Repository: polygene-java Updated Branches: refs/heads/develop cf3e88535 -> cd9731667
Formatting Signed-off-by: niclas <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/cd973166 Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/cd973166 Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/cd973166 Branch: refs/heads/develop Commit: cd97316675b1d239bd52fbf89ff4c75fa5621d69 Parents: 7956f2d Author: niclas <[email protected]> Authored: Sat May 13 19:04:23 2017 +0800 Committer: niclas <[email protected]> Committed: Sun May 14 12:07:56 2017 +0800 ---------------------------------------------------------------------- .../runtime/composite/ConstructorModel.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/polygene-java/blob/cd973166/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstructorModel.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstructorModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstructorModel.java index f3f60fb..427cff0 100644 --- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstructorModel.java +++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstructorModel.java @@ -46,7 +46,7 @@ public final class ConstructorModel public ConstructorModel( Constructor<?> constructor, InjectedParametersModel parameters ) { - this.constructor = AccessibleObjects.accessible( constructor); + this.constructor = AccessibleObjects.accessible( constructor ); this.parameters = parameters; } @@ -92,18 +92,21 @@ public final class ConstructorModel { throw (InvalidCompositeException) targetException; } - String message = "Could not instantiate \n " + constructor.getDeclaringClass() + "\nusing constructor:\n " + constructor - .toGenericString(); - throw new ConstructionException( message, targetException ); + throw new ConstructionException( createExceptionMessage( parametersInstance ), targetException ); } catch( Throwable e ) { - System.err.println( constructor.toGenericString() ); - System.err.println( Arrays.asList( parametersInstance ) ); - throw new ConstructionException( "Could not instantiate " + constructor.getDeclaringClass(), e ); + throw new ConstructionException( createExceptionMessage( parametersInstance ), e ); } } + private String createExceptionMessage( Object[] parametersInstance ) + { + return "Could not instantiate \n " + constructor.getDeclaringClass() + + "\nusing constructor:\n " + constructor.toGenericString() + + "\nparameter types:\n " + Arrays.toString( parametersInstance ); + } + @Override public String toString() {
