(self, code_content: str)
| 744 | return ['java'] |
| 745 | |
| 746 | def parse(self, code_content: str) -> List[ImportInfo]: |
| 747 | imports = [] |
| 748 | |
| 749 | # Pattern: import [static] package.Class[.*]; or import [static] package.*; |
| 750 | import_pattern = r'^\s*import\s+(static\s+)?((?:[\w]+\.)*[\w*]+);?' |
| 751 | for match in re.finditer(import_pattern, code_content, re.MULTILINE): |
| 752 | info = self._extract_java_import(match) |
| 753 | if info: |
| 754 | imports.append(info) |
| 755 | |
| 756 | return imports |
| 757 | |
| 758 | def _extract_java_import(self, match) -> Optional[ImportInfo]: |
| 759 | """Extract Java import statement""" |
nothing calls this directly
no test coverage detected