bug_id stringlengths 5 19 | func_before stringlengths 49 25.9k ⌀ | func_after stringlengths 45 26k |
|---|---|---|
Chart-12 | public MultiplePiePlot(CategoryDataset dataset) {
super();
this.dataset = dataset;
PiePlot piePlot = new PiePlot(null);
this.pieChart = new JFreeChart(piePlot);
this.pieChart.removeLegend();
this.dataExtractOrder = TableOrder.BY_COLUMN;
this.pieChart.setBackgr... | public MultiplePiePlot(CategoryDataset dataset) {
super();
setDataset(dataset);
PiePlot piePlot = new PiePlot(null);
this.pieChart = new JFreeChart(piePlot);
this.pieChart.removeLegend();
this.dataExtractOrder = TableOrder.BY_COLUMN;
this.pieChart.setBackgroun... |
Closure-125 | private void visitNew(NodeTraversal t, Node n) {
Node constructor = n.getFirstChild();
JSType type = getJSType(constructor).restrictByNotNullOrUndefined();
if (type.isConstructor() || type.isEmptyType() || type.isUnknownType()) {
FunctionType fnType = type.toMaybeFunctionType();
if (fnType != ... | private void visitNew(NodeTraversal t, Node n) {
Node constructor = n.getFirstChild();
JSType type = getJSType(constructor).restrictByNotNullOrUndefined();
if (type.isConstructor() || type.isEmptyType() || type.isUnknownType()) {
FunctionType fnType = type.toMaybeFunctionType();
if (fnType != ... |
Lang-16 | public static Number createNumber(String str) throws NumberFormatException {
if (str == null) {
return null;
}
if (StringUtils.isBlank(str)) {
throw new NumberFormatException("A blank string is not a valid number");
}
if (str.startsWith("--")) {
... | public static Number createNumber(String str) throws NumberFormatException {
if (str == null) {
return null;
}
if (StringUtils.isBlank(str)) {
throw new NumberFormatException("A blank string is not a valid number");
}
if (str.startsWith("--")) {
... |
Codec-4 | public Base64() {
this(false);
}
| public Base64() {
this(0);
}
|
JacksonDatabind-28 | public ObjectNode deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
{
if (p.getCurrentToken() == JsonToken.START_OBJECT) {
p.nextToken();
return deserializeObject(p, ctxt, ctxt.getNodeFactory());
}
if (p.getCurre... | public ObjectNode deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
{
if (p.isExpectedStartObjectToken() || p.hasToken(JsonToken.FIELD_NAME)) {
return deserializeObject(p, ctxt, ctxt.getNodeFactory());
}
if (p.hasToken(JsonToken... |
JacksonDatabind-16 | protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<? extends Annotation>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous != null) && previous.equals(ann);
}
| protected final boolean _add(Annotation ann) {
if (_annotations == null) {
_annotations = new HashMap<Class<? extends Annotation>,Annotation>();
}
Annotation previous = _annotations.put(ann.annotationType(), ann);
return (previous == null) || !previous.equals(ann);
}
|
JacksonDatabind-88 | protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException
{
TypeFactory tf = ctxt.getTypeFactory();
if (id.indexOf('<') > 0) {
JavaType t = tf.constructFromCanonical(id);
return t;
}
Class<?> cls;
try {
cls = t... | protected JavaType _typeFromId(String id, DatabindContext ctxt) throws IOException
{
TypeFactory tf = ctxt.getTypeFactory();
if (id.indexOf('<') > 0) {
JavaType t = tf.constructFromCanonical(id);
if (!t.isTypeOrSubTypeOf(_baseType.getRawClass())) {
throw n... |
Closure-35 | private void inferPropertyTypesToMatchConstraint(
JSType type, JSType constraint) {
if (type == null || constraint == null) {
return;
}
ObjectType constraintObj =
ObjectType.cast(constraint.restrictByNotNullOrUndefined());
if (constraintObj != null && constraintObj.isRecordType()) ... | private void inferPropertyTypesToMatchConstraint(
JSType type, JSType constraint) {
if (type == null || constraint == null) {
return;
}
ObjectType constraintObj =
ObjectType.cast(constraint.restrictByNotNullOrUndefined());
if (constraintObj != null) {
type.matchConstraint(con... |
Closure-19 | protected void declareNameInScope(FlowScope scope, Node node, JSType type) {
switch (node.getType()) {
case Token.NAME:
scope.inferSlotType(node.getString(), type);
break;
case Token.GETPROP:
String qualifiedName = node.getQualifiedName();
Preconditions.checkNotNull(qua... | protected void declareNameInScope(FlowScope scope, Node node, JSType type) {
switch (node.getType()) {
case Token.NAME:
scope.inferSlotType(node.getString(), type);
break;
case Token.GETPROP:
String qualifiedName = node.getQualifiedName();
Preconditions.checkNotNull(qua... |
Jsoup-76 | boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
... | boolean process(Token t, HtmlTreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
... |
Jsoup-82 | static Document parseInputStream(InputStream input, String charsetName, String baseUri, Parser parser) throws IOException {
if (input == null)
return new Document(baseUri);
input = ConstrainableInputStream.wrap(input, bufferSize, 0);
Document doc = null;
boolean fullyRe... | static Document parseInputStream(InputStream input, String charsetName, String baseUri, Parser parser) throws IOException {
if (input == null)
return new Document(baseUri);
input = ConstrainableInputStream.wrap(input, bufferSize, 0);
Document doc = null;
boolean fullyRe... |
Time-22 | protected BasePeriod(long duration) {
this(duration, null, null);
}
| protected BasePeriod(long duration) {
super();
iType = PeriodType.time();
int[] values = ISOChronology.getInstanceUTC().get(this, duration);
iType = PeriodType.standard();
iValues = new int[8];
System.arraycopy(values, 0, iValues, 4, 4);
}
|
Closure-164 | public boolean isSubtype(JSType other) {
if (!(other instanceof ArrowType)) {
return false;
}
ArrowType that = (ArrowType) other;
if (!this.returnType.isSubtype(that.returnType)) {
return false;
}
Node thisParam = parameters.getFirstChild();
Node thatParam = that.parameters.get... | public boolean isSubtype(JSType other) {
if (!(other instanceof ArrowType)) {
return false;
}
ArrowType that = (ArrowType) other;
if (!this.returnType.isSubtype(that.returnType)) {
return false;
}
Node thisParam = parameters.getFirstChild();
Node thatParam = that.parameters.get... |
Math-11 | public double density(final double[] vals) throws DimensionMismatchException {
final int dim = getDimension();
if (vals.length != dim) {
throw new DimensionMismatchException(vals.length, dim);
}
return FastMath.pow(2 * FastMath.PI, -dim / 2) *
FastMath.pow(cov... | public double density(final double[] vals) throws DimensionMismatchException {
final int dim = getDimension();
if (vals.length != dim) {
throw new DimensionMismatchException(vals.length, dim);
}
return FastMath.pow(2 * FastMath.PI, -0.5 * dim) *
FastMath.pow(c... |
Closure-160 | public void initOptions(CompilerOptions options) {
this.options = options;
if (errorManager == null) {
if (outStream == null) {
setErrorManager(
new LoggerErrorManager(createMessageFormatter(), logger));
} else {
PrintStreamErrorManager printer =
new PrintSt... | public void initOptions(CompilerOptions options) {
this.options = options;
if (errorManager == null) {
if (outStream == null) {
setErrorManager(
new LoggerErrorManager(createMessageFormatter(), logger));
} else {
PrintStreamErrorManager printer =
new PrintSt... |
Closure-50 | private Node tryFoldArrayJoin(Node n) {
Node callTarget = n.getFirstChild();
if (callTarget == null || !NodeUtil.isGetProp(callTarget)) {
return n;
}
Node right = callTarget.getNext();
if (right != null) {
if (!NodeUtil.isImmutableValue(right)) {
return n;
}
}
Nod... | private Node tryFoldArrayJoin(Node n) {
Node callTarget = n.getFirstChild();
if (callTarget == null || !NodeUtil.isGetProp(callTarget)) {
return n;
}
Node right = callTarget.getNext();
if (right != null) {
if (right.getNext() != null || !NodeUtil.isImmutableValue(right)) {
retu... |
Time-19 | public int getOffsetFromLocal(long instantLocal) {
final int offsetLocal = getOffset(instantLocal);
final long instantAdjusted = instantLocal - offsetLocal;
final int offsetAdjusted = getOffset(instantAdjusted);
if (offsetLocal != offsetAdjusted) {
if ((offsetLocal - offs... | public int getOffsetFromLocal(long instantLocal) {
final int offsetLocal = getOffset(instantLocal);
final long instantAdjusted = instantLocal - offsetLocal;
final int offsetAdjusted = getOffset(instantAdjusted);
if (offsetLocal != offsetAdjusted) {
if ((offsetLocal - offs... |
Math-95 | protected double getInitialDomain(double p) {
double ret;
double d = getDenominatorDegreesOfFreedom();
ret = d / (d - 2.0);
return ret;
}
| protected double getInitialDomain(double p) {
double ret = 1.0;
double d = getDenominatorDegreesOfFreedom();
if (d > 2.0) {
ret = d / (d - 2.0);
}
return ret;
}
|
JacksonCore-11 | private void _verifySharing()
{
if (_hashShared) {
_hashArea = Arrays.copyOf(_hashArea, _hashArea.length);
_names = Arrays.copyOf(_names, _names.length);
_hashShared = false;
}
if (_needRehash) {
rehash();
}
}
| private void _verifySharing()
{
if (_hashShared) {
_hashArea = Arrays.copyOf(_hashArea, _hashArea.length);
_names = Arrays.copyOf(_names, _names.length);
_hashShared = false;
_verifyNeedForRehash();
}
if (_needRehash) {
rehash()... |
Math-91 | public int compareTo(Fraction object) {
double nOd = doubleValue();
double dOn = object.doubleValue();
return (nOd < dOn) ? -1 : ((nOd > dOn) ? +1 : 0);
}
| public int compareTo(Fraction object) {
long nOd = ((long) numerator) * object.denominator;
long dOn = ((long) denominator) * object.numerator;
return (nOd < dOn) ? -1 : ((nOd > dOn) ? +1 : 0);
}
|
Math-73 | public double solve(final UnivariateRealFunction f,
final double min, final double max, final double initial)
throws MaxIterationsExceededException, FunctionEvaluationException {
clearResult();
verifySequence(min, initial, max);
double yInitial = f.value(initi... | public double solve(final UnivariateRealFunction f,
final double min, final double max, final double initial)
throws MaxIterationsExceededException, FunctionEvaluationException {
clearResult();
verifySequence(min, initial, max);
double yInitial = f.value(initi... |
Closure-17 | private JSType getDeclaredType(String sourceName, JSDocInfo info,
Node lValue, @Nullable Node rValue) {
if (info != null && info.hasType()) {
return getDeclaredTypeInAnnotation(sourceName, lValue, info);
} else if (rValue != null && rValue.isFunction() &&
shouldUseFunctionLiter... | private JSType getDeclaredType(String sourceName, JSDocInfo info,
Node lValue, @Nullable Node rValue) {
if (info != null && info.hasType()) {
return getDeclaredTypeInAnnotation(sourceName, lValue, info);
} else if (rValue != null && rValue.isFunction() &&
shouldUseFunctionLiter... |
Gson-10 | private ReflectiveTypeAdapterFactory.BoundField createBoundField(
final Gson context, final Field field, final String name,
final TypeToken<?> fieldType, boolean serialize, boolean deserialize) {
final boolean isPrimitive = Primitives.isPrimitive(fieldType.getRawType());
JsonAdapter annotation = f... | private ReflectiveTypeAdapterFactory.BoundField createBoundField(
final Gson context, final Field field, final String name,
final TypeToken<?> fieldType, boolean serialize, boolean deserialize) {
final boolean isPrimitive = Primitives.isPrimitive(fieldType.getRawType());
JsonAdapter annotation = f... |
JacksonDatabind-33 | public PropertyName findNameForSerialization(Annotated a)
{
String name = null;
JsonGetter jg = _findAnnotation(a, JsonGetter.class);
if (jg != null) {
name = jg.value();
} else {
JsonProperty pann = _findAnnotation(a, JsonProperty.class);
if (... | public PropertyName findNameForSerialization(Annotated a)
{
String name = null;
JsonGetter jg = _findAnnotation(a, JsonGetter.class);
if (jg != null) {
name = jg.value();
} else {
JsonProperty pann = _findAnnotation(a, JsonProperty.class);
if (... |
Closure-104 | JSType meet(JSType that) {
UnionTypeBuilder builder = new UnionTypeBuilder(registry);
for (JSType alternate : alternates) {
if (alternate.isSubtype(that)) {
builder.addAlternate(alternate);
}
}
if (that instanceof UnionType) {
for (JSType otherAlternate : ((UnionType) that).a... | JSType meet(JSType that) {
UnionTypeBuilder builder = new UnionTypeBuilder(registry);
for (JSType alternate : alternates) {
if (alternate.isSubtype(that)) {
builder.addAlternate(alternate);
}
}
if (that instanceof UnionType) {
for (JSType otherAlternate : ((UnionType) that).a... |
JacksonDatabind-42 | protected Object _deserializeFromEmptyString() throws IOException {
if (_kind == STD_URI) {
return URI.create("");
}
return super._deserializeFromEmptyString();
}
| protected Object _deserializeFromEmptyString() throws IOException {
if (_kind == STD_URI) {
return URI.create("");
}
if (_kind == STD_LOCALE) {
return Locale.ROOT;
}
return super._deserializeFromEmptyString();
}
|
Math-9 | public Line revert() {
final Line reverted = new Line(zero, zero.subtract(direction));
return reverted;
}
| public Line revert() {
final Line reverted = new Line(this);
reverted.direction = reverted.direction.negate();
return reverted;
}
|
JacksonDatabind-96 | protected void _addExplicitAnyCreator(DeserializationContext ctxt,
BeanDescription beanDesc, CreatorCollector creators,
CreatorCandidate candidate)
throws JsonMappingException
{
if (1 != candidate.paramCount()) {
int oneNotInjected = candidate.findOnlyParamWit... | protected void _addExplicitAnyCreator(DeserializationContext ctxt,
BeanDescription beanDesc, CreatorCollector creators,
CreatorCandidate candidate)
throws JsonMappingException
{
if (1 != candidate.paramCount()) {
int oneNotInjected = candidate.findOnlyParamWit... |
Cli-11 | private static void appendOption(final StringBuffer buff,
final Option option,
final boolean required)
{
if (!required)
{
buff.append("[");
}
if (option.getOpt() != null)
{
... | private static void appendOption(final StringBuffer buff,
final Option option,
final boolean required)
{
if (!required)
{
buff.append("[");
}
if (option.getOpt() != null)
{
... |
Closure-2 | private void checkInterfaceConflictProperties(NodeTraversal t, Node n,
String functionName, HashMap<String, ObjectType> properties,
HashMap<String, ObjectType> currentProperties,
ObjectType interfaceType) {
ObjectType implicitProto = interfaceType.getImplicitPrototype();
Set<String> currentP... | private void checkInterfaceConflictProperties(NodeTraversal t, Node n,
String functionName, HashMap<String, ObjectType> properties,
HashMap<String, ObjectType> currentProperties,
ObjectType interfaceType) {
ObjectType implicitProto = interfaceType.getImplicitPrototype();
Set<String> currentP... |
Math-21 | public RectangularCholeskyDecomposition(RealMatrix matrix, double small)
throws NonPositiveDefiniteMatrixException {
final int order = matrix.getRowDimension();
final double[][] c = matrix.getData();
final double[][] b = new double[order][order];
int[] swap = new int[order];... | public RectangularCholeskyDecomposition(RealMatrix matrix, double small)
throws NonPositiveDefiniteMatrixException {
final int order = matrix.getRowDimension();
final double[][] c = matrix.getData();
final double[][] b = new double[order][order];
int[] index = new int[order];... |
Jsoup-10 | public String absUrl(String attributeKey) {
Validate.notEmpty(attributeKey);
String relUrl = attr(attributeKey);
if (!hasAttr(attributeKey)) {
return "";
} else {
URL base;
try {
try {
base = new URL(baseUri);
... | public String absUrl(String attributeKey) {
Validate.notEmpty(attributeKey);
String relUrl = attr(attributeKey);
if (!hasAttr(attributeKey)) {
return "";
} else {
URL base;
try {
try {
base = new URL(baseUri);
... |
Math-101 | public Complex parse(String source, ParsePosition pos) {
int initialIndex = pos.getIndex();
parseAndIgnoreWhitespace(source, pos);
Number re = parseNumber(source, getRealFormat(), pos);
if (re == null) {
pos.setIndex(initialIndex);
return null;
}
... | public Complex parse(String source, ParsePosition pos) {
int initialIndex = pos.getIndex();
parseAndIgnoreWhitespace(source, pos);
Number re = parseNumber(source, getRealFormat(), pos);
if (re == null) {
pos.setIndex(initialIndex);
return null;
}
... |
Codec-10 | public String caverphone(String txt) {
if( txt == null || txt.length() == 0 ) {
return "1111111111";
}
txt = txt.toLowerCase(java.util.Locale.ENGLISH);
txt = txt.replaceAll("[^a-z]", "");
txt = txt.replaceAll("e$", "");
txt = txt.replaceAll("^... | public String caverphone(String txt) {
if( txt == null || txt.length() == 0 ) {
return "1111111111";
}
txt = txt.toLowerCase(java.util.Locale.ENGLISH);
txt = txt.replaceAll("[^a-z]", "");
txt = txt.replaceAll("e$", "");
txt = txt.replaceAll("^... |
Compress-30 | public int read(final byte[] dest, final int offs, final int len)
throws IOException {
if (offs < 0) {
throw new IndexOutOfBoundsException("offs(" + offs + ") < 0.");
}
if (len < 0) {
throw new IndexOutOfBoundsException("len(" + len + ") < 0.");
}
... | public int read(final byte[] dest, final int offs, final int len)
throws IOException {
if (offs < 0) {
throw new IndexOutOfBoundsException("offs(" + offs + ") < 0.");
}
if (len < 0) {
throw new IndexOutOfBoundsException("len(" + len + ") < 0.");
}
... |
Math-5 | public Complex reciprocal() {
if (isNaN) {
return NaN;
}
if (real == 0.0 && imaginary == 0.0) {
return NaN;
}
if (isInfinite) {
return ZERO;
}
if (FastMath.abs(real) < FastMath.abs(imaginary)) {
double q = real /... | public Complex reciprocal() {
if (isNaN) {
return NaN;
}
if (real == 0.0 && imaginary == 0.0) {
return INF;
}
if (isInfinite) {
return ZERO;
}
if (FastMath.abs(real) < FastMath.abs(imaginary)) {
double q = real /... |
Closure-55 | private static boolean isReduceableFunctionExpression(Node n) {
return NodeUtil.isFunctionExpression(n);
}
| private static boolean isReduceableFunctionExpression(Node n) {
return NodeUtil.isFunctionExpression(n)
&& !NodeUtil.isGetOrSetKey(n.getParent());
}
|
Closure-67 | private boolean isPrototypePropertyAssign(Node assign) {
Node n = assign.getFirstChild();
if (n != null && NodeUtil.isVarOrSimpleAssignLhs(n, assign)
&& n.getType() == Token.GETPROP
) {
boolean isChainedProperty =
n.getFirstChild().getType() == Token.GETPROP;
... | private boolean isPrototypePropertyAssign(Node assign) {
Node n = assign.getFirstChild();
if (n != null && NodeUtil.isVarOrSimpleAssignLhs(n, assign)
&& n.getType() == Token.GETPROP
&& assign.getParent().getType() == Token.EXPR_RESULT) {
boolean isChainedProperty =
... |
Closure-168 | @Override public void visit(NodeTraversal t, Node n, Node parent) {
if (t.inGlobalScope()) {
return;
}
if (n.isReturn() && n.getFirstChild() != null) {
data.get(t.getScopeRoot()).recordNonEmptyReturn();
}
if (t.getScopeDepth() <= 2) {
return;
}
if (n... | @Override public void visit(NodeTraversal t, Node n, Node parent) {
if (t.inGlobalScope()) {
return;
}
if (n.isReturn() && n.getFirstChild() != null) {
data.get(t.getScopeRoot()).recordNonEmptyReturn();
}
if (t.getScopeDepth() <= 1) {
return;
}
if (n... |
Closure-39 | String toStringHelper(boolean forAnnotations) {
if (hasReferenceName()) {
return getReferenceName();
} else if (prettyPrint) {
prettyPrint = false;
Set<String> propertyNames = Sets.newTreeSet();
for (ObjectType current = this;
current != null && !current.isNativeObjectType()... | String toStringHelper(boolean forAnnotations) {
if (hasReferenceName()) {
return getReferenceName();
} else if (prettyPrint) {
prettyPrint = false;
Set<String> propertyNames = Sets.newTreeSet();
for (ObjectType current = this;
current != null && !current.isNativeObjectType()... |
Lang-53 | private static void modify(Calendar val, int field, boolean round) {
if (val.get(Calendar.YEAR) > 280000000) {
throw new ArithmeticException("Calendar value too large for accurate calculations");
}
if (field == Calendar.MILLISECOND) {
return;
}
Date da... | private static void modify(Calendar val, int field, boolean round) {
if (val.get(Calendar.YEAR) > 280000000) {
throw new ArithmeticException("Calendar value too large for accurate calculations");
}
if (field == Calendar.MILLISECOND) {
return;
}
Date da... |
Csv-1 | public int read() throws IOException {
int current = super.read();
if (current == '\n') {
lineCounter++;
}
lastChar = current;
return lastChar;
}
| public int read() throws IOException {
int current = super.read();
if (current == '\r' || (current == '\n' && lastChar != '\r')) {
lineCounter++;
}
lastChar = current;
return lastChar;
}
|
JacksonDatabind-35 | private final Object _deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
{
if (p.canReadTypeId()) {
Object typeId = p.getTypeId();
if (typeId != null) {
return _deserializeWithNativeTypeId(p, ctxt, typeId);
}
}
if... | private final Object _deserialize(JsonParser p, DeserializationContext ctxt) throws IOException
{
if (p.canReadTypeId()) {
Object typeId = p.getTypeId();
if (typeId != null) {
return _deserializeWithNativeTypeId(p, ctxt, typeId);
}
}
Js... |
JacksonDatabind-64 | protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSerializer typeSer, TypeSerializer contentTypeSer,
AnnotatedMember am, boolean defaultUseStaticTyping)
throws JsonMappingExc... | protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSerializer typeSer, TypeSerializer contentTypeSer,
AnnotatedMember am, boolean defaultUseStaticTyping)
throws JsonMappingExc... |
Closure-15 | public boolean apply(Node n) {
if (n == null) {
return false;
}
if (n.isCall() && NodeUtil.functionCallHasSideEffects(n)) {
return true;
}
if (n.isNew() && NodeUtil.constructorCallHasSideEffects(n)) {
return true;
}
for (Node c ... | public boolean apply(Node n) {
if (n == null) {
return false;
}
if (n.isCall() && NodeUtil.functionCallHasSideEffects(n)) {
return true;
}
if (n.isNew() && NodeUtil.constructorCallHasSideEffects(n)) {
return true;
}
if (n.isDelP... |
Math-75 | public double getPct(Object v) {
return getCumPct((Comparable<?>) v);
}
| public double getPct(Object v) {
return getPct((Comparable<?>) v);
}
|
Jsoup-33 | Element insert(Token.StartTag startTag) {
if (startTag.isSelfClosing()) {
Element el = insertEmpty(startTag);
stack.add(el);
tokeniser.emit(new Token.EndTag(el.tagName()));
return el;
}
Element el = new Element(Tag.valueOf(startTag.name()), b... | Element insert(Token.StartTag startTag) {
if (startTag.isSelfClosing()) {
Element el = insertEmpty(startTag);
stack.add(el);
tokeniser.transition(TokeniserState.Data);
tokeniser.emit(new Token.EndTag(el.tagName()));
return el;
}
... |
Mockito-24 | public Object answer(InvocationOnMock invocation) {
if (methodsGuru.isToString(invocation.getMethod())) {
Object mock = invocation.getMock();
MockName name = mockUtil.getMockName(mock);
if (name.isDefault()) {
return "Mock for " + mockUtil.getMockSettings(... | public Object answer(InvocationOnMock invocation) {
if (methodsGuru.isToString(invocation.getMethod())) {
Object mock = invocation.getMock();
MockName name = mockUtil.getMockName(mock);
if (name.isDefault()) {
return "Mock for " + mockUtil.getMockSettings(... |
JacksonDatabind-11 | protected JavaType _fromVariable(TypeVariable<?> type, TypeBindings context)
{
final String name = type.getName();
if (context == null) {
return _unknownType();
} else {
JavaType actualType = context.findType(name);
if (actualType != null) {
... | protected JavaType _fromVariable(TypeVariable<?> type, TypeBindings context)
{
final String name = type.getName();
if (context == null) {
context = new TypeBindings(this, (Class<?>) null);
} else {
JavaType actualType = context.findType(name, false);
i... |
Closure-94 | static boolean isValidDefineValue(Node val, Set<String> defines) {
switch (val.getType()) {
case Token.STRING:
case Token.NUMBER:
case Token.TRUE:
case Token.FALSE:
return true;
case Token.BITAND:
case Token.BITNOT:
case Token.BITOR:
case Token.BITXOR:
... | static boolean isValidDefineValue(Node val, Set<String> defines) {
switch (val.getType()) {
case Token.STRING:
case Token.NUMBER:
case Token.TRUE:
case Token.FALSE:
return true;
case Token.ADD:
case Token.BITAND:
case Token.BITNOT:
case Token.BITOR:
ca... |
Jsoup-20 | static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) {
String docData;
Document doc = null;
if (charsetName == null) {
docData = Charset.forName(defaultCharset).decode(byteData).toString();
doc = parser.parseInput(docD... | static Document parseByteData(ByteBuffer byteData, String charsetName, String baseUri, Parser parser) {
String docData;
Document doc = null;
if (charsetName == null) {
docData = Charset.forName(defaultCharset).decode(byteData).toString();
doc = parser.parseInput(docD... |
Cli-9 | protected void checkRequiredOptions()
throws MissingOptionException
{
if (getRequiredOptions().size() > 0)
{
Iterator iter = getRequiredOptions().iterator();
StringBuffer buff = new StringBuffer("Missing required option");
buff.append(getRequiredOption... | protected void checkRequiredOptions()
throws MissingOptionException
{
if (getRequiredOptions().size() > 0)
{
Iterator iter = getRequiredOptions().iterator();
StringBuffer buff = new StringBuffer("Missing required option");
buff.append(getRequiredOption... |
Time-25 | public int getOffsetFromLocal(long instantLocal) {
final int offsetLocal = getOffset(instantLocal);
final long instantAdjusted = instantLocal - offsetLocal;
final int offsetAdjusted = getOffset(instantAdjusted);
if (offsetLocal != offsetAdjusted) {
if ((offsetLocal - offs... | public int getOffsetFromLocal(long instantLocal) {
final int offsetLocal = getOffset(instantLocal);
final long instantAdjusted = instantLocal - offsetLocal;
final int offsetAdjusted = getOffset(instantAdjusted);
if (offsetLocal != offsetAdjusted) {
if ((offsetLocal - offs... |
Math-25 | private void guessAOmega() {
double sx2 = 0;
double sy2 = 0;
double sxy = 0;
double sxz = 0;
double syz = 0;
double currentX = observations[0].getX();
double currentY = observations[0].getY();
double f2Integral = 0;
... | private void guessAOmega() {
double sx2 = 0;
double sy2 = 0;
double sxy = 0;
double sxz = 0;
double syz = 0;
double currentX = observations[0].getX();
double currentY = observations[0].getY();
double f2Integral = 0;
... |
Mockito-27 | public <T> void resetMock(T mock) {
MockHandlerInterface<T> oldMockHandler = getMockHandler(mock);
MockHandler<T> newMockHandler = new MockHandler<T>(oldMockHandler);
MethodInterceptorFilter newFilter = new MethodInterceptorFilter(newMockHandler, (MockSettingsImpl) org.mockito.Mockito.withSe... | public <T> void resetMock(T mock) {
MockHandlerInterface<T> oldMockHandler = getMockHandler(mock);
MethodInterceptorFilter newFilter = newMethodInterceptorFilter(oldMockHandler.getMockSettings());
((Factory) mock).setCallback(0, newFilter);
}
|
JacksonDatabind-7 | public TokenBuffer deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException
{
copyCurrentStructure(jp);
return this;
}
| public TokenBuffer deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException
{
if (jp.getCurrentTokenId() != JsonToken.FIELD_NAME.id()) {
copyCurrentStructure(jp);
return this;
}
JsonToken t;
writeStartObject();
do {
co... |
Jsoup-57 | public void removeIgnoreCase(String key) {
Validate.notEmpty(key);
if (attributes == null)
return;
for (Iterator<String> it = attributes.keySet().iterator(); it.hasNext(); ) {
String attrKey = it.next();
if (attrKey.equalsIgnoreCase(key))
a... | public void removeIgnoreCase(String key) {
Validate.notEmpty(key);
if (attributes == null)
return;
for (Iterator<String> it = attributes.keySet().iterator(); it.hasNext(); ) {
String attrKey = it.next();
if (attrKey.equalsIgnoreCase(key))
i... |
Lang-27 | public static Number createNumber(String str) throws NumberFormatException {
if (str == null) {
return null;
}
if (StringUtils.isBlank(str)) {
throw new NumberFormatException("A blank string is not a valid number");
}
if (str.startsWith("--")) {
... | public static Number createNumber(String str) throws NumberFormatException {
if (str == null) {
return null;
}
if (StringUtils.isBlank(str)) {
throw new NumberFormatException("A blank string is not a valid number");
}
if (str.startsWith("--")) {
... |
Lang-22 | private static int greatestCommonDivisor(int u, int v) {
if (Math.abs(u) <= 1 || Math.abs(v) <= 1) {
return 1;
}
if (u>0) { u=-u; }
if (v>0) { v=-v; }
int k=0;
while ((u&1)==0 && (v&1)==0 && k<31) {
u/=2; v/=2; k++;
}
if (k=... | private static int greatestCommonDivisor(int u, int v) {
if ((u == 0) || (v == 0)) {
if ((u == Integer.MIN_VALUE) || (v == Integer.MIN_VALUE)) {
throw new ArithmeticException("overflow: gcd is 2^31");
}
return Math.abs(u) + Math.abs(v);
}
i... |
Cli-5 | static String stripLeadingHyphens(String str)
{
if (str.startsWith("--"))
{
return str.substring(2, str.length());
}
else if (str.startsWith("-"))
{
return str.substring(1, str.length());
}
return str;
}
| static String stripLeadingHyphens(String str)
{
if (str == null) {
return null;
}
if (str.startsWith("--"))
{
return str.substring(2, str.length());
}
else if (str.startsWith("-"))
{
return str.substring(1, str.length())... |
Codec-6 | public int read(byte b[], int offset, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if (offset < 0 || len < 0) {
throw new IndexOutOfBoundsException();
} else if (offset > b.length || offset + len > b.length) {
thr... | public int read(byte b[], int offset, int len) throws IOException {
if (b == null) {
throw new NullPointerException();
} else if (offset < 0 || len < 0) {
throw new IndexOutOfBoundsException();
} else if (offset > b.length || offset + len > b.length) {
thr... |
Math-50 | 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... |
Math-39 | public void integrate(final ExpandableStatefulODE equations, final double t)
throws MathIllegalStateException, MathIllegalArgumentException {
sanityChecks(equations, t);
setEquations(equations);
final boolean forward = t > equations.getTime();
final double[] y0 = equations.getCompleteState();
... | public void integrate(final ExpandableStatefulODE equations, final double t)
throws MathIllegalStateException, MathIllegalArgumentException {
sanityChecks(equations, t);
setEquations(equations);
final boolean forward = t > equations.getTime();
final double[] y0 = equations.getCompleteState();
... |
JacksonDatabind-5 | protected void _addMethodMixIns(Class<?> targetClass, AnnotatedMethodMap methods,
Class<?> mixInCls, AnnotatedMethodMap mixIns)
{
List<Class<?>> parents = new ArrayList<Class<?>>();
parents.add(mixInCls);
ClassUtil.findSuperTypes(mixInCls, targetClass, parents);
for (... | protected void _addMethodMixIns(Class<?> targetClass, AnnotatedMethodMap methods,
Class<?> mixInCls, AnnotatedMethodMap mixIns)
{
List<Class<?>> parents = new ArrayList<Class<?>>();
parents.add(mixInCls);
ClassUtil.findSuperTypes(mixInCls, targetClass, parents);
for (... |
Closure-69 | private void visitCall(NodeTraversal t, Node n) {
Node child = n.getFirstChild();
JSType childType = getJSType(child).restrictByNotNullOrUndefined();
if (!childType.canBeCalled()) {
report(t, n, NOT_CALLABLE, childType.toString());
ensureTyped(t, n);
return;
}
if (childType insta... | private void visitCall(NodeTraversal t, Node n) {
Node child = n.getFirstChild();
JSType childType = getJSType(child).restrictByNotNullOrUndefined();
if (!childType.canBeCalled()) {
report(t, n, NOT_CALLABLE, childType.toString());
ensureTyped(t, n);
return;
}
if (childType insta... |
Jsoup-27 | static String getCharsetFromContentType(String contentType) {
if (contentType == null) return null;
Matcher m = charsetPattern.matcher(contentType);
if (m.find()) {
String charset = m.group(1).trim();
charset = charset.toUpperCase(Locale.ENGLISH);
return c... | static String getCharsetFromContentType(String contentType) {
if (contentType == null) return null;
Matcher m = charsetPattern.matcher(contentType);
if (m.find()) {
String charset = m.group(1).trim();
if (Charset.isSupported(charset)) return charset;
chars... |
Gson-6 | static TypeAdapter<?> getTypeAdapter(ConstructorConstructor constructorConstructor, Gson gson,
TypeToken<?> fieldType, JsonAdapter annotation) {
Class<?> value = annotation.value();
TypeAdapter<?> typeAdapter;
if (TypeAdapter.class.isAssignableFrom(value)) {
Class<TypeAdapter<?>> typeAdapterCl... | static TypeAdapter<?> getTypeAdapter(ConstructorConstructor constructorConstructor, Gson gson,
TypeToken<?> fieldType, JsonAdapter annotation) {
Class<?> value = annotation.value();
TypeAdapter<?> typeAdapter;
if (TypeAdapter.class.isAssignableFrom(value)) {
Class<TypeAdapter<?>> typeAdapterCl... |
Lang-38 | public StringBuffer format(Calendar calendar, StringBuffer buf) {
if (mTimeZoneForced) {
calendar = (Calendar) calendar.clone();
calendar.setTimeZone(mTimeZone);
}
return applyRules(calendar, buf);
}
| public StringBuffer format(Calendar calendar, StringBuffer buf) {
if (mTimeZoneForced) {
calendar.getTime();
calendar = (Calendar) calendar.clone();
calendar.setTimeZone(mTimeZone);
}
return applyRules(calendar, buf);
}
|
Mockito-38 | private boolean toStringEquals(Matcher m, Object arg) {
return StringDescription.toString(m).equals(arg.toString());
}
| private boolean toStringEquals(Matcher m, Object arg) {
return StringDescription.toString(m).equals(arg == null? "null" : arg.toString());
}
|
JacksonXml-4 | protected void _serializeXmlNull(JsonGenerator jgen) throws IOException
{
if (jgen instanceof ToXmlGenerator) {
_initWithRootName((ToXmlGenerator) jgen, ROOT_NAME_FOR_NULL);
}
super.serializeValue(jgen, null);
}
| protected void _serializeXmlNull(JsonGenerator jgen) throws IOException
{
QName rootName = _rootNameFromConfig();
if (rootName == null) {
rootName = ROOT_NAME_FOR_NULL;
}
if (jgen instanceof ToXmlGenerator) {
_initWithRootName((ToXmlGenerator) jgen, rootNa... |
JacksonDatabind-67 | public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt,
JavaType type)
throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
KeyDeserializer deser = null;
if (_factoryConfig.hasKeyDeserializers()) {
BeanDesc... | public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt,
JavaType type)
throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
KeyDeserializer deser = null;
if (_factoryConfig.hasKeyDeserializers()) {
BeanDesc... |
Closure-13 | private void traverse(Node node) {
if (!shouldVisit(node)) {
return;
}
int visits = 0;
do {
Node c = node.getFirstChild();
while(c != null) {
traverse(c);
Node next = c.getNext();
c = next;
}
visit(node);
visits++;
Preconditions.checkSt... | private void traverse(Node node) {
if (!shouldVisit(node)) {
return;
}
int visits = 0;
do {
Node c = node.getFirstChild();
while(c != null) {
Node next = c.getNext();
traverse(c);
c = next;
}
visit(node);
visits++;
Preconditions.checkSt... |
Csv-5 | public void println() throws IOException {
final String recordSeparator = format.getRecordSeparator();
out.append(recordSeparator);
newRecord = true;
}
| public void println() throws IOException {
final String recordSeparator = format.getRecordSeparator();
if (recordSeparator != null) {
out.append(recordSeparator);
}
newRecord = true;
}
|
Csv-6 | <M extends Map<String, String>> M putIn(final M map) {
for (final Entry<String, Integer> entry : mapping.entrySet()) {
final int col = entry.getValue().intValue();
map.put(entry.getKey(), values[col]);
}
return map;
}
| <M extends Map<String, String>> M putIn(final M map) {
for (final Entry<String, Integer> entry : mapping.entrySet()) {
final int col = entry.getValue().intValue();
if (col < values.length) {
map.put(entry.getKey(), values[col]);
}
}
return ... |
Chart-1 | public LegendItemCollection getLegendItems() {
LegendItemCollection result = new LegendItemCollection();
if (this.plot == null) {
return result;
}
int index = this.plot.getIndexOf(this);
CategoryDataset dataset = this.plot.getDataset(index);
if (dataset !=... | public LegendItemCollection getLegendItems() {
LegendItemCollection result = new LegendItemCollection();
if (this.plot == null) {
return result;
}
int index = this.plot.getIndexOf(this);
CategoryDataset dataset = this.plot.getDataset(index);
if (dataset ==... |
Math-97 | public double solve(double min, double max) throws MaxIterationsExceededException,
FunctionEvaluationException {
clearResult();
verifyInterval(min, max);
double ret = Double.NaN;
double yMin = f.value(min);
double yMax = f.value(max);
double sign = yMin * yMa... | public double solve(double min, double max) throws MaxIterationsExceededException,
FunctionEvaluationException {
clearResult();
verifyInterval(min, max);
double ret = Double.NaN;
double yMin = f.value(min);
double yMax = f.value(max);
double sign = yMin * yMa... |
Math-10 | public void atan2(final double[] y, final int yOffset,
final double[] x, final int xOffset,
final double[] result, final int resultOffset) {
double[] tmp1 = new double[getSize()];
multiply(x, xOffset, x, xOffset, tmp1, 0);
double[] tmp2 = new... | public void atan2(final double[] y, final int yOffset,
final double[] x, final int xOffset,
final double[] result, final int resultOffset) {
double[] tmp1 = new double[getSize()];
multiply(x, xOffset, x, xOffset, tmp1, 0);
double[] tmp2 = new... |
Cli-14 | public void validate(final WriteableCommandLine commandLine)
throws OptionException {
int present = 0;
Option unexpected = null;
for (final Iterator i = options.iterator(); i.hasNext();) {
final Option option = (Option) i.next();
boolean validate = option.isRe... | public void validate(final WriteableCommandLine commandLine)
throws OptionException {
int present = 0;
Option unexpected = null;
for (final Iterator i = options.iterator(); i.hasNext();) {
final Option option = (Option) i.next();
boolean validate = option.isRe... |
JxPath-21 | public int getLength() {
return ValueUtils.getLength(getBaseValue());
}
| public int getLength() {
Object baseValue = getBaseValue();
return baseValue == null ? 1 : ValueUtils.getLength(baseValue);
}
|
Jsoup-72 | private static String cacheString(final char[] charBuf, final String[] stringCache, final int start, final int count) {
if (count > maxStringCacheLen)
return new String(charBuf, start, count);
int hash = 0;
int offset = start;
for (int i = 0; i < count; i++) {
... | private static String cacheString(final char[] charBuf, final String[] stringCache, final int start, final int count) {
if (count > maxStringCacheLen)
return new String(charBuf, start, count);
if (count < 1)
return "";
int hash = 0;
int offset = start;
... |
Closure-48 | void maybeDeclareQualifiedName(NodeTraversal t, JSDocInfo info,
Node n, Node parent, Node rhsValue) {
Node ownerNode = n.getFirstChild();
String ownerName = ownerNode.getQualifiedName();
String qName = n.getQualifiedName();
String propName = n.getLastChild().getString();
Precon... | void maybeDeclareQualifiedName(NodeTraversal t, JSDocInfo info,
Node n, Node parent, Node rhsValue) {
Node ownerNode = n.getFirstChild();
String ownerName = ownerNode.getQualifiedName();
String qName = n.getQualifiedName();
String propName = n.getLastChild().getString();
Precon... |
JacksonDatabind-54 | protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSerializer typeSer, TypeSerializer contentTypeSer,
AnnotatedMember am, boolean defaultUseStaticTyping)
throws JsonMappingExc... | protected BeanPropertyWriter buildWriter(SerializerProvider prov,
BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser,
TypeSerializer typeSer, TypeSerializer contentTypeSer,
AnnotatedMember am, boolean defaultUseStaticTyping)
throws JsonMappingExc... |
Lang-9 | private void init() {
thisYear= Calendar.getInstance(timeZone, locale).get(Calendar.YEAR);
nameValues= new ConcurrentHashMap<Integer, KeyValue[]>();
StringBuilder regex= new StringBuilder();
List<Strategy> collector = new ArrayList<Strategy>();
Matcher patternMatcher= formatP... | private void init() {
thisYear= Calendar.getInstance(timeZone, locale).get(Calendar.YEAR);
nameValues= new ConcurrentHashMap<Integer, KeyValue[]>();
StringBuilder regex= new StringBuilder();
List<Strategy> collector = new ArrayList<Strategy>();
Matcher patternMatcher= formatP... |
Lang-54 | public static Locale toLocale(String str) {
if (str == null) {
return null;
}
int len = str.length();
if (len != 2 && len != 5 && len < 7) {
throw new IllegalArgumentException("Invalid locale format: " + str);
}
char ch0 = str.charAt(0);
... | public static Locale toLocale(String str) {
if (str == null) {
return null;
}
int len = str.length();
if (len != 2 && len != 5 && len < 7) {
throw new IllegalArgumentException("Invalid locale format: " + str);
}
char ch0 = str.charAt(0);
... |
JacksonDatabind-9 | public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
String str;
if (value instanceof Date) {
provider.defaultSerializeDateKey((Date) value, jgen);
return;
} else {
str = value.toString();
}
... | public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
String str;
Class<?> cls = value.getClass();
if (cls == String.class) {
str = (String) value;
} else if (Date.class.isAssignableFrom(cls)) {
provider.defa... |
Closure-107 | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
if (flags.processJqueryPrimitives) {
options.setCodingConvention(new JqueryCodingConvention());
} else {
options.setCodingConvention(new ClosureCodingConvention());
}
options.setExtraAnnotation... | protected CompilerOptions createOptions() {
CompilerOptions options = new CompilerOptions();
if (flags.processJqueryPrimitives) {
options.setCodingConvention(new JqueryCodingConvention());
} else {
options.setCodingConvention(new ClosureCodingConvention());
}
options.setExtraAnnotation... |
Closure-1 | private void removeUnreferencedFunctionArgs(Scope fnScope) {
Node function = fnScope.getRootNode();
Preconditions.checkState(function.isFunction());
if (NodeUtil.isGetOrSetKey(function.getParent())) {
return;
}
Node argList = getFunctionArgList(function);
boolean modifyCallers = modifyCa... | private void removeUnreferencedFunctionArgs(Scope fnScope) {
if (!removeGlobals) {
return;
}
Node function = fnScope.getRootNode();
Preconditions.checkState(function.isFunction());
if (NodeUtil.isGetOrSetKey(function.getParent())) {
return;
}
Node argList = getFunctionArgList(f... |
Closure-120 | boolean isAssignedOnceInLifetime() {
Reference ref = getOneAndOnlyAssignment();
if (ref == null) {
return false;
}
for (BasicBlock block = ref.getBasicBlock();
block != null; block = block.getParent()) {
if (block.isFunction) {
break;
} else if (b... | boolean isAssignedOnceInLifetime() {
Reference ref = getOneAndOnlyAssignment();
if (ref == null) {
return false;
}
for (BasicBlock block = ref.getBasicBlock();
block != null; block = block.getParent()) {
if (block.isFunction) {
if (ref.getSymbol().getScop... |
Compress-28 | public int read(byte[] buf, int offset, int numToRead) throws IOException {
int totalRead = 0;
if (hasHitEOF || entryOffset >= entrySize) {
return -1;
}
if (currEntry == null) {
throw new IllegalStateException("No current tar entry");
}
numToRead ... | public int read(byte[] buf, int offset, int numToRead) throws IOException {
int totalRead = 0;
if (hasHitEOF || entryOffset >= entrySize) {
return -1;
}
if (currEntry == null) {
throw new IllegalStateException("No current tar entry");
}
numToRead ... |
Math-102 | public double chiSquare(double[] expected, long[] observed)
throws IllegalArgumentException {
if ((expected.length < 2) || (expected.length != observed.length)) {
throw new IllegalArgumentException(
"observed, expected array lengths incorrect");
}
if (... | public double chiSquare(double[] expected, long[] observed)
throws IllegalArgumentException {
if ((expected.length < 2) || (expected.length != observed.length)) {
throw new IllegalArgumentException(
"observed, expected array lengths incorrect");
}
if (... |
Closure-82 | public final boolean isEmptyType() {
return isNoType() || isNoObjectType() || isNoResolvedType();
}
| public final boolean isEmptyType() {
return isNoType() || isNoObjectType() || isNoResolvedType() ||
(registry.getNativeFunctionType(
JSTypeNative.LEAST_FUNCTION_TYPE) == this);
}
|
Lang-42 | public void escape(Writer writer, String str) throws IOException {
int len = str.length();
for (int i = 0; i < len; i++) {
char c = str.charAt(i);
String entityName = this.entityName(c);
if (entityName == null) {
if (c > 0x7F) {
... | public void escape(Writer writer, String str) throws IOException {
int len = str.length();
for (int i = 0; i < len; i++) {
int c = Character.codePointAt(str, i);
String entityName = this.entityName(c);
if (entityName == null) {
if (c >= 0x010000 &... |
Lang-61 | public int indexOf(String str, int startIndex) {
startIndex = (startIndex < 0 ? 0 : startIndex);
if (str == null || startIndex >= size) {
return -1;
}
int strLen = str.length();
if (strLen == 1) {
return indexOf(str.charAt(0), startIndex);
}
... | public int indexOf(String str, int startIndex) {
startIndex = (startIndex < 0 ? 0 : startIndex);
if (str == null || startIndex >= size) {
return -1;
}
int strLen = str.length();
if (strLen == 1) {
return indexOf(str.charAt(0), startIndex);
}
... |
Closure-33 | public void matchConstraint(ObjectType constraintObj) {
if (constraintObj.isRecordType()) {
for (String prop : constraintObj.getOwnPropertyNames()) {
JSType propType = constraintObj.getPropertyType(prop);
if (!isPropertyTypeDeclared(prop)) {
JSType typeToInfer = propType;
... | public void matchConstraint(ObjectType constraintObj) {
if (hasReferenceName()) {
return;
}
if (constraintObj.isRecordType()) {
for (String prop : constraintObj.getOwnPropertyNames()) {
JSType propType = constraintObj.getPropertyType(prop);
if (!isPropertyTypeDeclared(prop)) {
... |
JacksonDatabind-102 | public JsonSerializer<?> createContextual(SerializerProvider serializers,
BeanProperty property) throws JsonMappingException
{
if (property == null) {
return this;
}
JsonFormat.Value format = findFormatOverrides(serializers, property, handledType());
if (f... | public JsonSerializer<?> createContextual(SerializerProvider serializers,
BeanProperty property) throws JsonMappingException
{
JsonFormat.Value format = findFormatOverrides(serializers, property, handledType());
if (format == null) {
return this;
}
JsonFor... |
Compress-36 | private InputStream getCurrentStream() throws IOException {
if (deferredBlockStreams.isEmpty()) {
throw new IllegalStateException("No current 7z entry (call getNextEntry() first).");
}
while (deferredBlockStreams.size() > 1) {
final InputStream stream = deferredBlockS... | private InputStream getCurrentStream() throws IOException {
if (archive.files[currentEntryIndex].getSize() == 0) {
return new ByteArrayInputStream(new byte[0]);
}
if (deferredBlockStreams.isEmpty()) {
throw new IllegalStateException("No current 7z entry (call getNextE... |
Chart-3 | public TimeSeries createCopy(int start, int end)
throws CloneNotSupportedException {
if (start < 0) {
throw new IllegalArgumentException("Requires start >= 0.");
}
if (end < start) {
throw new IllegalArgumentException("Requires start <= end.");
}
... | public TimeSeries createCopy(int start, int end)
throws CloneNotSupportedException {
if (start < 0) {
throw new IllegalArgumentException("Requires start >= 0.");
}
if (end < start) {
throw new IllegalArgumentException("Requires start <= end.");
}
... |
Cli-37 | private boolean isShortOption(String token)
{
return token.startsWith("-") && token.length() >= 2 && options.hasShortOption(token.substring(1, 2));
}
| private boolean isShortOption(String token)
{
if (!token.startsWith("-") || token.length() == 1)
{
return false;
}
int pos = token.indexOf("=");
String optName = pos == -1 ? token.substring(1) : token.substring(1, pos);
return options.hasShortOption(op... |
Math-44 | protected double acceptStep(final AbstractStepInterpolator interpolator,
final double[] y, final double[] yDot, final double tEnd)
throws MathIllegalStateException {
double previousT = interpolator.getGlobalPreviousTime();
final double currentT = inter... | protected double acceptStep(final AbstractStepInterpolator interpolator,
final double[] y, final double[] yDot, final double tEnd)
throws MathIllegalStateException {
double previousT = interpolator.getGlobalPreviousTime();
final double currentT = inter... |
Csv-9 | <M extends Map<String, String>> M putIn(final M map) {
for (final Entry<String, Integer> entry : mapping.entrySet()) {
final int col = entry.getValue().intValue();
if (col < values.length) {
map.put(entry.getKey(), values[col]);
}
}
return ... | <M extends Map<String, String>> M putIn(final M map) {
if (mapping == null) {
return map;
}
for (final Entry<String, Integer> entry : mapping.entrySet()) {
final int col = entry.getValue().intValue();
if (col < values.length) {
map.put(entr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.