Skip to content

Commit

Permalink
Fix warnings about instantiating new boxed primitives.
Browse files Browse the repository at this point in the history
These constructors are deprecated for removal in upcoming java versions, and are currently giving the following warning:

```
third_party/java_src/dagger/project/javatests/dagger/functional/basic/BasicTest.java:64: warning: [removal] Byte(byte) in Byte has been deprecated and marked for removal
    assertThat(basicComponent.getBoxedByte()).isEqualTo(new Byte(BOUND_BYTE));
```

We only call these in a single test and AFAICT they aren't necessary or relevant to what this test is trying to assert so I'm removing them.

RELNOTES=N/A
PiperOrigin-RevId: 707299930
  • Loading branch information
bcorso authored and Dagger Team committed Dec 18, 2024
1 parent 61ce1d5 commit 3764111
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions examples/bazel/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.4.0
24 changes: 12 additions & 12 deletions javatests/dagger/functional/basic/BasicTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,23 @@ public class BasicTest {
}

@Theory public void boxedPrimitives(BasicComponent basicComponent) {
assertThat(basicComponent.getBoxedByte()).isEqualTo(new Byte(BOUND_BYTE));
assertThat(basicComponent.getBoxedChar()).isEqualTo(new Character(BOUND_CHAR));
assertThat(basicComponent.getBoxedShort()).isEqualTo(new Short(BOUND_SHORT));
assertThat(basicComponent.getBoxedInt()).isEqualTo(new Integer(BOUND_INT));
assertThat(basicComponent.getBoxedLong()).isEqualTo(new Long(BOUND_LONG));
assertThat(basicComponent.getBoxedBoolean()).isEqualTo(new Boolean(BOUND_BOOLEAN));
assertThat(basicComponent.getBoxedByte()).isEqualTo(BOUND_BYTE);
assertThat(basicComponent.getBoxedChar()).isEqualTo(BOUND_CHAR);
assertThat(basicComponent.getBoxedShort()).isEqualTo(BOUND_SHORT);
assertThat(basicComponent.getBoxedInt()).isEqualTo(BOUND_INT);
assertThat(basicComponent.getBoxedLong()).isEqualTo(BOUND_LONG);
assertThat(basicComponent.getBoxedBoolean()).isEqualTo(BOUND_BOOLEAN);
assertThat(basicComponent.getBoxedFloat()).isEqualTo(BOUND_FLOAT);
assertThat(basicComponent.getBoxedDouble()).isEqualTo(BOUND_DOUBLE);
}

@Theory public void boxedPrimitiveProviders(BasicComponent basicComponent) {
assertThat(basicComponent.getByteProvider().get()).isEqualTo(new Byte(BOUND_BYTE));
assertThat(basicComponent.getCharProvider().get()).isEqualTo(new Character(BOUND_CHAR));
assertThat(basicComponent.getShortProvider().get()).isEqualTo(new Short(BOUND_SHORT));
assertThat(basicComponent.getIntProvider().get()).isEqualTo(new Integer(BOUND_INT));
assertThat(basicComponent.getLongProvider().get()).isEqualTo(new Long(BOUND_LONG));
assertThat(basicComponent.getBooleanProvider().get()).isEqualTo(new Boolean(BOUND_BOOLEAN));
assertThat(basicComponent.getByteProvider().get()).isEqualTo(BOUND_BYTE);
assertThat(basicComponent.getCharProvider().get()).isEqualTo(BOUND_CHAR);
assertThat(basicComponent.getShortProvider().get()).isEqualTo(BOUND_SHORT);
assertThat(basicComponent.getIntProvider().get()).isEqualTo(BOUND_INT);
assertThat(basicComponent.getLongProvider().get()).isEqualTo(BOUND_LONG);
assertThat(basicComponent.getBooleanProvider().get()).isEqualTo(BOUND_BOOLEAN);
assertThat(basicComponent.getFloatProvider().get()).isEqualTo(BOUND_FLOAT);
assertThat(basicComponent.getDoubleProvider().get()).isEqualTo(BOUND_DOUBLE);
}
Expand Down

0 comments on commit 3764111

Please sign in to comment.