JDK-8210550 : Applying String::align and String::indent at Compile Time
  • Type: New Feature
  • Component: tools
  • Sub-Component: javac
  • Priority: P3
  • Status: Closed
  • Resolution: Future Project
  • OS: generic
  • CPU: generic
  • Submitted: 2018-09-10
  • Updated: 2018-09-11
  • Resolved: 2018-09-11
Related Reports
Relates :  
Relates :  
Description
Raw String Literals introduce a performance penalty for those developers indenting string bodies to align with surrounding code. This incidental indentation increases the space needed for the string in the class file and incurs a cost to remove the indentation at runtime, usually via String::align.  To compensate, this feature reflectively applies select String methods at compile time, so that 1) minimum space is used to represent the string in the class file and 2) zero runtime cost occurs.