Archived

This forum has been archived. Please start a new discussion on GitHub.

java:type:java.util.Vector

In my .ice file I have the following line:
["java:type:java.util.Vector<Disk>"]
sequence<Disk> DisksDef;

However the variable that gets generated is:
public java.util.List<Disk> Disks;

Instead of creating a Vector it creates a List interface. Am I putting in the wrong metadata tag?

I realize that Vector implements the List interface. However, having to change from Vector to List will take some effort. I would prefer to keep it a Vector.

Comments

  • mes
    mes California
    Welcome to the forum.

    As explained in section 10.15.3 of the Ice manual, the syntax for Java custom type metadata is

    java:type:concrete-type[:abstract-type]

    If you don't specify an abstract type, the translator uses java.util.List by default. If you want to use java.util.Vector for both types, you need to modify your definition as shown below:
    ["java:type:java.util.Vector<Disk>:java.util.Vector<Disk>"]
    sequence<Disk> DisksDef;
    
    Take care,
    - Mark