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

Change DefaultChannelId visibility to default. Related to [#5053] #5057

Closed
wants to merge 1 commit into from

Conversation

normanmaurer
Copy link
Member

Motivation:

There is no need to make DefaultChannelId package private as it may be useful for the user. For example EmbeddedChannel allows to inject a ChannelId when it is constructed. For this case the user can just use DefaultChannelId.

Modifications:

Change visibility of DefaultChannelId to public.

Result:

It's possible to create a new instance of DefaultChannelId by the user.

@normanmaurer normanmaurer self-assigned this Mar 30, 2016
@normanmaurer normanmaurer added this to the 4.1.0.Final milestone Mar 30, 2016
@normanmaurer
Copy link
Member Author

@Scottmitch @nmittler @trustin PTAL

/**
* Create and return a new {@link ChannelId} instance.
*/
public static ChannelId newInstance() {
Copy link
Member

Choose a reason for hiding this comment

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

Should return DefaultChannelId given that this method is the factory method of DefaultChannelId?

Copy link
Member Author

Choose a reason for hiding this comment

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

@trustin does it make any difference though ?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'm happy. 😆 Consistency matters!

@@ -53,7 +53,10 @@

private static final AtomicInteger nextSequence = new AtomicInteger();

static ChannelId newInstance() {
/**
* Create and return a new {@link DefaultChannelId} instance.
Copy link
Member

Choose a reason for hiding this comment

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

I still think Returns a new ... implies that it creates a new instance and returns it. i.e.

  • 'create' is redundant.
  • It should be 'returns' instead of 'return', because it's not an imperative sentence.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Motivation:

There is no need to make DefaultChannelId package private as it may be useful for the user. For example EmbeddedChannel allows to inject a ChannelId when it is constructed. For this case the user can just use DefaultChannelId.

Modifications:

Change visibility of DefaultChannelId to public.

Result:

It's possible to create a new instance of DefaultChannelId by the user.
@trustin
Copy link
Member

trustin commented Mar 30, 2016

👏 LGTM 👍

@normanmaurer
Copy link
Member Author

Cherry-picked into 4.1 (2facb7a)

@normanmaurer normanmaurer deleted the public_default_channel_id branch March 30, 2016 15:39
@trustin trustin modified the milestones: 4.1.0.Final, 4.1.0.CR6 Apr 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants