Skip to content

Commit

Permalink
fix by adding segment to rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
anunn committed Nov 30, 2012
1 parent bb48e2c commit f094b3e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,18 @@ static Repository getRepositoryFromArguments(String[] args)
* @param objFactory
* @param segment
* @param repository
* @param segment
* @return
*/
private static Collection<? extends Rule> getRules(ObjectFactory objFactory, Value cwe, Repository repository)
private static Collection<? extends Rule> getRules(ObjectFactory objFactory, Value cwe, Repository repository, Value segment)
{
HashMap<String, Rule> ruleSet = new HashMap<String, CWECoverageClaimType.Claims.Claim.RuleSet.Rule>();
RepositoryConnection con = null;
try
{
con = getRepositoryConnection(repository);

String adaptorQuery = "SELECT ?descriptionText WHERE {" + "?finding <http://toif/toif:FindingHasCWEIdentifier> <" + cwe + "> . "
String adaptorQuery = "SELECT ?descriptionText WHERE {<"+segment+"> <http://toif/contains> ?finding. ?finding <http://toif/toif:FindingHasCWEIdentifier> <" + cwe + "> . "
+ "?finding <http://toif/toif:FindingIsDescribedByWeaknessDescription> ?description . "
+ "?description <http://toif/description> ?descriptionText . }";

Expand Down Expand Up @@ -348,7 +349,7 @@ private Collection<Claim> createClaims(ObjectFactory objFactory, Value segment,

Claim claim = claims.get(cweIdString);
RuleSet ruleSet = objFactory.createCWECoverageClaimTypeClaimsClaimRuleSet();
ruleSet.getRule().addAll(getRules(objFactory, cwe, repository));
ruleSet.getRule().addAll(getRules(objFactory, cwe, repository,segment));
claim.setRuleSet(ruleSet);

}
Expand Down

0 comments on commit f094b3e

Please sign in to comment.