quicktype icon indicating copy to clipboard operation
quicktype copied to clipboard

Fix: Keep acronyms uppercase in Java enum constants (#2850)

Open mohamedelhabib opened this issue 2 months ago • 0 comments

Enum constants containing known acronyms (like "SPA") were being incorrectly converted when using --acronym-style=camel, e.g. "MULTI_SPA_IN_GROUP_REJECTED" became "MULTI_Spa_IN_GROUP_REJECTED".

For Java enum constants (UPPER_UNDERSCORE style), acronyms should always remain uppercase regardless of the --acronym-style setting.

  • Modified javaNameStyle() to use allUpperWordStyle for acronyms in enum constants
  • Added test case for enum with "SPA" acronym

Description

Related Issue

Motivation and Context

Previous Behaviour / Output

New Behaviour / Output

How Has This Been Tested?

Screenshots (if appropriate):

mohamedelhabib avatar Dec 05 '25 18:12 mohamedelhabib