Jython/Java type declaration help

How do i correctly declare Object[].class in jython ? Im stumped on this.

ActivationDataFlavor(Object[].class, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");

I have tried.

from jarray import zeros, array
obj = array((), Object)
ActivationDataFlavor(obj, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");

and

from jarray import zeros, array
obj = zeros(0, Object)
ActivationDataFlavor(obj, DataFlavor.javaJVMLocalObjectMimeType, "Array of items");

Any help or suggestions appreciated.

Have you tried using the full classname? Jython has its own Object class, so your usage is ambiguous. Don’t forget to import it – it won’t be present in scope otherwise.

it is imported i didnt include it in the snippet…
from java.lang import Object

i thought that was was object with the lowercase o…
it is in scope.

Ah, yes. Lower-case object in python.

in my java ide it prints this

System.out.print(Object[].class);
>>> class [Ljava.lang.Object;

thats what im trying to get to on the Jython side.

Hmmm. Have you tried obj.getClass() on either of your jarray instances?

Unknown attribute error. Wrapping it with type returns

<type 'array.array'>
``` . 
As does
```obj.__class__.```

Beware! Java class != jython class, and java Type != jython type(). Everything accessible in a java object from jython is really a property of an internal PyObject wrapper, and some things just aren’t exposed on the jython side. I’ll have to think about this.

indeed you are correct. I sent you the entire code in a PM. Run it when you get a chance.