before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
public static boolean schemaWritable(Schema sourceSchema, Schema destinationSchema, boolean regardFieldOrder, boolean enableModeCheckForSchemaFields) {
if (sourceSchema == destinationSchema) {
return true;
}
if (sourceSchema == null || destinationSchema == null) {
return false;
}
if (regardFieldOrder) {
return sourceSc... | public static boolean schemaWritable(Schema sourceSchema, Schema destinationSchema, boolean regardFieldOrder, boolean enableModeCheckForSchemaFields) {
if (sourceSchema == destinationSchema) {
return true;
}
if (sourceSchema == null || destinationSchema == null) {
return false;
}
if (regardFieldOrder) {
return sourceSc... | spark-bigquery-connector | positive | 5,143 |
@Override
public void changedUpdate(DocumentEvent e) {
try {
boolean differenceFound = Integer.parseInt(chromaBorderInput[0].getText()) != config.getChromaBorder().x || Integer.parseInt(chromaBorderInput[1].getText()) != config.getChromaBorder().y || Integer.parseInt(chromaBorderInput[2].getText()) != config.getChromaB... | @Override
public void changedUpdate(DocumentEvent e) {
<DeepExtract>
try {
boolean differenceFound = Integer.parseInt(chromaBorderInput[0].getText()) != config.getChromaBorder().x || Integer.parseInt(chromaBorderInput[1].getText()) != config.getChromaBorder().y || Integer.parseInt(chromaBorderInput[2].getText()) != con... | ChatGameFontificator | positive | 5,144 |
public static boolean isNotNeedInject(String innerClassName) {
if (innerClassName == null) {
return false;
}
if (innerClassName.indexOf('$') >= 0) {
return true;
}
for (String prefix : excludePackagePrefix) {
if (innerClassName.startsWith(prefix)) {
return true;
}
}
for (String exp : excludePackageExp) {
if (StrMatchUt... | public static boolean isNotNeedInject(String innerClassName) {
if (innerClassName == null) {
return false;
}
if (innerClassName.indexOf('$') >= 0) {
return true;
}
<DeepExtract>
for (String prefix : excludePackagePrefix) {
if (innerClassName.startsWith(prefix)) {
return true;
}
}
for (String exp : excludePackageExp) {
... | MyPerf4J | positive | 5,147 |
@Override
public void onClick(View v) {
snackBar.dismiss();
if (cursorAdapter != null) {
cursorAdapter.setAllItemsChecked(false);
}
} | @Override
public void onClick(View v) {
snackBar.dismiss();
<DeepExtract>
if (cursorAdapter != null) {
cursorAdapter.setAllItemsChecked(false);
}
</DeepExtract>
} | BlackList | positive | 5,148 |
@Nonnull
public static Date getRequiredDate(Map obj, String key) {
Object value = obj.get(key);
if (value == null) {
throw new InvalidObjectDataException(String.format("Required property \"%s\" is missing or null", key));
}
if (value.toString() == null)
return null;
try {
return ((DateFormat) YYYYMMDD_UTC_FORMAT.clone(... | @Nonnull
public static Date getRequiredDate(Map obj, String key) {
Object value = obj.get(key);
if (value == null) {
throw new InvalidObjectDataException(String.format("Required property \"%s\" is missing or null", key));
}
<DeepExtract>
if (value.toString() == null)
return null;
try {
return ((DateFormat) YYYYMMDD_UTC... | buendia | positive | 5,149 |
public TreeNode sortedListToBST1(ListNode head) {
if (head == null) {
return null;
}
int len = 0;
ListNode cur = head;
while (cur != null) {
len++;
cur = cur.next;
}
int[] nums = new int[len];
cur = head;
int index = 0;
while (cur != null) {
nums[index++] = cur.val;
cur = cur.next;
}
if (0 == nums.length) {
return null... | public TreeNode sortedListToBST1(ListNode head) {
if (head == null) {
return null;
}
int len = 0;
ListNode cur = head;
while (cur != null) {
len++;
cur = cur.next;
}
int[] nums = new int[len];
cur = head;
int index = 0;
while (cur != null) {
nums[index++] = cur.val;
cur = cur.next;
}
<DeepExtract>
if (0 == nums.length)... | LeetCodeAndSwordToOffer | positive | 5,150 |
public static DataUnit equiv(EquivEdge value) {
DataUnit x = new DataUnit();
if (value == null)
throw new NullPointerException();
setField_ = _Fields.EQUIV;
value_ = value;
return x;
} | public static DataUnit equiv(EquivEdge value) {
DataUnit x = new DataUnit();
<DeepExtract>
if (value == null)
throw new NullPointerException();
setField_ = _Fields.EQUIV;
value_ = value;
</DeepExtract>
return x;
} | big-data-src | positive | 5,151 |
public Criteria andPasswordNotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "password" + " cannot be null");
}
criteria.add(new Criterion("password not between", value1, value2));
return (Criteria) this;
} | public Criteria andPasswordNotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "password" + " cannot be null");
}
criteria.add(new Criterion("password not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | ssmxiaomi | positive | 5,152 |
public static <L, R extends Throwable> GenericValues<L, R> both(@Nonnull L one, @Nonnull R two) {
return (GenericValues<L, R>) this;
} | public static <L, R extends Throwable> GenericValues<L, R> both(@Nonnull L one, @Nonnull R two) {
<DeepExtract>
return (GenericValues<L, R>) this;
</DeepExtract>
} | dataenum | positive | 5,153 |
public OrderByClauseBuilder<I> property(String sql) {
return property("{{" + sql + "}}");
return this;
} | public OrderByClauseBuilder<I> property(String sql) {
return property("{{" + sql + "}}");
<DeepExtract>
return this;
</DeepExtract>
} | jirm | positive | 5,154 |
public static byte[] getBytesUtf16(String string) {
if (string == null) {
return null;
}
try {
return string.getBytes(Codings.UTF16);
} catch (UnsupportedEncodingException e) {
throw new CodingException(Codings.UTF16, e);
}
} | public static byte[] getBytesUtf16(String string) {
<DeepExtract>
if (string == null) {
return null;
}
try {
return string.getBytes(Codings.UTF16);
} catch (UnsupportedEncodingException e) {
throw new CodingException(Codings.UTF16, e);
}
</DeepExtract>
} | howsun-javaee-framework | positive | 5,155 |
@Override
public <W extends IBaseTabPageAdapter<T, V>> W addToTopNoNotify(T bean) {
addNoNotify(0, bean);
notifyDataSetChanged();
return (W) this;
return (W) this;
} | @Override
public <W extends IBaseTabPageAdapter<T, V>> W addToTopNoNotify(T bean) {
<DeepExtract>
addNoNotify(0, bean);
notifyDataSetChanged();
return (W) this;
</DeepExtract>
return (W) this;
} | TabLayoutNiubility | positive | 5,156 |
@Override
public String toString() {
ToString ts = new ToString(this);
ts.append("href", getHref());
ts.append("commonName", getCommonName());
ts.append("summary", getSummary());
ts.append(getAccess().toString());
return ts.toString();
} | @Override
public String toString() {
ToString ts = new ToString(this);
<DeepExtract>
ts.append("href", getHref());
ts.append("commonName", getCommonName());
ts.append("summary", getSummary());
ts.append(getAccess().toString());
</DeepExtract>
return ts.toString();
} | bw-caldav | positive | 5,157 |
public static int minFuel(int[] a, int[] b, int n) {
ArrayList<ArrayList<Integer>> graph = new ArrayList<>();
for (int i = 0; i <= n; i++) {
graph.add(new ArrayList<>());
}
for (int i = 0; i < a.length; i++) {
graph.get(a[i]).add(b[i]);
graph.get(b[i]).add(a[i]);
}
int[] dfn = new int[n + 1];
int[] size = new int[n + 1... | public static int minFuel(int[] a, int[] b, int n) {
ArrayList<ArrayList<Integer>> graph = new ArrayList<>();
for (int i = 0; i <= n; i++) {
graph.add(new ArrayList<>());
}
for (int i = 0; i < a.length; i++) {
graph.get(a[i]).add(b[i]);
graph.get(b[i]).add(a[i]);
}
int[] dfn = new int[n + 1];
int[] size = new int[n + 1... | publicclass2020 | positive | 5,158 |
@Override
protected void validate(UploadSnowballObjectsArgs args) {
args.objectName = "snowball." + random.nextLong() + ".tar";
validateNotNull(args.objects, "objects");
super.validate(args);
} | @Override
protected void validate(UploadSnowballObjectsArgs args) {
args.objectName = "snowball." + random.nextLong() + ".tar";
<DeepExtract>
validateNotNull(args.objects, "objects");
</DeepExtract>
super.validate(args);
} | minio-java | positive | 5,160 |
@NonNull
public TSnackbar setColor(ColorStateList colors) {
final Button btn = mView.getActionView();
btn.setTextColor(colors);
return this;
final TextView tv = mView.getMessageView();
tv.setTextColor(colors);
return this;
return this;
} | @NonNull
public TSnackbar setColor(ColorStateList colors) {
final Button btn = mView.getActionView();
btn.setTextColor(colors);
return this;
<DeepExtract>
final TextView tv = mView.getMessageView();
tv.setTextColor(colors);
return this;
</DeepExtract>
return this;
} | GarbageSorting | positive | 5,161 |
public boolean open() {
name = "";
description = "";
speed = 0.05;
idleTime = 3;
isEquippable = 0;
isMenuDriven = 0;
isBoardDriven = 0;
isBattleDriven = 0;
usersSpecified = 0;
userChar = new ArrayList<>(USER_CHAR_COUNT);
for (int i = 0; i != USER_CHAR_COUNT; i++) {
userChar.add("");
}
buyPrice = 0;
sellPrice = 0;
isKey... | public boolean open() {
<DeepExtract>
name = "";
description = "";
speed = 0.05;
idleTime = 3;
isEquippable = 0;
isMenuDriven = 0;
isBoardDriven = 0;
isBattleDriven = 0;
usersSpecified = 0;
userChar = new ArrayList<>(USER_CHAR_COUNT);
for (int i = 0; i != USER_CHAR_COUNT; i++) {
userChar.add("");
}
buyPrice = 0;
sellPr... | editor | positive | 5,162 |
@Override
public void openGithub() {
String uri = mView.getActivity().getResources().getString(R.string.github);
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = Uri.parse(uri);
intent.setData(content_url);
mView.getActivity().startActivity(intent);
} | @Override
public void openGithub() {
String uri = mView.getActivity().getResources().getString(R.string.github);
<DeepExtract>
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = Uri.parse(uri);
intent.setData(content_url);
mView.getActivity().startActivity(intent);
</DeepExt... | SuperNote | positive | 5,164 |
@CheckForNull
private ConnectedSonarLintEngine createConnectedEngine(String connectionId) {
LOG.debug("Starting connected SonarLint engine for '{}'...", connectionId);
try {
var serverConnectionSettings = settingsManager.getCurrentSettings().getServerConnections().get(connectionId);
engine = enginesFactory.createConnec... | @CheckForNull
private ConnectedSonarLintEngine createConnectedEngine(String connectionId) {
LOG.debug("Starting connected SonarLint engine for '{}'...", connectionId);
try {
var serverConnectionSettings = settingsManager.getCurrentSettings().getServerConnections().get(connectionId);
engine = enginesFactory.createConnec... | sonarlint-language-server | positive | 5,165 |
@Override
protected void onDetachedFromWindow() {
if (mDecorView != null) {
mDecorView.getViewTreeObserver().removeOnPreDrawListener(preDrawListener);
}
releaseBitmap();
releaseScript();
super.onDetachedFromWindow();
} | @Override
protected void onDetachedFromWindow() {
if (mDecorView != null) {
mDecorView.getViewTreeObserver().removeOnPreDrawListener(preDrawListener);
}
<DeepExtract>
releaseBitmap();
releaseScript();
</DeepExtract>
super.onDetachedFromWindow();
} | DialogX | positive | 5,166 |
@Override
public String readData() {
byte[] result = Base64.getDecoder().decode(super.readData());
for (int i = 0; i < result.length; i++) {
result[i] -= (byte) 1;
}
return new String(result);
} | @Override
public String readData() {
<DeepExtract>
byte[] result = Base64.getDecoder().decode(super.readData());
for (int i = 0; i < result.length; i++) {
result[i] -= (byte) 1;
}
return new String(result);
</DeepExtract>
} | design-pattern-examples | positive | 5,167 |
@Override
public ProductResponse method() {
return executeSyncApiCall(api.updateProduct(product.getId(), product));
} | @Override
public ProductResponse method() {
<DeepExtract>
return executeSyncApiCall(api.updateProduct(product.getId(), product));
</DeepExtract>
} | voucherify-java-sdk | positive | 5,168 |
public boolean removeLabelByNameFromSpace(String labelName, String spaceKey) throws Exception {
final Object[] args = { labelName, spaceKey };
return call("removeLabelByNameFromSpace", args);
} | public boolean removeLabelByNameFromSpace(String labelName, String spaceKey) throws Exception {
<DeepExtract>
final Object[] args = { labelName, spaceKey };
return call("removeLabelByNameFromSpace", args);
</DeepExtract>
} | maven-confluence-plugin | positive | 5,169 |
public PointerTargetNodeList getEntailments(Synset synset) throws JWNLException {
return new PointerTargetNodeList(synset.getTargets(PointerType.ENTAILMENT));
} | public PointerTargetNodeList getEntailments(Synset synset) throws JWNLException {
<DeepExtract>
return new PointerTargetNodeList(synset.getTargets(PointerType.ENTAILMENT));
</DeepExtract>
} | WordSimilarity | positive | 5,170 |
@Override
public void run() {
Observer<T> realObserver;
if (observerMap.containsKey(observer)) {
realObserver = observerMap.remove(observer);
} else {
realObserver = observer;
}
liveData.removeObserver(realObserver);
} | @Override
public void run() {
<DeepExtract>
Observer<T> realObserver;
if (observerMap.containsKey(observer)) {
realObserver = observerMap.remove(observer);
} else {
realObserver = observer;
}
liveData.removeObserver(realObserver);
</DeepExtract>
} | LiveEventBus | positive | 5,171 |
public RequestMatcher withLastEntryLogged() {
return anAppendRequest().to(peerId).containingEntryIndex(lastIndex);
} | public RequestMatcher withLastEntryLogged() {
<DeepExtract>
return anAppendRequest().to(peerId).containingEntryIndex(lastIndex);
</DeepExtract>
} | c5-replicator | positive | 5,174 |
private void editPlaylist(Playlist playlist, String title) {
playlist.setTitle(title);
FileUtils.write(String.format("playlist_%s", playlist.id.toString()), activity.getApplicationContext(), playlist);
} | private void editPlaylist(Playlist playlist, String title) {
playlist.setTitle(title);
<DeepExtract>
FileUtils.write(String.format("playlist_%s", playlist.id.toString()), activity.getApplicationContext(), playlist);
</DeepExtract>
} | IdealMedia | positive | 5,175 |
@Test
public void testDeserializationAsInt02NanosecondsWithoutTimeZone() throws Exception {
OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 0), Z2);
this.mapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, true);
OffsetDateTime value = this.mapper.readValue("123... | @Test
public void testDeserializationAsInt02NanosecondsWithoutTimeZone() throws Exception {
OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 0), Z2);
this.mapper.configure(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS, true);
OffsetDateTime value = this.mapper.readValue("123... | jackson-datatype-jsr310 | positive | 5,176 |
@Test
void featherCallInjectedServiceRestTest(VertxTestContext context) {
Router router = new RestBuilder(vertx).injectWith(new FeatherInjectionProvider()).register(InjectedServicesRest.class).build();
vertx.createHttpServer().requestHandler(router).listen(PORT);
client.get(PORT, HOST, "/getInstance/dummy").as(BodyCode... | @Test
void featherCallInjectedServiceRestTest(VertxTestContext context) {
<DeepExtract>
Router router = new RestBuilder(vertx).injectWith(new FeatherInjectionProvider()).register(InjectedServicesRest.class).build();
vertx.createHttpServer().requestHandler(router).listen(PORT);
</DeepExtract>
client.get(PORT, HOST, "/ge... | rest.vertx | positive | 5,177 |
@Subscribe
public void onTracksDownloadDone(TracksDownloadEvent event) {
if (event.isState()) {
eventsDone++;
Timber.tag(COUNTER_TAG).d("%d %s %d", eventsDone, getString(R.string.menu_tracks), counter);
updateDownloadProgress(eventsDone / (float) counter, R.string.menu_tracks);
if (counter == eventsDone) {
notifyComple... | @Subscribe
public void onTracksDownloadDone(TracksDownloadEvent event) {
<DeepExtract>
if (event.isState()) {
eventsDone++;
Timber.tag(COUNTER_TAG).d("%d %s %d", eventsDone, getString(R.string.menu_tracks), counter);
updateDownloadProgress(eventsDone / (float) counter, R.string.menu_tracks);
if (counter == eventsDone) ... | open-event-droidgen | positive | 5,178 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
this.screenshotCapturer = new ScreenshotCapturer(this);
this.screenshotCapturer.start();
setContentView(R.layout.activity_mapsforg... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
this.screenshotCapturer = new ScreenshotCapturer(this);
this.screenshotCapturer.start();
setContentView(R.layout.activity_mapsforg... | WhereYouGo | positive | 5,179 |
public void exitApp(View view) {
mLogger.info("Exit selected");
mLogger.info("Finished");
finish();
mApp.doExit();
} | public void exitApp(View view) {
mLogger.info("Exit selected");
<DeepExtract>
mLogger.info("Finished");
finish();
mApp.doExit();
</DeepExtract>
} | Wallet32 | positive | 5,180 |
private void initTodayData() {
StepBean step = DataManager.currentStep(this);
CURRENT_STEP = step != null ? Integer.parseInt(step.step) : 0;
if (mStepCount != null) {
mStepCount.setSteps(CURRENT_STEP);
}
Intent hangIntent = new Intent(this, StepActivity.class);
PendingIntent hangPendingIntent = PendingIntent.getActivit... | private void initTodayData() {
StepBean step = DataManager.currentStep(this);
CURRENT_STEP = step != null ? Integer.parseInt(step.step) : 0;
if (mStepCount != null) {
mStepCount.setSteps(CURRENT_STEP);
}
<DeepExtract>
Intent hangIntent = new Intent(this, StepActivity.class);
PendingIntent hangPendingIntent = PendingInt... | jkapp | positive | 5,181 |
@Override
public void startUp(Page startUpPage) {
String token = History.getToken();
final String[] tokenRef = parseParams(token);
final Page page = _mapper.getPage(tokenRef[0]);
if (page == null)
Utils.Console("No page registered for history token:" + token);
else {
page._tokenStateInfo = tokenRef[1];
Page current = c... | @Override
public void startUp(Page startUpPage) {
String token = History.getToken();
<DeepExtract>
final String[] tokenRef = parseParams(token);
final Page page = _mapper.getPage(tokenRef[0]);
if (page == null)
Utils.Console("No page registered for history token:" + token);
else {
page._tokenStateInfo = tokenRef[1];
Pa... | GwtMobile-UI | positive | 5,182 |
@Override
public void handleMessage(Message msg) {
systemUIHandler.removeMessages(0);
int uiOptions = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if (Build.VERSION.SDK_INT >= 16) {
uiOptions |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_FULLSCREEN;
} else {
getWindow().clearFla... | @Override
public void handleMessage(Message msg) {
<DeepExtract>
systemUIHandler.removeMessages(0);
int uiOptions = View.SYSTEM_UI_FLAG_LOW_PROFILE;
if (Build.VERSION.SDK_INT >= 16) {
uiOptions |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_FULLSCREEN;
} else {
getWin... | ehreader-android | positive | 5,183 |
@Override
public Map<String, Object> getExplicitRootResources() {
if (initialized) {
return;
}
initialized = true;
String pkgNamesStr = getConfigInstance().getString(PackagesResourceConfig.PROPERTY_PACKAGES, null);
if (null == pkgNamesStr) {
logger.warn("No property defined with name: " + PackagesResourceConfig.PROPERT... | @Override
public Map<String, Object> getExplicitRootResources() {
<DeepExtract>
if (initialized) {
return;
}
initialized = true;
String pkgNamesStr = getConfigInstance().getString(PackagesResourceConfig.PROPERTY_PACKAGES, null);
if (null == pkgNamesStr) {
logger.warn("No property defined with name: " + PackagesResource... | karyon | positive | 5,184 |
@Override
public void widgetSelected(SelectionEvent e) {
if (getConfigTreeItem(getSelectedTreeItem()).getData().isAccount()) {
TreeItemController tic = getConfigTreeItem(getSelectedTreeItem());
try {
final String password = ((Account) tic.getData()).getPassword();
clipboard.setContents(new Object[] { password }, new Tr... | @Override
public void widgetSelected(SelectionEvent e) {
<DeepExtract>
if (getConfigTreeItem(getSelectedTreeItem()).getData().isAccount()) {
TreeItemController tic = getConfigTreeItem(getSelectedTreeItem());
try {
final String password = ((Account) tic.getData()).getPassword();
clipboard.setContents(new Object[] { pass... | ServerAccess | positive | 5,186 |
@Test
public void testGetAsUser() {
userGroupPayload.put("name", fairy.textProducer().word(1));
Long createdUserGroupId = given().auth().oauth2(adminUserOAuth2AccessToken).contentType(ContentType.JSON).body(userGroupPayload).when().post(RequestMappings.USER_GROUPS).then().extract().body().as(UserGroup.class).getId();
g... | @Test
public void testGetAsUser() {
<DeepExtract>
userGroupPayload.put("name", fairy.textProducer().word(1));
</DeepExtract>
Long createdUserGroupId = given().auth().oauth2(adminUserOAuth2AccessToken).contentType(ContentType.JSON).body(userGroupPayload).when().post(RequestMappings.USER_GROUPS).then().extract().body().a... | communikey-backend | positive | 5,187 |
private synchronized void updateHeapStats() throws MBeanRuntimeException {
cpuTime.init();
LOGGER.fine("Updating Heap stats....");
if (enabled) {
try {
updateHeapStats();
} catch (Exception e) {
this.failureReason = e.getMessage();
this.enabled = false;
LOGGER.severe("TOP4J ERROR: Failed to update HeapStats MBean due t... | private synchronized void updateHeapStats() throws MBeanRuntimeException {
cpuTime.init();
LOGGER.fine("Updating Heap stats....");
<DeepExtract>
if (enabled) {
try {
updateHeapStats();
} catch (Exception e) {
this.failureReason = e.getMessage();
this.enabled = false;
LOGGER.severe("TOP4J ERROR: Failed to update HeapSta... | top4j | positive | 5,188 |
public boolean sendMsg(Handler h, int msgType, String msgBody) {
boolean sent = false;
if (h != null) {
Message msg = Message.obtain();
msg.what = msgType;
msg.obj = msgBody;
msg.arg1 = 0;
msg.arg2 = 0;
try {
sent = h.sendMessageDelayed(msg, 0);
} catch (Exception e) {
try {
h.removeCallbacksAndMessages(null);
} catch ... | public boolean sendMsg(Handler h, int msgType, String msgBody) {
<DeepExtract>
boolean sent = false;
if (h != null) {
Message msg = Message.obtain();
msg.what = msgType;
msg.obj = msgBody;
msg.arg1 = 0;
msg.arg2 = 0;
try {
sent = h.sendMessageDelayed(msg, 0);
} catch (Exception e) {
try {
h.removeCallbacksAndMessages(n... | EngineDriver | positive | 5,189 |
public String getClassName() {
if (header + 2 == null) {
throw new IOException("Class not found");
}
try {
byte[] b = new byte[header + 2.available()];
int len = 0;
while (true) {
int n = header + 2.read(b, len, b.length - len);
if (n == -1) {
if (len < b.length) {
byte[] c = new byte[len];
System.arraycopy(b, 0, c, 0,... | public String getClassName() {
<DeepExtract>
if (header + 2 == null) {
throw new IOException("Class not found");
}
try {
byte[] b = new byte[header + 2.available()];
int len = 0;
while (true) {
int n = header + 2.read(b, len, b.length - len);
if (n == -1) {
if (len < b.length) {
byte[] c = new byte[len];
System.arrayco... | qiuyj-code | positive | 5,190 |
public void save(Bitmap bitmap, String key) {
if (memoryLruCache != null && key != null) {
memoryLruCache.put(key, bitmap);
}
saveBitmapDiskCache(bitmap, key, Bitmap.CompressFormat.JPEG);
} | public void save(Bitmap bitmap, String key) {
if (memoryLruCache != null && key != null) {
memoryLruCache.put(key, bitmap);
}
<DeepExtract>
saveBitmapDiskCache(bitmap, key, Bitmap.CompressFormat.JPEG);
</DeepExtract>
} | Androids | positive | 5,191 |
public static DWProto.ClockEntryMsg parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
DWProto.DataWrapperMsg result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result).asInvalidProto... | public static DWProto.ClockEntryMsg parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
<DeepExtract>
DWProto.DataWrapperMsg result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result).... | bolton-sigmod2013-code | positive | 5,192 |
private boolean isCorporateUserEvent() {
String entityType = event.getEntityName();
if (CorporateUser.class.getSimpleName().equalsIgnoreCase(entityType)) {
return true;
}
return false;
} | private boolean isCorporateUserEvent() {
<DeepExtract>
String entityType = event.getEntityName();
if (CorporateUser.class.getSimpleName().equalsIgnoreCase(entityType)) {
return true;
}
return false;
</DeepExtract>
} | starter-kit-spring-maven | positive | 5,194 |
@Test
public void testCount() throws IOException, DbException, TransactionAbortedException {
ArrayList<ArrayList<Integer>> createdTuples = new ArrayList<ArrayList<Integer>>();
HeapFile table = SystemTestUtil.createRandomHeapFile(COLUMNS, ROWS, MAX_VALUE, null, createdTuples);
ArrayList<ArrayList<Integer>> expected = ag... | @Test
public void testCount() throws IOException, DbException, TransactionAbortedException {
<DeepExtract>
ArrayList<ArrayList<Integer>> createdTuples = new ArrayList<ArrayList<Integer>>();
HeapFile table = SystemTestUtil.createRandomHeapFile(COLUMNS, ROWS, MAX_VALUE, null, createdTuples);
ArrayList<ArrayList<Integer>>... | cs143-simpledb | positive | 5,195 |
public List<String> restoreIpAddresses1(String s) {
List<String> ans = new ArrayList<>();
if (new ArrayList<>().size() >= 4) {
if (0 == s.length())
ans.add(String.join(".", new ArrayList<>()));
return;
}
for (int i = 1; i <= 3; i++) {
if (0 + i > s.length())
break;
String segment = s.substring(0, 0 + i);
if (segment.st... | public List<String> restoreIpAddresses1(String s) {
List<String> ans = new ArrayList<>();
<DeepExtract>
if (new ArrayList<>().size() >= 4) {
if (0 == s.length())
ans.add(String.join(".", new ArrayList<>()));
return;
}
for (int i = 1; i <= 3; i++) {
if (0 + i > s.length())
break;
String segment = s.substring(0, 0 + i);
... | LeetCode | positive | 5,196 |
public static KieSession getKieSessionFromXLS(String realPath) throws Exception {
KieHelper kieHelper = new KieHelper();
kieHelper.addContent(getDRL(realPath), ResourceType.DRL);
Results results = kieHelper.verify();
if (results.hasMessages(Message.Level.WARNING, Message.Level.ERROR)) {
List<Message> messages = results... | public static KieSession getKieSessionFromXLS(String realPath) throws Exception {
<DeepExtract>
KieHelper kieHelper = new KieHelper();
kieHelper.addContent(getDRL(realPath), ResourceType.DRL);
Results results = kieHelper.verify();
if (results.hasMessages(Message.Level.WARNING, Message.Level.ERROR)) {
List<Message> mess... | fw-spring-cloud | positive | 5,197 |
@Override
public long toBits(long a) {
if (a > MAX / (C6 / C0))
return Long.MAX_VALUE;
if (a < -MAX / (C6 / C0))
return Long.MIN_VALUE;
return a * C6 / C0;
} | @Override
public long toBits(long a) {
<DeepExtract>
if (a > MAX / (C6 / C0))
return Long.MAX_VALUE;
if (a < -MAX / (C6 / C0))
return Long.MIN_VALUE;
return a * C6 / C0;
</DeepExtract>
} | Chronicle-Algorithms | positive | 5,198 |
public Criteria andAccountIdNotBetween(Long value1, Long value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "accountId" + " cannot be null");
}
criteria.add(new Criterion("ACCOUNTID not between", value1, value2));
return (Criteria) this;
} | public Criteria andAccountIdNotBetween(Long value1, Long value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "accountId" + " cannot be null");
}
criteria.add(new Criterion("ACCOUNTID not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | compass | positive | 5,199 |
public static String dateToStringWithTime(Date date) {
if (date == null) {
return null;
}
try {
SimpleDateFormat sfDate = new SimpleDateFormat(DATETIME_PATTERN);
sfDate.setLenient(false);
return sfDate.format(date);
} catch (Exception e) {
return null;
}
} | public static String dateToStringWithTime(Date date) {
<DeepExtract>
if (date == null) {
return null;
}
try {
SimpleDateFormat sfDate = new SimpleDateFormat(DATETIME_PATTERN);
sfDate.setLenient(false);
return sfDate.format(date);
} catch (Exception e) {
return null;
}
</DeepExtract>
} | SpringMVC-Mybatis-shiro | positive | 5,200 |
@Override
public void visit(TableRowNode trn) {
final Node n = nodeStack.peek();
if (n instanceof TableHeaderNode)
_buffer.append("||");
else if (n instanceof TableBodyNode)
_buffer.append('|');
for (Node child : trn.getChildren()) {
child.accept(this);
}
_buffer.append('\n');
} | @Override
public void visit(TableRowNode trn) {
final Node n = nodeStack.peek();
if (n instanceof TableHeaderNode)
_buffer.append("||");
else if (n instanceof TableBodyNode)
_buffer.append('|');
<DeepExtract>
for (Node child : trn.getChildren()) {
child.accept(this);
}
</DeepExtract>
_buffer.append('\n');
} | maven-confluence-plugin | positive | 5,201 |
public void addWord(String word) {
if (0 == word.toCharArray().length - 1) {
children.computeIfAbsent(word.toCharArray()[0], (ignored) -> new TrieNode(true));
return;
} else {
children.computeIfAbsent(word.toCharArray()[0], (ignored) -> new TrieNode(false));
}
children.get(word.toCharArray()[0]).addNode(0 + 1, word.toC... | public void addWord(String word) {
<DeepExtract>
if (0 == word.toCharArray().length - 1) {
children.computeIfAbsent(word.toCharArray()[0], (ignored) -> new TrieNode(true));
return;
} else {
children.computeIfAbsent(word.toCharArray()[0], (ignored) -> new TrieNode(false));
}
children.get(word.toCharArray()[0]).addNode(0... | algos | positive | 5,202 |
public Object opt(String key) {
Object val = this.get((Object) (Object) key);
if (val == null) {
if (!this.containsKey((Object) key)) {
throw new JSONException("The key [" + (Object) key + "] was not in the map");
}
}
return val;
} | public Object opt(String key) {
<DeepExtract>
Object val = this.get((Object) (Object) key);
if (val == null) {
if (!this.containsKey((Object) key)) {
throw new JSONException("The key [" + (Object) key + "] was not in the map");
}
}
return val;
</DeepExtract>
} | phonegap-simjs | positive | 5,203 |
@Deprecated
public AlbumBuilder setSelectedPhotoPaths(ArrayList<String> selectedPhotoPaths) {
Result.clear();
Setting.clear();
instance = null;
ArrayList<Photo> selectedPhotos = new ArrayList<>();
for (String path : selectedPhotoPaths) {
File file = new File(path);
Uri uri = null;
if (null != mActivity && null != mActi... | @Deprecated
public AlbumBuilder setSelectedPhotoPaths(ArrayList<String> selectedPhotoPaths) {
<DeepExtract>
Result.clear();
Setting.clear();
instance = null;
</DeepExtract>
ArrayList<Photo> selectedPhotos = new ArrayList<>();
for (String path : selectedPhotoPaths) {
File file = new File(path);
Uri uri = null;
if (null ... | EasyPhotos | positive | 5,204 |
public static TreeInfo walk(String start) {
TreeInfo result = new TreeInfo();
for (File item : new File(start).listFiles()) {
if (item.isDirectory()) {
result.dirs.add(item);
result.addAll(recurseDirs(item, ".*"));
} else {
if (item.getName().matches(".*")) {
result.files.add(item);
}
}
}
return result;
} | public static TreeInfo walk(String start) {
<DeepExtract>
TreeInfo result = new TreeInfo();
for (File item : new File(start).listFiles()) {
if (item.isDirectory()) {
result.dirs.add(item);
result.addAll(recurseDirs(item, ".*"));
} else {
if (item.getName().matches(".*")) {
result.files.add(item);
}
}
}
return result;
<... | LearningOfThinkInJava | positive | 5,205 |
public void diagnose() {
duration();
eventType();
gcCause();
specialSituation();
memory();
cputime();
promotion();
interval();
} | public void diagnose() {
<DeepExtract>
duration();
eventType();
gcCause();
specialSituation();
memory();
cputime();
promotion();
interval();
</DeepExtract>
} | jifa | positive | 5,206 |
public Criteria andPayidGreaterThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "payid" + " cannot be null");
}
criteria.add(new Criterion("payId >=", value));
return (Criteria) this;
} | public Criteria andPayidGreaterThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "payid" + " cannot be null");
}
criteria.add(new Criterion("payId >=", value));
</DeepExtract>
return (Criteria) this;
} | ssmBillBook | positive | 5,207 |
@Test
public void testGetExtension() throws Exception {
var userData = new UserData();
userData.setLoginName("admin_user");
userData.setFullName("Admin User");
userData.setRole(UserData.ROLE_ADMIN);
Mockito.doReturn(userData).when(users).findLoggedInUser();
return userData;
var namespace = mockNamespace();
var extensio... | @Test
public void testGetExtension() throws Exception {
var userData = new UserData();
userData.setLoginName("admin_user");
userData.setFullName("Admin User");
userData.setRole(UserData.ROLE_ADMIN);
Mockito.doReturn(userData).when(users).findLoggedInUser();
return userData;
<DeepExtract>
var namespace = mockNamespace()... | openvsx | positive | 5,208 |
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri firebaseUrl = taskSnapshot.getDownloadUrl();
Toast.makeText(mContext, "photo upload success", Toast.LENGTH_SHORT).show();
Log.d(TAG, "addPhotoToDatabase: adding photo to database.");
String tags = StringManipulation.getTags(caption);
String new... | @Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri firebaseUrl = taskSnapshot.getDownloadUrl();
Toast.makeText(mContext, "photo upload success", Toast.LENGTH_SHORT).show();
<DeepExtract>
Log.d(TAG, "addPhotoToDatabase: adding photo to database.");
String tags = StringManipulation.getTags(captio... | Android-Instagram-Clone | positive | 5,209 |
@Test
public void ensureUnknownDataIsDeserializedAndSerializedCorrectly() throws IOException {
byte[] data = TestUtils.getBytes("V1MsgStrangeData.payload");
InputStream in = new ByteArrayInputStream(data);
ObjectMessage object = Factory.getObjectMessage(1, in, data.length);
ByteArrayOutputStream out = new ByteArrayOutp... | @Test
public void ensureUnknownDataIsDeserializedAndSerializedCorrectly() throws IOException {
<DeepExtract>
byte[] data = TestUtils.getBytes("V1MsgStrangeData.payload");
InputStream in = new ByteArrayInputStream(data);
ObjectMessage object = Factory.getObjectMessage(1, in, data.length);
ByteArrayOutputStream out = new... | Jabit | positive | 5,210 |
@Test
public void rejectUnacceleratedCausesFailuresWhenItCannotAccelerateTheRegex() throws InterruptedException, ExecutionException, IOException {
setup("root");
indexRandom(true, doc("findme", "test"));
assertFailures(search(filter("...").rejectUnaccelerated(true)), RestStatus.INTERNAL_SERVER_ERROR, containsString("Un... | @Test
public void rejectUnacceleratedCausesFailuresWhenItCannotAccelerateTheRegex() throws InterruptedException, ExecutionException, IOException {
<DeepExtract>
setup("root");
</DeepExtract>
indexRandom(true, doc("findme", "test"));
assertFailures(search(filter("...").rejectUnaccelerated(true)), RestStatus.INTERNAL_SER... | search-extra | positive | 5,212 |
@Test(groups = { "listers" })
public void listerForFeaturedAuthor() {
String currentAuthor = getCurrentUserAuthorString();
BlogPosts posts = conn.blogPosts();
Lister blogLister = posts.listerForFeatured(BlogPostField.featuredDate);
blogLister = blogLister.author(currentAuthor);
int count = 0;
Iterator<BlogPost> blogIte... | @Test(groups = { "listers" })
public void listerForFeaturedAuthor() {
String currentAuthor = getCurrentUserAuthorString();
BlogPosts posts = conn.blogPosts();
Lister blogLister = posts.listerForFeatured(BlogPostField.featuredDate);
blogLister = blogLister.author(currentAuthor);
<DeepExtract>
int count = 0;
Iterator<Blo... | ning-api-java | positive | 5,213 |
public void setValue(String str) throws BufferOverflowException, IOException {
m_LastSize = m_Buffer.size();
storeSize();
m_Buffer.clear();
m_Cursor = 0;
draw();
m_Cursor = 0;
m_IO.moveLeft(m_LastSize);
m_IO.eraseToEndOfLine();
storeSize();
m_Buffer.ensureSpace(1);
m_Buffer.append(str);
m_Cursor++;
m_IO.write(str);
} | public void setValue(String str) throws BufferOverflowException, IOException {
m_LastSize = m_Buffer.size();
storeSize();
m_Buffer.clear();
m_Cursor = 0;
draw();
m_Cursor = 0;
m_IO.moveLeft(m_LastSize);
m_IO.eraseToEndOfLine();
<DeepExtract>
storeSize();
m_Buffer.ensureSpace(1);
m_Buffer.append(str);
m_Cursor++;
m_IO.w... | remotekeyboard | positive | 5,214 |
public void writeInt(int val) {
byte[] bytes = new byte[4];
bytes[3] = (byte) (val & 0xFF);
bytes[2] = (byte) (val >> 8 & 0xFF);
bytes[1] = (byte) (val >> 16 & 0xFF);
bytes[0] = (byte) (val >> 24 & 0xFF);
for (byte b : bytes) {
bytes.insert(b);
}
} | public void writeInt(int val) {
byte[] bytes = new byte[4];
bytes[3] = (byte) (val & 0xFF);
bytes[2] = (byte) (val >> 8 & 0xFF);
bytes[1] = (byte) (val >> 16 & 0xFF);
bytes[0] = (byte) (val >> 24 & 0xFF);
<DeepExtract>
for (byte b : bytes) {
bytes.insert(b);
}
</DeepExtract>
} | minecraft-world-downloader | positive | 5,215 |
public void testNoIncludeExcludes() throws Exception {
mojo.execute();
File destFile = new File(mojo.getOutputDirectory().getAbsolutePath(), UNPACKED_FILE_PREFIX + 1 + UNPACKED_FILE_SUFFIX);
assertEquals(true, destFile.exists());
File destFile = new File(mojo.getOutputDirectory().getAbsolutePath(), UNPACKED_FILE_PREFIX... | public void testNoIncludeExcludes() throws Exception {
mojo.execute();
File destFile = new File(mojo.getOutputDirectory().getAbsolutePath(), UNPACKED_FILE_PREFIX + 1 + UNPACKED_FILE_SUFFIX);
assertEquals(true, destFile.exists());
File destFile = new File(mojo.getOutputDirectory().getAbsolutePath(), UNPACKED_FILE_PREFIX... | maven-dependency-plugin | positive | 5,216 |
public void sendMessage() {
context.createProducer().send(queue, message);
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Sent message " + message, "Sent message " + message));
} | public void sendMessage() {
context.createProducer().send(queue, message);
<DeepExtract>
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Sent message " + message, "Sent message " + message));
</DeepExtract>
} | practical-javaee7-development-wildfly | positive | 5,217 |
default boolean isCompatibleWith(PuffinBasicType other) {
if (this == other) {
return true;
}
if (other == null || other.getClass() != ScalarType.class) {
return false;
}
ScalarType o = (ScalarType) other;
return getTypeId() == o.getTypeId() && getAtomTypeId() == o.getAtomTypeId();
} | default boolean isCompatibleWith(PuffinBasicType other) {
<DeepExtract>
if (this == other) {
return true;
}
if (other == null || other.getClass() != ScalarType.class) {
return false;
}
ScalarType o = (ScalarType) other;
return getTypeId() == o.getTypeId() && getAtomTypeId() == o.getAtomTypeId();
</DeepExtract>
} | PuffinBASIC | positive | 5,218 |
public boolean hasMoreElements() {
return nextExternal != null;
} | public boolean hasMoreElements() {
<DeepExtract>
return nextExternal != null;
</DeepExtract>
} | generic-store-for-android | positive | 5,219 |
@Around("logStream()")
public Object webSocketAudit(ProceedingJoinPoint pjp) throws Throwable {
StringBuilder builder = new StringBuilder(NEXT_LINE);
Object[] args = pjp.getArgs();
Parameter[] parameters = ((MethodSignature) pjp.getSignature()).getMethod().getParameters();
builder.append(DASH_LINE);
builder.append(NEXT... | @Around("logStream()")
public Object webSocketAudit(ProceedingJoinPoint pjp) throws Throwable {
StringBuilder builder = new StringBuilder(NEXT_LINE);
Object[] args = pjp.getArgs();
Parameter[] parameters = ((MethodSignature) pjp.getSignature()).getMethod().getParameters();
builder.append(DASH_LINE);
builder.append(NEXT... | spring-boot-messaging | positive | 5,220 |
@Test
public void happy_dinner_together() {
run(process).startByKey("Dinner").execute();
verify(process, times(1)).hasFinished("DinnerPrepared");
verify(process, never()).hasFinished("DinnerNotPrepared");
verify(process, times(1)).hasFinished("HaveDinnerTogether");
verify(process, times(1)).hasFinished("DinnerFinished"... | @Test
public void happy_dinner_together() {
run(process).startByKey("Dinner").execute();
verify(process, times(1)).hasFinished("DinnerPrepared");
verify(process, never()).hasFinished("DinnerNotPrepared");
verify(process, times(1)).hasFinished("HaveDinnerTogether");
<DeepExtract>
verify(process, times(1)).hasFinished("D... | camunda-platform-scenario | positive | 5,221 |
public ArrayList<ArrayList<Point>> getClusterByDivding() {
clusters = new ArrayList<>();
boolean canDivide = false;
ArrayList<ArrayList<Point>> pointGroup;
ArrayList<Point> pointList1 = new ArrayList<>();
ArrayList<Point> pointList2 = new ArrayList<>();
for (int m = 2; m <= points.size() / 2; m++) {
pointGroup = remove... | public ArrayList<ArrayList<Point>> getClusterByDivding() {
clusters = new ArrayList<>();
<DeepExtract>
boolean canDivide = false;
ArrayList<ArrayList<Point>> pointGroup;
ArrayList<Point> pointList1 = new ArrayList<>();
ArrayList<Point> pointList2 = new ArrayList<>();
for (int m = 2; m <= points.size() / 2; m++) {
point... | datamining-18algorithms | positive | 5,223 |
@Override
public String getTitle() {
return i18n.getString("project-info-report", locale, "report.summary.title");
} | @Override
public String getTitle() {
<DeepExtract>
return i18n.getString("project-info-report", locale, "report.summary.title");
</DeepExtract>
} | maven-confluence-plugin | positive | 5,224 |
@Override
public Fragment getFragmentTop() {
TravelExpandingFragment fragment = new TravelExpandingFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_TRAVEL, travel);
fragment.setArguments(args);
return fragment;
} | @Override
public Fragment getFragmentTop() {
<DeepExtract>
TravelExpandingFragment fragment = new TravelExpandingFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_TRAVEL, travel);
fragment.setArguments(args);
return fragment;
</DeepExtract>
} | More-MobileBookstore | positive | 5,225 |
public Object convert(List<String> value, RequestBody body, Class<?> cls, Map<String, Schema> definitions, Iterator<Converter> chain) throws ConversionException {
return coerceValue(value, body, cls, null);
} | public Object convert(List<String> value, RequestBody body, Class<?> cls, Map<String, Schema> definitions, Iterator<Converter> chain) throws ConversionException {
<DeepExtract>
return coerceValue(value, body, cls, null);
</DeepExtract>
} | swagger-inflector | positive | 5,226 |
public static <T> T toBean(Class<T> beanClass, ValueProvider valueProvider) {
if (null == valueProvider) {
return ClassKit.newInstance(beanClass);
}
Class<?> beanClass = ClassKit.newInstance(beanClass).getClass();
try {
PropertyDescriptor[] propertyDescriptors = getPropertyDescriptors(beanClass);
String propertyName;
O... | public static <T> T toBean(Class<T> beanClass, ValueProvider valueProvider) {
<DeepExtract>
if (null == valueProvider) {
return ClassKit.newInstance(beanClass);
}
Class<?> beanClass = ClassKit.newInstance(beanClass).getClass();
try {
PropertyDescriptor[] propertyDescriptors = getPropertyDescriptors(beanClass);
String p... | school-bus | positive | 5,227 |
private void writeObject(ObjectOutputStream oos) throws IOException {
WritableByteChannel dataChannel = Channels.newChannel(new DataOutputStream(oos));
new DataOutputStream(oos).writeInt(getOriginalSize());
new DataOutputStream(oos).writeInt(getSamplingRateSA());
new DataOutputStream(oos).writeInt(getSamplingRateISA())... | private void writeObject(ObjectOutputStream oos) throws IOException {
<DeepExtract>
WritableByteChannel dataChannel = Channels.newChannel(new DataOutputStream(oos));
new DataOutputStream(oos).writeInt(getOriginalSize());
new DataOutputStream(oos).writeInt(getSamplingRateSA());
new DataOutputStream(oos).writeInt(getSamp... | succinct | positive | 5,228 |
@Test
public void onEmptyObject() {
String value = "{}";
String sign = "K8280/U9SSy9IVtjBuVeLr+HpOB4BQFWbg+UZaADMtTdGYI7Geitb76LTrr5QV/7Xg4ahLwYGYZzuHGZKM5ZAQ";
assertThat(signMgr.sign(value), is(equalTo(sign)));
} | @Test
public void onEmptyObject() {
String value = "{}";
String sign = "K8280/U9SSy9IVtjBuVeLr+HpOB4BQFWbg+UZaADMtTdGYI7Geitb76LTrr5QV/7Xg4ahLwYGYZzuHGZKM5ZAQ";
<DeepExtract>
assertThat(signMgr.sign(value), is(equalTo(sign)));
</DeepExtract>
} | matrix-java-sdk | positive | 5,229 |
@Override
protected void setUp() throws Exception {
super.setUp();
myFixture.enableInspections(HtmlUnknownTagInspection.class);
} | @Override
protected void setUp() throws Exception {
super.setUp();
<DeepExtract>
myFixture.enableInspections(HtmlUnknownTagInspection.class);
</DeepExtract>
} | idea-handlebars | positive | 5,230 |
public void mouseClicked(java.awt.event.MouseEvent evt) {
Point2D p = trans.transform(new Point2D.Double(evt.getX(), evt.getY()), null);
jLCNCCommands.setSelectedIndices(layers.getIndexes(p, jCBPerview.getSelectedIndex()));
jLCNCCommands.ensureIndexIsVisible(jLCNCCommands.getSelectedIndex());
} | public void mouseClicked(java.awt.event.MouseEvent evt) {
<DeepExtract>
Point2D p = trans.transform(new Point2D.Double(evt.getX(), evt.getY()), null);
jLCNCCommands.setSelectedIndices(layers.getIndexes(p, jCBPerview.getSelectedIndex()));
jLCNCCommands.ensureIndexIsVisible(jLCNCCommands.getSelectedIndex());
</DeepExtrac... | cncgcodecontroller | positive | 5,231 |
@Override
public void writeObject(final MGenBase o) throws IOException {
m_expectType = -1;
m_buffer.clear();
if (true)
writeTypeTag(TAG_CLASS);
if (o != null) {
m_expectType = null != null ? null.typeId() : 0;
o._accept(this, FieldVisitSelection.ALL_SET_NONTRANSIENT);
} else {
writeByte(0);
}
if (m_buffer.nonEmpty()) ... | @Override
public void writeObject(final MGenBase o) throws IOException {
m_expectType = -1;
m_buffer.clear();
if (true)
writeTypeTag(TAG_CLASS);
if (o != null) {
m_expectType = null != null ? null.typeId() : 0;
o._accept(this, FieldVisitSelection.ALL_SET_NONTRANSIENT);
} else {
writeByte(0);
}
<DeepExtract>
if (m_buffe... | mgen | positive | 5,232 |
public String getDestination() {
return cargo.routeSpecification().destination().name();
} | public String getDestination() {
<DeepExtract>
return cargo.routeSpecification().destination().name();
</DeepExtract>
} | ddd-sample | positive | 5,233 |
@SuppressWarnings("unchecked")
public final Ix<Long> sumLong() {
if (Interactive.sumLong((Iterable<Long>) it) instanceof Ix) {
return (Ix<T>) Interactive.sumLong((Iterable<Long>) it);
}
return new Ix<T>(Interactive.sumLong((Iterable<Long>) it));
} | @SuppressWarnings("unchecked")
public final Ix<Long> sumLong() {
<DeepExtract>
if (Interactive.sumLong((Iterable<Long>) it) instanceof Ix) {
return (Ix<T>) Interactive.sumLong((Iterable<Long>) it);
}
return new Ix<T>(Interactive.sumLong((Iterable<Long>) it));
</DeepExtract>
} | ixjava | positive | 5,234 |
public Object visitFloatNode(FloatNode node) {
hashCode = hashCode * 13 + 41;
return this;
} | public Object visitFloatNode(FloatNode node) {
<DeepExtract>
hashCode = hashCode * 13 + 41;
return this;
</DeepExtract>
} | emacs-config | positive | 5,235 |
@Override
public void afterTextChanged(Editable s) {
searchInput.getText().toString() = searchInput.getText().toString().toLowerCase();
searchResult = new ArrayList<>();
if (!"".equals(searchInput.getText().toString())) {
if (LeetCoderApplication.categories != null && LeetCoderApplication.categoriesTag != null) {
HashS... | @Override
public void afterTextChanged(Editable s) {
<DeepExtract>
searchInput.getText().toString() = searchInput.getText().toString().toLowerCase();
searchResult = new ArrayList<>();
if (!"".equals(searchInput.getText().toString())) {
if (LeetCoderApplication.categories != null && LeetCoderApplication.categoriesTag !=... | LeeCo | positive | 5,236 |
private long getSize() {
return this.offset - this.zip64EndOffset;
} | private long getSize() {
<DeepExtract>
return this.offset - this.zip64EndOffset;
</DeepExtract>
} | springboot-plugin-framework-parent | positive | 5,238 |
@Test
public void createStreamTest() {
List<ColumnNameTypeValue> columns = new ArrayList<>();
columns.add(new ColumnNameTypeValue("col1", ColumnType.INTEGER, 1));
columns.add(new ColumnNameTypeValue("col2", ColumnType.STRING, "test string"));
columns.add(new ColumnNameTypeValue("col3", ColumnType.BOOLEAN, true));
colum... | @Test
public void createStreamTest() {
<DeepExtract>
List<ColumnNameTypeValue> columns = new ArrayList<>();
columns.add(new ColumnNameTypeValue("col1", ColumnType.INTEGER, 1));
columns.add(new ColumnNameTypeValue("col2", ColumnType.STRING, "test string"));
columns.add(new ColumnNameTypeValue("col3", ColumnType.BOOLEAN,... | Decision | positive | 5,240 |
@Override
public void onError(Throwable e) {
e.printStackTrace();
if (mBaseService != null) {
mBaseService.returnFailed(e.getMessage());
}
CrashReport.postCatchedException(e);
} | @Override
public void onError(Throwable e) {
e.printStackTrace();
<DeepExtract>
if (mBaseService != null) {
mBaseService.returnFailed(e.getMessage());
}
</DeepExtract>
CrashReport.postCatchedException(e);
} | V2EX | positive | 5,241 |
@Override
public GiteaPullRequest fetchPullRequest(String username, String name, long id) throws IOException, InterruptedException {
HttpURLConnection connection = openConnection(api().literal("/repos").path(UriTemplateBuilder.var("username")).path(UriTemplateBuilder.var("name")).literal("/pulls").path(UriTemplateBuild... | @Override
public GiteaPullRequest fetchPullRequest(String username, String name, long id) throws IOException, InterruptedException {
<DeepExtract>
HttpURLConnection connection = openConnection(api().literal("/repos").path(UriTemplateBuilder.var("username")).path(UriTemplateBuilder.var("name")).literal("/pulls").path(Ur... | gitea-plugin | positive | 5,242 |
protected void describeTest(final MisteryGuest data) throws Exception {
if (data.datasets == null || data.datasets.length == 0) {
return;
}
final Model memoryModel = data.graphURI != null ? memoryDataset.getNamedModel(data.graphURI) : memoryDataset.getDefaultModel();
for (final String datafileName : data.datasets) {
fi... | protected void describeTest(final MisteryGuest data) throws Exception {
<DeepExtract>
if (data.datasets == null || data.datasets.length == 0) {
return;
}
final Model memoryModel = data.graphURI != null ? memoryDataset.getNamedModel(data.graphURI) : memoryDataset.getDefaultModel();
for (final String datafileName : data.... | SolRDF | positive | 5,243 |
@Override
protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
mValues.clear();
mValues.addAll(restoreValue ? getPersistedStringSet(mValues) : (Set<String>) defaultValue);
persistStringSet(restoreValue ? getPersistedStringSet(mValues) : (Set<String>) defaultValue);
} | @Override
protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
<DeepExtract>
mValues.clear();
mValues.addAll(restoreValue ? getPersistedStringSet(mValues) : (Set<String>) defaultValue);
persistStringSet(restoreValue ? getPersistedStringSet(mValues) : (Set<String>) defaultValue);
</DeepExtract>
... | PreferenceFragment | positive | 5,244 |
@CallSuper
@Override
protected void initView() {
super.initView();
int color = DialogConfig.getDialogColor().contentBackgroundColor();
switch(DialogConfig.getDialogStyle()) {
case DialogStyle.One:
case DialogStyle.Two:
setBackgroundColor(CornerRound.Top, color);
break;
case DialogStyle.Three:
setBackgroundColor(CornerR... | @CallSuper
@Override
protected void initView() {
super.initView();
int color = DialogConfig.getDialogColor().contentBackgroundColor();
switch(DialogConfig.getDialogStyle()) {
case DialogStyle.One:
case DialogStyle.Two:
setBackgroundColor(CornerRound.Top, color);
break;
case DialogStyle.Three:
setBackgroundColor(CornerR... | AndroidPicker | positive | 5,245 |
private String trampolineString(ProcessBuilder pb) {
if (hasAttribute(ATTR_ENV))
throw new RuntimeException("Capsule cannot trampoline because manifest defines the " + ATTR_ENV + " attribute.");
final List<String> cmdline = new ArrayList<>(pb.command());
cmdline.remove("-D" + PROP_TRAMPOLINE);
for (int i = 0; i < cmdli... | private String trampolineString(ProcessBuilder pb) {
if (hasAttribute(ATTR_ENV))
throw new RuntimeException("Capsule cannot trampoline because manifest defines the " + ATTR_ENV + " attribute.");
final List<String> cmdline = new ArrayList<>(pb.command());
cmdline.remove("-D" + PROP_TRAMPOLINE);
for (int i = 0; i < cmdli... | capsule | positive | 5,246 |
@Override
public int compareKeyAndSerializedKey(ByteBuffer key, OakScopedReadBuffer serializedKey) {
int minSize = Math.min(size, size);
for (int i = 0; i < minSize; i++) {
int i1 = key.getInt(0 + Integer.BYTES * i);
int i2 = serializedKey.getInt(0 + Integer.BYTES * i);
int compare = Integer.compare(i1, i2);
if (compar... | @Override
public int compareKeyAndSerializedKey(ByteBuffer key, OakScopedReadBuffer serializedKey) {
<DeepExtract>
int minSize = Math.min(size, size);
for (int i = 0; i < minSize; i++) {
int i1 = key.getInt(0 + Integer.BYTES * i);
int i2 = serializedKey.getInt(0 + Integer.BYTES * i);
int compare = Integer.compare(i1, i... | Oak | positive | 5,247 |
public static void makePlayerForget(String playerName, Object object) {
if (mod != null) {
ModWrapper.mod = (EquivalentExchange) mod;
}
if (mod != null) {
ModWrapper.mod.getPlayerKnowledgeRegistry().makePlayerForget(playerName, object);
}
} | public static void makePlayerForget(String playerName, Object object) {
<DeepExtract>
if (mod != null) {
ModWrapper.mod = (EquivalentExchange) mod;
}
</DeepExtract>
if (mod != null) {
ModWrapper.mod.getPlayerKnowledgeRegistry().makePlayerForget(playerName, object);
}
} | Equivalent-Exchange-3 | positive | 5,248 |
@Override
public void run() {
File target = file;
if (target.exists() && target.isFile() && target.canWrite())
target.delete();
else if (target.exists() && target.isDirectory() && target.canRead()) {
String[] file_list = target.list();
if (file_list != null && file_list.length == 0) {
target.delete();
} else if (file_l... | @Override
public void run() {
<DeepExtract>
File target = file;
if (target.exists() && target.isFile() && target.canWrite())
target.delete();
else if (target.exists() && target.isDirectory() && target.canRead()) {
String[] file_list = target.list();
if (file_list != null && file_list.length == 0) {
target.delete();
} e... | File_Quest | positive | 5,249 |
public static void main(String[] args) {
int[] array = { 3, 1, 2, 5, 7, 23, 123, 45, 2, 15, 12 };
if (0 < array.length - 1) {
int[] p = partition(array, 0, array.length - 1);
quickSort(array, 0, p[0] - 1);
quickSort(array, p[1] + 1, array.length - 1);
}
System.out.println(Arrays.toString(array));
} | public static void main(String[] args) {
int[] array = { 3, 1, 2, 5, 7, 23, 123, 45, 2, 15, 12 };
<DeepExtract>
if (0 < array.length - 1) {
int[] p = partition(array, 0, array.length - 1);
quickSort(array, 0, p[0] - 1);
quickSort(array, p[1] + 1, array.length - 1);
}
</DeepExtract>
System.out.println(Arrays.toString(ar... | learning-note | positive | 5,250 |
public static void onUpgrade(final Context context, final SQLiteDatabase db) throws IOException {
Log.w(TAG, "Upgrading table: " + TABLE);
String fn = TABLE + ".bak";
context.deleteFile(fn);
ObjectOutputStream os = new ObjectOutputStream(context.openFileOutput(fn, Context.MODE_PRIVATE));
Log.d(TAG, "backup(db,", TABLE,... | public static void onUpgrade(final Context context, final SQLiteDatabase db) throws IOException {
Log.w(TAG, "Upgrading table: " + TABLE);
String fn = TABLE + ".bak";
context.deleteFile(fn);
ObjectOutputStream os = new ObjectOutputStream(context.openFileOutput(fn, Context.MODE_PRIVATE));
Log.d(TAG, "backup(db,", TABLE,... | callmeter | positive | 5,251 |
@Test
public void testDownloadWhen2ValidDatabasesAreFound() throws IOException, SQLException, InterruptedException {
final Path tempDir = Files.createTempDirectory(null);
TempH2DatabaseFactory.createAndFillTempH2Database(tempDir.resolve("db1"));
Thread.sleep(10);
final String jdbc2 = TempH2DatabaseFactory.createAndFill... | @Test
public void testDownloadWhen2ValidDatabasesAreFound() throws IOException, SQLException, InterruptedException {
final Path tempDir = Files.createTempDirectory(null);
TempH2DatabaseFactory.createAndFillTempH2Database(tempDir.resolve("db1"));
Thread.sleep(10);
final String jdbc2 = TempH2DatabaseFactory.createAndFill... | MergeProcessor | positive | 5,252 |
public static LocalDate parseLocalDate(String date) throws ParseException {
if (parseThrowException(date) == null) {
return null;
}
if (parseThrowException(date) instanceof java.sql.Date || parseThrowException(date) instanceof java.sql.Time) {
parseThrowException(date) = new Date(parseThrowException(date).getTime());
}... | public static LocalDate parseLocalDate(String date) throws ParseException {
<DeepExtract>
if (parseThrowException(date) == null) {
return null;
}
if (parseThrowException(date) instanceof java.sql.Date || parseThrowException(date) instanceof java.sql.Time) {
parseThrowException(date) = new Date(parseThrowException(date)... | nimble-orm | positive | 5,253 |
public static Date startTimeOfSecondQuarter(int year) {
return DateTimeConverterUtil.toDate(LocalDate.of(year, 4, 1).atTime(startTimeOfDay()));
} | public static Date startTimeOfSecondQuarter(int year) {
<DeepExtract>
return DateTimeConverterUtil.toDate(LocalDate.of(year, 4, 1).atTime(startTimeOfDay()));
</DeepExtract>
} | jstarcraft-nlp | positive | 5,254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.