package ceylon.interop.java;

import ceylon.language.Array;
import ceylon.language.AssertionError;
import ceylon.language.SharedAnnotation$annotation$;

import com.redhat.ceylon.compiler.java.language.ByteArray;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Ignore;
import com.redhat.ceylon.compiler.java.metadata.Method;
import com.redhat.ceylon.compiler.java.metadata.Name;

@Ceylon(major = 7)
@Method
@SharedAnnotation$annotation$
public final class javaByteArray_ {
        
    @Ignore
    private javaByteArray_() {}

    /**
     * Cast a Ceylon <code>Array&lt;java.lang.Byte&gt;</code> to a Java 
     * <code>ByteArray</code>, that is, to <code>byte[]</code>, preserving 
     * the identity of the given array.
     * 
     * @see ByteArray
     */
    public static byte[] javaByteArray(@Name("array") Array<java.lang.Byte> array){
        if(array.toArray() instanceof byte[]){
            return (byte[]) array.toArray();
        }
        throw new AssertionError("Invalid source array type: "+array.toArray());
    }

}

@@ -426,16 +426,74 @@
 ta.Name;
+%0Aimport com.redhat.ceylon.compiler.java.metadata.TypeInfo;
 %0A%0A@Ceylo
@@ -662,16 +662,74 @@
  Ceylon 
+%3Ccode%3EArray&lt;ceylon.language.Byte&gt;%3C/code%3E %0A     * or 
 %3Ccode%3EAr
@@ -836,16 +836,24 @@
 /code%3E, 
+%0A     * 
 preservi
@@ -855,24 +855,16 @@
 serving 
-%0A     * 
 the iden
@@ -970,22 +970,131 @@
 ay(@
-Name(%22array%22) 
+SuppressWarnings(%22rawtypes%22) @Name(%22array%22) %0A    @TypeInfo(%22ceylon.language::Array%3Cceylon.language::Byte%3E%7Cceylon.language::
 Arra
@@ -1108,14 +1108,28 @@
 lang
-.
+::
 Byte%3E
+%22) %0A    Array
  arr
@@ -1143,16 +1143,17 @@
       if
+ 
 (array.t

make javaByteArray() accept an Array<Byte>