Change Optional.ofNullable calls to Optional.of
Nullable check is not needed because argument is known to be non null Change-Id: Ie3574ad9bbd1eff8a2088ac8da2804ea2f5e90a1
Showing
2 changed files
with
6 additions
and
6 deletions
| ... | @@ -48,9 +48,9 @@ public class MplsPathIntentInstallerTest extends IntentInstallerTest { | ... | @@ -48,9 +48,9 @@ public class MplsPathIntentInstallerTest extends IntentInstallerTest { |
| 48 | MplsPathIntentInstaller installer; | 48 | MplsPathIntentInstaller installer; |
| 49 | 49 | ||
| 50 | private final Optional<MplsLabel> ingressLabel = | 50 | private final Optional<MplsLabel> ingressLabel = |
| 51 | - Optional.ofNullable(MplsLabel.mplsLabel(10)); | 51 | + Optional.of(MplsLabel.mplsLabel(10)); |
| 52 | private final Optional<MplsLabel> egressLabel = | 52 | private final Optional<MplsLabel> egressLabel = |
| 53 | - Optional.ofNullable(MplsLabel.mplsLabel(20)); | 53 | + Optional.of(MplsLabel.mplsLabel(20)); |
| 54 | 54 | ||
| 55 | private final List<Link> links = Arrays.asList( | 55 | private final List<Link> links = Arrays.asList( |
| 56 | new DefaultLink(PID, d1p1, d2p0, DIRECT), | 56 | new DefaultLink(PID, d1p1, d2p0, DIRECT), | ... | ... |
| ... | @@ -80,8 +80,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { | ... | @@ -80,8 +80,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { |
| 80 | */ | 80 | */ |
| 81 | @Test | 81 | @Test |
| 82 | public void testForwardPathCompilation() { | 82 | public void testForwardPathCompilation() { |
| 83 | - Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10)); | 83 | + Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10)); |
| 84 | - Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20)); | 84 | + Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20)); |
| 85 | 85 | ||
| 86 | MplsIntent intent = makeIntent("d1", ingressLabel, "d8", egressLabel); | 86 | MplsIntent intent = makeIntent("d1", ingressLabel, "d8", egressLabel); |
| 87 | assertThat(intent, is(notNullValue())); | 87 | assertThat(intent, is(notNullValue())); |
| ... | @@ -117,8 +117,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { | ... | @@ -117,8 +117,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { |
| 117 | */ | 117 | */ |
| 118 | @Test | 118 | @Test |
| 119 | public void testReversePathCompilation() { | 119 | public void testReversePathCompilation() { |
| 120 | - Optional<MplsLabel> ingressLabel = Optional.ofNullable(MplsLabel.mplsLabel(10)); | 120 | + Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10)); |
| 121 | - Optional<MplsLabel> egressLabel = Optional.ofNullable(MplsLabel.mplsLabel(20)); | 121 | + Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20)); |
| 122 | 122 | ||
| 123 | MplsIntent intent = makeIntent("d8", ingressLabel, "d1", egressLabel); | 123 | MplsIntent intent = makeIntent("d8", ingressLabel, "d1", egressLabel); |
| 124 | assertThat(intent, is(notNullValue())); | 124 | assertThat(intent, is(notNullValue())); | ... | ... |
-
Please register or login to post a comment