machov opened a new pull request, #10961:
URL: https://github.com/apache/nifi/pull/10961

   # Summary
   
   [NIFI-15666](https://issues.apache.org/jira/browse/NIFI-15666) Improves the 
Javadoc example for NaiveSearchRingBuffer by replacing incomplete TODO 
placeholder with a complete, working code example.
   
   The NaiveSearchRingBuffer class contained an incomplete Javadoc example with 
a TODO placeholder instead of providing a working code example, making it 
difficult for developers to understand proper usage.
   
   # Changes Made
   
   - **Removed TODO comment** and provided concrete byte sequence assignment
   - **Fixed incorrect class name** in example (CircularBuffer -> 
NaiveSearchRingBuffer)  
   - **Added proper type casting** for addAndCompare() method call
   - **Provided realistic example** using newline delimiter search pattern
   - **Added explanatory comment** to clarify the search purpose
   
   # Impact
   
   This change improves developer experience by providing a complete, 
copy-paste ready example instead of leaving developers to figure out the 
missing implementation details. The newline delimiter example is a common 
real-world use case that demonstrates practical usage of the ring buffer for 
stream processing.
   
   # Example Before/After
   
   **Before:**
   ```java
   final byte[] searchSequence; //TODO assignment
   final CircularBuffer buffer = new CircularBuffer(searchSequence);
   ```
   
   **After:**
   ```java  
   // Search for newline delimiter in a stream
   final byte[] searchSequence = "\n".getBytes();
   final NaiveSearchRingBuffer buffer = new 
NaiveSearchRingBuffer(searchSequence);
   ```
   
   # Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-15666) 
issue created
   - [x] Pull Request title starts with Apache NiFi Jira issue number 
`NIFI-15666`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number 
`NIFI-15666`
   - [x] Pull request based on current revision of the `main` branch
   - [x] Pull request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   - [x] Javadoc example is now complete and compilable
   - [x] Correct class name used (NaiveSearchRingBuffer)
   - [x] Realistic usage example with newline delimiter
   - [x] Proper type casting included
   
   Fixes #15666


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to