Automatically init native memory when allocating java wrapper

Summary: Don't require calling init() to used an allocated object. This makes more sense and is more in line with how jni in java is generally managed.

Reviewed By: lucasr

Differential Revision: D3992802

fbshipit-source-id: 06d65821f1802ed8f2b2db651cef69f6851803f2
This commit is contained in:
Emil Sjolander
2016-10-12 03:44:52 -07:00
committed by Facebook Github Bot
parent 033658196f
commit 1de914737a

View File

@@ -35,6 +35,10 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
private long mNativePointer;
private Object mData;
public CSSNode() {
init();
}
private void assertNativeInstance() {
if (mNativePointer == 0) {
throw new IllegalStateException("Null native pointer");