jdk/src/java.base/share/classes/java/lang/Object.java
changeset 28683 a36c179aa292
parent 27733 e4e4d12307d7
child 28685 6e8154707178
equal deleted inserted replaced
28682:6c7c7cad5e64 28683:a36c179aa292
     1 /*
     1 /*
     2  * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    84      *     two objects must produce distinct integer results.  However, the
    84      *     two objects must produce distinct integer results.  However, the
    85      *     programmer should be aware that producing distinct integer results
    85      *     programmer should be aware that producing distinct integer results
    86      *     for unequal objects may improve the performance of hash tables.
    86      *     for unequal objects may improve the performance of hash tables.
    87      * </ul>
    87      * </ul>
    88      * <p>
    88      * <p>
    89      * As much as is reasonably practical, the hashCode method defined by
    89      * As much as is reasonably practical, the hashCode method defined
    90      * class {@code Object} does return distinct integers for distinct
    90      * by class {@code Object} does return distinct integers for
    91      * objects. (This is typically implemented by converting the internal
    91      * distinct objects. (The hashCode may or may not be implemented
    92      * address of the object into an integer, but this implementation
    92      * as some function of an object's memory address at some point
    93      * technique is not required by the
    93      * in time.)
    94      * Java&trade; programming language.)
       
    95      *
    94      *
    96      * @return  a hash code value for this object.
    95      * @return  a hash code value for this object.
    97      * @see     java.lang.Object#equals(java.lang.Object)
    96      * @see     java.lang.Object#equals(java.lang.Object)
    98      * @see     java.lang.System#identityHashCode
    97      * @see     java.lang.System#identityHashCode
    99      */
    98      */
   342      *         while (&lt;condition does not hold&gt;)
   341      *         while (&lt;condition does not hold&gt;)
   343      *             obj.wait(timeout);
   342      *             obj.wait(timeout);
   344      *         ... // Perform action appropriate to condition
   343      *         ... // Perform action appropriate to condition
   345      *     }
   344      *     }
   346      * </pre>
   345      * </pre>
   347      * (For more information on this topic, see Section 3.2.3 in Doug Lea's
   346      *
   348      * "Concurrent Programming in Java (Second Edition)" (Addison-Wesley,
   347      * (For more information on this topic, see section 14.2,
   349      * 2000), or Item 50 in Joshua Bloch's "Effective Java Programming
   348      * Condition Queues, in Brian Goetz and others' "Java Concurrency
   350      * Language Guide" (Addison-Wesley, 2001).
   349      * in Practice" (Addison-Wesley, 2006) or Item 69 in Joshua
       
   350      * Bloch's "Effective Java (Second Edition)" (Addison-Wesley,
       
   351      * 2008).
   351      *
   352      *
   352      * <p>If the current thread is {@linkplain java.lang.Thread#interrupt()
   353      * <p>If the current thread is {@linkplain java.lang.Thread#interrupt()
   353      * interrupted} by any thread before or while it is waiting, then an
   354      * interrupted} by any thread before or while it is waiting, then an
   354      * {@code InterruptedException} is thrown.  This exception is not
   355      * {@code InterruptedException} is thrown.  This exception is not
   355      * thrown until the lock status of this object has been restored as
   356      * thrown until the lock status of this object has been restored as