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

Corrected all Java interfaces declarations #2807

Merged
merged 1 commit into from
Mar 17, 2015

Conversation

artem-zinnatullin
Copy link
Contributor

Just little Java syntax fix for interfaces

I checked all interfaces in RxJava.

@benjchristensen I can add and configure Checkstyle gradle plugin for RxJava if you don't mind, mm?

@akarnokd
Copy link
Member

akarnokd commented Mar 5, 2015

I like the changes. However, we don't have a style guideline because we don't want to enforce one particular coding style on contributors: the functionality is first, the style is secondary.

@artem-zinnatullin
Copy link
Contributor Author

@akarnokd great

About code style: project is actively developing and code style can be problem in future, I think it will be good to have small amount of Checkstyle rules integrated with build process

You can ping me if you'll decide to do it with my help

@colriot
Copy link

colriot commented Mar 6, 2015

I agree on the necessity of Checkstyle, but may be it's already not the right time to remove public from interface methods. See: https://bugs.openjdk.java.net/browse/JDK-8071453. It's pretty distant future, but why do additional work that sums up to zero in this future.

@artem-zinnatullin
Copy link
Contributor Author

@colriot as I see, they won't break source compatibility and empty modifier in interface will be public abstract as before, if you would like to add implementation to interface, you'll have to write default modifier or private, also there is 100% no need in declaring static interface it's like writing extends Object in each class 😄

@colriot
Copy link

colriot commented Mar 6, 2015

@artem-zinnatullin yeah, completely agree on static, I was talking about public only. Speaking of compatibility, what you've said is true, but I personally prefer either to hide all the implicits if they are unambigous and ubiquitous, or to write them explicitly if there are other "theoretical" options, like private. Obviously, all that has sense if the library is targeting Java 8 or 9.

@benjchristensen
Copy link
Member

I can add and configure Checkstyle gradle plugin

I have a general aversion to Checkstyle as it is generally just unnecessary purely subjective opinions imposed upon people and causing otherwise fine code to fail a build.

In the 2+ years of this project taking pull requests style has rarely been a topic of discussion or issue.

What legit problems that affect behavior or safety will Checkstyle solve?

As for the changes in these pull request, a brief review seems like they are okay but I'll spend more time when I have it to review in depth.

@headinthebox
Copy link
Contributor

+1 for Ben.

@artem-zinnatullin
Copy link
Contributor Author

What legit problems that affect behavior or safety will Checkstyle solve? None of them, just code style.

I got your point, okay.

P.S. Not a fan of Airbnb, just want to quote their "nerds" post:

screen shot 2015-03-07 at 16 48 46

But I can't say, that it applicable to RxJava, code style is good in most of files 👍

benjchristensen added a commit that referenced this pull request Mar 17, 2015
Corrected all Java interfaces declarations
@benjchristensen benjchristensen merged commit 23a240b into ReactiveX:1.x Mar 17, 2015
@artem-zinnatullin artem-zinnatullin deleted the correct-interfaces branch March 17, 2015 17:05
@@ -34,7 +34,7 @@
* <p>
* The {@link Observable} will not call this method if it calls {@link #onError}.
*/
public abstract void onCompleted();
void onCompleted();
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change. E.g., RxScala has a Scala Observer wrapper that calls these methods. Removing public abstract will break them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Both modifiers are implicit and redundant. Run javap on the class file and you'll see both are still present.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you. Never noticed they are public by default...

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.

7 participants