bug_id stringlengths 5 19 | func_before stringlengths 49 25.9k ⌀ | func_after stringlengths 45 26k |
|---|---|---|
Compress-35 | public static boolean verifyCheckSum(byte[] header) {
long storedSum = 0;
long unsignedSum = 0;
long signedSum = 0;
int digits = 0;
for (int i = 0; i < header.length; i++) {
byte b = header[i];
if (CHKSUM_OFFSET <= i && i < CHKSUM_OFFSET + CHKSUMLEN) ... | public static boolean verifyCheckSum(byte[] header) {
long storedSum = parseOctal(header, CHKSUM_OFFSET, CHKSUMLEN);
long unsignedSum = 0;
long signedSum = 0;
int digits = 0;
for (int i = 0; i < header.length; i++) {
byte b = header[i];
if (CHKSUM_OFFS... |
JacksonCore-21 | public JsonToken nextToken() throws IOException
{
if (!_allowMultipleMatches && (_currToken != null) && (_exposedContext == null)) {
if (_currToken.isStructEnd()) {
if (_headContext.isStartHandled()) {
return (_currToken = null);
... | public JsonToken nextToken() throws IOException
{
if (!_allowMultipleMatches && (_currToken != null) && (_exposedContext == null)) {
if (!_includePath) {
if (_currToken.isStructEnd()) {
if (_headContext.isStartHandled()) {
return (_... |
Lang-5 | public static Locale toLocale(final String str) {
if (str == null) {
return null;
}
final int len = str.length();
if (len < 2) {
throw new IllegalArgumentException("Invalid locale format: " + str);
}
final char ch0 = str.charAt(0);
... | public static Locale toLocale(final String str) {
if (str == null) {
return null;
}
final int len = str.length();
if (len < 2) {
throw new IllegalArgumentException("Invalid locale format: " + str);
}
final char ch0 = str.charAt(0);
if (... |
Codec-17 | public static String newStringIso8859_1(final byte[] bytes) {
return new String(bytes, Charsets.ISO_8859_1);
}
| public static String newStringIso8859_1(final byte[] bytes) {
return newString(bytes, Charsets.ISO_8859_1);
}
|
Compress-12 | public TarArchiveEntry getNextTarEntry() throws IOException {
if (hasHitEOF) {
return null;
}
if (currEntry != null) {
long numToSkip = entrySize - entryOffset;
while (numToSkip > 0) {
long skipped = skip(numToSkip);
if (ski... | public TarArchiveEntry getNextTarEntry() throws IOException {
if (hasHitEOF) {
return null;
}
if (currEntry != null) {
long numToSkip = entrySize - entryOffset;
while (numToSkip > 0) {
long skipped = skip(numToSkip);
if (ski... |
Lang-31 | public static boolean containsAny(CharSequence cs, char[] searchChars) {
if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) {
return false;
}
int csLength = cs.length();
int searchLength = searchChars.length;
for (int i = 0; i < csLength; i++) {
char ch = cs.charAt(i);
for (int j = 0; j < searchLen... | public static boolean containsAny(CharSequence cs, char[] searchChars) {
if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) {
return false;
}
int csLength = cs.length();
int searchLength = searchChars.length;
int csLastIndex = csLength - 1;
int searchLastIndex = searchLength - 1;
for (int i = 0; i < ... |
Closure-116 | 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())... | private CanInlineResult canInlineReferenceDirectly(
Node callNode, Node fnNode) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
Node block = fnNode.getLastChild();
boolean hasSideEffects = false;
if (block.hasChildren()) {
Preconditions.checkS... |
Mockito-18 | Object returnValueFor(Class<?> type) {
if (Primitives.isPrimitiveOrWrapper(type)) {
return Primitives.defaultValueForPrimitiveOrWrapper(type);
} else if (type == Collection.class) {
return new LinkedList<Object>();
} else if (type == Set.class) {
return ne... | Object returnValueFor(Class<?> type) {
if (Primitives.isPrimitiveOrWrapper(type)) {
return Primitives.defaultValueForPrimitiveOrWrapper(type);
} else if (type == Iterable.class) {
return new ArrayList<Object>(0);
} else if (type == Collection.class) {
retu... |
Time-7 | 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... |
Closure-18 | Node parseInputs() {
boolean devMode = options.devMode != DevMode.OFF;
if (externsRoot != null) {
externsRoot.detachChildren();
}
if (jsRoot != null) {
jsRoot.detachChildren();
}
jsRoot = IR.block();
jsRoot.setIsSyntheticBlock(true);
externsRoot = IR.block();
externsRoo... | Node parseInputs() {
boolean devMode = options.devMode != DevMode.OFF;
if (externsRoot != null) {
externsRoot.detachChildren();
}
if (jsRoot != null) {
jsRoot.detachChildren();
}
jsRoot = IR.block();
jsRoot.setIsSyntheticBlock(true);
externsRoot = IR.block();
externsRoo... |
JacksonDatabind-17 | public boolean useForType(JavaType t)
{
switch (_appliesFor) {
case NON_CONCRETE_AND_ARRAYS:
while (t.isArrayType()) {
t = t.getContentType();
}
case OBJECT_AND_NON_CONCRETE:
return (t.getRawClass() =... | public boolean useForType(JavaType t)
{
switch (_appliesFor) {
case NON_CONCRETE_AND_ARRAYS:
while (t.isArrayType()) {
t = t.getContentType();
}
case OBJECT_AND_NON_CONCRETE:
return (t.getRawClass() =... |
Math-52 | public Rotation(Vector3D u1, Vector3D u2, Vector3D v1, Vector3D v2) {
double u1u1 = u1.getNormSq();
double u2u2 = u2.getNormSq();
double v1v1 = v1.getNormSq();
double v2v2 = v2.getNormSq();
if ((u1u1 == 0) || (u2u2 == 0) || (v1v1 == 0) || (v2v2 == 0)) {
throw MathRuntimeException.createIllegalArgumentEx... | public Rotation(Vector3D u1, Vector3D u2, Vector3D v1, Vector3D v2) {
double u1u1 = u1.getNormSq();
double u2u2 = u2.getNormSq();
double v1v1 = v1.getNormSq();
double v2v2 = v2.getNormSq();
if ((u1u1 == 0) || (u2u2 == 0) || (v1v1 == 0) || (v2v2 == 0)) {
throw MathRuntimeException.createIllegalArgumentEx... |
Chart-8 | public Week(Date time, TimeZone zone) {
this(time, RegularTimePeriod.DEFAULT_TIME_ZONE, Locale.getDefault());
}
| public Week(Date time, TimeZone zone) {
this(time, zone, Locale.getDefault());
}
|
Chart-11 | public static boolean equal(GeneralPath p1, GeneralPath p2) {
if (p1 == null) {
return (p2 == null);
}
if (p2 == null) {
return false;
}
if (p1.getWindingRule() != p2.getWindingRule()) {
return false;
}
PathIterator iterator... | public static boolean equal(GeneralPath p1, GeneralPath p2) {
if (p1 == null) {
return (p2 == null);
}
if (p2 == null) {
return false;
}
if (p1.getWindingRule() != p2.getWindingRule()) {
return false;
}
PathIterator iterator... |
Closure-10 | static boolean mayBeString(Node n, boolean recurse) {
if (recurse) {
return allResultsMatch(n, MAY_BE_STRING_PREDICATE);
} else {
return mayBeStringHelper(n);
}
}
| static boolean mayBeString(Node n, boolean recurse) {
if (recurse) {
return anyResultsMatch(n, MAY_BE_STRING_PREDICATE);
} else {
return mayBeStringHelper(n);
}
}
|
Jsoup-40 | public DocumentType(String name, String publicId, String systemId, String baseUri) {
super(baseUri);
Validate.notEmpty(name);
attr("name", name);
attr("publicId", publicId);
attr("systemId", systemId);
}
| public DocumentType(String name, String publicId, String systemId, String baseUri) {
super(baseUri);
attr("name", name);
attr("publicId", publicId);
attr("systemId", systemId);
}
|
Time-24 | public long computeMillis(boolean resetFields, String text) {
SavedField[] savedFields = iSavedFields;
int count = iSavedFieldsCount;
if (iSavedFieldsShared) {
iSavedFields = savedFields = (SavedField[])iSavedFields.clone();
iSavedFieldsShared = false;
}
... | public long computeMillis(boolean resetFields, String text) {
SavedField[] savedFields = iSavedFields;
int count = iSavedFieldsCount;
if (iSavedFieldsShared) {
iSavedFields = savedFields = (SavedField[])iSavedFields.clone();
iSavedFieldsShared = false;
}
... |
Cli-26 | public static Option create(String opt) throws IllegalArgumentException
{
Option option = new Option(opt, description);
option.setLongOpt(longopt);
option.setRequired(required);
option.setOptionalArg(optionalArg);
option.setArgs(numberOfArgs);
... | public static Option create(String opt) throws IllegalArgumentException
{
Option option = null;
try {
option = new Option(opt, description);
option.setLongOpt(longopt);
option.setRequired(required);
option.setOptionalArg(optionalArg);
o... |
Math-82 | private Integer getPivotRow(final int col, final SimplexTableau tableau) {
double minRatio = Double.MAX_VALUE;
Integer minRatioPos = null;
for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getHeight(); i++) {
final double rhs = tableau.getEntry(i, tableau.getWidth() - ... | private Integer getPivotRow(final int col, final SimplexTableau tableau) {
double minRatio = Double.MAX_VALUE;
Integer minRatioPos = null;
for (int i = tableau.getNumObjectiveFunctions(); i < tableau.getHeight(); i++) {
final double rhs = tableau.getEntry(i, tableau.getWidth() - ... |
JacksonDatabind-82 | protected void addBeanProps(DeserializationContext ctxt,
BeanDescription beanDesc, BeanDeserializerBuilder builder)
throws JsonMappingException
{
final boolean isConcrete = !beanDesc.getType().isAbstract();
final SettableBeanProperty[] creatorProps = isConcrete
... | protected void addBeanProps(DeserializationContext ctxt,
BeanDescription beanDesc, BeanDeserializerBuilder builder)
throws JsonMappingException
{
final boolean isConcrete = !beanDesc.getType().isAbstract();
final SettableBeanProperty[] creatorProps = isConcrete
... |
Jsoup-35 | 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;
... |
Lang-48 | public EqualsBuilder append(Object lhs, Object rhs) {
if (isEquals == false) {
return this;
}
if (lhs == rhs) {
return this;
}
if (lhs == null || rhs == null) {
this.setEquals(false);
return this;
}
Class lhsClas... | public EqualsBuilder append(Object lhs, Object rhs) {
if (isEquals == false) {
return this;
}
if (lhs == rhs) {
return this;
}
if (lhs == null || rhs == null) {
this.setEquals(false);
return this;
}
Class lhsClas... |
Chart-20 | public ValueMarker(double value, Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke, float alpha) {
super(paint, stroke, paint, stroke, alpha);
this.value = value;
}
| public ValueMarker(double value, Paint paint, Stroke stroke,
Paint outlinePaint, Stroke outlineStroke, float alpha) {
super(paint, stroke, outlinePaint, outlineStroke, alpha);
this.value = value;
}
|
Lang-45 | public static String abbreviate(String str, int lower, int upper, String appendToEnd) {
if (str == null) {
return null;
}
if (str.length() == 0) {
return StringUtils.EMPTY;
}
if (upper == -1 || upper > str.length()) {
upper = str.length();
... | public static String abbreviate(String str, int lower, int upper, String appendToEnd) {
if (str == null) {
return null;
}
if (str.length() == 0) {
return StringUtils.EMPTY;
}
if (lower > str.length()) {
lower = str.length();
}
... |
Codec-7 | public static String encodeBase64String(byte[] binaryData) {
return StringUtils.newStringUtf8(encodeBase64(binaryData, true));
}
| public static String encodeBase64String(byte[] binaryData) {
return StringUtils.newStringUtf8(encodeBase64(binaryData, false));
}
|
Gson-2 | public static <T1> TypeAdapterFactory newTypeHierarchyFactory(
final Class<T1> clazz, final TypeAdapter<T1> typeAdapter) {
return new TypeAdapterFactory() {
@SuppressWarnings("unchecked")
public <T2> TypeAdapter<T2> create(Gson gson, TypeToken<T2> typeToken) {
final Class<? super T2> req... | public static <T1> TypeAdapterFactory newTypeHierarchyFactory(
final Class<T1> clazz, final TypeAdapter<T1> typeAdapter) {
return new TypeAdapterFactory() {
@SuppressWarnings("unchecked")
public <T2> TypeAdapter<T2> create(Gson gson, TypeToken<T2> typeToken) {
final Class<? super T2> req... |
Chart-5 | public XYDataItem addOrUpdate(Number x, Number y) {
if (x == null) {
throw new IllegalArgumentException("Null 'x' argument.");
}
XYDataItem overwritten = null;
int index = indexOf(x);
if (index >= 0 && !this.allowDuplicateXValues) {
XYDataItem existing... | public XYDataItem addOrUpdate(Number x, Number y) {
if (x == null) {
throw new IllegalArgumentException("Null 'x' argument.");
}
if (this.allowDuplicateXValues) {
add(x, y);
return null;
}
XYDataItem overwritten = null;
int index = ... |
Closure-5 | private boolean isInlinableObject(List<Reference> refs) {
boolean ret = false;
Set<String> validProperties = Sets.newHashSet();
for (Reference ref : refs) {
Node name = ref.getNode();
Node parent = ref.getParent();
Node gramps = ref.getGrandparent();
if (parent.isGe... | private boolean isInlinableObject(List<Reference> refs) {
boolean ret = false;
Set<String> validProperties = Sets.newHashSet();
for (Reference ref : refs) {
Node name = ref.getNode();
Node parent = ref.getParent();
Node gramps = ref.getGrandparent();
if (parent.isGe... |
Math-64 | protected VectorialPointValuePair doOptimize()
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
solvedCols = Math.min(rows, cols);
diagR = new double[cols];
jacNorm = new double[cols];
beta = new double[cols];
per... | protected VectorialPointValuePair doOptimize()
throws FunctionEvaluationException, OptimizationException, IllegalArgumentException {
solvedCols = Math.min(rows, cols);
diagR = new double[cols];
jacNorm = new double[cols];
beta = new double[cols];
per... |
Mockito-22 | public static boolean areEqual(Object o1, Object o2) {
if (o1 == null || o2 == null) {
return o1 == null && o2 == null;
} else if (isArray(o1)) {
return isArray(o2) && areArraysEqual(o1, o2);
} else {
return o1.equals(o2);
}
}
| public static boolean areEqual(Object o1, Object o2) {
if (o1 == o2 ) {
return true;
} else if (o1 == null || o2 == null) {
return o1 == null && o2 == null;
} else if (isArray(o1)) {
return isArray(o2) && areArraysEqual(o1, o2);
} else {
retur... |
JacksonXml-1 | public JsonToken nextToken() throws IOException
{
_binaryValue = null;
if (_nextToken != null) {
JsonToken t = _nextToken;
_currToken = t;
_nextToken = null;
switch (t) {
case START_OBJECT:
_parsingContext = _parsingCont... | public JsonToken nextToken() throws IOException
{
_binaryValue = null;
if (_nextToken != null) {
JsonToken t = _nextToken;
_currToken = t;
_nextToken = null;
switch (t) {
case START_OBJECT:
_parsingContext = _parsingCont... |
Gson-15 | public JsonWriter value(double value) throws IOException {
writeDeferredName();
if (Double.isNaN(value) || Double.isInfinite(value)) {
throw new IllegalArgumentException("Numeric values must be finite, but was " + value);
}
beforeValue();
out.append(Double.toString(value));
return this;
... | public JsonWriter value(double value) throws IOException {
writeDeferredName();
if (!lenient && (Double.isNaN(value) || Double.isInfinite(value))) {
throw new IllegalArgumentException("Numeric values must be finite, but was " + value);
}
beforeValue();
out.append(Double.toString(value));
... |
Math-74 | public double integrate(final FirstOrderDifferentialEquations equations,
final double t0, final double[] y0,
final double t, final double[] y)
throws DerivativeException, IntegratorException {
sanityChecks(equations, t0, y0, t, y);
setEquations(equations);... | public double integrate(final FirstOrderDifferentialEquations equations,
final double t0, final double[] y0,
final double t, final double[] y)
throws DerivativeException, IntegratorException {
sanityChecks(equations, t0, y0, t, y);
setEquations(equations);... |
Gson-11 | public Number read(JsonReader in) throws IOException {
JsonToken jsonToken = in.peek();
switch (jsonToken) {
case NULL:
in.nextNull();
return null;
case NUMBER:
return new LazilyParsedNumber(in.nextString());
default:
throw new JsonSyntaxException("Expec... | public Number read(JsonReader in) throws IOException {
JsonToken jsonToken = in.peek();
switch (jsonToken) {
case NULL:
in.nextNull();
return null;
case NUMBER:
case STRING:
return new LazilyParsedNumber(in.nextString());
default:
throw new JsonSyn... |
Jsoup-15 | boolean process(Token t, TreeBuilder 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, TreeBuilder tb) {
switch (t.type) {
case Character: {
Token.Character c = t.asCharacter();
if (c.getData().equals(nullString)) {
tb.error(this);
return false;
... |
JacksonDatabind-98 | public Object complete(JsonParser p, DeserializationContext ctxt,
PropertyValueBuffer buffer, PropertyBasedCreator creator)
throws IOException
{
final int len = _properties.length;
Object[] values = new Object[len];
for (int i = 0; i < len; ++i) {
String t... | public Object complete(JsonParser p, DeserializationContext ctxt,
PropertyValueBuffer buffer, PropertyBasedCreator creator)
throws IOException
{
final int len = _properties.length;
Object[] values = new Object[len];
for (int i = 0; i < len; ++i) {
String t... |
Math-69 | public RealMatrix getCorrelationPValues() throws MathException {
TDistribution tDistribution = new TDistributionImpl(nObs - 2);
int nVars = correlationMatrix.getColumnDimension();
double[][] out = new double[nVars][nVars];
for (int i = 0; i < nVars; i++) {
for (int j = 0;... | public RealMatrix getCorrelationPValues() throws MathException {
TDistribution tDistribution = new TDistributionImpl(nObs - 2);
int nVars = correlationMatrix.getColumnDimension();
double[][] out = new double[nVars][nVars];
for (int i = 0; i < nVars; i++) {
for (int j = 0;... |
Csv-11 | private Map<String, Integer> initializeHeader() throws IOException {
Map<String, Integer> hdrMap = null;
final String[] formatHeader = this.format.getHeader();
if (formatHeader != null) {
hdrMap = new LinkedHashMap<String, Integer>();
String[] headerRecord = null;
... | private Map<String, Integer> initializeHeader() throws IOException {
Map<String, Integer> hdrMap = null;
final String[] formatHeader = this.format.getHeader();
if (formatHeader != null) {
hdrMap = new LinkedHashMap<String, Integer>();
String[] headerRecord = null;
... |
Closure-97 | private Node tryFoldShift(Node n, Node left, Node right) {
if (left.getType() == Token.NUMBER &&
right.getType() == Token.NUMBER) {
double result;
double lval = left.getDouble();
double rval = right.getDouble();
if (!(lval >= Integer.MIN_VALUE && lval <= Integer.MAX_VALUE)) {
... | private Node tryFoldShift(Node n, Node left, Node right) {
if (left.getType() == Token.NUMBER &&
right.getType() == Token.NUMBER) {
double result;
double lval = left.getDouble();
double rval = right.getDouble();
if (!(lval >= Integer.MIN_VALUE && lval <= Integer.MAX_VALUE)) {
... |
Jsoup-2 | private void parseStartTag() {
tq.consume("<");
String tagName = tq.consumeWord();
if (tagName.length() == 0) {
tq.addFirst("<");
parseTextNode();
return;
}
Attributes attributes = new Attributes();
while (!tq.matchesAny("<", "/... | private void parseStartTag() {
tq.consume("<");
String tagName = tq.consumeWord();
if (tagName.length() == 0) {
tq.addFirst("<");
parseTextNode();
return;
}
Attributes attributes = new Attributes();
while (!tq.matchesAny("<", "/... |
Jsoup-88 | public String getValue() {
return val;
}
| public String getValue() {
return Attributes.checkNotNull(val);
}
|
Jsoup-86 | public XmlDeclaration asXmlDeclaration() {
String data = getData();
Document doc = Jsoup.parse("<" + data.substring(1, data.length() -1) + ">", baseUri(), Parser.xmlParser());
XmlDeclaration decl = null;
if (doc.childNodeSize() > 0) {
Element el = doc.child(0);
... | public XmlDeclaration asXmlDeclaration() {
String data = getData();
Document doc = Jsoup.parse("<" + data.substring(1, data.length() -1) + ">", baseUri(), Parser.xmlParser());
XmlDeclaration decl = null;
if (doc.children().size() > 0) {
Element el = doc.child(0);
... |
Closure-105 | void tryFoldStringJoin(NodeTraversal t, Node n, Node left, Node right,
Node parent) {
if (!NodeUtil.isGetProp(left) || !NodeUtil.isImmutableValue(right)) {
return;
}
Node arrayNode = left.getFirstChild();
Node functionName = arrayNode.getNext();
if ((arrayNode.getTyp... | void tryFoldStringJoin(NodeTraversal t, Node n, Node left, Node right,
Node parent) {
if (!NodeUtil.isGetProp(left) || !NodeUtil.isImmutableValue(right)) {
return;
}
Node arrayNode = left.getFirstChild();
Node functionName = arrayNode.getNext();
if ((arrayNode.getTyp... |
Compress-21 | private void writeBits(final DataOutput header, final BitSet bits, final int length) throws IOException {
int cache = 0;
int shift = 7;
for (int i = 0; i < length; i++) {
cache |= ((bits.get(i) ? 1 : 0) << shift);
--shift;
if (shift == 0) {
... | private void writeBits(final DataOutput header, final BitSet bits, final int length) throws IOException {
int cache = 0;
int shift = 7;
for (int i = 0; i < length; i++) {
cache |= ((bits.get(i) ? 1 : 0) << shift);
if (--shift < 0) {
header.write(cache)... |
Codec-2 | void encode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
if (inAvail < 0) {
eof = true;
if (buf == null || buf.length - pos < encodeSize) {
resizeBuf();
}
switch (modulus) {
case 1:
... | void encode(byte[] in, int inPos, int inAvail) {
if (eof) {
return;
}
if (inAvail < 0) {
eof = true;
if (buf == null || buf.length - pos < encodeSize) {
resizeBuf();
}
switch (modulus) {
case 1:
... |
JacksonDatabind-76 | protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p,
DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
final PropertyBasedCreator creator = _propertyBasedCreator;
PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdRead... | protected Object deserializeUsingPropertyBasedWithUnwrapped(JsonParser p,
DeserializationContext ctxt)
throws IOException, JsonProcessingException
{
final PropertyBasedCreator creator = _propertyBasedCreator;
PropertyValueBuffer buffer = creator.startBuilding(p, ctxt, _objectIdRead... |
Mockito-20 | public <T> T createMock(MockCreationSettings<T> settings, MockHandler handler) {
if (settings.getSerializableMode() == SerializableMode.ACROSS_CLASSLOADERS) {
throw new MockitoException("Serialization across classloaders not yet supported with ByteBuddyMockMaker");
}
Class<? exte... | public <T> T createMock(MockCreationSettings<T> settings, MockHandler handler) {
if (settings.getSerializableMode() == SerializableMode.ACROSS_CLASSLOADERS) {
throw new MockitoException("Serialization across classloaders not yet supported with ByteBuddyMockMaker");
}
Class<? exte... |
Jsoup-39 | 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... |
Jsoup-90 | private static boolean looksLikeUtf8(byte[] input) {
int i = 0;
if (input.length >= 3 && (input[0] & 0xFF) == 0xEF
&& (input[1] & 0xFF) == 0xBB & (input[2] & 0xFF) == 0xBF) {
i = 3;
}
int end;
for (int j = input.length; ... | private static boolean looksLikeUtf8(byte[] input) {
int i = 0;
if (input.length >= 3 && (input[0] & 0xFF) == 0xEF
&& (input[1] & 0xFF) == 0xBB & (input[2] & 0xFF) == 0xBF) {
i = 3;
}
int end;
for (int j = input.length; ... |
Time-5 | public Period normalizedStandard(PeriodType type) {
type = DateTimeUtils.getPeriodType(type);
long millis = getMillis();
millis += (((long) getSeconds()) * ((long) DateTimeConstants.MILLIS_PER_SECOND));
millis += (((long) getMinutes()) * ((long) DateTimeConstants.MILLIS_PER_MINUTE)... | public Period normalizedStandard(PeriodType type) {
type = DateTimeUtils.getPeriodType(type);
long millis = getMillis();
millis += (((long) getSeconds()) * ((long) DateTimeConstants.MILLIS_PER_SECOND));
millis += (((long) getMinutes()) * ((long) DateTimeConstants.MILLIS_PER_MINUTE)... |
Mockito-5 | public void verify(VerificationData data) {
AssertionError error = null;
timer.start();
while (timer.isCounting()) {
try {
delegate.verify(data);
if (returnOnSuccess) {
return;
} else {
error ... | public void verify(VerificationData data) {
AssertionError error = null;
timer.start();
while (timer.isCounting()) {
try {
delegate.verify(data);
if (returnOnSuccess) {
return;
} else {
error ... |
Lang-17 | public final void translate(CharSequence input, Writer out) throws IOException {
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (input == null) {
return;
}
int pos = 0;
int len = Character.codePointCo... | public final void translate(CharSequence input, Writer out) throws IOException {
if (out == null) {
throw new IllegalArgumentException("The Writer must not be null");
}
if (input == null) {
return;
}
int pos = 0;
int len = input.length();
... |
Compress-1 | public void close() throws IOException {
if (!this.closed) {
super.close();
this.closed = true;
}
}
| public void close() throws IOException {
if (!this.closed) {
this.finish();
super.close();
this.closed = true;
}
}
|
Closure-22 | public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isEmpty() ||
n.isComma()) {
return;
}
if (parent == null) {
return;
}
if (parent.getType() == Token.COMMA) {
Node gramps = parent.getParent();
if (gramps.isCall() && parent == gramps.getFirstChild()) {
... | public void visit(NodeTraversal t, Node n, Node parent) {
if (n.isEmpty() ||
n.isComma()) {
return;
}
if (parent == null) {
return;
}
if (n.isExprResult() || n.isBlock()) {
return;
}
if (n.isQualifiedName() && n.getJSDocInfo() != null) {
return;
}
bo... |
JacksonCore-25 | private String _handleOddName2(int startPtr, int hash, int[] codes) throws IOException
{
_textBuffer.resetWithShared(_inputBuffer, startPtr, (_inputPtr - startPtr));
char[] outBuf = _textBuffer.getCurrentSegment();
int outPtr = _textBuffer.getCurrentSegmentSize();
final int maxCo... | private String _handleOddName2(int startPtr, int hash, int[] codes) throws IOException
{
_textBuffer.resetWithShared(_inputBuffer, startPtr, (_inputPtr - startPtr));
char[] outBuf = _textBuffer.getCurrentSegment();
int outPtr = _textBuffer.getCurrentSegmentSize();
final int maxCo... |
Lang-44 | public static Number createNumber(String val) throws NumberFormatException {
if (val == null) {
return null;
}
if (val.length() == 0) {
throw new NumberFormatException("\"\" is not a valid number.");
}
if (val.startsWith("--")) {
return nul... | public static Number createNumber(String val) throws NumberFormatException {
if (val == null) {
return null;
}
if (val.length() == 0) {
throw new NumberFormatException("\"\" is not a valid number.");
}
if (val.length() == 1 && !Character.isDigit(val.ch... |
Chart-9 | public TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end)
throws CloneNotSupportedException {
if (start == null) {
throw new IllegalArgumentException("Null 'start' argument.");
}
if (end == null) {
throw new IllegalArgumentException("Null 'e... | public TimeSeries createCopy(RegularTimePeriod start, RegularTimePeriod end)
throws CloneNotSupportedException {
if (start == null) {
throw new IllegalArgumentException("Null 'start' argument.");
}
if (end == null) {
throw new IllegalArgumentException("Null 'e... |
Closure-81 | Node processFunctionNode(FunctionNode functionNode) {
Name name = functionNode.getFunctionName();
Boolean isUnnamedFunction = false;
if (name == null) {
name = new Name();
name.setIdentifier("");
isUnnamedFunction = true;
}
Node node = newNode(Token.FUNCTION);
... | Node processFunctionNode(FunctionNode functionNode) {
Name name = functionNode.getFunctionName();
Boolean isUnnamedFunction = false;
if (name == null) {
int functionType = functionNode.getFunctionType();
if (functionType != FunctionNode.FUNCTION_EXPRESSION) {
errorReporte... |
Jsoup-50 | 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;
byteData.mark();
byte[] bom = new byte[4];
byteData.get(bom);
byteData.rewind();
if (bom[0] == 0x00 && bom[1] == 0x00 &... |
Jsoup-55 | void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.tagPending.selfClosing = true;
t.emitTagPending();
t.transition(Data);
break;
case eo... | void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.tagPending.selfClosing = true;
t.emitTagPending();
t.transition(Data);
break;
case eo... |
Jsoup-49 | protected void addChildren(int index, Node... children) {
Validate.noNullElements(children);
ensureChildNodes();
for (int i = children.length - 1; i >= 0; i--) {
Node in = children[i];
reparentChild(in);
childNodes.add(index, in);
}
reindex... | protected void addChildren(int index, Node... children) {
Validate.noNullElements(children);
ensureChildNodes();
for (int i = children.length - 1; i >= 0; i--) {
Node in = children[i];
reparentChild(in);
childNodes.add(index, in);
reindexChildr... |
Lang-21 | public static boolean isSameLocalTime(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The date must not be null");
}
return (cal1.get(Calendar.MILLISECOND) == cal2.get(Calendar.MILLISECOND) &&
cal1.get(Calend... | public static boolean isSameLocalTime(Calendar cal1, Calendar cal2) {
if (cal1 == null || cal2 == null) {
throw new IllegalArgumentException("The date must not be null");
}
return (cal1.get(Calendar.MILLISECOND) == cal2.get(Calendar.MILLISECOND) &&
cal1.get(Calend... |
Jsoup-43 | private static <E extends Element> Integer indexInList(Element search, List<E> elements) {
Validate.notNull(search);
Validate.notNull(elements);
for (int i = 0; i < elements.size(); i++) {
E element = elements.get(i);
if (element.equals(search))
return... | private static <E extends Element> Integer indexInList(Element search, List<E> elements) {
Validate.notNull(search);
Validate.notNull(elements);
for (int i = 0; i < elements.size(); i++) {
E element = elements.get(i);
if (element == search)
return i;
... |
Cli-25 | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb.a... | protected StringBuffer renderWrappedText(StringBuffer sb, int width,
int nextLineTabStop, String text)
{
int pos = findWrapPos(text, width, 0);
if (pos == -1)
{
sb.append(rtrim(text));
return sb;
}
sb.a... |
Lang-59 | public StrBuilder appendFixedWidthPadRight(Object obj, int width, char padChar) {
if (width > 0) {
ensureCapacity(size + width);
String str = (obj == null ? getNullText() : obj.toString());
int strLen = str.length();
if (strLen >= width) {
str.... | public StrBuilder appendFixedWidthPadRight(Object obj, int width, char padChar) {
if (width > 0) {
ensureCapacity(size + width);
String str = (obj == null ? getNullText() : obj.toString());
int strLen = str.length();
if (strLen >= width) {
str.... |
Closure-118 | private void handleObjectLit(NodeTraversal t, Node n) {
for (Node child = n.getFirstChild();
child != null;
child = child.getNext()) {
String name = child.getString();
T type = typeSystem.getType(getScope(), n, name);
Property prop = getProperty(name);
if (!... | private void handleObjectLit(NodeTraversal t, Node n) {
for (Node child = n.getFirstChild();
child != null;
child = child.getNext()) {
if (child.isQuotedString()) {
continue;
}
String name = child.getString();
T type = typeSystem.getType(getScope()... |
JacksonCore-4 | public char[] expandCurrentSegment()
{
final char[] curr = _currentSegment;
final int len = curr.length;
int newLen = (len == MAX_SEGMENT_LEN) ? (MAX_SEGMENT_LEN+1) : Math.min(MAX_SEGMENT_LEN, len + (len >> 1));
return (_currentSegment = Arrays.copyOf(curr, newLen));
}
| public char[] expandCurrentSegment()
{
final char[] curr = _currentSegment;
final int len = curr.length;
int newLen = len + (len >> 1);
if (newLen > MAX_SEGMENT_LEN) {
newLen = len + (len >> 2);
}
return (_currentSegment = Arrays.copyOf(curr, newLen));... |
Closure-133 | private String getRemainingJSDocLine() {
String result = stream.getRemainingJSDocLine();
return result;
}
| private String getRemainingJSDocLine() {
String result = stream.getRemainingJSDocLine();
unreadToken = NO_UNREAD_TOKEN;
return result;
}
|
Jsoup-80 | void insert(Token.Comment commentToken) {
Comment comment = new Comment(commentToken.getData());
Node insert = comment;
if (commentToken.bogus) {
String data = comment.getData();
if (data.length() > 1 && (data.startsWith("!") || data.startsWith("?"))) {
... | void insert(Token.Comment commentToken) {
Comment comment = new Comment(commentToken.getData());
Node insert = comment;
if (commentToken.bogus) {
String data = comment.getData();
if (data.length() > 1 && (data.startsWith("!") || data.startsWith("?"))) {
... |
Math-48 | 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... |
Closure-25 | private FlowScope traverseNew(Node n, FlowScope scope) {
Node constructor = n.getFirstChild();
scope = traverse(constructor, scope);
JSType constructorType = constructor.getJSType();
JSType type = null;
if (constructorType != null) {
constructorType = constructorType.restrictByNotNullOrUndef... | private FlowScope traverseNew(Node n, FlowScope scope) {
scope = traverseChildren(n, scope);
Node constructor = n.getFirstChild();
JSType constructorType = constructor.getJSType();
JSType type = null;
if (constructorType != null) {
constructorType = constructorType.restrictByNotNullOrUndefin... |
Time-4 | public Partial with(DateTimeFieldType fieldType, int value) {
if (fieldType == null) {
throw new IllegalArgumentException("The field type must not be null");
}
int index = indexOf(fieldType);
if (index == -1) {
DateTimeFieldType[] newTypes = new DateTimeFieldT... | public Partial with(DateTimeFieldType fieldType, int value) {
if (fieldType == null) {
throw new IllegalArgumentException("The field type must not be null");
}
int index = indexOf(fieldType);
if (index == -1) {
DateTimeFieldType[] newTypes = new DateTimeFieldT... |
Math-85 | public static double[] bracket(UnivariateRealFunction function,
double initial, double lowerBound, double upperBound,
int maximumIterations) throws ConvergenceException,
FunctionEvaluationException {
if (function == null) {
throw MathRuntimeException.createI... | public static double[] bracket(UnivariateRealFunction function,
double initial, double lowerBound, double upperBound,
int maximumIterations) throws ConvergenceException,
FunctionEvaluationException {
if (function == null) {
throw MathRuntimeException.createI... |
Lang-10 | private static StringBuilder escapeRegex(StringBuilder regex, String value, boolean unquote) {
boolean wasWhite= false;
for(int i= 0; i<value.length(); ++i) {
char c= value.charAt(i);
if(Character.isWhitespace(c)) {
if(!wasWhite) {
wasWhite... | private static StringBuilder escapeRegex(StringBuilder regex, String value, boolean unquote) {
for(int i= 0; i<value.length(); ++i) {
char c= value.charAt(i);
switch(c) {
case '\'':
if(unquote) {
if(++i==value.length()) {
... |
Lang-65 | 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");
}
boolean roundUp = false;
for (int i = 0; i < fields.length; i++) {
... | 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... |
JacksonCore-20 | public void writeEmbeddedObject(Object object) throws IOException {
throw new JsonGenerationException("No native support for writing embedded objects",
this);
}
| public void writeEmbeddedObject(Object object) throws IOException {
if (object == null) {
writeNull();
return;
}
if (object instanceof byte[]) {
writeBinary((byte[]) object);
return;
}
throw new JsonGenerationException("No nativ... |
Closure-61 | static boolean functionCallHasSideEffects(
Node callNode, @Nullable AbstractCompiler compiler) {
if (callNode.getType() != Token.CALL) {
throw new IllegalStateException(
"Expected CALL node, got " + Token.name(callNode.getType()));
}
if (callNode.isNoSideEffectsCall()) {
return... | static boolean functionCallHasSideEffects(
Node callNode, @Nullable AbstractCompiler compiler) {
if (callNode.getType() != Token.CALL) {
throw new IllegalStateException(
"Expected CALL node, got " + Token.name(callNode.getType()));
}
if (callNode.isNoSideEffectsCall()) {
return... |
Closure-161 | private Node tryFoldArrayAccess(Node n, Node left, Node right) {
Node parent = n.getParent();
if (right.getType() != Token.NUMBER) {
return n;
}
double index = right.getDouble();
int intIndex = (int) index;
if (intIndex != index) {
error(INVALID_GETELEM_INDEX_ERROR, right);
r... | private Node tryFoldArrayAccess(Node n, Node left, Node right) {
Node parent = n.getParent();
if (isAssignmentTarget(n)) {
return n;
}
if (right.getType() != Token.NUMBER) {
return n;
}
double index = right.getDouble();
int intIndex = (int) index;
if (intIndex != index) {
... |
Lang-49 | public Fraction reduce() {
int gcd = greatestCommonDivisor(Math.abs(numerator), denominator);
if (gcd == 1) {
return this;
}
return Fraction.getFraction(numerator / gcd, denominator / gcd);
}
| public Fraction reduce() {
if (numerator == 0) {
return equals(ZERO) ? this : ZERO;
}
int gcd = greatestCommonDivisor(Math.abs(numerator), denominator);
if (gcd == 1) {
return this;
}
return Fraction.getFraction(numerator / gcd, denominator / g... |
Lang-55 | public void stop() {
if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {
throw new IllegalStateException("Stopwatch is not running. ");
}
stopTime = System.currentTimeMillis();
this.runningState = STATE_STOPPED;
}
| public void stop() {
if(this.runningState != STATE_RUNNING && this.runningState != STATE_SUSPENDED) {
throw new IllegalStateException("Stopwatch is not running. ");
}
if(this.runningState == STATE_RUNNING) {
stopTime = System.currentTimeMillis();
}
thi... |
Closure-53 | private void replaceAssignmentExpression(Var v, Reference ref,
Map<String, String> varmap) {
List<Node> nodes = Lists.newArrayList();
Node val = ref.getAssignedValue();
blacklistVarReferencesInTree(val, v.scope);
Preconditions.checkState(val.getTy... | private void replaceAssignmentExpression(Var v, Reference ref,
Map<String, String> varmap) {
List<Node> nodes = Lists.newArrayList();
Node val = ref.getAssignedValue();
blacklistVarReferencesInTree(val, v.scope);
Preconditions.checkState(val.getTy... |
Chart-4 | public Range getDataRange(ValueAxis axis) {
Range result = null;
List mappedDatasets = new ArrayList();
List includedAnnotations = new ArrayList();
boolean isDomainAxis = true;
int domainIndex = getDomainAxisIndex(axis);
if (domainIndex >= 0) {
isDomainAxi... | public Range getDataRange(ValueAxis axis) {
Range result = null;
List mappedDatasets = new ArrayList();
List includedAnnotations = new ArrayList();
boolean isDomainAxis = true;
int domainIndex = getDomainAxisIndex(axis);
if (domainIndex >= 0) {
isDomainAxi... |
Closure-40 | public void visit(NodeTraversal t, Node n, Node parent) {
if (t.inGlobalScope()) {
if (NodeUtil.isVarDeclaration(n)) {
NameInformation ns = createNameInformation(t, n, parent);
Preconditions.checkNotNull(ns);
recordSet(ns.name, n);
} else if (NodeUtil.isFunctionDe... | public void visit(NodeTraversal t, Node n, Node parent) {
if (t.inGlobalScope()) {
if (NodeUtil.isVarDeclaration(n)) {
NameInformation ns = createNameInformation(t, n, parent);
Preconditions.checkNotNull(ns);
recordSet(ns.name, n);
} else if (NodeUtil.isFunctionDe... |
JacksonDatabind-24 | public BaseSettings withDateFormat(DateFormat df) {
if (_dateFormat == df) {
return this;
}
TimeZone tz = (df == null) ? _timeZone : df.getTimeZone();
return new BaseSettings(_classIntrospector, _annotationIntrospector, _visibilityChecker, _propertyNamingStrategy, _typeFa... | public BaseSettings withDateFormat(DateFormat df) {
if (_dateFormat == df) {
return this;
}
return new BaseSettings(_classIntrospector, _annotationIntrospector, _visibilityChecker, _propertyNamingStrategy, _typeFactory,
_typeResolverBuilder, df, _handlerInstantiat... |
Math-13 | private RealMatrix squareRoot(RealMatrix m) {
final EigenDecomposition dec = new EigenDecomposition(m);
return dec.getSquareRoot();
}
| private RealMatrix squareRoot(RealMatrix m) {
if (m instanceof DiagonalMatrix) {
final int dim = m.getRowDimension();
final RealMatrix sqrtM = new DiagonalMatrix(dim);
for (int i = 0; i < dim; i++) {
sqrtM.setEntry(i, i, FastMath.sqrt(m.getEntry(i, i)));
... |
Codec-18 | public static boolean equals(final CharSequence cs1, final CharSequence cs2) {
if (cs1 == cs2) {
return true;
}
if (cs1 == null || cs2 == null) {
return false;
}
if (cs1 instanceof String && cs2 instanceof String) {
return cs1.equals(cs2);
... | public static boolean equals(final CharSequence cs1, final CharSequence cs2) {
if (cs1 == cs2) {
return true;
}
if (cs1 == null || cs2 == null) {
return false;
}
if (cs1 instanceof String && cs2 instanceof String) {
return cs1.equals(cs2);
... |
JacksonDatabind-93 | public void validateSubType(DeserializationContext ctxt, JavaType type) throws JsonMappingException
{
final Class<?> raw = type.getRawClass();
String full = raw.getName();
main_check:
do {
if (_cfgIllegalClassNames.contains(full)) {
break;
... | public void validateSubType(DeserializationContext ctxt, JavaType type) throws JsonMappingException
{
final Class<?> raw = type.getRawClass();
String full = raw.getName();
main_check:
do {
if (_cfgIllegalClassNames.contains(full)) {
break;
... |
Closure-145 | private boolean isOneExactlyFunctionOrDo(Node n) {
return (n.getType() == Token.FUNCTION || n.getType() == Token.DO);
}
| private boolean isOneExactlyFunctionOrDo(Node n) {
if (n.getType() == Token.LABEL) {
Node labeledStatement = n.getLastChild();
if (labeledStatement.getType() != Token.BLOCK) {
return isOneExactlyFunctionOrDo(labeledStatement);
} else {
if (getNonEmptyChildCount(n, 2) == 1) {
... |
Closure-176 | private void updateScopeForTypeChange(
FlowScope scope, Node left, JSType leftType, JSType resultType) {
Preconditions.checkNotNull(resultType);
switch (left.getType()) {
case Token.NAME:
String varName = left.getString();
Var var = syntacticScope.getVar(varName);
boolean i... | private void updateScopeForTypeChange(
FlowScope scope, Node left, JSType leftType, JSType resultType) {
Preconditions.checkNotNull(resultType);
switch (left.getType()) {
case Token.NAME:
String varName = left.getString();
Var var = syntacticScope.getVar(varName);
JSType va... |
Cli-35 | public List<String> getMatchingOptions(String opt)
{
opt = Util.stripLeadingHyphens(opt);
List<String> matchingOpts = new ArrayList<String>();
for (String longOpt : longOpts.keySet())
{
if (longOpt.startsWith(opt))
{
matchingOpts.add(longOp... | public List<String> getMatchingOptions(String opt)
{
opt = Util.stripLeadingHyphens(opt);
List<String> matchingOpts = new ArrayList<String>();
if(longOpts.keySet().contains(opt)) {
return Collections.singletonList(opt);
}
for (String longOpt : longOpts.keySet(... |
Closure-119 | public void collect(JSModule module, Scope scope, Node n) {
Node parent = n.getParent();
String name;
boolean isSet = false;
Name.Type type = Name.Type.OTHER;
boolean isPropAssign = false;
switch (n.getType()) {
case Token.GETTER_DEF:
case Token.SETTER_DEF:
... | public void collect(JSModule module, Scope scope, Node n) {
Node parent = n.getParent();
String name;
boolean isSet = false;
Name.Type type = Name.Type.OTHER;
boolean isPropAssign = false;
switch (n.getType()) {
case Token.GETTER_DEF:
case Token.SETTER_DEF:
... |
JacksonDatabind-19 | private JavaType _mapType(Class<?> rawClass)
{
JavaType[] typeParams = findTypeParameters(rawClass, Map.class);
if (typeParams == null) {
return MapType.construct(rawClass, _unknownType(), _unknownType());
}
if (typeParams.length != 2) {
throw new IllegalA... | private JavaType _mapType(Class<?> rawClass)
{
if (rawClass == Properties.class) {
return MapType.construct(rawClass, CORE_TYPE_STRING, CORE_TYPE_STRING);
}
JavaType[] typeParams = findTypeParameters(rawClass, Map.class);
if (typeParams == null) {
return M... |
Closure-56 | public String getLine(int lineNumber) {
String js = "";
try {
js = getCode();
} catch (IOException e) {
return null;
}
int pos = 0;
int startLine = 1;
if (lineNumber >= lastLine) {
pos = lastOffset;
startLine = lastLine;
}
for (int n = startLine; n < lineNum... | public String getLine(int lineNumber) {
String js = "";
try {
js = getCode();
} catch (IOException e) {
return null;
}
int pos = 0;
int startLine = 1;
if (lineNumber >= lastLine) {
pos = lastOffset;
startLine = lastLine;
}
for (int n = startLine; n < lineNum... |
Math-103 | public double cumulativeProbability(double x) throws MathException {
return 0.5 * (1.0 + Erf.erf((x - mean) /
(standardDeviation * Math.sqrt(2.0))));
}
| public double cumulativeProbability(double x) throws MathException {
try {
return 0.5 * (1.0 + Erf.erf((x - mean) /
(standardDeviation * Math.sqrt(2.0))));
} catch (MaxIterationsExceededException ex) {
if (x < (mean - 20 * standardDeviation)) {
... |
Math-80 | private boolean flipIfWarranted(final int n, final int step) {
if (1.5 * work[pingPong] < work[4 * (n - 1) + pingPong]) {
int j = 4 * n - 1;
for (int i = 0; i < j; i += 4) {
for (int k = 0; k < 4; k += step) {
final double tmp = work[i + k];
... | private boolean flipIfWarranted(final int n, final int step) {
if (1.5 * work[pingPong] < work[4 * (n - 1) + pingPong]) {
int j = 4 * (n - 1);
for (int i = 0; i < j; i += 4) {
for (int k = 0; k < 4; k += step) {
final double tmp = work[i + k];
... |
Math-41 | public double evaluate(final double[] values, final double[] weights,
final double mean, final int begin, final int length) {
double var = Double.NaN;
if (test(values, weights, begin, length)) {
if (length == 1) {
var = 0.0;
} else i... | public double evaluate(final double[] values, final double[] weights,
final double mean, final int begin, final int length) {
double var = Double.NaN;
if (test(values, weights, begin, length)) {
if (length == 1) {
var = 0.0;
} else i... |
Math-17 | public Dfp multiply(final int x) {
return multiplyFast(x);
}
| public Dfp multiply(final int x) {
if (x >= 0 && x < RADIX) {
return multiplyFast(x);
} else {
return multiply(newInstance(x));
}
}
|
Math-38 | private void prelim(double[] lowerBound,
double[] upperBound) {
printMethod();
final int n = currentBest.getDimension();
final int npt = numberOfInterpolationPoints;
final int ndim = bMatrix.getRowDimension();
final double rhosq = initialTrustRegionRa... | private void prelim(double[] lowerBound,
double[] upperBound) {
printMethod();
final int n = currentBest.getDimension();
final int npt = numberOfInterpolationPoints;
final int ndim = bMatrix.getRowDimension();
final double rhosq = initialTrustRegionRa... |
Lang-37 | public static <T> T[] addAll(T[] array1, T... array2) {
if (array1 == null) {
return clone(array2);
} else if (array2 == null) {
return clone(array1);
}
final Class<?> type1 = array1.getClass().getComponentType();
T[] joinedArray = (T[]) Array.newInsta... | public static <T> T[] addAll(T[] array1, T... array2) {
if (array1 == null) {
return clone(array2);
} else if (array2 == null) {
return clone(array1);
}
final Class<?> type1 = array1.getClass().getComponentType();
T[] joinedArray = (T[]) Array.newInsta... |
Closure-132 | private Node tryMinimizeIf(Node n) {
Node parent = n.getParent();
Node cond = n.getFirstChild();
if (NodeUtil.isLiteralValue(cond, true)) {
return n;
}
Node thenBranch = cond.getNext();
Node elseBranch = thenBranch.getNext();
if (elseBranch == null) {
if (isFoldableExpressBlock... | private Node tryMinimizeIf(Node n) {
Node parent = n.getParent();
Node cond = n.getFirstChild();
if (NodeUtil.isLiteralValue(cond, true)) {
return n;
}
Node thenBranch = cond.getNext();
Node elseBranch = thenBranch.getNext();
if (elseBranch == null) {
if (isFoldableExpressBlock... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.