From 841f853ac37a07fb7fa9c5598c84841f9858d9bf Mon Sep 17 00:00:00 2001 From: Przemyslaw Szczepaniak Date: Tue, 6 Feb 2018 19:28:13 +0000 Subject: Null annotations for java.lang.(Character|Byte) Annotated Integer.java can be found at out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/ annotated/java/lang/(Character|Byte).java + Updated generate_annotated_java_files.py to correctly handle nested classes. Test: make docs Bug: 64930165 Change-Id: Icda613b60a406f0bc5e127a12e0916ddd6542d04 --- annotations/generate_annotated_java_files.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'annotations/generate_annotated_java_files.py') diff --git a/annotations/generate_annotated_java_files.py b/annotations/generate_annotated_java_files.py index de8b131da6..2f12eea105 100755 --- a/annotations/generate_annotated_java_files.py +++ b/annotations/generate_annotated_java_files.py @@ -15,7 +15,7 @@ BP_TEMPLATE = '''filegroup { ], }''' -srcs_list = [] +srcs_list = set() current_package = None with open(os.sys.argv[1], 'r') as jaif_file: for line in jaif_file: @@ -23,7 +23,13 @@ with open(os.sys.argv[1], 'r') as jaif_file: current_package = line[len(PACKAGE_STRING): line.find(':')] if line.startswith(CLASS_STRING) and current_package is not None: current_class = line[len(CLASS_STRING): line.find(':')] - srcs_list.append(SRC_PREFIX + current_package.replace('.', '/') + '/' + current_class + '.java') + + # In case of nested classes, discard substring after nested class name separator + nested_class_separator_index = current_class.find('$') + if nested_class_separator_index != -1: + current_class = current_class[:nested_class_separator_index] + + srcs_list.add(SRC_PREFIX + current_package.replace('.', '/') + '/' + current_class + '.java') print '// Do not edit; generated using libcore/annotations/generate_annotated_java_files.py' print BP_TEMPLATE % ('\n'.join([' "' + src_entry + '",' for src_entry in sorted(srcs_list)]),) -- cgit v1.2.3