Merge "Disallow unnamed package on the bootclasspath."

am: 56772d7213

Change-Id: Ibad1b6bbf94fdbb85c9eb3c73dcc3f025f560287
This commit is contained in:
Tobias Thierer 2020-01-11 09:02:02 -08:00 committed by android-build-merger
commit 270568dce5

View file

@ -53,10 +53,9 @@ def CheckJar(whitelist_path, jar):
if f.endswith('.class'): if f.endswith('.class'):
package_name = os.path.dirname(f) package_name = os.path.dirname(f)
package_name = package_name.replace('/', '.') package_name = package_name.replace('/', '.')
# Skip class without a package name if not package_name or not whitelist_re.match(package_name):
if package_name and not whitelist_re.match(package_name): print >> sys.stderr, ('Error: %s contains class file %s, whose package name %s is empty or'
print >> sys.stderr, ('Error: %s contains class file %s, whose package name %s is not ' ' not in the whitelist %s of packages allowed on the bootclasspath.'
'in the whitelist %s of packages allowed on the bootclasspath.'
% (jar, f, package_name, whitelist_path)) % (jar, f, package_name, whitelist_path))
return False return False
return True return True