Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for enabling tests from default packages #244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix for enabling tests from default packages
  • Loading branch information
bchenghi committed Oct 13, 2022
commit c539b446eb3cdbe952a020209567886bca6b7129
5 changes: 4 additions & 1 deletion microbat/src/main/microbat/util/MicroBatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ public static String getSourceFolder(String cName, String projectName) {
ICompilationUnit unit = JavaUtil.findICompilationUnitInProject(cName, projectName);
IPath uri = unit.getResource().getFullPath();
String sourceFolderPath = IResourceUtils.getAbsolutePathOsStr(uri);
cName = cName.substring(0, cName.lastIndexOf(".")).replace(".", File.separator);
int lastIndexOfDot = cName.lastIndexOf(".");
if (lastIndexOfDot != -1) {
cName = cName.substring(0, cName.lastIndexOf(".")).replace(".", File.separator);
}
sourceFolderPath = sourceFolderPath.substring(0, sourceFolderPath.indexOf(cName) - 1);
return sourceFolderPath;
}
Expand Down