mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
05.17.2014 12262caeda60050c11b1c730fc9b02ed86a55fcf
opendj3-server-dev/src/server/org/opends/server/backends/jeb/DN2URI.java
@@ -103,31 +103,8 @@
    dn2uriComparator = new AttributeIndex.KeyComparator();
    prefixRDNComponents = entryContainer.getBaseDN().size();
    DatabaseConfig dn2uriConfig = new DatabaseConfig();
    if(env.getConfig().getReadOnly())
    {
      dn2uriConfig.setReadOnly(true);
      dn2uriConfig.setSortedDuplicates(true);
      dn2uriConfig.setAllowCreate(false);
      dn2uriConfig.setTransactional(false);
    }
    else if(!env.getConfig().getTransactional())
    {
      dn2uriConfig.setSortedDuplicates(true);
      dn2uriConfig.setAllowCreate(true);
      dn2uriConfig.setTransactional(false);
      dn2uriConfig.setDeferredWrite(true);
    }
    else
    {
      dn2uriConfig.setSortedDuplicates(true);
      dn2uriConfig.setAllowCreate(true);
      dn2uriConfig.setTransactional(true);
    }
    this.dbConfig = dn2uriConfig;
    //This line causes an unchecked cast error if the SuppressWarnings
    //annotation is removed at the beginning of this method.
    this.dbConfig = JEBUtils.toDatabaseConfigAllowDuplicates(env);
    this.dbConfig.setBtreeComparator((Class<? extends Comparator<byte[]>>)
                                  dn2uriComparator.getClass());
  }