Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74feaf2

Browse files
committed
Adapt to static methods and nested types returning unbound declaring types
Previously these returned raw declaring types instead
1 parent b34448a commit 74feaf2

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

java/ql/src/semmle/code/java/dataflow/internal/ContainerFlow.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ private import semmle.code.java.dataflow.ExternalFlow
77

88
private class EntryType extends RefType {
99
EntryType() {
10-
this.getSourceDeclaration().getASourceSupertype*().hasQualifiedName("java.util", "Map<>$Entry")
10+
this.getSourceDeclaration().getASourceSupertype*().hasQualifiedName("java.util", "Map$Entry")
1111
}
1212

1313
RefType getValueType() {
14-
exists(GenericType t | t.hasQualifiedName("java.util", "Map<>$Entry") |
14+
exists(GenericType t | t.hasQualifiedName("java.util", "Map$Entry") |
1515
indirectlyInstantiates(this, t, 1, result)
1616
)
1717
}
@@ -95,10 +95,10 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
9595
override predicate row(string row) {
9696
row =
9797
[
98-
"java.util;Map<>$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
99-
"java.util;Map<>$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
100-
"java.util;Map<>$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
101-
"java.util;Map<>$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
98+
"java.util;Map$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
99+
"java.util;Map$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
100+
"java.util;Map$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
101+
"java.util;Map$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
102102
"java.lang;Iterable;true;iterator;();;Element of Argument[-1];Element of ReturnValue;value",
103103
"java.lang;Iterable;true;spliterator;();;Element of Argument[-1];Element of ReturnValue;value",
104104
"java.util;Iterator;true;next;;;Element of Argument[-1];ReturnValue;value",

java/ql/src/semmle/code/java/frameworks/play/Play.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class PlayMvcHttpRequestHeader extends RefType {
2626
}
2727

2828
/**
29-
* A `play.mvc.BodyParser<>$Of` annotation.
29+
* A `play.mvc.BodyParser$Of` annotation.
3030
*/
3131
class PlayBodyParserAnnotation extends Annotation {
32-
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser<>$Of") }
32+
PlayBodyParserAnnotation() { this.getType().hasQualifiedName("play.mvc", "BodyParser$Of") }
3333
}
3434

3535
/**

java/ql/test/library-tests/dataflow/collections/B.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,22 @@ static void sink(Object obj) { }
4949

5050
void foo() throws InterruptedException {
5151
{
52-
// "java.util;Map<>$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
52+
// "java.util;Map$Entry;true;getKey;;;MapKey of Argument[-1];ReturnValue;value",
5353
Object out = null;
5454
Object in = storeMapKeyEntry(source()); out = ((Map.Entry)in).getKey(); sink(out); // $ hasValueFlow
5555
}
5656
{
57-
// "java.util;Map<>$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
57+
// "java.util;Map$Entry;true;getValue;;;MapValue of Argument[-1];ReturnValue;value",
5858
Object out = null;
5959
Object in = storeMapValueEntry(source()); out = ((Map.Entry)in).getValue(); sink(out); // $ hasValueFlow
6060
}
6161
{
62-
// "java.util;Map<>$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
62+
// "java.util;Map$Entry;true;setValue;;;MapValue of Argument[-1];ReturnValue;value",
6363
Object out = null;
6464
Object in = storeMapValueEntry(source()); out = ((Map.Entry)in).setValue(null); sink(out); // $ hasValueFlow
6565
}
6666
{
67-
// "java.util;Map<>$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
67+
// "java.util;Map$Entry;true;setValue;;;Argument[0];MapValue of Argument[-1];value",
6868
Map.Entry out = null;
6969
Object in = source(); out.setValue(in); sink(readMapValue(out)); // $ hasValueFlow
7070
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| play.mvc.BodyParser<>$Of |
1+
| play.mvc.BodyParser$Of |

0 commit comments

Comments
 (0)