java.io.File.LazyInitialization (original) (raw)
Alex Lam S.L. alexlamsl at gmail.com
Sat Jan 21 18:11:46 UTC 2012
- Previous message: hg: jdk8/tl/jdk: 4504839: Java libraries should provide support for unsigned integer arithmetic; ...
- Next message: java.io.File.LazyInitialization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi there,
Whilst reading the JDK6 source code for java.io.File.createTempFile(), I noticed that:
... private static class LazyInitialization { ... static final String temporaryDirectory = temporaryDirectory(); static String temporaryDirectory() {...} ... } ... public static File createTempFile(String prefix, String suffix, File directory) throws IOException { ... if (directory == null) { String tmpDir = LazyInitialization.temporaryDirectory(); ...
Shouldn't the last line use the static field instead of the static method?
The static field "temporaryDirectory" is not used anywhere else in the class, which also make this seem suspicious.
Alex.
- Previous message: hg: jdk8/tl/jdk: 4504839: Java libraries should provide support for unsigned integer arithmetic; ...
- Next message: java.io.File.LazyInitialization
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]