Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/oauth
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/OAuthToken.java
r9067 r9371 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.oauth; 3 4 import java.util.Objects; 3 5 4 6 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 64 66 @Override 65 67 public int hashCode() { 66 final int prime = 31; 67 int result = 1; 68 result = prime * result + ((key == null) ? 0 : key.hashCode()); 69 result = prime * result + ((secret == null) ? 0 : secret.hashCode()); 70 return result; 68 return Objects.hash(key, secret); 71 69 } 72 70 73 71 @Override 74 72 public boolean equals(Object obj) { 75 if (this == obj) 76 return true; 77 if (obj == null) 78 return false; 79 if (getClass() != obj.getClass()) 80 return false; 81 OAuthToken other = (OAuthToken) obj; 82 if (key == null) { 83 if (other.key != null) 84 return false; 85 } else if (!key.equals(other.key)) 86 return false; 87 if (secret == null) { 88 if (other.secret != null) 89 return false; 90 } else if (!secret.equals(other.secret)) 91 return false; 92 return true; 73 if (this == obj) return true; 74 if (obj == null || getClass() != obj.getClass()) return false; 75 OAuthToken that = (OAuthToken) obj; 76 return Objects.equals(key, that.key) && 77 Objects.equals(secret, that.secret); 93 78 } 94 79 }
Note:
See TracChangeset
for help on using the changeset viewer.