JDK-4030374 - Java Issue Tracker
Feb 5, 1997 ... ... array before the superclass constructor runs. This is a problem ... An example follows below. public class OuterClass { Vector ...
Feb 5, 1997 ... ... array before the superclass constructor runs. This is a problem ... An example follows below. public class OuterClass { Vector ...
The actual behaviour is that substring() uses an performance optimized package private constructor which does not perform a copy of the char array for substring but reuses the original char array and so the memory will not be released as long a reference to the extracted substring exists.
This includes having a return type that is identical to the derived type of the record component, being `public`, etc. It's essentially the same for constructors: a record component list essentially derives a canonical constructor signature. If you are a constructor that is override-equivalent, then you are a canonical constructor.
File an issue Hitting a snag with your Java application and can't find anything in search? Have a small enhancement suggestion for the JDK? File a new issue!