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

Restore compatibility with former BaragonGroup #209

Merged
merged 5 commits into from
Feb 3, 2017

Conversation

PtrTeixeira
Copy link
Contributor

Restores compatibility with the old BaragonGroup serialization format by
changing the name of the added field. That is, earlier changes had
swapped the type of the sources field to use TrafficSource rather
than strings; this swaps it back and puts TrafficSources on a
trafficSource field.

This makes the new version compatible with anything using a prior
version of the source of this project.

/cc @ssalinas

Restores compatiblity with the old BaragonGroup serialization format by
changing the name of the added field. That is, earlier changes had
swapped the type of the `sources` field to use `TrafficSource` rather
than strings; this swaps it back and puts `TrafficSource`s on a
`trafficSource` field.

This makes the new version compatible with anything using a prior
version of the source of this project.
this.domains = Objects.firstNonNull(domains, Collections.<String>emptySet());
this.domains = MoreObjects.firstNonNull(domains, Collections.<String>emptySet());

if (sources == null) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can be a bit more clear about what is going on here, it's a bit hard to reason about this way. Maybe something like this?

    this.sources = MoreObjects.firstNonNull(sources, Collections.<String>emptySet());
    if (trafficSources == null) {
      this.trafficSources = sources.forEach((source) -> new TrafficSource(source, TrafficSourceType.CLASSIC));
    } else {
      this.trafficSources = trafficSources;
    }

might have to make sure the most recent stuff is merged in to use the java8 bits, but it would be cleaner/easier to read without having to have the static methods

That is, sources is always just an empty set. When it is input
it is replaced with an empty set.
Add an explicit type argument to help Java out with the type checking.
In theory this shouldn't matter, but as they say, the difference between
theory and practice is smaller in theory than it is in practice.
@PtrTeixeira PtrTeixeira added the qa label Feb 3, 2017
@PtrTeixeira PtrTeixeira merged commit 7337fa7 into alb_support Feb 3, 2017
@PtrTeixeira PtrTeixeira deleted the traffic_source_serialization branch February 3, 2017 20:10
@ssalinas ssalinas removed the staging label Feb 3, 2017
@ssalinas ssalinas modified the milestone: 0.5.0 May 23, 2017
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.

2 participants