aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/Package.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/Package.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/Package.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java
index 3a01bc3bf8..b05e6ae846 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Package.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java
@@ -103,7 +103,7 @@ public class Package {
/**
* The root of the source tree in which this package was found. It is an invariant that
- * {@code sourceRoot.getRelative(packageId.getPathFragment()).equals(packageDirectory)}.
+ * {@code sourceRoot.getRelative(packageId.getSourceRoot()).equals(packageDirectory)}.
*/
private Path sourceRoot;
@@ -292,9 +292,9 @@ public class Package {
this.filename = builder.getFilename();
this.packageDirectory = filename.getParentDirectory();
- this.sourceRoot = getSourceRoot(filename, packageIdentifier.getPathFragment());
+ this.sourceRoot = getSourceRoot(filename, packageIdentifier.getSourceRoot());
if ((sourceRoot == null
- || !sourceRoot.getRelative(packageIdentifier.getPathFragment()).equals(packageDirectory))
+ || !sourceRoot.getRelative(packageIdentifier.getSourceRoot()).equals(packageDirectory))
&& !filename.getBaseName().equals("WORKSPACE")) {
throw new IllegalArgumentException(
"Invalid BUILD file name for package '" + packageIdentifier + "': " + filename);
@@ -345,7 +345,7 @@ public class Package {
* Returns the source root (a directory) beneath which this package's BUILD file was found.
*
* <p> Assumes invariant:
- * {@code getSourceRoot().getRelative(packageId.getPathFragment()).equals(getPackageDirectory())}
+ * {@code getSourceRoot().getRelative(packageId.getSourceRoot()).equals(getPackageDirectory())}
*/
public Path getSourceRoot() {
return sourceRoot;