diff --git a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/JavaProjectInfo.java b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/JavaProjectInfo.java index b66709bb..2b99d015 100644 --- a/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/JavaProjectInfo.java +++ b/bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/JavaProjectInfo.java @@ -303,16 +303,10 @@ public JavaSourceInfo getTestSourceInfo() { * @return the passed in value or a relative path to a file in this package */ private String relativizeLabelToPackageIfPossible(String srcFileOrLabel) { - var myPackagePath = bazelPackage.getLabel().toString(); - - var relativePath = srcFileOrLabel; - var rootSlashIndex = srcFileOrLabel.indexOf(BazelLabel.BAZEL_ROOT_SLASHES); - if (rootSlashIndex > -1) { - relativePath = srcFileOrLabel.substring(rootSlashIndex + BazelLabel.BAZEL_ROOT_SLASHES.length()); - } - if (relativePath.startsWith(myPackagePath + BazelLabel.BAZEL_COLON)) { + var myPackageLabel = bazelPackage.getLabel().toString(); + if (srcFileOrLabel.startsWith(myPackageLabel + BazelLabel.BAZEL_COLON)) { // drop the package name to identify a reference within package - return relativePath.substring(myPackagePath.length() + 1); + return srcFileOrLabel.substring(myPackageLabel.length() + 1); } // return original passed in value