| Index: compiler/java/com/google/dart/compiler/ast/LibraryExport.java
|
| diff --git a/compiler/java/com/google/dart/compiler/ast/LibraryImport.java b/compiler/java/com/google/dart/compiler/ast/LibraryExport.java
|
| similarity index 72%
|
| copy from compiler/java/com/google/dart/compiler/ast/LibraryImport.java
|
| copy to compiler/java/com/google/dart/compiler/ast/LibraryExport.java
|
| index e6f32f557768403c2c508d200b7b0ed18bd334b3..ef1d6893b481752bb13cf8323ebc04f295ec8aac 100644
|
| --- a/compiler/java/com/google/dart/compiler/ast/LibraryImport.java
|
| +++ b/compiler/java/com/google/dart/compiler/ast/LibraryExport.java
|
| @@ -11,36 +11,30 @@ import java.util.List;
|
| import java.util.Set;
|
|
|
| /**
|
| - * Information about import - prefix and {@link LibraryUnit}.
|
| + * Information about export - {@link LibraryUnit} and show/hide names.
|
| */
|
| -public class LibraryImport {
|
| +public class LibraryExport {
|
| private final LibraryUnit library;
|
| - private final String prefix;
|
| private final Set<String> showNames;
|
| private final Set<String> hideNames;
|
| - private final boolean exported;
|
|
|
| - public LibraryImport(LibraryUnit library, String prefix, List<ImportCombinator> combinators,
|
| - boolean exported) {
|
| + public LibraryExport(LibraryUnit library, List<ImportCombinator> combinators) {
|
| this.library = library;
|
| - this.prefix = prefix;
|
| this.showNames = createCombinatorsSet(combinators, true);
|
| this.hideNames = createCombinatorsSet(combinators, false);
|
| - this.exported = exported;
|
| }
|
|
|
| @Override
|
| public int hashCode() {
|
| - return Objects.hashCode(prefix, library);
|
| + return Objects.hashCode(library);
|
| }
|
|
|
| @Override
|
| public boolean equals(Object obj) {
|
| - if (obj instanceof LibraryImport) {
|
| - LibraryImport other = (LibraryImport) obj;
|
| - return Objects.equal(library, other.library) && Objects.equal(prefix, other.prefix)
|
| - && Objects.equal(showNames, other.showNames) && Objects.equal(hideNames, other.hideNames)
|
| - && exported == other.exported;
|
| + if (obj instanceof LibraryExport) {
|
| + LibraryExport other = (LibraryExport) obj;
|
| + return Objects.equal(library, other.library) && Objects.equal(showNames, other.showNames)
|
| + && Objects.equal(hideNames, other.hideNames);
|
| }
|
| return false;
|
| }
|
| @@ -49,10 +43,6 @@ public class LibraryImport {
|
| return library;
|
| }
|
|
|
| - public String getPrefix() {
|
| - return prefix;
|
| - }
|
| -
|
| public boolean isVisible(String name) {
|
| if (hideNames.contains(name)) {
|
| return false;
|
| @@ -63,10 +53,6 @@ public class LibraryImport {
|
| return true;
|
| }
|
|
|
| - public boolean isExported() {
|
| - return exported;
|
| - }
|
| -
|
| private static Set<String> createCombinatorsSet(List<ImportCombinator> combinators, boolean show) {
|
| Set<String> result = Sets.newHashSet();
|
| for (ImportCombinator combinator : combinators) {
|
|
|