diff options
author | corysmith <corysmith@google.com> | 2018-02-15 09:07:29 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-15 09:09:17 -0800 |
commit | e722c79d380c8a70d628deed7d0cbc5fe4609715 (patch) | |
tree | be4a9ef5a1b9c026abfae4a5c2bc48df784f831a /src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java | |
parent | f264c987c02f644d63676c05da210dfb94784da3 (diff) |
Remove unused DataKey attribute.
RELNOTES: None
PiperOrigin-RevId: 185847904
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java b/src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java index 53be389d9f..ac953da711 100644 --- a/src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java +++ b/src/tools/android/java/com/google/devtools/build/android/DataSourceTable.java @@ -14,7 +14,6 @@ package com.google.devtools.build.android; import com.google.common.base.Function; -import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.android.proto.SerializeFormat; @@ -29,6 +28,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.NavigableMap; +import java.util.stream.Collectors; /** * Tracks mappings from resource source paths (/foo/bar/res/values/colors.xml) to an ID for a more @@ -36,13 +36,7 @@ import java.util.NavigableMap; */ class DataSourceTable { - private static final Function<DataValue, DataSource> VALUE_TO_SOURCE = - new Function<DataValue, DataSource>() { - @Override - public DataSource apply(DataValue input) { - return input.source(); - } - }; + private static final Function<DataValue, DataSource> VALUE_TO_SOURCE = DataValue::source; private final Map<DataSource, Integer> sourceTable = new LinkedHashMap<>(); private DataSource[] idToSource; @@ -73,7 +67,10 @@ class DataSourceTable { throws IOException { int sourceNumber = 0; LinkedList<DataSource> sourceQueue = - new LinkedList<>(Collections2.transform(map.values(), VALUE_TO_SOURCE)); + map.values() + .stream() + .map(VALUE_TO_SOURCE) + .collect(Collectors.toCollection(LinkedList::new)); while (!sourceQueue.isEmpty()) { DataSource source = sourceQueue.pop(); if (!sourceTable.containsKey(source)) { |