ASF Bugzilla – Attachment 32326 Details for
Bug 57394
ClassTools#construct(String, int) ignores second parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
use the int parameter for the constructor
0002-Use-the-constructor-with-an-integer-parameter-instea.patch (text/plain), 1.62 KB, created by
Felix Schumacher
on 2014-12-23 15:15:42 UTC
(
hide
)
Description:
use the int parameter for the constructor
Filename:
MIME Type:
Creator:
Felix Schumacher
Created:
2014-12-23 15:15:42 UTC
Size:
1.62 KB
patch
obsolete
>From 29f9916b027494c6a5d1406d15006fde405a69f1 Mon Sep 17 00:00:00 2001 >From: Felix Schumacher <felix.schumacher@internetallee.de> >Date: Tue, 23 Dec 2014 15:40:37 +0100 >Subject: [PATCH 2/3] Use the constructor with an integer parameter, instead of > ignoring the parameter > >--- > src/jorphan/org/apache/jorphan/reflect/ClassTools.java | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/src/jorphan/org/apache/jorphan/reflect/ClassTools.java b/src/jorphan/org/apache/jorphan/reflect/ClassTools.java >index d77c3e9..49df1ec 100644 >--- a/src/jorphan/org/apache/jorphan/reflect/ClassTools.java >+++ b/src/jorphan/org/apache/jorphan/reflect/ClassTools.java >@@ -64,8 +64,8 @@ public class ClassTools { > Object instance = null; > try { > Class<?> clazz = ClassUtils.getClass(className); >- clazz.getConstructor(new Class [] {Integer.TYPE}); >- instance = ClassUtils.getClass(className).newInstance(); >+ Constructor<?> constructor = clazz.getConstructor(new Class [] {Integer.TYPE}); >+ instance = constructor.newInstance(parameter); > } catch (ClassNotFoundException e) { > throw new JMeterException(e); > } catch (InstantiationException e) { >@@ -76,6 +76,10 @@ public class ClassTools { > throw new JMeterException(e); > } catch (NoSuchMethodException e) { > throw new JMeterException(e); >+ } catch (IllegalArgumentException e) { >+ throw new JMeterException(e); >+ } catch (InvocationTargetException e) { >+ throw new JMeterException(e); > } > return instance; > } >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57394
:
32326
|
32327