Skip to content

Commit c251da7

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: update TopJdkApis test
1 parent 16de30e commit c251da7

File tree

2 files changed

+68
-1
lines changed

2 files changed

+68
-1
lines changed

java/ql/test/ext/TopJdkApis/TopJdkApis.qll

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,61 @@ predicate topJdkApiName(string apiName) {
5757
"java.nio.file.Path#resolve(String)", "java.lang.Enum#toString()",
5858
"java.lang.RuntimeException#RuntimeException(Throwable)", "java.util.Collection#size()",
5959
"java.lang.String#charAt(int)", "java.util.stream.Stream#forEach(Consumer)",
60-
"java.util.Map#isEmpty()", "java.lang.String#valueOf(int)"
60+
"java.util.Map#isEmpty()", "java.lang.String#valueOf(int)",
61+
// top 200 JDK APIs
62+
"java.lang.Integer#intValue()", "java.util.ArrayList#size()",
63+
"java.util.ArrayList#ArrayList(int)", "java.util.function.Function#apply(Object)",
64+
"java.util.stream.Stream#forEach(Consumer)", "java.util.ArrayList#get(int)",
65+
"java.util.Set#iterator()", "java.util.stream.Collectors#toSet()",
66+
"java.lang.String#replaceAll(String,String)", "java.lang.String#getBytes(Charset)",
67+
"java.util.Objects#requireNonNull(Object)", "java.util.Objects#nonNull(Object)",
68+
"java.lang.String#endsWith(String)", "java.lang.AbstractStringBuilder#length()",
69+
"java.sql.PreparedStatement#setString(int,String)",
70+
"java.util.regex.Pattern#matcher(CharSequence)", "java.nio.file.Path#toString()",
71+
"java.time.Instant#now()", "java.io.File#getAbsolutePath()",
72+
"java.util.Set#addAll(Collection)", "java.lang.Integer#valueOf(int)",
73+
"java.util.HashSet#HashSet(Collection)", "java.lang.Integer#toString(int)",
74+
"java.lang.StringBuilder#StringBuilder(String)", "java.lang.Thread#sleep(long)",
75+
"java.lang.Thread#currentThread()", "java.util.Date#getTime()",
76+
"java.io.Writer#write(String)", "java.lang.String#getBytes()", "java.io.File#exists()",
77+
"java.lang.String#toUpperCase()", "java.lang.Long#parseLong(String)",
78+
"java.util.Collections#emptyMap()", "java.util.Optional#orElseThrow(Supplier)",
79+
"java.util.List#of(Object,Object)", "java.util.concurrent.CountDownLatch#countDown()",
80+
"java.lang.Class#isAssignableFrom(Class)",
81+
"java.lang.IndexOutOfBoundsException#IndexOutOfBoundsException(String)",
82+
"java.lang.Throwable#getCause()", "java.util.Arrays#stream(Object[])",
83+
"java.util.function.Supplier#get()", "java.lang.Exception#Exception(String)",
84+
"java.util.function.Consumer#accept(Object)", "java.util.stream.Stream#anyMatch(Predicate)",
85+
"java.util.List#clear()", "java.io.File#File(File,String)",
86+
"java.lang.String#indexOf(String)", "java.util.List#iterator()",
87+
"java.util.concurrent.CountDownLatch#CountDownLatch(int)", "java.sql.ResultSet#next()",
88+
"java.sql.PreparedStatement#setInt(int,int)",
89+
"java.util.concurrent.atomic.AtomicInteger#get()",
90+
"java.util.stream.Collectors#toMap(Function,Function)", "java.lang.Math#min(int,int)",
91+
"java.lang.Long#equals(Object)", "java.util.Properties#setProperty(String,String)",
92+
"java.util.Map#getOrDefault(Object,Object)", "java.lang.System#getProperty(String)",
93+
"java.util.stream.Stream#of(Object[])", "java.nio.file.Paths#get(String,String[])",
94+
"java.math.BigDecimal#compareTo(BigDecimal)", "java.math.BigDecimal#valueOf(long)",
95+
"java.lang.RuntimeException#RuntimeException(String,Throwable)",
96+
"java.util.Collection#add(Object)", "java.util.Collections#emptySet()",
97+
"java.util.stream.Stream#flatMap(Function)",
98+
"java.util.concurrent.atomic.AtomicReference#get()", "java.util.Collection#isEmpty()",
99+
"java.lang.StringBuffer#toString()", "java.util.Collections#singleton(Object)",
100+
"java.io.File#getName()", "java.time.ZonedDateTime#now()",
101+
"java.io.ByteArrayInputStream#ByteArrayInputStream(byte[])", "java.nio.file.Path#toFile()",
102+
"java.util.Date#Date(long)", "java.lang.System#nanoTime()",
103+
"java.util.Hashtable#put(Object,Object)", "java.util.Map#putAll(Map)",
104+
"java.lang.Long#toString()", "java.util.List#toArray(Object[])", "java.io.File#toPath()",
105+
"java.util.regex.Matcher#group(int)", "java.time.LocalDate#of(int,int,int)",
106+
"java.lang.String#valueOf(long)", "java.math.BigDecimal#valueOf(double)",
107+
"java.io.IOException#IOException(String)", "java.text.DateFormat#format(Date)",
108+
"java.sql.ResultSet#getInt(String)", "java.util.Map#clear()", "java.util.HashSet#add(Object)",
109+
"java.lang.Class#getClassLoader()", "java.lang.Boolean#equals(Object)",
110+
"java.lang.String#concat(String)", "java.util.Collections#singletonMap(Object,Object)",
111+
"java.util.Collection#iterator()", "java.util.Map#computeIfAbsent(Object,Function)",
112+
"java.text.SimpleDateFormat#SimpleDateFormat(String)",
113+
"java.util.StringJoiner#add(CharSequence)", "java.lang.Long#longValue()",
114+
"java.util.stream.Collectors#joining(CharSequence)"
61115
]
62116
}
63117

java/ql/test/ext/TopJdkApis/TopJdkApisTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@
66
import java.util.stream.Collectors;
77
import java.util.Map;
88
import java.util.HashMap;
9+
import java.util.HashSet;
10+
import java.util.StringJoiner;
11+
import java.util.concurrent.CountDownLatch;
12+
import java.util.concurrent.atomic.AtomicInteger;
13+
import java.util.concurrent.atomic.AtomicReference;
14+
import java.util.regex.Matcher;
15+
import java.util.regex.Pattern;
916
import java.math.BigDecimal;
1017
import java.sql.ResultSet;
1118
import java.lang.System;
1219
import java.lang.IllegalStateException;
20+
import java.lang.IndexOutOfBoundsException;
21+
import java.lang.Math;
22+
import java.io.ByteArrayInputStream;
23+
import java.nio.file.Paths;
24+
import java.text.DateFormat;
25+
import java.text.SimpleDateFormat;
1326

1427
public class TopJdkApisTest { }

0 commit comments

Comments
 (0)