From 3b4ff5ecbd27449d944efcbc0bfae3c98c28356b Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Mon, 15 Jul 2024 06:32:31 +0000
Subject: [PATCH] [#354] FIX "An error occurred while attempting to perform index rebuild: Unable to decode the provided object class set because it used an undefined token" (#356)

---
 opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
index b9d43e4..6b61b31 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -162,10 +162,8 @@
    */
   private void reloadAttributeTypeMaps(Mappings mappings, Mappings newMappings)
   {
-    for (Entry<AttributeDescription, Integer> entry : mappings.adEncodeMap.entrySet())
-    {
-      AttributeDescription ad = entry.getKey();
-      Integer id = entry.getValue();
+    for(int id=0;id<mappings.adDecodeMap.size();id++){
+      final AttributeDescription ad = mappings.adDecodeMap.get(id);
       loadAttributeToMaps(id, ad.getAttributeType().getNameOrOID(), ad.getOptions(), newMappings);
     }
   }
@@ -176,11 +174,8 @@
    */
   private void reloadObjectClassesMap(Mappings mappings, Mappings newMappings)
   {
-    for (Entry<Map<ObjectClass, String>, Integer> entry : mappings.ocEncodeMap.entrySet())
-    {
-      Map<ObjectClass, String> ocMap = entry.getKey();
-      Integer id = entry.getValue();
-      loadObjectClassesToMaps(id, ocMap.values(), newMappings, false);
+    for(int id=0;id<mappings.ocDecodeMap.size();id++){
+      loadObjectClassesToMaps(id, mappings.ocDecodeMap.get(id).values(), newMappings, false);
     }
   }
 

--
Gitblit v1.10.0