You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2023/05/23 22:16:14 UTC

[jmeter] branch master updated: fix: remove excessive "class should not be abstract" check from JMeterUtils#loadServicesAndScanJars

This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 29abbcf883 fix: remove excessive "class should not be abstract" check from JMeterUtils#loadServicesAndScanJars
29abbcf883 is described below

commit 29abbcf883da94dd065191ef828faa65028689bf
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Wed May 24 01:16:01 2023 +0300

    fix: remove excessive "class should not be abstract" check from JMeterUtils#loadServicesAndScanJars
    
    findClassesThatExtend already ensures it does not return and abstract class
    or interface, so one more check is not needed.
    
    The extra verification was incorrct, and it always discarded non-abstract classes.
---
 src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java b/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java
index de46f1b684..e5b3139bae 100644
--- a/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java
+++ b/src/core/src/main/java/org/apache/jmeter/util/JMeterUtils.java
@@ -373,9 +373,6 @@ public class JMeterUtils implements UnitTestManager {
             try {
                 Class<? extends S> klass = Class.forName(className, false, classLoader)
                         .asSubclass(service);
-                if (!Modifier.isAbstract(klass.getModifiers())) {
-                    continue;
-                }
                 result.add(klass.getDeclaredConstructor().newInstance());
             } catch (Throwable e) {
                 if (e instanceof InvocationTargetException) {