Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/java.base/share/classes/java/lang/ref/WeakReference.java
12521 views
1
/*[INCLUDE-IF Sidecar16]*/
2
package java.lang.ref;
3
4
/*******************************************************************************
5
* Copyright (c) 1998, 2010 IBM Corp. and others
6
*
7
* This program and the accompanying materials are made available under
8
* the terms of the Eclipse Public License 2.0 which accompanies this
9
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
10
* or the Apache License, Version 2.0 which accompanies this distribution and
11
* is available at https://www.apache.org/licenses/LICENSE-2.0.
12
*
13
* This Source Code may also be made available under the following
14
* Secondary Licenses when the conditions for such availability set
15
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
16
* General Public License, version 2 with the GNU Classpath
17
* Exception [1] and GNU General Public License, version 2 with the
18
* OpenJDK Assembly Exception [2].
19
*
20
* [1] https://www.gnu.org/software/classpath/license.html
21
* [2] http://openjdk.java.net/legal/assembly-exception.html
22
*
23
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
24
*******************************************************************************/
25
26
/**
27
* WeakReference objects are used to detect referents which
28
* are no longer visible.
29
*
30
* @author OTI
31
* @version initial
32
* @since 1.2
33
*/
34
public class WeakReference<T> extends java.lang.ref.Reference<T> {
35
36
/**
37
* Constructs a new instance of this class.
38
*
39
* @param r referent to track.
40
* @param q queue to register to the reference object with.
41
*/
42
public WeakReference(T r, ReferenceQueue<? super T> q) {
43
initReference(r, q);
44
}
45
46
/**
47
* Constructs a new instance of this class.
48
*
49
* @param r referent to track.
50
*/
51
public WeakReference(T r) {
52
initReference(r);
53
}
54
}
55
56