Skip to content

[fix](editlog) Remove dead editStream field and guaranteed-NPE getEditLogSize()#62066

Open
dataroaring wants to merge 1 commit intoapache:masterfrom
dataroaring:fix/editlog-dead-field
Open

[fix](editlog) Remove dead editStream field and guaranteed-NPE getEditLogSize()#62066
dataroaring wants to merge 1 commit intoapache:masterfrom
dataroaring:fix/editlog-dead-field

Conversation

@dataroaring
Copy link
Copy Markdown
Contributor

Summary

  • The `editStream` field (`EditLogOutputStream`) is declared but never assigned anywhere — it is always `null`
  • `getEditLogSize()` calls `editStream.length()`, which will always throw `NullPointerException`
  • Remove both the unused field and the dead method

Test plan

  • Verify FE compiles and starts normally
  • Verify no code references `getEditLogSize()` (confirmed by grep)

🤖 Generated with Claude Code

The editStream field (EditLogOutputStream) is declared but never assigned
anywhere in the codebase — it is always null. The getEditLogSize() method
calls editStream.length(), which will always throw NullPointerException.

Remove both the unused field and the guaranteed-to-NPE method.
Copilot AI review requested due to automatic review settings April 2, 2026 14:29
@Thearas
Copy link
Copy Markdown
Contributor

Thearas commented Apr 2, 2026

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes a dead editStream field and its associated getEditLogSize() method in EditLog, eliminating a guaranteed NullPointerException path and reducing unused API surface.

Changes:

  • Deleted the never-assigned editStream field.
  • Removed getEditLogSize() which dereferenced the null editStream.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants