@@ -9,9 +9,9 @@ private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) {
99 cie = fileReadingExpr and
1010 cie .getArgument ( 0 ) = fileAccess
1111 |
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"] )
1515 )
1616 or
1717 exists ( MethodAccess ma , Method filesMethod |
@@ -22,13 +22,9 @@ private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) {
2222 // represented by the first argument.
2323 filesMethod .getDeclaringType ( ) .hasQualifiedName ( "java.nio.file" , "Files" ) and
2424 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" ] )
3228 )
3329 )
3430 or
0 commit comments