mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-09 03:24:58 +00:00
Simpler boolean tests.
This commit is contained in:
parent
d02b2c53a0
commit
86683978bd
@ -2988,7 +2988,7 @@ public void close() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int read() {
|
||||
if (ready() == false) {
|
||||
if (!ready()) {
|
||||
return -1;
|
||||
}
|
||||
return StrBuilder.this.charAt(pos++);
|
||||
|
@ -400,7 +400,7 @@ public String replace(final String source) {
|
||||
return null;
|
||||
}
|
||||
final StrBuilder buf = new StrBuilder(source);
|
||||
if (substitute(buf, 0, source.length()) == false) {
|
||||
if (!substitute(buf, 0, source.length())) {
|
||||
return source;
|
||||
}
|
||||
return buf.toString();
|
||||
@ -423,7 +423,7 @@ public String replace(final String source, final int offset, final int length) {
|
||||
return null;
|
||||
}
|
||||
final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
|
||||
if (substitute(buf, 0, length) == false) {
|
||||
if (!substitute(buf, 0, length)) {
|
||||
return source.substring(offset, offset + length);
|
||||
}
|
||||
return buf.toString();
|
||||
@ -640,7 +640,7 @@ public boolean replaceIn(final StringBuffer source, final int offset, final int
|
||||
return false;
|
||||
}
|
||||
final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
|
||||
if (substitute(buf, 0, length) == false) {
|
||||
if (!substitute(buf, 0, length)) {
|
||||
return false;
|
||||
}
|
||||
source.replace(offset, offset + length, buf.toString());
|
||||
@ -683,7 +683,7 @@ public boolean replaceIn(final StringBuilder source, final int offset, final int
|
||||
return false;
|
||||
}
|
||||
final StrBuilder buf = new StrBuilder(length).append(source, offset, length);
|
||||
if (substitute(buf, 0, length) == false) {
|
||||
if (!substitute(buf, 0, length)) {
|
||||
return false;
|
||||
}
|
||||
source.replace(offset, offset + length, buf.toString());
|
||||
@ -896,7 +896,7 @@ private int substitute(final StrBuilder buf, final int offset, final int length,
|
||||
* @param priorVariables the list of prior variables
|
||||
*/
|
||||
private void checkCyclicSubstitution(final String varName, final List<String> priorVariables) {
|
||||
if (priorVariables.contains(varName) == false) {
|
||||
if (!priorVariables.contains(varName)) {
|
||||
return;
|
||||
}
|
||||
final StrBuilder buf = new StrBuilder(256);
|
||||
|
Loading…
x
Reference in New Issue
Block a user