When writing about the hash code, use 'hash code', the compound 'hashcode' is not a work in English. The text 'hashCode()' is left as in of course.
This commit is contained in:
parent
cf950e7365
commit
b836907ddb
|
@ -101,7 +101,7 @@ public class EqualsBuilder implements Builder<Boolean> {
|
||||||
*
|
*
|
||||||
* So we generate a one-to-one mapping from the original object to a new object.
|
* So we generate a one-to-one mapping from the original object to a new object.
|
||||||
*
|
*
|
||||||
* Now HashSet uses equals() to determine if two elements with the same hashcode really
|
* Now HashSet uses equals() to determine if two elements with the same hash code really
|
||||||
* are equal, so we also need to ensure that the replacement objects are only equal
|
* are equal, so we also need to ensure that the replacement objects are only equal
|
||||||
* if the original objects are identical.
|
* if the original objects are identical.
|
||||||
*
|
*
|
||||||
|
|
|
@ -42,7 +42,7 @@ import org.apache.commons.lang3.Validate;
|
||||||
* The following is the approach taken. When appending a data field, the current total is multiplied by the
|
* The following is the approach taken. When appending a data field, the current total is multiplied by the
|
||||||
* multiplier then a relevant value
|
* multiplier then a relevant value
|
||||||
* for that data type is added. For example, if the current hashCode is 17, and the multiplier is 37, then
|
* for that data type is added. For example, if the current hashCode is 17, and the multiplier is 37, then
|
||||||
* appending the integer 45 will create a hashcode of 674, namely 17 * 37 + 45.
|
* appending the integer 45 will create a hash code of 674, namely 17 * 37 + 45.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -126,7 +126,7 @@ public class HashCodeBuilder implements Builder<Integer> {
|
||||||
*
|
*
|
||||||
* So we generate a one-to-one mapping from the original object to a new object.
|
* So we generate a one-to-one mapping from the original object to a new object.
|
||||||
*
|
*
|
||||||
* Now HashSet uses equals() to determine if two elements with the same hashcode really
|
* Now HashSet uses equals() to determine if two elements with the same hash code really
|
||||||
* are equal, so we also need to ensure that the replacement objects are only equal
|
* are equal, so we also need to ensure that the replacement objects are only equal
|
||||||
* if the original objects are identical.
|
* if the original objects are identical.
|
||||||
*
|
*
|
||||||
|
|
|
@ -35,7 +35,7 @@ final class IDKey {
|
||||||
* @param _value The value
|
* @param _value The value
|
||||||
*/
|
*/
|
||||||
public IDKey(final Object _value) {
|
public IDKey(final Object _value) {
|
||||||
// This is the Object hashcode
|
// This is the Object hash code
|
||||||
id = System.identityHashCode(_value);
|
id = System.identityHashCode(_value);
|
||||||
// There have been some cases (LANG-459) that return the
|
// There have been some cases (LANG-459) that return the
|
||||||
// same identity hash code for different objects. So
|
// same identity hash code for different objects. So
|
||||||
|
@ -44,7 +44,7 @@ final class IDKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns hashcode - i.e. the system identity hashcode.
|
* returns hash code - i.e. the system identity hashcode.
|
||||||
* @return the hashcode
|
* @return the hashcode
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2314,7 +2314,7 @@ public abstract class ToStringStyle implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p><code>ToStringStyle</code> that does not print out the classname
|
* <p><code>ToStringStyle</code> that does not print out the classname
|
||||||
* and identity hashcode but prints content start and field names.</p>
|
* and identity hash code but prints content start and field names.</p>
|
||||||
*
|
*
|
||||||
* <p>This is an inner class rather than using
|
* <p>This is an inner class rather than using
|
||||||
* <code>StandardToStringStyle</code> to ensure its immutability.</p>
|
* <code>StandardToStringStyle</code> to ensure its immutability.</p>
|
||||||
|
|
|
@ -848,7 +848,7 @@ public final class Fraction extends Number implements Comparable<Fraction> {
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
if (hashCode == 0) {
|
if (hashCode == 0) {
|
||||||
// hashcode update should be atomic.
|
// hash code update should be atomic.
|
||||||
hashCode = 37 * (37 * 17 + getNumerator()) + getDenominator();
|
hashCode = 37 * (37 * 17 + getNumerator()) + getDenominator();
|
||||||
}
|
}
|
||||||
return hashCode;
|
return hashCode;
|
||||||
|
|
|
@ -636,9 +636,9 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns a hashcode compatible with equals.</p>
|
* <p>Returns a hash code compatible with equals.</p>
|
||||||
*
|
*
|
||||||
* @return a hashcode compatible with equals
|
* @return a hash code compatible with equals
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
|
@ -308,9 +308,9 @@ public class FastDateParser implements DateParser, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Return a hashcode compatible with equals.</p>
|
* <p>Return a hash code compatible with equals.</p>
|
||||||
*
|
*
|
||||||
* @return a hashcode compatible with equals
|
* @return a hash code compatible with equals
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
|
@ -637,9 +637,9 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Returns a hashcode compatible with equals.</p>
|
* <p>Returns a hash code compatible with equals.</p>
|
||||||
*
|
*
|
||||||
* @return a hashcode compatible with equals
|
* @return a hash code compatible with equals
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
|
|
Loading…
Reference in New Issue