NullPointerException in FTS add-on with Integer based identity

Hi
I don’t know if something changed in FTS add-on from 6.9 to 6.10, but now I always receive a NullPointerException when launching a search from the main window (the global search text box).

The problem resides in the method DatabaseDataLoader#mergeSearchData, in this snippet of code:

            List<Entity> entities = loadEntities(Lists.newArrayList(entityIds.keySet()), metaClass);
            for (Entity entity : entities) {
                //TODO: detect correct entity id
                Object entityId = entity.getId();   // <-- THIS RETURNS A STRING INSTEAD OF INTEGER
                EntityInfo entityInfo = entityIds.get(entityId);  // <-- THIS GET FAILS, BECAUSE KEYS ARE INTEGERS AND entityId is a STRING
                if (showInResults) {
                    searchResult.addEntry(new SearchResultEntry(entityId,
                            entityInfo.getEntityName(),
                            entity.getInstanceName()));
                }
                callback.entryAdded(entityId, entityInfo);
            }

Your TODO comment makes me think you are already aware of problems in that lines of code…

Thx
P.

Hi Paolo,

Thank you for reporting the problem. Issue: NPE in the search window for LONG/INT identity id entities · Issue #47 · cuba-platform/fts · GitHub. We’ll fix it in the next release 6.10.*.