Skip to content

Conversation

@skavanagh
Copy link
Contributor

Added operation to return a hashmap for each set of metadata properties

@skavanagh
Copy link
Contributor Author

It looks like from the 'meta' table a record either has the contents of the MANIFEST.MF or the pom.properties. And the only way I see to call getVulnerabilities(hashMap)
is to first callvr.getFlattenedMetaData() which gives me a HashMap of everything in both the MANIFEST.MF and the pom.propeties, so it fails on matching the record.

To get around this I added an operation that returns a HashMap for each individual data file. That way you can call getVulnerabilities(hashMap) like so

for (String key : vr.getMetaData().keySet()) {
    HashSet<String> cves = db.getVulnerabilities(vr.getMetaData().get(key));
    if (!cves.isEmpty()) {
        vulnerable = true;
    }
}

I'm probably completely missing something here though 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting issues:

  • use tabs (4) not spaces
  • truncate all white spaces at the end of lines

@abn
Copy link
Member

abn commented Oct 13, 2014

Note that currently setFromMetadata does not support fetching artifact coordinates from pom.properties yet. The overall implementation surrounding properties and metadata might require an overhaul in the future.

@abn abn self-assigned this Oct 13, 2014
Added operation to return a hashmap for each set of metadata properties
@skavanagh
Copy link
Contributor Author

Updated the method doc and I think I have the whitespace issues figured out. Thanks @abn !!!

@abn abn merged commit fa2b05b into victims:master Oct 13, 2014
@abn abn added this to the 1.4.0 milestone Oct 13, 2014
@skavanagh skavanagh deleted the metadata-branch branch October 13, 2014 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants