forked from phoedos/pmd
Update documentation
TRAVIS_JOB_NUMBER=3177.1 TRAVIS_COMMIT_RANGE=c9bdcf6ef6e9...16c7017aa923
This commit is contained in:
@ -121,15 +121,23 @@ public class Test {
|
||||
|
||||
**Minimum Language Version:** Java 1.7
|
||||
|
||||
The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage collection pauses. See [JDK-8080225](https://bugs.openjdk.java.net/browse/JDK-8080225) for details.
|
||||
The FileInputStream and FileOutputStream classes contains a finalizer method which will cause garbage
|
||||
collection pauses.
|
||||
See [JDK-8080225](https://bugs.openjdk.java.net/browse/JDK-8080225) for details.
|
||||
|
||||
The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream, again causing garbage collection issues while finalizer methods are called.
|
||||
The FileReader and FileWriter constructors instantiate FileInputStream and FileOutputStream,
|
||||
again causing garbage collection issues while finalizer methods are called.
|
||||
|
||||
* Use `Files.newInputStream(Paths.get(fileName))` instead of `new FileInputStream(fileName)`.
|
||||
* Use `Files.newOutputStream(Paths.get(fileName))` instead of `new FileOutputStream(fileName)`.
|
||||
* Use `Files.newBufferedReader(Paths.get(fileName))` instead of `new FileReader(fileName)`.
|
||||
* Use `Files.newBufferedWriter(Paths.get(fileName))` instead of `new FileWriter(fileName)`.
|
||||
|
||||
Please note, that the `java.nio` API does not throw a `FileNotFoundException` anymore, instead
|
||||
it throws a `NoSuchFileException`. If your code dealt explicitly with a `FileNotFoundException`,
|
||||
then this needs to be adjusted. Both exceptions are subclasses of `IOException`, so catching
|
||||
that one covers both.
|
||||
|
||||
**This rule is defined by the following XPath expression:**
|
||||
``` xpath
|
||||
//PrimaryPrefix/AllocationExpression/ClassOrInterfaceType[
|
||||
|
Reference in New Issue
Block a user