From d881d46444833dd2f240160eb3d3a36074a5cb8d Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Wed, 25 Jul 2012 22:08:29 +0000 Subject: [PATCH] [BIS-137] Fix an issue of EoDSQL with return SQL NULL values. SVN: 26211 --- .../server/authorization/predicate/SampleListPredicate.java | 6 +++--- .../authorization/ScreeningPlateListReadOnlyPredicate.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleListPredicate.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleListPredicate.java index 56e3abf9347..142ec02f042 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleListPredicate.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/authorization/predicate/SampleListPredicate.java @@ -85,7 +85,7 @@ public class SampleListPredicate extends AbstractSpacePredicate<List<Sample>> // - technical id // - permanent id // - space code - // - space identifier + // - identifier final List<Long> ids = new ArrayList<Long>(samples.size()); final List<String> permIds = new ArrayList<String>(samples.size()); for (Sample sample : samples) @@ -122,9 +122,9 @@ public class SampleListPredicate extends AbstractSpacePredicate<List<Sample>> } for (Long spaceId : getSampleSpaceIds(ids, permIds)) { - if (spaceId == null || spaceId == 0) + if (spaceId == null) { - continue; // Shared samples will return a spaceId of null (or 0 in EoDSQL). + continue; // Shared samples will return a spaceId of null. } final Status status = evaluate(person, allowedRoles, spaceId); 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 e72ee957c54..c15c2610895 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 @@ -91,9 +91,9 @@ public class ScreeningPlateListReadOnlyPredicate extends { for (Long spaceId : getSampleSpaceIds(permIds)) { - if (spaceId == null || spaceId == 0) + if (spaceId == null) { - continue; // Shared samples will return a spaceId of null (or 0 in EoDSQL). + continue; // Shared samples will return a spaceId of null. } final Status status = evaluate(person, allowedRoles, spaceId); -- GitLab