For those of you following along at home, the relevant part of the JLS we're discussing is right
here.
[Tony]:
"Here is a horse.
<insert-cat-here/>
Actually, it's a cat." Except it was more like:
"Here are examples of horses:
<insert-one-horse/>
<insert-another-horse/>
<insert-two-horses/>
Actually that's two horses."
If we omit the final comment, then it's ambiguous whether <two horses/> was intended as one example of
a horse, or two examples of horses. (Well not that ambiguous since we all know what a horse is, and the difference between one and two - but the definition of a string literal is not quite as obvious to everyone.) Anyway - <insert-two-horses/> was ambiguous.
Until they immediately clarified what they meant.
A contradiction? Sure. You say contradiction, I say clarification. Particularly because...
But it's on the same line? So? Immediacy is relevant. If I say something ambiguous and immediately follow with a statement acknowledging the ambiguity ("Actually...") and resolving it, that's a clarification, not a contradiction. If I don't notice the ambiguity, and then awhile later I say something which contradicts it (or at least, contradicts one interpretation of it) - well then you'd be a lot more justified saying I'd contradicted myself.
Also, you indicated you saw a contradiction in the next paragraph. Sounded to me like you hadn't read the rest of the lines (the comments) in the original paragraph, since by the end of those lines, the contradiction was resolved. By next paragraph, it was clear that "This is a " + "two-line string" is not one string literal, but two. Which is entirely consistent with "String literals-or, more generally, strings that are the values of constant expressions" implying that string literals were a subset of string-valued constant expressions. Also entirely consistent with the exact definitions of "String literal" and "constant expression", given in
JLS 3.10.5 and
JLS 15.28, respectively.