aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/MethodLibrary.java8
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/RuleClass.java28
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/Type.java6
3 files changed, 22 insertions, 20 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/MethodLibrary.java b/src/main/java/com/google/devtools/build/lib/packages/MethodLibrary.java
index 5969697337..65b4540965 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/MethodLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/MethodLibrary.java
@@ -465,7 +465,7 @@ public class MethodLibrary {
// TODO(bazel-team): This is dead code, get rid of it.
throw new EvalException(ast.getLocation(), String.format(
"Unsupported datatype (%s) for indexing, only works for dict and list",
- EvalUtils.getDatatypeName(collectionCandidate)));
+ EvalUtils.getDataTypeName(collectionCandidate)));
}
}
};
@@ -552,7 +552,7 @@ public class MethodLibrary {
int l = EvalUtils.size(arg);
if (l == -1) {
throw new EvalException(ast.getLocation(),
- EvalUtils.getDatatypeName(arg) + " is not iterable");
+ EvalUtils.getDataTypeName(arg) + " is not iterable");
}
return l;
}
@@ -792,7 +792,7 @@ public class MethodLibrary {
return args[2];
} else {
throw new EvalException(ast.getLocation(), "Object of type '"
- + EvalUtils.getDatatypeName(obj) + "' has no field '" + name + "'");
+ + EvalUtils.getDataTypeName(obj) + "' has no field '" + name + "'");
}
}
return result;
@@ -833,7 +833,7 @@ public class MethodLibrary {
@Override
public Object call(Object[] args, FuncallExpression ast) throws EvalException {
// There is no 'type' type in Skylark, so we return a string with the type name.
- return EvalUtils.getDatatypeName(args[0]);
+ return EvalUtils.getDataTypeName(args[0]);
}
};
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index f495502d70..f8f442f1ff 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -127,14 +127,14 @@ public final class RuleClass {
@Override
public String getErrorReason(Rule param) {
if (pathSegment == ANY_SEGMENT) {
- return param.getRuleClass() + " rules have to be under a " +
- StringUtil.joinEnglishList(values, "or", "'") + " directory";
+ return param.getRuleClass() + " rules have to be under a "
+ + StringUtil.joinEnglishList(values, "or", "'") + " directory";
} else if (pathSegment == 1) {
return param.getRuleClass() + " rules are only allowed in "
+ StringUtil.joinEnglishList(StringUtil.append(values, "//", ""), "or");
} else {
- return param.getRuleClass() + " rules are only allowed in packages which " +
- StringUtil.ordinal(pathSegment) + " is " + StringUtil.joinEnglishList(values, "or");
+ return param.getRuleClass() + " rules are only allowed in packages which "
+ + StringUtil.ordinal(pathSegment) + " is " + StringUtil.joinEnglishList(values, "or");
}
}
@@ -286,8 +286,8 @@ public final class RuleClass {
Preconditions.checkState(presentAttribute != null,
"Missing mandatory '%s' attribute in normal rule class.", attribute.getName());
Preconditions.checkState(presentAttribute.getType().equals(attribute.getType()),
- "Mandatory attribute '%s' in normal rule class has incorrect type (expcected" +
- " %s).", attribute.getName(), attribute.getType());
+ "Mandatory attribute '%s' in normal rule class has incorrect type (expected"
+ + " %s).", attribute.getName(), attribute.getType());
}
}
},
@@ -384,8 +384,8 @@ public final class RuleClass {
@Override
public boolean equals(Object o) {
- return (o instanceof RuleClassNamePredicate) &&
- ruleClasses.equals(((RuleClassNamePredicate) o).ruleClasses);
+ return (o instanceof RuleClassNamePredicate)
+ && ruleClasses.equals(((RuleClassNamePredicate) o).ruleClasses);
}
@Override
@@ -1024,8 +1024,8 @@ public final class RuleClass {
* which does not have the configured targets available.
*
* <p>This should in theory only contain subclasses of
- * {@link com.google.devtools.build.lib.analysis.TransitiveInfoProvider}, but our current dependency
- * structure does not allow a reference to that class here.
+ * {@link com.google.devtools.build.lib.analysis.TransitiveInfoProvider}, but
+ * our current dependency structure does not allow a reference to that class here.
*/
public ImmutableSet<Class<?>> getAdvertisedProviders() {
return advertisedProviders;
@@ -1401,8 +1401,8 @@ public final class RuleClass {
Integer attrIndex = getAttributeIndex(attrName);
if (attrIndex == null) {
- rule.reportError(rule.getLabel() + ": no such attribute '" + attrName +
- "' in '" + name + "' rule", eventHandler);
+ rule.reportError(rule.getLabel() + ": no such attribute '" + attrName
+ + "' in '" + name + "' rule", eventHandler);
return null;
}
@@ -1431,8 +1431,8 @@ public final class RuleClass {
if (attrName.equals("visibility")) {
List<Label> attrList = (List<Label>) converted;
- if (!attrList.isEmpty() &&
- ConstantRuleVisibility.LEGACY_PUBLIC_LABEL.equals(attrList.get(0))) {
+ if (!attrList.isEmpty()
+ && ConstantRuleVisibility.LEGACY_PUBLIC_LABEL.equals(attrList.get(0))) {
rule.reportError(rule.getLabel() + ": //visibility:legacy_public only allowed in package "
+ "declaration", eventHandler);
}
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Type.java b/src/main/java/com/google/devtools/build/lib/packages/Type.java
index 9172a1f5dc..48ba948090 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Type.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Type.java
@@ -319,7 +319,7 @@ public abstract class Type<T> {
}
builder.append(", but got '");
EvalUtils.printValue(value, builder);
- builder.append("' (").append(EvalUtils.getDatatypeName(value)).append(")");
+ builder.append("' (").append(EvalUtils.getDataTypeName(value)).append(")");
return builder.toString();
}
@@ -609,7 +609,7 @@ public abstract class Type<T> {
STRING.convert(x, what, currentRule));
} catch (Label.SyntaxException e) {
throw new ConversionException("invalid label '" + x + "' in "
- + what + ": "+ e.getMessage());
+ + what + ": " + e.getMessage());
}
}
}
@@ -813,6 +813,7 @@ public abstract class Type<T> {
}
}
+ /** A type for lists of a given element type */
public static class ListType<ELEM> extends Type<List<ELEM>> {
private final Type<ELEM> elemType;
@@ -905,6 +906,7 @@ public abstract class Type<T> {
}
}
+ /** Type for lists of arbitrary objects */
public static class ObjectListType extends ListType<Object> {
private static final Type<Object> elemType = new ObjectType();