directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r496272 - in /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema: ByteArrayComparator.java ObjectIdentifierComparator.java PrepareString.java RegexNormalizer.java
Date Mon, 15 Jan 2007 10:51:13 GMT
Author: elecharny
Date: Mon Jan 15 02:51:12 2007
New Revision: 496272

URL: http://svn.apache.org/viewvc?view=rev&rev=496272
Log:
Cleaning some waring found by findBugs. Remove dead code

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectIdentifierComparator.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java?view=diff&rev=496272&r1=496271&r2=496272
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ByteArrayComparator.java
Mon Jan 15 02:51:12 2007
@@ -45,19 +45,14 @@
         // Handle some basis cases
         // -------------------------------------------------------------------
 
-        if ( ( b1 == null ) && ( b2 == null ) )
+        if ( b1 == null )
         {
-            return 0;
+            return ( b2 == null ) ? 0 : -1;
         }
         
-        if ( ( b1 != null ) && ( b2 == null ) )
+        if ( b2 == null )
         {
             return 1;
-        }
-        
-        if ( ( b1 == null ) && ( b2 != null ) )
-        {
-            return -1;
         }
         
         if ( b1.length == b2.length )

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectIdentifierComparator.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectIdentifierComparator.java?view=diff&rev=496272&r1=496271&r2=496272
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectIdentifierComparator.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectIdentifierComparator.java
Mon Jan 15 02:51:12 2007
@@ -37,17 +37,13 @@
 
     public int compare( Object o1, Object o2 )
     {
-        if ( ( o1 == null ) && ( o2 == null ) )
+        if ( o1 == null )
         {
-            return 0;
+            return ( o2 == null ) ? 0 : -1;
         }
-        else if ( ( o1 != null ) && ( o2 == null ) )
+        else if ( o2 == null )
         {
             return 1;
-        }
-        else if ( ( o1 == null ) && ( o2 != null ) )
-        {
-            return -1;
         }
 
         if ( o1.equals( o2 ) )

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java?view=diff&rev=496272&r1=496271&r2=496272
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/PrepareString.java
Mon Jan 15 02:51:12 2007
@@ -4682,20 +4682,6 @@
 
     /**
      * 
-     * The 6 possible states for the insignifiant state machine
-     */
-    private enum State 
-    {
-        START,
-        START_SPACE,
-        INNER_START_SPACE,
-        CHAR,
-        COMBINING,
-        INNER_SPACE
-    }
-
-    /**
-     * 
      * Remove all insignifiant spaces in a string.
      * 
      * This method use a finite state machine to parse
@@ -4720,8 +4706,6 @@
         // TODO : we have to find a way to prevent this waste of space.
         char[] target = new char[ str.length() * 3 + 2 ];
         
-        // Initialise the starting state
-        State state = State.START;
         int pos = 0;
         char lowerCase = (char)( caseSensitive ? 0x00 : 0x20 );
         
@@ -4846,120 +4830,6 @@
                 target[pos++] = c;
             }
         }
-                
-
-            /*
-            switch ( state )
-            {
-                case START :
-                    if ( c == ' ' )
-                    {
-                        state = State.START_SPACE;
-                    }
-                    else if ( isCombiningMark( c ) )
-                    {
-                        // The first char can't be a combining char
-                        throw new InvalidCharacterException( c );
-                    }
-                    else
-                    {
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                        
-                        state = State.CHAR;
-                    }
-
-                    break;
-                    
-                case START_SPACE :
-                    if ( isCombiningMark( c ) )
-                    {
-                        state = State.COMBINING;
-                        target[pos++] = 0x0020;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-                    else if ( c != ' ' )
-                    {
-                        state = State.CHAR;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-
-                    break;
-                     
-                case CHAR :
-                    if ( c == ' ' )
-                    {
-                        state = State.INNER_START_SPACE;
-                    }
-                    else if ( isCombiningMark( c ) )
-                    {
-                        state = State.COMBINING;
-                        target[pos++] = c;
-                    }
-                    else
-                    {
-                        target[pos++] = c;
-                    }
-                    
-                    break;
-                    
-                case COMBINING :
-                    if ( c == ' ' )
-                    {
-                        state = State.INNER_START_SPACE;
-                    }
-                    else if ( !isCombiningMark( c ) )
-                    {
-                        state = State.CHAR;
-                        target[pos++] = c;
-                    }
-                    else
-                    {
-                        target[pos++] = c;
-                    }
-                    
-                    break;
-                    
-                case INNER_START_SPACE :
-                    if ( isCombiningMark( c ) )
-                    {
-                        state = State.COMBINING;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-                    else if ( c == ' ' )
-                    {
-                        state = State.INNER_SPACE;
-                    }
-                    else
-                    {
-                        state = State.CHAR;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-                    
-                    break;
-
-                case INNER_SPACE :
-                    if ( isCombiningMark( c ) )
-                    {
-                        state = State.COMBINING;
-                        target[pos++] = 0x0020;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-                    else if ( c != ' ' )
-                    {
-                        state = State.CHAR;
-                        target[pos++] = 0x0020;
-                        target[pos++] = c;
-                    }
-                    
-                    break;
-            }
-            */
         
         return new String( target, 0, pos );
     }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java?view=diff&rev=496272&r1=496271&r2=496272
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java
Mon Jan 15 02:51:12 2007
@@ -38,7 +38,7 @@
     private final Pattern[] regexes;
 
     /** the set of regular expressions used to transform values */
-    private final transient Matcher[] matchers;
+    private final Matcher[] matchers;
 
 
     /**



Mime
View raw message