Merge pull request #22 from foghina/master
Add jsr305, couple of @Nullable annotations
This commit is contained in:
3
Makefile
3
Makefile
@@ -17,7 +17,8 @@ c_test: c
|
|||||||
|
|
||||||
java: transpile_all src/java
|
java: transpile_all src/java
|
||||||
@if [ ! -f lib/junit4.jar ]; then mkdir lib/; wget -O lib/junit4.jar http://search.maven.org/remotecontent?filepath=junit/junit/4.10/junit-4.10.jar; fi
|
@if [ ! -f lib/junit4.jar ]; then mkdir lib/; wget -O lib/junit4.jar http://search.maven.org/remotecontent?filepath=junit/junit/4.10/junit-4.10.jar; fi
|
||||||
@javac -cp ./lib/junit4.jar -sourcepath ./src/java/src:./src/java/tests src/java/tests/com/facebook/csslayout/*.java
|
@if [ ! -f lib/jsr305.jar ]; then mkdir lib/; wget -O lib/jsr305.jar http://search.maven.org/remotecontent?filepath=net/sourceforge/findbugs/jsr305/1.3.7/jsr305-1.3.7.jar; fi
|
||||||
|
@javac -cp ./lib/junit4.jar:./lib/jsr305.jar -sourcepath ./src/java/src:./src/java/tests src/java/tests/com/facebook/csslayout/*.java
|
||||||
|
|
||||||
java_test: java
|
java_test: java
|
||||||
@java -cp ./src/java/src:./src/java/tests:./lib/junit4.jar org.junit.runner.JUnitCore \
|
@java -cp ./src/java/src:./src/java/tests:./lib/junit4.jar org.junit.runner.JUnitCore \
|
||||||
|
@@ -6,8 +6,11 @@
|
|||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.csslayout;
|
package com.facebook.csslayout;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -242,7 +245,7 @@ public class CSSNode {
|
|||||||
return FloatUtil.floatsEqual(f1, f2);
|
return FloatUtil.floatsEqual(f1, f2);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected <T> boolean valuesEqual(T o1, T o2) {
|
protected <T> boolean valuesEqual(@Nullable T o1, @Nullable T o2) {
|
||||||
if (o1 == null) {
|
if (o1 == null) {
|
||||||
return o2 == null;
|
return o2 == null;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user