Home
Content of source file org.apache.log4j.helpers.OptionConverter.java.res Press <TAB> to move from one error to the next
package org.apache.log4j.helpers;
import java.util.Properties;
import java.net.URL;
import org.apache.log4j.Level;
import org.apache.log4j.spi.Configurator;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.PropertyConfigurator;
public 
class OptionConverter
{
   
   static 
   String DELIM_START
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.DELIM_START   : Interval   0 :         . {  : . {         
   ="$ { "
   ;
   
   static 
   char DELIM_STOP
   //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.DELIM_STOP    : Interval   0 :           }  :  }          
   =' } '
   ;
   
   static 
   int DELIM_START_LEN
   //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.DELIM_START_LEN: Interval   0 :            2 : 2           
   =2
   ;
   
   static 
   int DELIM_STOP_LEN
   //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.DELIM_STOP_LEN: Interval   0 :            1 : 1           
   =1
   ;
   
   private 
   OptionConverter
   (
   )
   
   {
   }
   
   public static 
   String[]  concatanateArrays
   //QC   Intervals :(String[]) org.apache.log4j.helpers.OptionConverter.concatanateArrays: Interval   0 :         null null        
   //QC             :                                                                       Interval   1 :          new new         
   (
      String[]  l
      ,
      String[]  r
   )
   //QC   Intervals :(String[]) org.apache.log4j.helpers.OptionConverter.concatanateArrays.l: Interval   0 :         null null        
   //QC             :                                                                         Interval   1 :          new new         
   //QC   Intervals :(String[]) org.apache.log4j.helpers.OptionConverter.concatanateArrays.r: Interval   0 :         null null        
   //QC             :                                                                         Interval   1 :          new new         
   
   {
      int len=l.length+r.length;
      //QC-CWE476 or QCerrorNPE null pointer reference on l (see http://cwe.mitre.org/data/definitions/476.html)
      //QC-CWE476 or QCerrorNPE null pointer reference on r (see http://cwe.mitre.org/data/definitions/476.html)
      //QC-CWE190 and QCerrorOVF attention overflow + on l_length (-2147483647,2147483647) and r_length (-2147483647,2147483647) = -4294967294
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.concatanateArrays.len: Interval   0 :  -2147483647 : 2147483647  
      String[]  a=new String[len] ;
      //QC   Intervals :(String[]) org.apache.log4j.helpers.OptionConverter.concatanateArrays.a: Interval   0 :          new new         
      
      System.arraycopy(l,0,a,0,l.length);
      //QC   Intervals :  (Object) java.lang.System.arraycopy
1                           : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      //QC   Intervals :     (int) java.lang.System.arraycopy
2                           : Interval   0 :            0 : 0           
      //QC   Intervals :  (Object) java.lang.System.arraycopy
3                           : Interval   0 :          new new         
      //QC   Intervals :     (int) java.lang.System.arraycopy
4                           : Interval   0 :            0 : 0           
      //QC-CWE476 or QCerrorNPE null pointer reference on l (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :     (int) java.lang.System.arraycopy
5                           : Interval   0 :  -2147483647 : 2147483647  
      //type of the function/method : void
      
      System.arraycopy(r,0,a,l.length,r.length);
      //type of the function/method : void
      
      return a;
      //QC   Intervals :(String[]) org.apache.log4j.helpers.OptionConverter.concatanateArrays.return: Interval   0 :          new new         
   }
   
   public static 
   String convertSpecialChars
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.convertSpecialChars: Interval   0 :         null null        
   //QC             :                                                                         Interval   1 :          new new         
   (
      String s
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.s: Interval   0 :         null null        
   //QC             :                                                                           Interval   1 :          new new         
   
   {
      char c;
      //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :            A : z           
      int len=s.length();
      //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.len: Interval   0 :         null null        
      //QC             :                                                                             Interval   1 :          new new         
      StringBuffer sbuf=new StringBuffer(len);
      //QC   Intervals :(StringBuffer) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.sbuf: Interval   0 :          new new         
      int i=0;
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.i: Interval   0 :            0 : 0           
      
      while (i<len)
      //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.i
      //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.len
         {
            
            c=s.charAt(i++);
            //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
            //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
            //QC             :                                                                           Interval   1 :          new new         
            //assignation
            
            if (c=='\\')
               //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
               {
                  
                  c=s.charAt(i++);
                  //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
                  //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                  //QC             :                                                                           Interval   1 :          new new         
                  //assignation
                  
                  if (c=='n')
                     //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                     c='n';
                     //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :            n : n           
                     //assignation
                  else 
                     //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                     //QC             :                                                                           Interval   1 :          new new         
                     if (c=='r')
                        //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                        c='\r';
                        //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :           \r : \r          
                        //assignation
                     else 
                        //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                        //QC             :                                                                           Interval   1 :          new new         
                        if (c=='t')
                           //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                           c='\t';
                           //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :           \t : \t          
                           //assignation
                        else 
                           //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                           //QC             :                                                                           Interval   1 :          new new         
                           if (c=='f')
                              //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                              c='\f';
                              //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :           \f : \f          
                              //assignation
                           else 
                              //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                              //QC             :                                                                           Interval   1 :          new new         
                              if (c=='\b')
                                 //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                                 c='\b';
                                 //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :           \b : \b          
                                 //assignation
                              else 
                                 //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                                 //QC             :                                                                           Interval   1 :          new new         
                                 if (c=='\"')
                                    //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                                    c='\"';
                                    //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :           \" : \"          
                                    //assignation
                                 else 
                                    //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                                    //QC             :                                                                           Interval   1 :          new new         
                                    if (c=='\'')
                                       //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                                       c='\'';
                                       //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :            ' : '           
                                       //assignation
                                    else 
                                       //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :         null null        
                                       //QC             :                                                                           Interval   1 :          new new         
                                       if (c=='\\')
                                          //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (char)org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c
                                          c='\\';
                                          //QC   Intervals :    (char) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.c: Interval   0 :            \ : \           
                                          //assignation
               }
            
            sbuf.append(c);
            //type of the function/method : TypeInconnu
         }
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.i: Interval   0 :            0 : 0           
      //QC             :                                                                           Interval   1 :            1 : 1           
      //QC             :                                                                           Interval   2 :            2 : 2           
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.len: Interval   0 :         null null        
      //QC             :                                                                             Interval   1 :          new new         
      
      return sbuf.toString();
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.convertSpecialChars.return: Interval   0 :         null null        
      //QC             :                                                                                Interval   1 :          new new         
   }
   
   public static 
   String getSystemProperty
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty: Interval   0 :         null null        
   //QC             :                                                                       Interval   1 :          new new         
   (
      String key
      ,
      String def
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty.key: Interval   0 :         null null        
   //QC             :                                                                           Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty.def: Interval   0 :         null null        
   //QC             :                                                                           Interval   1 :          new new         
   
   {
      
      try 
      {
         
         return System.getProperty(key,def);
         //QC   Intervals :  (String) java.lang.System.getProperty
1                         : Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
         //QC   Intervals :  (String) java.lang.System.getProperty
2                         : Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty.return: Interval   0 :         null null        
         //QC             :                                                                              Interval   1 :          new new         
      }
      catch (
         Throwable e
      )
      //QC   Intervals :(Throwable) org.apache.log4j.helpers.OptionConverter.getSystemProperty.e: Interval   0 :         null null        
      //QC             :                                                                          Interval   1 :          new new         
      {
         
         LogLog.debug("Was not allowed to read system property \""+key+"\" . ");
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.debug
1                : Interval   0 : Was not allowed to read system property "null" .  : Was not allowed to read system property "null" . 
         //type of the function/method : void
         
         return def;
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty.return: Interval   0 :         null null        
         //QC             :                                                                              Interval   1 :          new new         
      }
   }
   
   public static 
   Object instantiateByKey
   //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByKey: Interval   0 :         null null        
   //QC             :                                                                      Interval   1 :          new new         
   (
      Properties props
      ,
      String key
      ,
      Class superClass
      ,
      Object defaultValue
   )
   //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.instantiateByKey.props: Interval   0 :         null null        
   //QC             :                                                                              Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByKey.key: Interval   0 :         null null        
   //QC             :                                                                          Interval   1 :          new new         
   //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.instantiateByKey.superClass: Interval   0 :         null null        
   //QC             :                                                                                 Interval   1 :          new new         
   //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByKey.defaultValue: Interval   0 :         null null        
   //QC             :                                                                                   Interval   1 :          new new         
   
   {
      String className=findAndSubst(key,props);
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst
1: Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.findAndSubst
2: Interval   0 :         null null        
      //QC             :                                                                      Interval   1 :          new new         
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByKey.className: Interval   0 :         null null        
      //QC             :                                                                                Interval   1 :          new new         
      
      if (className==null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByKey.className: Interval   0 :         null null        
         {
            
            LogLog.error("Could not find value for key "+key);
            //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 : Could not find value for key null : Could not find value for key null
            //QC             :                                                                    Interval   1 : Could not find value for key new : Could not find value for key new
            //type of the function/method : void
            
            return defaultValue;
            //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByKey.return: Interval   0 :         null null        
            //QC             :                                                                             Interval   1 :          new new         
         }
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByKey.className: Interval   0 :          new new         
      
      return OptionConverter.instantiateByClassName(className.trim(),superClass,defaultValue);
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.OptionConverter
1: Interval   0 :         null null        
      //QC             :                                                                       Interval   1 :          new new         
      //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.OptionConverter
2: Interval   0 :         null null        
      //QC             :                                                                       Interval   1 :          new new         
      //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.OptionConverter
3: Interval   0 :         null null        
      //QC             :                                                                       Interval   1 :          new new         
      //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByKey.return: Interval   0 :         null null        
      //QC             :                                                                             Interval   1 :          new new         
   }
   
   public static 
   boolean toBoolean
   //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean     : Interval   0 :        false true        
   (
      String value
      ,
      boolean dEfault
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toBoolean.value: Interval   0 :         null null        
   //QC             :                                                                     Interval   1 :          new new         
   //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean.dEfault: Interval   0 :        false true        
   
   {
      
      if (value==null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toBoolean.value: Interval   0 :         null null        
         return dEfault;
         //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean.return: Interval   0 :        false true        
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toBoolean.value: Interval   0 :          new new         
      String trimmedVal=value.trim();
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toBoolean.trimmedVal: Interval   0 :         null null        
      //QC             :                                                                          Interval   1 :          new new         
      
      if (String.valueOf("true").equalsIgnoreCase(trimmedVal))
         return true;
         //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean.return: Interval   0 :         true true        
      
      if (String.valueOf("false").equalsIgnoreCase(trimmedVal))
         return false;
         //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean.return: Interval   0 :        false false       
      
      return dEfault;
      //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.toBoolean.return: Interval   0 :        false true        
   }
   
   public static 
   int toInt
   //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toInt         : Interval   0 :  -2147483647 : 2147483647  
   (
      String value
      ,
      int dEfault
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toInt.value   : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toInt.dEfault : Interval   0 :  -2147483647 : 2147483647  
   
   {
      
      if (value!=null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toInt.value   : Interval   0 :          new new         
         {
            String s=value.trim();
            //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toInt.s       : Interval   0 :         null null        
            //QC             :                                                                    Interval   1 :          new new         
            
            try 
            {
               
               return Integer.valueOf(s).intValue();
               //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toInt.return  : Interval   0 :         null null        
               //QC             :                                                                    Interval   1 :          new new         
            }
            catch (
               NumberFormatException e
            )
            //QC   Intervals :(NumberFormatException) org.apache.log4j.helpers.OptionConverter.toInt.e       : Interval   0 :         null null        
            //QC             :                                                                                 Interval   1 :          new new         
            {
               
               LogLog.error(" [ "+s+" ]  is not in proper int form . ");
               //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 :    is not in proper int form .  :    is not in proper int form . 
               //type of the function/method : void
               
               e.printStackTrace();
               //QC-CWE476 or QCerrorNPE null pointer reference on e (see http://cwe.mitre.org/data/definitions/476.html)
               //type of the function/method : void;PrintWriter
               //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html)
            }
         }
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toInt.value   : Interval   0 :         null null        
      
      return dEfault;
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toInt.return  : Interval   0 :  -2147483647 : 2147483647  
   }
   
   public static 
   Level toLevel
   //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel       : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   (
      String value
      ,
      Level defaultValue
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.value : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.defaultValue: Interval   0 :         null null        
   //QC             :                                                                          Interval   1 :          new new         
   
   {
      
      if (value==null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.value : Interval   0 :         null null        
         return defaultValue;
         //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.return: Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.value : Interval   0 :          new new         
      
      value=value.trim();
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.value : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      //assignation
      int hashIndex=value.indexOf('#');
      //QC-CWE476 or QCerrorNPE null pointer reference on value (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toLevel.hashIndex: Interval   0 :         null null        
      //QC             :                                                                       Interval   1 :          new new         
      
      if (hashIndex==(-1))
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.toLevel.hashIndex
         {
            
            if (String.valueOf("NULL").equalsIgnoreCase(value))
               {
                  
                  return null ;
                  //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.return: Interval   0 :         null null        
               }
            else 
               {
                  
                  return (Level )Level.toLevel(value,defaultValue);
                  //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.return: Interval   0 :         null null        
                  //QC             :                                                                    Interval   1 :          new new         
               }
         }
      Level result=defaultValue;
      //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.result: Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      String clazz=value.substring(hashIndex+1);
      //QC-CWE476 or QCerrorNPE null pointer reference on value (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.clazz : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      String levelName=value.substring(0,hashIndex);
      //QC-CWE476 or QCerrorNPE null pointer reference on value (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toLevel.levelName: Interval   0 :         null null        
      //QC             :                                                                       Interval   1 :          new new         
      
      if (String.valueOf("NULL").equalsIgnoreCase(levelName))
         {
            
            return null ;
            //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.return: Interval   0 :         null null        
         }
      
      LogLog.debug("toLevel"+" : class =  [ "+clazz+" ] "+" : pri =  [ "+levelName+" ] ");
      //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.debug
1                : Interval   0 : toLevel : class =    : pri =    : toLevel : class =    : pri =   
      //type of the function/method : void
      
      try 
      {
         Class customLevel=Loader.loadClass(clazz);
         //QC   Intervals :  (String) org.apache.log4j.helpers.Loader
1                      : Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
         //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.toLevel.customLevel: Interval   0 :         null null        
         //QC             :                                                                         Interval   1 :          new new         
         Class[]  paramTypes=new Class[] {String.class ,org.apache.log4j.Level.class };
         //QC   Intervals : (Class[]) org.apache.log4j.helpers.OptionConverter.toLevel.paramTypes: Interval   0 :          new new         
         java.lang.reflect.Method toLevelMethod=customLevel.getMethod("toLevel",paramTypes);
         //QC   Intervals :  (String) java.lang.Class
1                                      : Interval   0 :      toLevel : toLevel     
         //QC   Intervals :   (Class) java.lang.Class
2                                      : Interval   0 :          new new         
         //QC-CWE476 or QCerrorNPE null pointer reference on customLevel (see http://cwe.mitre.org/data/definitions/476.html)
         //QC   Intervals :(java.lang.reflect.Method) org.apache.log4j.helpers.OptionConverter.toLevel.toLevelMethod: Interval   0 :         null null        
         //QC             :                                                                                           Interval   1 :          new new         
         Object[]  params=new Object[] {levelName,defaultValue};
         //QC   Intervals :(Object[]) org.apache.log4j.helpers.OptionConverter.toLevel.params: Interval   0 :          new new         
         Object o=toLevelMethod.invoke(null ,params);
         //QC   Intervals :  (Object) java.lang.reflect.Method
1                             : Interval   0 :         null null        
         //QC   Intervals :  (Object) java.lang.reflect.Method
2                             : Interval   0 :          new new         
         //QC-CWE476 or QCerrorNPE null pointer reference on toLevelMethod (see http://cwe.mitre.org/data/definitions/476.html)
         //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.toLevel.o     : Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
         
         result=(Level )o;
         //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.result: Interval   0 :         null null        
         //QC             :                                                                    Interval   1 :          new new         
         //assignation
      }
      catch (
         ClassNotFoundException e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("custom level class  [ "+clazz+" ]  not found . ");
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : custom level class    not found .  : custom level class    not found . 
         //type of the function/method : void
      }
      catch (
         NoSuchMethodException e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("custom level class  [ "+clazz+" ] "+" does not have a class function toLevel ( String ,  Level ) ",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : custom level class  ustom level class  [ null0 : custom level class  ustom level class  [ null0
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.warn
2                 : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
      }
      catch (
         java.lang.reflect.InvocationTargetException e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("custom level class  [ "+clazz+" ] "+" could not be instantiated",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : custom level class  ustom level class  [ null0 : custom level class  ustom level class  [ null0
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.warn
2                 : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
      }
      catch (
         ClassCastException e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("class  [ "+clazz+" ]  is not a subclass of org . apache . log4j . Level",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : class    is not a subclass of org . apache . log4j . Level : class    is not a subclass of org . apache . log4j . Level
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.warn
2                 : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
      }
      catch (
         IllegalAccessException e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("class  [ "+clazz+" ]  cannot be instantiated due to access restrictions",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : class    cannot be instantiated due to access restrictions : class    cannot be instantiated due to access restrictions
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.warn
2                 : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
      }
      catch (
         Exception e
      )
      //QC   Intervals :(ClassNotFoundException) org.apache.log4j.helpers.OptionConverter.toLevel.e     : Interval   0 :         null null        
      //QC             :                                                                                  Interval   1 :          new new         
      {
         
         LogLog.warn("class  [ "+clazz+" ]  ,  level  [ "+levelName+" ]  conversion failed . ",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.warn
1                 : Interval   0 : class    ,  level    ,  level    ,  level    ,  level  [ null ]  conversion failed .  : class    ,  level    ,  level    ,  level    ,  level  [ null ]  conversion failed . 
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.warn
2                 : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
      }
      
      return result;
      //QC   Intervals :   (Level) org.apache.log4j.helpers.OptionConverter.toLevel.return: Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
   }
   
   public static 
   long toFileSize
   //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize    : Interval   0 : -9.2233720368548E+18 : 9.2233720368548E+18
   (
      String value
      ,
      long dEfault
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.value: Interval   0 :         null null        
   //QC             :                                                                      Interval   1 :          new new         
   //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.dEfault: Interval   0 : -9.2233720368548E+18 : 9.2233720368548E+18
   
   {
      
      if (value==null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.value: Interval   0 :         null null        
         return dEfault;
         //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.return: Interval   0 : -9.2233720368548E+18 : 9.2233720368548E+18
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.value: Interval   0 :          new new         
      String s=value.trim().toUpperCase();
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      long multiplier=1;
      //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.multiplier: Interval   0 :            1 : 1           
      int index;
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toFileSize.index: Interval   0 :  -2147483647 : 2147483647  
      
      if ((index=s.indexOf("KB"))!=(-1))
         //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
         //QC-CWE481 Assigning instead of comparing on index=s.indexOf("KB") (see http://cwe.mitre.org/data/definitions/481.html)
         //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
         //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toFileSize.index: Interval   0 :         null null        
         //QC             :                                                                      Interval   1 :          new new         
         //QC   Intervals :(TypeInconnu) s.indexOf                                              : Interval   0 :         null null        
         //QC             :                                                                       Interval   1 :          new new         
         {
            
            multiplier=1024;
            //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.multiplier: Interval   0 :         1024 : 1024        
            //assignation
            
            s=s.substring(0,index);
            //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :         null null        
            //QC             :                                                                    Interval   1 :          new new         
            //assignation
         }
      else 
         //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.toFileSize.index
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (TypeInconnu)s.indexOf
         if ((index=s.indexOf("MB"))!=(-1))
            //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
            //QC-CWE481 Assigning instead of comparing on index=s.indexOf("MB") (see http://cwe.mitre.org/data/definitions/481.html)
            //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
            //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toFileSize.index: Interval   0 :          new new         
            //QC   Intervals :(TypeInconnu) s.indexOf                                              : Interval   0 :          new new         
            {
               
               multiplier=(1024*1024);
               //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.multiplier: Interval   0 :      1048576 : 1048576     
               //assignation
               
               s=s.substring(0,index);
               //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :         null null        
               //QC             :                                                                    Interval   1 :          new new         
               //assignation
            }
         else 
            //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
            //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.toFileSize.index
            //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (TypeInconnu)s.indexOf
            if ((index=s.indexOf("GB"))!=(-1))
               //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
               //QC-CWE481 Assigning instead of comparing on index=s.indexOf("GB") (see http://cwe.mitre.org/data/definitions/481.html)
               //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
               //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.toFileSize.index: Interval   0 :          new new         
               //QC   Intervals :(TypeInconnu) s.indexOf                                              : Interval   0 :          new new         
               {
                  
                  multiplier=(1024*(1024*1024));
                  //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.multiplier: Interval   0 :   1073741824 : 1073741824  
                  //assignation
                  
                  s=s.substring(0,index);
                  //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :         null null        
                  //QC             :                                                                    Interval   1 :          new new         
                  //assignation
               }
      
      if (s!=null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :          new new         
         {
            
            try 
            {
               
               return Long.valueOf(s).longValue()*multiplier;
               //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.return: Interval   0 :            0 : 0           
            }
            catch (
               NumberFormatException e
            )
            //QC   Intervals :(NumberFormatException) org.apache.log4j.helpers.OptionConverter.toFileSize.e  : Interval   0 :         null null        
            //QC             :                                                                                 Interval   1 :          new new         
            {
               
               LogLog.error(" [ "+s+" ]  is not in proper int form . ");
               //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 :    is not in proper int form .  :    is not in proper int form . 
               //type of the function/method : void
               
               LogLog.error(" [ "+value+" ]  not in expected format . ",e);
               //type of the function/method : void
            }
         }
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.toFileSize.s  : Interval   0 :         null null        
      
      return dEfault;
      //QC   Intervals :    (long) org.apache.log4j.helpers.OptionConverter.toFileSize.return: Interval   0 : -9.2233720368548E+18 : 9.2233720368548E+18
   }
   
   public static 
   String findAndSubst
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst  : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   (
      String key
      ,
      Properties props
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.key: Interval   0 :         null null        
   //QC             :                                                                      Interval   1 :          new new         
   //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.findAndSubst.props: Interval   0 :         null null        
   //QC             :                                                                          Interval   1 :          new new         
   
   {
      String value=props.getProperty(key);
      //QC   Intervals :  (String) java.util.Properties.getProperty
1                     : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      //QC-CWE476 or QCerrorNPE null pointer reference on props (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.value: Interval   0 :         null null        
      //QC             :                                                                        Interval   1 :          new new         
      
      if (value==null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.value: Interval   0 :         null null        
         return null ;
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.return: Interval   0 :         null null        
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.value: Interval   0 :          new new         
      
      try 
      {
         
         return substVars(value,props);
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars
1   : Interval   0 :          new new         
         //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.substVars
2   : Interval   0 :         null null        
         //QC             :                                                                      Interval   1 :          new new         
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.return: Interval   0 :         null null        
         //QC             :                                                                         Interval   1 :          new new         
      }
      catch (
         IllegalArgumentException e
      )
      //QC   Intervals :(IllegalArgumentException) org.apache.log4j.helpers.OptionConverter.findAndSubst.e: Interval   0 :         null null        
      //QC             :                                                                                    Interval   1 :          new new         
      {
         
         LogLog.error("Bad option value  [ "+value+" ]  . ",e);
         //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 : Bad option value    .  : Bad option value    . 
         //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.error
2                : Interval   0 :         null null        
         //QC             :                                                                     Interval   1 :          new new         
         //type of the function/method : void
         
         return value;
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.findAndSubst.return: Interval   0 :          new new         
      }
   }
   
   public static 
   Object instantiateByClassName
   //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByClassName: Interval   0 :         null null        
   //QC             :                                                                            Interval   1 :          new new         
   (
      String className
      ,
      Class superClass
      ,
      Object defaultValue
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.className: Interval   0 :         null null        
   //QC             :                                                                                      Interval   1 :          new new         
   //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.superClass: Interval   0 :         null null        
   //QC             :                                                                                       Interval   1 :          new new         
   //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.defaultValue: Interval   0 :         null null        
   //QC             :                                                                                         Interval   1 :          new new         
   
   {
      
      if (className!=null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.className: Interval   0 :          new new         
         {
            
            try 
            {
               Class classObj=Loader.loadClass(className);
               //QC   Intervals :  (String) org.apache.log4j.helpers.Loader
1                      : Interval   0 :          new new         
               //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.classObj: Interval   0 :         null null        
               //QC             :                                                                                     Interval   1 :          new new         
               
               if (!superClass.isAssignableFrom(classObj))
                  //QC   Intervals :   (Class) java.lang.Class.isAssignableFrom
1                     : Interval   0 :         null null        
                  //QC             :                                                                    Interval   1 :          new new         
                  //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
                  //QC   Intervals : (boolean) java.lang.Class.isAssignableFrom
                      : Interval   0 :        false false       
                  {
                     
                     LogLog.error("A \""+className+"\" object is not assignable to a \""+superClass.getName()+"\" variable . ");
                     //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
                     //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 : A "new" object is not assignable to a "null" variable .  : A "new" object is not assignable to a "null" variable . 
                     //type of the function/method : void
                     
                     LogLog.error("The class \""+superClass.getName()+"\" was loaded by ");
                     //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
                     //type of the function/method : void
                     
                     LogLog.error(" [ "+superClass.getClassLoader()+" ]  whereas object of type ");
                     //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
                     //type of the function/method : void
                     
                     LogLog.error("\""+classObj.getName()+"\" was loaded by  [ "+classObj.getClassLoader()+" ]  . ");
                     //QC-CWE476 or QCerrorNPE null pointer reference on classObj (see http://cwe.mitre.org/data/definitions/476.html)
                     //type of the function/method : void
                     
                     return defaultValue;
                     //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.return: Interval   0 :         null null        
                     //QC             :                                                                                   Interval   1 :          new new         
                  }
               //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
               //QC   Intervals : (boolean) java.lang.Class.isAssignableFrom
                      : Interval   0 :         true true        
               
               return classObj.newInstance();
               //QC-CWE476 or QCerrorNPE null pointer reference on classObj (see http://cwe.mitre.org/data/definitions/476.html)
               //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.return: Interval   0 :         null null        
               //QC             :                                                                                   Interval   1 :          new new         
            }
            catch (
               Exception e
            )
            //QC   Intervals :(Exception) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.e: Interval   0 :         null null        
            //QC             :                                                                               Interval   1 :          new new         
            {
               
               LogLog.error("Could not instantiate class  [ "+className+" ]  . ",e);
               //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 : Could not instantiate class    .  : Could not instantiate class    . 
               //QC   Intervals :(Throwable) org.apache.log4j.helpers.LogLog.error
2                : Interval   0 :         null null        
               //QC             :                                                                     Interval   1 :          new new         
               //type of the function/method : void
            }
         }
      //QC-CWE476 or QCerrorNPE null pointer reference on superClass (see http://cwe.mitre.org/data/definitions/476.html)
      
      return defaultValue;
      //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.instantiateByClassName.return: Interval   0 :         null null        
      //QC             :                                                                                   Interval   1 :          new new         
   }
   
   public static 
   String substVars
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars     : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   (
      String val
      ,
      Properties props
   )
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.val : Interval   0 :         null null        
   //QC             :                                                                    Interval   1 :          new new         
   //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.substVars.props: Interval   0 :         null null        
   //QC             :                                                                       Interval   1 :          new new         
   throws IllegalArgumentException
   {
      StringBuffer sbuf=new StringBuffer();
      //QC   Intervals :(StringBuffer) org.apache.log4j.helpers.OptionConverter.substVars.sbuf: Interval   0 :          new new         
      int i=0;
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.i   : Interval   0 :            0 : 0           
      int j,k;
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.j   : Interval   0 :  -2147483647 : 2147483647  
      //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.k   : Interval   0 :  -2147483647 : 2147483647  
      
      while (true)
         {
            
            j=val.indexOf(DELIM_START,i);
            //QC-CWE476 or QCerrorNPE null pointer reference on val (see http://cwe.mitre.org/data/definitions/476.html)
            //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.j   : Interval   0 :         null null        
            //QC             :                                                                    Interval   1 :          new new         
            //assignation
            
            if (j==(-1))
               //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.substVars.j
               {
                  
                  if (i==0)
                     //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.i   : Interval   0 :            0 : 0           
                     {
                        
                        return val;
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.return: Interval   0 :         null null        
                        //QC             :                                                                      Interval   1 :          new new         
                     }
                  else 
                     //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.substVars.i
                     {
                        
                        sbuf.append(val.substring(i,val.length()));
                        //type of the function/method : TypeInconnu
                        
                        return sbuf.toString();
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.return: Interval   0 :         null null        
                        //QC             :                                                                      Interval   1 :          new new         
                     }
                  //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.substVars.i
               }
            else 
               //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.j   : Interval   0 :         null null        
               //QC             :                                                                    Interval   1 :          new new         
               {
                  
                  sbuf.append(val.substring(i,j));
                  //type of the function/method : TypeInconnu
                  
                  k=val.indexOf(DELIM_STOP,j);
                  //QC-CWE476 or QCerrorNPE null pointer reference on val (see http://cwe.mitre.org/data/definitions/476.html)
                  //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.k   : Interval   0 :         null null        
                  //QC             :                                                                    Interval   1 :          new new         
                  //assignation
                  
                  if (k==(-1))
                     //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (int)org.apache.log4j.helpers.OptionConverter.substVars.k
                     {
                        
                        throw new IllegalArgumentException('"'+(val+("\" has no closing brace .  Opening brace at position "+(j+' . '))));
                     }
                  else 
                     //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.k   : Interval   0 :         null null        
                     //QC             :                                                                    Interval   1 :          new new         
                     {
                        
                        j+=DELIM_START_LEN;
                        //QC-CWE476 or QCerrorNPE null pointer reference on DELIM.START (see http://cwe.mitre.org/data/definitions/476.html)
                        //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.j   : Interval   0 :            2 : 2           
                        //assignation
                        String key=val.substring(j,k);
                        //QC-CWE476 or QCerrorNPE null pointer reference on val (see http://cwe.mitre.org/data/definitions/476.html)
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.key : Interval   0 :         null null        
                        //QC             :                                                                    Interval   1 :          new new         
                        String replacement=getSystemProperty(key,null );
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty
1: Interval   0 :         null null        
                        //QC             :                                                                         Interval   1 :          new new         
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.getSystemProperty
2: Interval   0 :         null null        
                        //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.replacement: Interval   0 :         null null        
                        //QC             :                                                                           Interval   1 :          new new         
                        
                        if ((replacement==null )&&(props!=null ))
                           //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.replacement: Interval   0 :         null null        
                           //QC   Intervals :(Properties) org.apache.log4j.helpers.OptionConverter.substVars.props: Interval   0 :          new new         
                           {
                              
                              replacement=props.getProperty(key);
                              //QC   Intervals :  (String) java.util.Properties.getProperty
1                     : Interval   0 :         null null        
                              //QC             :                                                                    Interval   1 :          new new         
                              //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.replacement: Interval   0 :         null null        
                              //QC             :                                                                           Interval   1 :          new new         
                              //assignation
                           }
                        
                        if (replacement!=null )
                           //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.replacement: Interval   0 :          new new         
                           {
                              String recursiveReplacement=substVars(replacement,props);
                              //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.substVars.recursiveReplacement: Interval   0 :         null null        
                              //QC             :                                                                                    Interval   1 :          new new         
                              
                              sbuf.append(recursiveReplacement);
                              //type of the function/method : TypeInconnu
                           }
                        
                        i=(k+DELIM_STOP_LEN);
                        //QC   Intervals :     (int) org.apache.log4j.helpers.OptionConverter.substVars.i   : Interval   0 :            1 : 1           
                        //assignation
                     }
               }
         }
   }
   
   static public 
   void  selectAndConfigure
   (
      URL url
      ,
      String clazz
      ,
      LoggerRepository hierarchy
   )
   //QC   Intervals :     (URL) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.url: Interval   0 :         null null        
   //QC             :                                                                            Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.clazz: Interval   0 :         null null        
   //QC             :                                                                              Interval   1 :          new new         
   //QC   Intervals :(LoggerRepository) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.hierarchy: Interval   0 :         null null        
   //QC             :                                                                                          Interval   1 :          new new         
   
   {
      Configurator configurator=null ;
      //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :         null null        
      String filename=url.getFile();
      //QC-CWE476 or QCerrorNPE null pointer reference on url (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.filename: Interval   0 :         null null        
      //QC             :                                                                                 Interval   1 :          new new         
      
      if ((clazz==null )&&((filename!=null )&&filename.endsWith(" . xml")))
         //QC-CWE476 or QCerrorNPE null pointer reference on filename (see http://cwe.mitre.org/data/definitions/476.html)
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (String)org.apache.log4j.helpers.OptionConverter.selectAndConfigure.clazz
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (String)org.apache.log4j.helpers.OptionConverter.selectAndConfigure.filename
         //QC-CWE570 and QCerrorCNT Condition NEVER true : no interval for variable (TypeInconnu)filename.endsWith
         {
            
            clazz="org . apache . log4j . xml . DOMConfigurator";
            //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.clazz: Interval   0 : org . apache . log4j . xml . DOMConfigurator : org . apache . log4j . xml . DOMConfigurator
            //assignation
         }
      
      if (clazz!=null )
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.clazz: Interval   0 :          new new         
         //QC             :                                                                              Interval   1 : org . apache . log4j . xml . DOMConfigurator : org . apache . log4j . xml . DOMConfigurator
         {
            
            LogLog.debug("Preferred configurator class :  "+clazz);
            //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.debug
1                : Interval   0 : Preferred configurator class :  new : Preferred configurator class :  new
            //QC             :                                                                    Interval   1 : Preferred configurator class :  org . apache . log4j . xml . DOMConfigurator : Preferred configurator class :  org . apache . log4j . xml . DOMConfigurator
            //type of the function/method : void
            
            configurator=(Configurator )instantiateByClassName(clazz,Configurator.class ,null );
            //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure
1: Interval   0 :          new new         
            //QC             :                                                                          Interval   1 : org . apache . log4j . xml . DOMConfigurator : org . apache . log4j . xml . DOMConfigurator
            //QC   Intervals :   (Class) org.apache.log4j.helpers.OptionConverter.selectAndConfigure
2: Interval   0 :         null null        
            //QC             :                                                                          Interval   1 :          new new         
            //QC   Intervals :  (Object) org.apache.log4j.helpers.OptionConverter.selectAndConfigure
3: Interval   0 :         null null        
            //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :         null null        
            //QC             :                                                                                         Interval   1 :          new new         
            //assignation
            
            if (configurator==null )
               //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :         null null        
               {
                  
                  LogLog.error("Could not instantiate configurator  [ "+clazz+" ]  . ");
                  //QC   Intervals :  (String) org.apache.log4j.helpers.LogLog.error
1                : Interval   0 : Could not instantiate configurator    .  : Could not instantiate configurator    . 
                  //type of the function/method : void
                  
                  return ;
                  //QC   Intervals : (boolean) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.selectAndConfigure.return: Interval   0 :         true true        
               }
            //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :          new new         
         }
      else 
         //QC   Intervals :  (String) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.clazz: Interval   0 :         null null        
         {
            
            configurator=(new PropertyConfigurator());
            //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :          new new         
            //assignation
         }
      //QC   Intervals :(Configurator) org.apache.log4j.helpers.OptionConverter.selectAndConfigure.configurator: Interval   0 :          new new         
      
      configurator.doConfigure(url,hierarchy);
      //QC   Intervals :     (URL) org.apache.log4j.spi.Configurator.doConfigure
1        : Interval   0 :         null null        
      //QC             :                                                                    Interval   1 :          new new         
      //QC   Intervals :(LoggerRepository) org.apache.log4j.spi.Configurator.doConfigure
2        : Interval   0 :         null null        
      //QC             :                                                                            Interval   1 :          new new         
      //type of the function/method : void
   }
   
}