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

Address the 1 critical issue from Sonar report. #699

Closed
wants to merge 1 commit into from
Closed

Address the 1 critical issue from Sonar report. #699

wants to merge 1 commit into from

Conversation

yinlinchen
Copy link
Contributor

Override "equals(Object obj)" to comply with the contract of the "compareTo(T o)" method
Resolves: https://jira.duraspace.org/browse/FCREPO-1307

@@ -137,4 +137,9 @@ public void addResponseHeaders(final HttpServletResponse servletResponse) {
public int compareTo(final PreferTag otherTag) {
return getTag().compareTo(otherTag.getTag());
}

@Override
public boolean equals(final Object obj) {
Copy link

Choose a reason for hiding this comment

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

Please add a simple unit test for this method to: PreferTagTest.java

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unit test added.

On Wed, Jan 28, 2015 at 2:59 PM, Andrew Woods notifications@github.com
wrote:

In
fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/domain/PreferTag.java
#699 (comment):

@@ -137,4 +137,9 @@ public void addResponseHeaders(final HttpServletResponse servletResponse) {
public int compareTo(final PreferTag otherTag) {
return getTag().compareTo(otherTag.getTag());
}
+

  • @OverRide
  • public boolean equals(final Object obj) {

Please add a simple unit test for this method to: PreferTagTest.java


Reply to this email directly or view it on GitHub
https://github.com/fcrepo4/fcrepo4/pull/699/files#r23717773.

Add unit test PreferTagTest.java
Resolves: https://jira.duraspace.org/browse/FCREPO-1307

Add two unit tests and update PreferTag.java
@@ -66,7 +68,13 @@ public PropertiesRdfContext(final FedoraResource resource,
private Iterator<Triple> triplesFromProperties(final FedoraResource n)
throws RepositoryException {
LOGGER.trace("Creating triples for node: {}", n);
final Iterator<Property> allProperties = n.getNode().getProperties();
final Iterator<Property> allProperties;
if (n instanceof FedoraBinary) {
Copy link

Choose a reason for hiding this comment

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

Why is PropertiesRdfContext in this PR?

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 didn't add this in this PR.. It shows in Untracked file.
I work 2 branches at the same time. I am sure that file didn't add into commit.

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

2 participants