Author: fschumacher
Date: Sun Dec 2 11:05:50 2018
New Revision: 1847960
URL: http://svn.apache.org/viewvc?rev=1847960&view=rev
Log:
Replace deprecated newInstance calls
Part of #435 and Bugzilla Id: 62972
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java?rev=1847960&r1=1847959&r2=1847960&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
(original)
+++
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/AccessLogSampler.java
Sun Dec 2 11:05:50 2018
@@ -199,15 +199,14 @@ public class AccessLogSampler extends HT
try {
if (StringUtils.isNotBlank(this.getParserClassName())) {
if (StringUtils.isNotBlank(this.getLogFile())) {
- parser = (LogParser)
Class.forName(getParserClassName()).newInstance();
+ parser = (LogParser)
Class.forName(getParserClassName()).getDeclaredConstructor().newInstance();
parser.setSourceFile(this.getLogFile());
parser.setFilter(filter);
} else {
log.error("No log file specified");
}
}
- } catch (InstantiationException | ClassNotFoundException
- | IllegalAccessException e) {
+ } catch (IllegalArgumentException | ReflectiveOperationException |
SecurityException e) {
log.error("", e);
}
}
@@ -308,7 +307,7 @@ public class AccessLogSampler extends HT
protected void initFilter() {
if (filter == null && StringUtils.isNotBlank(filterClassName)) {
try {
- filter = (Filter) Class.forName(filterClassName).newInstance();
+ filter = (Filter)
Class.forName(filterClassName).getDeclaredConstructor().newInstance();
} catch (Exception e) {
log.warn("Couldn't instantiate filter '" + filterClassName +
"'", e);
}