@@ -315,33 +315,3 @@ index 71826b906d10..22d8eaf6e232 100644
315315 foreach(_name, _input_names) {
316316 _name =
317317 string_replace(get_path_info(_name, "name"), "\$", "__") + "_jni.h"
318- diff --git a/third_party/jni_zero/parse.py b/third_party/jni_zero/parse.py
319- index 96e82c855699..629655e8aeb0 100644
320- --- a/third_party/jni_zero/parse.py
321- +++ b/third_party/jni_zero/parse.py
322- @@ -389,13 +389,15 @@ _IMPORT_REGEX = re.compile(r'^import\s+([^\s*]+);', flags=re.MULTILINE)
323- _IMPORT_CLASS_NAME_REGEX = re.compile(r'^(.*?)\.([A-Z].*)')
324-
325-
326- - def _parse_imports(contents):
327- + def _parse_imports(contents, package_prefix):
328- # Regex skips static imports as well as wildcard imports.
329- names = _IMPORT_REGEX.findall(contents)
330- for name in names:
331- m = _IMPORT_CLASS_NAME_REGEX.match(name)
332- if m:
333- package, class_name = m.groups()
334- + if package.startswith('org.webrtc'):
335- + package = package_prefix + '.org.webrtc'
336- yield java_types.JavaClass(
337- package.replace('.', '/') + '/' + class_name.replace('.', '$'))
338-
339- @@ -434,7 +436,7 @@ def _do_parse(filename, *, package_prefix, package_prefix_filter,
340- null_marked=null_marked,
341- package_prefix=package_prefix,
342- package_prefix_filter=package_prefix_filter)
343- - for java_class in _parse_imports(contents):
344- + for java_class in _parse_imports(contents, package_prefix):
345- type_resolver.add_import(java_class)
346- for java_class in nested_classes:
347- type_resolver.add_nested_class(java_class)
0 commit comments