This is an automated email from the ASF dual-hosted git repository.
jaikiran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ant.git
The following commit(s) were added to refs/heads/master by this push:
new 2b8f19a bz-63680 Prevent StringIndexOutOfBoundsException while trying
to infer the package name of a test class
2b8f19a is described below
commit 2b8f19ae9dbc048ecb4f40b6f24db7acc7cfaab6
Author: Jaikiran Pai <[email protected]>
AuthorDate: Thu Aug 22 18:32:00 2019 +0530
bz-63680 Prevent StringIndexOutOfBoundsException while trying to infer the
package name of a test class
---
.../taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java
b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java
index 0bc330c..3e0e671 100644
---
a/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java
+++
b/src/main/org/apache/tools/ant/taskdefs/optional/junitlauncher/confined/JUnitLauncherTask.java
@@ -477,7 +477,8 @@ public class JUnitLauncherTask extends Task {
if (theClass != null) {
return theClass;
}
- final String packageName = classname.substring(0,
classname.lastIndexOf('.'));
+ final String packageName = classname.contains(".") ?
classname.substring(0, classname.lastIndexOf('.'))
+ : "";
if
(packageName.equals("org.apache.tools.ant.taskdefs.optional.junitlauncher")) {
theClass = findClass(classname);
if (resolve) {