DATACMNS-867 - Avoid allocations from Method.getParameterTypes() where possible.
We now prefer an explicit Method.getParameterCount() over accessing the parameter types array and its length to avoid the overhead of cloning the array. Original pull request: #187.
This commit is contained in:
committed by
Oliver Gierke
parent
1ad82cb82d
commit
9b3dd05baa
@@ -116,7 +116,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests {
|
||||
|
||||
Constructor<?>[] declaredConstructors = persistentPropertyAccessor.getClass().getDeclaredConstructors();
|
||||
assertThat(declaredConstructors.length).isEqualTo(1);
|
||||
assertThat(declaredConstructors[0].getParameterTypes().length).isEqualTo(1);
|
||||
assertThat(declaredConstructors[0].getParameterCount()).isEqualTo(1);
|
||||
assertThat(declaredConstructors[0].getParameterTypes()[0]).isEqualTo(expectedConstructorType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user