Skip to content

Commit f8bbc56

Browse files
Copilotmercyblitz
andcommitted
Optimize @SInCE annotation search to limit search range near class declaration
Co-authored-by: mercyblitz <533114+mercyblitz@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsphere-projects/microsphere-java/sessions/7650185e-b104-4ff0-9746-890b795ffe8c
1 parent 4a8d073 commit f8bbc56

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/scripts/generate-wiki-docs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,9 @@ def parse_java_file(filepath, module_name):
324324
# Parse the class Javadoc
325325
javadoc_info = parse_javadoc(class_javadoc)
326326

327-
# Check for @Since annotation on the class
328-
since_annotation = SINCE_ANNOTATION_RE.search(content[:class_decl_pos + len(class_decl_match)])
327+
# Check for @Since annotation on the class (limit search to nearby context)
328+
search_start = max(0, class_decl_pos - 2000)
329+
since_annotation = SINCE_ANNOTATION_RE.search(content[search_start:class_decl_pos + len(class_decl_match)])
329330
annotation_since = since_annotation.group(1) if since_annotation else ""
330331

331332
# Extract extends/implements

0 commit comments

Comments
 (0)