summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2018-05-21 15:09:45 +0100
committerTobias Thierer <tobiast@google.com>2018-05-21 15:11:54 +0100
commitfe56e48dd8b475acbc34d6e2c674d9a4e7ea8d65 (patch)
tree5e8ccb4dc4668a8554760e617fb7ee93944b365f /tools
parentb6ad455a1a597b6da0f701b001d35fcdf89c1eaa (diff)
Upstream tooling: Fix java{,x}.sql missing from 'expected' snapshot.
The java{,x}.sql classes were missing from the snapshot of files in the 'expected' upstream revision because CopyUpstreamFiles was checking for upstream.equals(expectedUpstream) before copying a file to the "expected/" subfolder, but Repository.equals() was based on object identity and the StandardRepositories constructor created two instances of the OpenJDK 7u40 repository, which were then not considered equal. This bug was probably introduced by http://r.android.com/640021 (commit 2af621453187a8ce05724575a2749aca890a3976). Test: After this CL, the directory ~/ojluni-upstreams/java/sql gets created by the following command: make libcore-copy-upstream-files && java -jar \ out/host/linux-x86/framework/libcore-copy-upstream-files.jar \ ~/ojluni-upstreams Bug: 35910877 Change-Id: Icacedb46e6b922206aa5603ae668eb8bddf9ade2
Diffstat (limited to 'tools')
-rw-r--r--tools/upstream/src/main/java/libcore/Repository.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/upstream/src/main/java/libcore/Repository.java b/tools/upstream/src/main/java/libcore/Repository.java
index 8b0e2f7bf6..0591fe1859 100644
--- a/tools/upstream/src/main/java/libcore/Repository.java
+++ b/tools/upstream/src/main/java/libcore/Repository.java
@@ -84,6 +84,16 @@ abstract class Repository {
return rootPath;
}
+ @Override
+ public int hashCode() {
+ return rootPath.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return (obj instanceof Repository) && rootPath.equals(((Repository) obj).rootPath);
+ }
+
/**
* @return A human readable name to identify this repository, suitable for use as a
* directory name.