-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Open
Labels
Description
Before Creating the Enhancement Request
- I have confirmed that this should be classified as an enhancement rather than a bug/feature.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Summary
Enhancement Description
This issue proposes two small improvements to increase code readability, maintainability, and compliance with Java best practices.
Code Changes
// 1. Use Arrays.fill to clear byte array
// Before:
for (int i = 0; i < bytes.length; i++) {
bytes[i] = (byte) 0x00;
}
// After:
Arrays.fill(bytes, (byte) 0x00);
// ------------------------------------------------------
// 2. Explicitly specify charset when constructing String
// Before:
String s = new String(bos.toByteArray());
// After:
String s = new String(bos.toByteArray(), StandardCharsets.UTF_8);
### Motivation
These changes improve code readability and robustness with no functional impact. They follow standard Java best practices
### Describe the Solution You'd Like
Just like what was mentioned above
### Describe Alternatives You've Considered
Just like what was mentioned above
### Additional Context
_No response_
Activity