From ea63943b660aadff1c89cc6b2afdbda7441f3754 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Tue, 24 Jul 2012 19:11:39 +0000 Subject: [PATCH] Fix ScreeningPlateListReadOnlyPredicate for plates without a space. SVN: 26177 --- .../ScreeningPlateListReadOnlyPredicate.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java index 0d8c7ec0a11..ab983474a34 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/api/internal/authorization/ScreeningPlateListReadOnlyPredicate.java @@ -71,7 +71,7 @@ public class ScreeningPlateListReadOnlyPredicate extends } final String spaceCodeOrNull = - SpaceCodeHelper.getSpaceCode(person, plate.tryGetSpaceCode()); + SpaceCodeHelper.tryGetSpaceCode(person, plate.tryGetSpaceCode()); if (spaceCodeOrNull == null && hasPermId == false) { throw new UndefinedSpaceException(); @@ -103,7 +103,7 @@ public class ScreeningPlateListReadOnlyPredicate extends return Status.OK; } - private final static int SAMPLE_PERM_ID_LIMIT = 999; + private final static int ARRAY_SIZE_LIMIT = 999; interface ISampleToSpaceQuery extends BaseQuery { @@ -117,13 +117,13 @@ public class ScreeningPlateListReadOnlyPredicate extends final ISampleToSpaceQuery query = QueryTool.getQuery(authorizationDataProvider.getConnection(), ISampleToSpaceQuery.class); - if (permIds.size() > SAMPLE_PERM_ID_LIMIT) + if (permIds.size() > ARRAY_SIZE_LIMIT) { final Set<Long> spaceIds = new HashSet<Long>(permIds.size()); - for (int startIdx = 0; startIdx < permIds.size(); startIdx += SAMPLE_PERM_ID_LIMIT) + for (int startIdx = 0; startIdx < permIds.size(); startIdx += ARRAY_SIZE_LIMIT) { final List<String> permIdSubList = permIds.subList(startIdx, - Math.min(permIds.size(), startIdx + SAMPLE_PERM_ID_LIMIT)); + Math.min(permIds.size(), startIdx + ARRAY_SIZE_LIMIT)); spaceIds.addAll(query.getSampleSpaceIds(permIdSubList.toArray( new String[permIdSubList.size()]))); } -- GitLab