Skip to content

Commit

Permalink
Mark model fields final
Browse files Browse the repository at this point in the history
Reviewed By: emilsjolander

Differential Revision: D6759564

fbshipit-source-id: 810dc8a9730fb330760d2aedecafcea81cf25cb1
  • Loading branch information
passy authored and facebook-github-bot committed Jan 22, 2018
1 parent f49f793 commit ff2658c
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public enum YogaAlign {
SPACE_BETWEEN(6),
SPACE_AROUND(7);

private int mIntValue;
private final int mIntValue;

YogaAlign(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum YogaDimension {
WIDTH(0),
HEIGHT(1);

private int mIntValue;
private final int mIntValue;

YogaDimension(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum YogaDirection {
LTR(1),
RTL(2);

private int mIntValue;
private final int mIntValue;

YogaDirection(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum YogaDisplay {
FLEX(0),
NONE(1);

private int mIntValue;
private final int mIntValue;

YogaDisplay(int intValue) {
mIntValue = intValue;
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/java/com/facebook/yoga/YogaEdge.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum YogaEdge {
VERTICAL(7),
ALL(8);

private int mIntValue;
private final int mIntValue;

YogaEdge(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public enum YogaExperimentalFeature {
WEB_FLEX_BASIS(0);

private int mIntValue;
private final int mIntValue;

YogaExperimentalFeature(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum YogaFlexDirection {
ROW(2),
ROW_REVERSE(3);

private int mIntValue;
private final int mIntValue;

YogaFlexDirection(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum YogaJustify {
SPACE_AROUND(4),
SPACE_EVENLY(5);

private int mIntValue;
private final int mIntValue;

YogaJustify(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum YogaLogLevel {
VERBOSE(4),
FATAL(5);

private int mIntValue;
private final int mIntValue;

YogaLogLevel(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum YogaMeasureMode {
EXACTLY(1),
AT_MOST(2);

private int mIntValue;
private final int mIntValue;

YogaMeasureMode(int intValue) {
mIntValue = intValue;
Expand Down
12 changes: 7 additions & 5 deletions ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class YogaNode {
private List<YogaNode> mChildren;
private YogaMeasureFunction mMeasureFunction;
private YogaBaselineFunction mBaselineFunction;
private long mNativePointer;
private final long mNativePointer;
private Object mData;

/* Those flags needs be in sync with YGJNI.cpp */
private final static int MARGIN = 1;
private final static int PADDING = 2;
private final static int BORDER = 4;
private static final int MARGIN = 1;
private static final int PADDING = 2;
private static final int BORDER = 4;

@DoNotStrip
private int mEdgeSetFlag = 0;
Expand Down Expand Up @@ -100,6 +100,7 @@ public YogaNode(YogaConfig config) {
}

private native void jni_YGNodeFree(long nativePointer);
@Override
protected void finalize() throws Throwable {
try {
jni_YGNodeFree(mNativePointer);
Expand Down Expand Up @@ -170,7 +171,8 @@ public YogaNode removeChildAt(int i) {
return child;
}

public @Nullable
@Nullable
public
YogaNode getParent() {
return mParent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum YogaNodeType {
DEFAULT(0),
TEXT(1);

private int mIntValue;
private final int mIntValue;

YogaNodeType(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum YogaOverflow {
HIDDEN(1),
SCROLL(2);

private int mIntValue;
private final int mIntValue;

YogaOverflow(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum YogaPositionType {
RELATIVE(0),
ABSOLUTE(1);

private int mIntValue;
private final int mIntValue;

YogaPositionType(int intValue) {
mIntValue = intValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum YogaPrintOptions {
STYLE(2),
CHILDREN(4);

private int mIntValue;
private final int mIntValue;

YogaPrintOptions(int intValue) {
mIntValue = intValue;
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/java/com/facebook/yoga/YogaUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum YogaUnit {
PERCENT(2),
AUTO(3);

private int mIntValue;
private final int mIntValue;

YogaUnit(int intValue) {
mIntValue = intValue;
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/java/com/facebook/yoga/YogaWrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum YogaWrap {
WRAP(1),
WRAP_REVERSE(2);

private int mIntValue;
private final int mIntValue;

YogaWrap(int intValue) {
mIntValue = intValue;
Expand Down

0 comments on commit ff2658c

Please sign in to comment.