Rename reset() -> free() to be more in line with what it now does

Summary: Rename reset() -> free() to be more in line with what it now does as the default implementation is JNI

Reviewed By: lucasr

Differential Revision: D3992808

fbshipit-source-id: 8428ae33268d1417ce8642b741e47150a17bf077
This commit is contained in:
Emil Sjolander
2016-10-12 03:44:53 -07:00
committed by Facebook Github Bot
parent 1de914737a
commit 23acf2156f
3 changed files with 6 additions and 6 deletions

View File

@@ -58,10 +58,10 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
private native void jni_CSSNodeFree(long nativePointer); private native void jni_CSSNodeFree(long nativePointer);
@Override @Override
public void reset() { public void free() {
assertNativeInstance(); assertNativeInstance();
if (mParent != null || (mChildren != null && mChildren.size() > 0)) { if (mParent != null || (mChildren != null && mChildren.size() > 0)) {
throw new IllegalStateException("You should not reset an attached CSSNode"); throw new IllegalStateException("You should not free an attached CSSNode");
} }
jni_CSSNodeFree(mNativePointer); jni_CSSNodeFree(mNativePointer);

View File

@@ -90,5 +90,5 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
void setData(Object data); void setData(Object data);
Object getData(); Object getData();
void init(); void init();
void reset(); void free();
} }

View File

@@ -63,7 +63,7 @@ public class CSSNodeDEPRECATED implements CSSNodeAPI<CSSNodeDEPRECATED> {
@Override @Override
public void init() { public void init() {
reset(); free();
} }
@Override @Override
@@ -640,9 +640,9 @@ public class CSSNodeDEPRECATED implements CSSNodeAPI<CSSNodeDEPRECATED> {
* recycling {@link CSSNodeDEPRECATED} instances. * recycling {@link CSSNodeDEPRECATED} instances.
*/ */
@Override @Override
public void reset() { public void free() {
if (mParent != null || (mChildren != null && mChildren.size() > 0)) { if (mParent != null || (mChildren != null && mChildren.size() > 0)) {
throw new IllegalStateException("You should not reset an attached CSSNodeDEPRECATED"); throw new IllegalStateException("You should not free an attached CSSNodeDEPRECATED");
} }
style.reset(); style.reset();