directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r542329 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/message/ main/java/org/apache/directory/shared/ldap/message/extended/ main/java/org/apache/directory/shared/ldap/util/ test/java/org/apache/directory/...
Date Mon, 28 May 2007 21:53:22 GMT
Author: erodriguez
Date: Mon May 28 14:53:21 2007
New Revision: 542329

URL: http://svn.apache.org/viewvc?view=rev&rev=542329
Log:
Warnings clean-up in shared-ldap:  unnecessary cast.

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributesImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/UnixCrypt.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributesImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributesImpl.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributesImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/AttributesImpl.java
Mon May 28 14:53:21 2007
@@ -403,7 +403,7 @@
         {
             String key = StringTools.lowerCaseAscii( attrId );
             
-            return (AttributeImpl)keyMap.get( key );
+            return keyMap.get( key );
         }
         else
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/StoredProcedureRequest.java
Mon May 28 14:53:21 2007
@@ -101,7 +101,7 @@
     	StoredProcedureResponse resp = ( StoredProcedureResponse ) getResultResponse();
     	resp.setResponse( berValue );
     	resp.setOid( id );
-        return ( ExtendedResponse ) resp;
+        return resp;
     }
 
 
@@ -182,7 +182,7 @@
     {
         if ( ! this.procedure.getLanguage().equals( "java" ) )
         {
-            return ( ( StoredProcedureParameter ) procedure.getParameters().get( index )
).getType();
+            return procedure.getParameters().get( index ).getType();
         }
 
         return getJavaParameterType( index );
@@ -199,7 +199,7 @@
     {
         if ( ! this.procedure.getLanguage().equals( "java" ) )
         {
-            return ( ( StoredProcedureParameter ) procedure.getParameters().get( index )
).getValue();
+            return procedure.getParameters().get( index ).getValue();
         }
 
         return getJavaParameterValue( index );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
Mon May 28 14:53:21 2007
@@ -418,12 +418,12 @@
 
     static final int writeValueBytes( byte[] buf, String value )
     {
-        if ( ( ( String ) value ).length() == 0 )
+        if ( value.length() == 0 )
         {
             return 0;
         }
         
-        char[] strchars = ( ( String ) value ).toCharArray();
+        char[] strchars = value.toCharArray();
         int jj = 0;
         for ( int ii = 0; ii < strchars.length; ii++, jj = ii << 1 )
         {
@@ -436,12 +436,12 @@
     
     static final int writeValueBytes( byte[] buf, String value, int offset )
     {
-        if ( ( ( String ) value ).length() == 0 )
+        if ( value.length() == 0 )
         {
             return offset;
         }
         
-        char[] strchars = ( ( String ) value ).toCharArray();
+        char[] strchars = value.toCharArray();
         int jj = 0;
         for ( int ii = 0; ii < strchars.length; ii++, jj = ii << 1 )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/UnixCrypt.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/UnixCrypt.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/UnixCrypt.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/UnixCrypt.java
Mon May 28 14:53:21 2007
@@ -232,10 +232,10 @@
          for (int i=0; i<64; i++) perm[i] = (byte)0;
          for (int i=0; i<64; i++) {
              int k;
-             if ((k = (int)PC2[i]) == 0) continue;
+             if ((k = PC2[i]) == 0) continue;
              k += Rotates[0]-1;
              if ((k%28) < Rotates[0]) k -= 28;
-             k = (int)PC1[k];
+             k = PC1[k];
              if (k > 0) {
                  k--;
                  k = (k|0x07) - (k&0x07);
@@ -250,11 +250,11 @@
              int k;
              for (int i=0; i<64; i++) perm[i] = temp[i] = 0;
              for (int i=0; i<64; i++) {
-                 if ((k = (int)PC2[i]) == 0) continue;
+                 if ((k = PC2[i]) == 0) continue;
                  temp[k-1] = (byte)(i+1);
              }
              for (int i=0; i<64; i++) {
-                 if ((k = (int)PC2[i]) == 0) continue;
+                 if ((k = PC2[i]) == 0) continue;
                  k += j;
                  if ((k%28) <= j) k -= 28;
                  perm[i] = temp[k];
@@ -309,7 +309,7 @@
                  long kk = 0;
                  for (int i=24; --i>=0; ) kk = ((kk<<1) |
                                                 ((long)temp[perm[i]-1])<<32 |
-                                                ((long)temp[perm[i+24]-1]));
+                                                (temp[perm[i+24]-1]));
  
                  SPE[t][j] = to_six_bit(kk);
              }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
Mon May 28 14:53:21 2007
@@ -383,7 +383,7 @@
 
         assertEquals( 1, addResponse.getLdapResult().getReferrals().size() );
 
-        LdapURL referral = ( LdapURL ) addResponse.getLdapResult().getReferrals().get( 0
);
+        LdapURL referral = addResponse.getLdapResult().getReferrals().get( 0 );
 
         assertEquals( "ldap:///", referral.toString() );
 
@@ -458,11 +458,11 @@
 
         assertEquals( 2, addResponse.getLdapResult().getReferrals().size() );
 
-        LdapURL referral = ( LdapURL ) addResponse.getLdapResult().getReferrals().get( 0
);
+        LdapURL referral = addResponse.getLdapResult().getReferrals().get( 0 );
 
         assertEquals( "ldap:///", referral.toString() );
 
-        referral = ( LdapURL ) addResponse.getLdapResult().getReferrals().get( 1 );
+        referral = addResponse.getLdapResult().getReferrals().get( 1 );
 
         assertEquals( "ldap:///", referral.toString() );
 
@@ -537,11 +537,11 @@
 
         assertEquals( 2, addResponse.getLdapResult().getReferrals().size() );
 
-        LdapURL referral = ( LdapURL ) addResponse.getLdapResult().getReferrals().get( 0
);
+        LdapURL referral = addResponse.getLdapResult().getReferrals().get( 0 );
 
         assertEquals( "ldap:///", referral.toString() );
 
-        referral = ( LdapURL ) addResponse.getLdapResult().getReferrals().get( 1 );
+        referral = addResponse.getLdapResult().getReferrals().get( 1 );
 
         assertEquals( "ldap:///", referral.toString() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/operations/StoredProcedureTest.java
Mon May 28 14:53:21 2007
@@ -91,17 +91,17 @@
 
         Assert.assertEquals( 3, storedProcedure.getParameters().size() );
 
-        StoredProcedureParameter param = ( StoredProcedureParameter ) storedProcedure.getParameters().get(
0 );
+        StoredProcedureParameter param = storedProcedure.getParameters().get( 0 );
 
         Assert.assertEquals( "int", StringTools.utf8ToString( param.getType() ) );
         Assert.assertEquals( 1, param.getValue()[0] );
 
-        param = ( StoredProcedureParameter ) storedProcedure.getParameters().get( 1 );
+        param = storedProcedure.getParameters().get( 1 );
 
         Assert.assertEquals( "boolean", StringTools.utf8ToString( param.getType() ) );
         Assert.assertEquals( "true", StringTools.utf8ToString( param.getValue() ) );
 
-        param = ( StoredProcedureParameter ) storedProcedure.getParameters().get( 2 );
+        param = storedProcedure.getParameters().get( 2 );
 
         Assert.assertEquals( "String", StringTools.utf8ToString( param.getType() ) );
         Assert.assertEquals( "parameter3", StringTools.utf8ToString( param.getValue() ) );
@@ -219,7 +219,7 @@
 
         Assert.assertEquals( 1, storedProcedure.getParameters().size() );
 
-        StoredProcedureParameter param = ( StoredProcedureParameter ) storedProcedure.getParameters().get(
0 );
+        StoredProcedureParameter param = storedProcedure.getParameters().get( 0 );
 
         Assert.assertEquals( "int", StringTools.utf8ToString( param.getType() ) );
         Assert.assertEquals( 1, param.getValue()[0] );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
Mon May 28 14:53:21 2007
@@ -410,7 +410,7 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( null, substringFilter.getInitialSubstrings() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
         assertEquals( null, substringFilter.getFinalSubstrings() );
 
         // The attributes
@@ -532,7 +532,7 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( null, substringFilter.getInitialSubstrings() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
         assertEquals( "t", substringFilter.getFinalSubstrings().toString() );
 
         // The attributes
@@ -655,7 +655,7 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( "t", substringFilter.getInitialSubstrings().toString() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
         assertEquals( "t", substringFilter.getFinalSubstrings().toString() );
 
         // The attributes
@@ -777,7 +777,7 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( "t", substringFilter.getInitialSubstrings().toString() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
 
         // The attributes
         Attributes attributes = sr.getAttributes();
@@ -893,8 +893,8 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( null, substringFilter.getInitialSubstrings() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 1 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 1 ) );
         assertEquals( "t", substringFilter.getFinalSubstrings().toString() );
 
         // The attributes
@@ -1016,7 +1016,7 @@
 
         assertEquals( "objectclass", substringFilter.getType().toString() );
         assertEquals( "t", substringFilter.getInitialSubstrings().toString() );
-        assertEquals( "*", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
+        assertEquals( "*", substringFilter.getAnySubstrings().get( 0 ) );
 
         // The attributes
         Attributes attributes = sr.getAttributes();
@@ -1138,9 +1138,9 @@
 
         assertEquals( "objectclass", substringFilter.getType() );
         assertEquals( null, substringFilter.getInitialSubstrings() );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 0 ) ) );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 1 ) ) );
-        assertEquals( "t", ( ( String ) substringFilter.getAnySubstrings().get( 2 ) ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 0 ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 1 ) );
+        assertEquals( "t", substringFilter.getAnySubstrings().get( 2 ) );
         assertEquals( null, substringFilter.getFinalSubstrings() );
 
         // The attributes

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceTest.java
Mon May 28 14:53:21 2007
@@ -401,7 +401,7 @@
 
         assertEquals( 1, message.getMessageId() );
 
-        LdapURL ldapUrl = ( LdapURL ) searchResultReference.getSearchResultReferences().get(
0 );
+        LdapURL ldapUrl = searchResultReference.getSearchResultReferences().get( 0 );
 
         assertEquals( "ldap:///", ldapUrl.toString() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java?view=diff&rev=542329&r1=542328&r2=542329
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParserTest.java
Mon May 28 14:53:21 2007
@@ -365,13 +365,13 @@
         String firstExclusion = "{ specificExclusions { chopAfter:\"k=l\" } }";
         SubtreeSpecification firstSpec = parser.parse( firstExclusion );
         assertEquals( 1, firstSpec.getChopAfterExclusions().size() );
-        assertEquals( firstDN, (LdapDN)firstSpec.getChopAfterExclusions().iterator().next()
);
+        assertEquals( firstDN, firstSpec.getChopAfterExclusions().iterator().next() );
 
         LdapDN secondDN = new LdapDN("x=y");
         String secondExclusion = "{ specificExclusions { chopAfter:\"x=y\" } }";
         SubtreeSpecification secondSpec = parser.parse( secondExclusion );
         assertEquals( 1, secondSpec.getChopAfterExclusions().size() );
-        assertEquals( secondDN, (LdapDN)secondSpec.getChopAfterExclusions().iterator().next()
);
+        assertEquals( secondDN, secondSpec.getChopAfterExclusions().iterator().next() );
 
     }
 



Mime
View raw message