[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] Re: plugin needs to send events to the workbench?

> I.e., you don't need to close the newStream, since the contract of
> setContents says it will always be closed.  The refreshLocal is
> definitely not need here, since you're only using the IFile API to
> modify the file.  A couple more questions:

Doh!  This is the problem.  I should have read more carefully.  I was
closing the WRONG InputStream.

parser.prettify( currentFile.getContents(), ostr );

That means I had no local reference to the InputStream being passed in.
Changing it to:

InputStream fileContents - currentFile.getContents();
parser.prettify( fileContents, ostr );

...
fileContents.close();

does the trick.  Thanks John.  You are entitled to the beverage of your
choice if you're ever in Austin!

--Eric