Skip to content

Commit

Permalink
Add support for UNSIGNED_RIGHT_SHIFT. (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazaroclapp committed Apr 8, 2019
1 parent 4d7b4d0 commit d2d84b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions nullaway/src/main/java/com/uber/nullaway/NullAway.java
Expand Up @@ -1889,6 +1889,7 @@ private boolean mayBeNullExpr(VisitorState state, ExpressionTree expr) {
case XOR:
case LEFT_SHIFT:
case RIGHT_SHIFT:
case UNSIGNED_RIGHT_SHIFT:
// clearly not null
exprMayBeNull = false;
break;
Expand Down
Expand Up @@ -809,4 +809,19 @@ static void testTwoParamIter() {
s.hashCode();
}
}

static String boxAndDeref(Integer boxed) {
return boxed.toString();
}

static String testNoCrashOnUnboxedShifts(int n) {
Integer m = n << 2;
String s = "";
s += boxAndDeref(m);
s += boxAndDeref(m <<= 2);
s += boxAndDeref(n >>= 1);
s += boxAndDeref(m >>>= 4);
s += boxAndDeref(n >>> 3);
return s;
}
}

0 comments on commit d2d84b0

Please sign in to comment.