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

Compare Strings using .equals() instead of == #935

Closed
wants to merge 9 commits into from

Conversation

bencomp
Copy link
Contributor

@bencomp bencomp commented Sep 25, 2014

This was a warning raised by the Inspector in IntelliJ IDEA.

(Plus some parametrised instantiations :))

@landreev
Copy link
Contributor

Yeah, this is embarrassing.
The code in IngestServiceBean.java is mine; as in, I copy-and-pasted it
from somewhere in the old DVN 2-3.*.
I should've looked at it more closely.

So, what is the plan with these pull requests? Are we going to merge
them once everybody whose code is affected reviews them?
Or what?

Alternatively, I can just go ahead and incorporate the changes below
into my code.
I already did that with the SAVFileReader; I was doing work on that
class anyway, so I just fixed the raw declarations while I was at it.

On 9/25/14 2:55 AM, bencomp wrote:

This was a warning raised by the Inspector in IntelliJ IDEA.

(Plus some parametrised instantiations :))


    You can merge this Pull Request by running

git pull https://github.com/bencomp/dataverse master

Or view, comment on, or merge it at:

#935

    Commit Summary


Reply to this email directly or view it on GitHub
#935.

@raprasad
Copy link
Contributor

I incorporated the ShapefileHandler.java changes into my code.

Same for the IngestServiceBean.java, there was an additional bug in the next line--both are checked in.

@pdurbin
Copy link
Member

pdurbin commented Oct 1, 2014

I incorporated the ShapefileHandler.java changes into my code.

That's fine. It means we can automatically merge the pull request, but that's ok. I think @bencomp is just trying to raise awareness.

So, what is the plan with these pull requests?

I thought maybe this small one could get merged but again, I don't think @bencomp will be offended if we don't. @landreev maybe you can just close this request if you've already made your own changes to the code. I'll assign this pull request to you so you can decide.

@@ -132,11 +132,11 @@ public void setDefaultContributorRole(DataverseRole defaultContributorRole) {
private List<DataverseContact> dataverseContacts = new ArrayList();

@OneToMany(cascade = {CascadeType.MERGE})
private List<MetadataBlock> metadataBlocks = new ArrayList();
private List<MetadataBlock> metadataBlocks = new ArrayList<MetadataBlock>();
Copy link
Member

Choose a reason for hiding this comment

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

Equally, we could use diamond inference here, right? Like this: new ArrayList<>();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you could. And in many other places ;)

@pdurbin
Copy link
Member

pdurbin commented Jan 14, 2015

My preference would be to use diamond inference, so I'm going to close this pull request. Note that @raprasad already merged in a lot of the other changes.

See also #775 in which we are defining our coding standards in a Google doc for now, where public comments are enabled.

@pdurbin pdurbin closed this Jan 14, 2015
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.

4 participants