Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

ALL-3936/Package restructure #55

Merged
merged 13 commits into from
Jun 27, 2017
Merged

Conversation

Mecharyry
Copy link
Contributor

Problem

Lots and lots of public classes that could be package if they were in the right place.

Solution

Move classes to logically grouped areas and make them package scope.

Test(s) added

No, just updating packages.

Screenshots

No UI changes.

Paired with

@ouchadam


import java.io.IOException;

final class ExoPlayerErrorFactory {
public final class ExoPlayerErrorFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this ok that is available from the client?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see the problem with this being accessible from the client. They will only get a specific Player.PlayerError based on an Exception. They can't extend it or anything else.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is public a client can do ExoPlayerErrorFactory.errorFor(...). Is this part of the public API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We opted to rename as Mapper and move to the package where it is used 6b400cf

@@ -12,7 +12,7 @@ public TextCues(List<Cue> cues) {
this.cues = cues;
}

List<Cue> cues() {
public List<Cue> cues() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This class needs to be public facing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wouldn't need to be if we collapsed some more packages but all of our models now belong in the model package meaning they need to be public. Personally, I would find it strange if we didn't expose our NoPlayer models.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the client needs to have those models then ok, but if it doesn't then these models become a contract with the clients

Copy link
Contributor

@ouchadam ouchadam Jun 27, 2017

Choose a reason for hiding this comment

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

TextCues is part of the NoPlayer contract as it's used in PlayerView (although in it's current form it's leaking exoplayer but this is fixed in #56)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@zegnus zegnus self-assigned this Jun 27, 2017
@Mecharyry Mecharyry changed the base branch from ALL-3936/ensure_target_api to exo-player-2 June 27, 2017 13:36
@joetimmins joetimmins self-requested a review June 27, 2017 14:08
@juankysoriano juankysoriano requested review from juankysoriano and removed request for joetimmins June 27, 2017 14:08
@joetimmins joetimmins self-assigned this Jun 27, 2017
@@ -391,7 +391,7 @@ public void whenGettingAudioTracks_thenDelegatesToTrackSelector() {
@Mock
DrmSessionCreator drmSessionCreator;
@Mock
ExoPlayerDrmSessionEventListener drmSessionEventListener;
DefaultDrmSessionManager.EventListener drmSessionEventListener;
Copy link
Contributor

Choose a reason for hiding this comment

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

static import?

Copy link
Contributor

@ouchadam ouchadam Jun 27, 2017

Choose a reason for hiding this comment

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

I'm not tooo fussed, it's a test 🍷 unless you really want it? 🌵

Copy link
Contributor

@juankysoriano juankysoriano left a comment

Choose a reason for hiding this comment

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

I guess you feel super good after doing this!!!! all those reduced scopes!!!

Leaving to @joetimmins

import java.io.IOException;
import java.nio.charset.Charset;

class ProvisionExecutorImpl implements ProvisionExecutor {
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 call this something that doesn't end in impl? HttpPostingProvisionExecutor or something maybe?

@joetimmins joetimmins merged commit ef11b30 into exo-player-2 Jun 27, 2017
@Mecharyry Mecharyry deleted the ALL-3936/package_structure branch June 27, 2017 14:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants