Erroneous JavaDoc for Path#register
Matthias Ernst
matthias at mernst.org
Wed Dec 3 23:55:25 PST 2008
http://openjdk.java.net/projects/nio/javadoc/java/nio/file/Path.html#register(java.nio.file.WatchService,%20java.nio.file.WatchEvent.Kind[],%20java.nio.file.WatchEvent.Modifier...)
Barring any language changes I missed, the example code does not
compile. It requires an explicit array creation, not?
WatchKey key = dir.register(watcher, new WatchEvent.Kind<?>[] {
ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY });
Given that there are no modifiers defined as of today and I would
expect them to be empty most of the time (that's why they're called
modifiers), wouldn't it be nicer if the two parameters were switched?
Matthias
More information about the nio-dev
mailing list