| package org.apache.log4j.or; |
| import org.apache.log4j.Layout; |
| public |
| class ThreadGroupRenderer |
| implements ObjectRenderer |
| { |
| public |
| ThreadGroupRenderer |
| ( |
| ) |
| { |
| } |
| public |
| String doRender |
| //QC Intervals : (String) org.apache.log4j.or.ThreadGroupRenderer.doRender : Interval 0 : null : null |
| //QC : Interval 1 : new : new |
| ( |
| Object o |
| ) |
| //QC Intervals : (Object) org.apache.log4j.or.ThreadGroupRenderer.doRender.o : Interval 0 : null : null |
| //QC : Interval 1 : new : new |
| { |
| if (o instanceof ThreadGroup ) |
| //QC Intervals : (boolean) instanceof : Interval 0 : true : true |
| { |
| StringBuffer sbuf=new StringBuffer(); |
| //QC Intervals :(StringBuffer) org.apache.log4j.or.ThreadGroupRenderer.doRender.sbuf : Interval 0 : new : new |
| ThreadGroup tg=(ThreadGroup )o; |
| //QC Intervals :(ThreadGroup) org.apache.log4j.or.ThreadGroupRenderer.doRender.tg : Interval 0 : null : null |
| //QC : Interval 1 : new : new |
| sbuf.append("java . lang . ThreadGroup [ name = "); |
| //type of the function/method : TypeInconnu |
| sbuf.append(tg.getName()); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" , maxpri = "); |
| //type of the function/method : TypeInconnu |
| sbuf.append(tg.getMaxPriority()); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" ] "); |
| //type of the function/method : TypeInconnu |
| Thread[] t=new Thread[tg.activeCount()] ; |
| //QC Intervals :(Thread[]) org.apache.log4j.or.ThreadGroupRenderer.doRender.t : Interval 0 : new : new |
| tg.enumerate(t); |
| //QC Intervals : (Thread) java.lang.ThreadGroup.enumerate |
| 1 : Interval 0 : new : new |
| //QC-CWE476 or QCerrorNPE null pointer reference on tg (see http://cwe.mitre.org/data/definitions/476.html) |
| //type of the function/method : int |
| //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html) |
| for ( |
| int i |
| //QC Intervals : (int) org.apache.log4j.or.ThreadGroupRenderer.doRender.i : Interval 0 : 0 : 0 |
| =0; |
| i<t.length; |
| i++ |
| ) |
| { |
| sbuf.append(Layout.LINE_SEP); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" Thread = [ "); |
| //type of the function/method : TypeInconnu |
| sbuf.append(t[i] .getName()); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" , "); |
| //type of the function/method : TypeInconnu |
| sbuf.append(t[i] .getPriority()); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" , "); |
| //type of the function/method : TypeInconnu |
| sbuf.append(t[i] .isDaemon()); |
| //type of the function/method : TypeInconnu |
| sbuf.append(" ] "); |
| //type of the function/method : TypeInconnu |
| } |
| return sbuf.toString(); |
| //QC Intervals : (String) org.apache.log4j.or.ThreadGroupRenderer.doRender.return: Interval 0 : null : null |
| //QC : Interval 1 : new : new |
| } |
| else |
| //QC Intervals : (boolean) instanceof : Interval 0 : false : false |
| { |
| return o.toString(); |
| //QC-CWE476 or QCerrorNPE null pointer reference on o (see http://cwe.mitre.org/data/definitions/476.html) |
| //QC Intervals : (String) org.apache.log4j.or.ThreadGroupRenderer.doRender.return: Interval 0 : null : null |
| //QC : Interval 1 : new : new |
| } |
| //QC Intervals : (boolean) instanceof : Interval 0 : false : false |
| } |
| } |