You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by se...@apache.org on 2010/09/30 00:13:38 UTC
svn commit: r1002871 - in
/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap:
aci/ csn/ entry/ filter/ name/ schema/syntaxCheckers/ trigger/ util/
Author: seelmann
Date: Wed Sep 29 22:13:37 2010
New Revision: 1002871
URL: http://svn.apache.org/viewvc?rev=1002871&view=rev
Log:
Fix checkstyle errors: OperatorWrap
Modified:
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/csn/Csn.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/DSETypeSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/JpegSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UuidSyntaxChecker.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java
directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java Wed Sep 29 22:13:37 2010
@@ -150,9 +150,9 @@ public class ItemFirstACIItem extends AC
{
Set<GrantAndDenial> grants = itemPermission.getGrants();
Set<GrantAndDenial> denials = itemPermission.getDenials();
- int precedence = itemPermission.getPrecedence() != null ?
- itemPermission.getPrecedence() :
- this.getPrecedence();
+ int precedence = itemPermission.getPrecedence() != null
+ ? itemPermission.getPrecedence()
+ : this.getPrecedence();
if ( grants.size() > 0 )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/csn/Csn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/csn/Csn.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/csn/Csn.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/csn/Csn.java Wed Sep 29 22:13:37 2010
@@ -605,11 +605,8 @@ public class Csn implements Serializable
Csn that = ( Csn ) o;
- return
- ( timestamp == that.timestamp ) &&
- ( changeCount == that.changeCount ) &&
- ( replicaId == that.replicaId ) &&
- ( operationNumber == that.operationNumber );
+ return ( timestamp == that.timestamp ) && ( changeCount == that.changeCount )
+ && ( replicaId == that.replicaId ) && ( operationNumber == that.operationNumber );
}
@@ -650,11 +647,7 @@ public class Csn implements Serializable
}
// Then the replicaId
- int replicaIdCompareResult=
- ( this.replicaId < csn.replicaId ?
- -1 :
- ( this.replicaId > csn.replicaId ?
- 1 : 0 ) );
+ int replicaIdCompareResult = getReplicaIdCompareResult( csn );
if ( replicaIdCompareResult != 0 )
{
@@ -675,4 +668,18 @@ public class Csn implements Serializable
return 0;
}
}
+
+
+ private int getReplicaIdCompareResult( Csn csn )
+ {
+ if ( this.replicaId < csn.replicaId )
+ {
+ return -1;
+ }
+ if ( this.replicaId > csn.replicaId )
+ {
+ return 1;
+ }
+ return 0;
+ }
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/DefaultEntry.java Wed Sep 29 22:13:37 2010
@@ -2963,8 +2963,8 @@ public class DefaultEntry implements Ent
}
else
{
- if ( !id.equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT ) &&
- !id.equals( SchemaConstants.OBJECT_CLASS_AT_OID ) )
+ if ( !id.equalsIgnoreCase( SchemaConstants.OBJECT_CLASS_AT )
+ && !id.equals( SchemaConstants.OBJECT_CLASS_AT_OID ) )
{
sb.append( attribute );
continue;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java Wed Sep 29 22:13:37 2010
@@ -86,8 +86,8 @@ public class StringValue extends Abstrac
if ( ! attributeType.getSyntax().isHumanReadable() )
{
- LOG.warn( "Treating a value of a binary attribute {} as a String: " +
- "\nthis could cause data corruption!", attributeType.getName() );
+ LOG.warn( "Treating a value of a binary attribute {} as a String: "
+ + "\nthis could cause data corruption!", attributeType.getName() );
}
this.attributeType = attributeType;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SimpleNode.java Wed Sep 29 22:13:37 2010
@@ -158,9 +158,9 @@ public abstract class SimpleNode<T> exte
}
else
{
- if ( ( attribute == null ) ||
- !( SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( attribute ) ||
- SchemaConstants.OBJECT_CLASS_AT_OID.equalsIgnoreCase( attribute ) ) )
+ if ( ( attribute == null )
+ || !( SchemaConstants.OBJECT_CLASS_AT.equalsIgnoreCase( attribute )
+ || SchemaConstants.OBJECT_CLASS_AT_OID.equalsIgnoreCase( attribute ) ) )
{
throw new UnsupportedOperationException( I18n.err( I18n.ERR_04162, attribute ) );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVA.java Wed Sep 29 22:13:37 2010
@@ -476,9 +476,9 @@ public class AVA implements Cloneable, C
{
if ( !val2.isBinary() )
{
- int val = ( sensitivity == CASE_SENSITIVE ) ?
- ( val1.getString() ).compareTo( val2.getString() )
- : ( val1.getString() ).compareToIgnoreCase( val2.getString() );
+ int val = ( sensitivity == CASE_SENSITIVE )
+ ? ( val1.getString() ).compareTo( val2.getString() )
+ : ( val1.getString() ).compareToIgnoreCase( val2.getString() );
return ( val < 0 ? -1 : ( val > 0 ? 1 : val ) );
}
@@ -744,13 +744,13 @@ public class AVA implements Cloneable, C
*/
public void writeExternal( ObjectOutput out ) throws IOException
{
- if ( StringTools.isEmpty( upName ) ||
- StringTools.isEmpty( upType ) ||
- StringTools.isEmpty( normType ) ||
- ( start < 0 ) ||
- ( length < 2 ) || // At least a type and '='
- ( upValue.isNull() ) ||
- ( normValue.isNull() ) )
+ if ( StringTools.isEmpty( upName )
+ || StringTools.isEmpty( upType )
+ || StringTools.isEmpty( normType )
+ || ( start < 0 )
+ || ( length < 2 ) // At least a type and '='
+ || ( upValue.isNull() )
+ || ( normValue.isNull() ) )
{
String message = "Cannot serialize an wrong ATAV, ";
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/AVASerializer.java Wed Sep 29 22:13:37 2010
@@ -80,13 +80,13 @@ public final class AVASerializer
*/
public static void serialize( AVA atav, ObjectOutput out ) throws IOException
{
- if ( StringTools.isEmpty( atav.getUpName() ) ||
- StringTools.isEmpty( atav.getUpType() ) ||
- StringTools.isEmpty( atav.getNormType() ) ||
- ( atav.getStart() < 0 ) ||
- ( atav.getLength() < 2 ) || // At least a type and '='
- ( atav.getUpValue().isNull() ) ||
- ( atav.getNormValue().isNull() ) )
+ if ( StringTools.isEmpty( atav.getUpName() )
+ || StringTools.isEmpty( atav.getUpType() )
+ || StringTools.isEmpty( atav.getNormType() )
+ || ( atav.getStart() < 0 )
+ || ( atav.getLength() < 2 ) // At least a type and '='
+ || ( atav.getUpValue().isNull() )
+ || ( atav.getNormValue().isNull() ) )
{
String message = "Cannot serialize an wrong ATAV, ";
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/AttributeTypeUsageSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -82,8 +82,8 @@ public class AttributeTypeUsageSyntaxChe
strValue = value.toString();
}
- if ( ( strValue.length() < "userApplications".length() ) ||
- ( strValue.length() > "userApplications".length() ) )
+ if ( ( strValue.length() < "userApplications".length() )
+ || ( strValue.length() > "userApplications".length() ) )
{
LOG.debug( "Syntax invalid for '{}'", value );
return false;
@@ -94,10 +94,10 @@ public class AttributeTypeUsageSyntaxChe
switch ( ch )
{
case( 'd' ):
- if ( "dSAOperation".equals( strValue ) ||
- "directoryOperation".equals( strValue ) ||
- "distributedOperation".equals( strValue ) )
- {
+ if ( "dSAOperation".equals( strValue )
+ || "directoryOperation".equals( strValue )
+ || "distributedOperation".equals( strValue ) )
+ {
LOG.debug( "Syntax valid for '{}'", value );
return true;
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/DSETypeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/DSETypeSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/DSETypeSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/DSETypeSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -118,8 +118,8 @@ public class DSETypeSyntaxChecker extend
}
// Check the opening and closing parenthesis
- if ( ( strValue.charAt( 0 ) != '(' ) ||
- ( strValue.charAt( strValue.length() - 1 ) != ')' ) )
+ if ( ( strValue.charAt( 0 ) != '(' )
+ || ( strValue.charAt( strValue.length() - 1 ) != ')' ) )
{
LOG.debug( "Syntax invalid for '{}'", value );
return false;
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/GeneralizedTimeSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -76,20 +76,21 @@ public class GeneralizedTimeSyntaxChecke
private static final long serialVersionUID = 1L;
/** The GeneralizedDate pattern matching */
- private static final String GENERALIZED_TIME_PATTERN =
- "^\\d{4}" + // century + year : 0000 to 9999
- "(0[1-9]|1[0-2])" + // month : 01 to 12
- "(0[1-9]|[12]\\d|3[01])" + // day : 01 to 31
- "([01]\\d|2[0-3])" + // hour : 00 to 23
- "(" +
- "([0-5]\\d)" + // optionnal minute : 00 to 59
- "([0-5]\\d|60)?" + // optionnal second | leap second
- ")?" +
- "([.,]\\d+)?" + // fraction
- "(Z|[+-]([01]\\d|2[0-3])([0-5]\\d)?)$"; // time-zone
-
- // The regexp pattern is immutable, only one instance needed.
- private static final Pattern DATE_PATTERN = Pattern.compile( GENERALIZED_TIME_PATTERN );
+ private static final String GENERALIZED_TIME_PATTERN =
+ "^\\d{4}" // century + year : 0000 to 9999
+ + "(0[1-9]|1[0-2])" // month : 01 to 12
+ + "(0[1-9]|[12]\\d|3[01])" // day : 01 to 31
+ + "([01]\\d|2[0-3])" // hour : 00 to 23
+ + "("
+ + "([0-5]\\d)" // optional minute : 00 to 59
+ + "([0-5]\\d|60)?" // optional second | leap second
+ + ")?"
+ + "([.,]\\d+)?" // fraction
+ + "(Z|[+-]([01]\\d|2[0-3])([0-5]\\d)?)$"; // time-zone
+
+ /** The date pattern. The regexp pattern is immutable, only one instance needed. */
+ private static final Pattern DATE_PATTERN = Pattern.compile( GENERALIZED_TIME_PATTERN );
+
/**
* Creates a new instance of GeneralizedTimeSyntaxChecker.
@@ -98,7 +99,7 @@ public class GeneralizedTimeSyntaxChecke
{
super( SchemaConstants.GENERALIZED_TIME_SYNTAX );
}
-
+
/**
* {@inheritDoc}
@@ -112,14 +113,14 @@ public class GeneralizedTimeSyntaxChecke
LOG.debug( "Syntax invalid for 'null'" );
return false;
}
-
+
if ( value instanceof String )
{
strValue = ( String ) value;
}
else if ( value instanceof byte[] )
{
- strValue = StringTools.utf8ToString( ( byte[] ) value );
+ strValue = StringTools.utf8ToString( ( byte[] ) value );
}
else
{
@@ -132,10 +133,10 @@ public class GeneralizedTimeSyntaxChecke
LOG.debug( "Syntax invalid for '{}'", value );
return false;
}
-
+
// Start the date parsing
boolean result = DATE_PATTERN.matcher( strValue ).find();
-
+
if ( result )
{
LOG.debug( "Syntax valid for '{}'", value );
@@ -144,7 +145,7 @@ public class GeneralizedTimeSyntaxChecke
{
LOG.debug( "Syntax invalid for '{}'", value );
}
-
+
return result;
}
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/JpegSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/JpegSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/JpegSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/JpegSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -84,15 +84,15 @@ public class JpegSyntaxChecker extends S
return false;
}
- if ( ( bytes[0] == (byte)0x00FF ) && // SOI
- ( bytes[1] == (byte)0x00D8 ) &&
- ( bytes[2] == (byte)0x00FF ) && // APP0
- ( bytes[3] == (byte)0x00E0 ) &&
- ( bytes[6] == 'J' ) && // JFIF
- ( bytes[7] == 'F' ) && // JFIF
- ( bytes[8] == 'I' ) && // JFIF
- ( bytes[9] == 'F' ) &&
- ( bytes[10] == 0x00 ) ) // \0
+ if ( ( bytes[0] == ( byte ) 0x00FF ) // SOI
+ && ( bytes[1] == ( byte ) 0x00D8 )
+ && ( bytes[2] == ( byte ) 0x00FF ) // APP0
+ && ( bytes[3] == ( byte ) 0x00E0 )
+ && ( bytes[6] == 'J' ) // JFIF
+ && ( bytes[7] == 'F' ) // JFIF
+ && ( bytes[8] == 'I' ) // JFIF
+ && ( bytes[9] == 'F' )
+ && ( bytes[10] == 0x00 ) ) // \0
{
// Note : this is not because the header is correct
// that the file is a jpeg file. There are much more
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/MailPreferenceSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -98,9 +98,9 @@ public class MailPreferenceSyntaxChecker
return false;
}
- boolean result = ( ( "NO-LISTS".equals( strValue ) ) || ( "ANY-LIST".equals( strValue ) ) ||
- ( "PROFESSIONAL-LISTS".equals( strValue ) ) );
-
+ boolean result = ( ( "NO-LISTS".equals( strValue ) ) || ( "ANY-LIST".equals( strValue ) )
+ || ( "PROFESSIONAL-LISTS".equals( strValue ) ) );
+
if ( result )
{
LOG.debug( "Syntax valid for '{}'", value );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/NameAndOptionalUIDSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -109,8 +109,8 @@ public class NameAndOptionalUIDSyntaxChe
// followed by a BitString, except if the '#' is
// on the last position
// We shoould not find a
- if ( BitStringSyntaxChecker.isValid( strValue.substring( sharpPos + 1 ) ) &&
- ( sharpPos < strValue.length() ) )
+ if ( BitStringSyntaxChecker.isValid( strValue.substring( sharpPos + 1 ) )
+ && ( sharpPos < strValue.length() ) )
{
// Ok, we have a BitString, now check the DN,
// except if the '#' is in first position
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/OtherMailboxSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -98,8 +98,8 @@ public class OtherMailboxSyntaxChecker e
String mailboxType = strValue.substring( 0, dollar );
- String mailbox = ( ( dollar < strValue.length() - 1 ) ?
- strValue.substring( dollar + 1 ) : "" );
+ String mailbox = ( ( dollar < strValue.length() - 1 )
+ ? strValue.substring( dollar + 1 ) : "" );
// The mailbox should not contains a '$'
if ( mailbox.indexOf( '$' ) != -1 )
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/TeletexTerminalIdentifierSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -138,11 +138,11 @@ public class TeletexTerminalIdentifierSy
String key = ttxParam.substring( 0, colon );
- if ( key.startsWith( "graphic" ) ||
- key.startsWith( "control" ) ||
- key.startsWith( "misc" ) ||
- key.startsWith( "page" ) ||
- key.startsWith( "private" ) )
+ if ( key.startsWith( "graphic" )
+ || key.startsWith( "control" )
+ || key.startsWith( "misc" )
+ || key.startsWith( "page" )
+ || key.startsWith( "private" ) )
{
if ( colon + 1 == ttxParam.length() )
{
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UtcTimeSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -70,17 +70,17 @@ public class UtcTimeSyntaxChecker extend
private static final long serialVersionUID = 1L;
/** The GeneralizedDate pattern matching */
- private static final String UTC_TIME_PATTERN =
- "^\\d{2}" + // year : 00 to 99
- "(0[1-9]|1[0-2])" + // month : 01 to 12
- "(0[1-9]|[12]\\d|3[01])" + // day : 01 to 31
- "([01]\\d|2[0-3])" + // hour: 00 to 23
- "([0-5]\\d)" + // minute : 00 to 59
- "(" +
- "([0-5]\\d)?" + // optional second : 00 to 59
- "(Z|([+-]([01]\\d|2[0-3])[0-5]\\d))?" + // optionnal time-zone
- ")$";
-
+ private static final String UTC_TIME_PATTERN =
+ "^\\d{2}" // year : 00 to 99
+ + "(0[1-9]|1[0-2])" // month : 01 to 12
+ + "(0[1-9]|[12]\\d|3[01])" // day : 01 to 31
+ + "([01]\\d|2[0-3])" // hour: 00 to 23
+ + "([0-5]\\d)" // minute : 00 to 59
+ + "("
+ + "([0-5]\\d)?" // optional second : 00 to 59
+ + "(Z|([+-]([01]\\d|2[0-3])[0-5]\\d))?" // optionnal time-zone
+ + ")$";
+
// The regexp pattern, java.util.regex.Pattern is immutable so only one instance is needed.
private static final Pattern DATE_PATTERN = Pattern.compile( UTC_TIME_PATTERN );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UuidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UuidSyntaxChecker.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UuidSyntaxChecker.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/UuidSyntaxChecker.java Wed Sep 29 22:13:37 2010
@@ -81,19 +81,18 @@ public class UuidSyntaxChecker extends S
return false;
}
- if (
- isHex( b[0] ) && isHex( b[1] ) && isHex( b[2] ) && isHex( b[3] ) &
- isHex( b[4] ) && isHex( b[5] ) && isHex( b[6] ) && isHex( b[7] ) &
- b[8] == '-' &
- isHex( b[9] ) && isHex( b[10] ) && isHex( b[11] ) && isHex( b[12] ) &
- b[13] == '-' &
- isHex( b[14] ) && isHex( b[15] ) && isHex( b[16] ) && isHex( b[17] ) &
- b[18] == '-' &
- isHex( b[19] ) && isHex( b[20] ) && isHex( b[21] ) && isHex( b[22] ) &
- b[23] == '-' &
- isHex( b[24] ) && isHex( b[25] ) && isHex( b[26] ) && isHex( b[27] ) &
- isHex( b[28] ) && isHex( b[29] ) && isHex( b[30] ) && isHex( b[31] ) &
- isHex( b[32] ) && isHex( b[33] ) && isHex( b[34] ) && isHex( b[35] ) )
+ if ( isHex( b[0] ) && isHex( b[1] ) && isHex( b[2] ) && isHex( b[3] )
+ && isHex( b[4] ) && isHex( b[5] ) && isHex( b[6] ) && isHex( b[7] )
+ && b[8] == '-'
+ && isHex( b[9] ) && isHex( b[10] ) && isHex( b[11] ) && isHex( b[12] )
+ && b[13] == '-'
+ && isHex( b[14] ) && isHex( b[15] ) && isHex( b[16] ) && isHex( b[17] )
+ && b[18] == '-'
+ && isHex( b[19] ) && isHex( b[20] ) && isHex( b[21] ) && isHex( b[22] )
+ && b[23] == '-'
+ && isHex( b[24] ) && isHex( b[25] ) && isHex( b[26] ) && isHex( b[27] )
+ && isHex( b[28] ) && isHex( b[29] ) && isHex( b[30] ) && isHex( b[31] )
+ && isHex( b[32] ) && isHex( b[33] ) && isHex( b[34] ) && isHex( b[35] ) )
{
// There is not that much more we can check.
LOG.debug( "Syntax valid for '{}'", value );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java Wed Sep 29 22:13:37 2010
@@ -43,9 +43,9 @@ public class TriggerSpecification
public TriggerSpecification( LdapOperation ldapOperation, ActionTime actionTime, List<SPSpec> spSpecs )
{
super();
- if ( ldapOperation == null ||
- actionTime == null ||
- spSpecs == null )
+ if ( ldapOperation == null
+ || actionTime == null
+ || spSpecs == null )
{
throw new NullArgumentException( I18n.err( I18n.ERR_04331 ) );
}
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerUtils.java Wed Sep 29 22:13:37 2010
@@ -58,8 +58,8 @@ public final class TriggerUtils
{
Attributes ap = apCtx.getAttributes( "", new String[] { SchemaConstants.ADMINISTRATIVE_ROLE_AT } );
Attribute administrativeRole = ap.get( SchemaConstants.ADMINISTRATIVE_ROLE_AT );
- if ( administrativeRole == null ||
- !AttributeUtils.containsValueCaseIgnore( administrativeRole, TRIGGER_EXECUTION_SPECIFIC_AREA_VALUE ) )
+ if ( administrativeRole == null
+ || !AttributeUtils.containsValueCaseIgnore( administrativeRole, TRIGGER_EXECUTION_SPECIFIC_AREA_VALUE ) )
{
Attributes changes = new BasicAttributes( SchemaConstants.ADMINISTRATIVE_ROLE_AT, TRIGGER_EXECUTION_SPECIFIC_AREA_VALUE, true );
apCtx.modifyAttributes( "", DirContext.ADD_ATTRIBUTE, changes );
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java?rev=1002871&r1=1002870&r2=1002871&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java Wed Sep 29 22:13:37 2010
@@ -1248,13 +1248,13 @@ public final class StringTools
// Three bytes char
return ( char ) (
// 1110-tttt 10xx-xxyy 10zz-zzzz -> tttt-0000-0000-0000
- ( ( bytes[pos] & 0x0F ) << 12 ) +
- // 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-xxxx-0000-0000
- ( ( bytes[pos + 1] & 0x3C ) << 6 ) +
+ ( ( bytes[pos] & 0x0F ) << 12 )
+ // 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-xxxx-0000-0000
+ + ( ( bytes[pos + 1] & 0x3C ) << 6 )
// 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-0000-yy00-0000
- ( ( bytes[pos + 1] & 0x03 ) << 6 ) +
+ + ( ( bytes[pos + 1] & 0x03 ) << 6 )
// 1110-tttt 10xx-xxyy 10zz-zzzz -> 0000-0000-00zz-zzzz
- ( bytes[pos + 2] & 0x3F )
+ + ( bytes[pos + 2] & 0x3F )
// -> tttt-xxxx yyzz-zzzz (FF FF)
);
}
@@ -1264,22 +1264,22 @@ public final class StringTools
return ( char ) (
// 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 000t-tt00
// 0000-0000 0000-0000
- ( ( bytes[pos] & 0x07 ) << 18 ) +
- // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-00uu
- // 0000-0000 0000-0000
- ( ( bytes[pos + 1] & 0x30 ) << 16 ) +
+ ( ( bytes[pos] & 0x07 ) << 18 )
+ // 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-00uu
+ // 0000-0000 0000-0000
+ + ( ( bytes[pos + 1] & 0x30 ) << 16 )
// 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
// vvvv-0000 0000-0000
- ( ( bytes[pos + 1] & 0x0F ) << 12 ) +
+ + ( ( bytes[pos + 1] & 0x0F ) << 12 )
// 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
// 0000-xxxx 0000-0000
- ( ( bytes[pos + 2] & 0x3C ) << 6 ) +
+ + ( ( bytes[pos + 2] & 0x3C ) << 6 )
// 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
// 0000-0000 yy00-0000
- ( ( bytes[pos + 2] & 0x03 ) << 6 ) +
+ + ( ( bytes[pos + 2] & 0x03 ) << 6 )
// 1111-0ttt 10uu-vvvv 10xx-xxyy 10zz-zzzz -> 0000-0000
// 0000-0000 00zz-zzzz
- ( bytes[pos + 3] & 0x3F )
+ + ( bytes[pos + 3] & 0x3F )
// -> 000t-ttuu vvvv-xxxx yyzz-zzzz (1FFFFF)
);
}
@@ -1289,25 +1289,25 @@ public final class StringTools
return ( char ) (
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-00tt 0000-0000 0000-0000 0000-0000
- ( ( bytes[pos] & 0x03 ) << 24 ) +
- // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
- // 0000-0000 uuuu-uu00 0000-0000 0000-0000
- ( ( bytes[pos + 1] & 0x3F ) << 18 ) +
+ ( ( bytes[pos] & 0x03 ) << 24 )
+ // 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
+ // 0000-0000 uuuu-uu00 0000-0000 0000-0000
+ + ( ( bytes[pos + 1] & 0x3F ) << 18 )
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-0000 0000-00vv 0000-0000 0000-0000
- ( ( bytes[pos + 2] & 0x30 ) << 12 ) +
+ + ( ( bytes[pos + 2] & 0x30 ) << 12 )
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-0000 0000-0000 wwww-0000 0000-0000
- ( ( bytes[pos + 2] & 0x0F ) << 12 ) +
+ + ( ( bytes[pos + 2] & 0x0F ) << 12 )
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-0000 0000-0000 0000-xxxx 0000-0000
- ( ( bytes[pos + 3] & 0x3C ) << 6 ) +
+ + ( ( bytes[pos + 3] & 0x3C ) << 6 )
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-0000 0000-0000 0000-0000 yy00-0000
- ( ( bytes[pos + 3] & 0x03 ) << 6 ) +
+ + ( ( bytes[pos + 3] & 0x03 ) << 6 )
// 1111-10tt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz ->
// 0000-0000 0000-0000 0000-0000 00zz-zzzz
- ( bytes[pos + 4] & 0x3F )
+ + ( bytes[pos + 4] & 0x3F )
// -> 0000-00tt uuuu-uuvv wwww-xxxx yyzz-zzzz (03 FF FF FF)
);
}
@@ -1318,35 +1318,35 @@ public final class StringTools
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
// ->
// 0s00-0000 0000-0000 0000-0000 0000-0000
- ( ( bytes[pos] & 0x01 ) << 30 ) +
- // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
- // ->
+ ( ( bytes[pos] & 0x01 ) << 30 )
+ // 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
+ // ->
// 00tt-tttt 0000-0000 0000-0000 0000-0000
- ( ( bytes[pos + 1] & 0x3F ) << 24 ) +
+ + ( ( bytes[pos + 1] & 0x3F ) << 24 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
// 10zz-zzzz ->
// 0000-0000 uuuu-uu00 0000-0000 0000-0000
- ( ( bytes[pos + 2] & 0x3F ) << 18 ) +
+ + ( ( bytes[pos + 2] & 0x3F ) << 18 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
// 10zz-zzzz ->
// 0000-0000 0000-00vv 0000-0000 0000-0000
- ( ( bytes[pos + 3] & 0x30 ) << 12 ) +
+ + ( ( bytes[pos + 3] & 0x30 ) << 12 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
// 10zz-zzzz ->
// 0000-0000 0000-0000 wwww-0000 0000-0000
- ( ( bytes[pos + 3] & 0x0F ) << 12 ) +
+ + ( ( bytes[pos + 3] & 0x0F ) << 12 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
// 10zz-zzzz ->
// 0000-0000 0000-0000 0000-xxxx 0000-0000
- ( ( bytes[pos + 4] & 0x3C ) << 6 ) +
+ + ( ( bytes[pos + 4] & 0x3C ) << 6 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy
// 10zz-zzzz ->
// 0000-0000 0000-0000 0000-0000 yy00-0000
- ( ( bytes[pos + 4] & 0x03 ) << 6 ) +
+ + ( ( bytes[pos + 4] & 0x03 ) << 6 )
// 1111-110s 10tt-tttt 10uu-uuuu 10vv-wwww 10xx-xxyy 10zz-zzzz
// ->
// 0000-0000 0000-0000 0000-0000 00zz-zzzz
- ( bytes[pos + 5] & 0x3F )
+ + ( bytes[pos + 5] & 0x3F )
// -> 0stt-tttt uuuu-uuvv wwww-xxxx yyzz-zzzz (7F FF FF FF)
);
}
@@ -3402,8 +3402,8 @@ public final class StringTools
for ( int ii = 1, jj = 0 ; ii < chars.length; ii+=2, jj++ )
{
- int ch = ( StringTools.HEX_VALUE[chars[ii]] << 4 ) +
- StringTools.HEX_VALUE[chars[ii+1]];
+ int ch = ( StringTools.HEX_VALUE[chars[ii]] << 4 )
+ + StringTools.HEX_VALUE[chars[ii + 1]];
decoded[jj] = ( byte ) ch;
}
@@ -3445,8 +3445,8 @@ public final class StringTools
// we have the start of a hex escape sequence
if ( isHex( str, i+1 ) && isHex ( str, i+2 ) )
{
- byte value = ( byte ) ( (StringTools.HEX_VALUE[str.charAt( i+1 )] << 4 ) +
- StringTools.HEX_VALUE[str.charAt( i+2 )] );
+ byte value = ( byte ) ( ( StringTools.HEX_VALUE[str.charAt( i + 1 )] << 4 )
+ + StringTools.HEX_VALUE[str.charAt( i + 2 )] );
i+=2;
buf[pos++] = value;