Scarab commit: svn commit: r11376 - branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java
[email protected] Wed, 19 Apr 2017 06:56:53 -0700 (PDT)
| Newsgroups | gmane.comp.java.scarab.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: dabbous
Date: 2017-04-19 06:56:53-0700
New Revision: 11376
Modified:
branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java
Log:
refactored function for better readability, also removed unnecessary if block
Modified: branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java
Url: http://scarab.tigris.org/source/browse/scarab/branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java?view=diff&pathrev=11376&r1=11375&r2=11376
==============================================================================
--- branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java (original)
+++ branches/scarab_11079_legacy_with_ant_maven1/src/java/org/tigris/scarab/om/AttributeValuePeer.java 2017-04-19 06:56:53-0700
@@ -168,6 +168,7 @@
{
crit.or(AttributeValuePeer.VALUE, stateiter.next());
}
+ crit.and(AttributeValuePeer.DELETED, false);
List avs = statusAttribute.getAttributeValues(crit);
List<AttributeValue> candidates = new ArrayList<AttributeValue>();
@@ -184,24 +185,23 @@
{
AttributeValue av = iterav.next();
Issue issue = av.getIssue();
+ if (issue.getDeleted())
+ {
+ continue;
+ }
+
Module module = issue.getModule();
String code = module.getCode();
Iterator<Object> iterm = moduleCodes.iterator();
- boolean isCandidate = false;
while (iterm.hasNext())
{
String modid = (String)iterm.next();
if(modid.equalsIgnoreCase(code))
{
- isCandidate = true;
+ candidates.add(av);
break;
}
}
-
- if (isCandidate)
- {
- candidates.add(av);
- }
}
return candidates;
}
------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=3230609