diff options
author | Matthias Klose <doko@gcc.gnu.org> | 2007-06-03 23:18:43 +0000 |
---|---|---|
committer | Matthias Klose <doko@gcc.gnu.org> | 2007-06-03 23:18:43 +0000 |
commit | e1bea0c0687c5f4551b3a6058ec37ce3705fa6cc (patch) | |
tree | a9c9e7d91c484d53fe154f9285fc57325572ce50 /libjava/classpath/javax/naming | |
parent | af333b9a7f9e1cc1029bec56d48f2de63acdf686 (diff) | |
download | gcc-e1bea0c0687c5f4551b3a6058ec37ce3705fa6cc.zip gcc-e1bea0c0687c5f4551b3a6058ec37ce3705fa6cc.tar.gz gcc-e1bea0c0687c5f4551b3a6058ec37ce3705fa6cc.tar.bz2 |
libjava/classpath/ChangeLog.gcj:
2007-05-31 Matthias Klose <doko@ubuntu.com>
* javax/management/NotificationBroadcasterSupport.java
(getNotificationInfo): Add cast.
* native/jni/qt-peer/Makefile.am (AM_CXXFLAGS): Add libstdc++ include
directories.
* native/jni/qt-peer/Makefile.in: Regenerate.
libjava/ChangeLog:
2007-06-03 Matthias Klose <doko@ubuntu.com>
* java/io/natFileWin32.cc (setFilePermissions): New (stub only).
_access: Handle EXEC query, stub only.
2007-06-03 Matthias Klose <doko@ubuntu.com>
Merged from classpath:
* gnu/java/nio/SelectorProviderImpl.java: Whitespace merge.
* java/lang/System.java(inheritedChannel): New.
* java/lang/Character.java: Remove stray`;'.
* java/net/MulticastSocket.java: Merged.
* java/text/DateFormatSymbols.java(getInstance): New, comment updates.
* java/text/Collator.java(getInstance): Merged.
* java/util/Calendar.java: New attributes ALL_STYLES, SHORT, LONG.
getDisplayName, getDisplayNames: New.
* java/util/logging/Logger.java: Merged.
* Regenerate .class and .h files.
2007-06-03 Matthias Klose <doko@ubuntu.com>
* java/io/File.java: Merge with classpath-0.95, new method
setFilePermissions, new attribute EXEC.
* java/io/natFilePosix.cc (setFilePermissions): New.
_access: Handle EXEC query.
* classpath/lib/java/io/File.class, java/io/File.h: Regenerate.
2007-06-03 Matthias Klose <doko@ubuntu.com>
Imported GNU Classpath 0.95.
* classpath/Makefile.in,
classpath/native/jni/midi-dssi/Makefile.in,
classpath/native/jni/classpath/Makefile.in,
classpath/native/jni/Makefile.in,
classpath/native/jni/gconf-peer/Makefile.in,
classpath/native/jni/java-io/Makefile.in,
classpath/native/jni/native-lib/Makefile.in,
classpath/native/jni/java-util/Makefile.in,
classpath/native/jni/midi-alsa/Makefile.in,
classpath/native/jni/java-lang/Makefile.in,
classpath/native/jni/java-nio/Makefile.in,
classpath/native/jni/java-net/Makefile.in,
classpath/native/jni/xmlj/Makefile.in,
classpath/native/jni/qt-peer/Makefile.in,
classpath/native/jni/gtk-peer/Makefile.in,
classpath/native/Makefile.in, classpath/native/jawt/Makefile.in,
classpath/native/fdlibm/Makefile.in,
classpath/native/plugin/Makefile.in,
classpath/resource/Makefile.in, classpath/scripts/Makefile.in,
classpath/tools/Makefile.in, classpath/doc/Makefile.in,
classpath/doc/api/Makefile.in, classpath/lib/Makefile.in,
classpath/external/Makefile.in, classpath/external/jsr166/Makefile.in,
classpath/external/sax/Makefile.in,
classpath/external/w3c_dom/Makefile.in,
classpath/external/relaxngDatatype/Makefile.in,
classpath/include/Makefile.in,
classpath/examples/Makefile.in: Regenerate.
* classpath/config.guess, classpath/config.sub,
classpath/ltmain.sh : Update.
* classpath/configure, classpath/depcomp, classpath/missing,
classpath/aclocal.m4, classpath/install-sh: Regenerate.
* gnu/classpath/Configuration.java (CLASSPATH_VERSION): Now 0.95.
* sources.am: Regenerate.
* Makefile.in: Regenerate.
* Update the .class files and generated CNI header files, add new
.class and generated CNI header files.
* Remove generated files for removed java source files:
classpath/gnu/java/net/BASE64.java,
classpath/gnu/java/security/util/Base64.java,
classpath/gnu/java/awt/peer/gtk/GThreadMutex.java,
classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,
classpath/gnu/java/awt/font/autofit/Scaler.java,
classpath/gnu/classpath/jdwp/util/Value.java,
classpath/gnu/javax/net/ssl/Base64.java.
* Remove empty directories.
* Makefile.am(nat_source_files): Add natVMOperatingSystemMXBeanImpl.cc.
* java/lang/Class.java(setAccessible): Merge from classpath.
* java/util/Locale.java: Remove.
* gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java,
gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc: New.
* gcj/javaprims.h: Update class declarations.
* scripts/classes.pl: Update usage.
* HACKING: Mention to build all peers.
From-SVN: r125302
Diffstat (limited to 'libjava/classpath/javax/naming')
8 files changed, 98 insertions, 73 deletions
diff --git a/libjava/classpath/javax/naming/CompositeName.java b/libjava/classpath/javax/naming/CompositeName.java index 6129321..7227f9d 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 diff --git a/libjava/classpath/javax/naming/CompoundName.java b/libjava/classpath/javax/naming/CompoundName.java index 703d44e..f345d3e 100644 --- a/libjava/classpath/javax/naming/CompoundName.java +++ b/libjava/classpath/javax/naming/CompoundName.java @@ -68,14 +68,14 @@ public class CompoundName implements Name, Cloneable, Serializable private CompoundName (Properties syntax) { - elts = new Vector (); + elts = new Vector<String> (); mySyntax = syntax; initializeSyntax (); } protected CompoundName (Enumeration<String> comps, Properties syntax) { - elts = new Vector (); + elts = new Vector<String> (); mySyntax = syntax; initializeSyntax (); try @@ -91,7 +91,7 @@ public class CompoundName implements Name, Cloneable, Serializable public CompoundName (String n, Properties syntax) throws InvalidNameException { - elts = new Vector (); + elts = new Vector<String> (); mySyntax = syntax; initializeSyntax (); @@ -186,7 +186,7 @@ public class CompoundName implements Name, Cloneable, Serializable int len = elts.size (); for (i = 0; i < len / 2; ++i) { - Object t = elts.set (i, elts.get (len - i - 1)); + String t = elts.set (i, elts.get (len - i - 1)); elts.set (len - i - 1, t); } } @@ -210,7 +210,7 @@ public class CompoundName 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 ()) @@ -227,7 +227,7 @@ public class CompoundName implements Name, Cloneable, Serializable public Name addAll (Name suffix) throws InvalidNameException { - Enumeration e = suffix.getAll (); + Enumeration<String> e = suffix.getAll (); try { while (e.hasMoreElements ()) @@ -252,8 +252,8 @@ public class CompoundName implements Name, Cloneable, Serializable int last = Math.min (cn.elts.size (), elts.size ()); for (int i = 0; i < last; ++i) { - String f = canonicalize ((String) elts.get (i)); - int comp = f.compareTo (canonicalize ((String) cn.elts.get (i))); + String f = canonicalize (elts.get (i)); + int comp = f.compareTo (canonicalize (cn.elts.get (i))); if (comp != 0) return comp; } @@ -270,8 +270,8 @@ public class CompoundName implements Name, Cloneable, Serializable int delta = elts.size () - cn.elts.size (); for (int i = 0; i < cn.elts.size (); ++i) { - String f = canonicalize ((String) elts.get (delta + i)); - if (! f.equals (canonicalize ((String) cn.elts.get (i)))) + String f = canonicalize (elts.get (delta + i)); + if (! f.equals (canonicalize (cn.elts.get (i)))) return false; } return true; @@ -286,7 +286,7 @@ public class CompoundName implements Name, Cloneable, Serializable public String get (int posn) { - return (String) elts.get (posn); + return elts.get (posn); } public Enumeration<String> getAll () @@ -316,7 +316,7 @@ public class CompoundName implements Name, Cloneable, Serializable { int h = 0; for (int i = 0; i < elts.size (); ++i) - h += canonicalize ((String) elts.get (i)).hashCode (); + h += canonicalize (elts.get (i)).hashCode (); return h; } @@ -344,8 +344,8 @@ public class CompoundName implements Name, Cloneable, Serializable return false; for (int i = 0; i < cn.elts.size (); ++i) { - String f = canonicalize ((String) elts.get (i)); - if (! f.equals (canonicalize ((String) cn.elts.get (i)))) + String f = canonicalize (elts.get (i)); + if (! f.equals (canonicalize (cn.elts.get (i)))) return false; } return true; @@ -383,7 +383,7 @@ public class CompoundName implements Name, Cloneable, Serializable // Find the appropriate element. FIXME: not clear what FLAT // means. int offset = (direction == RIGHT_TO_LEFT) ? (size - i - 1) : i; - String element = (String) elts.get (offset); + String element = elts.get (offset); if (i > 0 || (i == size - 1 && element.equals (""))) result.append (separator); @@ -478,7 +478,7 @@ public class CompoundName implements Name, Cloneable, Serializable { mySyntax = (Properties) s.readObject(); int count = s.readInt(); - elts = new Vector(count); + elts = new Vector<String>(count); for (int i = 0; i < count; i++) elts.addElement((String) s.readObject()); } @@ -499,7 +499,7 @@ public class CompoundName implements Name, Cloneable, Serializable protected transient Properties mySyntax; // The actual elements. - private transient Vector elts; + private transient Vector<String> elts; // The following are all used for syntax. private transient int direction; diff --git a/libjava/classpath/javax/naming/InitialContext.java b/libjava/classpath/javax/naming/InitialContext.java index 1a3b1e3..a5fe5f0 100644 --- a/libjava/classpath/javax/naming/InitialContext.java +++ b/libjava/classpath/javax/naming/InitialContext.java @@ -80,14 +80,14 @@ public class InitialContext implements Context * be appended after the colon to the first possible value. Used in * {@link #merge(Hashtable, Hashtable)} */ - static final HashSet colon_list; + static final HashSet<String> colon_list; static { - colon_list = new HashSet(); + colon_list = new HashSet<String>(); colon_list.add(Context.OBJECT_FACTORIES); colon_list.add(Context.URL_PKG_PREFIXES); colon_list.add(Context.STATE_FACTORIES); - }; + } /** * The properties that are searched in the agreed places in the @@ -262,7 +262,8 @@ public class InitialContext implements Context * in this table. * @param additional the second table, from where additional values are taken */ - static void merge (Hashtable primary, Hashtable additional) + static void merge (Hashtable<Object, Object> primary, + Hashtable<Object, Object> additional) { Enumeration en = additional.keys(); diff --git a/libjava/classpath/javax/naming/Reference.java b/libjava/classpath/javax/naming/Reference.java index 3379bd5..fedbf58 100644 --- a/libjava/classpath/javax/naming/Reference.java +++ b/libjava/classpath/javax/naming/Reference.java @@ -83,7 +83,7 @@ public class Reference implements Cloneable, Serializable public Reference (String className) { this.className = className; - addrs = new Vector (); + addrs = new Vector<RefAddr> (); } /** @@ -93,7 +93,7 @@ public class Reference implements Cloneable, Serializable public Reference (String className, RefAddr addr) { this.className = className; - addrs = new Vector (); + addrs = new Vector<RefAddr> (); addrs.add (addr); } @@ -112,7 +112,7 @@ public class Reference implements Cloneable, Serializable this.className = className; this.classFactory = factoryClassName; this.classFactoryLocation = factoryLocation; - addrs = new Vector (); + addrs = new Vector<RefAddr> (); } /** @@ -131,7 +131,7 @@ public class Reference implements Cloneable, Serializable this.className = className; this.classFactory = factoryClassName; this.classFactoryLocation = factoryLocation; - addrs = new Vector (); + addrs = new Vector<RefAddr> (); addrs.add (addr); } @@ -164,7 +164,7 @@ public class Reference implements Cloneable, Serializable { Reference r = new Reference (className, classFactory, classFactoryLocation); - r.addrs = (Vector) addrs.clone (); + r.addrs = (Vector<RefAddr>) addrs.clone (); return r; } @@ -193,7 +193,7 @@ public class Reference implements Cloneable, Serializable */ public RefAddr get (int posn) { - return (RefAddr) addrs.get (posn); + return addrs.get (posn); } /** @@ -208,7 +208,7 @@ public class Reference implements Cloneable, Serializable { for (int i = 0; i < addrs.size (); ++i) { - RefAddr r = (RefAddr) addrs.get (i); + RefAddr r = addrs.get (i); if (addrType.equals (r.getType ())) return r; } diff --git a/libjava/classpath/javax/naming/directory/BasicAttribute.java b/libjava/classpath/javax/naming/directory/BasicAttribute.java index 5a1bb0e..2715c96 100644 --- a/libjava/classpath/javax/naming/directory/BasicAttribute.java +++ b/libjava/classpath/javax/naming/directory/BasicAttribute.java @@ -78,7 +78,7 @@ public class BasicAttribute implements Attribute { attrID = id; this.ordered = ordered; - values = new Vector (); + values = new Vector<Object> (); } public BasicAttribute (String id, Object value) @@ -90,7 +90,7 @@ public class BasicAttribute implements Attribute { attrID = id; this.ordered = ordered; - values = new Vector (); + values = new Vector<Object> (); values.add (value); } @@ -118,7 +118,7 @@ public class BasicAttribute implements Attribute BasicAttribute c = new BasicAttribute (); c.attrID = attrID; c.ordered = ordered; - c.values = (Vector) values.clone (); + c.values = (Vector<Object>) values.clone (); return c; } @@ -307,7 +307,7 @@ public class BasicAttribute implements Attribute { s.defaultReadObject(); int size = s.readInt(); - values = new Vector(size); + values = new Vector<Object>(size); for (int i=0; i < size; i++) values.add(s.readObject()); } diff --git a/libjava/classpath/javax/naming/directory/BasicAttributes.java b/libjava/classpath/javax/naming/directory/BasicAttributes.java index 6880f5b..54b1f19 100644 --- a/libjava/classpath/javax/naming/directory/BasicAttributes.java +++ b/libjava/classpath/javax/naming/directory/BasicAttributes.java @@ -63,7 +63,7 @@ public class BasicAttributes implements Attributes public BasicAttributes (boolean ignoreCase) { this.ignoreCase = ignoreCase; - this.attributes = new Vector (); + this.attributes = new Vector<Attribute>(); } public BasicAttributes (String attrID, Object val) @@ -74,7 +74,7 @@ public class BasicAttributes implements Attributes public BasicAttributes (String attrID, Object val, boolean ignoreCase) { this.ignoreCase = ignoreCase; - attributes = new Vector (); + attributes = new Vector<Attribute>(); attributes.add (new BasicAttribute (attrID, val)); } @@ -82,7 +82,7 @@ public class BasicAttributes implements Attributes { // Slightly inefficient as we make a garbage Vector here. BasicAttributes ba = new BasicAttributes (ignoreCase); - ba.attributes = (Vector) attributes.clone (); + ba.attributes = (Vector<Attribute>) attributes.clone (); return ba; } @@ -117,7 +117,7 @@ public class BasicAttributes implements Attributes { for (int i = 0; i < attributes.size (); ++i) { - Attribute at = (Attribute) attributes.get (i); + Attribute at = attributes.get (i); if ((ignoreCase && attrID.equalsIgnoreCase (at.getID ())) || (! ignoreCase && attrID.equals (at.getID ()))) return at; @@ -128,12 +128,38 @@ public class BasicAttributes implements Attributes public NamingEnumeration<Attribute> getAll () { - return new BasicAttributesEnumeration (false); + return new BasicAttributesEnumeration(); } public NamingEnumeration<String> getIDs () { - return new BasicAttributesEnumeration (true); + final NamingEnumeration<Attribute> attrs = getAll(); + return new NamingEnumeration<String>() { + public boolean hasMore() throws NamingException + { + return attrs.hasMore(); + } + + public boolean hasMoreElements() + { + return attrs.hasMoreElements(); + } + + public String next() throws NamingException + { + return attrs.next().getID(); + } + + public String nextElement() + { + return attrs.nextElement().getID(); + } + + public void close() throws NamingException + { + attrs.close(); + } + }; } public int hashCode () @@ -197,16 +223,16 @@ public class BasicAttributes implements Attributes // This is set by the serialization spec. private boolean ignoreCase; // Package-private to avoid a trampoline. - transient Vector attributes; + transient Vector<Attribute> attributes; private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); int size = s.readInt(); - attributes = new Vector(size); + attributes = new Vector<Attribute>(size); for (int i = 0; i < size; i++) - attributes.add(s.readObject()); + attributes.add((Attribute) s.readObject()); } private void writeObject(ObjectOutputStream s) throws IOException @@ -218,14 +244,13 @@ public class BasicAttributes implements Attributes } // Used when enumerating. - private class BasicAttributesEnumeration implements NamingEnumeration + private class BasicAttributesEnumeration + implements NamingEnumeration<Attribute> { int where = 0; - boolean id; - public BasicAttributesEnumeration (boolean id) + public BasicAttributesEnumeration () { - this.id = id; } public void close () throws NamingException @@ -237,7 +262,7 @@ public class BasicAttributes implements Attributes return hasMoreElements (); } - public Object next () throws NamingException + public Attribute next () throws NamingException { return nextElement (); } @@ -247,13 +272,13 @@ public class BasicAttributes implements Attributes return where < attributes.size (); } - public Object nextElement () throws NoSuchElementException + public Attribute nextElement () throws NoSuchElementException { if (where >= attributes.size ()) throw new NoSuchElementException ("no more elements"); - Attribute at = (Attribute) attributes.get (where); + Attribute at = attributes.get (where); ++where; - return id ? (Object) at.getID () : (Object) at; + return at; } } } diff --git a/libjava/classpath/javax/naming/ldap/InitialLdapContext.java b/libjava/classpath/javax/naming/ldap/InitialLdapContext.java index f9493c3..1a29c6a 100644 --- a/libjava/classpath/javax/naming/ldap/InitialLdapContext.java +++ b/libjava/classpath/javax/naming/ldap/InitialLdapContext.java @@ -66,13 +66,13 @@ public class InitialLdapContext { super (false); - Hashtable myenv = null; + Hashtable<Object, Object> myenv = null; if (connControls != null) { if (environment == null) - myenv = new Hashtable (); + myenv = new Hashtable<Object, Object> (); else - myenv = (Hashtable) environment.clone (); + myenv = (Hashtable<Object, Object>) environment.clone (); myenv.put ("java.naming.ldap.control.connect", connControls); } diff --git a/libjava/classpath/javax/naming/spi/Resolver.java b/libjava/classpath/javax/naming/spi/Resolver.java index f017905..67174cf 100644 --- a/libjava/classpath/javax/naming/spi/Resolver.java +++ b/libjava/classpath/javax/naming/spi/Resolver.java @@ -41,15 +41,14 @@ package javax.naming.spi; import javax.naming.Context; import javax.naming.Name; import javax.naming.NamingException; -import javax.naming.NotContextException; /** -+ * <p>Represents the object, capable for the at least partial name resolution. -+ * The object is not necessay capable for the complete name resolution and -+ * need not implement the {@link Context}.</p> -+ * <p> -+ * Both passed parameters and returned results are owned by the caller.</p> -+ * + * <p>Represents the object, capable for the at least partial name resolution. + * The object is not necessay capable for the complete name resolution and + * need not implement the {@link Context}.</p> + * <p> + * Both passed parameters and returned results are owned by the caller.</p> + * * @author Warren Levy (warrenl@redhat.com) */ public interface Resolver |