Code (Pre-)Review for JEP 280: Indify String Concat

Aleksey Shipilev aleksey.shipilev at oracle.com
Fri Nov 27 17:35:34 UTC 2015


Hi Andrej,

On 11/27/2015 03:29 PM, Andrej Golovnin wrote:
>>   http://cr.openjdk.java.net/~shade/8085796/webrev.jdk.03/
> 
> src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java
> 
> The inner class Key is final. But the inner classes Recipe and
> RecipeElement are not final. Why?
> 
> The #equals method of the Recipe class has this line:
> 
> 295             return elements.equals(recipe.elements);
> 
> where elements is a list of RecipeElements. But RecipeElement does not
> implement the #equals method. Is it intended or a mistake?
> I think, the RecipeElement class must implement the #equals and
> #hashCode methods. In other case the cache will not work as expected.

Ow! Thanks, these are fixed in the updated webrevs!
 http://cr.openjdk.java.net/~shade/8085796/

Cheers,
-Aleksey



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20151127/2fea9a46/signature.asc>


More information about the compiler-dev mailing list