Java: Vector & lt; String & gt; warnings

advertisements
public class myTokens
{
     protected Vector<String> myTokens;

     ...

     public Vector<String> getTokens ()
     {
          return myTokens;
     }
}

...

public class otherClass
{
...

    public Vector<String> myStrings ()
    {
    ...

        return myTokens.getTokens ();
    }
}

While using Eclipse, the method myStrings at the return myTokens.getTokens () is marked as a warning saying "The expression of type Vector needs unchecked conversion to conform to Vector"

The dang method says it returns a Vector<String> why is this marked as a warning?

The only way I can deal with this is to use a suppress warning pragma which in itself in Eclipse marks as a warning so in essence in Eclipse it is impossible to deal with this warning.

Thanx for your Help.

Bodger


The Vector classes were made obsolete by the JDK1.2 and should probable not be used in new development. You should try to use another class instead.

What netbeans gives me:

This inspection reports any uses of java.util.Vector or java.util.Hashtable. While still supported, these classes were made obsolete by the JDK1.2 collection classes, and should probably not be used in new development.