mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Java: Add WithoutElement model for List.clear and add appropriate test.
This commit is contained in:
@@ -302,6 +302,16 @@ public class B {
|
||||
List out = null;
|
||||
Collection in = storeElementList(source()); out.addAll(0,in); sink(readElement(out)); // $ hasValueFlow
|
||||
}
|
||||
{
|
||||
// "java.util;List;true;clear;;;Argument[this].WithoutElement;Argument[this];value;manual"
|
||||
List out = null;
|
||||
List in = storeElementList(source()); out = in; out.clear(); sink(readElement(out)); // No flow
|
||||
}
|
||||
{
|
||||
// "java.util;List;true;clear;;;Argument[this].WithoutElement;Argument[this];value;manual"
|
||||
List out = null;
|
||||
List in = (List)source(); out = in; out.clear(); sink(out); // $ hasValueFlow
|
||||
}
|
||||
{
|
||||
// "java.util;Vector;true;elementAt;(int);;Element of Argument[this];ReturnValue;value;manual",
|
||||
Object out = null;
|
||||
|
||||
Reference in New Issue
Block a user