summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Ulya Trafimovich <skvadrik@google.com> 2020-11-03 15:15:46 +0000
committer Ulya Trafimovich <skvadrik@google.com> 2020-11-03 15:15:46 +0000
commit8cbc5d269b20b5743679bfb8684ed174dcf58a30 (patch)
tree2204c9bcd1ef2ec5eedb60653e64a5780b60d761 /java/java_test.go
parent366c7d3a74d13b86122309a4710a30eda026e5f1 (diff)
Rework class loader context implementation.
The old representation consisted of a list of libraries (UsesLibraries), a list of optional libraries (OptionalUsesLibraries) and a mapping from library name to its build/install paths (LibraryPaths). The separation into lists and map was necessary because of special handling of compatibility libraries, which is now unified with normal libraries. The new representation is a mapping from target SDK version to a tree structure ClassLoaderContext. Each node of the tree represents a library and contains library name, build/install paths and a slice of subcontexts for dependencies. The same library may occur in the tree multiple times in case it is a dependency of multiple libraries. The order in which libraries are added matters (the resulting tree shape may be different). Test results have to be updated, as the resulting <uses-library> list is reodered (previously it was a sorted list of map keys, and now it is formed by a depth-first preorder traversal of the class loader tree). Test: lunch aosp_cf_x86_phone-userdebug && m Bug: 132357300 Bug: 168686456 Change-Id: I11be8cd2967f004fd58753d7c5fb99fed179cd63
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 6c0a90856..81c4f22a8 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1593,8 +1593,8 @@ func TestJavaSdkLibrary(t *testing.T) {
// test if baz has exported SDK lib names foo and bar to qux
qux := ctx.ModuleForTests("qux", "android_common")
if quxLib, ok := qux.Module().(*Library); ok {
- sdkLibs := android.SortedStringKeys(quxLib.ExportedSdkLibs())
- if w := []string{"bar", "foo", "fred", "quuz"}; !reflect.DeepEqual(w, sdkLibs) {
+ sdkLibs := quxLib.ExportedSdkLibs().UsesLibs()
+ if w := []string{"foo", "bar", "fred", "quuz"}; !reflect.DeepEqual(w, sdkLibs) {
t.Errorf("qux should export %q but exports %q", w, sdkLibs)
}
}