Name: skT88420 Date: 11/25/99 $ java -version java version "1.2" Solaris VM (build Solaris_JDK_1.2_01, native threads, sunwjit) The class java.lang.Process provides a method: java.io.InputStream getInputStream (); The name of the method is wrong, because it returns the Process' output stream (the return type of the method is fine, since our Java code needs an InputStream to read from). The name of the method includes its return type (which is unnecessary), instead of naming the member of the Process that one wishes to access. One wishes to get the output stream of the Process (and manipulate it as an InputStream). The method should have been named: java.io.InputStream getOutputStream (); (or perhaps "getOutput" would be even less confusing). The javadoc generated documentation says: public abstract InputStream getInputStream() Gets the input stream of the subprocess. The stream obtains data piped from the standard output stream of the process represented by this Process object. The first sentence is clearly wrong. I repeat, this method gets the output stream of the subprocess (who type is necessarily an InputStream). The method getOutputStream is symmetrically wrongly named. Of course, you'll never be able to fix this, but perhaps you can find the person in Sun who named these methods, and explain why the names are wrong, so that no more conceptual damage will be done. (Review ID: 98289) ======================================================================
|