Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Beware of InputStream#available() on JDK 1.4.1 in MacOS

The new JDK 1.4.1 for Mac has recently exposed a bug in JDT/Core where we
were blindly expecting it to answer non-zero values.
Also see http://bugs.eclipse.org/bugs/show_bug.cgi?id=34658.

Throughout Eclipse there may be other occurrences of this bug, and you may
want to double check code reading InputStream contents.

If using #available(), then it could be zero when buffered input has no
more bytes available (but forcing a read would find more).
Also make sure to loop until -1 was answered as the last read size.

Suspicious code areas:
org.eclipse.jdt.internal.launching.JavaAppletLaunchConfigurationDelegate.getInputStreamAsByteArray(InputStream,

int) (2 matches)
org.eclipse.jdt.ui.jarpackager.JarWriter.write(IFile, IPath)
org.eclipse.team.internal.core.streams.PollingInputStream.readPendingInput
()




Back to the top