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

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:

int) (2 matches)
org.eclipse.jdt.ui.jarpackager.JarWriter.write(IFile, IPath)

Back to the top