before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
STATE = position;
unsplashListAdapter.clearData();
if (STATE == STATE_SEARCH) {
mPresenter.getSearchPhotoList("");
} else {
mPresenter.getPhotoList(STATE);
}
} | @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
STATE = position;
<DeepExtract>
unsplashListAdapter.clearData();
if (STATE == STATE_SEARCH) {
mPresenter.getSearchPhotoList("");
} else {
mPresenter.getPhotoList(STATE);
}
</DeepExtract>
} | KTReader | positive | 4,427 |
public Criteria andExpectReturnTimeLessThan(Date value) {
if (value == null) {
throw new RuntimeException("Value for " + "expectReturnTime" + " cannot be null");
}
criteria.add(new Criterion("expect_return_time <", value));
return (Criteria) this;
} | public Criteria andExpectReturnTimeLessThan(Date value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "expectReturnTime" + " cannot be null");
}
criteria.add(new Criterion("expect_return_time <", value));
</DeepExtract>
return (Criteria) this;
} | SSM_BookSystem | positive | 4,428 |
@org.junit.Test
public void checkSorting3() throws Exception {
Integer[] sortingAttempt = testSpecificSort(testArrSet[3].clone(), testArrSet[3].length);
assertArrayEquals(expectedArrSet[3], sortingAttempt);
} | @org.junit.Test
public void checkSorting3() throws Exception {
<DeepExtract>
Integer[] sortingAttempt = testSpecificSort(testArrSet[3].clone(), testArrSet[3].length);
assertArrayEquals(expectedArrSet[3], sortingAttempt);
</DeepExtract>
} | gin | positive | 4,429 |
@Override
protected void onPreExecute() {
super.onPreExecute();
rvMovie.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
results.clear();
;
} | @Override
protected void onPreExecute() {
super.onPreExecute();
<DeepExtract>
rvMovie.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
</DeepExtract>
results.clear();
;
} | Android-Developer-Expert-Example | positive | 4,430 |
@Override
public void triggerEmpty() {
mLoading.setVisibility(GONE);
mLoading.stop();
mEmptyImg.setImageResource(mDrawableIds[0]);
mStatusText.setText(mTextIds[0]);
mEmptyImg.setVisibility(VISIBLE);
setVisibility(VISIBLE);
final View[] views = mBindViews;
if (views == null || views.length == 0)
return;
for (View view :... | @Override
public void triggerEmpty() {
mLoading.setVisibility(GONE);
mLoading.stop();
mEmptyImg.setImageResource(mDrawableIds[0]);
mStatusText.setText(mTextIds[0]);
mEmptyImg.setVisibility(VISIBLE);
setVisibility(VISIBLE);
<DeepExtract>
final View[] views = mBindViews;
if (views == null || views.length == 0)
return;
fo... | ITalker | positive | 4,431 |
static public boolean checkIP(String ipAddress) {
String regex = "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])";
boolean tem = false;
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pa... | static public boolean checkIP(String ipAddress) {
String regex = "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\." + "(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])";
<DeepExtract>
boolean tem = false;
Pattern pattern = Pattern.compile(regex);
Matche... | Car-eye-pusher-android | positive | 4,432 |
@PostMapping(value = "/password")
public String updatePassword(String oldPassword, String password, ModelMap model) {
try {
AccountProfile profile = getProfile();
userService.updatePassword(profile.getId(), oldPassword, password);
data = Result.success();
} catch (Exception e) {
data = Result.failure(e.getMessage());
}... | @PostMapping(value = "/password")
public String updatePassword(String oldPassword, String password, ModelMap model) {
try {
AccountProfile profile = getProfile();
userService.updatePassword(profile.getId(), oldPassword, password);
data = Result.success();
} catch (Exception e) {
data = Result.failure(e.getMessage());
}... | mblog | positive | 4,433 |
@Override
public boolean isHidden() {
return accountSelect.isCollapsed();
} | @Override
public boolean isHidden() {
<DeepExtract>
return accountSelect.isCollapsed();
</DeepExtract>
} | domino-ui-demo | positive | 4,434 |
public void writerComplex(Object... args) throws IOException {
if (args == null) {
writerNull();
return;
}
out.write(Protocol.ASTERISK_BYTE);
out.writeIntCrLf(args.length);
for (Object arg : args) {
if (arg == null) {
writerNull();
continue;
}
if (arg instanceof byte[]) {
byte[] val = (byte[]) arg;
writer(val);
} else ... | public void writerComplex(Object... args) throws IOException {
<DeepExtract>
if (args == null) {
writerNull();
return;
}
out.write(Protocol.ASTERISK_BYTE);
out.writeIntCrLf(args.length);
for (Object arg : args) {
if (arg == null) {
writerNull();
continue;
}
if (arg instanceof byte[]) {
byte[] val = (byte[]) arg;
writer... | redis-mock | positive | 4,435 |
private void credits() {
long duration = 8 * D;
new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1).setStartOffsetMillis(time);
new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1).setStopOffsetMillis(time + duration);
effects.add(new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1));
Sys... | private void credits() {
long duration = 8 * D;
new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1).setStartOffsetMillis(time);
new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1).setStopOffsetMillis(time + duration);
effects.add(new CreditsSprite(config, "greetings_demofx_3.txt", 0.22, 2.1));
Sys... | DemoFX | positive | 4,436 |
public void putInt32(int xint) {
int boffset = byteArray.length;
byte[] value = new byte[byteArray.length + 4];
System.arraycopy(byteArray, 0, value, 0, byteArray.length);
byteArray = value;
byteArray[boffset + 3] = (byte) ((xint) & 0xff);
byteArray[boffset + 2] = (byte) ((xint >> 8) & 0xff);
byteArray[boffset + 1] = (... | public void putInt32(int xint) {
int boffset = byteArray.length;
<DeepExtract>
byte[] value = new byte[byteArray.length + 4];
System.arraycopy(byteArray, 0, value, 0, byteArray.length);
byteArray = value;
</DeepExtract>
byteArray[boffset + 3] = (byte) ((xint) & 0xff);
byteArray[boffset + 2] = (byte) ((xint >> 8) & 0xff... | jta | positive | 4,437 |
public static <K> void quickSort(final K[] x, final int from, final int to, final Comparator<K> comp) {
final int len = to - from;
if (len < SMALL) {
selectionSort(x, from, to, comp);
return;
}
int m = from + len / 2;
if (len > SMALL) {
int l = from;
int n = to - 1;
if (len > MEDIUM) {
int s = len / 8;
l = med3(x, l, l... | public static <K> void quickSort(final K[] x, final int from, final int to, final Comparator<K> comp) {
final int len = to - from;
if (len < SMALL) {
selectionSort(x, from, to, comp);
return;
}
int m = from + len / 2;
if (len > SMALL) {
int l = from;
int n = to - 1;
if (len > MEDIUM) {
int s = len / 8;
l = med3(x, l, l... | jhighlight | positive | 4,438 |
public static void cleanSharedPreference(Context context) {
if (new File("/data/data/" + context.getPackageName() + "/shared_prefs") != null && new File("/data/data/" + context.getPackageName() + "/shared_prefs").exists() && new File("/data/data/" + context.getPackageName() + "/shared_prefs").isDirectory()) {
for (File... | public static void cleanSharedPreference(Context context) {
<DeepExtract>
if (new File("/data/data/" + context.getPackageName() + "/shared_prefs") != null && new File("/data/data/" + context.getPackageName() + "/shared_prefs").exists() && new File("/data/data/" + context.getPackageName() + "/shared_prefs").isDirectory(... | Akit-Reader | positive | 4,439 |
private void obtainColorFormat(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getInteger(R.integer.color_picker_preference_default_color_format);
Condition.INSTANCE.ensureNotNull(ColorFormat.fromValue(typedArray.getInteger(R.styleable.AbstractColorPickerPreference_colorFormat, de... | private void obtainColorFormat(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getInteger(R.integer.color_picker_preference_default_color_format);
<DeepExtract>
Condition.INSTANCE.ensureNotNull(ColorFormat.fromValue(typedArray.getInteger(R.styleable.AbstractColorPickerPreference_c... | AndroidMaterialPreferences | positive | 4,440 |
@LocalData
@Test
public void aggregatedTestResultsOnly() throws Exception {
upstreamProject = j.createFreeStyleProject(AGGREGATION_PROJECT_NAME);
addFingerprinterToProject(upstreamProject, singleContents, singleFiles);
upstreamProject.setQuietPeriod(0);
createDownstreamProjectWithNoTests();
addJUnitResultArchiver(downs... | @LocalData
@Test
public void aggregatedTestResultsOnly() throws Exception {
upstreamProject = j.createFreeStyleProject(AGGREGATION_PROJECT_NAME);
addFingerprinterToProject(upstreamProject, singleContents, singleFiles);
upstreamProject.setQuietPeriod(0);
createDownstreamProjectWithNoTests();
addJUnitResultArchiver(downs... | junit-plugin | positive | 4,441 |
public static void main(String[] args) {
Trie tt = new Trie();
if ("banana" == null) {
return root;
}
return add(root, "banana".toLowerCase(), 0);
if ("apple" == null) {
return root;
}
return add(root, "apple".toLowerCase(), 0);
if ("mango" == null) {
return root;
}
return add(root, "mango".toLowerCase(), 0);
System.ou... | public static void main(String[] args) {
Trie tt = new Trie();
if ("banana" == null) {
return root;
}
return add(root, "banana".toLowerCase(), 0);
if ("apple" == null) {
return root;
}
return add(root, "apple".toLowerCase(), 0);
<DeepExtract>
if ("mango" == null) {
return root;
}
return add(root, "mango".toLowerCase(),... | Problem-Solving-in-Data-Structures-Algorithms-using-Java | positive | 4,443 |
public void handle(MouseEvent event) {
snappedIndex = -1;
for (Shape s : shapes) s.delete();
update();
Shape.StrokeWidth = Shape.DEFAULT_STROKE_WIDTH;
AsyUnitSize = DEFAULT_ASY_UNIT_SIZE;
for (Shape s : shapes) {
if (getChildren().contains(s.getObject())) {
if (Utility.distToShape(event.getSceneX(), event.getSceneY(), ... | public void handle(MouseEvent event) {
snappedIndex = -1;
<DeepExtract>
for (Shape s : shapes) s.delete();
update();
Shape.StrokeWidth = Shape.DEFAULT_STROKE_WIDTH;
AsyUnitSize = DEFAULT_ASY_UNIT_SIZE;
</DeepExtract>
for (Shape s : shapes) {
if (getChildren().contains(s.getObject())) {
if (Utility.distToShape(event.get... | AsyPad | positive | 4,444 |
public Builder setMsgType(com.github.yuanrw.im.protobuf.generate.Internal.InternalMsg.MsgType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
return value;
onChanged();
return this;
} | public Builder setMsgType(com.github.yuanrw.im.protobuf.generate.Internal.InternalMsg.MsgType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
<DeepExtract>
return value;
</DeepExtract>
onChanged();
return this;
} | IM | positive | 4,445 |
public void doShipTickUpdate() {
if (torpCoolMsgSent)
torpCoolMsgSent = false;
if (phaserCoolMsgSent)
phaserCoolMsgSent = false;
if (torpsOutMsgSent)
torpsOutMsgSent = false;
if (!docked && !orbiting) {
repairLSMsgSent = false;
}
if (isIntercepting()) {
if (!currentQuadrant.isInQuadrant(interceptTarget))
interceptTarge... | public void doShipTickUpdate() {
if (torpCoolMsgSent)
torpCoolMsgSent = false;
if (phaserCoolMsgSent)
phaserCoolMsgSent = false;
if (torpsOutMsgSent)
torpsOutMsgSent = false;
if (!docked && !orbiting) {
repairLSMsgSent = false;
}
if (isIntercepting()) {
if (!currentQuadrant.isInQuadrant(interceptTarget))
interceptTarge... | jtrek | positive | 4,446 |
public static org.eclipselab.emf.ecore.protobuf.tests.library.LibraryProtos.Book parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
org.eclipselab.emf.ecore.protobuf.tests.library.LibraryProtos.Library.Ref result = buildPartial();
if (!result.i... | public static org.eclipselab.emf.ecore.protobuf.tests.library.LibraryProtos.Book parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
<DeepExtract>
org.eclipselab.emf.ecore.protobuf.tests.library.LibraryProtos.Library.Ref result = buildPartial();... | org.eclipselab.emf.ecore.protobuf | positive | 4,447 |
@Nullable
public Bitmap cropImage() {
Bitmap viewBitmap = getViewBitmap();
if (viewBitmap == null || viewBitmap.isRecycled()) {
return null;
}
removeCallbacks(mWrapCropBoundsRunnable);
removeCallbacks(mZoomImageToPositionRunnable);
if (!isImageWrapCropBounds()) {
float currentX = mCurrentImageCenter[0];
float currentY ... | @Nullable
public Bitmap cropImage() {
Bitmap viewBitmap = getViewBitmap();
if (viewBitmap == null || viewBitmap.isRecycled()) {
return null;
}
removeCallbacks(mWrapCropBoundsRunnable);
removeCallbacks(mZoomImageToPositionRunnable);
<DeepExtract>
if (!isImageWrapCropBounds()) {
float currentX = mCurrentImageCenter[0];
f... | Yalantis-Series | positive | 4,448 |
public static void main(String... argv) {
Main args = new Main();
JCommander.newBuilder().addObject(args).build().parse(argv);
out.printf("%d %d", length, pattern);
} | public static void main(String... argv) {
Main args = new Main();
JCommander.newBuilder().addObject(args).build().parse(argv);
<DeepExtract>
out.printf("%d %d", length, pattern);
</DeepExtract>
} | jcommander | positive | 4,449 |
private void restoreEncryptedWithPGP(Uri uri, Intent decryptIntent) {
if (decryptIntent == null)
decryptIntent = new Intent(OpenPgpApi.ACTION_DECRYPT_VERIFY);
PGPRestoreTask task = new PGPRestoreTask(this, uri, decryptIntent);
currentTask = BackupTaskResult.ResultType.RESTORE;
startBackgroundTask(task);
} | private void restoreEncryptedWithPGP(Uri uri, Intent decryptIntent) {
if (decryptIntent == null)
decryptIntent = new Intent(OpenPgpApi.ACTION_DECRYPT_VERIFY);
PGPRestoreTask task = new PGPRestoreTask(this, uri, decryptIntent);
<DeepExtract>
currentTask = BackupTaskResult.ResultType.RESTORE;
startBackgroundTask(task);
<... | andOTP | positive | 4,450 |
public int sum(int l, int r) {
if (lazy != 0) {
sum += lazy * (maxPos - minPos);
min += lazy;
if (left != null)
left.lazy += lazy;
if (right != null)
right.lazy += lazy;
lazy = 0;
}
if (l <= minPos && maxPos <= r)
return sum;
else if (r <= minPos || l >= maxPos)
return 0;
else
return (left == null ? 0 : left.sum(l, r))... | public int sum(int l, int r) {
<DeepExtract>
if (lazy != 0) {
sum += lazy * (maxPos - minPos);
min += lazy;
if (left != null)
left.lazy += lazy;
if (right != null)
right.lazy += lazy;
lazy = 0;
}
</DeepExtract>
if (l <= minPos && maxPos <= r)
return sum;
else if (r <= minPos || l >= maxPos)
return 0;
else
return (left ... | DEPRECATED-data-structures | positive | 4,451 |
public static R error(int code, String msg) {
R r = new R();
super.put("code", code);
return this;
super.put("msg", msg);
return this;
return r;
} | public static R error(int code, String msg) {
R r = new R();
super.put("code", code);
return this;
<DeepExtract>
super.put("msg", msg);
return this;
</DeepExtract>
return r;
} | clouddo | positive | 4,452 |
@Override
protected void finalize() throws Throwable {
if (this.db != null)
this.db.close();
super.finalize();
} | @Override
protected void finalize() throws Throwable {
<DeepExtract>
if (this.db != null)
this.db.close();
</DeepExtract>
super.finalize();
} | hmdm-android | positive | 4,453 |
@Override
public void run() {
vtData.produceState(whichState, progressIndicator);
} | @Override
public void run() {
<DeepExtract>
vtData.produceState(whichState, progressIndicator);
</DeepExtract>
} | VisibleTesla | positive | 4,454 |
@Deprecated
@Override
public void loadComplete() {
try {
super.loadComplete();
} catch (Throwable e) {
LogUtils.e(e);
}
notifyDataSetChanged();
} | @Deprecated
@Override
public void loadComplete() {
<DeepExtract>
try {
super.loadComplete();
} catch (Throwable e) {
LogUtils.e(e);
}
notifyDataSetChanged();
</DeepExtract>
} | JianshuApp | positive | 4,456 |
public void query() {
System.out.println("[Debug]使用了" + "query" + "方法");
userService.query();
} | public void query() {
<DeepExtract>
System.out.println("[Debug]使用了" + "query" + "方法");
</DeepExtract>
userService.query();
} | codingce-java | positive | 4,457 |
@Override
public void onRefresh() {
mPage = 1;
if (mIsLoading)
return;
mIsLoading = true;
if (mNodeName != null && !mNodeName.isEmpty())
requestTopicsByName(true);
else if (mTabName != null && !mTabName.isEmpty())
requestTopicsByTab(true);
else
requestTopicsById(true);
} | @Override
public void onRefresh() {
mPage = 1;
<DeepExtract>
if (mIsLoading)
return;
mIsLoading = true;
if (mNodeName != null && !mNodeName.isEmpty())
requestTopicsByName(true);
else if (mTabName != null && !mTabName.isEmpty())
requestTopicsByTab(true);
else
requestTopicsById(true);
</DeepExtract>
} | v2ex-android | positive | 4,458 |
@Override
public void onClick(View v) {
DialogFragment dialog;
if (USE_BUILDERS) {
dialog = createDialogWithBuilders(group.getCheckedRadioButtonId());
} else {
dialog = createDialogWithSetters(group.getCheckedRadioButtonId());
}
dialog.show(getSupportFragmentManager(), TAG);
} | @Override
public void onClick(View v) {
<DeepExtract>
DialogFragment dialog;
if (USE_BUILDERS) {
dialog = createDialogWithBuilders(group.getCheckedRadioButtonId());
} else {
dialog = createDialogWithSetters(group.getCheckedRadioButtonId());
}
</DeepExtract>
dialog.show(getSupportFragmentManager(), TAG);
} | BottomSheetPickers | positive | 4,460 |
public void setSchema(String schema) throws SQLException {
super.validateState();
if (_session == null || _session.isClosed()) {
_session = null;
throw CassandraErrors.connectionClosedException();
}
if (!quiet) {
throw CassandraErrors.notSupportedException();
}
if (Strings.isNullOrEmpty(schema) || schema.equals(_keyspa... | public void setSchema(String schema) throws SQLException {
<DeepExtract>
super.validateState();
if (_session == null || _session.isClosed()) {
_session = null;
throw CassandraErrors.connectionClosedException();
}
</DeepExtract>
if (!quiet) {
throw CassandraErrors.notSupportedException();
}
if (Strings.isNullOrEmpty(sch... | cassandra-jdbc-driver | positive | 4,461 |
@Override
public void onRefresh() {
mPresenter.loadList(mPage, finalType, date);
} | @Override
public void onRefresh() {
<DeepExtract>
mPresenter.loadList(mPage, finalType, date);
</DeepExtract>
} | pivisionM | positive | 4,462 |
@Override
public void run() {
if (mLoadingDialog != null)
mLoadingDialog.dismiss();
try {
if (mTimer != null) {
mTimer.cancel();
mTimer = null;
}
if (mTimerTask != null) {
mTimerTask.cancel();
mTimerTask = null;
}
} catch (Exception e) {
e.printStackTrace();
}
} | @Override
public void run() {
if (mLoadingDialog != null)
mLoadingDialog.dismiss();
<DeepExtract>
try {
if (mTimer != null) {
mTimer.cancel();
mTimer = null;
}
if (mTimerTask != null) {
mTimerTask.cancel();
mTimerTask = null;
}
} catch (Exception e) {
e.printStackTrace();
}
</DeepExtract>
} | BlueskyAndroid | positive | 4,463 |
@Override
public E poll() {
if (this.sourceIterator.hasNext()) {
this.pollCount++;
result = this.sourceIterator.next();
} else {
int tailSize = this.tail.size();
if (tailSize > 0) {
this.pollCount++;
result = this.tail.remove(0);
} else {
result = null;
}
}
this.peekCount = Math.max(this.pollCount, this.peekCount);
ret... | @Override
public E poll() {
if (this.sourceIterator.hasNext()) {
this.pollCount++;
result = this.sourceIterator.next();
} else {
int tailSize = this.tail.size();
if (tailSize > 0) {
this.pollCount++;
result = this.tail.remove(0);
} else {
result = null;
}
}
<DeepExtract>
this.peekCount = Math.max(this.pollCount, this.p... | Entwined-STM | positive | 4,464 |
public static RestResponse failure(String message) {
RestResponse restResponse = new RestResponse();
if (false != null)
put("success", false);
return this;
if (message != null)
put("message", message);
return this;
return restResponse;
} | public static RestResponse failure(String message) {
RestResponse restResponse = new RestResponse();
if (false != null)
put("success", false);
return this;
<DeepExtract>
if (message != null)
put("message", message);
return this;
</DeepExtract>
return restResponse;
} | PinPlus | positive | 4,465 |
static int solve(int[] A) {
int result = 0;
int cumulative = A[0];
int power2 = 1;
for (int i = 1; i < A.length; i++) {
result = addMod(multiplyMod(result, 2), multiplyMod(A[i], cumulative));
cumulative = addMod(cumulative, multiplyMod(A[i], power2));
power2 = multiplyMod(power2, 2);
}
return (int) ((long) result * 2 %... | static int solve(int[] A) {
int result = 0;
int cumulative = A[0];
int power2 = 1;
for (int i = 1; i < A.length; i++) {
result = addMod(multiplyMod(result, 2), multiplyMod(A[i], cumulative));
cumulative = addMod(cumulative, multiplyMod(A[i], power2));
power2 = multiplyMod(power2, 2);
}
<DeepExtract>
return (int) ((long... | codechef | positive | 4,466 |
private void compileInto(String srcDirPath, String compDirPath) {
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
throw new IllegalStateException("no JavaCompiler provided for this platform");
}
final List<String> javaFilePathList = new ArrayList<String>();
final File mainSrc... | private void compileInto(String srcDirPath, String compDirPath) {
final JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
if (compiler == null) {
throw new IllegalStateException("no JavaCompiler provided for this platform");
}
final List<String> javaFilePathList = new ArrayList<String>();
final File mainSrc... | jafama | positive | 4,467 |
private void updateExpandPath(float progress) {
float yProgress = (1 - progress) * mHeight;
float xProgress = progress * mWidth;
mExpandPath.reset();
mExpandRectF.left = mIsBigBar ? xProgress / 2 + mBarOverDistance : xProgress / 2;
mExpandRectF.top = mIsBigBar ? progress * mHeight / 2 + mBarOverDistance : progress * mH... | private void updateExpandPath(float progress) {
float yProgress = (1 - progress) * mHeight;
float xProgress = progress * mWidth;
mExpandPath.reset();
mExpandRectF.left = mIsBigBar ? xProgress / 2 + mBarOverDistance : xProgress / 2;
mExpandRectF.top = mIsBigBar ? progress * mHeight / 2 + mBarOverDistance : progress * mH... | ZJYWidget | positive | 4,468 |
public void parseHeader() throws BadMapperException {
header = new int[16];
System.arraycopy(therom, 0, header, 0, 16);
if (header[0] == 'N' && header[1] == 'E' && header[2] == 'S' && header[3] == 0x1A) {
scrolltype = ((header[6] & (utils.BIT3)) != 0) ? Mapper.MirrorType.FOUR_SCREEN_MIRROR : ((header[6] & (utils.BIT0))... | public void parseHeader() throws BadMapperException {
<DeepExtract>
header = new int[16];
System.arraycopy(therom, 0, header, 0, 16);
</DeepExtract>
if (header[0] == 'N' && header[1] == 'E' && header[2] == 'S' && header[3] == 0x1A) {
scrolltype = ((header[6] & (utils.BIT3)) != 0) ? Mapper.MirrorType.FOUR_SCREEN_MIRROR ... | halfnes | positive | 4,469 |
void initialCapacity(String key, @Nullable String value) {
if (!initialCapacity == UNSET_INT) {
throw new IllegalArgumentException(String.format("initial capacity was already set to %,d", initialCapacity));
}
requireArgument((value != null) && !value.isEmpty(), "value of key %s was omitted", key);
try {
initialCapacity... | void initialCapacity(String key, @Nullable String value) {
if (!initialCapacity == UNSET_INT) {
throw new IllegalArgumentException(String.format("initial capacity was already set to %,d", initialCapacity));
}
<DeepExtract>
requireArgument((value != null) && !value.isEmpty(), "value of key %s was omitted", key);
try {
i... | l2cache | positive | 4,471 |
@Override
public void onExtendMenuContainerHide() {
faceNormal.setVisibility(View.VISIBLE);
faceChecked.setVisibility(View.INVISIBLE);
} | @Override
public void onExtendMenuContainerHide() {
<DeepExtract>
faceNormal.setVisibility(View.VISIBLE);
faceChecked.setVisibility(View.INVISIBLE);
</DeepExtract>
} | KTalk | positive | 4,472 |
public void shift_bytes_right(short numBytes) {
rm.locker.lock(bnh.fnc_shift_bytes_right_tmp);
Util.arrayCopyNonAtomic(this.value, (short) 0, bnh.fnc_shift_bytes_right_tmp, (short) 0, (short) (this.value.length));
Util.arrayCopyNonAtomic(bnh.fnc_shift_bytes_right_tmp, (short) 0, this.value, numBytes, (short) ((short) (... | public void shift_bytes_right(short numBytes) {
rm.locker.lock(bnh.fnc_shift_bytes_right_tmp);
Util.arrayCopyNonAtomic(this.value, (short) 0, bnh.fnc_shift_bytes_right_tmp, (short) 0, (short) (this.value.length));
Util.arrayCopyNonAtomic(bnh.fnc_shift_bytes_right_tmp, (short) 0, this.value, numBytes, (short) ((short) (... | JCMathLib | positive | 4,473 |
private void removeLanguage(String language) {
newDeckContext.getDestinationLanguages().remove(language);
flexboxLayout.removeAllViews();
for (String language : newDeckContext.getDestinationLanguages()) {
flexboxLayout.addView(createLanguageChip(language));
}
boolean hasLanguages = !newDeckContext.getDestinationLanguag... | private void removeLanguage(String language) {
newDeckContext.getDestinationLanguages().remove(language);
flexboxLayout.removeAllViews();
for (String language : newDeckContext.getDestinationLanguages()) {
flexboxLayout.addView(createLanguageChip(language));
}
<DeepExtract>
boolean hasLanguages = !newDeckContext.getDest... | translation-cards | positive | 4,474 |
@Override
public void buttonClick(final ClickEvent event) {
final GroupMember userElement = new GroupMember();
userElement.setUser(user);
userElement.setCreated(new Date());
final UserGroupMemberFlowlet userGroupMemberFlowlet = getFlow().forward(UserGroupMemberFlowlet.class);
this.user = userElement;
editor.setItem(new... | @Override
public void buttonClick(final ClickEvent event) {
final GroupMember userElement = new GroupMember();
userElement.setUser(user);
userElement.setCreated(new Date());
final UserGroupMemberFlowlet userGroupMemberFlowlet = getFlow().forward(UserGroupMemberFlowlet.class);
<DeepExtract>
this.user = userElement;
edit... | ilves | positive | 4,475 |
@Override
public String getHost() {
return "RemoteServiceHandle for " + "address: " + address + "and type: " + type + " .";
} | @Override
public String getHost() {
<DeepExtract>
return "RemoteServiceHandle for " + "address: " + address + "and type: " + type + " .";
</DeepExtract>
} | SilverWare | positive | 4,476 |
@Test
public void matches() throws ReflectiveOperationException {
checkMatches(Object.class, "hashCode");
Method method = Object.class.getMethod("equals", Object.class);
MethodKey methodKey = new MethodKey(method);
assertEquals(methodKey, new MethodKey(Object.class, "equals", Object.class));
assertTrue(methodKey.matche... | @Test
public void matches() throws ReflectiveOperationException {
checkMatches(Object.class, "hashCode");
<DeepExtract>
Method method = Object.class.getMethod("equals", Object.class);
MethodKey methodKey = new MethodKey(method);
assertEquals(methodKey, new MethodKey(Object.class, "equals", Object.class));
assertTrue(me... | dynamic-proxies-samples | positive | 4,477 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OPENLOG.initTag("hailongqiu", true);
setContentView(R.layout.demo_keyboard_activity);
input_tv = (TextView) findViewById(R.id.input_tv);
skbContainer = (SkbContainer) findViewById(R.id.skbContainer);
skbContainer.setSkbLa... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OPENLOG.initTag("hailongqiu", true);
setContentView(R.layout.demo_keyboard_activity);
input_tv = (TextView) findViewById(R.id.input_tv);
skbContainer = (SkbContainer) findViewById(R.id.skbContainer);
skbContainer.setSkbLa... | AndroidTVWidget | positive | 4,478 |
public void init(Properties p) throws WorkloadException {
table = p.getProperty(TABLENAME_PROPERTY, TABLENAME_PROPERTY_DEFAULT);
fieldcount = Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT));
IntegerGenerator fieldlengthgenerator;
String fieldlengthdistribution = p.getProperty(FIELD_L... | public void init(Properties p) throws WorkloadException {
table = p.getProperty(TABLENAME_PROPERTY, TABLENAME_PROPERTY_DEFAULT);
fieldcount = Integer.parseInt(p.getProperty(FIELD_COUNT_PROPERTY, FIELD_COUNT_PROPERTY_DEFAULT));
<DeepExtract>
IntegerGenerator fieldlengthgenerator;
String fieldlengthdistribution = p.getPr... | tapir | positive | 4,479 |
public void init(WorldConfig baseWorld) {
if (this.initialized) {
return;
}
if (baseWorld != null) {
if (this.enabled == null) {
this.enabled = baseWorld.enabled;
}
if (this.darknessHideBlocks == null) {
this.darknessHideBlocks = baseWorld.darknessHideBlocks;
}
if (this.antiTexturePackAndFreecam == null) {
this.antiTex... | public void init(WorldConfig baseWorld) {
if (this.initialized) {
return;
}
if (baseWorld != null) {
if (this.enabled == null) {
this.enabled = baseWorld.enabled;
}
if (this.darknessHideBlocks == null) {
this.darknessHideBlocks = baseWorld.darknessHideBlocks;
}
if (this.antiTexturePackAndFreecam == null) {
this.antiTex... | Orebfuscator | positive | 4,480 |
public static Type getMethodType(final String methodDescriptor) {
int len;
switch(methodDescriptor.toCharArray()[0]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
case 'B':
return BYTE_TYPE;
case 'S':
return SHORT_TYPE;
case 'I':
return INT_TYPE;
case 'F':
return FLOAT_TYPE;
c... | public static Type getMethodType(final String methodDescriptor) {
<DeepExtract>
int len;
switch(methodDescriptor.toCharArray()[0]) {
case 'V':
return VOID_TYPE;
case 'Z':
return BOOLEAN_TYPE;
case 'C':
return CHAR_TYPE;
case 'B':
return BYTE_TYPE;
case 'S':
return SHORT_TYPE;
case 'I':
return INT_TYPE;
case 'F':
return... | bsl | positive | 4,481 |
protected void processBackViewRelease(float xvel, float yvel) {
switch(mShowEdge) {
case Left:
if (xvel == 0) {
if (getBackView().getLeft() > (0 - mDragDistance * 0.5f)) {
open();
return;
}
} else if (xvel > 0) {
open();
return;
}
break;
case Right:
if (xvel == 0) {
if (getBackView().getLeft() < (getMeasuredWidth() - m... | protected void processBackViewRelease(float xvel, float yvel) {
switch(mShowEdge) {
case Left:
if (xvel == 0) {
if (getBackView().getLeft() > (0 - mDragDistance * 0.5f)) {
open();
return;
}
} else if (xvel > 0) {
open();
return;
}
break;
case Right:
if (xvel == 0) {
if (getBackView().getLeft() < (getMeasuredWidth() - m... | Teameeting-Android | positive | 4,482 |
public void draw(Graphics g) {
if (firstDraw) {
getCurrentContext().initGraphics(g);
firstDraw = false;
}
if (getCurrentContext().isClearBeforeDraw()) {
g.setColor(getCurrentContext().getBackgroundColor());
g.fillRect(0, 0, getCurrentContext().getW(), getCurrentContext().getH());
}
g.setFps(fps);
getCurrentContext().dr... | public void draw(Graphics g) {
if (firstDraw) {
getCurrentContext().initGraphics(g);
firstDraw = false;
}
if (getCurrentContext().isClearBeforeDraw()) {
g.setColor(getCurrentContext().getBackgroundColor());
g.fillRect(0, 0, getCurrentContext().getW(), getCurrentContext().getH());
}
g.setFps(fps);
getCurrentContext().dr... | etyl | positive | 4,483 |
@Override
protected void notBusy() throws Exception {
if ((onIdle != null) && inbox.isIdle()) {
flush(true);
onIdle.run();
}
boolean result = false;
final Iterator<Map.Entry<ReactorMtImpl, ArrayDeque<RequestMtImpl<?>>>> iter = outbox.getIterator();
if (iter != null) {
while (iter.hasNext()) {
result = true;
final Map.E... | @Override
protected void notBusy() throws Exception {
if ((onIdle != null) && inbox.isIdle()) {
flush(true);
onIdle.run();
}
<DeepExtract>
boolean result = false;
final Iterator<Map.Entry<ReactorMtImpl, ArrayDeque<RequestMtImpl<?>>>> iter = outbox.getIterator();
if (iter != null) {
while (iter.hasNext()) {
result = tru... | JActor2 | positive | 4,484 |
private void onLoadFail(@FwUpgradeCallback.UpgradeErrorType int errorCode) {
if (mCallback != null)
mCallback.onLoadFwError(FwUpgradeConsoleNucleo2.this, mFile, errorCode);
synchronized (this) {
mConsole.removeDebugOutputListener(mCurrentListener);
mConsole.addDebugOutputListener(null);
mCurrentListener = null;
}
} | private void onLoadFail(@FwUpgradeCallback.UpgradeErrorType int errorCode) {
if (mCallback != null)
mCallback.onLoadFwError(FwUpgradeConsoleNucleo2.this, mFile, errorCode);
<DeepExtract>
synchronized (this) {
mConsole.removeDebugOutputListener(mCurrentListener);
mConsole.addDebugOutputListener(null);
mCurrentListener =... | BlueSTSDK_GUI_Android | positive | 4,485 |
@Override
public void executeOperation(LdbcUpdate6AddPost operation, DbConnectionState dbConnectionState, ResultReporter resultReporter) throws DbException {
try {
List<ObjectOutputStream> oStreams = (TorcDb2ClientConnectionState) dbConnectionState.getObjectOutputStreams();
List<ObjectInputStream> iStreams = (TorcDb2Cl... | @Override
public void executeOperation(LdbcUpdate6AddPost operation, DbConnectionState dbConnectionState, ResultReporter resultReporter) throws DbException {
<DeepExtract>
try {
List<ObjectOutputStream> oStreams = (TorcDb2ClientConnectionState) dbConnectionState.getObjectOutputStreams();
List<ObjectInputStream> iStream... | ldbc-snb-impls | positive | 4,486 |
private void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
mScrollListener = this;
mHeaderView = new XListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
mHeaderTimeView = (TextView) mHeaderView.fin... | private void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
<DeepExtract>
mScrollListener = this;
</DeepExtract>
mHeaderView = new XListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
mHeaderTimeView... | LDXY | positive | 4,487 |
private void updateSelectedResourceId(@NonNull String resourceId) {
if (resourceId.isEmpty()) {
mSelectedResource = null;
mOriginalStringTextView.setText("");
mTranslatedStringEditText.setText("");
} else {
mSelectedResource = mDefaultResources.getTag(resourceId);
mOriginalStringTextView.setText(mSelectedResource.getCo... | private void updateSelectedResourceId(@NonNull String resourceId) {
if (resourceId.isEmpty()) {
mSelectedResource = null;
mOriginalStringTextView.setText("");
mTranslatedStringEditText.setText("");
} else {
mSelectedResource = mDefaultResources.getTag(resourceId);
mOriginalStringTextView.setText(mSelectedResource.getCo... | Stringlate | positive | 4,488 |
public Criteria andCreatorNotIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "creator" + " cannot be null");
}
criteria.add(new Criterion("creator not in", values));
return (Criteria) this;
} | public Criteria andCreatorNotIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "creator" + " cannot be null");
}
criteria.add(new Criterion("creator not in", values));
</DeepExtract>
return (Criteria) this;
} | dtsopensource | positive | 4,489 |
@Override
public void sendError(int sc) throws IOException {
if (sc == SC_UNAUTHORIZED) {
StringBuilder v = new StringBuilder();
v.append("Digest");
v.append(" realm=\"" + REALM_NAME + "\"");
v.append(", domain=\"" + getDomain() + "\"");
v.append(", qop=\"auth\"");
if (stale != null) {
v.append(", stale=" + stale);
}
v... | @Override
public void sendError(int sc) throws IOException {
<DeepExtract>
if (sc == SC_UNAUTHORIZED) {
StringBuilder v = new StringBuilder();
v.append("Digest");
v.append(" realm=\"" + REALM_NAME + "\"");
v.append(", domain=\"" + getDomain() + "\"");
v.append(", qop=\"auth\"");
if (stale != null) {
v.append(", stale="... | mini-git-server | positive | 4,490 |
private final void jjCheckNAddStates(int start) {
if (jjrounds[jjnextStates[start]] != jjround) {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
jjrounds[jjnextStates[start]] = jjround;
}
if (jjrounds[jjnextStates[start + 1]] != jjround) {
jjstateSet[jjnewStateCnt++] = jjnextStates[start + 1];
jjrounds[jjnextStates... | private final void jjCheckNAddStates(int start) {
if (jjrounds[jjnextStates[start]] != jjround) {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
jjrounds[jjnextStates[start]] = jjround;
}
<DeepExtract>
if (jjrounds[jjnextStates[start + 1]] != jjround) {
jjstateSet[jjnewStateCnt++] = jjnextStates[start + 1];
jjround... | dragmath | positive | 4,491 |
public List<WebElement> getOptions() {
driver = WebUIDriver.getWebDriver();
element = driver.findElement(this.getBy());
try {
select = getNewSelectElement(element);
options = select.getOptions();
} catch (UnexpectedTagNameException e) {
if (element.getTagName().equalsIgnoreCase("ul")) {
options = element.findElements(B... | public List<WebElement> getOptions() {
<DeepExtract>
driver = WebUIDriver.getWebDriver();
element = driver.findElement(this.getBy());
try {
select = getNewSelectElement(element);
options = select.getOptions();
} catch (UnexpectedTagNameException e) {
if (element.getTagName().equalsIgnoreCase("ul")) {
options = element.... | seleniumtestsframework | positive | 4,492 |
public void semant(SymbolTable objectTable, SymbolTable methodTable, ClassTable classTable, class_c c) {
if (ClassTable.DEBUG) {
System.out.println("---Integer: " + token.getString() + ", " + getLineNumber());
}
type = TreeConstants.Int;
return this;
} | public void semant(SymbolTable objectTable, SymbolTable methodTable, ClassTable classTable, class_c c) {
if (ClassTable.DEBUG) {
System.out.println("---Integer: " + token.getString() + ", " + getLineNumber());
}
<DeepExtract>
type = TreeConstants.Int;
return this;
</DeepExtract>
} | Cool-Compiler | positive | 4,493 |
@Override
CMAApiKey method() {
assertNotNull(spaceId, "spaceId");
assertNotNull(key, "key");
return service.create(spaceId, key).blockingFirst();
} | @Override
CMAApiKey method() {
<DeepExtract>
assertNotNull(spaceId, "spaceId");
assertNotNull(key, "key");
return service.create(spaceId, key).blockingFirst();
</DeepExtract>
} | contentful-management.java | positive | 4,494 |
@Override
public void setImageResource(@DrawableRes int resId) {
if (getResources().getDrawable(resId) instanceof BitmapDrawable && mCornerRadius > 0) {
Bitmap bitmap = ((BitmapDrawable) getResources().getDrawable(resId)).getBitmap();
if (bitmap != null) {
super.setImageDrawable(getRoundedDrawable(getContext(), bitmap,... | @Override
public void setImageResource(@DrawableRes int resId) {
<DeepExtract>
if (getResources().getDrawable(resId) instanceof BitmapDrawable && mCornerRadius > 0) {
Bitmap bitmap = ((BitmapDrawable) getResources().getDrawable(resId)).getBitmap();
if (bitmap != null) {
super.setImageDrawable(getRoundedDrawable(getCont... | BGAPhotoPicker-Android | positive | 4,495 |
@Override
public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
int count = db.delete(UserDao.TABLENAME, getWhere(uri, selection), selectionArgs);
if (getContext() != null) {
getContext().getContentResolver().notifyChange(uri, null);
}
return count;
} | @Override
public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
int count = db.delete(UserDao.TABLENAME, getWhere(uri, selection), selectionArgs);
<DeepExtract>
if (getContext() != null) {
getContext().getContentResolver().notifyChange(uri, null);
}
</DeepExtract>
return count;
} | AndroidArt | positive | 4,496 |
public static void main(String[] args) {
int[] objs = { 1, 2, 3, 4, 5, 6, 7 };
List<DemoTree> list = new ArrayList<>();
for (int i : objs) {
list.add(new DemoTree(i));
}
tree = list.get(0);
for (int i = 0; i < objs.length / 2; i++) {
list.get(i).setLeft(list.get(i * 2 + 1));
if (i * 2 + 2 < objs.length) {
list.get(i).s... | public static void main(String[] args) {
int[] objs = { 1, 2, 3, 4, 5, 6, 7 };
List<DemoTree> list = new ArrayList<>();
for (int i : objs) {
list.add(new DemoTree(i));
}
tree = list.get(0);
for (int i = 0; i < objs.length / 2; i++) {
list.get(i).setLeft(list.get(i * 2 + 1));
if (i * 2 + 2 < objs.length) {
list.get(i).s... | springboot-technology | positive | 4,498 |
@RestrictTo(LIBRARY_GROUP)
public void setChildInsets(Object insets, boolean draw) {
mLastInsets = insets;
mDrawStatusBarBackground = draw;
setWillNotDraw(!draw && getBackground() == null);
if (!mInLayout) {
super.requestLayout();
}
} | @RestrictTo(LIBRARY_GROUP)
public void setChildInsets(Object insets, boolean draw) {
mLastInsets = insets;
mDrawStatusBarBackground = draw;
setWillNotDraw(!draw && getBackground() == null);
<DeepExtract>
if (!mInLayout) {
super.requestLayout();
}
</DeepExtract>
} | FakeVibrato | positive | 4,499 |
@Test
public void validateFolderPattern_errorClearedOnChange() {
PathPatternDialog dialog = new PathPatternDialog(shell, "src/");
dialog.setBlockOnOpen(false);
dialog.open();
getFolderPatternText(dialog).setText("src//");
getFolderPatternText(dialog).setText("src/");
assertNull(dialog.getErrorMessage());
} | @Test
public void validateFolderPattern_errorClearedOnChange() {
PathPatternDialog dialog = new PathPatternDialog(shell, "src/");
<DeepExtract>
dialog.setBlockOnOpen(false);
dialog.open();
</DeepExtract>
getFolderPatternText(dialog).setText("src//");
getFolderPatternText(dialog).setText("src/");
assertNull(dialog.getEr... | jshint-eclipse | positive | 4,500 |
@Test
public final void testPillar() {
LocalCall<Boolean> call = Match.pillar("foo", Optional.empty());
assertEquals("match.pillar", call.getPayload().get("fun"));
stubFor(any(urlMatching("/")).willReturn(aResponse().withStatus(HttpURLConnection.HTTP_OK).withHeader("Content-Type", "application/json").withBody(JSON_MATC... | @Test
public final void testPillar() {
LocalCall<Boolean> call = Match.pillar("foo", Optional.empty());
assertEquals("match.pillar", call.getPayload().get("fun"));
<DeepExtract>
stubFor(any(urlMatching("/")).willReturn(aResponse().withStatus(HttpURLConnection.HTTP_OK).withHeader("Content-Type", "application/json").with... | salt-netapi-client | positive | 4,502 |
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
View view = View.inflate(getContext(), R.layout.dialog_date_picker, null);
dialog.setContentView(view);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSP... | @NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
View view = View.inflate(getContext(), R.layout.dialog_date_picker, null);
dialog.setContentView(view);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSP... | Android-development-with-example | positive | 4,503 |
public void setAllcount(TreeMap<String, Integer> allcount) {
List<List<Object>> result = new ArrayList<>();
for (Entry<String, Integer> tmp : allcount.entrySet()) {
List<Object> list = new ArrayList<>();
list.add(tmp.getKey());
list.add(tmp.getValue());
result.add(list);
}
return result;
} | public void setAllcount(TreeMap<String, Integer> allcount) {
<DeepExtract>
List<List<Object>> result = new ArrayList<>();
for (Entry<String, Integer> tmp : allcount.entrySet()) {
List<Object> list = new ArrayList<>();
list.add(tmp.getKey());
list.add(tmp.getValue());
result.add(list);
}
return result;
</DeepExtract>
} | weibo-service | positive | 4,504 |
private void handle401(final YokeRequest request, final Handler<Object> next) {
YokeResponse response = request.response();
response.putHeader("WWW-Authenticate", "Basic realm=\"" + getRealm(request) + "\"");
response.setStatusCode(401);
if ("No authorization token" != null) {
request.put("user", user);
next.handle(nul... | private void handle401(final YokeRequest request, final Handler<Object> next) {
YokeResponse response = request.response();
response.putHeader("WWW-Authenticate", "Basic realm=\"" + getRealm(request) + "\"");
response.setStatusCode(401);
<DeepExtract>
if ("No authorization token" != null) {
request.put("user", user);
n... | yoke | positive | 4,505 |
void setupSetter(Class targetClass) {
Method setterOrGetter = null;
try {
mPropertyMapLock.writeLock().lock();
HashMap<String, Method> propertyMap = sSetterPropertyMap.get(targetClass);
if (propertyMap != null) {
setterOrGetter = propertyMap.get(mPropertyName);
}
if (setterOrGetter == null) {
setterOrGetter = getProper... | void setupSetter(Class targetClass) {
<DeepExtract>
Method setterOrGetter = null;
try {
mPropertyMapLock.writeLock().lock();
HashMap<String, Method> propertyMap = sSetterPropertyMap.get(targetClass);
if (propertyMap != null) {
setterOrGetter = propertyMap.get(mPropertyName);
}
if (setterOrGetter == null) {
setterOrGett... | AwesomeDrawer | positive | 4,507 |
public void destroyJoint(Joint joint) {
DwBody shp = getShape(joint);
if (shp != null) {
shp.release();
}
super.destroyJoint(joint);
} | public void destroyJoint(Joint joint) {
<DeepExtract>
DwBody shp = getShape(joint);
if (shp != null) {
shp.release();
}
</DeepExtract>
super.destroyJoint(joint);
} | LiquidFunProcessing | positive | 4,508 |
public Criteria andTypeIsNotNull() {
if ("type is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("type is not null"));
return (Criteria) this;
} | public Criteria andTypeIsNotNull() {
<DeepExtract>
if ("type is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("type is not null"));
</DeepExtract>
return (Criteria) this;
} | Whome | positive | 4,509 |
public static com.conveyal.transitwand.TransitWandProtos.Upload parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
com.conveyal.transitwand.TransitWandProtos.Upload.Route.Point result = buildPartial();
if (!result.isInitialized... | public static com.conveyal.transitwand.TransitWandProtos.Upload parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException {
<DeepExtract>
com.conveyal.transitwand.TransitWandProtos.Upload.Route.Point result = buildPartial();
if (!result... | transit-wand | positive | 4,510 |
public void setProgressRotation(float rotation) {
mRotation = rotation;
invalidateSelf();
} | public void setProgressRotation(float rotation) {
<DeepExtract>
mRotation = rotation;
invalidateSelf();
</DeepExtract>
} | AgentWebX5 | positive | 4,511 |
private void launchEmulator() throws IOException {
Stage stage = Stages.getPrimaryStage();
stage.setTitle(APP_TITLE + (appConfig.isDeveloperMode() ? " (Developer Mode)" : ""));
stage.setIconified(false);
stage.setAlwaysOnTop(appConfig.isAlwaysOnTop());
stage.setMinWidth(appConfig.getMinWindowWidth());
stage.setMinHeigh... | private void launchEmulator() throws IOException {
Stage stage = Stages.getPrimaryStage();
stage.setTitle(APP_TITLE + (appConfig.isDeveloperMode() ? " (Developer Mode)" : ""));
stage.setIconified(false);
stage.setAlwaysOnTop(appConfig.isAlwaysOnTop());
stage.setMinWidth(appConfig.getMinWindowWidth());
stage.setMinHeigh... | glcd-emulator | positive | 4,512 |
public static Calendar fromYyyyMmDdHhMmSs(String str) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.setTime(sdf.parse(str));
return cal;
} | public static Calendar fromYyyyMmDdHhMmSs(String str) throws ParseException {
<DeepExtract>
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
cal.setTime(sdf.parse(str));
return cal;
</DeepExtract>
} | hyena | positive | 4,513 |
public Builder indexRepository(final String pIndex) {
indexRepository = pIndex;
return this;
} | public Builder indexRepository(final String pIndex) {
<DeepExtract>
indexRepository = pIndex;
</DeepExtract>
return this;
} | semantic-repository | positive | 4,514 |
public void widgetSelected(SelectionEvent arg0) {
String sGitHubUserName = getGitHubUserName();
if (sGitHubUserName != null) {
PopulateListTaskWithProgress task = new PopulateListTaskWithProgress(getTelosysToolsCfgFromFields(), sGitHubUserName, _listGitHubRepositories, _tLogger);
ProgressMonitorDialog progressMonitorDi... | public void widgetSelected(SelectionEvent arg0) {
<DeepExtract>
String sGitHubUserName = getGitHubUserName();
if (sGitHubUserName != null) {
PopulateListTaskWithProgress task = new PopulateListTaskWithProgress(getTelosysToolsCfgFromFields(), sGitHubUserName, _listGitHubRepositories, _tLogger);
ProgressMonitorDialog pro... | TelosysToolsPlugin | positive | 4,515 |
private AixDetailedWidget initialize() throws AixWidgetDrawException, AixWidgetDataException {
mResolver = mContext.getContentResolver();
Calendar calendar = Calendar.getInstance(mUtcTimeZone);
mTimeNow = calendar.getTimeInMillis();
truncateHour(calendar);
calendar.add(Calendar.HOUR_OF_DAY, 1);
calendar.add(Calendar.HO... | private AixDetailedWidget initialize() throws AixWidgetDrawException, AixWidgetDataException {
mResolver = mContext.getContentResolver();
Calendar calendar = Calendar.getInstance(mUtcTimeZone);
mTimeNow = calendar.getTimeInMillis();
truncateHour(calendar);
calendar.add(Calendar.HOUR_OF_DAY, 1);
calendar.add(Calendar.HO... | aix-weather-widget | positive | 4,516 |
public void http_lt1(String name) {
try {
Thread.sleep((long) (Math.random() * 500));
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("测试结果:hi1 " + name);
try {
Thread.sleep((long) (Math.random() * 500));
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println... | public void http_lt1(String name) {
try {
Thread.sleep((long) (Math.random() * 500));
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("测试结果:hi1 " + name);
<DeepExtract>
try {
Thread.sleep((long) (Math.random() * 500));
} catch (InterruptedException e) {
e.printStackTrace();
}
Syst... | distributed-dev-learning | positive | 4,517 |
private void goToNext() {
float extra = 0;
if (scale != 1) {
extra = (getContainerViewWidth() - centerImage.getImageWidth()) / 2 * scale;
}
switchImageAfterAnimation = 1;
animateTo(scale, minX - getContainerViewWidth() - extra - PAGE_SPACING / 2, translationY, false, 250);
} | private void goToNext() {
float extra = 0;
if (scale != 1) {
extra = (getContainerViewWidth() - centerImage.getImageWidth()) / 2 * scale;
}
switchImageAfterAnimation = 1;
<DeepExtract>
animateTo(scale, minX - getContainerViewWidth() - extra - PAGE_SPACING / 2, translationY, false, 250);
</DeepExtract>
} | TelegramGallery | positive | 4,519 |
public Map[] bannerZoneStatistics(Integer id, Date startDate) throws XmlRpcException {
if (!isValidSessionId())
throw new IllegalArgumentException("Not logined to server");
return bannerService.bannerZoneStatistics(id, startDate);
} | public Map[] bannerZoneStatistics(Integer id, Date startDate) throws XmlRpcException {
<DeepExtract>
if (!isValidSessionId())
throw new IllegalArgumentException("Not logined to server");
</DeepExtract>
return bannerService.bannerZoneStatistics(id, startDate);
} | openx-2.8.8 | positive | 4,520 |
public Criteria andUserAddressLessThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "userAddress" + " cannot be null");
}
criteria.add(new Criterion("user_address <", value));
return (Criteria) this;
} | public Criteria andUserAddressLessThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "userAddress" + " cannot be null");
}
criteria.add(new Criterion("user_address <", value));
</DeepExtract>
return (Criteria) this;
} | SSM_BookSystem | positive | 4,522 |
public Criteria andPasswordIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "password" + " cannot be null");
}
criteria.add(new Criterion("password in", values));
return (Criteria) this;
} | public Criteria andPasswordIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "password" + " cannot be null");
}
criteria.add(new Criterion("password in", values));
</DeepExtract>
return (Criteria) this;
} | garbage-collection | positive | 4,523 |
public static long parseDate(String date) {
for (int i = 0; i < _dateReceive.length; i++) {
if (_dateReceive[i] == null) {
_dateReceive[i] = new SimpleDateFormat(__dateReceiveFmt[i], Locale.US);
_dateReceive[i].setTimeZone(__GMT);
}
try {
Date date = (Date) _dateReceive[i].parseObject(date);
return date.getTime();
} ca... | public static long parseDate(String date) {
<DeepExtract>
for (int i = 0; i < _dateReceive.length; i++) {
if (_dateReceive[i] == null) {
_dateReceive[i] = new SimpleDateFormat(__dateReceiveFmt[i], Locale.US);
_dateReceive[i].setTimeZone(__GMT);
}
try {
Date date = (Date) _dateReceive[i].parseObject(date);
return date.g... | pc5s | positive | 4,524 |
public ChangesetStoreState getChangesetState(int sequenceNumber) throws Exception {
HttpGet get = new HttpGet(getChangesetStateURL(sequenceNumber).toString());
setUserAgent(get);
HttpResponse httpResponse = getHttpClient().execute(get);
if (httpResponse.getStatusLine().getStatusCode() != 200) {
log.info("HTTP " + httpR... | public ChangesetStoreState getChangesetState(int sequenceNumber) throws Exception {
<DeepExtract>
HttpGet get = new HttpGet(getChangesetStateURL(sequenceNumber).toString());
setUserAgent(get);
HttpResponse httpResponse = getHttpClient().execute(get);
if (httpResponse.getStatusLine().getStatusCode() != 200) {
log.info("... | osm-common | positive | 4,525 |
@Override
public Tab setTabPadding(int tabPaddingStart, int tabPaddingTop, int tabPaddingEnd, int tabPaddingBottom) {
this.tabPaddingStart = tabPaddingStart;
this.tabPaddingTop = tabPaddingTop;
this.tabPaddingEnd = tabPaddingEnd;
this.tabPaddingBottom = tabPaddingBottom;
ViewCompat.setPaddingRelative(this, getTabPaddin... | @Override
public Tab setTabPadding(int tabPaddingStart, int tabPaddingTop, int tabPaddingEnd, int tabPaddingBottom) {
this.tabPaddingStart = tabPaddingStart;
this.tabPaddingTop = tabPaddingTop;
this.tabPaddingEnd = tabPaddingEnd;
this.tabPaddingBottom = tabPaddingBottom;
<DeepExtract>
ViewCompat.setPaddingRelative(this... | JTabLayout | positive | 4,526 |
public static int getNum1(int n) {
if (n < 1) {
return 0;
}
if (1 == n - 1) {
return 2;
}
if (1 == n) {
return 1;
}
return process(1 + 1, n) + process(1 + 2, n);
} | public static int getNum1(int n) {
if (n < 1) {
return 0;
}
<DeepExtract>
if (1 == n - 1) {
return 2;
}
if (1 == n) {
return 1;
}
return process(1 + 1, n) + process(1 + 2, n);
</DeepExtract>
} | ZuoChengyun | positive | 4,527 |
public void release() {
if (pingTask != null) {
pingTask.cancel();
}
if (timer != null) {
timer.cancel();
timer = null;
}
} | public void release() {
<DeepExtract>
if (pingTask != null) {
pingTask.cancel();
}
</DeepExtract>
if (timer != null) {
timer.cancel();
timer = null;
}
} | dcs-sdk-java | positive | 4,529 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
wpConfigPanel.store();
DialogDescriptor dialogDescriptor = new DialogDescriptor(wpConfigPanel, "wp-config", true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
Object result = DialogDisplayer.getDefault().notify(dialogDescriptor);
if (result != DialogDescr... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
wpConfigPanel.store();
DialogDescriptor dialogDescriptor = new DialogDescriptor(wpConfigPanel, "wp-config", true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
Object result = DialogDisplayer.getDefault().notify(dialogDescriptor);
if (result ... | netbeans-wordpress-plugin | positive | 4,530 |
@Override
public <W extends IBaseTabPageAdapter<T, V>> W remove(int position) {
list_bean.remove(position);
return (W) this;
notifyDataSetChanged();
return (W) this;
} | @Override
public <W extends IBaseTabPageAdapter<T, V>> W remove(int position) {
<DeepExtract>
list_bean.remove(position);
return (W) this;
</DeepExtract>
notifyDataSetChanged();
return (W) this;
} | TabLayoutNiubility | positive | 4,531 |
public boolean hashPath(String path, LinkedHashMap value) {
if (tophash != null)
return;
if (chars == null)
return;
setTopHash(!cyrus ? readHashMap(true) : readCyrusHash(true));
return setObject(tophash, path, value);
} | public boolean hashPath(String path, LinkedHashMap value) {
if (tophash != null)
return;
if (chars == null)
return;
setTopHash(!cyrus ? readHashMap(true) : readCyrusHash(true));
<DeepExtract>
return setObject(tophash, path, value);
</DeepExtract>
} | NetMash | positive | 4,532 |
public static void removeFromTablist(Player player) {
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle());
for (Player all : Bukkit.getOnlinePlayers()) {
((CraftPlayer) all).getHandle().playerConnection.sendPacket(packet);
}
} | public static void removeFromTablist(Player player) {
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ((CraftPlayer) player).getHandle());
<DeepExtract>
for (Player all : Bukkit.getOnlinePlayers()) {
((CraftPlayer) all).getHandle().playerConnection.sendPacket(packet);
}
... | BetterNick | positive | 4,533 |
private String updateSQL(SafeAppendable builder) {
if (!tables.isEmpty()) {
if (!builder.isEmpty()) {
builder.append("\n");
}
builder.append("UPDATE");
builder.append(" ");
builder.append("");
String last = "________";
for (int i = 0, n = tables.size(); i < n; i++) {
String part = tables.get(i);
if (i > 0 && !part.equa... | private String updateSQL(SafeAppendable builder) {
if (!tables.isEmpty()) {
if (!builder.isEmpty()) {
builder.append("\n");
}
builder.append("UPDATE");
builder.append(" ");
builder.append("");
String last = "________";
for (int i = 0, n = tables.size(); i < n; i++) {
String part = tables.get(i);
if (i > 0 && !part.equa... | EasyJdbc | positive | 4,534 |
public void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) {
int source = code.length;
code.putByte(Opcodes.TABLESWITCH);
code.length += (4 - code.length % 4) % 4;
dflt.put(this, code, source, true);
code.putInt(min).putInt(max);
for (int i = 0; i < labels.length; ++i) {
labe... | public void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label[] labels) {
int source = code.length;
code.putByte(Opcodes.TABLESWITCH);
code.length += (4 - code.length % 4) % 4;
dflt.put(this, code, source, true);
code.putInt(min).putInt(max);
for (int i = 0; i < labels.length; ++i) {
labe... | xson | positive | 4,535 |
private void expandValidArgumentFile(String fileName, File file, List<String> arguments, Set<String> visited) {
return file.getAbsolutePath().isOption() ? addOption((OptionSpec) file.getAbsolutePath()) : addPositional((PositionalParamSpec) file.getAbsolutePath());
List<String> result = new ArrayList<String>();
LineNumb... | private void expandValidArgumentFile(String fileName, File file, List<String> arguments, Set<String> visited) {
return file.getAbsolutePath().isOption() ? addOption((OptionSpec) file.getAbsolutePath()) : addPositional((PositionalParamSpec) file.getAbsolutePath());
List<String> result = new ArrayList<String>();
LineNumb... | gitruler | positive | 4,536 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.