Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2013-02-08 06:54:00 +0000
committerEd Merks2013-02-08 06:54:00 +0000
commit7e41cc3c2d507577e6e680c46b8ee95bec1f9724 (patch)
tree89b686bf55f46a922b129047c812c141fe02ce64
parent30406cdb0f63015d6367768782bbf0a379390e0a (diff)
downloadorg.eclipse.emf-R2_8_maintenance.tar.gz
org.eclipse.emf-R2_8_maintenance.tar.xz
org.eclipse.emf-R2_8_maintenance.zip
[399728] Don't assume that available == 0 means end of stream.R2_8_maintenance
-rw-r--r--plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java b/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
index 473b256d5..d4a4516db 100644
--- a/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
+++ b/plugins/org.eclipse.emf.ecore.xmi/src/org/eclipse/emf/ecore/xmi/impl/XMLResourceImpl.java
@@ -206,15 +206,21 @@ public class XMLResourceImpl extends ResourceImpl implements XMLResource
eObjectInputStream.loadResource(this);
// Load the extrinsic ID map.
- // If this stream wasn't produced by XMLResourceImpl, there won't be a map.
- //
- if (inputStream.available() > 0)
- {
- for (int i = 0, size = eObjectInputStream.readCompressedInt(); i < size; ++i)
- {
- setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString());
- }
- }
+ int size = 0;
+ try
+ {
+ // If this stream wasn't produced by XMLResourceImpl, there won't be a map.
+ //
+ size = eObjectInputStream.readCompressedInt();
+ }
+ catch (IOException exception)
+ {
+ // Ignore
+ }
+ for (int i = 0; i < size; ++i)
+ {
+ setID(eObjectInputStream.loadEObject(), eObjectInputStream.readString());
+ }
if (handler != null)
{

Back to the top