8187089: StringConcatFactory.makeConcat & makeConcatWithConstants should throw StringConcatException if parameter slot count is over 200

Reviewed-by: rriggs, shade
This commit is contained in:
Mandy Chung 2017-10-26 16:57:35 -07:00
parent 18cbe428c1
commit 34c9d598c7
2 changed files with 108 additions and 6 deletions

View file

@ -398,8 +398,8 @@ public final class StringConcatFactory {
* <p>Then the following linkage invariants must hold:
*
* <ul>
* <li>The parameter count in {@code concatType} is less than or equal to 200</li>
*
* <li>The number of parameter slots in {@code concatType} is
* less than or equal to 200</li>
* <li>The return type in {@code concatType} is assignable from {@link java.lang.String}</li>
* </ul>
*
@ -487,8 +487,8 @@ public final class StringConcatFactory {
* <p>Then the following linkage invariants must hold:
*
* <ul>
* <li>The parameter count in {@code concatType} is less than or equal to
* 200</li>
* <li>The number of parameter slots in {@code concatType} is less than
* or equal to 200</li>
*
* <li>The parameter count in {@code concatType} equals to number of \1 tags
* in {@code recipe}</li>
@ -613,9 +613,9 @@ public final class StringConcatFactory {
concatType.returnType());
}
if (concatType.parameterCount() > MAX_INDY_CONCAT_ARG_SLOTS) {
if (concatType.parameterSlotCount() > MAX_INDY_CONCAT_ARG_SLOTS) {
throw new StringConcatException("Too many concat argument slots: " +
concatType.parameterCount() +
concatType.parameterSlotCount() +
", can only accept " +
MAX_INDY_CONCAT_ARG_SLOTS);
}