-
Notifications
You must be signed in to change notification settings - Fork 569
Expand file tree
/
Copy pathJavaProxyObject.java
More file actions
45 lines (37 loc) · 1009 Bytes
/
JavaProxyObject.java
File metadata and controls
45 lines (37 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package net.dot.jni.internal;
import java.util.ArrayList;
import net.dot.jni.GCUserPeerable;
/* package */ final class JavaProxyObject
extends java.lang.Object
implements GCUserPeerable
{
ArrayList<Object> managedReferences = new ArrayList<Object> ();
// This trimmable runtime copy cannot use Java.Interop's native object methods:
// those are registered through ManagedPeer.registerNativeMembers, which is not
// supported in the trimmable typemap path.
// Trimmable proxies use Java identity semantics: equals/hashCode/toString
// do not delegate to the wrapped .NET object.
@Override
public boolean equals (Object obj)
{
return this == obj;
}
@Override
public int hashCode ()
{
return System.identityHashCode (this);
}
@Override
public String toString ()
{
return super.toString ();
}
public void jiAddManagedReference (java.lang.Object obj)
{
managedReferences.add (obj);
}
public void jiClearManagedReferences ()
{
managedReferences.clear ();
}
}