projects
/
ldk-java
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Java] Handle nullable arrays
[ldk-java]
/
src
/
main
/
java
/
org
/
ldk
/
structs
/
PrivateRoute.java
diff --git
a/src/main/java/org/ldk/structs/PrivateRoute.java
b/src/main/java/org/ldk/structs/PrivateRoute.java
index a74bcc892381ca926249cd915617d546fae0dd36..f839d1a3b18c7efa963e3138da8d8fcba6d4473a 100644
(file)
--- a/
src/main/java/org/ldk/structs/PrivateRoute.java
+++ b/
src/main/java/org/ldk/structs/PrivateRoute.java
@@
-4,6
+4,7
@@
import org.ldk.impl.bindings;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
import javax.annotation.Nullable;
@@
-22,14
+23,21
@@
public class PrivateRoute extends CommonBase {
if (ptr != 0) { bindings.PrivateRoute_free(ptr); }
}
if (ptr != 0) { bindings.PrivateRoute_free(ptr); }
}
+ long clone_ptr() {
+ long ret = bindings.PrivateRoute_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Creates a copy of the PrivateRoute
*/
public PrivateRoute clone() {
long ret = bindings.PrivateRoute_clone(this.ptr);
/**
* Creates a copy of the PrivateRoute
*/
public PrivateRoute clone() {
long ret = bindings.PrivateRoute_clone(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new
PrivateRoute(null, ret); }
-
ret_hu_conv.ptrs_to.add(this)
;
+
org.ldk.structs.PrivateRoute ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.
PrivateRoute(null, ret); }
+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }
;
return ret_hu_conv;
}
return ret_hu_conv;
}
@@
-38,27
+46,39
@@
public class PrivateRoute extends CommonBase {
*/
public long hash() {
long ret = bindings.PrivateRoute_hash(this.ptr);
*/
public long hash() {
long ret = bindings.PrivateRoute_hash(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
return ret;
}
+ @Override public int hashCode() {
+ return (int)this.hash();
+ }
/**
* Checks if two PrivateRoutes contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
public boolean eq(PrivateRoute b) {
/**
* Checks if two PrivateRoutes contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
* Two objects with NULL inner values will be considered "equal" here.
*/
public boolean eq(PrivateRoute b) {
- boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
- this.ptrs_to.add(b);
+ boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
return ret;
}
return ret;
}
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof PrivateRoute)) return false;
+ return this.eq((PrivateRoute)o);
+ }
/**
* Creates a new (partial) route from a list of hops
*/
public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
/**
* Creates a new (partial) route from a list of hops
*/
public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
- long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+ long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr);
+ Reference.reachabilityFence(hops);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hops); };
return ret_hu_conv;
}
return ret_hu_conv;
}
@@
-67,10
+87,11
@@
public class PrivateRoute extends CommonBase {
*/
public RouteHint into_inner() {
long ret = bindings.PrivateRoute_into_inner(this.ptr);
*/
public RouteHint into_inner() {
long ret = bindings.PrivateRoute_into_inner(this.ptr);
+ Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
if (ret >= 0 && ret <= 4096) { return null; }
-
RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new
RouteHint(null, ret); }
-
ret_hu_conv.ptrs_to.add(this)
;
- ;
+
org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.
RouteHint(null, ret); }
+
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }
;
+
if (this != null) { this.ptrs_to.add(this); }
;
return ret_hu_conv;
}
return ret_hu_conv;
}