mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Adapt to static methods and nested types returning unbound declaring types
Previously these returned raw declaring types instead
This commit is contained in:
@@ -7,11 +7,11 @@ private import semmle.code.java.dataflow.ExternalFlow
|
||||
|
||||
private class EntryType extends RefType {
|
||||
EntryType() {
|
||||
this.getSourceDeclaration().getASourceSupertype*().hasQualifiedName("java.util", "Map<>$Entry")
|
||||
this.getSourceDeclaration().getASourceSupertype*().hasQualifiedName("java.util", "Map$Entry")
|
||||
}
|
||||
|
||||
RefType getValueType() {
|
||||
exists(GenericType t | t.hasQualifiedName("java.util", "Map<>$Entry") |
|
||||
exists(GenericType t | t.hasQualifiedName("java.util", "Map$Entry") |
|
||||
indirectlyInstantiates(this, t, 1, result)
|
||||
)
|
||||
}
|
||||
@@ -95,10 +95,10 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
[
|
||||
"java.util;Map<>$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map<>$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map<>$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map<>$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
|
||||
"java.util;Map$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
"java.util;Map$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
|
||||
"java.lang;Iterable;true;iterator;();;Element of Argument[-1];Element of ReturnValue;value",
|
||||
"java.lang;Iterable;true;spliterator;();;Element of Argument[-1];Element of ReturnValue;value",
|
||||
"java.util;Iterator;true;next;;;Element of Argument[-1];ReturnValue;value",
|
||||
|
||||
@@ -26,10 +26,10 @@ class PlayMvcHttpRequestHeader extends RefType {
|
||||
}
|
||||
|
||||
/**
|
||||
* A `play.mvc.BodyParser<>$Of` annotation.
|
||||
* A `play.mvc.BodyParser$Of` annotation.
|
||||
*/
|
||||
class PlayBodyParserAnnotation extends Annotation {
|
||||
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser<>$Of") }
|
||||
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser$Of") }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,22 +49,22 @@ public class B {
|
||||
|
||||
void foo() throws InterruptedException {
|
||||
{
|
||||
// "java.util;Map<>$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
|
||||
// "java.util;Map$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
|
||||
Object out = null;
|
||||
Object in = storeMapKeyEntry(source()); out = ((Map.Entry)in).getKey(); sink(out); // $ hasValueFlow
|
||||
}
|
||||
{
|
||||
// "java.util;Map<>$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
// "java.util;Map$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
Object out = null;
|
||||
Object in = storeMapValueEntry(source()); out = ((Map.Entry)in).getValue(); sink(out); // $ hasValueFlow
|
||||
}
|
||||
{
|
||||
// "java.util;Map<>$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
// "java.util;Map$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
|
||||
Object out = null;
|
||||
Object in = storeMapValueEntry(source()); out = ((Map.Entry)in).setValue(null); sink(out); // $ hasValueFlow
|
||||
}
|
||||
{
|
||||
// "java.util;Map<>$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
|
||||
// "java.util;Map$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
|
||||
Map.Entry out = null;
|
||||
Object in = source(); out.setValue(in); sink(readMapValue(out)); // $ hasValueFlow
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
| play.mvc.BodyParser<>$Of |
|
||||
| play.mvc.BodyParser$Of |
|
||||
|
||||
Reference in New Issue
Block a user