Code (Pre-)Review for JEP 280: Indify String Concat
Andrej Golovnin
andrej.golovnin at gmail.com
Fri Nov 27 12:29:40 UTC 2015
Hi Aleksey,
> 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.
Best regards,
Andrej Golovnin
More information about the compiler-dev
mailing list