Project

General

Profile

Actions

Bug #2095

open

AbstractDataPackage - entity array not initialized automatically

Added by Matthew Brooke over 19 years ago. Updated over 18 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
morpho - general
Target version:
Start date:
05/30/2005
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2095

Description

This was discovered while writing a plugin for morpho - it doesn't affect how
morpho runs at the moment - but may cause complications in future if not addressed

Under some circumstances, for a datapackage with 1 or more entities, a call to
the AbstractDataPackage getEntityCount() method returns zero (0), and a call to
dataPackage.getEntityName(0) returns "No such entity!"

The reason is that the "entityArray" variable is not initialized until a call is
made to the getEntityArray() method. Therefore, as a temporary workaround for my
plugin, I called getEntityArray() before calling getEntityName(0)

SUGGESTED FIX -
1) ensure that all methods within AbstractDataPackage call getEntityArray()
instead of just using the global "entityArray" variable

2) ensure that subclasses do the same, by making "entityArray" private instead
of protected

(The plugin code can be seen in the jalama cvs module, under
jalama/src/edu/ucsb/nceas/jalama/entrypoint/morpho/OpenUIGenCommand.java, within
the method: private String getUniqueID_EML(int i) )

Actions

Also available in: Atom PDF