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.java37
1 files changed, 18 insertions, 19 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 90e3b59516..f1d9b51878 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
@@ -1265,12 +1265,12 @@ public class Package {
}
}
- void addRule(Rule rule) throws NameConflictException {
+ void addRule(Rule rule) throws NameConflictException, InterruptedException {
checkForConflicts(rule);
addRuleUnchecked(rule);
}
- private Builder beforeBuild() {
+ private Builder beforeBuild() throws InterruptedException {
Preconditions.checkNotNull(pkg);
Preconditions.checkNotNull(filename);
Preconditions.checkNotNull(buildFileLabel);
@@ -1323,7 +1323,7 @@ public class Package {
}
/** Intended for use by {@link com.google.devtools.build.lib.skyframe.PackageFunction} only. */
- public Builder buildPartial() {
+ public Builder buildPartial() throws InterruptedException {
if (alreadyBuilt) {
return this;
}
@@ -1371,7 +1371,7 @@ public class Package {
return externalPackageData;
}
- public Package build() {
+ public Package build() throws InterruptedException {
if (alreadyBuilt) {
return pkg;
}
@@ -1399,14 +1399,15 @@ public class Package {
}
/**
- * Precondition check for addRule. We must maintain these invariants of the
- * package:
- * - Each name refers to at most one target.
- * - No rule with errors is inserted into the package.
- * - The generating rule of every output file in the package must itself be
- * in the package.
+ * Precondition check for addRule. We must maintain these invariants of the package:
+ *
+ * <ul>
+ * <li>Each name refers to at most one target.
+ * <li>No rule with errors is inserted into the package.
+ * <li>The generating rule of every output file in the package must itself be in the package.
+ * </ul>
*/
- private void checkForConflicts(Rule rule) throws NameConflictException {
+ private void checkForConflicts(Rule rule) throws NameConflictException, InterruptedException {
String name = rule.getName();
Target existing = targets.get(name);
if (existing != null) {
@@ -1451,17 +1452,15 @@ public class Package {
}
/**
- * A utility method that checks for conflicts between
- * input file names and output file names for a rule from a build
- * file.
- * @param rule the rule whose inputs and outputs are
- * to be checked for conflicts.
- * @param outputFiles a set containing the names of output
- * files to be generated by the rule.
+ * A utility method that checks for conflicts between input file names and output file names for
+ * a rule from a build file.
+ *
+ * @param rule the rule whose inputs and outputs are to be checked for conflicts.
+ * @param outputFiles a set containing the names of output files to be generated by the rule.
* @throws NameConflictException if a conflict is found.
*/
private void checkForInputOutputConflicts(Rule rule, Set<String> outputFiles)
- throws NameConflictException {
+ throws NameConflictException, InterruptedException {
PathFragment packageFragment = rule.getLabel().getPackageFragment();
for (Label inputLabel : rule.getLabels()) {
if (packageFragment.equals(inputLabel.getPackageFragment())