Fix result limit to work as documented: 0 means no limit, not maximum of no results

This commit is contained in:
Mark H. Wood
2012-07-03 13:02:45 -04:00
parent f5032e8a22
commit 521e613224
2 changed files with 4 additions and 2 deletions

View File

@@ -194,7 +194,9 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements Choic
if (null != idAttr) // 'id' is optional
authorities[i] = idAttr.getNodeValue();
}
int resultCount = Math.min(labels.length - start, limit);
int resultCount = labels.length - start;
if ((limit > 0) && (resultCount > limit)) // limit = 0 means no limit
resultCount = limit;
choices = new Choice[resultCount];
if (resultCount > 0)
{