### Eclipse Workspace Patch 1.0 #P org.eclipse.osgi Index: defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java,v retrieving revision 1.9 diff -u -r1.9 DirZipBundleEntry.java --- defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java 8 Sep 2010 17:56:32 -0000 1.9 +++ defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/DirZipBundleEntry.java 13 Jun 2011 14:17:28 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,8 +11,7 @@ package org.eclipse.osgi.baseadaptor.bundlefile; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.net.MalformedURLException; import java.net.URL; @@ -42,7 +41,7 @@ * @throws IOException */ public InputStream getInputStream() throws IOException { - return null; + return new ByteArrayInputStream(new byte[0]); } public long getSize() { Index: security/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java =================================================================== RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/security/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java,v retrieving revision 1.4 diff -u -r1.4 SignatureBlockProcessor.java --- security/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java 9 Nov 2010 15:19:40 -0000 1.4 +++ security/src/org/eclipse/osgi/internal/signedcontent/SignatureBlockProcessor.java 13 Jun 2011 14:17:28 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2007, 2011 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -467,12 +467,20 @@ private static byte[] readIntoArray(BundleEntry be) throws IOException { int size = (int) be.getSize(); InputStream is = be.getInputStream(); - byte b[] = new byte[size]; - int rc = readFully(is, b); - if (rc != size) { - throw new IOException("Couldn't read all of " + be.getName() + ": " + rc + " != " + size); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + try { + byte b[] = new byte[size]; + int rc = readFully(is, b); + if (rc != size) { + throw new IOException("Couldn't read all of " + be.getName() + ": " + rc + " != " + size); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } + return b; + } finally { + try { + is.close(); + } catch (IOException e) { + // do nothing; + } } - return b; } private static int readFully(InputStream is, byte b[]) throws IOException {