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 onDestroy() {
if (mStopForeground != null) {
mStopForegroundArgs[0] = Boolean.TRUE;
invokeMethod(mStopForeground, mStopForegroundArgs);
return;
}
mNM.cancel(R.string.remote_service_started);
mSetForegroundArgs[0] = Boolean.FALSE;
invokeMethod(mSetForeground, mSetForegroundArgs);
if (mLocationListe... | @Override
public void onDestroy() {
<DeepExtract>
if (mStopForeground != null) {
mStopForegroundArgs[0] = Boolean.TRUE;
invokeMethod(mStopForeground, mStopForegroundArgs);
return;
}
mNM.cancel(R.string.remote_service_started);
mSetForegroundArgs[0] = Boolean.FALSE;
invokeMethod(mSetForeground, mSetForegroundArgs);
</De... | RMaps.0.9.x | positive | 435,172 |
public Response fail(ErrorCodeIntf err, String othMsg) {
return code;
this.msg = err.getMsg() + othMsg;
return fail();
} | public Response fail(ErrorCodeIntf err, String othMsg) {
<DeepExtract>
return code;
</DeepExtract>
this.msg = err.getMsg() + othMsg;
return fail();
} | chronus | positive | 435,173 |
public void clickLinkWithText(String linkText, int index) {
assertTrue("Link with text [" + linkText + "] and index [" + index + "] not found in response.", getTestingEngine().hasLinkWithText(linkText, index));
getTestingEngine().clickLinkWithText(linkText, index);
} | public void clickLinkWithText(String linkText, int index) {
<DeepExtract>
assertTrue("Link with text [" + linkText + "] and index [" + index + "] not found in response.", getTestingEngine().hasLinkWithText(linkText, index));
</DeepExtract>
getTestingEngine().clickLinkWithText(linkText, index);
} | jwebunit | positive | 435,175 |
public void loadProjectFromFolderOrSnowFile(File path) {
SnowConstants.INSTANCE.setStageTitle("- " + path.getName());
boolean abort;
if (canSave.getValue()) {
ButtonType save = new ButtonType("Save changes");
ButtonType dontSave = new ButtonType("Don't save");
ButtonType cancel = new ButtonType("Cancel", ButtonBar.Butt... | public void loadProjectFromFolderOrSnowFile(File path) {
SnowConstants.INSTANCE.setStageTitle("- " + path.getName());
boolean abort;
if (canSave.getValue()) {
ButtonType save = new ButtonType("Save changes");
ButtonType dontSave = new ButtonType("Don't save");
ButtonType cancel = new ButtonType("Cancel", ButtonBar.Butt... | snowride | positive | 435,176 |
@Override
public void onClick(View v) {
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_FINE_LOCATION)) {
fragment.requestPermissions(Permissions.getPreQLocationPermissions(), preQLocationResultCode);
} else {
Intent i = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTING... | @Override
public void onClick(View v) {
<DeepExtract>
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_FINE_LOCATION)) {
fragment.requestPermissions(Permissions.getPreQLocationPermissions(), preQLocationResultCode);
} else {
Intent i = new Intent(Settings.ACTION_APPLICATION_D... | george | positive | 435,179 |
final T assertCannotUse() throws Exception {
if (canUse()) {
fail(this + "should have been rejected");
}
return (T) this;
} | final T assertCannotUse() throws Exception {
if (canUse()) {
fail(this + "should have been rejected");
}
<DeepExtract>
return (T) this;
</DeepExtract>
} | script-security-plugin | positive | 435,180 |
public Boolean isArray() {
JNIReturnClass runnable = new JNIReturnClass() {
@Override
public void run() {
jni = new JNIReturnObject();
jni.bool = isArray(context.ctxRef(), valueRef);
}
};
if (Looper.myLooper() == Looper.getMainLooper()) {
try {
JSException e = new JSTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUT... | public Boolean isArray() {
JNIReturnClass runnable = new JNIReturnClass() {
@Override
public void run() {
jni = new JNIReturnObject();
jni.bool = isArray(context.ctxRef(), valueRef);
}
};
<DeepExtract>
if (Looper.myLooper() == Looper.getMainLooper()) {
try {
JSException e = new JSTask().executeOnExecutor(AsyncTask.THRE... | AndroidJSCore | positive | 435,181 |
public void setData(List<?> t) {
mData.clear();
mDataFiltered.clear();
notifyDataSetChanged();
int oSize = mData.size();
for (Object d : t) {
if (d instanceof Title) {
((Title) d).setBookmark(p.getBookmark((Title) d));
mData.add((Title) d);
} else if (d instanceof MTitle) {
Title d2 = new Title((MTitle) d);
d2.setBookm... | public void setData(List<?> t) {
mData.clear();
mDataFiltered.clear();
notifyDataSetChanged();
<DeepExtract>
int oSize = mData.size();
for (Object d : t) {
if (d instanceof Title) {
((Title) d).setBookmark(p.getBookmark((Title) d));
mData.add((Title) d);
} else if (d instanceof MTitle) {
Title d2 = new Title((MTitle) d... | MangaViewAndroid | positive | 435,182 |
private void init(Context context, AttributeSet attrs) {
topCircle = new Circle();
bottomCircle = new Circle();
mPath = new Path();
mPaint = new Paint();
mPaint.setColor(Color.GRAY);
mPaint.setAntiAlias(true);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setStrokeWidth(STROKE_WIDTH);
Drawable drawable = getReso... | private void init(Context context, AttributeSet attrs) {
topCircle = new Circle();
bottomCircle = new Circle();
mPath = new Path();
mPaint = new Paint();
mPaint.setColor(Color.GRAY);
mPaint.setAntiAlias(true);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setStrokeWidth(STROKE_WIDTH);
Drawable drawable = getReso... | XRefreshView | positive | 435,183 |
public static Fragment addFragment(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @IdRes final int containerId, final boolean isHide, final boolean isAddStack, SharedElement... sharedElement) {
Bundle bundle = fragment.getArguments();
if (bundle == null) {
bundle = new Bundle();
fragm... | public static Fragment addFragment(@NonNull final FragmentManager fragmentManager, @NonNull final Fragment fragment, @IdRes final int containerId, final boolean isHide, final boolean isAddStack, SharedElement... sharedElement) {
Bundle bundle = fragment.getArguments();
if (bundle == null) {
bundle = new Bundle();
fragm... | WanDroid | positive | 435,184 |
public void saveAnalytics(String command) {
LoggableEvent event = LoggableEventCreator.createEvent(command);
this.eventSendBuffer.receiveEvent(event);
try {
eventSendBuffer.saveNow(1000);
} catch (Exception e) {
logger.warn("Failed to save events: ", e.getStackTrace());
}
} | public void saveAnalytics(String command) {
LoggableEvent event = LoggableEventCreator.createEvent(command);
<DeepExtract>
this.eventSendBuffer.receiveEvent(event);
try {
eventSendBuffer.saveNow(1000);
} catch (Exception e) {
logger.warn("Failed to save events: ", e.getStackTrace());
}
</DeepExtract>
} | tmc-cli | positive | 435,185 |
@Test
public void testConnectionHandler() throws Exception {
InetSocketAddress ajp = new InetSocketAddress("localhost", 8010);
Server server = new Server(ajp, new AJPConnectionHandler(handler));
server.start();
AJPClient client = new AJPClient();
client.setTimeout(1000);
client.connect(ajp);
doPost(client, 16);
doPost(... | @Test
public void testConnectionHandler() throws Exception {
InetSocketAddress ajp = new InetSocketAddress("localhost", 8010);
Server server = new Server(ajp, new AJPConnectionHandler(handler));
server.start();
AJPClient client = new AJPClient();
client.setTimeout(1000);
client.connect(ajp);
<DeepExtract>
doPost(client... | OWASP-Proxy | positive | 435,187 |
public IBuild visit(IBuildTriggerable triggerable) {
triggerable.setCommitId(cid);
triggerable.addBuildCause("Jenkins job: " + overrides.get(IOpenShiftPlugin.BUILD_URL_ENV_KEY));
if (getEnv() != null) {
for (NameValuePair p : getEnv()) {
String name = p.getName().trim();
if (!name.isEmpty()) {
if (chatty)
listener.getL... | public IBuild visit(IBuildTriggerable triggerable) {
triggerable.setCommitId(cid);
triggerable.addBuildCause("Jenkins job: " + overrides.get(IOpenShiftPlugin.BUILD_URL_ENV_KEY));
<DeepExtract>
if (getEnv() != null) {
for (NameValuePair p : getEnv()) {
String name = p.getName().trim();
if (!name.isEmpty()) {
if (chatty)... | jenkins-plugin | positive | 435,189 |
@Test(expected = TestException.class)
public void joinMixedException() throws CheckedFutureException {
Promise<Integer> p1 = Promise.apply();
Promise<Integer> p2 = Promise.apply();
Future<Void> future = Future.join(Arrays.asList(p1, p2, Future.value(3)));
p1.setValue(1);
p2.setException(ex);
return future.get(Duration.... | @Test(expected = TestException.class)
public void joinMixedException() throws CheckedFutureException {
Promise<Integer> p1 = Promise.apply();
Promise<Integer> p2 = Promise.apply();
Future<Void> future = Future.join(Arrays.asList(p1, p2, Future.value(3)));
p1.setValue(1);
p2.setException(ex);
<DeepExtract>
return future... | future | positive | 435,190 |
public <T> Predicate lte(T value) {
LessOrEqual re = new LessOrEqual();
re._left = this;
if (value instanceof Directive) {
re._right = (Directive) value;
} else {
re._right = new Literal(value);
}
return re;
} | public <T> Predicate lte(T value) {
LessOrEqual re = new LessOrEqual();
re._left = this;
<DeepExtract>
if (value instanceof Directive) {
re._right = (Directive) value;
} else {
re._right = new Literal(value);
}
</DeepExtract>
return re;
} | jaskell-java8 | positive | 435,192 |
private static void blankInput() throws Exception {
Pattern p = Pattern.compile("abc", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher("");
if (m.find())
failCount++;
p = Pattern.compile("a*", Pattern.CASE_INSENSITIVE);
m = p.matcher("");
if (!m.find())
failCount++;
p = Pattern.compile("abc");
m = p.matcher("");
if (m... | private static void blankInput() throws Exception {
Pattern p = Pattern.compile("abc", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher("");
if (m.find())
failCount++;
p = Pattern.compile("a*", Pattern.CASE_INSENSITIVE);
m = p.matcher("");
if (!m.find())
failCount++;
p = Pattern.compile("abc");
m = p.matcher("");
if (m... | com.florianingerl.util.regex | positive | 435,193 |
public final List<String> parseCancelOrders(List<String> results, ExchangeInfo info) {
Exception exception = null;
try {
R r = this::transformCancelOrders.apply(results, info);
if (exist(r)) {
return r;
}
} catch (Exception e) {
this.log.error("{} {} exception is {}", this.name.getName(), info.tip(), e);
exception = e;... | public final List<String> parseCancelOrders(List<String> results, ExchangeInfo info) {
<DeepExtract>
Exception exception = null;
try {
R r = this::transformCancelOrders.apply(results, info);
if (exist(r)) {
return r;
}
} catch (Exception e) {
this.log.error("{} {} exception is {}", this.name.getName(), info.tip(), e);
... | GOAi | positive | 435,195 |
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(actionBarColor, PorterDuff.Mode.SRC_ATOP);
mReadItLater.getCompoundDrawables()[0].setColorFilter(colorFilter);
mReadItLater.setTextColor(actionBarColor);
} | @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
<DeepExtract>
PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(actionBarColor, PorterDuff.Mode.SRC_ATOP);
mReadItLater.getCompoundDrawables()[0].setColorFilter(colorFilter);
mReadItLater.setTextColor(actionBarColor);
</DeepExtract>... | Gazetti_Newspaper_Reader | positive | 435,196 |
public LeafNode[] divideLeafNode() {
LeafNode[] leafNodeArray = new LeafNode[2];
Cluster cluster1 = null;
Cluster cluster2 = null;
Cluster tempCluster = null;
double maxValue = 0;
double temp = 0;
for (int i = 0; i < clusterChilds.size() - 1; i++) {
tempCluster = clusterChilds.get(i);
for (int j = i + 1; j < clusterChi... | public LeafNode[] divideLeafNode() {
LeafNode[] leafNodeArray = new LeafNode[2];
Cluster cluster1 = null;
Cluster cluster2 = null;
Cluster tempCluster = null;
double maxValue = 0;
double temp = 0;
for (int i = 0; i < clusterChilds.size() - 1; i++) {
tempCluster = clusterChilds.get(i);
for (int j = i + 1; j < clusterChi... | datamining-18algorithms | positive | 435,197 |
private void addRoom(AdapterItemRoomFinder item, int roomID) {
if (roomList.contains(item))
return;
requestQueue.add(new RequestModel(roomID, item.getName()));
if (roomList.isEmpty())
findViewById(R.id.tvNoRooms).setVisibility(View.VISIBLE);
else
findViewById(R.id.tvNoRooms).setVisibility(View.GONE);
Collections.sort(r... | private void addRoom(AdapterItemRoomFinder item, int roomID) {
if (roomList.contains(item))
return;
requestQueue.add(new RequestModel(roomID, item.getName()));
<DeepExtract>
if (roomList.isEmpty())
findViewById(R.id.tvNoRooms).setVisibility(View.VISIBLE);
else
findViewById(R.id.tvNoRooms).setVisibility(View.GONE);
Coll... | OpenUntis | positive | 435,198 |
public static synchronized I18nLoader newInstance(List<Feature> features) {
instance = null;
if (instance == null) {
instance = new I18nLoader();
instance.init(features);
}
return instance;
} | public static synchronized I18nLoader newInstance(List<Feature> features) {
instance = null;
<DeepExtract>
if (instance == null) {
instance = new I18nLoader();
instance.init(features);
}
return instance;
</DeepExtract>
} | cukedoctor | positive | 435,199 |
private void initView() {
_fieldController = this.new TextFieldController();
_brush = new Paint();
_brush.setAntiAlias(true);
_brush.setTextSize(BASE_TEXT_SIZE_PIXELS);
setBackgroundColor(ColorScheme.backgroundColor);
setFocusableInTouchMode(true);
setHapticFeedbackEnabled(true);
_rowLis = new RowListener() {
@Override... | private void initView() {
_fieldController = this.new TextFieldController();
_brush = new Paint();
_brush.setAntiAlias(true);
_brush.setTextSize(BASE_TEXT_SIZE_PIXELS);
setBackgroundColor(ColorScheme.backgroundColor);
setFocusableInTouchMode(true);
setHapticFeedbackEnabled(true);
_rowLis = new RowListener() {
@Override... | TextWarriorLibrary | positive | 435,200 |
@Test
public void testQuestionEnhancing() {
VotingQuestion votingQuestion = new VotingQuestion();
votingQuestion.setAlternativeQuestion(true);
votingQuestion.setQuestionKey("abc");
VotingSubject votingSubject = new VotingSubject();
votingSubject.setEndOfVoteTime(OffsetDateTime.MIN);
votingSubject.setRevealWinner(true);... | @Test
public void testQuestionEnhancing() {
VotingQuestion votingQuestion = new VotingQuestion();
votingQuestion.setAlternativeQuestion(true);
votingQuestion.setQuestionKey("abc");
VotingSubject votingSubject = new VotingSubject();
votingSubject.setEndOfVoteTime(OffsetDateTime.MIN);
votingSubject.setRevealWinner(true);... | faf-java-api | positive | 435,201 |
public String getSQL(boolean isJoin, List args) {
StringBuilder buff = new StringBuilder();
if (isJoin) {
if (outerJoin) {
buff.append("LEFT OUTER JOIN ");
} else {
buff.append("INNER JOIN ");
}
}
buff.append(table.getSQL());
if (alias != null) {
buff.append(' ').append(Session.quoteIdentifier(alias));
}
if (isJoin) {
... | public String getSQL(boolean isJoin, List args) {
StringBuilder buff = new StringBuilder();
if (isJoin) {
if (outerJoin) {
buff.append("LEFT OUTER JOIN ");
} else {
buff.append("INNER JOIN ");
}
}
buff.append(table.getSQL());
if (alias != null) {
buff.append(' ').append(Session.quoteIdentifier(alias));
}
if (isJoin) {
... | RedQueryBuilder | positive | 435,202 |
@Test(expected = RuntimeException.class)
public void testJobFailDueToOffsetRangeCallError() throws Exception {
TopicMetadataResponse metadataResponse = mockTopicMetaDataResponse();
List<MyMessage> myMessages = messagesWritten.get(TOPIC_1);
OffsetResponse offsetResponse = mockOffsetResponseWithError(myMessages);
EtlInpu... | @Test(expected = RuntimeException.class)
public void testJobFailDueToOffsetRangeCallError() throws Exception {
<DeepExtract>
TopicMetadataResponse metadataResponse = mockTopicMetaDataResponse();
List<MyMessage> myMessages = messagesWritten.get(TOPIC_1);
OffsetResponse offsetResponse = mockOffsetResponseWithError(myMess... | camus | positive | 435,203 |
@Override
public void addRecentName(@NotNull @NonNls String name) {
RECENT_TEMPLATES.remove(name);
RECENT_TEMPLATES.add(name);
} | @Override
public void addRecentName(@NotNull @NonNls String name) {
<DeepExtract>
RECENT_TEMPLATES.remove(name);
RECENT_TEMPLATES.add(name);
</DeepExtract>
} | testme-idea | positive | 435,206 |
private void update() {
String in = GUI.getInputText(uid + "chna::" + y);
if (Configs.isLNameTaken(cid, ProfileType.VIEWER, in) && !in.equals(lay.getName())) {
GUI.setBackground(uid + "chna::" + y, new Color(255, 122, 122));
return;
}
names.remove(this.name);
this.name = in;
names.put(in, lay);
Configs.setStr(cid, lay,... | private void update() {
String in = GUI.getInputText(uid + "chna::" + y);
if (Configs.isLNameTaken(cid, ProfileType.VIEWER, in) && !in.equals(lay.getName())) {
GUI.setBackground(uid + "chna::" + y, new Color(255, 122, 122));
return;
}
<DeepExtract>
names.remove(this.name);
this.name = in;
names.put(in, lay);
Configs.se... | StreamRaidersBot | positive | 435,207 |
public Cursor rawQuery(String sql, String[] selectionArgs) {
if (!isOpen()) {
throw new IllegalStateException("database not open");
}
long timeStart = 0;
if (Config.LOGV || mSlowQueryThreshold != -1) {
timeStart = System.currentTimeMillis();
}
SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this, sql, null);
C... | public Cursor rawQuery(String sql, String[] selectionArgs) {
<DeepExtract>
if (!isOpen()) {
throw new IllegalStateException("database not open");
}
long timeStart = 0;
if (Config.LOGV || mSlowQueryThreshold != -1) {
timeStart = System.currentTimeMillis();
}
SQLiteCursorDriver driver = new SQLiteDirectCursorDriver(this,... | android-database-sqlcipher | positive | 435,209 |
public DIReactor addComponent(final String id, final Class<?> implClass, final Set<String> params) {
final DIComponentInfo diComponentInfo = new DIComponentInfo(id, implClass, params);
if (allComponentInfos.contains(diComponentInfo.getId())) {
throw new DIException("deux composants insérés avec le même id :'" + diCo... | public DIReactor addComponent(final String id, final Class<?> implClass, final Set<String> params) {
final DIComponentInfo diComponentInfo = new DIComponentInfo(id, implClass, params);
<DeepExtract>
if (allComponentInfos.contains(diComponentInfo.getId())) {
throw new DIException("deux composants insérés avec le même... | vertigo | positive | 435,210 |
public UserBuilder withDefaults() {
this.username = "jane@doe.com";
return this;
} | public UserBuilder withDefaults() {
<DeepExtract>
this.username = "jane@doe.com";
return this;
</DeepExtract>
} | vics | positive | 435,212 |
@Override
public Object clone() {
return new ChunkLocation(x, z);
} | @Override
public Object clone() {
<DeepExtract>
return new ChunkLocation(x, z);
</DeepExtract>
} | TridentSDK | positive | 435,213 |
@Override
public void onClick(View v) {
startActivity(new Intent(TestRecyclerViewInNestedScrollViewInSrlActivity.this, MainActivity.class));
finish();
} | @Override
public void onClick(View v) {
<DeepExtract>
startActivity(new Intent(TestRecyclerViewInNestedScrollViewInSrlActivity.this, MainActivity.class));
finish();
</DeepExtract>
} | SmoothRefreshLayout | positive | 435,214 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mMeasureSpecHeight = View.MeasureSpec.getSize(heightMeasureSpec);
int newWidthMeasureSpec;
if (mCalendarViewPagerWidth == SIZE_UNSPECIFIED) {
newWidthMeasureSpec = widthMeasureSpec;
}
final int mode = View.MeasureSpec.getMode(widthMeasure... | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mMeasureSpecHeight = View.MeasureSpec.getSize(heightMeasureSpec);
<DeepExtract>
int newWidthMeasureSpec;
if (mCalendarViewPagerWidth == SIZE_UNSPECIFIED) {
newWidthMeasureSpec = widthMeasureSpec;
}
final int mode = View.MeasureSpec.getMod... | SamsungOneUi | positive | 435,215 |
public Vec3f add(Vec3i v) {
this.x = x + v.x();
this.y = y + v.y();
this.z = z + v.z();
return this;
return this;
} | public Vec3f add(Vec3i v) {
<DeepExtract>
this.x = x + v.x();
this.y = y + v.y();
this.z = z + v.z();
return this;
</DeepExtract>
return this;
} | CraftMania | positive | 435,219 |
@Override
public BigDecimal convert(Number sourceDuration, DecimalTimeUnit u) {
return toSeconds(sourceDuration).divide(SECONDS_IN_DAY);
} | @Override
public BigDecimal convert(Number sourceDuration, DecimalTimeUnit u) {
<DeepExtract>
return toSeconds(sourceDuration).divide(SECONDS_IN_DAY);
</DeepExtract>
} | funf-core-android | positive | 435,221 |
@Override
public void onPause() {
super.onPause();
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener(null);
} | @Override
public void onPause() {
super.onPause();
<DeepExtract>
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener(null);
</DeepExtract>
} | LSPosed | positive | 435,222 |
private void init() {
Objects.requireNonNull(CssDataViewHandler.class, "viewHandlerClass can't be null");
ViewHandler viewHandler = context.addBean(CssDataViewHandler.class);
String type = viewHandler.getType();
if (viewHandler.getHandlerType().equals(ViewHandlerType.DATA_VIEW)) {
type = type + dataViewMark();
}
this.v... | private void init() {
Objects.requireNonNull(CssDataViewHandler.class, "viewHandlerClass can't be null");
ViewHandler viewHandler = context.addBean(CssDataViewHandler.class);
String type = viewHandler.getType();
if (viewHandler.getHandlerType().equals(ViewHandlerType.DATA_VIEW)) {
type = type + dataViewMark();
}
this.v... | aquiver | positive | 435,223 |
@Override
public void onFailure(@NonNull Exception exception) {
Toast.makeText(SettingsActivity.this, "could not upload photo", Toast.LENGTH_SHORT).show();
if (mProgressBar.getVisibility() == View.VISIBLE) {
mProgressBar.setVisibility(View.INVISIBLE);
}
} | @Override
public void onFailure(@NonNull Exception exception) {
Toast.makeText(SettingsActivity.this, "could not upload photo", Toast.LENGTH_SHORT).show();
<DeepExtract>
if (mProgressBar.getVisibility() == View.VISIBLE) {
mProgressBar.setVisibility(View.INVISIBLE);
}
</DeepExtract>
} | TabianConsulting | positive | 435,225 |
@Override
public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {
bright_label.setText(getString(R.string.brightness).replace(":value:", ((bright_value.getProgress() - 200) * 100 / 200) + ""));
} | @Override
public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {
<DeepExtract>
bright_label.setText(getString(R.string.brightness).replace(":value:", ((bright_value.getProgress() - 200) * 100 / 200) + ""));
</DeepExtract>
} | Dali-Doodle | positive | 435,226 |
@Override
public void start(Stage primaryStage) {
System.out.println("JavaFX version: " + VersionInfo.getRuntimeVersion());
mediaModel.setURL("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv");
videoView = new VideoView(mediaModel);
playerControlsView = new PlayerControlsView(mediaModel);
playerControl... | @Override
public void start(Stage primaryStage) {
System.out.println("JavaFX version: " + VersionInfo.getRuntimeVersion());
mediaModel.setURL("http://download.oracle.com/otndocs/products/javafx/oow2010-2.flv");
videoView = new VideoView(mediaModel);
playerControlsView = new PlayerControlsView(mediaModel);
playerControl... | pro-javafx-8 | positive | 435,227 |
public static AuthenticationFailedResponse okayWithData(Object data) {
this.data = data;
return this;
} | public static AuthenticationFailedResponse okayWithData(Object data) {
<DeepExtract>
this.data = data;
return this;
</DeepExtract>
} | wecube-plugins-service-management | positive | 435,228 |
public String selectByExample(ResourceExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("resource_id");
} else {
sql.SELECT("resource_id");
}
sql.SELECT("resource_name");
sql.SELECT("url");
sql.SELECT("description");
sql.SELECT("sort");
sql.SELECT("parent_id");
s... | public String selectByExample(ResourceExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("resource_id");
} else {
sql.SELECT("resource_id");
}
sql.SELECT("resource_name");
sql.SELECT("url");
sql.SELECT("description");
sql.SELECT("sort");
sql.SELECT("parent_id");
s... | wukong-framework | positive | 435,229 |
public static void deleteDir(final String pPath) {
File dir = new File(pPath);
if (dir == null || !dir.exists() || !dir.isDirectory())
return;
for (File file : dir.listFiles()) {
if (file.isFile())
file.delete();
else if (file.isDirectory())
deleteDirWihtFile(file);
}
dir.delete();
} | public static void deleteDir(final String pPath) {
File dir = new File(pPath);
<DeepExtract>
if (dir == null || !dir.exists() || !dir.isDirectory())
return;
for (File file : dir.listFiles()) {
if (file.isFile())
file.delete();
else if (file.isDirectory())
deleteDirWihtFile(file);
}
dir.delete();
</DeepExtract>
} | ChartSdk | positive | 435,230 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OpenEventApp.getEventBus().register(this);
if (results.size() == 0) {
noResultsView.setVisibility(View.VISIBLE);
searchRecyclerView.setVisibility(View.INVISIBLE);
} else {
noResultsView.setVisibility(View.INVISIBLE);
sear... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OpenEventApp.getEventBus().register(this);
<DeepExtract>
if (results.size() == 0) {
noResultsView.setVisibility(View.VISIBLE);
searchRecyclerView.setVisibility(View.INVISIBLE);
} else {
noResultsView.setVisibility(View.IN... | open-event-droidgen | positive | 435,231 |
@Override
public boolean onScale(ScaleGestureDetector detector) {
oldPx = detector.getFocusX();
oldPy = detector.getFocusY();
float origScale = saveScale;
saveScale *= detector.getScaleFactor();
if (saveScale > maxScale) {
saveScale = maxScale;
detector.getScaleFactor() = maxScale / origScale;
} else if (saveScale < mi... | @Override
public boolean onScale(ScaleGestureDetector detector) {
oldPx = detector.getFocusX();
oldPy = detector.getFocusY();
<DeepExtract>
float origScale = saveScale;
saveScale *= detector.getScaleFactor();
if (saveScale > maxScale) {
saveScale = maxScale;
detector.getScaleFactor() = maxScale / origScale;
} else if (... | ChanExplorer | positive | 435,233 |
public String queryString(String name) {
Collection<String> ps = queryStrings().get(name);
return (ps == null || ps.size() == 0) ? true ? "" : null : ps.iterator().next();
} | public String queryString(String name) {
<DeepExtract>
Collection<String> ps = queryStrings().get(name);
return (ps == null || ps.size() == 0) ? true ? "" : null : ps.iterator().next();
</DeepExtract>
} | Argo | positive | 435,234 |
@Override
public void onConversationClicked(Conversation conversation, int position) {
conversationsHandler.setConversationRead(conversation.getConversationId());
Log.d(TAG, "ArchivedConversationListFragment.startMessageActivity: conversation == " + conversation.toString());
Intent intent = new Intent(getActivity(), Me... | @Override
public void onConversationClicked(Conversation conversation, int position) {
conversationsHandler.setConversationRead(conversation.getConversationId());
<DeepExtract>
Log.d(TAG, "ArchivedConversationListFragment.startMessageActivity: conversation == " + conversation.toString());
Intent intent = new Intent(get... | chat21-android-sdk | positive | 435,237 |
public Node treeToDoublyList(Node root) {
if (root == null) {
return null;
}
if (root == null) {
return;
}
inOrder(root.left);
if (pre == null) {
head = root;
} else {
pre.right = root;
}
root.left = pre;
pre = root;
inOrder(root.right);
head.left = pre;
pre.right = head;
return head;
} | public Node treeToDoublyList(Node root) {
if (root == null) {
return null;
}
<DeepExtract>
if (root == null) {
return;
}
inOrder(root.left);
if (pre == null) {
head = root;
} else {
pre.right = root;
}
root.left = pre;
pre = root;
inOrder(root.right);
</DeepExtract>
head.left = pre;
pre.right = head;
return head;
} | DataStructureAlgorithmsJava | positive | 435,240 |
public void run() {
if (!syncronizations.containsKey(newPlayer.getId())) {
PlayerStatus status = service.getPlayerStatus(newPlayer.getId());
View view = LayoutInflater.from(getContext()).inflate(R.layout.player_sync_control_layout, null);
SeekBar volumeSeekBar = (SeekBar) view.findViewById(R.id.volume_seek_bar);
volume... | public void run() {
<DeepExtract>
if (!syncronizations.containsKey(newPlayer.getId())) {
PlayerStatus status = service.getPlayerStatus(newPlayer.getId());
View view = LayoutInflater.from(getContext()).inflate(R.layout.player_sync_control_layout, null);
SeekBar volumeSeekBar = (SeekBar) view.findViewById(R.id.volume_see... | squeezedroid | positive | 435,241 |
@SuppressWarnings("ConstantConditions")
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
return new Mater... | @SuppressWarnings("ConstantConditions")
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
return new Mater... | android_app_efidroidmanager | positive | 435,243 |
private void jButton_srEquipmentSearchActionPerformed(java.awt.event.ActionEvent evt) {
if ("Overlays Card".equals("Spot Report Equipment Search Card")) {
refreshTOC();
}
CardLayout layout = (CardLayout) (getLayout());
layout.show(this, "Spot Report Equipment Search Card");
} | private void jButton_srEquipmentSearchActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
if ("Overlays Card".equals("Spot Report Equipment Search Card")) {
refreshTOC();
}
CardLayout layout = (CardLayout) (getLayout());
layout.show(this, "Spot Report Equipment Search Card");
</DeepExtract>
} | vehicle-commander-java | positive | 435,246 |
@Override
public NQLObject visit(AttrExpn e) {
if (log.isDebugEnabled()) {
_evalStack.append(" (");
_evalStack.append(e.getTreeNode().getText());
}
NQLObject value = e.getExpn().accept(this);
if (!(value instanceof Attributable))
throw new TypeError(value, "'%s' object is not attributable");
Attributable attributable =... | @Override
public NQLObject visit(AttrExpn e) {
if (log.isDebugEnabled()) {
_evalStack.append(" (");
_evalStack.append(e.getTreeNode().getText());
}
NQLObject value = e.getExpn().accept(this);
if (!(value instanceof Attributable))
throw new TypeError(value, "'%s' object is not attributable");
Attributable attributable =... | bowser | positive | 435,247 |
public TxSignResult signTransaction(String chainID, String password, Wallet wallet) {
this.network = MetaUtil.getNetWork(wallet.getMetadata());
if (wallet.getMetadata().getSource().equals(Metadata.FROM_WIF)) {
changeAddress = Address.fromBase58(network, wallet.getAddress());
BigInteger prvKey = DumpedPrivateKey.fromBas... | public TxSignResult signTransaction(String chainID, String password, Wallet wallet) {
<DeepExtract>
this.network = MetaUtil.getNetWork(wallet.getMetadata());
if (wallet.getMetadata().getSource().equals(Metadata.FROM_WIF)) {
changeAddress = Address.fromBase58(network, wallet.getAddress());
BigInteger prvKey = DumpedPriv... | tokencore | positive | 435,250 |
public void loadAvailableWidgets() {
WidgetFactory[] widgetFactories = new WidgetFactory[] { new DefaultWidgetsFactory(), new XChatWidgetsFactory(), new GaugesSteelSeriesFactory() };
widgetsComponents.clear();
for (WidgetFactory widgetFactory : widgetFactories) {
List<WidgetInfo> list = widgetFactory.list();
for (Widge... | public void loadAvailableWidgets() {
WidgetFactory[] widgetFactories = new WidgetFactory[] { new DefaultWidgetsFactory(), new XChatWidgetsFactory(), new GaugesSteelSeriesFactory() };
<DeepExtract>
widgetsComponents.clear();
</DeepExtract>
for (WidgetFactory widgetFactory : widgetFactories) {
List<WidgetInfo> list = wid... | RITDevX | positive | 435,252 |
private static void functionColumn(final Context context, final Function function, final FunctionColumn functionColumn) throws SQLException {
Objects.requireNonNull(context, "context is null");
Objects.requireNonNull(function, "function is null");
Objects.requireNonNull(functionColumn, "functionColumn is null");
Object... | private static void functionColumn(final Context context, final Function function, final FunctionColumn functionColumn) throws SQLException {
Objects.requireNonNull(context, "context is null");
Objects.requireNonNull(function, "function is null");
Objects.requireNonNull(functionColumn, "functionColumn is null");
<DeepE... | database-metadata-bind | positive | 435,253 |
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
isDestroyed = false;
viewDelegate.initWidget(getArguments());
viewDelegate.initChildControllers();
lifecycleRegistry.setCurrentState(Lifecycle.State.CREATED);
} | @Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
isDestroyed = false;
viewDelegate.initWidget(getArguments());
viewDelegate.initChildControllers();
<DeepExtract>
lifecycleRegistry.setCurrentState(Lifecycle.State.CREATED);
</DeepExtract>... | AndroidLibrary | positive | 435,254 |
public void mouseClicked(java.awt.event.MouseEvent evt) {
String username = banText.getText();
banText.setText("");
DriverCar driver = new DriverCar();
driver.banDriver(username);
} | public void mouseClicked(java.awt.event.MouseEvent evt) {
<DeepExtract>
String username = banText.getText();
banText.setText("");
DriverCar driver = new DriverCar();
driver.banDriver(username);
</DeepExtract>
} | vehler | positive | 435,255 |
@Test
public void duplicateExpectedColumn() {
this.actualTable(row("Col 1", "Col 2"), row("A", "B"));
this.expectedTable(row("Col 1", "Col 2", "Col 2"), row("A", "B", "B"));
ColumnComparators columnComparators = new ColumnComparators.Builder().withTolerance(1.0d).build();
SingleTableVerifier verifier = createSingleTabl... | @Test
public void duplicateExpectedColumn() {
this.actualTable(row("Col 1", "Col 2"), row("A", "B"));
this.expectedTable(row("Col 1", "Col 2", "Col 2"), row("A", "B", "B"));
<DeepExtract>
ColumnComparators columnComparators = new ColumnComparators.Builder().withTolerance(1.0d).build();
SingleTableVerifier verifier = cr... | tablasco | positive | 435,256 |
@EventHandler
public void onPlotMenuItemClick(PlayerInteractEvent e) {
if (!(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
return;
}
ItemStack stack = VersionUtils.getItemInHand(e.getPlayer());
if (!stack.equals(baseItem.getItemStack())) {
return;
}
BaseArena arena = ArenaRegi... | @EventHandler
public void onPlotMenuItemClick(PlayerInteractEvent e) {
if (!(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
return;
}
ItemStack stack = VersionUtils.getItemInHand(e.getPlayer());
if (!stack.equals(baseItem.getItemStack())) {
return;
}
BaseArena arena = ArenaRegi... | BuildBattle | positive | 435,257 |
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
mUseCase = mUseCases[position];
mTitle.setText(mUseCases[position].title);
mDescription.setText(mUseCases[position].description);
} | @Override
public void onBindViewHolder(ViewHolder holder, int position) {
<DeepExtract>
mUseCase = mUseCases[position];
mTitle.setText(mUseCases[position].title);
mDescription.setText(mUseCases[position].description);
</DeepExtract>
} | android-checkout | positive | 435,258 |
@Override
public Single<byte[]> generateTransactionWithMessage(SignumAddress recipientAddress, byte[] recipientPublicKey, byte[] senderPublicKey, SignumValue fee, int deadline, String message, String referencedTransactionFullHash) {
return service -> service.generateTransactionWithMessage(recipientAddress, recipientPub... | @Override
public Single<byte[]> generateTransactionWithMessage(SignumAddress recipientAddress, byte[] recipientPublicKey, byte[] senderPublicKey, SignumValue fee, int deadline, String message, String referencedTransactionFullHash) {
<DeepExtract>
return service -> service.generateTransactionWithMessage(recipientAddress... | signumj | positive | 435,259 |
private void initSwiperBackHelper() {
super.onCreate(this);
mActivityDestroyed = false;
mActivityHandler = new ActivityHandler(this);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
mActivityDestroyed = false;
mRxManager = new RxManager();
StatusBarUtil.setMIUIStatusBarDarkIcon(this, isLightStatusBar());
StatusBarUtil.... | private void initSwiperBackHelper() {
<DeepExtract>
super.onCreate(this);
mActivityDestroyed = false;
mActivityHandler = new ActivityHandler(this);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
mActivityDestroyed = false;
mRxManager = new RxManager();
StatusBarUtil.setMIUIStatusBarDarkIcon(this, isLightStatusBar());
... | MainUiFrame | positive | 435,260 |
public void setImageMapping(String name, long imageID, ImageSize imageSize) {
if (name == null) {
log.error("The supplied image name is null.");
throw new NullPointerException("The supplied image name is null.");
}
if (imageSize == null) {
log.error("Supplied image size is null.");
throw new NullPointerException("Suppl... | public void setImageMapping(String name, long imageID, ImageSize imageSize) {
if (name == null) {
log.error("The supplied image name is null.");
throw new NullPointerException("The supplied image name is null.");
}
<DeepExtract>
if (imageSize == null) {
log.error("Supplied image size is null.");
throw new NullPointerEx... | TeaStore | positive | 435,261 |
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
int x = (int) e.getX();
int y = (int) e.getY();
if (mVelocityTracker == null) {
mVelocityTracker = VelocityTracker.obtain();
}
mVelocityTracker.addMovement(e);
switch(e.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!mScroller.isFinished()) {
mScroller.a... | @Override
public boolean onInterceptTouchEvent(MotionEvent e) {
int x = (int) e.getX();
int y = (int) e.getY();
<DeepExtract>
if (mVelocityTracker == null) {
mVelocityTracker = VelocityTracker.obtain();
}
mVelocityTracker.addMovement(e);
</DeepExtract>
switch(e.getAction()) {
case MotionEvent.ACTION_DOWN:
if (!mScrolle... | JetpackDemo | positive | 435,262 |
public static void primeiro() {
System.out.println("1o - inicio");
System.out.println("2o - inicio");
terceiro();
System.out.println("2o - fim");
System.out.println("1o - fim");
} | public static void primeiro() {
System.out.println("1o - inicio");
<DeepExtract>
System.out.println("2o - inicio");
terceiro();
System.out.println("2o - fim");
</DeepExtract>
System.out.println("1o - fim");
} | aeds2 | positive | 435,263 |
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
allTags = getTags();
selectedTags = new boolean[allTags.size()];
for (int i = 0; i < allTags.size(); i++) {
List<TagDto> kinoTags = kinoDto.getTags();
selectedTags[i] = kinoTags != null && kinoTags.contains(allTags.get(i));
}
List<String> allTagNames =... | @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
<DeepExtract>
allTags = getTags();
selectedTags = new boolean[allTags.size()];
for (int i = 0; i < allTags.size(); i++) {
List<TagDto> kinoTags = kinoDto.getTags();
selectedTags[i] = kinoTags != null && kinoTags.contains(allTags.get(i));
}
</DeepExtrac... | CineLog | positive | 435,264 |
public void clearExcludedPermsList() {
getDefPrefs().edit().putStringSet(getString(R.string.pref_filter_excluded_perms_key), new HashSet<>()).apply();
ExcFiltersData.INS.updateList(getString(R.string.pref_filter_excluded_perms_key));
} | public void clearExcludedPermsList() {
<DeepExtract>
getDefPrefs().edit().putStringSet(getString(R.string.pref_filter_excluded_perms_key), new HashSet<>()).apply();
ExcFiltersData.INS.updateList(getString(R.string.pref_filter_excluded_perms_key));
</DeepExtract>
} | PermissionManagerX | positive | 435,265 |
@Test
public void testAllThrough() throws LarkClientException {
{
HttpRequestWithAddCookie loginRequest = new HttpRequestWithAddCookie();
HttpResponseWithGetCookie loginResponse = new HttpResponseWithGetCookie();
miniProgramAuthenticator.login(CODE, loginRequest, loginResponse);
cookie = loginResponse.getCookies().get(... | @Test
public void testAllThrough() throws LarkClientException {
{
HttpRequestWithAddCookie loginRequest = new HttpRequestWithAddCookie();
HttpResponseWithGetCookie loginResponse = new HttpResponseWithGetCookie();
miniProgramAuthenticator.login(CODE, loginRequest, loginResponse);
cookie = loginResponse.getCookies().get(... | appframework-java | positive | 435,266 |
@Ignore
@Test
public void createAndDelete() throws Exception {
if (!enabled()) {
return;
}
deleteAll();
assertFalse("Workspace was not properly removed", reader.existsNamespace(DEFAULT_WS));
publisher.createWorkspace(DEFAULT_WS);
GeoServerRESTStructuredGridCoverageReaderManager manager = new GeoServerRESTStructuredGrid... | @Ignore
@Test
public void createAndDelete() throws Exception {
if (!enabled()) {
return;
}
deleteAll();
assertFalse("Workspace was not properly removed", reader.existsNamespace(DEFAULT_WS));
publisher.createWorkspace(DEFAULT_WS);
GeoServerRESTStructuredGridCoverageReaderManager manager = new GeoServerRESTStructuredGrid... | geoserver-manager | positive | 435,267 |
public double getMaxValue(WlPresentation wl) {
Number min = pixelToRealValue(minMax.minVal, wl);
Number max = pixelToRealValue(minMax.maxVal, wl);
if (min == null || max == null) {
return 0;
}
if (false) {
return Math.min(min.doubleValue(), max.doubleValue());
}
return Math.max(min.doubleValue(), max.doubleValue());
} | public double getMaxValue(WlPresentation wl) {
<DeepExtract>
Number min = pixelToRealValue(minMax.minVal, wl);
Number max = pixelToRealValue(minMax.maxVal, wl);
if (min == null || max == null) {
return 0;
}
if (false) {
return Math.min(min.doubleValue(), max.doubleValue());
}
return Math.max(min.doubleValue(), max.doub... | weasis-dicom-tools | positive | 435,268 |
public static AI fromDefBestAgent(final BestAgent agent) {
if (agent.agent().equalsIgnoreCase("Random"))
return new RandomAI();
if (agent.agent().equalsIgnoreCase("Monte Carlo (flat)") || agent.agent().equalsIgnoreCase("Flat MC"))
return new FlatMonteCarlo();
if (agent.agent().equalsIgnoreCase("Alpha-Beta") || agent.ag... | public static AI fromDefBestAgent(final BestAgent agent) {
<DeepExtract>
if (agent.agent().equalsIgnoreCase("Random"))
return new RandomAI();
if (agent.agent().equalsIgnoreCase("Monte Carlo (flat)") || agent.agent().equalsIgnoreCase("Flat MC"))
return new FlatMonteCarlo();
if (agent.agent().equalsIgnoreCase("Alpha-Beta... | LudiiAI | positive | 435,271 |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View rootView = getLayoutInflater().inflate(this.getLayoutId(), null, false);
boolean isNotSwipeBack = getLayoutId() == R.layout.activity_main;
super.setContentView(isNotSwipeBack ? rootView : getContainer(rootView));
Inject... | @Override
<DeepExtract>
</DeepExtract>
public void onCreate(Bundle savedInstanceState) {
<DeepExtract>
</DeepExtract>
super.onCreate(savedInstanceState);
<DeepExtract>
</DeepExtract>
View rootView = getLayoutInflater().inflate(this.getLayoutId(), null, false);
<DeepExtract>
</DeepExtract>
boolean isNotSwipeBack = getLa... | S-MVP | positive | 435,272 |
private static void shellSort2(int[] array) {
for (int i = 0; i < array.length; i++) {
System.out.print(array[i] + " ");
}
System.out.println();
for (int gap = array.length / 2; gap > 0; gap = gap / 2) {
for (int i = gap; i < array.length; i++) {
int current = array[i];
int j = i;
while (j > gap - 1 && (current < array... | private static void shellSort2(int[] array) {
<DeepExtract>
for (int i = 0; i < array.length; i++) {
System.out.print(array[i] + " ");
}
System.out.println();
</DeepExtract>
for (int gap = array.length / 2; gap > 0; gap = gap / 2) {
for (int i = gap; i < array.length; i++) {
int current = array[i];
int j = i;
while (j ... | ProjectStudy | positive | 435,273 |
public String Time2String(int time) {
String duration = "";
String str;
int totalSeconds = time / 1000;
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
int hours = totalSeconds / 3600;
mFormatBuilder.setLength(0);
if (hours > 0) {
str = mFormatter.format("%d:%02d:%02d", hours, minutes, seconds)... | public String Time2String(int time) {
String duration = "";
<DeepExtract>
String str;
int totalSeconds = time / 1000;
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
int hours = totalSeconds / 3600;
mFormatBuilder.setLength(0);
if (hours > 0) {
str = mFormatter.format("%d:%02d:%02d", hours, min... | DynamicWallpaper | positive | 435,275 |
public static String sha1(String srcStr) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] bytes = md.digest(srcStr.getBytes("utf-8"));
return toHex(bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | public static String sha1(String srcStr) {
<DeepExtract>
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] bytes = md.digest(srcStr.getBytes("utf-8"));
return toHex(bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
</DeepExtract>
} | pybbs | positive | 435,280 |
@Override
public void onDestroyView() {
super.onDestroyView();
Bundle state = new Bundle();
state.putInt("index", currentItem);
return state;
} | @Override
public void onDestroyView() {
super.onDestroyView();
<DeepExtract>
Bundle state = new Bundle();
state.putInt("index", currentItem);
return state;
</DeepExtract>
} | LKShop | positive | 435,281 |
public Criteria andOidNotBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "oid" + " cannot be null");
}
criteria.add(new Criterion("oid not between", value1, value2));
return (Criteria) this;
} | public Criteria andOidNotBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "oid" + " cannot be null");
}
criteria.add(new Criterion("oid not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | webike | positive | 435,284 |
public static void main(String[] args) {
final int MESSAGES = 10000;
this.startGenerator(MESSAGES, 5000);
this.startGenerator(MESSAGES, 3280);
this.startGenerator(MESSAGES, 126);
this.startGenerator(MESSAGES, 1000);
this.startGenerator(MESSAGES, 300);
this.startGenerator(MESSAGES, 510);
this.startGenerator(MESSAGES, 45... | public static void main(String[] args) {
<DeepExtract>
final int MESSAGES = 10000;
this.startGenerator(MESSAGES, 5000);
this.startGenerator(MESSAGES, 3280);
this.startGenerator(MESSAGES, 126);
this.startGenerator(MESSAGES, 1000);
this.startGenerator(MESSAGES, 300);
this.startGenerator(MESSAGES, 510);
this.startGenerato... | js-collider | positive | 435,285 |
@Test
void testWithAtomicMove() {
UnsupportedOperationException exception = assertThrows(UnsupportedOperationException.class, () -> CopyOptions.forMove(false, StandardCopyOption.ATOMIC_MOVE));
assertChainEquals(Messages.fileSystemProvider().unsupportedCopyOption(StandardCopyOption.ATOMIC_MOVE), exception);
} | @Test
void testWithAtomicMove() {
<DeepExtract>
UnsupportedOperationException exception = assertThrows(UnsupportedOperationException.class, () -> CopyOptions.forMove(false, StandardCopyOption.ATOMIC_MOVE));
assertChainEquals(Messages.fileSystemProvider().unsupportedCopyOption(StandardCopyOption.ATOMIC_MOVE), exception)... | sftp-fs | positive | 435,286 |
public void setExternalEditorPath(String path) {
Element el = settingsFile.getRootElement().getChild(SETTING_EXTERNALEDITOR);
if (null == el) {
el = new Element(SETTING_EXTERNALEDITOR);
settingsFile.getRootElement().addContent(el);
}
if (path != null && !path.isEmpty()) {
el.setText(path);
} else {
el.setText("");
}
} | public void setExternalEditorPath(String path) {
<DeepExtract>
Element el = settingsFile.getRootElement().getChild(SETTING_EXTERNALEDITOR);
if (null == el) {
el = new Element(SETTING_EXTERNALEDITOR);
settingsFile.getRootElement().addContent(el);
}
if (path != null && !path.isEmpty()) {
el.setText(path);
} else {
el.set... | Relaunch64 | positive | 435,287 |
@Override
public void onClick(View v) {
setLoadingCaptcha(true);
(new ReloadCaptcha()).execute(mNewPost);
mNewPost.setCaptcha("");
mCaptcha.setText("");
} | @Override
public void onClick(View v) {
<DeepExtract>
setLoadingCaptcha(true);
(new ReloadCaptcha()).execute(mNewPost);
mNewPost.setCaptcha("");
mCaptcha.setText("");
</DeepExtract>
} | ChanExplorer | positive | 435,288 |
public void setXml(byte[] xml) {
if (schemaService == null)
throw new IllegalStateException("schemaService has not been injected");
String namespace = schemaService.getNamespace(xml);
this.namespace = namespace;
this.xml = xml;
} | public void setXml(byte[] xml) {
if (schemaService == null)
throw new IllegalStateException("schemaService has not been injected");
String namespace = schemaService.getNamespace(xml);
<DeepExtract>
this.namespace = namespace;
</DeepExtract>
this.xml = xml;
} | mds | positive | 435,291 |
int stratumTableIndex(String stratumId) {
if (stratumId == null) {
return defaultStratumTableIndex();
}
for (i = 0; i < (stratumIndex - 1); ++i) {
if (stratumTable[i].id.equals(stratumId)) {
return i;
}
}
if ((defaultStratumIndex == -1) && (defaultStratumId != null)) {
defaultStratumIndex = stratumTableIndex(defaultStr... | int stratumTableIndex(String stratumId) {
if (stratumId == null) {
return defaultStratumTableIndex();
}
for (i = 0; i < (stratumIndex - 1); ++i) {
if (stratumTable[i].id.equals(stratumId)) {
return i;
}
}
<DeepExtract>
if ((defaultStratumIndex == -1) && (defaultStratumId != null)) {
defaultStratumIndex = stratumTableIn... | jdk-sa-jdwp | positive | 435,292 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
lbl.setText(btn_Er.getText());
X_Z.setText(68 + "");
X_A.removeAllItems();
X_A.addItem(Integer.toString(162));
X_A.addItem(Integer.toString(164));
X_A.addItem(Integer.toString(166));
X_A.addItem(Integer.toString(167));
X_A.addItem(Integer.toString(168));
X_A... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
lbl.setText(btn_Er.getText());
X_Z.setText(68 + "");
X_A.removeAllItems();
X_A.addItem(Integer.toString(162));
X_A.addItem(Integer.toString(164));
X_A.addItem(Integer.toString(166));
X_A.addItem(Integer.toString(167));
X_A.addItem(Integer.toStr... | ERSN-OpenMC | positive | 435,295 |
public static int roundEvenToInt(double value) {
final int sign = (int) signFromBit(value);
return StrictMath.abs(value);
value = ((value + TWO_POW_52) - TWO_POW_52);
return (int) (sign * value);
} | public static int roundEvenToInt(double value) {
final int sign = (int) signFromBit(value);
<DeepExtract>
return StrictMath.abs(value);
</DeepExtract>
value = ((value + TWO_POW_52) - TWO_POW_52);
return (int) (sign * value);
} | jafama | positive | 435,296 |
@Test
public void testSerializationForConfidenceCms() throws IOException, ClassNotFoundException {
byte[] bytes = TestUtils.serialize(new CountMinSketch(0.0001, 0.99999999999, 1));
CountMinSketch serializedCms = (CountMinSketch) TestUtils.deserialize(bytes);
assertEquals(new CountMinSketch(0.0001, 0.99999999999, 1), se... | @Test
public void testSerializationForConfidenceCms() throws IOException, ClassNotFoundException {
<DeepExtract>
byte[] bytes = TestUtils.serialize(new CountMinSketch(0.0001, 0.99999999999, 1));
CountMinSketch serializedCms = (CountMinSketch) TestUtils.deserialize(bytes);
assertEquals(new CountMinSketch(0.0001, 0.99999... | stream-lib | positive | 435,299 |
private void updateTableView() {
ObservableList<T> filtered = FXCollections.observableArrayList();
filtered.addAll(list);
if (!getText().equals("") && !prompting) {
filtered.removeIf(e -> e.matchesSearchTerm(getText().toLowerCase()) <= 0);
Collections.sort(filtered, (a, b) -> Math.round(b.matchesSearchTerm(getText()) -... | private void updateTableView() {
ObservableList<T> filtered = FXCollections.observableArrayList();
filtered.addAll(list);
if (!getText().equals("") && !prompting) {
filtered.removeIf(e -> e.matchesSearchTerm(getText().toLowerCase()) <= 0);
Collections.sort(filtered, (a, b) -> Math.round(b.matchesSearchTerm(getText()) -... | Simulizer | positive | 435,302 |
@Override
public void init() throws SlimException {
verts.put(VERTS_ARRAY);
GL2D.setBackground(Color.gray);
GL11.glViewport(0, 0, 800, 600);
List<VertexAttrib> a = Arrays.asList(new VertexAttrib(0, "Position", 2), new VertexAttrib(1, "Color", 4), new VertexAttrib(2, "TexCoord", 2));
prog = ShaderProgram.load("res/shade... | @Override
public void init() throws SlimException {
verts.put(VERTS_ARRAY);
GL2D.setBackground(Color.gray);
GL11.glViewport(0, 0, 800, 600);
List<VertexAttrib> a = Arrays.asList(new VertexAttrib(0, "Position", 2), new VertexAttrib(1, "Color", 4), new VertexAttrib(2, "TexCoord", 2));
prog = ShaderProgram.load("res/shade... | slim | positive | 435,305 |
@Override
public IMessage onMessage(BlackHeartParticlesMessage message, MessageContext ctx) {
World world = Minecraft.getMinecraft().theWorld;
double x = message.x;
double y = message.y;
double z = message.z;
Minecraft.getMinecraft().effectRenderer.addEffect(new BlackHeartFX(world, x, y, z));
return null;
} | @Override
public IMessage onMessage(BlackHeartParticlesMessage message, MessageContext ctx) {
<DeepExtract>
World world = Minecraft.getMinecraft().theWorld;
double x = message.x;
double y = message.y;
double z = message.z;
Minecraft.getMinecraft().effectRenderer.addEffect(new BlackHeartFX(world, x, y, z));
</DeepExtrac... | Et-Futurum | positive | 435,306 |
public void setMeasureTextSize(int measureTextSize) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, measureTextSize, getResources().getDisplayMetrics());
if (mSweepAngle > 360)
throw new IllegalArgumentException("sweepAngle must less than 360 degree");
mSmallSliceRadius = mRadius - dpToPx(8);
mBigS... | public void setMeasureTextSize(int measureTextSize) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, measureTextSize, getResources().getDisplayMetrics());
<DeepExtract>
if (mSweepAngle > 360)
throw new IllegalArgumentException("sweepAngle must less than 360 degree");
mSmallSliceRadius = mRadius - dp... | AndroidDashboardView | positive | 435,307 |
public void onSequencerSpecificEvent(byte[] data) {
try {
buffer_.write(0xFF);
buffer_.write(0x7f);
MidiUtil.writeVarInt(buffer_, data.length);
buffer_.write(data);
notifyMessage();
} catch (IOException e) {
throw new RuntimeException(e);
}
} | public void onSequencerSpecificEvent(byte[] data) {
<DeepExtract>
try {
buffer_.write(0xFF);
buffer_.write(0x7f);
MidiUtil.writeVarInt(buffer_, data.length);
buffer_.write(data);
notifyMessage();
} catch (IOException e) {
throw new RuntimeException(e);
}
</DeepExtract>
} | music-synthesizer-for-android-old | positive | 435,309 |
@Deprecated
public List<StyleableProperty> impl_getStyleableProperties() {
return XYChart.StyleableProperties.STYLEABLES;
} | @Deprecated
public List<StyleableProperty> impl_getStyleableProperties() {
<DeepExtract>
return XYChart.StyleableProperties.STYLEABLES;
</DeepExtract>
} | VisibleTesla | positive | 435,312 |
public Criteria andDenameNotLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "dename" + " cannot be null");
}
criteria.add(new Criterion("dename not like", value));
return (Criteria) this;
} | public Criteria andDenameNotLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "dename" + " cannot be null");
}
criteria.add(new Criterion("dename not like", value));
</DeepExtract>
return (Criteria) this;
} | Hospital | positive | 435,314 |
public void logBeforeServiceCheckSignature(JoinPoint jp) {
Object[] args = jp.getArgs();
String params = "";
for (Object arg : args) {
if (null != arg) {
params += arg.toString() + ", ";
} else {
params += "null, ";
}
}
params = (params.length() >= 2) ? params.substring(0, params.length() - 2) : "";
logger.debug("Start... | public void logBeforeServiceCheckSignature(JoinPoint jp) {
<DeepExtract>
Object[] args = jp.getArgs();
String params = "";
for (Object arg : args) {
if (null != arg) {
params += arg.toString() + ", ";
} else {
params += "null, ";
}
}
params = (params.length() >= 2) ? params.substring(0, params.length() - 2) : "";
logge... | WTF | positive | 435,315 |
@Override
protected void onViewReady(Bundle savedInstanceState) {
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Help");
fragments = new ArrayList<>(6);
for (int i = 0; i < 6; i++) {
fragments.add(Hel... | @Override
protected void onViewReady(Bundle savedInstanceState) {
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Help");
<DeepExtract>
fragments = new ArrayList<>(6);
for (int i = 0; i < 6; i++) {
fra... | CodePolitan | positive | 435,316 |
private static void caretAtEndTest() throws Exception {
Pattern pattern = Pattern.compile("^x?", Pattern.MULTILINE);
Matcher matcher = pattern.matcher("\r");
matcher.find();
matcher.find();
int spacesToAdd = 30 - "Caret at end".length();
StringBuffer paddedNameBuffer = new StringBuffer("Caret at end");
for (int i = 0; ... | private static void caretAtEndTest() throws Exception {
Pattern pattern = Pattern.compile("^x?", Pattern.MULTILINE);
Matcher matcher = pattern.matcher("\r");
matcher.find();
matcher.find();
<DeepExtract>
int spacesToAdd = 30 - "Caret at end".length();
StringBuffer paddedNameBuffer = new StringBuffer("Caret at end");
fo... | com.florianingerl.util.regex | positive | 435,317 |
public static String parseTableMeta() {
try {
return RESOURCE_BUNDLE.getString("parse.table.meta");
} catch (MissingResourceException e) {
return '!' + "parse.table.meta" + '!';
}
} | public static String parseTableMeta() {
<DeepExtract>
try {
return RESOURCE_BUNDLE.getString("parse.table.meta");
} catch (MissingResourceException e) {
return '!' + "parse.table.meta" + '!';
}
</DeepExtract>
} | zest | positive | 435,319 |
public void requestThumbnail(final PhotoUpload upload, final boolean honourFilter) {
cancelRequest();
if (true) {
setImageDrawable(null);
}
if (upload.requiresProcessing(false) && honourFilter) {
requestFiltered(upload, false, null);
} else {
requestImage(upload, false, null);
}
} | public void requestThumbnail(final PhotoUpload upload, final boolean honourFilter) {
<DeepExtract>
cancelRequest();
if (true) {
setImageDrawable(null);
}
</DeepExtract>
if (upload.requiresProcessing(false) && honourFilter) {
requestFiltered(upload, false, null);
} else {
requestImage(upload, false, null);
}
} | photup | positive | 435,320 |
@Override
public void onClick(View v) {
if (mCurrentSelection.equals(SELECTION_POPULAR)) {
Toast.makeText(getActivity(), "This option is already selected", Toast.LENGTH_SHORT).show();
rvMainMovieList.smoothScrollToPosition(1);
return true;
}
tvShowAdapter.setVideoData(null);
scrollListenerPosition = 1;
mCurrentSelectio... | @Override
public void onClick(View v) {
<DeepExtract>
if (mCurrentSelection.equals(SELECTION_POPULAR)) {
Toast.makeText(getActivity(), "This option is already selected", Toast.LENGTH_SHORT).show();
rvMainMovieList.smoothScrollToPosition(1);
return true;
}
tvShowAdapter.setVideoData(null);
scrollListenerPosition = 1;
mC... | Cinematic | positive | 435,323 |
@Ignore
@Test
public void shouldParseConfiguration() {
parameters.put(HOSTNAMES, "10.5.5.27");
parameters.put(CLUSTER_NAME, "testing-cluster-name");
parameters.put(INDEX_NAME, "testing-index-name");
parameters.put(INDEX_TYPE, "testing-index-type");
parameters.put(TTL, "10");
fixture = new ElasticSearchSink();
hasContex... | @Ignore
@Test
public void shouldParseConfiguration() {
parameters.put(HOSTNAMES, "10.5.5.27");
parameters.put(CLUSTER_NAME, "testing-cluster-name");
parameters.put(INDEX_NAME, "testing-index-name");
parameters.put(INDEX_TYPE, "testing-index-type");
parameters.put(TTL, "10");
fixture = new ElasticSearchSink();
<DeepExtr... | ingestion | positive | 435,324 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.