Am 01.05.2017 um 13:18 schrieb Philippe Mouawad:
Hi Felix,
Can you point me to what was wrong, I am blind this morning :-)
I thought I already did:
if (currentStrPathOrJar != null &&
classpathElement.endsWith(currentStrPathOrJar)) {
instead of
if (currentStrPathOrJar != null &&
currentStrPathOrJar.endsWith(currentStrPathOrJar)) {
look at the second part of the condition. Correct seems to be
"classpathElement.endsWith" and not "currentStrPathOrJar.endsWith". The
second condition would always be true.
Felix
Thanks
On Mon, May 1, 2017 at 1:06 PM, Felix Schumacher <
[email protected]> wrote:
Am 1. Mai 2017 13:03:00 MESZ schrieb Philippe Mouawad <
[email protected]>:
On Mon, May 1, 2017 at 12:56 PM, Felix Schumacher <
[email protected]> wrote:
Am 1. Mai 2017 12:47:03 MESZ schrieb [email protected]:
Author: pmouawad
Date: Mon May 1 10:47:03 2017
New Revision: 1793304
URL: http://svn.apache.org/viewvc?rev=1793304&view=rev
Log:
Fix test failure
Modified:
jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
Modified:
jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/
apache/jorphan/reflect/ClassFinder.java?rev=1793304&
r1=1793303&r2=1793304&view=diff
===========================================================
===================
---
jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
(original)
+++
jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
Mon May 1 10:47:03 2017
@@ -311,14 +311,16 @@ public final class ClassFinder {
String classpathElement = null;
StringTokenizer classpathElements =
new StringTokenizer(javaClassPath,
File.pathSeparator);
+
while (classpathElements.hasMoreTokens()) {
classpathElement =
fixPathEntry(classpathElements.nextToken());
if(classpathElement == null) {
continue;
}
boolean found = false;
- for (String currentStrPathOrJar : strPathsOrJars) {
- if (currentStrPathOrJar != null &&
currentStrPathOrJar.endsWith(currentStrPathOrJar)) {
+ for (int i = 0; i < strPathsOrJars.size(); i++) {
+ String currentStrPathOrJar = strPathsOrJars.get(i);
+ if (currentStrPathOrJar != null &&
classpathElement.endsWith(currentStrPathOrJar)) {
Why did you change the for loop? Would it not have been enough to
change
the condition?
What condition ?
currentStringPathOrJar.endsWith => class pathElement.endsWith
Felix
The issue seems to be in the loop.
I don't understand clearly why tests broke before.
Scratching my head,
Felix
found = true;
log.debug("Adding {}", classpathElement);
listPaths.add(classpathElement);
@@ -470,4 +472,5 @@ public final class ClassFinder {
}
}
}
+
}