directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065078 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java
Date Sat, 29 Jan 2011 17:25:05 GMT
Author: akarasulu
Date: Sat Jan 29 17:25:04 2011
New Revision: 1065078

URL: http://svn.apache.org/viewvc?rev=1065078&view=rev
Log:
it will build now but with failures

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java?rev=1065078&r1=1065077&r2=1065078&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
Sat Jan 29 17:25:04 2011
@@ -95,6 +95,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings("unchecked")
     public <E> E newCodecControl( Class<? extends ICodecControl<? extends Control>>
clazz )
     {
         try
@@ -102,7 +103,7 @@ public class DefaultLdapCodecService imp
             Field f = clazz.getField( "OID" );
             String oid = ( String ) f.get( null );
             IControlFactory<?,?> factory = controlFactories.get( oid );
-            return extracted2( factory );
+            return ( E ) factory.newCodecControl();
         }
         catch ( IllegalAccessException e )
         {
@@ -124,6 +125,7 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings("unchecked")
     public <E> E newControl( Class<? extends Control> clazz )
     {
         try
@@ -131,7 +133,7 @@ public class DefaultLdapCodecService imp
             Field f = clazz.getField( "OID" );
             String oid = ( String ) f.get( null );
             IControlFactory<?,?> factory = controlFactories.get( oid );
-            return extracted( factory );
+            return ( E ) factory.newControl();
         }
         catch ( IllegalAccessException e )
         {
@@ -160,25 +162,12 @@ public class DefaultLdapCodecService imp
 
     
     @SuppressWarnings("unchecked")
-    private <E> E extracted( IControlFactory<?,?> factory )
-    {
-        return ( E ) factory.newControl();
-    }
-
-    
-    @SuppressWarnings("unchecked")
-    private <E> E extracted2( IControlFactory<?,?> factory )
-    {
-        return ( E ) factory.newCodecControl();
-    }
-
-
     public <E> E newControl( String oid )
     {
         try
         {
             IControlFactory<?,?> factory = controlFactories.get( oid );
-            return extracted( factory );
+            return ( E ) factory.newControl();
         }
         catch ( SecurityException e )
         {

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java?rev=1065078&r1=1065077&r2=1065078&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java
Sat Jan 29 17:25:04 2011
@@ -44,6 +44,7 @@ public class TestLdapCodecService implem
     }
 
 
+    @SuppressWarnings("unchecked")
     public <E> E newCodecControl( Class<? extends ICodecControl<? extends Control>>
clazz )
     {
         try
@@ -51,7 +52,7 @@ public class TestLdapCodecService implem
             Field f = clazz.getField( "OID" );
             String oid = ( String ) f.get( null );
             IControlFactory<?,?> factory = factories.get( oid );
-            return extracted2( factory );
+            return ( E ) factory.newCodecControl();
         }
         catch ( IllegalAccessException e )
         {
@@ -70,6 +71,7 @@ public class TestLdapCodecService implem
     }
 
     
+    @SuppressWarnings("unchecked")
     public <E> E newControl( Class<? extends Control> clazz )
     {
         try
@@ -77,7 +79,7 @@ public class TestLdapCodecService implem
             Field f = clazz.getField( "OID" );
             String oid = ( String ) f.get( null );
             IControlFactory<?,?> factory = factories.get( oid );
-            return extracted( factory );
+            return ( E ) factory.newControl();
         }
         catch ( IllegalAccessException e )
         {
@@ -96,18 +98,6 @@ public class TestLdapCodecService implem
     }
 
     
-    @SuppressWarnings("unchecked")
-    private <E> E extracted( IControlFactory<?,?> factory )
-    {
-        return ( E ) factory.newControl();
-    }
-
-    @SuppressWarnings("unchecked")
-    private <E> E extracted2( IControlFactory<?,?> factory )
-    {
-        return ( E ) factory.newCodecControl();
-    }
-
     public Iterator<String> controlOids()
     {
         return null;



Mime
View raw message