bug_id stringlengths 5 19 | func_before stringlengths 49 25.9k ⌀ | func_after stringlengths 45 26k |
|---|---|---|
Closure-170 | private void getNumUseInUseCfgNode(final Node cfgNode) {
numUsesWithinCfgNode = 0;
AbstractCfgNodeTraversalCallback gatherCb =
new AbstractCfgNodeTraversalCallback() {
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isName() && n.getString().... | private void getNumUseInUseCfgNode(final Node cfgNode) {
numUsesWithinCfgNode = 0;
AbstractCfgNodeTraversalCallback gatherCb =
new AbstractCfgNodeTraversalCallback() {
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isName() && n.getString().... |
Lang-18 | protected List<Rule> parsePattern() {
DateFormatSymbols symbols = new DateFormatSymbols(mLocale);
List<Rule> rules = new ArrayList<Rule>();
String[] ERAs = symbols.getEras();
String[] months = symbols.getMonths();
String[] shortMonths = symbols.getShortMonths();
Strin... | protected List<Rule> parsePattern() {
DateFormatSymbols symbols = new DateFormatSymbols(mLocale);
List<Rule> rules = new ArrayList<Rule>();
String[] ERAs = symbols.getEras();
String[] months = symbols.getMonths();
String[] shortMonths = symbols.getShortMonths();
Strin... |
Closure-115 | private CanInlineResult canInlineReferenceDirectly(
Node callNode, Node fnNode) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
Node block = fnNode.getLastChild();
boolean hasSideEffects = false;
if (block.hasChildren()) {
Preconditions.checkSta... | private CanInlineResult canInlineReferenceDirectly(
Node callNode, Node fnNode) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
Node block = fnNode.getLastChild();
Node cArg = callNode.getFirstChild().getNext();
if (!callNode.getFirstChild().isName())... |
Closure-159 | private void findCalledFunctions(
Node node, Set<String> changed) {
Preconditions.checkArgument(changed != null);
if (node.getType() == Token.CALL) {
Node child = node.getFirstChild();
if (child.getType() == Token.NAME) {
changed.add(child.getString());
}
}
for (Node c ... | private void findCalledFunctions(
Node node, Set<String> changed) {
Preconditions.checkArgument(changed != null);
if (node.getType() == Token.NAME) {
if (isCandidateUsage(node)) {
changed.add(node.getString());
}
}
for (Node c = node.getFirstChild(); c != null; c = c.getNext(... |
Chart-7 | private void updateBounds(TimePeriod period, int index) {
long start = period.getStart().getTime();
long end = period.getEnd().getTime();
long middle = start + ((end - start) / 2);
if (this.minStartIndex >= 0) {
long minStart = getDataItem(this.minStartIndex).getPeriod()
... | private void updateBounds(TimePeriod period, int index) {
long start = period.getStart().getTime();
long end = period.getEnd().getTime();
long middle = start + ((end - start) / 2);
if (this.minStartIndex >= 0) {
long minStart = getDataItem(this.minStartIndex).getPeriod()
... |
Jsoup-48 | void processResponseHeaders(Map<String, List<String>> resHeaders) {
for (Map.Entry<String, List<String>> entry : resHeaders.entrySet()) {
String name = entry.getKey();
if (name == null)
continue;
List<String> values = entry.getValu... | void processResponseHeaders(Map<String, List<String>> resHeaders) {
for (Map.Entry<String, List<String>> entry : resHeaders.entrySet()) {
String name = entry.getKey();
if (name == null)
continue;
List<String> values = entry.getValu... |
Closure-109 | private Node parseContextTypeExpression(JsDocToken token) {
return parseTypeName(token);
}
| private Node parseContextTypeExpression(JsDocToken token) {
if (token == JsDocToken.QMARK) {
return newNode(Token.QMARK);
} else {
return parseBasicTypeExpression(token);
}
}
|
Closure-70 | private void declareArguments(Node functionNode) {
Node astParameters = functionNode.getFirstChild().getNext();
Node body = astParameters.getNext();
FunctionType functionType = (FunctionType) functionNode.getJSType();
if (functionType != null) {
Node jsDocParameters = functionType.ge... | private void declareArguments(Node functionNode) {
Node astParameters = functionNode.getFirstChild().getNext();
Node body = astParameters.getNext();
FunctionType functionType = (FunctionType) functionNode.getJSType();
if (functionType != null) {
Node jsDocParameters = functionType.ge... |
Closure-129 | private void annotateCalls(Node n) {
Preconditions.checkState(n.isCall());
Node first = n.getFirstChild();
if (!NodeUtil.isGet(first)) {
n.putBooleanProp(Node.FREE_CALL, true);
}
if (first.isName() &&
"eval".equals(first.getString())) {
first.putBooleanProp(No... | private void annotateCalls(Node n) {
Preconditions.checkState(n.isCall());
Node first = n.getFirstChild();
while (first.isCast()) {
first = first.getFirstChild();
}
if (!NodeUtil.isGet(first)) {
n.putBooleanProp(Node.FREE_CALL, true);
}
if (first.isName() &&... |
Gson-17 | public Date read(JsonReader in) throws IOException {
if (in.peek() != JsonToken.STRING) {
throw new JsonParseException("The date should be a string value");
}
Date date = deserializeToDate(in.nextString());
if (dateType == Date.class) {
return date;
} else if (dateType == Timestamp.cla... | public Date read(JsonReader in) throws IOException {
if (in.peek() == JsonToken.NULL) {
in.nextNull();
return null;
}
Date date = deserializeToDate(in.nextString());
if (dateType == Date.class) {
return date;
} else if (dateType == Timestamp.class) {
return new Timestamp(da... |
Compress-32 | private void applyPaxHeadersToCurrentEntry(Map<String, String> headers) {
for (Entry<String, String> ent : headers.entrySet()){
String key = ent.getKey();
String val = ent.getValue();
if ("path".equals(key)){
currEntry.setName(val);
} else if (... | private void applyPaxHeadersToCurrentEntry(Map<String, String> headers) {
for (Entry<String, String> ent : headers.entrySet()){
String key = ent.getKey();
String val = ent.getValue();
if ("path".equals(key)){
currEntry.setName(val);
} else if (... |
JacksonDatabind-51 | protected final JsonDeserializer<Object> _findDeserializer(DeserializationContext ctxt,
String typeId) throws IOException
{
JsonDeserializer<Object> deser = _deserializers.get(typeId);
if (deser == null) {
JavaType type = _idResolver.typeFromId(ctxt, typeId);
... | protected final JsonDeserializer<Object> _findDeserializer(DeserializationContext ctxt,
String typeId) throws IOException
{
JsonDeserializer<Object> deser = _deserializers.get(typeId);
if (deser == null) {
JavaType type = _idResolver.typeFromId(ctxt, typeId);
... |
Jsoup-5 | private Attribute parseAttribute() {
tq.consumeWhitespace();
String key = tq.consumeAttributeKey();
String value = "";
tq.consumeWhitespace();
if (tq.matchChomp("=")) {
tq.consumeWhitespace();
if (tq.matchChomp(SQ)) {
value = tq.chompTo... | private Attribute parseAttribute() {
tq.consumeWhitespace();
String key = tq.consumeAttributeKey();
String value = "";
tq.consumeWhitespace();
if (tq.matchChomp("=")) {
tq.consumeWhitespace();
if (tq.matchChomp(SQ)) {
value = tq.chompTo... |
Jsoup-47 | static void escape(StringBuilder accum, String string, Document.OutputSettings out,
boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWhite) {
boolean lastWasWhite = false;
boolean reachedNonWhite = false;
final EscapeMode escapeMode = out.escapeMode();
... | static void escape(StringBuilder accum, String string, Document.OutputSettings out,
boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWhite) {
boolean lastWasWhite = false;
boolean reachedNonWhite = false;
final EscapeMode escapeMode = out.escapeMode();
... |
JacksonDatabind-71 | public static StdKeyDeserializer forType(Class<?> raw)
{
int kind;
if (raw == String.class || raw == Object.class) {
return StringKD.forType(raw);
} else if (raw == UUID.class) {
kind = TYPE_UUID;
} else if (raw == Integer.class) {
kind = TYPE_... | public static StdKeyDeserializer forType(Class<?> raw)
{
int kind;
if (raw == String.class || raw == Object.class || raw == CharSequence.class) {
return StringKD.forType(raw);
} else if (raw == UUID.class) {
kind = TYPE_UUID;
} else if (raw == Integer.clas... |
Closure-124 | private boolean isSafeReplacement(Node node, Node replacement) {
if (node.isName()) {
return true;
}
Preconditions.checkArgument(node.isGetProp());
node = node.getFirstChild();
if (node.isName()
&& isNameAssignedTo(node.getString(), replacement)) {
return false;
}
ret... | private boolean isSafeReplacement(Node node, Node replacement) {
if (node.isName()) {
return true;
}
Preconditions.checkArgument(node.isGetProp());
while (node.isGetProp()) {
node = node.getFirstChild();
}
if (node.isName()
&& isNameAssignedTo(node.getString(), replacement)... |
Jsoup-41 | public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Element element = (Element) o;
return this == o;
}
| public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
Element element = (Element) o;
return tag.equals(element.tag);
}
|
Mockito-8 | protected void registerTypeVariablesOn(Type classType) {
if (!(classType instanceof ParameterizedType)) {
return;
}
ParameterizedType parameterizedType = (ParameterizedType) classType;
TypeVariable[] typeParameters = ((Class<?>) parameterizedType.getRawType()).getTypePara... | protected void registerTypeVariablesOn(Type classType) {
if (!(classType instanceof ParameterizedType)) {
return;
}
ParameterizedType parameterizedType = (ParameterizedType) classType;
TypeVariable[] typeParameters = ((Class<?>) parameterizedType.getRawType()).getTypePara... |
JacksonCore-8 | public char[] getTextBuffer()
{
if (_inputStart >= 0) return _inputBuffer;
if (_resultArray != null) return _resultArray;
if (_resultString != null) {
return (_resultArray = _resultString.toCharArray());
}
if (!_hasSegments) return _currentSegment;
r... | public char[] getTextBuffer()
{
if (_inputStart >= 0) return _inputBuffer;
if (_resultArray != null) return _resultArray;
if (_resultString != null) {
return (_resultArray = _resultString.toCharArray());
}
if (!_hasSegments && _currentSegment != null) return... |
Cli-17 | protected void burstToken(String token, boolean stopAtNonOption)
{
for (int i = 1; i < token.length(); i++)
{
String ch = String.valueOf(token.charAt(i));
if (options.hasOption(ch))
{
tokens.add("-" + ch);
currentOption = option... | protected void burstToken(String token, boolean stopAtNonOption)
{
for (int i = 1; i < token.length(); i++)
{
String ch = String.valueOf(token.charAt(i));
if (options.hasOption(ch))
{
tokens.add("-" + ch);
currentOption = option... |
Math-86 | public CholeskyDecompositionImpl(final RealMatrix matrix,
final double relativeSymmetryThreshold,
final double absolutePositivityThreshold)
throws NonSquareMatrixException,
NotSymmetricMatrixException, NotPositiveDefini... | public CholeskyDecompositionImpl(final RealMatrix matrix,
final double relativeSymmetryThreshold,
final double absolutePositivityThreshold)
throws NonSquareMatrixException,
NotSymmetricMatrixException, NotPositiveDefini... |
Closure-83 | public int parseArguments(Parameters params) throws CmdLineException {
String param = params.getParameter(0);
if (param == null) {
setter.addValue(true);
return 0;
} else {
String lowerParam = param.toLowerCase();
if (TRUES.contains(lowerParam)) {
... | public int parseArguments(Parameters params) throws CmdLineException {
String param = null;
try {
param = params.getParameter(0);
} catch (CmdLineException e) {}
if (param == null) {
setter.addValue(true);
return 0;
} else {
String lo... |
Jsoup-61 | public boolean hasClass(String className) {
final String classAttr = attributes.get("class");
final int len = classAttr.length();
final int wantLen = className.length();
if (len == 0 || len < wantLen) {
return false;
}
if (len == wantLen) {
ret... | public boolean hasClass(String className) {
final String classAttr = attributes.getIgnoreCase("class");
final int len = classAttr.length();
final int wantLen = className.length();
if (len == 0 || len < wantLen) {
return false;
}
if (len == wantLen) {
... |
Closure-32 | private ExtractionInfo extractMultilineTextualBlock(JsDocToken token,
WhitespaceOption option) {
if (token == JsDocToken.EOC || token == JsDocToken.EOL ||
token == JsDocToken.EOF) {
return new ExtractionInfo("", token);
}
stream.update();... | private ExtractionInfo extractMultilineTextualBlock(JsDocToken token,
WhitespaceOption option) {
if (token == JsDocToken.EOC || token == JsDocToken.EOL ||
token == JsDocToken.EOF) {
return new ExtractionInfo("", token);
}
stream.update();... |
Math-53 | public Complex add(Complex rhs)
throws NullArgumentException {
MathUtils.checkNotNull(rhs);
return createComplex(real + rhs.getReal(),
imaginary + rhs.getImaginary());
}
| public Complex add(Complex rhs)
throws NullArgumentException {
MathUtils.checkNotNull(rhs);
if (isNaN || rhs.isNaN) {
return NaN;
}
return createComplex(real + rhs.getReal(),
imaginary + rhs.getImaginary());
}
|
Math-28 | private Integer getPivotRow(SimplexTableau tableau, final int col) {
List<Integer> minRatioPositions = new ArrayList<Integer>();
double minRatio = Double.MAX_VALUE;
for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getHeight(); i++) {
final double rhs = tableau.getEntr... | private Integer getPivotRow(SimplexTableau tableau, final int col) {
List<Integer> minRatioPositions = new ArrayList<Integer>();
double minRatio = Double.MAX_VALUE;
for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getHeight(); i++) {
final double rhs = tableau.getEntr... |
Closure-128 | static boolean isSimpleNumber(String s) {
int len = s.length();
for (int index = 0; index < len; index++) {
char c = s.charAt(index);
if (c < '0' || c > '9') {
return false;
}
}
return len > 0 && s.charAt(0) != '0';
}
| static boolean isSimpleNumber(String s) {
int len = s.length();
if (len == 0) {
return false;
}
for (int index = 0; index < len; index++) {
char c = s.charAt(index);
if (c < '0' || c > '9') {
return false;
}
}
return len == 1 || s.charAt(0) != '0';
}
|
Compress-37 | Map<String, String> parsePaxHeaders(final InputStream i)
throws IOException {
final Map<String, String> headers = new HashMap<String, String>(globalPaxHeaders);
while(true){
int ch;
int len = 0;
int read = 0;
while((ch = i.read()) != -1) {
... | Map<String, String> parsePaxHeaders(final InputStream i)
throws IOException {
final Map<String, String> headers = new HashMap<String, String>(globalPaxHeaders);
while(true){
int ch;
int len = 0;
int read = 0;
while((ch = i.read()) != -1) {
... |
Compress-7 | public static String parseName(byte[] buffer, final int offset, final int length) {
StringBuffer result = new StringBuffer(length);
int end = offset + length;
for (int i = offset; i < end; ++i) {
if (buffer[i] == 0) {
break;
}
resu... | public static String parseName(byte[] buffer, final int offset, final int length) {
StringBuffer result = new StringBuffer(length);
int end = offset + length;
for (int i = offset; i < end; ++i) {
byte b = buffer[i];
if (b == 0) {
break;
... |
Cli-4 | private void checkRequiredOptions()
throws MissingOptionException
{
if (requiredOptions.size() > 0)
{
Iterator iter = requiredOptions.iterator();
StringBuffer buff = new StringBuffer();
while (iter.hasNext())
{
buff.append(i... | private void checkRequiredOptions()
throws MissingOptionException
{
if (requiredOptions.size() > 0)
{
Iterator iter = requiredOptions.iterator();
StringBuffer buff = new StringBuffer("Missing required option");
buff.append(requiredOptions.size() == 1 ?... |
Time-16 | public int parseInto(ReadWritableInstant instant, String text, int position) {
DateTimeParser parser = requireParser();
if (instant == null) {
throw new IllegalArgumentException("Instant must not be null");
}
long instantMillis = instant.getMillis();
Chronology ch... | public int parseInto(ReadWritableInstant instant, String text, int position) {
DateTimeParser parser = requireParser();
if (instant == null) {
throw new IllegalArgumentException("Instant must not be null");
}
long instantMillis = instant.getMillis();
Chronology ch... |
Jsoup-42 | public List<Connection.KeyVal> formData() {
ArrayList<Connection.KeyVal> data = new ArrayList<Connection.KeyVal>();
for (Element el: elements) {
if (!el.tag().isFormSubmittable()) continue;
String name = el.attr("name");
if (name.length() == 0) continue;
... | public List<Connection.KeyVal> formData() {
ArrayList<Connection.KeyVal> data = new ArrayList<Connection.KeyVal>();
for (Element el: elements) {
if (!el.tag().isFormSubmittable()) continue;
if (el.hasAttr("disabled")) continue;
String name = el.attr("name");
... |
Closure-166 | public void matchConstraint(JSType constraint) {
if (hasReferenceName()) {
return;
}
if (constraint.isRecordType()) {
matchRecordTypeConstraint(constraint.toObjectType());
}
}
| public void matchConstraint(JSType constraint) {
if (hasReferenceName()) {
return;
}
if (constraint.isRecordType()) {
matchRecordTypeConstraint(constraint.toObjectType());
} else if (constraint.isUnionType()) {
for (JSType alt : constraint.toMaybeUnionType().getAlternates()) {
... |
Closure-87 | private boolean isFoldableExpressBlock(Node n) {
if (n.getType() == Token.BLOCK) {
if (n.hasOneChild()) {
Node maybeExpr = n.getFirstChild();
return NodeUtil.isExpressionNode(maybeExpr);
}
}
return false;
}
| private boolean isFoldableExpressBlock(Node n) {
if (n.getType() == Token.BLOCK) {
if (n.hasOneChild()) {
Node maybeExpr = n.getFirstChild();
if (maybeExpr.getType() == Token.EXPR_RESULT) {
if (maybeExpr.getFirstChild().getType() == Token.CALL) {
Node calledFn = maybeEx... |
JacksonDatabind-107 | protected final JsonDeserializer<Object> _findDeserializer(DeserializationContext ctxt,
String typeId) throws IOException
{
JsonDeserializer<Object> deser = _deserializers.get(typeId);
if (deser == null) {
JavaType type = _idResolver.typeFromId(ctxt, typeId);
... | protected final JsonDeserializer<Object> _findDeserializer(DeserializationContext ctxt,
String typeId) throws IOException
{
JsonDeserializer<Object> deser = _deserializers.get(typeId);
if (deser == null) {
JavaType type = _idResolver.typeFromId(ctxt, typeId);
... |
Jsoup-62 | boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {
String name = t.asEndTag().normalName();
ArrayList<Element> stack = tb.getStack();
for (int pos = stack.size() -1; pos >= 0; pos--) {
Element node = stack.get(pos);
if (node.nodeName().equal... | boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {
String name = t.asEndTag().name();
ArrayList<Element> stack = tb.getStack();
for (int pos = stack.size() -1; pos >= 0; pos--) {
Element node = stack.get(pos);
if (node.nodeName().equals(nam... |
JacksonDatabind-37 | protected JavaType _narrow(Class<?> subclass)
{
if (_class == subclass) {
return this;
}
return new SimpleType(subclass, _bindings, _superClass, _superInterfaces,
_valueHandler, _typeHandler, _asStatic);
}
| protected JavaType _narrow(Class<?> subclass)
{
if (_class == subclass) {
return this;
}
return new SimpleType(subclass, _bindings, this, _superInterfaces,
_valueHandler, _typeHandler, _asStatic);
}
|
Math-51 | protected final double doSolve() {
double x0 = getMin();
double x1 = getMax();
double f0 = computeObjectiveValue(x0);
double f1 = computeObjectiveValue(x1);
if (f0 == 0.0) {
return x0;
}
if (f1 == 0.0) {
return x1;
}
ver... | protected final double doSolve() {
double x0 = getMin();
double x1 = getMax();
double f0 = computeObjectiveValue(x0);
double f1 = computeObjectiveValue(x1);
if (f0 == 0.0) {
return x0;
}
if (f1 == 0.0) {
return x1;
}
ver... |
JacksonDatabind-100 | public byte[] getBinaryValue(Base64Variant b64variant)
throws IOException, JsonParseException
{
JsonNode n = currentNode();
if (n != null) {
byte[] data = n.binaryValue();
if (data != null) {
return data;
}
if (n.isPojo()) {... | public byte[] getBinaryValue(Base64Variant b64variant)
throws IOException, JsonParseException
{
JsonNode n = currentNode();
if (n != null) {
if (n instanceof TextNode) {
return ((TextNode) n).getBinaryValue(b64variant);
}
return n.binar... |
Time-20 | public int parseInto(DateTimeParserBucket bucket, String text, int position) {
String str = text.substring(position);
for (String id : ALL_IDS) {
if (str.startsWith(id)) {
bucket.setZone(DateTimeZone.forID(id));
return position + id... | public int parseInto(DateTimeParserBucket bucket, String text, int position) {
String str = text.substring(position);
String best = null;
for (String id : ALL_IDS) {
if (str.startsWith(id)) {
if (best == null || id.length() > best.length()) {
... |
Jsoup-68 | private boolean inSpecificScope(String[] targetNames, String[] baseTypes, String[] extraTypes) {
int bottom = stack.size() -1;
if (bottom > MaxScopeSearchDepth) {
bottom = MaxScopeSearchDepth;
}
final int top = bottom > MaxScopeSearchDepth ? bottom - MaxScopeSearchDepth :... | private boolean inSpecificScope(String[] targetNames, String[] baseTypes, String[] extraTypes) {
final int bottom = stack.size() -1;
final int top = bottom > MaxScopeSearchDepth ? bottom - MaxScopeSearchDepth : 0;
for (int pos = bottom; pos >= top; pos--) {
final String elName = ... |
Jsoup-51 | boolean matchesLetter() {
if (isEmpty())
return false;
char c = input[pos];
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}
| boolean matchesLetter() {
if (isEmpty())
return false;
char c = input[pos];
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || Character.isLetter(c);
}
|
Gson-18 | static Type getSupertype(Type context, Class<?> contextRawType, Class<?> supertype) {
checkArgument(supertype.isAssignableFrom(contextRawType));
return resolve(context, contextRawType,
$Gson$Types.getGenericSupertype(context, contextRawType, supertype));
}
| static Type getSupertype(Type context, Class<?> contextRawType, Class<?> supertype) {
if (context instanceof WildcardType) {
context = ((WildcardType)context).getUpperBounds()[0];
}
checkArgument(supertype.isAssignableFrom(contextRawType));
return resolve(context, contextRawType,
$Gson$T... |
Closure-88 | private VariableLiveness isVariableReadBeforeKill(
Node n, String variable) {
if (NodeUtil.isName(n) && variable.equals(n.getString())) {
if (NodeUtil.isLhs(n, n.getParent())) {
return VariableLiveness.KILL;
} else {
return VariableLiveness.READ;
}
}
for (Node child... | private VariableLiveness isVariableReadBeforeKill(
Node n, String variable) {
if (NodeUtil.isName(n) && variable.equals(n.getString())) {
if (NodeUtil.isLhs(n, n.getParent())) {
Preconditions.checkState(n.getParent().getType() == Token.ASSIGN);
Node rhs = n.getNext();
VariableL... |
Closure-123 | void add(Node n, Context context) {
if (!cc.continueProcessing()) {
return;
}
int type = n.getType();
String opstr = NodeUtil.opToStr(type);
int childCount = n.getChildCount();
Node first = n.getFirstChild();
Node last = n.getLastChild();
if (opstr != null && first != last) {
... | void add(Node n, Context context) {
if (!cc.continueProcessing()) {
return;
}
int type = n.getType();
String opstr = NodeUtil.opToStr(type);
int childCount = n.getChildCount();
Node first = n.getFirstChild();
Node last = n.getLastChild();
if (opstr != null && first != last) {
... |
Math-42 | protected RealPointValuePair getSolution() {
int negativeVarColumn = columnLabels.indexOf(NEGATIVE_VAR_COLUMN_LABEL);
Integer negativeVarBasicRow = negativeVarColumn > 0 ? getBasicRow(negativeVarColumn) : null;
double mostNegative = negativeVarBasicRow == null ? 0 : getEntry(negativeVarBasicRow, g... | protected RealPointValuePair getSolution() {
int negativeVarColumn = columnLabels.indexOf(NEGATIVE_VAR_COLUMN_LABEL);
Integer negativeVarBasicRow = negativeVarColumn > 0 ? getBasicRow(negativeVarColumn) : null;
double mostNegative = negativeVarBasicRow == null ? 0 : getEntry(negativeVarBasicRow, g... |
Math-89 | public void addValue(Object v) {
addValue((Comparable<?>) v);
}
| public void addValue(Object v) {
if (v instanceof Comparable<?>){
addValue((Comparable<?>) v);
} else {
throw new IllegalArgumentException("Object must implement Comparable");
}
}
|
Math-78 | public boolean evaluateStep(final StepInterpolator interpolator)
throws DerivativeException, EventException, ConvergenceException {
try {
forward = interpolator.isForward();
final double t1 = interpolator.getCurrentTime();
final int n = Math.max(1, (int) Math.... | public boolean evaluateStep(final StepInterpolator interpolator)
throws DerivativeException, EventException, ConvergenceException {
try {
forward = interpolator.isForward();
final double t1 = interpolator.getCurrentTime();
final int n = Math.max(1, (int) Math.... |
Time-27 | private static PeriodFormatter toFormatter(List<Object> elementPairs, boolean notPrinter, boolean notParser) {
if (notPrinter && notParser) {
throw new IllegalStateException("Builder has created neither a printer nor a parser");
}
int size = elementPairs.size();
if (size ... | private static PeriodFormatter toFormatter(List<Object> elementPairs, boolean notPrinter, boolean notParser) {
if (notPrinter && notParser) {
throw new IllegalStateException("Builder has created neither a printer nor a parser");
}
int size = elementPairs.size();
if (size ... |
Time-14 | public int[] add(ReadablePartial partial, int fieldIndex, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return values;
}
if (DateTimeUtils.isContiguous(partial)) {
long instant = 0L;
for (int i = 0, isize = partial.size(); i < isize; i++) {
... | public int[] add(ReadablePartial partial, int fieldIndex, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return values;
}
if (partial.size() > 0 && partial.getFieldType(0).equals(DateTimeFieldType.monthOfYear()) && fieldIndex == 0) {
int curMonth0 = partial.ge... |
Chart-23 | null | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof MinMaxCategoryRenderer)) {
return false;
}
MinMaxCategoryRenderer that = (MinMaxCategoryRenderer) obj;
if (this.plotLines != that.plotLines) {
... |
Mockito-33 | public boolean hasSameMethod(Invocation candidate) {
Method m1 = invocation.getMethod();
Method m2 = candidate.getMethod();
return m1.equals(m2);
}
| public boolean hasSameMethod(Invocation candidate) {
Method m1 = invocation.getMethod();
Method m2 = candidate.getMethod();
if (m1.getName() != null && m1.getName().equals(m2.getName())) {
Class[] params1 = m1.getParameterTypes();
Class[] params2 = m2.getParameterTy... |
Closure-101 | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
options.setCodingConvention(new ClosureCodingConvention());
CompilationLevel level = flags.compilation_level;
level.setOptionsForCompilationLevel(options);
if (flags.debug) {
level.setDebugOptionsFor... | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
options.setCodingConvention(new ClosureCodingConvention());
CompilationLevel level = flags.compilation_level;
level.setOptionsForCompilationLevel(options);
if (flags.debug) {
level.setDebugOptionsFor... |
Closure-38 | void addNumber(double x) {
char prev = getLastChar();
boolean negativeZero = isNegativeZero(x);
if (x < 0 && prev == '-') {
add(" ");
}
if ((long) x == x && !negativeZero) {
long value = (long) x;
long mantissa = value;
int exp = 0;
if (Math.abs(x) >= 100) {
w... | void addNumber(double x) {
char prev = getLastChar();
boolean negativeZero = isNegativeZero(x);
if ((x < 0 || negativeZero) && prev == '-') {
add(" ");
}
if ((long) x == x && !negativeZero) {
long value = (long) x;
long mantissa = value;
int exp = 0;
if (Math.abs(x) >... |
JacksonDatabind-70 | public void remove(SettableBeanProperty propToRm)
{
ArrayList<SettableBeanProperty> props = new ArrayList<SettableBeanProperty>(_size);
String key = getPropertyName(propToRm);
boolean found = false;
for (int i = 1, end = _hashArea.length; i < end; i += 2) {
SettableBe... | public void remove(SettableBeanProperty propToRm)
{
ArrayList<SettableBeanProperty> props = new ArrayList<SettableBeanProperty>(_size);
String key = getPropertyName(propToRm);
boolean found = false;
for (int i = 1, end = _hashArea.length; i < end; i += 2) {
SettableBe... |
JacksonDatabind-6 | protected Date parseAsISO8601(String dateStr, ParsePosition pos)
{
int len = dateStr.length();
char c = dateStr.charAt(len-1);
DateFormat df;
if (len <= 10 && Character.isDigit(c)) {
df = _formatPlain;
if (df == null) {
df = _formatPlain = ... | protected Date parseAsISO8601(String dateStr, ParsePosition pos)
{
int len = dateStr.length();
char c = dateStr.charAt(len-1);
DateFormat df;
if (len <= 10 && Character.isDigit(c)) {
df = _formatPlain;
if (df == null) {
df = _formatPlain = ... |
JacksonDatabind-101 | protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, DeserializationContext ctxt)
throws IOException
{
final PropertyBasedCreator creator = _propertyBasedCreator;
PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdReader);
TokenBuffer tokens... | protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p, DeserializationContext ctxt)
throws IOException
{
final PropertyBasedCreator creator = _propertyBasedCreator;
PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdReader);
TokenBuffer tokens... |
Time-23 | private static synchronized String getConvertedId(String id) {
Map<String, String> map = cZoneIdConversion;
if (map == null) {
map = new HashMap<String, String>();
map.put("GMT", "UTC");
map.put("MIT", "Pacific/Apia");
map.put("HST", "Pacific/Honolulu"... | private static synchronized String getConvertedId(String id) {
Map<String, String> map = cZoneIdConversion;
if (map == null) {
map = new HashMap<String, String>();
map.put("GMT", "UTC");
map.put("WET", "WET");
map.put("CET", "CET");
map.put... |
Csv-2 | public String get(final String name) {
if (mapping == null) {
throw new IllegalStateException(
"No header mapping was specified, the record values can't be accessed by name");
}
final Integer index = mapping.get(name);
return index != null ? values... | public String get(final String name) {
if (mapping == null) {
throw new IllegalStateException(
"No header mapping was specified, the record values can't be accessed by name");
}
final Integer index = mapping.get(name);
try {
return index !=... |
Closure-20 | private Node tryFoldSimpleFunctionCall(Node n) {
Preconditions.checkState(n.isCall());
Node callTarget = n.getFirstChild();
if (callTarget != null && callTarget.isName() &&
callTarget.getString().equals("String")) {
Node value = callTarget.getNext();
if (value != null) {
Node... | private Node tryFoldSimpleFunctionCall(Node n) {
Preconditions.checkState(n.isCall());
Node callTarget = n.getFirstChild();
if (callTarget != null && callTarget.isName() &&
callTarget.getString().equals("String")) {
Node value = callTarget.getNext();
if (value != null && value.getNex... |
Compress-45 | public static int formatLongOctalOrBinaryBytes(
final long value, final byte[] buf, final int offset, final int length) {
final long maxAsOctalChar = length == TarConstants.UIDLEN ? TarConstants.MAXID : TarConstants.MAXSIZE;
final boolean negative = value < 0;
if (!negative && value ... | public static int formatLongOctalOrBinaryBytes(
final long value, final byte[] buf, final int offset, final int length) {
final long maxAsOctalChar = length == TarConstants.UIDLEN ? TarConstants.MAXID : TarConstants.MAXSIZE;
final boolean negative = value < 0;
if (!negative && value ... |
Jsoup-54 | private void copyAttributes(org.jsoup.nodes.Node source, Element el) {
for (Attribute attribute : source.attributes()) {
String key = attribute.getKey().replaceAll("[^-a-zA-Z0-9_:.]", "");
el.setAttribute(key, attribute.getValue());
}
}
| private void copyAttributes(org.jsoup.nodes.Node source, Element el) {
for (Attribute attribute : source.attributes()) {
String key = attribute.getKey().replaceAll("[^-a-zA-Z0-9_:.]", "");
if (key.matches("[a-zA-Z_:]{1}[-a-zA-Z0-9_:.]*"))
el.setAtt... |
Compress-11 | public ArchiveInputStream createArchiveInputStream(final InputStream in)
throws ArchiveException {
if (in == null) {
throw new IllegalArgumentException("Stream must not be null.");
}
if (!in.markSupported()) {
throw new IllegalArgumentException("Mark is no... | public ArchiveInputStream createArchiveInputStream(final InputStream in)
throws ArchiveException {
if (in == null) {
throw new IllegalArgumentException("Stream must not be null.");
}
if (!in.markSupported()) {
throw new IllegalArgumentException("Mark is no... |
JacksonXml-5 | protected XmlSerializerProvider(XmlSerializerProvider src) {
super(src);
_rootNameLookup = src._rootNameLookup;
}
| protected XmlSerializerProvider(XmlSerializerProvider src) {
super(src);
_rootNameLookup = new XmlRootNameLookup();
}
|
Csv-15 | private void printAndQuote(final Object object, final CharSequence value, final int offset, final int len,
final Appendable out, final boolean newRecord) throws IOException {
boolean quote = false;
int start = offset;
int pos = offset;
final int end = offset + len;
... | private void printAndQuote(final Object object, final CharSequence value, final int offset, final int len,
final Appendable out, final boolean newRecord) throws IOException {
boolean quote = false;
int start = offset;
int pos = offset;
final int end = offset + len;
... |
Chart-6 | public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ShapeList)) {
return false;
}
return super.equals(obj);
}
| public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof ShapeList)) {
return false;
}
ShapeList that = (ShapeList) obj;
int listSize = size();
for (int i = 0; i < listSize; i++) {
if (!Shape... |
Mockito-34 | public void captureArgumentsFrom(Invocation i) {
int k = 0;
for (Matcher m : matchers) {
if (m instanceof CapturesArguments) {
((CapturesArguments) m).captureFrom(i.getArguments()[k]);
}
k++;
}
}
| public void captureArgumentsFrom(Invocation i) {
int k = 0;
for (Matcher m : matchers) {
if (m instanceof CapturesArguments && i.getArguments().length > k) {
((CapturesArguments) m).captureFrom(i.getArguments()[k]);
}
k++;
}
}
|
Math-34 | public Iterator<Chromosome> iterator() {
return chromosomes.iterator();
}
| public Iterator<Chromosome> iterator() {
return getChromosomes().iterator();
}
|
Closure-44 | void add(String newcode) {
maybeEndStatement();
if (newcode.length() == 0) {
return;
}
char c = newcode.charAt(0);
if ((isWordChar(c) || c == '\\') &&
isWordChar(getLastChar())) {
append(" ");
}
append(newcode);
}
| void add(String newcode) {
maybeEndStatement();
if (newcode.length() == 0) {
return;
}
char c = newcode.charAt(0);
if ((isWordChar(c) || c == '\\') &&
isWordChar(getLastChar())) {
append(" ");
} else if (c == '/' && getLastChar() == '/') {
append(" ");
}
appen... |
Compress-25 | public ZipArchiveInputStream(InputStream inputStream,
String encoding,
boolean useUnicodeExtraFields,
boolean allowStoredEntriesWithDataDescriptor) {
zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
... | public ZipArchiveInputStream(InputStream inputStream,
String encoding,
boolean useUnicodeExtraFields,
boolean allowStoredEntriesWithDataDescriptor) {
zipEncoding = ZipEncodingHelper.getZipEncoding(encoding);
... |
Closure-52 | static boolean isSimpleNumber(String s) {
int len = s.length();
for (int index = 0; index < len; index++) {
char c = s.charAt(index);
if (c < '0' || c > '9') {
return false;
}
}
return len > 0;
}
| static boolean isSimpleNumber(String s) {
int len = s.length();
for (int index = 0; index < len; index++) {
char c = s.charAt(index);
if (c < '0' || c > '9') {
return false;
}
}
return len > 0 && s.charAt(0) != '0';
}
|
Closure-14 | private static Node computeFollowNode(
Node fromNode, Node node, ControlFlowAnalysis cfa) {
Node parent = node.getParent();
if (parent == null || parent.isFunction() ||
(cfa != null && node == cfa.root)) {
return null;
}
switch (parent.getType()) {
case Token.IF:
retu... | private static Node computeFollowNode(
Node fromNode, Node node, ControlFlowAnalysis cfa) {
Node parent = node.getParent();
if (parent == null || parent.isFunction() ||
(cfa != null && node == cfa.root)) {
return null;
}
switch (parent.getType()) {
case Token.IF:
retu... |
Math-56 | public int[] getCounts(int index) {
if (index < 0 ||
index >= totalSize) {
throw new OutOfRangeException(index, 0, totalSize);
}
final int[] indices = new int[dimension];
int count = 0;
for (int i = 0; i < last; i++) {
int idx = 0;
... | public int[] getCounts(int index) {
if (index < 0 ||
index >= totalSize) {
throw new OutOfRangeException(index, 0, totalSize);
}
final int[] indices = new int[dimension];
int count = 0;
for (int i = 0; i < last; i++) {
int idx = 0;
... |
Math-79 | public static double distance(int[] p1, int[] p2) {
int sum = 0;
for (int i = 0; i < p1.length; i++) {
final int dp = p1[i] - p2[i];
sum += dp * dp;
}
return Math.sqrt(sum);
}
| public static double distance(int[] p1, int[] p2) {
double sum = 0;
for (int i = 0; i < p1.length; i++) {
final double dp = p1[i] - p2[i];
sum += dp * dp;
}
return Math.sqrt(sum);
}
|
Jsoup-53 | public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
do {
if (isEmpty()) break;
Character c = consume();
if (last == 0 || last != ESC) {
if (c.equals(open)) {
... | public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
boolean inQuote = false;
do {
if (isEmpty()) break;
Character c = consume();
if (last == 0 || last != ESC) {
... |
Closure-92 | void replace() {
if (firstNode == null) {
replacementNode = candidateDefinition;
return;
}
if (candidateDefinition != null && explicitNode != null) {
explicitNode.detachFromParent();
compiler.reportCodeChange();
replacementNode = candidateDefinition;
... | void replace() {
if (firstNode == null) {
replacementNode = candidateDefinition;
return;
}
if (candidateDefinition != null && explicitNode != null) {
explicitNode.detachFromParent();
compiler.reportCodeChange();
replacementNode = candidateDefinition;
... |
Compress-10 | private void resolveLocalFileHeaderData(Map<ZipArchiveEntry, NameAndComment>
entriesWithoutUTF8Flag)
throws IOException {
for (ZipArchiveEntry ze : entries.keySet()) {
OffsetEntry offsetEntry = entries.get(ze);
long offset = offsetE... | private void resolveLocalFileHeaderData(Map<ZipArchiveEntry, NameAndComment>
entriesWithoutUTF8Flag)
throws IOException {
Map<ZipArchiveEntry, OffsetEntry> origMap =
new LinkedHashMap<ZipArchiveEntry, OffsetEntry>(entries);
entries.clea... |
Closure-121 | private void inlineNonConstants(
Var v, ReferenceCollection referenceInfo,
boolean maybeModifiedArguments) {
int refCount = referenceInfo.references.size();
Reference declaration = referenceInfo.references.get(0);
Reference init = referenceInfo.getInitializingReference();
int... | private void inlineNonConstants(
Var v, ReferenceCollection referenceInfo,
boolean maybeModifiedArguments) {
int refCount = referenceInfo.references.size();
Reference declaration = referenceInfo.references.get(0);
Reference init = referenceInfo.getInitializingReference();
int... |
Jsoup-59 | final void newAttribute() {
if (attributes == null)
attributes = new Attributes();
if (pendingAttributeName != null) {
pendingAttributeName = pendingAttributeName.trim();
Attribute attribute;
if (hasPendingAttributeV... | final void newAttribute() {
if (attributes == null)
attributes = new Attributes();
if (pendingAttributeName != null) {
pendingAttributeName = pendingAttributeName.trim();
if (pendingAttributeName.length() > 0) {
Attribut... |
Lang-28 | public int translate(CharSequence input, int index, Writer out) throws IOException {
if(input.charAt(index) == '&' && input.charAt(index + 1) == '#') {
int start = index + 2;
boolean isHex = false;
char firstChar = input.charAt(start);
if(firstChar == 'x' || f... | public int translate(CharSequence input, int index, Writer out) throws IOException {
if(input.charAt(index) == '&' && input.charAt(index + 1) == '#') {
int start = index + 2;
boolean isHex = false;
char firstChar = input.charAt(start);
if(firstChar == 'x' || f... |
Math-87 | private Integer getBasicRow(final int col) {
Integer row = null;
for (int i = getNumObjectiveFunctions(); i < getHeight(); i++) {
if (!MathUtils.equals(getEntry(i, col), 0.0, epsilon)) {
if (row == null) {
row = i;
} else {
... | private Integer getBasicRow(final int col) {
Integer row = null;
for (int i = getNumObjectiveFunctions(); i < getHeight(); i++) {
if (MathUtils.equals(getEntry(i, col), 1.0, epsilon) && (row == null)) {
row = i;
} else if (!MathUtils.equals(getEntry(i, col), 0... |
JacksonCore-23 | public DefaultPrettyPrinter createInstance() {
return new DefaultPrettyPrinter(this);
}
| public DefaultPrettyPrinter createInstance() {
if (getClass() != DefaultPrettyPrinter.class) {
throw new IllegalStateException("Failed `createInstance()`: "+getClass().getName()
+" does not override method; it has to");
}
return new DefaultPrettyPrinter(this)... |
Closure-122 | private void handleBlockComment(Comment comment) {
if (comment.getValue().indexOf("/* @") != -1 || comment.getValue().indexOf("\n * @") != -1) {
errorReporter.warning(
SUSPICIOUS_COMMENT_WARNING,
sourceName,
comment.getLineno(), "", 0);
}
}
| private void handleBlockComment(Comment comment) {
Pattern p = Pattern.compile("(/|(\n[ \t]*))\\*[ \t]*@[a-zA-Z]");
if (p.matcher(comment.getValue()).find()) {
errorReporter.warning(
SUSPICIOUS_COMMENT_WARNING,
sourceName,
comment.getLineno(), "", 0);
}
}
|
JacksonDatabind-8 | protected void verifyNonDup(AnnotatedWithParams newOne, int typeIndex, boolean explicit)
{
final int mask = (1 << typeIndex);
_hasNonDefaultCreator = true;
AnnotatedWithParams oldOne = _creators[typeIndex];
if (oldOne != null) {
if ((_explicitCreators & mask) != 0) { ... | protected void verifyNonDup(AnnotatedWithParams newOne, int typeIndex, boolean explicit)
{
final int mask = (1 << typeIndex);
_hasNonDefaultCreator = true;
AnnotatedWithParams oldOne = _creators[typeIndex];
if (oldOne != null) {
boolean verify;
if ((_expli... |
JacksonDatabind-49 | public Object generateId(Object forPojo) {
id = generator.generateId(forPojo);
return id;
}
| public Object generateId(Object forPojo) {
if (id == null) {
id = generator.generateId(forPojo);
}
return id;
}
|
Jsoup-6 | static String unescape(String string) {
if (!string.contains("&"))
return string;
Matcher m = unescapePattern.matcher(string);
StringBuffer accum = new StringBuffer(string.length());
while (m.find()) {
int charval = -1;
String num = m.group(3);
... | static String unescape(String string) {
if (!string.contains("&"))
return string;
Matcher m = unescapePattern.matcher(string);
StringBuffer accum = new StringBuffer(string.length());
while (m.find()) {
int charval = -1;
String num = m.group(3);
... |
Cli-12 | protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
{
List tokens = new ArrayList();
boolean eatTheRest = false;
for (int i = 0; i < arguments.length; i++)
{
String arg = arguments[i];
if ("--".equals(arg))
... | protected String[] flatten(Options options, String[] arguments, boolean stopAtNonOption)
{
List tokens = new ArrayList();
boolean eatTheRest = false;
for (int i = 0; i < arguments.length; i++)
{
String arg = arguments[i];
if ("--".equals(arg))
... |
Codec-5 | void decode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
if (inAvail < 0) {
eof = true;
}
for (int i = 0; i < inAvail; i++) {
if (buffer == null || buffer.length - pos < decodeSize) {
resizeBuffer();
... | void decode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
if (inAvail < 0) {
eof = true;
}
for (int i = 0; i < inAvail; i++) {
if (buffer == null || buffer.length - pos < decodeSize) {
resizeBuffer();
... |
Chart-26 | protected AxisState drawLabel(String label, Graphics2D g2,
Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
AxisState state, PlotRenderingInfo plotState) {
if (state == null) {
throw new IllegalArgumentException("Null 'state' argument.");
}
... | protected AxisState drawLabel(String label, Graphics2D g2,
Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge,
AxisState state, PlotRenderingInfo plotState) {
if (state == null) {
throw new IllegalArgumentException("Null 'state' argument.");
}
... |
Math-105 | public double getSumSquaredErrors() {
return sumYY - sumXY * sumXY / sumXX;
}
| public double getSumSquaredErrors() {
return Math.max(0d, sumYY - sumXY * sumXY / sumXX);
}
|
Time-18 | public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
throws IllegalArgumentException
{
Chronology base;
if ((base = getBase()) ... | public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth,
int hourOfDay, int minuteOfHour,
int secondOfMinute, int millisOfSecond)
throws IllegalArgumentException
{
Chronology base;
if ((base = getBase()) ... |
JacksonDatabind-34 | public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
if (_isInt) {
visitIntFormat(visitor, typeHint, JsonParser.NumberType.BIG_INTEGER);
} else {
Class<?> h = handledType();
if (h == BigDecimal.... | public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
{
if (_isInt) {
visitIntFormat(visitor, typeHint, JsonParser.NumberType.BIG_INTEGER);
} else {
Class<?> h = handledType();
if (h == BigDecimal.... |
Mockito-28 | private void injectMockCandidate(Class<?> awaitingInjectionClazz, Set<Object> mocks, Object fieldInstance) {
for(Field field : orderedInstanceFieldsFrom(awaitingInjectionClazz)) {
mockCandidateFilter.filterCandidate(mocks, field, fieldInstance).thenInject();
}
}
| private void injectMockCandidate(Class<?> awaitingInjectionClazz, Set<Object> mocks, Object fieldInstance) {
for(Field field : orderedInstanceFieldsFrom(awaitingInjectionClazz)) {
Object injected = mockCandidateFilter.filterCandidate(mocks, field, fieldInstance).thenInject();
mocks.r... |
Mockito-29 | public void describeTo(Description description) {
description.appendText("same(");
appendQuoting(description);
description.appendText(wanted.toString());
appendQuoting(description);
description.appendText(")");
}
| public void describeTo(Description description) {
description.appendText("same(");
appendQuoting(description);
description.appendText(wanted == null ? "null" : wanted.toString());
appendQuoting(description);
description.appendText(")");
}
|
Lang-52 | private static void escapeJavaStyleString(Writer out, String str, boolean escapeSingleQuote) throws IOException {
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (str == null) {
return;
}
int sz;
sz = ... | private static void escapeJavaStyleString(Writer out, String str, boolean escapeSingleQuote) throws IOException {
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (str == null) {
return;
}
int sz;
sz = ... |
Jsoup-34 | int nextIndexOf(CharSequence seq) {
char startChar = seq.charAt(0);
for (int offset = pos; offset < length; offset++) {
if (startChar != input[offset])
while(++offset < length && startChar != input[offset]);
int i = offset + 1;
int last = i + seq.l... | int nextIndexOf(CharSequence seq) {
char startChar = seq.charAt(0);
for (int offset = pos; offset < length; offset++) {
if (startChar != input[offset])
while(++offset < length && startChar != input[offset]);
int i = offset + 1;
int last = i + seq.l... |
Closure-86 | static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) {
switch (value.getType()) {
case Token.ASSIGN:
return NodeUtil.isImmutableValue(value.getLastChild())
|| (locals.apply(value)
&& evaluatesToLocalValue(value.getLastChild(), locals));
case Toke... | static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) {
switch (value.getType()) {
case Token.ASSIGN:
return NodeUtil.isImmutableValue(value.getLastChild())
|| (locals.apply(value)
&& evaluatesToLocalValue(value.getLastChild(), locals));
case Toke... |
Jsoup-32 | public Element clone() {
Element clone = (Element) super.clone();
clone.classNames();
return clone;
}
| public Element clone() {
Element clone = (Element) super.clone();
clone.classNames = null;
return clone;
}
|
Jsoup-64 | private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.insert(startTag);
tb.tokeniser.transition(TokeniserState.Rawtext);
tb.markInsertionMode();
tb.transition(Text);
}
| private static void handleRawtext(Token.StartTag startTag, HtmlTreeBuilder tb) {
tb.tokeniser.transition(TokeniserState.Rawtext);
tb.markInsertionMode();
tb.transition(Text);
tb.insert(startTag);
}
|
Lang-11 | public static String random(int count, int start, int end, boolean letters, boolean numbers,
char[] chars, Random random) {
if (count == 0) {
return "";
} else if (count < 0) {
throw new IllegalArgumentException("Requested random string length ... | public static String random(int count, int start, int end, boolean letters, boolean numbers,
char[] chars, Random random) {
if (count == 0) {
return "";
} else if (count < 0) {
throw new IllegalArgumentException("Requested random string length ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.