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

ludovicp
29.11.2008 3ecf5819c28cd06f004a6deb35e46df2d6197413
Fix or indicate possible null pointer dereferencing detected by FindBugs
6 files modified
24 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/backends/LDIFBackend.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryCachePreloader.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VerifyJob.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/LDIFBackend.java
@@ -636,6 +636,7 @@
        else
        {
          DN matchedDN = null;
          // BUG: parentDN can be null when entering the loop
          while (true)
          {
            parentDN = parentDN.getParentDNInSuffix();
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -4235,7 +4235,8 @@
          AttributeType attrType = AttributeTypeSyntax.decodeAttributeType(
              v.getValue(), schema, false);
          String schemaFile = attrType.getSchemaFile();
          if (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE))
          if ((schemaFile != null) &&
              (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE)))
          {
            // Don't import the file containing the definitions of the
            // Schema elements used for configuration because these
@@ -4287,7 +4288,8 @@
    for (AttributeType removeType : currentAttrTypes.values())
    {
      String schemaFile = removeType.getSchemaFile();
      if (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE))
      if ((schemaFile != null) &&
           (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE)))
      {
        // Don't import the file containing the definitiong of the
        // Schema elements used for configuration because these
@@ -4297,10 +4299,9 @@
      if (!oidList.contains(removeType.getOID()))
      {
        newSchema.deregisterAttributeType(removeType);
        if (schemaFile != null)
        {
          modifiedSchemaFiles.add(schemaFile);
              modifiedSchemaFiles.add(schemaFile);
        }
      }
    }
@@ -4349,7 +4350,8 @@
          ObjectClass newObjectClass = ObjectClassSyntax.decodeObjectClass(
              v.getValue(), newSchema, true);
          String schemaFile = newObjectClass.getSchemaFile();
          if (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE))
          if ((schemaFile != null) &&
              (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE)))
          {
            // Don't import the file containing the definitions of the
            // Schema elements used for configuration because these
@@ -4406,7 +4408,8 @@
    for (ObjectClass removeClass : currentObjectClasses.values())
    {
      String schemaFile = removeClass.getSchemaFile();
      if (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE))
      if ((schemaFile != null) &&
          (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE)))
      {
        // Don't import the file containing the definitiong of the
        // Schema elements used for configuration because these
@@ -5276,8 +5279,7 @@
          logError(message);
        }
        Message message = ERR_SCHEMA_RESTORE_SIGNED_HASH_INVALID.get(
              schemaBackupDir.getPath());
        Message message = ERR_SCHEMA_RESTORE_SIGNED_HASH_INVALID.get(backupID);
        throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                     message);
      }
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryCachePreloader.java
@@ -353,6 +353,7 @@
                continue;
              }
            }
            // BUG cursor might be null ? If not why testing below ?
            status = cursor.getNext(key, data, LockMode.DEFAULT);
            if (status != OperationStatus.SUCCESS) {
              // Reset cursor and continue.
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java
@@ -180,6 +180,7 @@
      updatedEntryIDs[pos] = entryID;
      byte[] newValuesBytes = attributeValuesToDatabase(values);
      // BUG valuesBytesOffsets might be null ? If not why testing below ?
      int valuesPos = valuesBytesOffsets[pos];
      byte[] updatedValuesBytes = new byte[valuesBytes.length +
          newValuesBytes.length];
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java
@@ -1885,6 +1885,7 @@
            resultCode = ResultCode.INVALID_ATTRIBUTE_SYNTAX;
          }
        }
        // BUG: attrType may be NULL
        sortKeys[i] = new SortKey(attrType, ascending[i]);
        orderingRules[i] = attrType.getOrderingMatchingRule();
      }
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VerifyJob.java
@@ -1798,7 +1798,7 @@
    DatabaseEntry presenceKey = AttributeIndex.presenceKey;
    // Presence index.
    if (!attrList.isEmpty() && presenceIndex != null)
    if ((attrList != null) && !attrList.isEmpty() && presenceIndex != null)
    {
      try
      {