mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
JavaScript: Autoformat extractor sources using google-java-format.
No special settings; command: find javascript/extractor/src -name "*.java" | xargs java -jar /path/to/google-java-format-1.7-all-deps.jar --replace
This commit is contained in:
@@ -2,35 +2,30 @@ package com.semmle.js.ast;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The body of a {@linkplain ClassDeclaration} or {@linkplain ClassExpression}.
|
||||
*/
|
||||
/** The body of a {@linkplain ClassDeclaration} or {@linkplain ClassExpression}. */
|
||||
public class ClassBody extends Node {
|
||||
private final List<MemberDefinition<?>> body;
|
||||
private final List<MemberDefinition<?>> body;
|
||||
|
||||
public ClassBody(SourceLocation loc, List<MemberDefinition<?>> body) {
|
||||
super("ClassBody", loc);
|
||||
this.body = body;
|
||||
}
|
||||
public ClassBody(SourceLocation loc, List<MemberDefinition<?>> body) {
|
||||
super("ClassBody", loc);
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public List<MemberDefinition<?>> getBody() {
|
||||
return body;
|
||||
}
|
||||
public List<MemberDefinition<?>> getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void addMember(MemberDefinition<?> md) {
|
||||
body.add(md);
|
||||
}
|
||||
public void addMember(MemberDefinition<?> md) {
|
||||
body.add(md);
|
||||
}
|
||||
|
||||
public MethodDefinition getConstructor() {
|
||||
for (MemberDefinition<?> md : body)
|
||||
if (md.isConstructor())
|
||||
return (MethodDefinition) md;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <C, R> R accept(Visitor<C, R> v, C c) {
|
||||
return v.visit(this, c);
|
||||
}
|
||||
public MethodDefinition getConstructor() {
|
||||
for (MemberDefinition<?> md : body) if (md.isConstructor()) return (MethodDefinition) md;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <C, R> R accept(Visitor<C, R> v, C c) {
|
||||
return v.visit(this, c);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user