Files
codeql/java/ql/test/library-tests/logging/Test.java
2021-11-03 10:35:38 +01:00

169 lines
5.6 KiB
Java

package generatedtest;
import java.util.logging.LogRecord;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.EntryMessage;
import org.apache.logging.log4j.message.Message;
import org.slf4j.spi.LoggingEventBuilder;
// Test case generated by GenerateFlowTestCase.ql
public class Test {
Object source() {
return null;
}
void sink(Object o) {}
public void test() throws Exception {
{
// "java.util.logging;LogRecord;false;LogRecord;;;Argument[1];Argument[-1];taint"
LogRecord out = null;
String in = (String) source();
out = new LogRecord(null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(Message);;Argument[0];ReturnValue;taint"
EntryMessage out = null;
Message in = (Message) source();
Logger instance = null;
out = instance.traceEntry(in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint"
EntryMessage out = null;
Object[] in = (Object[]) source();
Logger instance = null;
out = instance.traceEntry((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Object[]);;Argument[0..1];ReturnValue;taint"
EntryMessage out = null;
String in = (String) source();
Logger instance = null;
out = instance.traceEntry(in, (Object[]) null);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint"
EntryMessage out = null;
String in = (String) source();
Logger instance = null;
out = instance.traceEntry(in, (org.apache.logging.log4j.util.Supplier[]) null);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(String,Supplier[]);;Argument[0..1];ReturnValue;taint"
EntryMessage out = null;
org.apache.logging.log4j.util.Supplier[] in =
(org.apache.logging.log4j.util.Supplier[]) source();
Logger instance = null;
out = instance.traceEntry((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceEntry;(Supplier[]);;Argument[0];ReturnValue;taint"
EntryMessage out = null;
org.apache.logging.log4j.util.Supplier[] in =
(org.apache.logging.log4j.util.Supplier[]) source();
Logger instance = null;
out = instance.traceEntry(in);
sink(out); // $ hasTaintFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(EntryMessage,Object);;Argument[1];ReturnValue;value"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((EntryMessage) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(Message,Object);;Argument[1];ReturnValue;value"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((Message) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(Object);;Argument[0];ReturnValue;value"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit(in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.logging.log4j;Logger;true;traceExit;(String,Object);;Argument[1];ReturnValue;value"
Object out = null;
Object in = (Object) source();
Logger instance = null;
out = instance.traceExit((String) null, in);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addArgument((Object) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addArgument;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addArgument((java.util.function.Supplier) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addKeyValue((String) null, (Object) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addKeyValue((String) null, (java.util.function.Supplier) null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[-1];taint"
LoggingEventBuilder out = null;
Object in = (Object) source();
out.addKeyValue((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addKeyValue;;;Argument[1];Argument[-1];taint"
LoggingEventBuilder out = null;
java.util.function.Supplier in = (java.util.function.Supplier) source();
out.addKeyValue((String) null, in);
sink(out); // $ hasTaintFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;addMarker;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.addMarker(null);
sink(out); // $ hasValueFlow
}
{
// "org.slf4j.spi;LoggingEventBuilder;true;setCause;;;Argument[-1];ReturnValue;value"
LoggingEventBuilder out = null;
LoggingEventBuilder in = (LoggingEventBuilder) source();
out = in.setCause(null);
sink(out); // $ hasValueFlow
}
}
}