Files
codeql/java/ql/test/utils/model-generator/p/ImplOfExternalSPI.java
Benjamin Muskalla 0e9fcc6c39 Only generate models for local supertypes
Avoid generating models for classes
implementing external SPI (e.g. `FileFilter`).
Keep `toString` models intact as they're
commonly used as taint-propagation method
(e.g. see `Joiner`).
2021-11-10 16:30:23 +01:00

19 lines
385 B
Java

package p;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
public class ImplOfExternalSPI extends AbstractImplOfExternalSPI {
@Override
public boolean accept(File pathname) {
try {
Files.createFile(pathname.toPath());
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
}