Skip to content

Commit 1e2b8ab

Browse files
committed
ObjectToObjectConverter properly handles constructors on non-public classes
Issue: SPR-14304
1 parent f6024c2 commit 1e2b8ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-core/src/main/java/org/springframework/core/convert/support/ObjectToObjectConverter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,6 +70,7 @@ public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor t
7070
else {
7171
Constructor<?> constructor = getConstructor(targetClass, sourceClass);
7272
if (constructor != null) {
73+
ReflectionUtils.makeAccessible(constructor);
7374
return constructor.newInstance(source);
7475
}
7576
}

0 commit comments

Comments
 (0)