Skip to content

docs(website): unify example code blocks to JEP-512 style - #1012

Open
bengbengbalabalabeng wants to merge 2 commits into
apache:mainfrom
bengbengbalabalabeng:docs-example-code-style
Open

docs(website): unify example code blocks to JEP-512 style#1012
bengbengbalabalabeng wants to merge 2 commits into
apache:mainfrom
bengbengbalabalabeng:docs-example-code-style

Conversation

@bengbengbalabalabeng

@bengbengbalabalabeng bengbengbalabalabeng commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Unify the code style of all example code blocks in the documentation to follow a consistent JEP-512 (Compact Source Files and Instance Main Methods) pattern, replacing the previously varied @Test method styles.

What's changed?

  • Before:
// Style 1
public static void main(String[] args) {
    // .....
}

// Style 2
@Test
void readAndWrite() {
    // ......
}
  • After:
void main() {
    // ......
}

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@Test
public void orderByIncludeColumnWrite() {
String fileName = "includeColumnFieldWrite" + System.currentTimeMillis() + ".xlsx";
void main() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will the replacement making confuse with psvm ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the reminder! The purpose of switching to the JEP‑512 style this time is mainly to keep the example code in the documentation structurally consistent, and it is not intended to imply any connection between these examples and PSVM.

In the updated example, void main() is used only to improve readability; it does not represent the actual entry-point method, nor does it alter the semantics of the example. Therefore, it will not be confused with PSVM.

@alaahong

Copy link
Copy Markdown
Member

Generally good, only on concern is the sample only support on JDK 25+, but current major user are from java 8 - 21...any confuse while following guide to code?

@delei

delei commented Aug 16, 2026

Copy link
Copy Markdown
Member

Generally good, only on concern is the sample only support on JDK 25+, but current major user are from java 8 - 21...any confuse while following guide to code?

Let’s keep up with the times. LOL.

@bengbengbalabalabeng

Copy link
Copy Markdown
Contributor Author

Or provide a supplementary note: indicate that the void main() pattern is used only to simplify and unify the example code style, and does not mean that this feature supports only Java 25+ versions.

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