[go: nahoru, domu]

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

Some sonar fixes #1141

Merged
merged 1 commit into from
Jun 1, 2015
Merged

Some sonar fixes #1141

merged 1 commit into from
Jun 1, 2015

Conversation

baev
Copy link
Contributor
@baev baev commented May 12, 2015

No description provided.

@@ -34,7 +34,7 @@
map.put(b, a);
}

public static ArrayList<ParameterSignature> signatures(Method method) {
public static List<ParameterSignature> signatures(Method method) {
Copy link
Member

Choose a reason for hiding this comment

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

This change could break people.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there way to migrate to List without breaking people?

Copy link
Member

Choose a reason for hiding this comment

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

Not in public API signatures. If we have a public method that returns an ArrayList we can't change it to return a List:

ArrayList<String> s = ParameterSignature.signatures(method); // woops!

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 understand. I ask about some best practices like a "add deprecation with a comment about migration to List in next releases". Btw I put it back to the ArrayList

Copy link
Member

Choose a reason for hiding this comment

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

I personally don't think it's worth it to deprecate the method and replace it with a similarly-named method that returns a List

@kcooney
Copy link
Member
kcooney commented May 12, 2015

Thanks for the fixes! The 'static public' bothers me too :-)

@@ -34,6 +34,15 @@
* @since 4.4
*/
public class Assume {

/**
* Do not use instance if this class.
Copy link
Member

Choose a reason for hiding this comment

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

Let's change this Javadoc to simply "Do not instantiate." Ditto for ResultMatchers and Classes

@kcooney
Copy link
Member
kcooney commented May 13, 2015

LGTM. I can fix the minor problems that are left when I merge this.

@junit-team/junit-committers can one of you please take a look?

@baev
Copy link
Contributor Author
baev commented May 13, 2015

@kcooney done

}
}

static private boolean doubleIsDifferent(double d1, double d2, double delta) {
Copy link
Member

Choose a reason for hiding this comment

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

These implementations (floatIsDifferent, doubleIsDifferent) were deliberate stylistic choices for readability. I don't feel strongly about the style, but feel that muddying the git history for a different stylistic change doesn't seem worth it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@dsaff
Copy link
Member
dsaff commented May 13, 2015

Mostly great stuff. I've commented the few places that give me pause: in places where there's at best a minor improvement in style, or just a fit to a different preference, I'd prefer not to make the change, a lesson learned since our "git blame" history became largely useless after we "fixed" all the indentation.

@baev
Copy link
Contributor Author
baev commented May 21, 2015

@dsaff thx for the review. All the comments are fixed now.

@marcphilipp
Copy link
Member

LGTM!

@dsaff Do you want to take another look?

@dsaff
Copy link
Member
dsaff commented Jun 1, 2015

LGTM2!

marcphilipp added a commit that referenced this pull request Jun 1, 2015
@marcphilipp marcphilipp merged commit f56556f into junit-team:master Jun 1, 2015
@marcphilipp marcphilipp added this to the 4.13 milestone Jul 9, 2015
marcphilipp pushed a commit that referenced this pull request Sep 6, 2020
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