Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion javascript/extractor/src/com/semmle/jcorn/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ protected void raise(int pos, String msg) {
raise(pos, msg, false);
}

@SuppressWarnings("ReturnValueIgnored")
protected void raise(Position loc, String msg, boolean recoverable) {
msg += " (" + loc.getLine() + ":" + loc.getColumn() + ")";
SyntaxError err = new SyntaxError(msg, loc, this.pos);
Expand Down Expand Up @@ -3114,7 +3115,7 @@ protected BlockStatement parseBlock(boolean allowStrict) {
}
first = false;
}
if (oldStrict == Boolean.FALSE) this.setStrict(false);
if (Boolean.FALSE.equals(oldStrict)) this.setStrict(false);
return this.finishNode(new BlockStatement(new SourceLocation(startLoc), body));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private void reset() {
options.onRecoverableError(this.onRecoverableError);
}

@SuppressWarnings("ReturnValueIgnored")
private void commit() {
// commit buffered tokens
options.onToken(this.onToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public AFunctionExpression(
id,
params,
body,
generator == Boolean.TRUE,
async == Boolean.TRUE,
Boolean.TRUE.equals(generator),
Boolean.TRUE.equals(async),
typeParameters,
parameterTypes,
parameterDecorators,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public ComprehensionBlock(SourceLocation loc, IPattern left, Expression right, B
super("ComprehensionBlock", loc);
this.left = left;
this.right = right;
this.of = of != Boolean.FALSE;
this.of = !Boolean.FALSE.equals(of);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ComprehensionExpression(
this.body = body;
this.blocks = blocks;
this.filter = filter;
this.generator = generator == Boolean.TRUE;
this.generator = Boolean.TRUE.equals(generator);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class ForInStatement extends EnhancedForStatement {
public ForInStatement(
SourceLocation loc, Node left, Expression right, Statement body, Boolean each) {
super("ForInStatement", loc, left, right, body);
this.each = each == Boolean.TRUE;
this.each = Boolean.TRUE.equals(each);
}

public boolean isEach() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public InvokeExpression(
this.callee = callee;
this.typeArguments = typeArguments;
this.arguments = arguments;
this.optional = optional == Boolean.TRUE;
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
this.optional = Boolean.TRUE.equals(optional);
this.onOptionalChain = Boolean.TRUE.equals(onOptionalChain);
}

/** The callee expression of this invocation. */
Expand Down
2 changes: 1 addition & 1 deletion javascript/extractor/src/com/semmle/js/ast/Literal.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean isFalsy() {
if (isRegExp()) return false;
return value == null
|| value instanceof Number && ((Number) value).intValue() == 0
|| value == Boolean.FALSE
|| Boolean.FALSE.equals(value)
|| value instanceof String && ((String) value).isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public MemberExpression(
super("MemberExpression", loc);
this.object = object;
this.property = property;
this.computed = computed == Boolean.TRUE;
this.optional = optional == Boolean.TRUE;
this.onOptionalChain = onOptionalChain == Boolean.TRUE;
this.computed = Boolean.TRUE.equals(computed);
this.optional = Boolean.TRUE.equals(optional);
this.onOptionalChain = Boolean.TRUE.equals(onOptionalChain);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions javascript/extractor/src/com/semmle/js/ast/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public Property(
}
this.rawValue = rawValue;
this.kind = Kind.valueOf(StringUtil.uc(kind));
this.computed = computed == Boolean.TRUE;
this.method = method == Boolean.TRUE;
this.computed = Boolean.TRUE.equals(computed);
this.method = Boolean.TRUE.equals(method);
this.decorators = new ArrayList<Decorator>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public TemplateElement(SourceLocation loc, Object cooked, String raw, Boolean ta
super("TemplateElement", loc);
this.cooked = cooked;
this.raw = raw;
this.tail = tail == Boolean.TRUE;
this.tail = Boolean.TRUE.equals(tail);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public UnaryExpression(SourceLocation loc, String operator, Expression argument,
super("UnaryExpression", loc);
this.operator = operator;
this.argument = argument;
this.prefix = prefix == Boolean.TRUE;
this.prefix = Boolean.TRUE.equals(prefix);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public UpdateExpression(
super("UpdateExpression", loc);
this.operator = operator;
this.argument = argument;
this.prefix = prefix == Boolean.TRUE;
this.prefix = Boolean.TRUE.equals(prefix);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class YieldExpression extends Expression {
public YieldExpression(SourceLocation loc, Expression argument, Boolean delegating) {
super("YieldExpression", loc);
this.argument = argument;
this.delegating = delegating == Boolean.TRUE;
this.delegating = Boolean.TRUE.equals(delegating);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public FunctionType(
JSDocTypeExpression result) {
super(loc, "FunctionType");
this._this = _this;
this._new = _new == Boolean.TRUE;
this._new = Boolean.TRUE.equals(_new);
this.params = params;
this.result = result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public UnaryTypeConstructor(
String operator) {
super(loc, type);
this.expression = expression;
this.prefix = prefix == Boolean.TRUE;
this.prefix = Boolean.TRUE.equals(prefix);
this.operator = operator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CharacterClass extends RegExpTerm {
public CharacterClass(SourceLocation loc, List<RegExpTerm> elements, Boolean inverted) {
super(loc, "CharacterClass");
this.elements = elements;
this.inverted = inverted == Boolean.TRUE;
this.inverted = Boolean.TRUE.equals(inverted);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class Quantifier extends RegExpTerm {
public Quantifier(SourceLocation loc, String type, RegExpTerm operand, Boolean greedy) {
super(loc, type);
this.operand = operand;
this.greedy = greedy == Boolean.TRUE;
this.greedy = Boolean.TRUE.equals(greedy);
}

/** The quantified term. */
Expand Down