directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r570260 - in /directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap: ldif/Entry.java util/SingletonEnumeration.java
Date Mon, 27 Aug 2007 22:17:38 GMT
Author: akarasulu
Date: Mon Aug 27 15:17:37 2007
New Revision: 570260

URL: http://svn.apache.org/viewvc?rev=570260&view=rev
Log:
generics cleanups

Modified:
    directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
    directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SingletonEnumeration.java

Modified: directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java?rev=570260&r1=570259&r2=570260&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
(original)
+++ directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
Mon Aug 27 15:17:37 2007
@@ -184,7 +184,7 @@
                 ModificationItemImpl item = modificationItems.get( attr.getID() );
                 Attribute attribute = item.getAttribute();
 
-                Enumeration attrs = attr.getAll();
+                Enumeration<?> attrs = attr.getAll();
 
                 while ( attrs.hasMoreElements() )
                 {
@@ -495,7 +495,7 @@
     /**
      * Clone method
      */
-    public Object clone() throws CloneNotSupportedException
+    public Entry clone() throws CloneNotSupportedException
     {
         Entry clone = (Entry) super.clone();
 
@@ -538,13 +538,13 @@
         
         try
         {
-            for ( NamingEnumeration attrs = attributeList.getAll(); attrs.hasMoreElements();
)
+            for ( NamingEnumeration<? extends Attribute> attrs = attributeList.getAll();
attrs.hasMoreElements(); )
             {
-                Attribute attribute = (Attribute) attrs.nextElement();
+                Attribute attribute = attrs.nextElement();
     
                 sb.append( "        ").append( attribute.getID() ).append( ":\n" );
     
-                for ( NamingEnumeration values = attribute.getAll(); values.hasMoreElements();
)
+                for ( NamingEnumeration<?> values = attribute.getAll(); values.hasMoreElements();
)
                 {
                     Object value = values.nextElement();
                     
@@ -601,7 +601,7 @@
             {
                 try
                 {
-                    for ( NamingEnumeration values = attribute.getAll(); values.hasMoreElements();
)
+                    for ( NamingEnumeration<?> values = attribute.getAll(); values.hasMoreElements();
)
                     {
                         Object value = values.nextElement();
     

Modified: directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SingletonEnumeration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SingletonEnumeration.java?rev=570260&r1=570259&r2=570260&view=diff
==============================================================================
--- directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SingletonEnumeration.java
(original)
+++ directory/sandbox/akarasulu/refactoring-shared-trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/SingletonEnumeration.java
Mon Aug 27 15:17:37 2007
@@ -31,10 +31,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public class SingletonEnumeration implements NamingEnumeration
+public class SingletonEnumeration<T> implements NamingEnumeration<T>
 {
     /** The singleton element to return */
-    private final Object m_element;
+    private final T m_element;
 
     /** Can we return a element */
     private boolean m_hasMore = true;
@@ -46,7 +46,7 @@
      * @param a_element
      *            TODO
      */
-    public SingletonEnumeration(final Object a_element)
+    public SingletonEnumeration(final T a_element)
     {
         m_element = a_element;
     }
@@ -75,7 +75,7 @@
     /**
      * @see javax.naming.NamingEnumeration#next()
      */
-    public Object next()
+    public T next()
     {
         if ( m_hasMore )
         {
@@ -99,7 +99,7 @@
     /**
      * @see java.util.Enumeration#nextElement()
      */
-    public Object nextElement()
+    public T nextElement()
     {
         return next();
     }



Mime
View raw message