Bug 243347 [Wizards] TarFile should not throw NPE in finalize()
I20080805-1307 TarFile#finalize() throws an NPE which is swallowed by the Finalizer thread. To reproduce, e.g. try to import a *.zip archive. Here, the constructor fails to initialize entryEnumerationStream, so it stays null: Thread [main] (Suspended (breakpoint at line 59 in TarFile)) TarFile.<init>(File) line: 59 TarFile.<init>(String) line: 84 ArchiveFileManipulations.isTarFile(String) line: 47 WizardArchiveFileResourceImportPage1.getFileSystemTree() line: 228 In the finalizer thread, the NPE is thrown: Daemon System Thread [Finalizer] (Suspended (exception NullPointerException)) TarFile.close() line: 71 TarFile.finalize() line: 158 Finalizer.invokeFinalizeMethod(Object) line: not available Finalizer.runFinalizer() line: 83 [local variables unavailable] Finalizer.access$100(Finalizer) line: 14 Finalizer$FinalizerThread.run() line: 160 [local variables unavailable]
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/TarFile.java
TarEntry oldEntry = curEntry;
				try {
					curEntry = entryEnumerationStream.getNextEntry();
				} catch(TarException e) {
					curEntry = null;
				} catch(IOException e) {
					curEntry = null;
				}
				return oldEntry;
			}
		};
	}
	/**
	 * Returns a new InputStream for the given file in the tar archive.
	 * 
	 * @param entry
	 * @return an input stream for the given file
	 * @throws TarException
	 * @throws IOException
	 */
	public InputStream getInputStream(TarEntry entry) throws TarException, IOException {
		if(entryStream == null || !entryStream.skipToEntry(entry)) {
			if (internalEntryStream != null) {
				internalEntryStream.close();
			}
			internalEntryStream = new FileInputStream(file);
			
			try {
				internalEntryStream = new GZIPInputStream(internalEntryStream);
			} catch(IOException e) {