Skip to content

Conversation

@superajun-wsj
Copy link
Collaborator

No description provided.

Copy link

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

This pull request introduces a comprehensive implementation of formatting infrastructure to optimize String.format() performance. The changes add core Java formatting capabilities including a full Formatter class implementation, the Integer class with parsing/formatting methods, and a new String.repeat() method.

Changes:

  • Adds complete Formatter class (~5400 lines) for printf-style formatting
  • Implements Integer class with string conversion and parsing utilities
  • Introduces String.repeat() method for efficient string repetition
  • Adds new exception classes: IllegalFormatArgumentIndexException and NumberFormatException

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
IllegalFormatArgumentIndexException.java New exception for invalid format argument indices
Formatter.java Complete formatter implementation with extensive documentation
String.java Added repeat() method for string repetition
NumberFormatException.java Exception class with factory methods for parsing errors
Integer.java Integer wrapper class with conversion and parsing methods

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


/**
* Constructs an instance of this class with the specified argument index
* @param index The value of a corresponding illegal argument index.
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

Missing period at the end of the parameter description. The Javadoc should read "The value of a corresponding illegal argument index." to maintain consistency with Java documentation standards.

Copilot uses AI. Check for mistakes.
assert (shiftDistance >= 1 && shiftDistance < DoubleConsts.SIGNIFICAND_WIDTH);

long doppel = Double.doubleToLongBits(d);
// Deterime the number of bits to keep.
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

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

Typo in Javadoc comment. "Deterime" should be spelled "Determine".

Suggested change
// Deterime the number of bits to keep.
// Determine the number of bits to keep.

Copilot uses AI. Check for mistakes.
@superajun-wsj superajun-wsj force-pushed the jdk17u-target8-string-format-opt branch from 6a9d02d to 3cdcae4 Compare January 12, 2026 02:54
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.

2 participants