Change kMultiDexSeparator from ':' to '!'
The ':' separator is commonly used to separate class path elements. That
means that we cannot easily encode multidex location in a classpath
without complicating the parsing logic unnecessarily (e.g. when encoding
classpaths in the oat file).
For easy parsing and understanding kMultiDexSeparator and
kClassPathSeparator should have different values. ':' is a wide spread
classpath separator so this CL changes the value of kMultiDexSeparator to
'!' which is also commonly used to denote an object inside a given
container.
Test: m test-art-host
Bug: 38138251
Change-Id: I30995c553d9131478c6c071b27327df6d2de06a7
diff --git a/runtime/class_loader_context_test.cc b/runtime/class_loader_context_test.cc
index 1b46f67..a87552d 100644
--- a/runtime/class_loader_context_test.cc
+++ b/runtime/class_loader_context_test.cc
@@ -488,4 +488,12 @@
ASSERT_TRUE(context->VerifyClassLoaderContextMatch(context->EncodeContextForOatFile("")));
}
+TEST_F(ClassLoaderContextTest, VerifyClassLoaderContextMatchAfterEncodingMultidex) {
+ jobject class_loader = LoadDexInPathClassLoader("MultiDex", nullptr);
+
+ std::unique_ptr<ClassLoaderContext> context = CreateContextForClassLoader(class_loader);
+
+ ASSERT_TRUE(context->VerifyClassLoaderContextMatch(context->EncodeContextForOatFile("")));
+}
+
} // namespace art