Skip to content

Commit

Permalink
Fix Operator Wrap
Browse files Browse the repository at this point in the history
Allow longer links in JavaDoc, cConf / hConf as names and remove duplicate LineLength section
  • Loading branch information
tivv committed Mar 3, 2023
1 parent e81bb23 commit fbdbe51
Show file tree
Hide file tree
Showing 821 changed files with 5,267 additions and 5,102 deletions.
40 changes: 20 additions & 20 deletions cdap-api-common/src/main/java/io/cdap/cdap/api/common/Bytes.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ public static String toStringBinary(final byte[] b, int off, int len) {

private static boolean isHexDigit(char c) {
return
(c >= 'A' && c <= 'F') ||
(c >= '0' && c <= '9');
(c >= 'A' && c <= 'F')
|| (c >= '0' && c <= '9');
}

/**
Expand Down Expand Up @@ -362,8 +362,8 @@ public static byte[] toBytesBinary(String in) {
char hd2 = in.charAt(i + 3);

// they need to be A-F0-9:
if (!isHexDigit(hd1) ||
!isHexDigit(hd2)) {
if (!isHexDigit(hd1)
|| !isHexDigit(hd2)) {
// bogus escape code, ignore:
continue;
}
Expand Down Expand Up @@ -828,8 +828,8 @@ public static BigDecimal toBigDecimal(byte[] bytes) {
* @return the char value
*/
public static BigDecimal toBigDecimal(byte[] bytes, int offset, final int length) {
if (bytes == null || length < SIZEOF_INT + 1 ||
(offset + length > bytes.length)) {
if (bytes == null || length < SIZEOF_INT + 1
|| (offset + length > bytes.length)) {
return null;
}

Expand Down Expand Up @@ -1073,9 +1073,9 @@ enum PureJavaComparer implements Comparer<byte[]> {
public int compareTo(byte[] buffer1, int offset1, int length1,
byte[] buffer2, int offset2, int length2) {
// Short circuit equal case
if (buffer1 == buffer2 &&
offset1 == offset2 &&
length1 == length2) {
if (buffer1 == buffer2
&& offset1 == offset2
&& length1 == length2) {
return 0;
}
// Bring WritableComparator code local
Expand Down Expand Up @@ -1140,9 +1140,9 @@ public static boolean equals(@Nullable byte[] left, @Nullable byte[] right) {
public static boolean equals(final byte[] left, int leftOffset, int leftLen,
final byte[] right, int rightOffset, int rightLen) {
// short circuit case
if (left == right &&
leftOffset == rightOffset &&
leftLen == rightLen) {
if (left == right
&& leftOffset == rightOffset
&& leftLen == rightLen) {
return true;
}
// different lengths fast check
Expand All @@ -1169,10 +1169,10 @@ public static boolean equals(final byte[] left, int leftOffset, int leftLen,
* Return true if the byte array on the right is a prefix of the byte array on the left.
*/
public static boolean startsWith(byte[] bytes, byte[] prefix) {
return bytes != null && prefix != null &&
bytes.length >= prefix.length &&
LexicographicalComparerHolder.BEST_COMPARER.
compareTo(bytes, 0, prefix.length, prefix, 0, prefix.length) == 0;
return bytes != null && prefix != null
&& bytes.length >= prefix.length
&& LexicographicalComparerHolder.BEST_COMPARER.
compareTo(bytes, 0, prefix.length, prefix, 0, prefix.length) == 0;
}

/**
Expand Down Expand Up @@ -1557,8 +1557,8 @@ public static byte[] incrementBytes(byte[] value, long amount) {
val.length);
val = newvalue;
} else if (val.length > SIZEOF_LONG) {
throw new IllegalArgumentException("Increment Bytes - value too big: " +
val.length);
throw new IllegalArgumentException("Increment Bytes - value too big: "
+ val.length);
}
if (amount == 0) {
return val;
Expand Down Expand Up @@ -1630,8 +1630,8 @@ public static void writeStringFixedSize(final DataOutput out, String s,
int size) throws IOException {
byte[] b = toBytes(s);
if (b.length > size) {
throw new IOException("Trying to write " + b.length + " bytes (" +
toStringBinary(b) + ") into a field of length " + size);
throw new IOException("Trying to write " + b.length + " bytes ("
+ toStringBinary(b) + ") into a field of length " + size);
}

out.writeBytes(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public boolean equals(Object o) {

FormatSpecification that = (FormatSpecification) o;

return Objects.equals(name, that.name) &&
Objects.equals(schema, that.schema) &&
Objects.equals(settings, that.settings);
return Objects.equals(name, that.name)
&& Objects.equals(schema, that.schema)
&& Objects.equals(settings, that.settings);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ private void skipWhitespace() {
private String nextToken() {
char currChar = schema.charAt(pos);
int endPos = pos;
while (!(Character.isWhitespace(currChar) ||
currChar == ':' || currChar == ',' || currChar == '<' || currChar == '>')) {
while (!(Character.isWhitespace(currChar)
|| currChar == ':' || currChar == ',' || currChar == '<' || currChar == '>')) {
endPos++;
if (endPos == end) {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public boolean equals(Object o) {
return false;
}
Pair pair = (Pair) o;
return Objects.equals(field, pair.field) &&
Objects.equals(schema, pair.schema);
return Objects.equals(field, pair.field)
&& Objects.equals(schema, pair.schema);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ protected ExtendedSparkConfigurer getConfigurer() {
if (!(configurer instanceof ExtendedSparkConfigurer)) {
// This shouldn't happen, unless there is bug in app-fabric
throw new IllegalStateException(
"Expected the configurer is an instance of " + ExtendedSparkConfigurer.class.getName() +
", but get " + configurer.getClass().getName() + " instead.");
"Expected the configurer is an instance of " + ExtendedSparkConfigurer.class.getName()
+ ", but get " + configurer.getClass().getName() + " instead.");
}
return (ExtendedSparkConfigurer) configurer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ private static Object toRowValue(@Nullable Object value, DataType dataType, Stri
collection = Arrays.asList((Object[]) value);
} else {
throw new IllegalArgumentException(
"Value type " + value.getClass() +
" is not supported as array type value. It must either be a Collection or an array");
"Value type " + value.getClass()
+ " is not supported as array type value. It must either be a Collection or an array");
}

List<Object> result = new ArrayList<>(collection.size());
Expand Down
16 changes: 8 additions & 8 deletions cdap-api/src/main/java/io/cdap/cdap/api/NamespaceSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public boolean equals(Object o) {
return false;
}
NamespaceSummary that = (NamespaceSummary) o;
return generation == that.generation &&
Objects.equals(name, that.name) &&
Objects.equals(description, that.description);
return generation == that.generation
&& Objects.equals(name, that.name)
&& Objects.equals(description, that.description);
}

@Override
Expand All @@ -79,10 +79,10 @@ public int hashCode() {

@Override
public String toString() {
return "NamespaceSummary{" +
"name='" + name + '\'' +
", description='" + description + '\'' +
", generation=" + generation +
'}';
return "NamespaceSummary{"
+ "name='" + name + '\''
+ ", description='" + description + '\''
+ ", generation=" + generation
+ '}';
}
}
8 changes: 4 additions & 4 deletions cdap-api/src/main/java/io/cdap/cdap/api/Resources.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public int hashCode() {

@Override
public String toString() {
return "Resources{" +
"virtualCores=" + virtualCores +
", memoryMB=" + memoryMB +
'}';
return "Resources{"
+ "virtualCores=" + virtualCores
+ ", memoryMB=" + memoryMB
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public boolean equals(Object o) {

ApplicationClass that = (ApplicationClass) o;

return Objects.equals(description, that.description) &&
Objects.equals(className, that.className) &&
Objects.equals(configSchema, that.configSchema) &&
Objects.equals(requirements, that.requirements);
return Objects.equals(description, that.description)
&& Objects.equals(className, that.className)
&& Objects.equals(configSchema, that.configSchema)
&& Objects.equals(requirements, that.requirements);
}

@Override
Expand All @@ -104,11 +104,11 @@ public int hashCode() {

@Override
public String toString() {
return "ApplicationClass{" +
"className='" + className + '\'' +
", description='" + description + '\'' +
", configSchema=" + configSchema +
", requirements=" + requirements +
'}';
return "ApplicationClass{"
+ "className='" + className + '\''
+ ", description='" + description + '\''
+ ", configSchema=" + configSchema
+ ", requirements=" + requirements
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public boolean equals(Object o) {
}

ArtifactClasses that = (ArtifactClasses) o;
return Objects.equals(apps, that.apps) &&
Objects.equals(plugins, that.plugins);
return Objects.equals(apps, that.apps)
&& Objects.equals(plugins, that.plugins);
}

@Override
Expand All @@ -76,10 +76,10 @@ public int hashCode() {

@Override
public String toString() {
return "ArtifactClasses{" +
"apps=" + apps +
", plugins=" + plugins +
'}';
return "ArtifactClasses{"
+ "apps=" + apps
+ ", plugins=" + plugins
+ '}';
}

public static Builder builder() {
Expand Down
16 changes: 8 additions & 8 deletions cdap-api/src/main/java/io/cdap/cdap/api/artifact/ArtifactId.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public ArtifactScope getScope() {

@Override
public String toString() {
return "ArtifactId{" +
"name='" + name + '\'' +
", version=" + version +
", scope='" + scope + '\'' +
'}';
return "ArtifactId{"
+ "name='" + name + '\''
+ ", version=" + version
+ ", scope='" + scope + '\''
+ '}';
}

@Override
Expand All @@ -81,9 +81,9 @@ public boolean equals(Object o) {
}

ArtifactId that = (ArtifactId) o;
return Objects.equals(name, that.name) &&
Objects.equals(version, that.version) &&
Objects.equals(scope, that.scope);
return Objects.equals(name, that.name)
&& Objects.equals(version, that.version)
&& Objects.equals(scope, that.scope);
}

@Override
Expand Down
20 changes: 10 additions & 10 deletions cdap-api/src/main/java/io/cdap/cdap/api/artifact/ArtifactInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public boolean equals(Object o) {

ArtifactInfo that = (ArtifactInfo) o;

return super.equals(that) &&
Objects.equals(classes, that.classes) &&
Objects.equals(properties, that.properties);
return super.equals(that)
&& Objects.equals(classes, that.classes)
&& Objects.equals(properties, that.properties);
}

@Override
Expand All @@ -91,12 +91,12 @@ public int hashCode() {

@Override
public String toString() {
return "ArtifactInfo{" +
"name='" + name + '\'' +
", version='" + version + '\'' +
", scope=" + scope +
", classes=" + classes +
", properties=" + properties +
'}';
return "ArtifactInfo{"
+ "name='" + name + '\''
+ ", version='" + version + '\''
+ ", scope=" + scope
+ ", classes=" + classes
+ ", properties=" + properties
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public boolean equals(Object o) {

ArtifactRange that = (ArtifactRange) o;

return Objects.equals(namespace, that.namespace) &&
Objects.equals(name, that.name) &&
Objects.equals(lower, that.lower) &&
Objects.equals(upper, that.upper) &&
isLowerInclusive == that.isLowerInclusive &&
isUpperInclusive == that.isUpperInclusive;
return Objects.equals(namespace, that.namespace)
&& Objects.equals(name, that.name)
&& Objects.equals(lower, that.lower)
&& Objects.equals(upper, that.upper)
&& isLowerInclusive == that.isLowerInclusive
&& isUpperInclusive == that.isUpperInclusive;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ public boolean equals(Object o) {

ArtifactSummary that = (ArtifactSummary) o;

return Objects.equals(name, that.name) &&
Objects.equals(version, that.version) &&
Objects.equals(scope, that.scope);
return Objects.equals(name, that.name)
&& Objects.equals(version, that.version)
&& Objects.equals(scope, that.scope);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public String getVersionString() {
if (isExactVersion()) {
return lower.getVersion();
} else {
return (isLowerInclusive ? '[' : '(') +
lower.getVersion() +
',' +
upper.getVersion() +
(isUpperInclusive ? ']' : ')');
return (isLowerInclusive ? '[' : '(')
+ lower.getVersion()
+ ','
+ upper.getVersion()
+ (isUpperInclusive ? ']' : ')');
}
}

Expand Down Expand Up @@ -141,8 +141,8 @@ public static ArtifactVersionRange parse(String artifactVersionStr)
} else if (comp == 0 && isLowerInclusive && !isUpperInclusive) {
// if lower and upper are equal, but lower is inclusive and upper is exclusive, this is also invalid
throw new InvalidArtifactRangeException(String.format(
"Invalid version range %s. Lower and upper versions %s are equal, " +
"but lower is inclusive and upper is exclusive.",
"Invalid version range %s. Lower and upper versions %s are equal, "
+ "but lower is inclusive and upper is exclusive.",
artifactVersionStr, lowerStr));
}
return new ArtifactVersionRange(lower, isLowerInclusive, upper, isUpperInclusive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public static Map<String, String> extractScope(Scope scope, String name,
* Identifies arguments with a given scope prefix and adds them back without the scope prefix.
*
* 1. An argument can be prefixed by "&lt;scope>.&lt;name>.". e.g. mapreduce.myMapReduce.read.timeout=30.
* In this case the MapReduce program named 'myMapReduce' will receive two arguments -
* mapreduce.myMapReduce.read.timeout=30 and read.timeout=30. However MapReduce programs other
* In this case the MapReduce program named 'myMapReduce' will receive two arguments
- * mapreduce.myMapReduce.read.timeout=30 and read.timeout=30. However MapReduce programs other
* than 'myMapReduce' will receive only one argument - mapreduce.myMapReduce.read.timeout=30 2. An
* argument can be prefixed by "&lt;scope>.*.". e.g. mapreduce.*.read.timeout=30. In this case all
* the underlying MapReduce programs will receive the arguments mapreduce.*.read.timeout=30 and
Expand Down
Loading

0 comments on commit fbdbe51

Please sign in to comment.