Skip to content

bugfix/java references#335

Merged
baywet merged 3 commits intofeature/java-v3from
bugfix/java-references
Dec 4, 2020
Merged

bugfix/java references#335
baywet merged 3 commits intofeature/java-v3from
bugfix/java-references

Conversation

@baywet
Copy link
Copy Markdown
Member

@baywet baywet commented Nov 27, 2020

  • fixes a bug where java reference update requests would fail due to formatting
  • updates test files

updates & related to:
microsoftgraph/msgraph-sdk-java#576

@baywet baywet self-assigned this Nov 27, 2020
@baywet baywet marked this pull request as draft November 30, 2020 15:36
@baywet baywet force-pushed the bugfix/java-references branch from 4c56873 to 550da59 Compare December 1, 2020 19:39
@baywet baywet marked this pull request as ready for review December 1, 2020 19:42
@baywet baywet marked this pull request as draft December 2, 2020 18:21
@baywet baywet force-pushed the bugfix/java-references branch 2 times, most recently from 9c353d3 to 51e546c Compare December 2, 2020 19:12
@baywet baywet changed the base branch from dev to feature/java-v3 December 2, 2020 19:12
@baywet baywet marked this pull request as ready for review December 2, 2020 19:12
@baywet baywet force-pushed the bugfix/java-references branch from 09dcf6a to c886969 Compare December 2, 2020 19:47
@baywet baywet requested review from nikithauc and zengin December 2, 2020 19:49
Comment on lines +195 to +202
var entityContainerProperties = m.EntityContainer.Properties.Where(propertiesFilter);
var namespaceProperties = m.Namespaces
.SelectMany(x => x.Classes)
.SelectMany(x => x.Properties.Where(propertiesFilter));
return m.EntityContainer.Properties.OfType<OdcmSingleton>()
.SelectMany(x => x.Projection.Type.AsOdcmClass().Properties.Where(propertiesFilter))
.Union(entityContainerProperties.Any() ? entityContainerProperties : new List<OdcmProperty>())
.Union(namespaceProperties.Any() ? namespaceProperties : new List<OdcmProperty>());
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.

not blocking, but I wonder what you think about this in terms of reading the logic faster:

Suggested change
var entityContainerProperties = m.EntityContainer.Properties.Where(propertiesFilter);
var namespaceProperties = m.Namespaces
.SelectMany(x => x.Classes)
.SelectMany(x => x.Properties.Where(propertiesFilter));
return m.EntityContainer.Properties.OfType<OdcmSingleton>()
.SelectMany(x => x.Projection.Type.AsOdcmClass().Properties.Where(propertiesFilter))
.Union(entityContainerProperties.Any() ? entityContainerProperties : new List<OdcmProperty>())
.Union(namespaceProperties.Any() ? namespaceProperties : new List<OdcmProperty>());
return m.EntityContainer.Properties
.Union(m.Namespaces.SelectMany(x => x.Classes)
.SelectMany(x => x.Properties))
.Union(m.EntityContainer.Properties.OfType<OdcmSingleton>()
.SelectMany(x => x.Projection.Type.AsOdcmClass().Properties))
.Where(propertiesFilter);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks for the suggestion. After going back and forth I forgot to take a step back on this one.
I just pushed a new commit improving upon your suggestion, let me know what you think

@baywet baywet requested a review from zengin December 4, 2020 13:54
@baywet baywet merged commit c9c787f into feature/java-v3 Dec 4, 2020
@baywet baywet deleted the bugfix/java-references branch December 4, 2020 23:07
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.

4 participants