Skip to content

Conversation

6mmLIU
Copy link
Contributor

@6mmLIU 6mmLIU commented Aug 25, 2025

Describe what this PR does / why we need it

Introduce blank-text validation in TextDocumentParser.
After reading and decoding the input stream, if the content contains only whitespace characters, an IllegalArgumentException will be thrown.
Additionally, IOException is now caught and rethrown as a RuntimeException to simplify exception handling for callers.


Does this pull request fix one issue?

NONE


Describe how you did it

  • Read the entire input stream and decode it using the specified charset.
  • If the decoded result contains only whitespace, throw an IllegalArgumentException.
  • Catch any IOException and wrap it in a RuntimeException.

Describe how to verify it

  • ✅ Run module tests:
    mvn -pl spring-ai-alibaba-core -am test
  • ✅ Check code style:
    mvn -pl spring-ai-alibaba-core -am checkstyle:check
  • ✅ Apply code formatting:
    mvn -pl spring-ai-alibaba-core -am spotless:apply

Special notes for reviews

Make sure your local environment can access https://repo.spring.io/milestone when running the above Maven commands to resolve dependencies.

6mmLIU added 2 commits August 25, 2025 10:52
fix: handle blank text in TextDocumentParser
@CLAassistant
Copy link

CLAassistant commented Aug 25, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the area/core SAA Core module label Aug 25, 2025
@6mmLIU 6mmLIU changed the title [core] Add blank-text validation in TextDocumentParser feat(core): add blank-text validation in TextDocumentParser Aug 25, 2025
@6mmLIU 6mmLIU changed the title feat(core): add blank-text validation in TextDocumentParser fix(core): add blank-text validation in TextDocumentParser Aug 25, 2025
yuluo-yx
yuluo-yx previously approved these changes Aug 29, 2025
Copy link
Collaborator

@yuluo-yx yuluo-yx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@6mmLIU
Copy link
Contributor Author

6mmLIU commented Aug 30, 2025

@yuluo-yx 请求合并

@yuluo-yx
Copy link
Collaborator

pr 里注释还是中文,换成英文

@6mmLIU 6mmLIU requested a review from yuluo-yx August 30, 2025 11:56
Copy link
Collaborator

@yuluo-yx yuluo-yx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT thx

@yuluo-yx yuluo-yx merged commit 70f2398 into alibaba:main Aug 30, 2025
10 checks passed
anyin-xyz pushed a commit to anyin-xyz/spring-ai-alibaba that referenced this pull request Sep 1, 2025
zhouyou9505 pushed a commit to zhouyou9505/spring-ai-alibaba that referenced this pull request Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core SAA Core module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants