@@ -9,9 +9,9 @@ private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) {
9
9
cie = fileReadingExpr and
10
10
cie .getArgument ( 0 ) = fileAccess
11
11
|
12
- cie . getConstructedType ( ) . hasQualifiedName ( "java.io" , "RandomAccessFile" ) or
13
- cie .getConstructedType ( ) . hasQualifiedName ( "java.io" , "FileReader" ) or
14
- cie . getConstructedType ( ) . hasQualifiedName ( "java.io" , " FileInputStream")
12
+ cie
13
+ .getConstructedType ( )
14
+ . hasQualifiedName ( "java.io" , [ "RandomAccessFile" , "FileReader" , " FileInputStream"] )
15
15
)
16
16
or
17
17
exists ( MethodAccess ma , Method filesMethod |
@@ -22,13 +22,9 @@ private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) {
22
22
// represented by the first argument.
23
23
filesMethod .getDeclaringType ( ) .hasQualifiedName ( "java.nio.file" , "Files" ) and
24
24
fileAccess = ma .getArgument ( 0 ) and
25
- (
26
- filesMethod .hasName ( "readAllBytes" ) or
27
- filesMethod .hasName ( "readAllLines" ) or
28
- filesMethod .hasName ( "newBufferedReader" ) or
29
- filesMethod .hasName ( "newInputReader" ) or
30
- filesMethod .hasName ( "newByteChannel" )
31
- )
25
+ filesMethod
26
+ .hasName ( [ "readAllBytes" , "readAllLines" , "readString" , "lines" , "newBufferedReader" ,
27
+ "newInputStream" , "newByteChannel" ] )
32
28
)
33
29
)
34
30
or
0 commit comments