Skip to content

ISSUE-74 : Fix when parsing an XCApi containing different components with the same stateMachine name#75

Merged
Julien-Molina merged 4 commits intomasterfrom
ISSUE-74
Feb 1, 2018
Merged

ISSUE-74 : Fix when parsing an XCApi containing different components with the same stateMachine name#75
Julien-Molina merged 4 commits intomasterfrom
ISSUE-74

Conversation

@yahyanajar
Copy link
Copy Markdown
Collaborator

@yahyanajar yahyanajar commented Jan 31, 2018

closes #74

private Dictionary<TopicIdentifier, string> _publisherTopicByIdentifier;
private Dictionary<TopicIdentifier, string> _subscriberTopicByIdentifier;
private Dictionary<long, string> _snapshotTopicByComponent;
private Dictionary<string, List<StateMachineInfo>> _stateMachineInfoByComponentRepository;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose something "Repo" "Repository" or "Nothing" and use it everywhere. I would suggest to remove Repository & Repo.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done


_componentCodeByComponent = CreateComponentCodeByNameRepository(_xcApiDescription.GetComponentsNode());
_stateMachineCodeByStateMachine = CreateStateMachineCodeByNameRepository(_xcApiDescription.GetStateMachinesNode());
ParseComponentNodes(_xcApiDescription.GetComponentsNode(), out _componentCodeByComponentNameRepo, out _stateMachineInfoByComponentRepository);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove out _componentCodeByComponentNameRepo, out _stateMachineInfoByComponentRepository and use them directly in the private method

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

}
}

private Dictionary<long, string> CreateSnapshotTopicByComponentRepository(IEnumerable<XElement> snapshotNodes)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same problem with namings here : "Repo" and "Repository"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

if (!repository.ContainsKey(componentCode))
{
repository.Add(componentCode, node?.Descendants(_xc + XCApiTags.Topic).FirstOrDefault().Value);
repository.Add(componentCode, node?.Descendants(_xc + XCApiTags.Topic).FirstOrDefault()?.Value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really want to add null values in the dictionnary ?

namespace ReactiveXComponent.Parser
{
public class StateMachineInfo
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Create a constructor with 2 parameters and remove the public setters

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@yahyanajar yahyanajar requested a review from mbarekh January 31, 2018 15:39
Copy link
Copy Markdown
Contributor

@anouarhassine anouarhassine left a comment

Choose a reason for hiding this comment

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

Remove the old Tools folder (with capital T). It is still there in your branch

@Julien-Molina Julien-Molina merged commit 3553658 into master Feb 1, 2018
@Julien-Molina Julien-Molina deleted the ISSUE-74 branch February 1, 2018 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API initialization problem

3 participants