kParameters;
private final Constructor> synthetic;
@@ -185,6 +187,7 @@ static class DefaultingKotlinClassInstantiatorAdapter implements EntityInstantia
}
this.instantiator = instantiator;
+ this.constructor = kotlinConstructor;
this.kParameters = kotlinConstructor.getParameters();
this.synthetic = constructor.getConstructor();
}
@@ -214,10 +217,8 @@ private , T> Object[] extractInvocationArguments
throw new IllegalArgumentException("PreferredConstructor must not be null!");
}
- int[] defaulting = new int[(synthetic.getParameterCount() / Integer.SIZE) + 1];
-
Object[] params = allocateArguments(
- synthetic.getParameterCount() + defaulting.length + /* DefaultConstructorMarker */1);
+ synthetic.getParameterCount() + KotlinDefaultMask.getMaskCount(synthetic.getParameterCount()) + /* DefaultConstructorMarker */1);
int userParameterCount = kParameters.size();
List> parameters = preferredConstructor.getParameters();
@@ -225,28 +226,30 @@ private , T> Object[] extractInvocationArguments
// Prepare user-space arguments
for (int i = 0; i < userParameterCount; i++) {
- int slot = i / Integer.SIZE;
- int offset = slot * Integer.SIZE;
-
Parameter