...
| Code Block | ||
|---|---|---|
| ||
final class BadSer implements Serializable {
File f;
public BadSer() throws FileNotFoundException {
f = new File("c:\\filepath\\filename");
}
}
|
Compliant
...
Solution
This compliant solution declares the File object transient. Consequently, the file path is not exposed.
...