Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 197886 Details for
Bug 349121
SignatureBlockProcessor.readIntoArray(BundleEntry) does not close input stream
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
updated patch
349121.txt (text/plain), 3.35 KB, created by
Thomas Watson
on 2011-06-13 10:19:22 EDT
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2011-06-13 10:19:22 EDT
Size:
3.35 KB
patch
obsolete
>### 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 {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 349121
:
197885
| 197886