Skip to content

Filtering sources based on assembly type#1537

Merged
mayankbansal018 merged 4 commits intomicrosoft:masterfrom
abhishkk:filterSourcesBasedOnAssemblyType
Apr 11, 2018
Merged

Filtering sources based on assembly type#1537
mayankbansal018 merged 4 commits intomicrosoft:masterfrom
abhishkk:filterSourcesBasedOnAssemblyType

Conversation

@abhishkk
Copy link
Contributor

@abhishkk abhishkk commented Apr 9, 2018

Part 3 of RFC:
Contains changes for filtering sources based on assembly type.

if (discoverer.Metadata.AssemblyType == AssemblyType.Native ||
discoverer.Metadata.AssemblyType == AssemblyType.Managed)
{
assemblyTypeToSoucesMap = assemblyTypeToSoucesMap ?? GetAssemblyTypeToSoucesMap(sources);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

spelling

@mayankbansal018 mayankbansal018 removed their request for review April 10, 2018 07:07
private DiscoveryResultCache discoveryResultCache;
private Mock<IRequestData> mockRequestData;
private Mock<IMetricsCollection> mockMetricsCollection;
private Mock<IAssemblyProperties> mockPEReaderHelper;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renaming mockPEReaderHelper to mockAssemblyProperties

@mayankbansal018 mayankbansal018 self-assigned this Apr 10, 2018
this.assemblyProperties = new AssemblyProperties();
}

// Added this to make class testable, needed a PEHeader mocked Instance
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: needed a AssemblyProperties or remove comment.

{
var sourcesToCheck = sources;

if (discoverer.Metadata.AssemblyType == AssemblyType.Native ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a chance discoverer can support both managed and native?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. adapter can't mention both

assemblyTypeToSoucesMap[assemblyProperties.GetAssemblyType(source)] :
assemblyTypeToSoucesMap[AssemblyType.None];

((List<string>)sourcesList).Add(source);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use IList here?

Copy link
Contributor

Choose a reason for hiding this comment

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

done

}
finally
{
this.ResetDiscoverers();
Copy link
Contributor

Choose a reason for hiding this comment

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

Add this to cleanup.

@mayankbansal018 mayankbansal018 merged commit 2f6e1db into microsoft:master Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants