Bug 397337 - need to check for elements that are byte[] when cloning the
elements of an EList.
diff --git a/runtimes/org.eclipse.edt.runtime.java/src/org/eclipse/edt/runtime/java/eglx/lang/EList.java b/runtimes/org.eclipse.edt.runtime.java/src/org/eclipse/edt/runtime/java/eglx/lang/EList.java
index cc62240..a483045 100644
--- a/runtimes/org.eclipse.edt.runtime.java/src/org/eclipse/edt/runtime/java/eglx/lang/EList.java
+++ b/runtimes/org.eclipse.edt.runtime.java/src/org/eclipse/edt/runtime/java/eglx/lang/EList.java
@@ -340,7 +340,15 @@
 				else if ( element instanceof Cloneable )
 				{
 					// Our runtime and generated classes are Cloneable.
-					copy.add( (T)element.getClass().getMethod( "clone" ).invoke( element ) );
+					if ( element instanceof byte[] )
+					{
+						// Arrays are Cloneable but you can't get their clone method reflectively.
+						copy.add( (T)((byte[])element).clone() );
+					}
+					else
+					{
+						copy.add( (T)element.getClass().getMethod( "clone" ).invoke( element ) );
+					}
 				}
 				else
 				{
@@ -376,7 +384,15 @@
 				else if ( element instanceof Cloneable )
 				{
 					// Our runtime and generated classes are Cloneable.
-					box = boxElement( element.getClass().getMethod( "clone" ).invoke( element ) );
+					if ( element instanceof byte[] )
+					{
+						// Arrays are Cloneable but you can't get their clone method reflectively.
+						box = boxElement( ((byte[])element).clone() );
+					}
+					else
+					{
+						box = boxElement( element.getClass().getMethod( "clone" ).invoke( element ) );
+					}
 				}
 				else
 				{