Home
Content of source file org.apache.log4j.xml.Log4jEntityResolver.java.res Press <TAB> to move from one error to the next
package org.apache.log4j.xml;
import org.apache.log4j.helpers.LogLog;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
public 
class Log4jEntityResolver
implements EntityResolver 
{
   
   public 
   InputSource resolveEntity
   //QC   Intervals :(InputSource) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity : Interval   0 :         null null        
   //QC             :                                                                       Interval   1 :          new new         
   (
      String publicId
      ,
      String systemId
   )
   //QC   Intervals :  (String) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.publicId: Interval   0 :         null null        
   //QC             :                                                                            Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.systemId: Interval   0 :         null null        
   //QC             :                                                                            Interval   1 :          new new         
   
   {
      
      if (systemId.endsWith("log4j . dtd"))
         //QC-CWE476 or QCerrorNPE null pointer reference on systemId (see http://cwe.mitre.org/data/definitions/476.html)
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (TypeInconnu)systemId.endsWith
         {
            Class clazz=getClass();
            //QC   Intervals :   (Class) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.clazz: Interval   0 :         null null        
            //QC             :                                                                         Interval   1 :          new new         
            InputStream in=clazz.getResourceAsStream(" / org / apache / log4j / xml / log4j . dtd");
            //QC   Intervals :  (String) java.lang.Class
1                                      : Interval   0 :  / org / apache / log4j / xml / log4j . dtd :  / org / apache / log4j / xml / log4j . dtd
            //QC-CWE476 or QCerrorNPE null pointer reference on clazz (see http://cwe.mitre.org/data/definitions/476.html)
            //QC   Intervals :(InputStream) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.in: Interval   0 :         null null        
            //QC             :                                                                         Interval   1 :          new new         
            
            if (in==null )
               //QC   Intervals :(InputStream) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.in: Interval   0 :         null null        
               {
                  
                  LogLog.warn("Could not find  [ log4j . dtd ]  using  [ "+clazz.getClassLoader()+" ]  class loader ,  parsed without DTD . ");
                  //QC-CWE476 or QCerrorNPE null pointer reference on clazz (see http://cwe.mitre.org/data/definitions/476.html)
                  //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 :            0 : 0           
                  //type of the function/method : void
                  
                  in=(new ByteArrayInputStream(new byte[0] ));
                  //QC   Intervals :(InputStream) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.in: Interval   0 :          new new         
                  //assignation
               }
            
            return new InputSource(in);
            //QC   Intervals :(InputSource) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.return: Interval   0 :          new new         
         }
      else 
         //QC-CWE476 or QCerrorNPE null pointer reference on systemId (see http://cwe.mitre.org/data/definitions/476.html)
         //QC   Intervals :(TypeInconnu) systemId.endsWith                                      : Interval   0 :         null null        
         //QC             :                                                                       Interval   1 :          new new         
         {
            
            return null ;
            //QC   Intervals :(InputSource) org.apache.log4j.xml.Log4jEntityResolver.resolveEntity.return: Interval   0 :         null null        
         }
   }
   
}