Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-09-27 17:27:23 -0400
committerslewis2018-09-27 17:27:23 -0400
commit1f426000a4ea9569d24f64c866cc10e3144ba319 (patch)
tree535cf3be0bbf37410b3c6419431300d065896920
parente0673ed9090a25ac57c511d0458e4ff01aecce50 (diff)
downloadorg.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.tar.gz
org.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.tar.xz
org.eclipse.ecf-1f426000a4ea9569d24f64c866cc10e3144ba319.zip
Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=539556
-rw-r--r--examples/bundles/org.eclipse.ecf.examples.raspberrypi.management.host.feature/feature.xml2
-rw-r--r--framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf/pom.xml2
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java10
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java12
-rw-r--r--releng/features/org.eclipse.ecf.base.feature/feature.xml2
-rw-r--r--releng/features/org.eclipse.ecf.core.feature/feature.xml2
-rw-r--r--releng/features/org.eclipse.ecf.core.feature/pom.xml2
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java21
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java8
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java17
11 files changed, 65 insertions, 15 deletions
diff --git a/examples/bundles/org.eclipse.ecf.examples.raspberrypi.management.host.feature/feature.xml b/examples/bundles/org.eclipse.ecf.examples.raspberrypi.management.host.feature/feature.xml
index 02cdfe80b..07903f884 100644
--- a/examples/bundles/org.eclipse.ecf.examples.raspberrypi.management.host.feature/feature.xml
+++ b/examples/bundles/org.eclipse.ecf.examples.raspberrypi.management.host.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.ecf.examples.raspberrypi.management.host.feature"
label="Raspberry Pi Host Feature"
- version="1.1.1.qualifier">
+ version="1.1.2.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
diff --git a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
index 357da843b..24ab73dda 100644
--- a/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf;singleton:=true
Automatic-Module-Name: org.eclipse.ecf
-Bundle-Version: 3.9.1.qualifier
+Bundle-Version: 3.9.2.qualifier
Bundle-Activator: org.eclipse.ecf.internal.core.ECFPlugin
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
diff --git a/framework/bundles/org.eclipse.ecf/pom.xml b/framework/bundles/org.eclipse.ecf/pom.xml
index 374579c96..8b20f70c7 100644
--- a/framework/bundles/org.eclipse.ecf/pom.xml
+++ b/framework/bundles/org.eclipse.ecf/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf</artifactId>
- <version>3.9.1-SNAPSHOT</version>
+ <version>3.9.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java
index c29b6ac01..fea2887e9 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java
@@ -194,7 +194,7 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje
return in.readFloat();
case C_ENUM :
trace("readEnum"); //$NON-NLS-1$
- return in.readObject();
+ return Enum.valueOf(loadClass(in.readUTF()), in.readUTF());
case C_OBJECT :
return readNonSerializedObject();
default :
@@ -227,7 +227,9 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje
m.setAccessible(true);
return m.invoke(osc, (Object[]) null);
} catch (Exception e) {
- throw new IOException("Exception creating newInstance of class=" + osc.getName()); //$NON-NLS-1$
+ IOException t = new IOException("Exception creating newInstance of class=" + osc.getName()); //$NON-NLS-1$
+ t.setStackTrace(e.getStackTrace());
+ throw t;
}
}
@@ -261,7 +263,9 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje
}
return inst;
} catch (final Exception e) {
- throw new IOException("Error while deserializing class=" + clazz.getName() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+ IOException t = new IOException("Error while deserializing class=" + clazz.getName() + ": " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
+ t.setStackTrace(e.getStackTrace());
+ throw t;
}
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java
index fb207aa48..f363c2aa2 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java
@@ -293,7 +293,13 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb
for (Object item : itr)
writeObjectOverride(item);
return;
- } else if (obj instanceof Externalizable) {
+ } else if (obj instanceof Enum) {
+ out.writeByte(C_ENUM);
+ out.writeUTF(obj.getClass().getName());
+ out.writeUTF(((Enum) obj).name());
+ return;
+ }
+ if (obj instanceof Externalizable) {
out.writeByte(C_EXTER);
writeExternalizable((Externalizable) obj, clazz);
} else if (obj instanceof Serializable) {
@@ -309,10 +315,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb
out.writeByte(C_DTO);
writeDTO(obj, clazz);
return;
- } else if (obj instanceof Enum) {
- out.writeByte(C_ENUM);
- out.writeObject(obj);
- return;
} else {
if (allowNonSerializable) {
out.writeByte(C_OBJECT);
diff --git a/releng/features/org.eclipse.ecf.base.feature/feature.xml b/releng/features/org.eclipse.ecf.base.feature/feature.xml
index 14251bdbf..7861c9c9d 100644
--- a/releng/features/org.eclipse.ecf.base.feature/feature.xml
+++ b/releng/features/org.eclipse.ecf.base.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.ecf.base.feature"
label="ECF Base Feature"
- version="2.0.200.qualifier"
+ version="2.0.300.qualifier"
provider-name="Eclipse.org"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/features/org.eclipse.ecf.core.feature/feature.xml b/releng/features/org.eclipse.ecf.core.feature/feature.xml
index d15180d03..71f701a65 100644
--- a/releng/features/org.eclipse.ecf.core.feature/feature.xml
+++ b/releng/features/org.eclipse.ecf.core.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.ecf.core.feature"
label="ECF Core Feature"
- version="1.5.1.qualifier"
+ version="1.5.2.qualifier"
provider-name="Eclipse.org - ECF"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
diff --git a/releng/features/org.eclipse.ecf.core.feature/pom.xml b/releng/features/org.eclipse.ecf.core.feature/pom.xml
index 48466bdd2..6668c9acc 100644
--- a/releng/features/org.eclipse.ecf.core.feature/pom.xml
+++ b/releng/features/org.eclipse.ecf.core.feature/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>org.eclipse.ecf.core.feature</artifactId>
- <version>1.5.1-SNAPSHOT</version>
+ <version>1.5.2-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java
new file mode 100644
index 000000000..5e83a6865
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/ITestEnum.java
@@ -0,0 +1,21 @@
+package org.eclipse.ecf.tests.core.util;
+
+import java.io.Serializable;
+
+public interface ITestEnum extends Serializable {
+
+ enum ColumnType {
+ METADATA,
+ ICON
+ }
+
+ enum DataType {
+ STRING,
+ DATE,
+ INTEGER,
+ FILE_SIZE,
+ USER
+ }
+
+ ColumnType getColumnType();
+}
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
index 639b1f9c7..352ffbfe3 100644
--- a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/OSGIObjectStreamTest.java
@@ -59,6 +59,7 @@ public class OSGIObjectStreamTest extends TestCase {
String s;
MySerializable ser;
Bundle b;
+ TestEnumImpl testEnum;
@Override
protected void setUp() throws Exception {
@@ -82,6 +83,8 @@ public class OSGIObjectStreamTest extends TestCase {
ser = new MySerializable("first string", 100, new byte[] { 1, 2, 3 });
b = Activator.getContext().getBundle();
+
+ testEnum = new TestEnumImpl();
}
public void testOSGIObjectOutputStream() throws Exception {
@@ -149,5 +152,8 @@ public class OSGIObjectStreamTest extends TestCase {
assertTrue(Arrays.equals(r.getBytes(),ser.getBytes()));
}
-
+ public void testEnum() throws Exception {
+ ITestEnum desTestEnum = (ITestEnum) serializeDeserialize(testEnum);
+ assertEquals(desTestEnum.getColumnType().name(),testEnum.getColumnType().name());
+ }
}
diff --git a/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java
new file mode 100644
index 000000000..c39f4dfb1
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.core/src/org/eclipse/ecf/tests/core/util/TestEnumImpl.java
@@ -0,0 +1,17 @@
+package org.eclipse.ecf.tests.core.util;
+
+public class TestEnumImpl implements ITestEnum {
+
+ private static final long serialVersionUID = 1L;
+
+ private ColumnType columnType;
+
+ public ColumnType getColumnType() {
+ return columnType;
+ }
+
+ public TestEnumImpl() {
+ this.columnType = ITestEnum.ColumnType.METADATA;
+ }
+
+}

Back to the top