Merge pull request #22 from foghina/master

Add jsr305, couple of @Nullable annotations
This commit is contained in:
Andy Street
2014-12-05 15:45:15 +00:00
2 changed files with 6 additions and 2 deletions

View File

@@ -17,7 +17,8 @@ c_test: c
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
@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 -cp ./src/java/src:./src/java/tests:./lib/junit4.jar org.junit.runner.JUnitCore \

View File

@@ -6,8 +6,11 @@
* 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.
*/
package com.facebook.csslayout;
import javax.annotation.Nullable;
import java.util.ArrayList;
/**
@@ -242,7 +245,7 @@ public class CSSNode {
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) {
return o2 == null;
}