Skip to content

Commit

Permalink
Merge pull request #719 from KevinStrong/master
Browse files Browse the repository at this point in the history
Replace deprecated boxed primiative constructors with updated replacements
  • Loading branch information
boncey authored Feb 25, 2024
2 parents e6b8b51 + 0b79130 commit 62506e3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/flickr4java/flickr/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Parameter(String name, Object value) {

public Parameter(String name, long value) {
this.name = name;
this.value = new Long(value);
this.value = value;
}

public String getName() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/flickr4java/flickr/photos/Editability.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public boolean equals(Object obj) {
@Override
public int hashCode() {
int hash = 1;
hash += new Boolean(comment).hashCode();
hash += new Boolean(addmeta).hashCode();
hash += Boolean.hashCode(comment);
hash += Boolean.hashCode(addmeta);
return hash;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/flickr4java/flickr/photos/GeoData.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public boolean equals(Object obj) {
@Override
public int hashCode() {
int hash = 1;
hash += new Float(longitude).hashCode();
hash += new Float(latitude).hashCode();
hash += new Integer(accuracy).hashCode();
hash += Float.hashCode(longitude);
hash += Float.hashCode(latitude);
hash += Integer.hashCode(accuracy);
return hash;
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/flickr4java/flickr/photos/Permissions.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ public boolean equals(Object obj) {
public int hashCode() {
int hash = 87;
hash += id.hashCode();
hash += new Integer(comment).hashCode();
hash += new Integer(addmeta).hashCode();
hash += new Boolean(publicFlag).hashCode();
hash += new Boolean(friendFlag).hashCode();
hash += new Boolean(familyFlag).hashCode();
hash += Integer.hashCode(comment);
hash += Integer.hashCode(addmeta);
hash += Boolean.hashCode(publicFlag);
hash += Boolean.hashCode(friendFlag);
hash += Boolean.hashCode(familyFlag);
return hash;
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/flickr4java/flickr/photos/Size.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ public boolean equals(Object obj) {
public int hashCode() {

int hash = 1;
hash += new Integer(label).hashCode();
hash += new Integer(width).hashCode();
hash += new Integer(height).hashCode();
hash += Integer.hashCode(label);
hash += Integer.hashCode(width);
hash += Integer.hashCode(height);
if (source != null) {
hash += source.hashCode();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/flickr4java/flickr/stats/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void setViews(Long views) {
public void setViews(String views) {

try {
setViews(new Long(views));
setViews(Long.valueOf(views));
} catch (NumberFormatException e) {
// ignore and set value as null
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/flickr4java/flickr/stats/Referrer.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void setViews(Long views) {
public void setViews(String views) {

try {
setViews(new Long(views));
setViews(Long.valueOf(views));
} catch (NumberFormatException e) {
// ignore and set value as null
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/flickr4java/flickr/tags/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public boolean equals(Object obj) {
@Override
public int hashCode() {
int hash = 1;
hash += new Integer(count).hashCode();
hash += Integer.hashCode(count);
if (value != null) {
hash += value.hashCode();
}
Expand Down

0 comments on commit 62506e3

Please sign in to comment.