@Test public void testDifferentObjectIdentifiers() { String c1 = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )"; String c2 = "( 1.2 fqcn org.apache.directory.SimpleComparator bytecode ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )"; assertEquals( -1, comparator.compare( c1, c2 ) ); String c3 = "( 1.1 FQCN org.apache.directory.SimpleComparator BYTECODE ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== X-SCHEMA 'system' )"; String c4 = "( 1.1.1 fqcn org.apache.directory.SimpleComparator bytecode ABCDEFGHIJKLMNOPQRSTUVWXYZ+/abcdefghijklmnopqrstuvwxyz0123456789==== )"; assertNotSame( 0, comparator.compare( c3, c4 ) ); }
public int compare( String s1, String s2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT, s1, s2 ) ); } if ( s1 == null ) { return ( s2 == null ) ? 0 : -1; } if ( s2 == null ) { return -1; } if ( s1.equals( s2 ) ) { return 0; } String oid1 = getNumericOid( s1 ); if ( oid1 == null ) { return -1; } String oid2 = getNumericOid( s2 ); if ( oid2 == null ) { return -1; } if ( oid1.equals( oid2 ) ) { return 0; } else { return -1; } }
ObjectIdentifierFirstComponentComparator extends LdapComparator<String> { public int compare( String s1, String s2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT, s1, s2 ) ); } if ( s1 == null ) { return ( s2 == null ) ? 0 : -1; } if ( s2 == null ) { return -1; } if ( s1.equals( s2 ) ) { return 0; } String oid1 = getNumericOid( s1 ); if ( oid1 == null ) { return -1; } String oid2 = getNumericOid( s2 ); if ( oid2 == null ) { return -1; } if ( oid1.equals( oid2 ) ) { return 0; } else { return -1; } } }
ObjectIdentifierFirstComponentComparator extends LdapComparator<String> { public int compare( String s1, String s2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT, s1, s2 ) ); } if ( s1 == null ) { return ( s2 == null ) ? 0 : -1; } if ( s2 == null ) { return -1; } if ( s1.equals( s2 ) ) { return 0; } String oid1 = getNumericOid( s1 ); if ( oid1 == null ) { return -1; } String oid2 = getNumericOid( s2 ); if ( oid2 == null ) { return -1; } if ( oid1.equals( oid2 ) ) { return 0; } else { return -1; } } ObjectIdentifierFirstComponentComparator( String oid ); }
ObjectIdentifierFirstComponentComparator extends LdapComparator<String> { public int compare( String s1, String s2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT, s1, s2 ) ); } if ( s1 == null ) { return ( s2 == null ) ? 0 : -1; } if ( s2 == null ) { return -1; } if ( s1.equals( s2 ) ) { return 0; } String oid1 = getNumericOid( s1 ); if ( oid1 == null ) { return -1; } String oid2 = getNumericOid( s2 ); if ( oid2 == null ) { return -1; } if ( oid1.equals( oid2 ) ) { return 0; } else { return -1; } } ObjectIdentifierFirstComponentComparator( String oid ); int compare( String s1, String s2 ); }
ObjectIdentifierFirstComponentComparator extends LdapComparator<String> { public int compare( String s1, String s2 ) { if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_13748_COMPARING_OBJECT_IDENTIFIER_FIRST_COMPONENT, s1, s2 ) ); } if ( s1 == null ) { return ( s2 == null ) ? 0 : -1; } if ( s2 == null ) { return -1; } if ( s1.equals( s2 ) ) { return 0; } String oid1 = getNumericOid( s1 ); if ( oid1 == null ) { return -1; } String oid2 = getNumericOid( s2 ); if ( oid2 == null ) { return -1; } if ( oid1.equals( oid2 ) ) { return 0; } else { return -1; } } ObjectIdentifierFirstComponentComparator( String oid ); int compare( String s1, String s2 );  }