WeakishReference (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util, class: WeakishReference

# Class WeakishReference

java.lang.Object
org.apache.tools.ant.util.WeakishReference

Direct Known Subclasses:
  `WeakishReference.HardReference`

@Deprecated public class WeakishReference extends Object
Deprecated.
deprecated 1.7; will be removed in Ant1.8 Just use `WeakReference` directly.
These classes are part of some code to reduce memory leaks by only retaining weak references to things on Java1.2+, and yet still work (with leaky hard references) on Java1.1. Now that Ant is 1.2+ only, life is simpler and none of the classes are needed any more. They are only retained in case a third-party task uses them

Since:
  ant1.6
See Also:
  - `WeakishReference12`

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `WeakishReference.HardReference`
  Deprecated.
  since 1.7.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static WeakishReference`
  `createReference(Object object)`
  Deprecated.
  create the appropriate type of reference for the java version
  `Object`
  `get()`
  Deprecated.
  Returns this reference object's referent.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### get

    public Object get()
    Deprecated.
    Returns this reference object's referent. If this reference object has been cleared, then this method returns `null`.
    Returns:
      The object to which this reference refers, or `null` if this reference object has been cleared.

  - ### createReference

    public static WeakishReference createReference(Object object)
    Deprecated.
    create the appropriate type of reference for the java version
    Parameters:
      `object` - the object that the reference will refer to.
    Returns:
      reference to the Object.