summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/javax/naming/CompositeName.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/naming/CompositeName.java')
-rw-r--r--libjava/classpath/javax/naming/CompositeName.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/libjava/classpath/javax/naming/CompositeName.java b/libjava/classpath/javax/naming/CompositeName.java
index 612932152da..7227f9d78e4 100644
--- a/libjava/classpath/javax/naming/CompositeName.java
+++ b/libjava/classpath/javax/naming/CompositeName.java
@@ -58,16 +58,16 @@ public class CompositeName implements Name, Cloneable, Serializable
{
private static final long serialVersionUID = 1667768148915813118L;
- private transient Vector elts;
+ private transient Vector<String> elts;
public CompositeName ()
{
- elts = new Vector ();
+ elts = new Vector<String> ();
}
protected CompositeName (Enumeration<String> comps)
{
- elts = new Vector ();
+ elts = new Vector<String> ();
try
{
while (comps.hasMoreElements ())
@@ -80,7 +80,7 @@ public class CompositeName implements Name, Cloneable, Serializable
public CompositeName (String n) throws InvalidNameException
{
- elts = new Vector ();
+ elts = new Vector<String> ();
// Parse the string into its components.
final char no_quote = 'x'; // Use 'x' to mean no quoting.
char quote = no_quote;
@@ -151,7 +151,7 @@ public class CompositeName implements Name, Cloneable, Serializable
public Name addAll (int posn, Name n) throws InvalidNameException
{
- Enumeration e = n.getAll ();
+ Enumeration<String> e = n.getAll ();
try
{
while (e.hasMoreElements ())
@@ -168,7 +168,7 @@ public class CompositeName implements Name, Cloneable, Serializable
public Name addAll (Name suffix) throws InvalidNameException
{
- Enumeration e = suffix.getAll ();
+ Enumeration<String> e = suffix.getAll ();
try
{
while (e.hasMoreElements ())
@@ -193,8 +193,8 @@ public class CompositeName implements Name, Cloneable, Serializable
int last = Math.min (cn.elts.size (), elts.size ());
for (int i = 0; i < last; ++i)
{
- String f = (String) elts.get (i);
- int comp = f.compareTo ((String) cn.elts.get (i));
+ String f = elts.get (i);
+ int comp = f.compareTo (cn.elts.get (i));
if (comp != 0)
return comp;
}
@@ -227,7 +227,7 @@ public class CompositeName implements Name, Cloneable, Serializable
public String get (int posn)
{
- return (String) elts.get (posn);
+ return elts.get (posn);
}
public Enumeration<String> getAll ()
@@ -239,7 +239,7 @@ public class CompositeName implements Name, Cloneable, Serializable
{
CompositeName cn = new CompositeName ();
for (int i = 0; i < posn; ++i)
- cn.elts.add ((String) elts.get (i));
+ cn.elts.add (elts.get (i));
return cn;
}
@@ -249,7 +249,7 @@ public class CompositeName implements Name, Cloneable, Serializable
throw new ArrayIndexOutOfBoundsException (posn);
CompositeName cn = new CompositeName ();
for (int i = posn; i < elts.size (); ++i)
- cn.elts.add ((String) elts.get (i));
+ cn.elts.add (elts.get (i));
return cn;
}
@@ -299,7 +299,7 @@ public class CompositeName implements Name, Cloneable, Serializable
{
// For simplicity we choose to always quote using escapes and
// never quotes.
- String elt = (String) elts.get (i);
+ String elt = elts.get (i);
if (i > 0
|| (i == elts.size () - 1 && elt.equals ("")))
result.append ('/');
@@ -327,9 +327,9 @@ public class CompositeName implements Name, Cloneable, Serializable
throws IOException, ClassNotFoundException
{
int size = s.readInt();
- elts = new Vector(size);
+ elts = new Vector<String>(size);
for (int i = 0; i < size; i++)
- elts.add(s.readObject());
+ elts.add((String) s.readObject());
}
private void writeObject(ObjectOutputStream s) throws IOException
OpenPOWER on IntegriCloud