8153858: Clean up needed when obtaining the package name from a fully qualified class name

Consolidated and refactored code parsing fully qualified names. Includes gtest.

Reviewed-by: dholmes, coleenp
This commit is contained in:
Rachel Protacio 2016-06-07 11:39:47 -04:00
parent b0fab9d6b7
commit e956abefe6
9 changed files with 218 additions and 85 deletions

View file

@ -444,7 +444,9 @@ class ClassLoader: AllStatic {
static bool string_ends_with(const char* str, const char* str_to_find);
// obtain package name from a fully qualified class name
static const char* package_from_name(const char* class_name);
// *bad_class_name is set to true if there's a problem with parsing class_name, to
// distinguish from a class_name with no package name, as both cases have a NULL return value
static const char* package_from_name(const char* const class_name, bool* bad_class_name = NULL);
static bool is_jrt(const char* name) { return string_ends_with(name, MODULES_IMAGE_NAME); }