Skip to content

Commit

Permalink
Fixing some ErrorProne warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
coheigea committed Jun 1, 2018
1 parent 175692f commit f76df6d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,10 @@ public void testEquals() throws Exception {

@Test
public void testGetFilename() throws Exception {
assertEquals(toResourceIdentifier("gs:https://my_bucket/").getFilename(), null);
assertEquals(toResourceIdentifier("gs:https://my_bucket/abc").getFilename(),
"abc");
assertEquals(toResourceIdentifier("gs:https://my_bucket/abc/").getFilename(),
"abc");
assertEquals(toResourceIdentifier("gs:https://my_bucket/abc/xyz.txt").getFilename(),
"xyz.txt");
assertEquals(null, toResourceIdentifier("gs:https://my_bucket/").getFilename());
assertEquals("abc", toResourceIdentifier("gs:https://my_bucket/abc").getFilename());
assertEquals("abc", toResourceIdentifier("gs:https://my_bucket/abc/").getFilename());
assertEquals("xyz.txt", toResourceIdentifier("gs:https://my_bucket/abc/xyz.txt").getFilename());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static class MockNanoClock implements NanoClock {

@Override
public long nanoTime() {
return timesMs[i++ / 2] * 1000000;
return timesMs[i++ / 2] * 1000000L;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void testRoundFunction() {

// round(short) => short
operands.clear();
operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, new Short("4")));
operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("4")));
Assert.assertEquals(
SqlFunctions.toShort(4),
new BeamSqlRoundExpression(operands).evaluate(row, null, ImmutableMap.of()).getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void singleInputMultipleOutputSucceeds() throws Exception {
new Instant(0).minus(Duration.standardMinutes(2L)), Duration.standardMinutes(4L));
IntervalWindow thirdWindow =
new IntervalWindow(
new Instant(0).minus(Duration.standardMinutes(0L)), Duration.standardMinutes(4L));
new Instant(0), Duration.standardMinutes(4L));

WindowedValue<Integer> firstValue =
WindowedValue.timestampedValueInGlobalWindow(-3, new Instant(-12));
Expand Down

0 comments on commit f76df6d

Please sign in to comment.