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

Jean-Noel Rouvignac
08.16.2014 716ff091f474a7694027a26eb6f82828d5d71b02
Index.java, NullIndex.java, AttributeIndex.java:
Removed unnecessary and incorrect return types.
3 files modified
39 ■■■■ changed files
opendj3-server-dev/src/server/org/opends/server/backends/jeb/AttributeIndex.java 12 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/Index.java 23 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/NullIndex.java 4 ●●●● patch | view | raw | blame | history
opendj3-server-dev/src/server/org/opends/server/backends/jeb/AttributeIndex.java
@@ -313,25 +313,17 @@
   * @param buffer The index buffer to use to store the added keys
   * @param entryID     The entry ID.
   * @param entry       The contents of the new entry.
   * @return True if all the index keys for the entry are added. False if the
   *         entry ID already exists for some keys.
   * @throws DatabaseException If an error occurs in the JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry)
  public void addEntry(IndexBuffer buffer, EntryID entryID, Entry entry)
       throws DatabaseException, DirectoryException
  {
    boolean success = true;
    final IndexingOptions options = indexQueryFactory.getIndexingOptions();
    for (Index index : nameToIndexes.values())
    {
      if (!index.addEntry(buffer, entryID, entry, options))
      {
        success = false;
      }
      index.addEntry(buffer, entryID, entry, options);
    }
    return success;
  }
  /**
opendj3-server-dev/src/server/org/opends/server/backends/jeb/Index.java
@@ -166,14 +166,10 @@
   * @param buffer The index buffer to insert the ID into.
   * @param keyBytes         The index key bytes.
   * @param entryID     The entry ID.
   * @return True if the entry ID is inserted or ignored because the entry limit
   *         count is exceeded. False if it already exists in the entry ID set
   *         for the given key.
   */
  public boolean insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID)
  public void insertID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID)
  {
    getBufferedIndexValues(buffer, keyBytes).addEntryID(keyBytes, entryID);
    return true;
  }
  private void deleteKey(DatabaseEntry key, ImportIDSet importIdSet, DatabaseEntry data) throws DatabaseException {
@@ -458,14 +454,10 @@
   * @param buffer The index buffer to insert the ID into.
   * @param keyBytes    The index key bytes.
   * @param entryID     The entry ID.
   * @return True if the entry ID is inserted or ignored because the entry limit
   *         count is exceeded. False if it already exists in the entry ID set
   *         for the given key.
   */
  public boolean removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID)
  public void removeID(IndexBuffer buffer, ByteString keyBytes, EntryID entryID)
  {
    getBufferedIndexValues(buffer, keyBytes).deleteEntryID(keyBytes, entryID);
    return true;
  }
  private void logIndexCorruptError(Transaction txn, DatabaseEntry key)
@@ -754,26 +746,19 @@
   * @param entryID     The entry ID.
   * @param entry       The entry to be indexed.
   * @param options     The indexing options to use
   * @return True if all the indexType keys for the entry are added. False if
   *         the entry ID already exists for some keys.
   * @throws DatabaseException If an error occurs in the JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry,
  public void addEntry(IndexBuffer buffer, EntryID entryID, Entry entry,
      IndexingOptions options) throws DatabaseException, DirectoryException
  {
    HashSet<ByteString> addKeys = new HashSet<ByteString>();
    indexer.indexEntry(entry, addKeys, options);
    boolean success = true;
    for (ByteString keyBytes : addKeys)
    {
      if(!insertID(buffer, keyBytes, entryID))
      {
        success = false;
      }
      insertID(buffer, keyBytes, entryID);
    }
    return success;
  }
  /**
opendj3-server-dev/src/server/org/opends/server/backends/jeb/NullIndex.java
@@ -145,10 +145,10 @@
  /** {@inheritDoc} */
  @Override
  public boolean addEntry(IndexBuffer buffer, EntryID entryID, Entry entry, IndexingOptions options)
  public void addEntry(IndexBuffer buffer, EntryID entryID, Entry entry, IndexingOptions options)
      throws DatabaseException, DirectoryException
  {
    return true;
    // Do nothing.
  }
  /** {@inheritDoc} */