Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override ordering for bundle dependency filters #4886

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

Legioth
Copy link
Member

@Legioth Legioth commented Dec 19, 2018

Backported variant of #4878. This approach avoids API changes, but
increases complexity instead of reducing it.


This change is Reviewable

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java, line 278 at r1 (raw file):

                .sorted(Comparator.comparingInt(
                        filter -> filter instanceof BundleDependencyFilter ? 1
                                : 0))

This logic could be tested.

@Legioth
Copy link
Member Author

Legioth commented Dec 21, 2018


flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java, line 278 at r1 (raw file):

Previously, denis-anisimov (Denis) wrote…
                .sorted(Comparator.comparingInt(
                        filter -> filter instanceof BundleDependencyFilter ? 1
                                : 0))

This logic could be tested.

Please suggest any sensible way of testing this. For reference, the original implementation that was included in master didn't have any tests for the reasons described in #4878 (comment).

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java, line 278 at r1 (raw file):

Previously, Legioth (Leif Åstrand) wrote…

Please suggest any sensible way of testing this. For reference, the original implementation that was included in master didn't have any tests for the reasons described in #4878 (comment).

I'm not sure that I've not missed something but it looks like this should work:

  • Extend VaadinService.
  • Override either createInstantiator().
  • Return you own Instantiator mock.
  • Mock/override getDependencyFilters method.
  • Check that getDependencyFilters() returns the BundleDependencyFilter instances in the end of Iterable.

Looks like everything is doable.

Backported variant of #4878. This approach avoids API changes, but
increases complexity instead of reducing it.
Copy link
Member Author

@Legioth Legioth left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/server/VaadinService.java, line 278 at r1 (raw file):

Previously, denis-anisimov (Denis) wrote…

I'm not sure that I've not missed something but it looks like this should work:

  • Extend VaadinService.
  • Override either createInstantiator().
  • Return you own Instantiator mock.
  • Mock/override getDependencyFilters method.
  • Check that getDependencyFilters() returns the BundleDependencyFilter instances in the end of Iterable.

Looks like everything is doable.

Done.

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 6 issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. CRITICAL VaadinService.java#L2101: First sentence of Javadoc is incomplete (period is missing) or not present. rule
  2. CRITICAL VaadinService.java#L2135: First sentence of Javadoc is incomplete (period is missing) or not present. rule
  3. CRITICAL VaadinService.java#L2147: First sentence of Javadoc is incomplete (period is missing) or not present. rule
  4. CRITICAL VaadinService.java#L2159: First sentence of Javadoc is incomplete (period is missing) or not present. rule
  5. MINOR VaadinService.java#L573: This call to "add()" may be a performance hot spot if the collection is large. rule
  6. MINOR VaadinService.java#L574: This call to "remove()" may be a performance hot spot if the collection is large. rule

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: 1 unresolved discussion, 1 of 1 LGTMs obtained

Copy link
Contributor

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@denis-anisimov denis-anisimov merged commit 85b01ca into 1.2 Jan 4, 2019
@denis-anisimov denis-anisimov deleted the dependencyFilterOrder_12 branch January 4, 2019 06:33
@bogdanudrescu bogdanudrescu added this to the 1.2.4 milestone Jan 8, 2019
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.

None yet

4 participants