From a08a57b33c55f6e2ca966d57d51bfacb9281aeaf Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Wed, 11 Sep 2019 10:24:38 -0700 Subject: [PATCH] Remove unused YogaNodeJNIPhantomRefs.java Summary: Removed unused file YogaNodeJNIPhantomRefs.java as this was causing oss build failures because of an import. ````:yoga:compileDebugJavaWithJavac/home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:9: error: package com.facebook.jni does not exist import com.facebook.jni.DestructorThread; ^ /home/travis/build/facebook/yoga/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java:30: error: package DestructorThread does not exist new DestructorThread.Destructor(node) { ^ 2 errors FAILED Reviewed By: pasqualeanatriello Differential Revision: D17257330 fbshipit-source-id: 98b0c5d5b7dcd94bee559b58194c13b07f47723d --- .../facebook/yoga/YogaNodeJNIPhantomRefs.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java diff --git a/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java b/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java deleted file mode 100644 index a87defd8..00000000 --- a/java/com/facebook/yoga/YogaNodeJNIPhantomRefs.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the LICENSE - * file in the root directory of this source tree. - */ -package com.facebook.yoga; - -import com.facebook.jni.DestructorThread; - -public class YogaNodeJNIPhantomRefs extends YogaNodeJNIBase { - public YogaNodeJNIPhantomRefs() { - super(); - registerPhantomRef(this, mNativePointer); - } - - public YogaNodeJNIPhantomRefs(YogaConfig config) { - super(config); - registerPhantomRef(this, mNativePointer); - } - - @Override - public YogaNodeJNIPhantomRefs cloneWithoutChildren() { - YogaNodeJNIPhantomRefs clone = (YogaNodeJNIPhantomRefs) super.cloneWithoutChildren(); - registerPhantomRef(clone, clone.mNativePointer); - return clone; - } - - private static final void registerPhantomRef(YogaNode node, final long nativePointer) { - new DestructorThread.Destructor(node) { - private long mNativePointer = nativePointer; - @Override - protected void destruct() { - if (mNativePointer != 0) { - YogaNative.jni_YGNodeFree(mNativePointer); - mNativePointer = 0; - } - } - }; - } -}