Expose empty annotations as SparseAnnotations to move down cast
Change-Id: I9e8a7d61b770faaec1b7e0ea1cf78bdb367b68ee
Showing
2 changed files
with
2 additions
and
2 deletions
| ... | @@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull; | ... | @@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull; |
| 29 | */ | 29 | */ |
| 30 | public final class DefaultAnnotations implements SparseAnnotations { | 30 | public final class DefaultAnnotations implements SparseAnnotations { |
| 31 | 31 | ||
| 32 | - public static final Annotations EMPTY = DefaultAnnotations.builder().build(); | 32 | + public static final SparseAnnotations EMPTY = DefaultAnnotations.builder().build(); |
| 33 | 33 | ||
| 34 | private final Map<String, String> map; | 34 | private final Map<String, String> map; |
| 35 | 35 | ... | ... |
| ... | @@ -465,7 +465,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { | ... | @@ -465,7 +465,7 @@ class ConfigProvider implements DeviceProvider, LinkProvider, HostProvider { |
| 465 | // Produces set of annotations from the given JSON node. | 465 | // Produces set of annotations from the given JSON node. |
| 466 | private SparseAnnotations annotations(JsonNode node) { | 466 | private SparseAnnotations annotations(JsonNode node) { |
| 467 | if (node == null) { | 467 | if (node == null) { |
| 468 | - return (SparseAnnotations) DefaultAnnotations.EMPTY; | 468 | + return DefaultAnnotations.EMPTY; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | DefaultAnnotations.Builder builder = DefaultAnnotations.builder(); | 471 | DefaultAnnotations.Builder builder = DefaultAnnotations.builder(); | ... | ... |
-
Please register or login to post a comment