Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P5
-
Resolution: Fixed
-
Affects Version/s: 8
-
Fix Version/s: 8u40
-
Component/s: specification
-
Labels:
-
Subcomponent:
Description
JLS 12.5 has always said: "Execution of a string concatenation operator (§15.18.1) that is not part of a constant expression (§15.28) sometimes creates a new String object to represent the result."
However, the "sometimes" appears wrong; 15.18.1 requires that a new String is always created for a + that isn't a constant expression. See http://mail.openjdk.java.net/pipermail/compiler-dev/2014-January/008451.html
However, the "sometimes" appears wrong; 15.18.1 requires that a new String is always created for a + that isn't a constant expression. See http://mail.openjdk.java.net/pipermail/compiler-dev/2014-January/008451.html