directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1588422 - in /directory/shared/trunk: asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/ ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/contro...
Date Fri, 18 Apr 2014 08:17:00 GMT
Author: elecharny
Date: Fri Apr 18 08:17:00 2014
New Revision: 1588422

URL: http://svn.apache.org/r1588422
Log:
Removed warnings

Modified:
    directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ExtendedRequestDecorator.java
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
    directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsFactory.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsResponseDecorator.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIFactory.java
    directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/ResultCodeEnum.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/Registries.java
    directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/OsgiUtils.java

Modified: directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
(original)
+++ directory/shared/trunk/asn1/ber/src/main/java/org/apache/directory/api/asn1/ber/Asn1Decoder.java
Fri Apr 18 08:17:00 2014
@@ -588,6 +588,7 @@ public class Asn1Decoder implements TLVB
      * </code> otherwise
      * @throws DecoderException Thrown if anything went wrong
      */
+    @SuppressWarnings("unchecked")
     private boolean treatTLVDoneState( ByteBuffer stream, Asn1Container container ) throws
DecoderException
     {
         if ( IS_DEBUG )

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ExtendedRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ExtendedRequestDecorator.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ExtendedRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/api/ExtendedRequestDecorator.java
Fri Apr 18 08:17:00 2014
@@ -158,7 +158,6 @@ public class ExtendedRequestDecorator<Q 
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public ExtendedRequest addControl( Control control )
     {
         return ( ExtendedRequest ) super.addControl( control );
@@ -168,7 +167,6 @@ public class ExtendedRequestDecorator<Q 
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public ExtendedRequest addAllControls( Control[] controls )
     {
         return ( ExtendedRequest ) super.addAllControls( controls );
@@ -178,7 +176,6 @@ public class ExtendedRequestDecorator<Q 
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public ExtendedRequest removeControl( Control control )
     {
         return ( ExtendedRequest ) super.removeControl( control );

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortRequestGrammar.java
Fri Apr 18 08:17:00 2014
@@ -49,9 +49,10 @@ public class SortRequestGrammar extends 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. SortRequestGrammar is a singleton */
-    private static Grammar<?> instance = new SortRequestGrammar();
+    private static Grammar<SortRequestContainer> instance = new SortRequestGrammar();
 
 
+    @SuppressWarnings("unchecked")
     private SortRequestGrammar()
     {
         setName( SortRequestGrammar.class.getName() );

Modified: directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
(original)
+++ directory/shared/trunk/ldap/codec/core/src/main/java/org/apache/directory/api/ldap/codec/controls/sort/SortResponseGrammar.java
Fri Apr 18 08:17:00 2014
@@ -46,9 +46,10 @@ public class SortResponseGrammar extends
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. SortResponseGrammar is a singleton */
-    private static Grammar<?> instance = new SortResponseGrammar();
+    private static Grammar<SortResponseContainer> instance = new SortResponseGrammar();
 
 
+    @SuppressWarnings("unchecked")
     private SortResponseGrammar()
     {
         setName( SortResponseGrammar.class.getName() );

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/pwdModify/PasswordModifyFactory.java
Fri Apr 18 08:17:00 2014
@@ -124,6 +124,7 @@ public class PasswordModifyFactory imple
         }
 
         // It's an opaque extended operation
+        @SuppressWarnings("unchecked")
         ExtendedResponseDecorator<ExtendedResponse> response = ( ExtendedResponseDecorator<ExtendedResponse>
) decoratedResponse;
 
         // Decode the response, as it's an opaque operation

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsFactory.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsFactory.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsFactory.java
Fri Apr 18 08:17:00 2014
@@ -116,6 +116,7 @@ public class StartTlsFactory implements 
         }
 
         // It's an opaque extended operation
+        @SuppressWarnings("unchecked")
         ExtendedResponseDecorator<ExtendedResponse> response = ( ExtendedResponseDecorator<ExtendedResponse>
) decoratedResponse;
 
         // Decode the response, as it's an opaque operation

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsResponseDecorator.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsResponseDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/startTls/StartTlsResponseDecorator.java
Fri Apr 18 08:17:00 2014
@@ -33,12 +33,9 @@ import org.apache.directory.api.util.Str
  */
 public class StartTlsResponseDecorator extends ExtendedResponseDecorator<StartTlsResponse>
implements StartTlsResponse
 {
-    private StartTlsResponse startTlsResponse;
-
     public StartTlsResponseDecorator( LdapApiService codec, StartTlsResponse decoratedMessage
)
     {
         super( codec, decoratedMessage );
-        startTlsResponse = decoratedMessage;
     }
 
 

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIFactory.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIFactory.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIFactory.java
Fri Apr 18 08:17:00 2014
@@ -122,6 +122,7 @@ public class WhoAmIFactory implements Ex
         }
 
         // It's an opaque extended operation
+        @SuppressWarnings("unchecked")
         ExtendedResponseDecorator<ExtendedResponse> response = ( ExtendedResponseDecorator<ExtendedResponse>
) decoratedResponse;
 
         // Decode the response, as it's an opaque operation

Modified: directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseTest.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseTest.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/test/java/org/apache/directory/api/ldap/extras/extended/ads_impl/whoAmI/WhoAmIResponseTest.java
Fri Apr 18 08:17:00 2014
@@ -62,7 +62,7 @@ public class WhoAmIResponseTest
         stream.put( new byte[]
             {} ).flip();
 
-        String decodedPdu = Strings.dumpBytes( stream.array() );
+        Strings.dumpBytes( stream.array() );
 
         // Allocate a WhoAmI Container
         Asn1Container whoAmIResponseContainer = new WhoAmIResponseContainer();

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
Fri Apr 18 08:17:00 2014
@@ -991,7 +991,6 @@ public final class DefaultEntry implemen
      * the original object won't affect the cloned object, as a modification
      * on the cloned object has no impact on the original object
      */
-    @SuppressWarnings("unchecked")
     public Entry clone()
     {
         // First, clone the structure

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifEntry.java
Fri Apr 18 08:17:00 2014
@@ -223,6 +223,15 @@ public class LdifEntry implements Clonea
         // Now, parse the Ldif and convert it to a LdifEntry
         LdifReader reader = new LdifReader();
         List<LdifEntry> ldifEntries = reader.parseLdif( sb.toString() );
+        
+        try
+        {
+            reader.close();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
 
         if ( ( ldifEntries != null ) && ( ldifEntries.size() == 1 ) )
         {
@@ -258,6 +267,7 @@ public class LdifEntry implements Clonea
                     {
                         modifications.put( modification.getAttribute().getId(), modification
);
                     }
+                    
                     break;
             }
         }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/ldif/LdifUtils.java
Fri Apr 18 08:17:00 2014
@@ -20,6 +20,7 @@
 package org.apache.directory.api.ldap.model.ldif;
 
 
+import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 
 import javax.naming.directory.Attributes;
@@ -269,7 +270,18 @@ public final class LdifUtils
     {
         LdifAttributesReader reader = new LdifAttributesReader();
 
-        return AttributeUtils.toAttributes( reader.parseEntry( ldif ) );
+        try
+        {
+            Attributes attributes = AttributeUtils.toAttributes( reader.parseEntry( ldif
) );
+            
+            reader.close();
+            
+            return attributes;
+        }
+        catch ( IOException ioe )
+        {
+            throw new LdapLdifException( ioe.getMessage() );
+        }
     }
 
 
@@ -727,6 +739,15 @@ public final class LdifUtils
 
         LdifAttributesReader reader = new LdifAttributesReader();
         Attributes attributes = AttributeUtils.toAttributes( reader.parseEntry( sb.toString()
) );
+        
+        try
+        {
+            reader.close();
+        }
+        catch ( IOException e )
+        {
+            e.printStackTrace();
+        }
 
         return attributes;
     }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/ResultCodeEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/ResultCodeEnum.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/ResultCodeEnum.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/message/ResultCodeEnum.java
Fri Apr 18 08:17:00 2014
@@ -1693,6 +1693,10 @@ public enum ResultCodeEnum
 
             case UNBIND_REQUEST:
                 return set.iterator().next();
+                
+            case INTERMEDIATE_RESPONSE :
+                candidates = intersection( set, SEARCH_CODES );
+                break;
         }
 
         // we don't want any codes that do not have anything to do w/ errors

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/Registries.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/Registries.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/schema/registries/Registries.java
Fri Apr 18 08:17:00 2014
@@ -725,6 +725,22 @@ public class Registries implements Schem
                 case OBJECT_CLASS:
                     ObjectClassHelper.removeFromRegistries( ( ObjectClass ) schemaObject,
errors, this );
                     break;
+                    
+                case DIT_CONTENT_RULE :
+                    // TODO
+                    break;
+                    
+                case DIT_STRUCTURE_RULE :
+                    // TODO
+                    break;
+                    
+                case NAME_FORM :
+                    // TODO
+                    break;
+                    
+                case MATCHING_RULE_USE :
+                    // TODO
+                    break;
             }
         }
         catch ( LdapException ne )

Modified: directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java
Fri Apr 18 08:17:00 2014
@@ -209,9 +209,11 @@ public class DefaultSchemaLdifExtractor 
 
         FileWriter out = new FileWriter( destination );
 
+        LdifReader ldifReader = null;
+        
         try
         {
-            LdifReader ldifReader = new LdifReader( source );
+            ldifReader = new LdifReader( source );
             boolean first = true;
             LdifEntry ldifEntry = null;
 
@@ -239,8 +241,6 @@ public class DefaultSchemaLdifExtractor 
                 }
             }
 
-            ldifReader.close();
-
             // Add the version at the first line, to avoid a warning
             String ldifString = "version: 1\n" + ldifEntry.toString();
 
@@ -261,6 +261,7 @@ public class DefaultSchemaLdifExtractor 
         }
         finally
         {
+            ldifReader.close();
             out.close();
         }
     }

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/OsgiUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/OsgiUtils.java?rev=1588422&r1=1588421&r2=1588422&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/OsgiUtils.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/OsgiUtils.java
Fri Apr 18 08:17:00 2014
@@ -181,7 +181,7 @@ public class OsgiUtils
      */
     public static String getBundleExports( File bundle )
     {
-        JarFile jar;
+        JarFile jar = null;
         try
         {
             jar = new JarFile( bundle );
@@ -207,5 +207,19 @@ public class OsgiUtils
             LOG.error( "Failed to open jar file or manifest.", e );
             throw new RuntimeException( "Failed to open jar file or manifest.", e );
         }
+        finally
+        {
+            if ( jar != null )
+            {
+                try
+                {
+                    jar.close();
+                }
+                catch ( IOException e )
+                {
+                    e.printStackTrace();
+                }
+            }
+        }
     }
 }



Mime
View raw message