Program: 90611
Project: 90611
Buggy source:
/** 
 * Processes the portlet deployment descriptor represented by the given input stream. <p> The data is merged into an existing configuration data structure if one is provided. This capability is used by version 3 portlets for merging config data from the files into config data that has been read from annotations. <p> If no existing configuration data is provides, or if a version 1.0 or version 2.0 deployment descriptor is being processed, a new configuration data structure is created. <p> The class also performs validity checking and throws exceptions for invalid data. To maintain compatibility with the earlier Pluto implementation, an <code>IllegalArgumentException</code> is thrown in such cases.
 * @param stream Input stream pointing to deployment descriptor
 * @return The resulting portlet application definition
 * @throws IOException If an I/O error occurs
 * @throws IllegalArgumentException If data validation fails
 * @throws XMLStreamException 
 */
public void processPortletDD(InputStream stream) throws IOException, IllegalArgumentException, JAXBException, XMLStreamException {
  if (isDebug) {
    StringBuilder txt=new StringBuilder(128);
    txt.append("String_Node_Str");
    ClassLoader mycl=this.getClass().getClassLoader();
    ClassLoader jaxbcl=JAXBContext.class.getClassLoader();
    ClassLoader ofcl=org.apache.pluto.container.om.portlet20.impl.ObjectFactory.class.getClassLoader();
    ClassLoader syscl=null;
    try {
      syscl=ClassLoader.getSystemClassLoader();
    }
 catch (    Exception e) {
    }
    txt.append("String_Node_Str").append((mycl != null) ? mycl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((jaxbcl != null) ? jaxbcl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((ofcl != null) ? ofcl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((syscl != null) ? syscl.toString() : "String_Node_Str");
    Class<?> myof=null;
    Class<?> jaxbof=null;
    Class<?> ofof=null;
    Class<?> sysof=null;
    String clsName="String_Node_Str";
    try {
      myof=mycl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      jaxbof=jaxbcl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      ofof=ofcl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      sysof=syscl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    txt.append("String_Node_Str").append(clsName);
    txt.append("String_Node_Str").append(myof != null);
    txt.append("String_Node_Str").append(jaxbof != null);
    txt.append("String_Node_Str").append(ofof != null);
    txt.append("String_Node_Str").append(sysof != null);
    LOG.debug(txt.toString());
  }
  ClassLoader mycl=this.getClass().getClassLoader();
  JAXBContext cntxt=JAXBContext.newInstance(JAXB_CONTEXT,mycl);
  Unmarshaller um=cntxt.createUnmarshaller();
  XMLInputFactory xif=XMLInputFactory.newFactory();
  XMLStreamReader xsr=xif.createXMLStreamReader(stream);
  JAXBElement<?> jel=(JAXBElement<?>)um.unmarshal(xsr);
  if (jel == null) {
    String warning="String_Node_Str";
    LOG.warn(warning);
    throw new IOException(warning);
  }
  if (isDebug) {
    StringBuilder txt=new StringBuilder();
    txt.append("String_Node_Str");
    txt.append(jel.getValue().getClass().getCanonicalName());
    LOG.debug(txt.toString());
  }
  if (jel.getValue() instanceof org.apache.pluto.container.om.portlet10.impl.PortletAppType) {
    pad=new PortletApplicationDefinitionImpl();
    jcp=new JSR168ConfigurationProcessor();
  }
 else   if (jel.getValue() instanceof org.apache.pluto.container.om.portlet20.impl.PortletAppType) {
    pad=new PortletApplicationDefinitionImpl();
    jcp=new JSR286ConfigurationProcessor();
  }
 else   if (jel.getValue() instanceof org.apache.pluto.container.om.portlet30.impl.PortletAppType) {
    if (pad == null) {
      pad=new PortletApplicationDefinitionImpl();
    }
    jcp=new JSR362ConfigurationProcessor();
  }
 else {
    String warning="String_Node_Str" + jel.getValue().getClass().getCanonicalName();
    LOG.warn(warning);
    throw new IOException(warning);
  }
  pad=jcp.process(jel);
}

Fixed version (ground truth):
/** 
 * Processes the portlet deployment descriptor represented by the given input stream. <p> The data is merged into an existing configuration data structure if one is provided. This capability is used by version 3 portlets for merging config data from the files into config data that has been read from annotations. <p> If no existing configuration data is provides, or if a version 1.0 or version 2.0 deployment descriptor is being processed, a new configuration data structure is created. <p> The class also performs validity checking and throws exceptions for invalid data. To maintain compatibility with the earlier Pluto implementation, an <code>IllegalArgumentException</code> is thrown in such cases.
 * @param stream Input stream pointing to deployment descriptor
 * @return The resulting portlet application definition
 * @throws IOException If an I/O error occurs
 * @throws IllegalArgumentException If data validation fails
 * @throws XMLStreamException 
 */
public void processPortletDD(InputStream stream) throws IOException, IllegalArgumentException, JAXBException, XMLStreamException {
  if (isDebug) {
    StringBuilder txt=new StringBuilder(128);
    txt.append("String_Node_Str");
    ClassLoader mycl=this.getClass().getClassLoader();
    ClassLoader jaxbcl=JAXBContext.class.getClassLoader();
    ClassLoader ofcl=org.apache.pluto.container.om.portlet20.impl.ObjectFactory.class.getClassLoader();
    ClassLoader syscl=null;
    try {
      syscl=ClassLoader.getSystemClassLoader();
    }
 catch (    Exception e) {
    }
    txt.append("String_Node_Str").append((mycl != null) ? mycl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((jaxbcl != null) ? jaxbcl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((ofcl != null) ? ofcl.toString() : "String_Node_Str");
    txt.append("String_Node_Str").append((syscl != null) ? syscl.toString() : "String_Node_Str");
    Class<?> myof=null;
    Class<?> jaxbof=null;
    Class<?> ofof=null;
    Class<?> sysof=null;
    String clsName="String_Node_Str";
    try {
      myof=mycl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      jaxbof=jaxbcl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      ofof=ofcl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    try {
      sysof=syscl.loadClass(clsName);
    }
 catch (    Exception e) {
    }
    txt.append("String_Node_Str").append(clsName);
    txt.append("String_Node_Str").append(myof != null);
    txt.append("String_Node_Str").append(jaxbof != null);
    txt.append("String_Node_Str").append(ofof != null);
    txt.append("String_Node_Str").append(sysof != null);
    LOG.debug(txt.toString());
  }
  ClassLoader mycl=this.getClass().getClassLoader();
  JAXBContext cntxt=JAXBContext.newInstance(JAXB_CONTEXT,mycl);
  Unmarshaller um=cntxt.createUnmarshaller();
  XMLInputFactory xif=XMLInputFactory.newFactory();
  XMLStreamReader xsr=xif.createXMLStreamReader(stream);
  JAXBElement<?> jel=(JAXBElement<?>)um.unmarshal(xsr);
  if (jel == null) {
    String warning="String_Node_Str";
    LOG.warn(warning);
    throw new IOException(warning);
  }
  if (isDebug) {
    StringBuilder txt=new StringBuilder();
    txt.append("String_Node_Str");
    txt.append(jel.getValue().getClass().getCanonicalName());
    LOG.debug(txt.toString());
  }
  if (jel.getValue() instanceof org.apache.pluto.container.om.portlet10.impl.PortletAppType) {
    pad=new PortletApplicationDefinitionImpl();
    jcp=new JSR168ConfigurationProcessor();
  }
 else   if (jel.getValue() instanceof org.apache.pluto.container.om.portlet20.impl.PortletAppType) {
    pad=new PortletApplicationDefinitionImpl();
    jcp=new JSR286ConfigurationProcessor();
  }
 else   if (jel.getValue() instanceof org.apache.pluto.container.om.portlet30.impl.PortletAppType) {
    if (pad == null) {
      pad=new PortletApplicationDefinitionImpl();
    }
    jcp=new JSR362ConfigurationProcessor();
  }
 else {
    String warning="String_Node_Str" + jel.getValue().getClass().getCanonicalName();
    LOG.warn(warning);
    throw new IOException(warning);
  }
  pad=jcp.process(jel);
  if (isDebug) {
    StringBuilder txt=new StringBuilder(128);
    txt.append("String_Node_Str").append(pad.getName());
    txt.append("String_Node_Str").append(pad.getPortlets().size());
    txt.append("String_Node_Str");
    String sep="String_Node_Str";
    for (    PortletDefinition pd : pad.getPortlets()) {
      txt.append(sep).append(pd.getPortletName());
      sep="String_Node_Str";
    }
    LOG.debug(txt.toString());
  }
}