before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
mTop = new LinearLayout(this);
mTop.setOrientation(Lin... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
<DeepExtract>
mTop = new LinearLayout(this);
mTop.setO... | rxjava-examples | positive | 3,067 |
public static void install(Application application, TestRefWatcher refWatcher) {
stopWatchingActivities();
application.registerActivityLifecycleCallbacks(lifecycleCallbacks);
} | public static void install(Application application, TestRefWatcher refWatcher) {
<DeepExtract>
stopWatchingActivities();
application.registerActivityLifecycleCallbacks(lifecycleCallbacks);
</DeepExtract>
} | GH-Demo | positive | 3,068 |
public Criteria andStatusNotIn(List<Byte> values) {
if (values == null) {
throw new RuntimeException("Value for " + "status" + " cannot be null");
}
criteria.add(new Criterion("status not in", values));
return (Criteria) this;
} | public Criteria andStatusNotIn(List<Byte> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "status" + " cannot be null");
}
criteria.add(new Criterion("status not in", values));
</DeepExtract>
return (Criteria) this;
} | uccn | positive | 3,069 |
@Override
public CompletableFuture<RecordList<T, K>> nativeQueryListAsync(String sql, @Nullable Collection<?> parameters) throws SQLRuntimeException {
GaarasonDataSource gaarasonDataSource = getGaarasonDataSource();
boolean inTransaction = gaarasonDataSource.isLocalThreadInTransaction();
if (inTransaction) {
U value = ... | @Override
public CompletableFuture<RecordList<T, K>> nativeQueryListAsync(String sql, @Nullable Collection<?> parameters) throws SQLRuntimeException {
<DeepExtract>
GaarasonDataSource gaarasonDataSource = getGaarasonDataSource();
boolean inTransaction = gaarasonDataSource.isLocalThreadInTransaction();
if (inTransaction... | database-all | positive | 3,070 |
public final void ReadFromBytes(byte[] bytes) {
MyBuffer buff = new MyBuffer(bytes);
privateFlag = buff.get();
text = buff.getString();
} | public final void ReadFromBytes(byte[] bytes) {
MyBuffer buff = new MyBuffer(bytes);
privateFlag = buff.get();
<DeepExtract>
text = buff.getString();
</DeepExtract>
} | jt808server | positive | 3,071 |
@Override
public String getString(int columnIndex) {
super.checkPosition();
if (mWindow == null) {
throw new StaleDataException("Access closed cursor");
}
synchronized (mUpdatedRows) {
if (isFieldUpdated(columnIndex)) {
return (String) getUpdatedField(columnIndex);
}
}
return mWindow.getString(mPos, columnIndex);
} | @Override
public String getString(int columnIndex) {
<DeepExtract>
super.checkPosition();
if (mWindow == null) {
throw new StaleDataException("Access closed cursor");
}
</DeepExtract>
synchronized (mUpdatedRows) {
if (isFieldUpdated(columnIndex)) {
return (String) getUpdatedField(columnIndex);
}
}
return mWindow.getStr... | android-database-sqlcipher | positive | 3,072 |
public void save(File file) {
for (int x = 1; x < this.arraySizeX - 1; x++) {
for (int y = 1; y < this.arraySizeY - 1; y++) {
for (int z = 1; z < this.arraySizeZ - 1; z++) {
if (isAirBlockInitiate(x, y, z)) {
this.isAirBlock[x][y][z] = true;
markNeighbors(x, y, z);
} else {
this.isAirBlock[x][y][z] = false;
}
}
}
}
mar... | public void save(File file) {
<DeepExtract>
for (int x = 1; x < this.arraySizeX - 1; x++) {
for (int y = 1; y < this.arraySizeY - 1; y++) {
for (int z = 1; z < this.arraySizeZ - 1; z++) {
if (isAirBlockInitiate(x, y, z)) {
this.isAirBlock[x][y][z] = true;
markNeighbors(x, y, z);
} else {
this.isAirBlock[x][y][z] = fals... | SourceCraft-Reborn | positive | 3,073 |
private static void genTagFeatures(List<Feature> f, Token[] tokens, int i) throws IOException {
if (i - 1 > 0)
addFeature(f, tokens[i].getNE() + tokens[i - 1].getNE());
f.add(new Feature(tokens[i].getNE() + tokens[i].getToken()));
if (i - 1 > 0)
addFeature(f, tokens[i].getNE() + tokens[i - 1].getToken());
if (i + 1 < t... | private static void genTagFeatures(List<Feature> f, Token[] tokens, int i) throws IOException {
if (i - 1 > 0)
addFeature(f, tokens[i].getNE() + tokens[i - 1].getNE());
<DeepExtract>
f.add(new Feature(tokens[i].getNE() + tokens[i].getToken()));
</DeepExtract>
if (i - 1 > 0)
addFeature(f, tokens[i].getNE() + tokens[i - ... | geolocator-3.0 | positive | 3,074 |
public StringBuilder appendln(String str) {
sb = sb.append(System.lineSeparator());
return this;
return this;
} | public StringBuilder appendln(String str) {
<DeepExtract>
sb = sb.append(System.lineSeparator());
return this;
</DeepExtract>
return this;
} | startup-os | positive | 3,075 |
public void getSSDPIPv6MulticastAddress(String ip) {
this.getDeviceData().setMulticastIPv6Address(ip);
} | public void getSSDPIPv6MulticastAddress(String ip) {
<DeepExtract>
this.getDeviceData().setMulticastIPv6Address(ip);
</DeepExtract>
} | dlna_framework | positive | 3,076 |
public void saveVar(float var, String filename) {
if (text == null || !filename.equals(currentFile)) {
text = new Text();
text.write(filename, "", false);
currentFile = filename;
}
text.write(filename, String.valueOf(var), true);
} | public void saveVar(float var, String filename) {
<DeepExtract>
if (text == null || !filename.equals(currentFile)) {
text = new Text();
text.write(filename, "", false);
currentFile = filename;
}
</DeepExtract>
text.write(filename, String.valueOf(var), true);
} | promoss | positive | 3,077 |
private void extractConfigAnnotation(final VariableElement element) {
for (Class<? extends Annotation> configAnnotationClass : Configs.ALL) {
final Annotation annotation = element.getAnnotation(configAnnotationClass);
if (annotation != null) {
mConfigAnnotation = new LibraryConfigAnnotationParser(annotation);
return;
}... | private void extractConfigAnnotation(final VariableElement element) {
for (Class<? extends Annotation> configAnnotationClass : Configs.ALL) {
final Annotation annotation = element.getAnnotation(configAnnotationClass);
if (annotation != null) {
mConfigAnnotation = new LibraryConfigAnnotationParser(annotation);
return;
}... | aircon | positive | 3,078 |
@Override
protected void convertToVillager() {
EntityVillager villager = new EntityVillager(worldObj);
villager.copyLocationAndAnglesFrom(this);
setType(worldObj.rand.nextInt(6));
return super.onSpawnWithEgg((IEntityLivingData) null);
villager.setLookingForHome();
villager.setProfession(getType());
if (isChild())
villa... | @Override
protected void convertToVillager() {
EntityVillager villager = new EntityVillager(worldObj);
villager.copyLocationAndAnglesFrom(this);
<DeepExtract>
setType(worldObj.rand.nextInt(6));
return super.onSpawnWithEgg((IEntityLivingData) null);
</DeepExtract>
villager.setLookingForHome();
villager.setProfession(get... | Et-Futurum | positive | 3,079 |
public void newPwsStartScan() {
Utils.setPwsEndpoint(this, mPwCollection);
stopScan();
mScanStartTime = new Date().getTime();
startScan();
} | public void newPwsStartScan() {
Utils.setPwsEndpoint(this, mPwCollection);
<DeepExtract>
stopScan();
mScanStartTime = new Date().getTime();
startScan();
</DeepExtract>
} | physical-web | positive | 3,080 |
@Override
protected void actionPerformed(GuiButton button) throws IOException {
switch(button.id) {
case 1:
if (inventorySlots.getSlot(0).getStack() != null) {
refreshRecipe();
}
break;
case 2:
JustEnoughCalculation.proxy.getPlayerHandler().syncItemCalculator(inventorySlots.getSlot(0).getStack(), textFieldAmount.getTex... | @Override
protected void actionPerformed(GuiButton button) throws IOException {
switch(button.id) {
case 1:
if (inventorySlots.getSlot(0).getStack() != null) {
refreshRecipe();
}
break;
case 2:
JustEnoughCalculation.proxy.getPlayerHandler().syncItemCalculator(inventorySlots.getSlot(0).getStack(), textFieldAmount.getTex... | JustEnoughCalculation | positive | 3,081 |
public static int[] get_artist_mbtags_count(H5File h5, int songidx) throws Exception {
H5CompoundDS analysis = (H5CompoundDS) h5.get("musicbrainz" + "/songs");
analysis.init();
if ("idx_artist_mbtags".equals(""))
"idx_artist_mbtags" = "idx_" + "artist_mbtags_count";
int wantedMember = find(analysis.getMemberNames(), "i... | public static int[] get_artist_mbtags_count(H5File h5, int songidx) throws Exception {
<DeepExtract>
H5CompoundDS analysis = (H5CompoundDS) h5.get("musicbrainz" + "/songs");
analysis.init();
if ("idx_artist_mbtags".equals(""))
"idx_artist_mbtags" = "idx_" + "artist_mbtags_count";
int wantedMember = find(analysis.getMem... | Modulo7 | positive | 3,082 |
private void moveEventDeal(float eventX, float eventY) {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
Point point = mPoints[i][j];
float dx = Math.abs(eventX - point.x);
float dy = Math.abs(eventY - point.y);
if (Math.sqrt(dx * dx + dy * dy) < mRadius) {
point.status = Point.POINT_PRESS_STATUS;
addPressP... | private void moveEventDeal(float eventX, float eventY) {
<DeepExtract>
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
Point point = mPoints[i][j];
float dx = Math.abs(eventX - point.x);
float dy = Math.abs(eventY - point.y);
if (Math.sqrt(dx * dx + dy * dy) < mRadius) {
point.status = Point.POINT_PRESS_STA... | EnableHands | positive | 3,083 |
public static int getMaxExpBefore(int x, int j) {
if (j < 0) {
throw new UnsupportedOperationException();
}
if (j == 0) {
x = 1;
}
j--;
int xp = 2;
while (j > 0) {
j--;
xp *= 2;
}
return xp;
int exp = -1;
while (x > 0) {
exp++;
x /= 2;
}
return exp;
} | public static int getMaxExpBefore(int x, int j) {
if (j < 0) {
throw new UnsupportedOperationException();
}
if (j == 0) {
x = 1;
}
j--;
int xp = 2;
while (j > 0) {
j--;
xp *= 2;
}
return xp;
<DeepExtract>
int exp = -1;
while (x > 0) {
exp++;
x /= 2;
}
return exp;
</DeepExtract>
} | choco-graph | positive | 3,084 |
public Map<String, List<Column>> getSubColumnsFromRowsUtf8Keys(String columnFamily, KeyRange keyRange, Bytes superColName, boolean reversed, ConsistencyLevel cLevel) throws PelopsException {
return getColumnsFromRowsUtf8Keys(newColumnParent(newColumnParent(columnFamily, superColName)), keyRange, columnsPredicateAll(col... | public Map<String, List<Column>> getSubColumnsFromRowsUtf8Keys(String columnFamily, KeyRange keyRange, Bytes superColName, boolean reversed, ConsistencyLevel cLevel) throws PelopsException {
<DeepExtract>
return getColumnsFromRowsUtf8Keys(newColumnParent(newColumnParent(columnFamily, superColName)), keyRange, columnsPr... | scale7-pelops | positive | 3,085 |
public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException {
iprot.readStructBegin();
while (true) {
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch(schemeField.id) {
default:
org.apache.thri... | public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException {
<DeepExtract>
</DeepExtract>
iprot.readStructBegin();
<DeepExtract>
</DeepExtract>
while (true) {
<DeepExtract>
</DeepExtract>
schemeField = iprot.readFieldBegin();
<DeepExtract>
</DeepExtract>
if (sch... | Thrift-Connection-Pool | positive | 3,086 |
public void _set_object_ref(long ref) {
if (this.ref_ != 0) {
long ref = _get_object_ref();
_delete_object_ref(ref);
this.ref_ = 0;
}
this.ref_ = _narrow_object_ref(ref);
} | public void _set_object_ref(long ref) {
<DeepExtract>
if (this.ref_ != 0) {
long ref = _get_object_ref();
_delete_object_ref(ref);
this.ref_ = 0;
}
</DeepExtract>
this.ref_ = _narrow_object_ref(ref);
} | framework-core | positive | 3,087 |
public MappedFunction map(Object function, Object... arguments) throws ArityException, UnsupportedTypeException {
Object[] args = new Object[arguments.length + 1];
args[0] = function;
System.arraycopy(arguments, 0, args, 1, arguments.length);
if (args.length == 0) {
throw ArityException.create(1, 0);
}
Object function ... | public MappedFunction map(Object function, Object... arguments) throws ArityException, UnsupportedTypeException {
Object[] args = new Object[arguments.length + 1];
args[0] = function;
System.arraycopy(arguments, 0, args, 1, arguments.length);
<DeepExtract>
if (args.length == 0) {
throw ArityException.create(1, 0);
}
Ob... | grcuda | positive | 3,088 |
public Criteria andBalanceIsNull() {
if ("balance is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("balance is null"));
return (Criteria) this;
} | public Criteria andBalanceIsNull() {
<DeepExtract>
if ("balance is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("balance is null"));
</DeepExtract>
return (Criteria) this;
} | Online_Study_System | positive | 3,089 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields;
switch(fieldId) {
case 1:
fields = ID;
default:
fields = null;
}
if (fields == null)
throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
} | public static _Fields findByThriftIdOrThrow(int fieldId) {
<DeepExtract>
_Fields fields;
switch(fieldId) {
case 1:
fields = ID;
default:
fields = null;
}
</DeepExtract>
if (fields == null)
throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
} | imooc-Docker-Kubernetes-k8s | positive | 3,090 |
@Override
@Transactional
public String auth(Authentication auth) {
RESTAssert.assertNotNull(auth);
if ((auth.getToken() == null) || auth.getToken().isEmpty()) {
RESTAssert.assertNotEmpty(auth.getUsername());
RESTAssert.assertNotEmpty(auth.getPassword());
EUser user = this.authHandler.getUser(auth.getUsername(), auth.ge... | @Override
@Transactional
public String auth(Authentication auth) {
RESTAssert.assertNotNull(auth);
if ((auth.getToken() == null) || auth.getToken().isEmpty()) {
RESTAssert.assertNotEmpty(auth.getUsername());
RESTAssert.assertNotEmpty(auth.getPassword());
EUser user = this.authHandler.getUser(auth.getUsername(), auth.ge... | cloudconductor-server | positive | 3,091 |
private void myTouchUp(int id) {
touches[id].x = -1;
touches[id].y = -1;
if (id == touchid) {
touchid = -1;
deltax = deltay = touchx = touchy = 0;
touches_on_bk--;
}
clearDeltaXY();
return true;
if (id == touchid) {
touchid = -1;
deltax = deltay = touchx = touchy = 0;
touches_on_bk--;
}
clearDeltaXY();
return true;
if ... | private void myTouchUp(int id) {
touches[id].x = -1;
touches[id].y = -1;
<DeepExtract>
if (id == touchid) {
touchid = -1;
deltax = deltay = touchx = touchy = 0;
touches_on_bk--;
}
clearDeltaXY();
return true;
</DeepExtract>
if (id == touchid) {
touchid = -1;
deltax = deltay = touchx = touchy = 0;
touches_on_bk--;
}
cle... | midisheetmusicmemo | positive | 3,092 |
public void setStrokeWidth(float strokeWidth) {
mStrokeWidth = strokeWidth;
mArcPaint.setStrokeWidth(strokeWidth);
mRingCallback.invalidateDrawable(null);
} | public void setStrokeWidth(float strokeWidth) {
mStrokeWidth = strokeWidth;
mArcPaint.setStrokeWidth(strokeWidth);
<DeepExtract>
mRingCallback.invalidateDrawable(null);
</DeepExtract>
} | Android-rxjava-retrofit-okhttp-app | positive | 3,093 |
protected void setStepMethodFromElement(Element traceEventElement) {
String stepMethod = null;
Element element = traceEventElement.element("StepMethod");
if (element != null) {
stepMethod = element.getText();
} else {
element = traceEventElement.element("DBTSQLOperation");
if (element != null) {
stepMethod = element.ge... | protected void setStepMethodFromElement(Element traceEventElement) {
String stepMethod = null;
Element element = traceEventElement.element("StepMethod");
if (element != null) {
stepMethod = element.getText();
} else {
element = traceEventElement.element("DBTSQLOperation");
if (element != null) {
stepMethod = element.ge... | pega-tracerviewer | positive | 3,094 |
@Test
public void twoRowRS() throws SQLException {
PreparedStatement prep = conn.prepareStatement("select ? union all select ?;");
prep.setDouble(1, Double.MAX_VALUE);
prep.setDouble(2, Double.MIN_VALUE);
ResultSet rs = prep.executeQuery();
assertTrue(rs.next());
assertEquals(Double.MAX_VALUE, rs.getDouble(1));
assertT... | @Test
public void twoRowRS() throws SQLException {
PreparedStatement prep = conn.prepareStatement("select ? union all select ?;");
prep.setDouble(1, Double.MAX_VALUE);
prep.setDouble(2, Double.MIN_VALUE);
ResultSet rs = prep.executeQuery();
assertTrue(rs.next());
assertEquals(Double.MAX_VALUE, rs.getDouble(1));
assertT... | sqlitejdbc | positive | 3,095 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields;
switch(fieldId) {
case 1:
fields = ID;
case 2:
fields = NAME;
case 3:
fields = AGE;
default:
fields = null;
}
if (fields == null)
throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
} | public static _Fields findByThriftIdOrThrow(int fieldId) {
<DeepExtract>
_Fields fields;
switch(fieldId) {
case 1:
fields = ID;
case 2:
fields = NAME;
case 3:
fields = AGE;
default:
fields = null;
}
</DeepExtract>
if (fields == null)
throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fie... | dubbo-thrift | positive | 3,096 |
@OnClick(R.id.mButton2)
public void onClick2() {
Toast.makeText(this, "Click2", Toast.LENGTH_SHORT).show();
View dialogView = getLayoutInflater().inflate(R.layout.ui_dialog, null);
new MaterialDialog.Builder(this).customView(dialogView, false).show();
} | @OnClick(R.id.mButton2)
public void onClick2() {
<DeepExtract>
Toast.makeText(this, "Click2", Toast.LENGTH_SHORT).show();
</DeepExtract>
View dialogView = getLayoutInflater().inflate(R.layout.ui_dialog, null);
new MaterialDialog.Builder(this).customView(dialogView, false).show();
} | AndroidPlayground | positive | 3,097 |
public void actionPerformed(ActionEvent e) {
try {
goWithForge(new FileInputStream(new File(txtForgeJar.getText())));
} catch (FileNotFoundException e) {
displayError("File not found: " + txtForgeJar.getText());
}
} | public void actionPerformed(ActionEvent e) {
<DeepExtract>
try {
goWithForge(new FileInputStream(new File(txtForgeJar.getText())));
} catch (FileNotFoundException e) {
displayError("File not found: " + txtForgeJar.getText());
}
</DeepExtract>
} | bearded-octo-nemesis | positive | 3,098 |
private void initialPaint() {
backgroundPaint.setStyle(Paint.Style.FILL);
barPaint.setStyle(Paint.Style.FILL);
backgroundPaint.setColor(Color.argb(255, 90, 90, 90));
invalidate();
barPaint.setColor(0xFFFF4081);
invalidate();
} | private void initialPaint() {
backgroundPaint.setStyle(Paint.Style.FILL);
barPaint.setStyle(Paint.Style.FILL);
backgroundPaint.setColor(Color.argb(255, 90, 90, 90));
invalidate();
<DeepExtract>
barPaint.setColor(0xFFFF4081);
invalidate();
</DeepExtract>
} | BeatmapService | positive | 3,099 |
public K proxy(String host, int port) {
proxy = new HttpHost(host, port);
return (K) this;
} | public K proxy(String host, int port) {
proxy = new HttpHost(host, port);
<DeepExtract>
return (K) this;
</DeepExtract>
} | androidquery | positive | 3,101 |
@Override
public void updateMeasureState(final TextPaint paint) {
int oldStyle;
Typeface old = paint.getTypeface();
if (old == null) {
oldStyle = 0;
} else {
oldStyle = old.getStyle();
}
int fake = oldStyle & ~newType.getStyle();
if ((fake & Typeface.BOLD) != 0) {
paint.setFakeBoldText(true);
}
if ((fake & Typeface.ITA... | @Override
public void updateMeasureState(final TextPaint paint) {
<DeepExtract>
int oldStyle;
Typeface old = paint.getTypeface();
if (old == null) {
oldStyle = 0;
} else {
oldStyle = old.getStyle();
}
int fake = oldStyle & ~newType.getStyle();
if ((fake & Typeface.BOLD) != 0) {
paint.setFakeBoldText(true);
}
if ((fake ... | Android-utils | positive | 3,102 |
public void delete() {
SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(TABLE, null, null);
this.dbHelper.close();
} | public void delete() {
SQLiteDatabase db = dbHelper.getWritableDatabase();
db.delete(TABLE, null, null);
<DeepExtract>
this.dbHelper.close();
</DeepExtract>
} | LearningAndroidYamba | positive | 3,103 |
@Test
public void testLegalMarcInJson() throws Exception {
InputStream input = getResourceAsStream(StaticTestRecords.RESOURCES_LEGAL_JSON_MARC_IN_JSON_JSON);
MarcReader reader = new MarcJsonReader(input);
if (!reader.hasNext()) {
fail("should have at least one record");
}
Record record = reader.next();
TestUtils.valida... | @Test
public void testLegalMarcInJson() throws Exception {
<DeepExtract>
InputStream input = getResourceAsStream(StaticTestRecords.RESOURCES_LEGAL_JSON_MARC_IN_JSON_JSON);
MarcReader reader = new MarcJsonReader(input);
if (!reader.hasNext()) {
fail("should have at least one record");
}
Record record = reader.next();
Te... | marc4j | positive | 3,104 |
public void setBr(float val) {
br = val;
hue = hueModulo(hue);
sat = constrain(sat, 0, 1);
br = constrain(br, 0, 1);
alpha = constrain(alpha, 0, 1);
} | public void setBr(float val) {
br = val;
<DeepExtract>
hue = hueModulo(hue);
sat = constrain(sat, 0, 1);
br = constrain(br, 0, 1);
alpha = constrain(alpha, 0, 1);
</DeepExtract>
} | ProcessingSketches | positive | 3,105 |
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
TextView label = new TextView(Term.this);
String title = getSessionTitle(position, getString(R.string.window_title, position + 1));
label.setText(title);
if (AndroidCompat.SDK >= 13) {
label.setTextAppearance(Term.this, TextAppear... | @Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
<DeepExtract>
TextView label = new TextView(Term.this);
String title = getSessionTitle(position, getString(R.string.window_title, position + 1));
label.setText(title);
if (AndroidCompat.SDK >= 13) {
label.setTextAppearance(Term.th... | ANDROID_Terminal_Emulator | positive | 3,106 |
@Override
public Object buildItem(Cursor c) {
Integer sectionId = IndexGroupAdapter.IndexGroupUtils.getSectionId(c);
String database = IndexGroupAdapter.IndexGroupUtils.getDatabase(c);
String name = IndexGroupAdapter.IndexGroupUtils.getName(c);
String url = IndexGroupAdapter.IndexGroupUtils.getUrl(c);
String descriptio... | @Override
public Object buildItem(Cursor c) {
Integer sectionId = IndexGroupAdapter.IndexGroupUtils.getSectionId(c);
String database = IndexGroupAdapter.IndexGroupUtils.getDatabase(c);
String name = IndexGroupAdapter.IndexGroupUtils.getName(c);
String url = IndexGroupAdapter.IndexGroupUtils.getUrl(c);
String descriptio... | PathfinderOpenReference | positive | 3,107 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
this.setVisible(false);
this.dispose();
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
this.setVisible(false);
this.dispose();
</DeepExtract>
} | tmc-netbeans | positive | 3,108 |
public String src() {
return element == null ? "" : element.attr("src");
} | public String src() {
<DeepExtract>
return element == null ? "" : element.attr("src");
</DeepExtract>
} | SakuraAnime | positive | 3,109 |
@NonNull
public MapperOptions missingFields(@NonNull final MissingItemsBehaviour missingFields) {
Objects.requireNonNull(missingFields, "Missing fields behaviour is required");
MapperOptions clone;
try {
clone = (MapperOptions) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
clo... | @NonNull
public MapperOptions missingFields(@NonNull final MissingItemsBehaviour missingFields) {
Objects.requireNonNull(missingFields, "Missing fields behaviour is required");
<DeepExtract>
MapperOptions clone;
try {
clone = (MapperOptions) super.clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeExcep... | nifi-influxdb-bundle | positive | 3,110 |
public static PoseSteering[] loadPathFromFile(String fileName) {
ArrayList<PoseSteering> ret = new ArrayList<PoseSteering>();
try {
Scanner in = new Scanner(new FileReader(fileName));
String prevLine = "Gibberish";
while (in.hasNextLine()) {
String line = in.nextLine().trim();
if (!line.equals(prevLine)) {
prevLine = l... | public static PoseSteering[] loadPathFromFile(String fileName) {
ArrayList<PoseSteering> ret = new ArrayList<PoseSteering>();
try {
Scanner in = new Scanner(new FileReader(fileName));
String prevLine = "Gibberish";
while (in.hasNextLine()) {
String line = in.nextLine().trim();
if (!line.equals(prevLine)) {
prevLine = l... | coordination_oru | positive | 3,111 |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
pref_btcguildKey = prefs.getString("btcguildKey", "");
pref_widgetMiningPayoutUnit = I... | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
pref_btcguildKey = prefs.getString("btcguildKey", "");
pref_widgetMiningPayoutUnit = I... | bitcoinium | positive | 3,112 |
private void delete() {
if (Tools.isEmpty(etKeyDelete.getText().toString())) {
etKeyDelete.setError(getString(R.string.empty));
return;
}
sharedPreferences.edit().remove(etKeyDelete.getText().toString()).apply();
Tools.toast(this, etKeyDelete.getText().toString() + " remove !");
} | private void delete() {
if (Tools.isEmpty(etKeyDelete.getText().toString())) {
etKeyDelete.setError(getString(R.string.empty));
return;
}
sharedPreferences.edit().remove(etKeyDelete.getText().toString()).apply();
<DeepExtract>
Tools.toast(this, etKeyDelete.getText().toString() + " remove !");
</DeepExtract>
} | Android-development-with-example | positive | 3,113 |
public CommandState execute(CommandState state, String[] args) throws Exception {
CommandLine line = CommandLineHelper.getCommandLine(getUsage(), getOptions(), args);
if (line == null) {
return null;
}
IOHelper ioHelper = CommandLineHelper.getIOHelper(line);
if (state == null) {
state = new CommandState();
}
OWLOntolog... | public CommandState execute(CommandState state, String[] args) throws Exception {
CommandLine line = CommandLineHelper.getCommandLine(getUsage(), getOptions(), args);
if (line == null) {
return null;
}
IOHelper ioHelper = CommandLineHelper.getIOHelper(line);
if (state == null) {
state = new CommandState();
}
OWLOntolog... | robot | positive | 3,114 |
@Override
public void onBindViewHolder(@NonNull InstanceHolder holder, int position) {
cursor.moveToPosition(holder.getAdapterPosition());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onItemClick(v, holder.getAdapterPosition());
}
});
holder.title.setT... | @Override
public void onBindViewHolder(@NonNull InstanceHolder holder, int position) {
cursor.moveToPosition(holder.getAdapterPosition());
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onItemClick(v, holder.getAdapterPosition());
}
});
holder.title.setT... | skunkworks-crow | positive | 3,115 |
public void setItem(mindustry.gen.Building build, mindustry.type.Item item, int amount) {
original = Vars.net;
staticNet.setNet(net).setProvider(provider);
Vars.net = staticNet;
mindustry.gen.Call.setItem(build, item, amount);
Vars.net = original;
original = null;
} | public void setItem(mindustry.gen.Building build, mindustry.type.Item item, int amount) {
original = Vars.net;
staticNet.setNet(net).setProvider(provider);
Vars.net = staticNet;
mindustry.gen.Call.setItem(build, item, amount);
<DeepExtract>
Vars.net = original;
original = null;
</DeepExtract>
} | Mindustry-Ozone | positive | 3,116 |
public void insertOrUpdateCategory(Category categoryNew) {
if (categoryNew == null) {
return;
}
CategoryDao categoryDao = MyApplication.getDaoSession().getCategoryDao();
Category categoryOld;
if (TextUtils.isEmpty(categoryNew.getKey())) {
categoryOld = null;
}
CategoryDao categoryDao = MyApplication.getDaoSession().get... | public void insertOrUpdateCategory(Category categoryNew) {
if (categoryNew == null) {
return;
}
CategoryDao categoryDao = MyApplication.getDaoSession().getCategoryDao();
<DeepExtract>
Category categoryOld;
if (TextUtils.isEmpty(categoryNew.getKey())) {
categoryOld = null;
}
CategoryDao categoryDao = MyApplication.getDa... | AiYue | positive | 3,117 |
public Criteria andParm2EqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "parm2" + " cannot be null");
}
criteria.add(new Criterion("PARM2 =", value));
return (Criteria) this;
} | public Criteria andParm2EqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "parm2" + " cannot be null");
}
criteria.add(new Criterion("PARM2 =", value));
</DeepExtract>
return (Criteria) this;
} | console | positive | 3,118 |
@Override
public LocalDateTime component4() {
return (LocalDateTime) get(3);
} | @Override
public LocalDateTime component4() {
<DeepExtract>
return (LocalDateTime) get(3);
</DeepExtract>
} | wdumper | positive | 3,119 |
public void loadMore() {
mStartLoadingTime = System.currentTimeMillis();
mStatus = PULL_UP;
mScroller.startScroll(0, getScrollY(), 0, mFooterHoldingPosition - getScrollY(), 400);
invalidate();
if (!isLoading) {
isLoading = true;
mListener.onLoadMore();
}
if (mStatus == PULL_DOWN) {
mHeaderIndicator.onLoading();
}
if (m... | public void loadMore() {
mStartLoadingTime = System.currentTimeMillis();
mStatus = PULL_UP;
mScroller.startScroll(0, getScrollY(), 0, mFooterHoldingPosition - getScrollY(), 400);
invalidate();
if (!isLoading) {
isLoading = true;
mListener.onLoadMore();
}
<DeepExtract>
if (mStatus == PULL_DOWN) {
mHeaderIndicator.onLoad... | QuickDevLib | positive | 3,121 |
@Override
public double convert(double d, BitUnit u) {
return toBits(d) / C_KIBIT;
} | @Override
public double convert(double d, BitUnit u) {
<DeepExtract>
return toBits(d) / C_KIBIT;
</DeepExtract>
} | hive-io-experimental | positive | 3,122 |
@Override
public void run() {
ISelection selection;
ISelectionProvider selectionProvider = getSelectionProvider();
if (selectionProvider != null)
selection = selectionProvider.getSelection();
else
selection = null;
if (selection instanceof ITextSelection) {
ITextSelection sel = (ITextSelection) selection;
System.err.pr... | @Override
public void run() {
<DeepExtract>
ISelection selection;
ISelectionProvider selectionProvider = getSelectionProvider();
if (selectionProvider != null)
selection = selectionProvider.getSelection();
else
selection = null;
</DeepExtract>
if (selection instanceof ITextSelection) {
ITextSelection sel = (ITextSelect... | Twig-Eclipse-Plugin | positive | 3,123 |
public static void main(String[] args) {
InputUnusedMethod method = new InputUnusedMethod();
} | public static void main(String[] args) {
<DeepExtract>
</DeepExtract>
InputUnusedMethod method = new InputUnusedMethod();
<DeepExtract>
</DeepExtract>
} | contribution | positive | 3,124 |
private void nextQuestionActualQuiz() {
if (actualQuiz.isAdventureMode()) {
this.currQuestion = actualQuiz.getQuestion(this.idNextQuestion);
} else {
this.questionIndex++;
this.currQuestion = actualQuiz.getQuestion(ids.get(questionIndex));
}
if (currAnswers == null)
this.currAnswers = null;
Iterator<QuizAnswerDataItem>... | private void nextQuestionActualQuiz() {
if (actualQuiz.isAdventureMode()) {
this.currQuestion = actualQuiz.getQuestion(this.idNextQuestion);
} else {
this.questionIndex++;
this.currQuestion = actualQuiz.getQuestion(ids.get(questionIndex));
}
<DeepExtract>
if (currAnswers == null)
this.currAnswers = null;
Iterator<QuizA... | emobc-android | positive | 3,125 |
public static void main(String[] args) throws FileNotFoundException {
String loc = "chr1:183,269,781-183,413,660";
loc = "chr1:134,869,918-134,928,273";
loc = "chr1:120,176,951-120,213,058";
loc = "chr1:95,650,693-95,689,757";
loc = "chr1:95,685,317-95,699,849";
loc = "chr1:88,235,609-88,268,664";
loc = "chr1:80,249,08... | public static void main(String[] args) throws FileNotFoundException {
String loc = "chr1:183,269,781-183,413,660";
loc = "chr1:134,869,918-134,928,273";
loc = "chr1:120,176,951-120,213,058";
loc = "chr1:95,650,693-95,689,757";
loc = "chr1:95,685,317-95,699,849";
loc = "chr1:88,235,609-88,268,664";
loc = "chr1:80,249,08... | isoscm | positive | 3,126 |
@Override
public void connectChain(FabrikChain3D newChain, int existingChainNumber, int existingBoneNumber) {
if (existingChainNumber > this.mChains.size()) {
throw new IllegalArgumentException("Cannot connect to chain " + existingChainNumber + " - no such chain (remember that chains are zero indexed).");
}
if (existin... | @Override
public void connectChain(FabrikChain3D newChain, int existingChainNumber, int existingBoneNumber) {
if (existingChainNumber > this.mChains.size()) {
throw new IllegalArgumentException("Cannot connect to chain " + existingChainNumber + " - no such chain (remember that chains are zero indexed).");
}
if (existin... | caliko | positive | 3,127 |
public void shutdown() {
if (inactivityFuture != null) {
inactivityFuture.cancel(true);
inactivityFuture = null;
}
inactivityTimer.shutdown();
} | public void shutdown() {
<DeepExtract>
if (inactivityFuture != null) {
inactivityFuture.cancel(true);
inactivityFuture = null;
}
</DeepExtract>
inactivityTimer.shutdown();
} | instabtbu | positive | 3,128 |
public static Integer sumOfFirstNEvens(Integer count) {
return IntStream.iterate(1, i -> i + 1).filter((i -> isEven(i))).limit(count).sum();
} | public static Integer sumOfFirstNEvens(Integer count) {
<DeepExtract>
return IntStream.iterate(1, i -> i + 1).filter((i -> isEven(i))).limit(count).sum();
</DeepExtract>
} | Java-9-Cookbook | positive | 3,129 |
private ByteBuffer extract() {
final ByteBuffer[] items = this.items;
ByteBuffer item = items[takeIndex];
items[takeIndex] = null;
return (++takeIndex == items.length) ? 0 : takeIndex;
--count;
return item;
} | private ByteBuffer extract() {
final ByteBuffer[] items = this.items;
ByteBuffer item = items[takeIndex];
items[takeIndex] = null;
<DeepExtract>
return (++takeIndex == items.length) ? 0 : takeIndex;
</DeepExtract>
--count;
return item;
} | waterwave | positive | 3,130 |
@Override
public String toString() {
return String.valueOf(_value).toLowerCase();
} | @Override
public String toString() {
<DeepExtract>
return String.valueOf(_value).toLowerCase();
</DeepExtract>
} | neoj | positive | 3,131 |
@Override
public ElasticResponse scroll(String scrollId, Integer scrollTime) throws IOException {
final String path = "/_search/scroll";
final Map<String, Object> requestBody = new HashMap<>();
requestBody.put("scroll_id", scrollId);
requestBody.put("scroll", scrollTime + "s");
try (final InputStream inputStream = perf... | @Override
public ElasticResponse scroll(String scrollId, Integer scrollTime) throws IOException {
final String path = "/_search/scroll";
final Map<String, Object> requestBody = new HashMap<>();
requestBody.put("scroll_id", scrollId);
requestBody.put("scroll", scrollTime + "s");
<DeepExtract>
try (final InputStream inpu... | elasticgeo | positive | 3,132 |
@Test
public void testChangePasswordLoggedIn() {
logoutTest();
loginTest(user01, pass01);
changePassword(getPasswordEditText(pass01), getPasswordEditText(pass01 + "new"));
assertEquals(whoAmI(), user01);
logoutTest();
loginTest(user01, pass01 + "new");
changePassword(getPasswordEditText(pass01 + "new"), getPasswordEdit... | @Test
public void testChangePasswordLoggedIn() {
<DeepExtract>
logoutTest();
loginTest(user01, pass01);
changePassword(getPasswordEditText(pass01), getPasswordEditText(pass01 + "new"));
assertEquals(whoAmI(), user01);
logoutTest();
loginTest(user01, pass01 + "new");
changePassword(getPasswordEditText(pass01 + "new"), g... | ZeroKit-Android-SDK | positive | 3,133 |
@Override
ModelItem getModelItem() {
return customElement;
} | @Override
ModelItem getModelItem() {
<DeepExtract>
return customElement;
</DeepExtract>
} | dsl | positive | 3,134 |
public static String getFirstDayOfQuarter(Integer year, Integer quarter) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
Integer month = new Integer(0);
if (quarter == 1) {
month = 1 - 1;
} else if (quarter == 2) {
month = 4 - 1;
} else if (quarter == 3) {
month = 7 - 1;
} els... | public static String getFirstDayOfQuarter(Integer year, Integer quarter) {
Calendar calendar = Calendar.getInstance();
calendar.setFirstDayOfWeek(Calendar.MONDAY);
Integer month = new Integer(0);
if (quarter == 1) {
month = 1 - 1;
} else if (quarter == 2) {
month = 4 - 1;
} else if (quarter == 3) {
month = 7 - 1;
} els... | SuperBoot | positive | 3,135 |
public Criteria andItemIdGreaterThanOrEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "itemId" + " cannot be null");
}
criteria.add(new Criterion("item_id >=", value));
return (Criteria) this;
} | public Criteria andItemIdGreaterThanOrEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "itemId" + " cannot be null");
}
criteria.add(new Criterion("item_id >=", value));
</DeepExtract>
return (Criteria) this;
} | miaosha | positive | 3,136 |
public static void main(String[] args) {
System.out.println("welcome to covariant return type");
} | public static void main(String[] args) {
<DeepExtract>
System.out.println("welcome to covariant return type");
</DeepExtract>
} | PGR-103-2020 | positive | 3,137 |
public Criteria andEndIndexGreaterThan(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "endIndex" + " cannot be null");
}
criteria.add(new Criterion("endIndex >", value));
return (Criteria) this;
} | public Criteria andEndIndexGreaterThan(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "endIndex" + " cannot be null");
}
criteria.add(new Criterion("endIndex >", value));
</DeepExtract>
return (Criteria) this;
} | jtt808-simulator | positive | 3,138 |
public int size() {
return this.views.size();
} | public int size() {
<DeepExtract>
return this.views.size();
</DeepExtract>
} | droidQuery | positive | 3,139 |
public void addChunk(ClaimedChunk chunk) {
pendingChunks.add(chunk);
isDirty = true;
isDirty = true;
} | public void addChunk(ClaimedChunk chunk) {
pendingChunks.add(chunk);
<DeepExtract>
isDirty = true;
</DeepExtract>
isDirty = true;
} | FTB-Utilities | positive | 3,140 |
@NotNull
@Override
public FoldingDescriptor[] buildFoldRegions(@NotNull final ASTNode node, @NotNull final Document document) {
List<FoldingDescriptor> descriptors = new ArrayList<>();
final boolean foldCharacters = getMathematicaFoldingSettings().isCollapseNamedCharacters();
final IElementType elementType = node.getEl... | @NotNull
@Override
public FoldingDescriptor[] buildFoldRegions(@NotNull final ASTNode node, @NotNull final Document document) {
List<FoldingDescriptor> descriptors = new ArrayList<>();
<DeepExtract>
final boolean foldCharacters = getMathematicaFoldingSettings().isCollapseNamedCharacters();
final IElementType elementTyp... | Wolfram-Language-IntelliJ-Plugin-Archive | positive | 3,142 |
public static void main(String[] args) throws TException {
User user = new User();
user.setEmail("kongxuan@163.com");
user.setName("kongxuan");
byte[] data;
try {
TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
data = serializer.serialize(user);
} catch (TException e) {
throw new RuntimeExcepti... | public static void main(String[] args) throws TException {
User user = new User();
user.setEmail("kongxuan@163.com");
user.setName("kongxuan");
byte[] data;
try {
TSerializer serializer = new TSerializer(new TBinaryProtocol.Factory());
data = serializer.serialize(user);
} catch (TException e) {
throw new RuntimeExcepti... | lyb-schema-explorer | positive | 3,143 |
protected void setPool(NBTTagCompound root, StatNBT data) {
NBTTagCompound extra = TagUtil.getExtraTag(root);
NBTTagCompound tag = new NBTTagCompound();
data.write(tag);
extra.setTag(pool_key, tag);
TagUtil.setExtraTag(root, extra);
} | protected void setPool(NBTTagCompound root, StatNBT data) {
<DeepExtract>
NBTTagCompound extra = TagUtil.getExtraTag(root);
NBTTagCompound tag = new NBTTagCompound();
data.write(tag);
extra.setTag(pool_key, tag);
TagUtil.setExtraTag(root, extra);
</DeepExtract>
} | ConstructsArmory | positive | 3,144 |
synchronized public void service2() {
System.out.println("service2");
System.out.println("service3");
} | synchronized public void service2() {
System.out.println("service2");
<DeepExtract>
System.out.println("service3");
</DeepExtract>
} | java-multi-thread-programming | positive | 3,145 |
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
if (new java.sql.Date(value1.getTime()) == null || new java.sql.Date(value2.getTime()) == null... | protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
<DeepExtract>
if (new java.sql.Date(value1.getTime()) == null || new java.sql.Date(value2.getT... | health_online | positive | 3,146 |
void onActivityResumeFragments() {
isRunning = true;
if (currentState instanceof InitState && playbackService != null && audioBookManager.isInitialized() && isRunning) {
if (playbackService.getState() != PlaybackService.State.IDLE) {
Preconditions.checkState(hasAnyBooks());
changeState(StateFactory.PLAYBACK);
} else if... | void onActivityResumeFragments() {
isRunning = true;
<DeepExtract>
if (currentState instanceof InitState && playbackService != null && audioBookManager.isInitialized() && isRunning) {
if (playbackService.getState() != PlaybackService.State.IDLE) {
Preconditions.checkState(hasAnyBooks());
changeState(StateFactory.PLAYBA... | homerplayer | positive | 3,147 |
@NonNull
public static String hashSHA1Value(@NonNull InputStream inputStream) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
int length;
byte[] buffer = new byte[1024];
while ((length = inputStream.read(buffer)) != -1) {
messageDigest.update(buffer, 0, length);
}
inputStream.close();
return ge... | @NonNull
public static String hashSHA1Value(@NonNull InputStream inputStream) {
<DeepExtract>
try {
MessageDigest messageDigest = MessageDigest.getInstance("SHA1");
int length;
byte[] buffer = new byte[1024];
while ((length = inputStream.read(buffer)) != -1) {
messageDigest.update(buffer, 0, length);
}
inputStream.clos... | apkextractor | positive | 3,149 |
private void showOptionsDialog() {
OptionsDialog optionsDialog = new OptionsDialog(frame);
optionsDialog.initControlsFromSettings(rfbSettings, uiSettings, false);
this.isVisible = true;
if (true)
bar.revalidate();
presenter.saveHistory();
} | private void showOptionsDialog() {
OptionsDialog optionsDialog = new OptionsDialog(frame);
optionsDialog.initControlsFromSettings(rfbSettings, uiSettings, false);
<DeepExtract>
this.isVisible = true;
if (true)
bar.revalidate();
</DeepExtract>
presenter.saveHistory();
} | TightVNC | positive | 3,150 |
public void dispose() {
if (checkScoresLoaded()) {
try {
FileWriter file = new FileWriter(saveFileName);
logger.trace("saving scores:" + jsonObject);
file.write(jsonObject.toString());
logger.info("saved scores to file");
file.close();
} catch (IOException ex) {
logger.error("failed score save", ex);
}
}
} | public void dispose() {
<DeepExtract>
if (checkScoresLoaded()) {
try {
FileWriter file = new FileWriter(saveFileName);
logger.trace("saving scores:" + jsonObject);
file.write(jsonObject.toString());
logger.info("saved scores to file");
file.close();
} catch (IOException ex) {
logger.error("failed score save", ex);
}
}
... | cell-rpg | positive | 3,151 |
public static byte getApnType(Context mContext) {
NetInfo netInfo;
NetInfo result = new NetInfo();
NetworkInfo info = null;
ConnectivityManager connManager = null;
try {
connManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connManager != null)
info = connManager.getActiveNetw... | public static byte getApnType(Context mContext) {
<DeepExtract>
NetInfo netInfo;
NetInfo result = new NetInfo();
NetworkInfo info = null;
ConnectivityManager connManager = null;
try {
connManager = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connManager != null)
info = connManager... | readhub-android | positive | 3,152 |
@Override
public void run() {
Object element = ((StructuredSelection) scriptsViewer.getSelection()).getFirstElement();
ScriptsController controller = (ScriptsController) scriptsViewer.getLabelProvider();
String text = controller.getText(element);
ScriptDialog diag = new ScriptDialog(scriptsViewer.getTree().getShell());... | @Override
public void run() {
<DeepExtract>
Object element = ((StructuredSelection) scriptsViewer.getSelection()).getFirstElement();
ScriptsController controller = (ScriptsController) scriptsViewer.getLabelProvider();
String text = controller.getText(element);
ScriptDialog diag = new ScriptDialog(scriptsViewer.getTree(... | Composer-Eclipse-Plugin | positive | 3,153 |
public Criteria andSaltEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "salt" + " cannot be null");
}
criteria.add(new Criterion("salt =", value));
return (Criteria) this;
} | public Criteria andSaltEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "salt" + " cannot be null");
}
criteria.add(new Criterion("salt =", value));
</DeepExtract>
return (Criteria) this;
} | cloud | positive | 3,154 |
@Override
public void remove() {
if (modCount != expectedModCount) {
throw new ConcurrentModificationException();
}
if (lastReturned == null) {
throw new IllegalStateException();
}
Entry lastNext = lastReturned.next;
final E element = (E) lastReturned.key;
final Entry next = lastReturned.next;
final Entry prev = lastRe... | @Override
public void remove() {
if (modCount != expectedModCount) {
throw new ConcurrentModificationException();
}
if (lastReturned == null) {
throw new IllegalStateException();
}
Entry lastNext = lastReturned.next;
<DeepExtract>
final E element = (E) lastReturned.key;
final Entry next = lastReturned.next;
final Entry... | CoFHTweaks | positive | 3,155 |
String downloadText(String urlString) throws Exception {
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("Accept", "text/plain");
conn.setDoInput(true);
conn.connect();
int responseCode = conn.getResponseCode();
if (responseCode != HttpURLConnecti... | String downloadText(String urlString) throws Exception {
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("Accept", "text/plain");
conn.setDoInput(true);
conn.connect();
int responseCode = conn.getResponseCode();
if (responseCode != HttpURLConnecti... | Asynchronous-Android-Programming | positive | 3,156 |
void onCanceled() {
remaining--;
if (remaining != 0) {
return;
}
try {
if (closeOnCancel) {
channel.close();
}
} catch (IOException ignore) {
}
socketState = new CANCELED(dispose);
for (Task runnable : runnables) {
runnable.run();
}
if (dispose) {
dispose();
}
} | void onCanceled() {
<DeepExtract>
</DeepExtract>
remaining--;
<DeepExtract>
</DeepExtract>
if (remaining != 0) {
<DeepExtract>
</DeepExtract>
return;
<DeepExtract>
</DeepExtract>
}
<DeepExtract>
</DeepExtract>
try {
<DeepExtract>
</DeepExtract>
if (closeOnCancel) {
<DeepExtract>
</DeepExtract>
channel.close();
<DeepExt... | hawtdispatch | positive | 3,157 |
private List<FunLiveRoom> getData() {
List<FunLiveRoom> list = funLiveDB.getAllFunLiveRoom(tableName);
Collections.reverse(list);
if (list.size() == 0) {
emptyView.setVisibility(View.VISIBLE);
} else {
emptyView.setVisibility(View.GONE);
}
return list;
} | private List<FunLiveRoom> getData() {
List<FunLiveRoom> list = funLiveDB.getAllFunLiveRoom(tableName);
Collections.reverse(list);
<DeepExtract>
if (list.size() == 0) {
emptyView.setVisibility(View.VISIBLE);
} else {
emptyView.setVisibility(View.GONE);
}
</DeepExtract>
return list;
} | FunLive | positive | 3,158 |
public static FeedSource checkFeedSourcePermissions(Request req, FeedSource feedSource, Actions action) {
Auth0UserProfile userProfile = req.attribute("user");
if (feedSource == null) {
logMessageAndHalt(req, 400, "Feed source ID does not exist");
return null;
}
boolean isProjectAdmin = userProfile.canAdministerProject... | public static FeedSource checkFeedSourcePermissions(Request req, FeedSource feedSource, Actions action) {
Auth0UserProfile userProfile = req.attribute("user");
if (feedSource == null) {
logMessageAndHalt(req, 400, "Feed source ID does not exist");
return null;
}
boolean isProjectAdmin = userProfile.canAdministerProject... | datatools-server | positive | 3,159 |
public static synchronized int updateShellNote(String id, String note) {
String updateNote = "UPDATE \"shell\" SET \"note\" = ?, \"updateTime\" = ? WHERE id = ?";
String updateTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date());
PreparedStatement preparedStatement;
if (dbConn != null) {
try {
prepar... | public static synchronized int updateShellNote(String id, String note) {
String updateNote = "UPDATE \"shell\" SET \"note\" = ?, \"updateTime\" = ? WHERE id = ?";
String updateTime = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date());
<DeepExtract>
PreparedStatement preparedStatement;
if (dbConn != null) ... | GodzillaSource | positive | 3,160 |
public long getTime() {
long time = 0;
for (int i = 0; i < _NUM_UID_STATE; i++) {
if (mTimes[i] > time) {
time = mTimes[i];
}
}
return time;
} | public long getTime() {
<DeepExtract>
long time = 0;
for (int i = 0; i < _NUM_UID_STATE; i++) {
if (mTimes[i] > time) {
time = mTimes[i];
}
}
return time;
</DeepExtract>
} | AppOpsX | positive | 3,161 |
public WorldRenderer lineFromEyes(double x, double y, double z) {
this.buffer.pos(x, y, z).color(this.r, this.g, this.b, this.a).endVertex();
return this;
} | public WorldRenderer lineFromEyes(double x, double y, double z) {
<DeepExtract>
this.buffer.pos(x, y, z).color(this.r, this.g, this.b, this.a).endVertex();
return this;
</DeepExtract>
} | pepsimod | positive | 3,162 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gps);
coords = (TextView) findViewById(R.id.tvcoords);
startgps = (Button) findViewById(R.id.bstartgps);
startgps.setOnClickListener(this);
stopgps = (Button) findViewById(R.id.bstopgps);
... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_gps);
<DeepExtract>
coords = (TextView) findViewById(R.id.tvcoords);
startgps = (Button) findViewById(R.id.bstartgps);
startgps.setOnClickListener(this);
stopgps = (Button) findViewById(R.... | Android-Practice-for-Beginners | positive | 3,163 |
@Override
public void run() {
show(String.format(Utils.getContext().getResources().getString(format), args), Toast.LENGTH_LONG);
} | @Override
public void run() {
<DeepExtract>
show(String.format(Utils.getContext().getResources().getString(format), args), Toast.LENGTH_LONG);
</DeepExtract>
} | MVVMHabit | positive | 3,164 |
public static void main(String[] args) {
graph.put("A", new HashSet<String>());
graph.put("B", new HashSet<String>());
graph.put("C", new HashSet<String>());
graph.put("D", new HashSet<String>());
graph.put("E", new HashSet<String>());
graph.put("F", new HashSet<String>());
graph.get("A").add("C");
graph.get("A").add("... | public static void main(String[] args) {
graph.put("A", new HashSet<String>());
graph.put("B", new HashSet<String>());
graph.put("C", new HashSet<String>());
graph.put("D", new HashSet<String>());
graph.put("E", new HashSet<String>());
graph.put("F", new HashSet<String>());
graph.get("A").add("C");
graph.get("A").add("... | Data-Structures-and-Algorithms-master | positive | 3,165 |
@Override
public AuthenticationResponse authenticate(AuthenticationRequest request, RequestContext requestContext, AuthenticationStateHandler stateHandler) throws AuthenticationException {
try {
Map<String, Object> query = null;
Map<String, List<String>> headers = null;
if (requestContext != null) {
query = requestCont... | @Override
public AuthenticationResponse authenticate(AuthenticationRequest request, RequestContext requestContext, AuthenticationStateHandler stateHandler) throws AuthenticationException {
<DeepExtract>
try {
Map<String, Object> query = null;
Map<String, List<String>> headers = null;
if (requestContext != null) {
query... | okta-auth-java | positive | 3,166 |
public static void testJson(File inkmls, File jsons, Extractor configuration) throws IOException {
int exprCount = 0, actualTraceCount = 0, resultTraceCount = 0, matchTraceCount = 0, exact = 0;
long start = System.currentTimeMillis();
for (Iterator<Pair<TraceList, TraceList>> iterator = Files.list(inkmls.toPath()).filt... | public static void testJson(File inkmls, File jsons, Extractor configuration) throws IOException {
<DeepExtract>
int exprCount = 0, actualTraceCount = 0, resultTraceCount = 0, matchTraceCount = 0, exact = 0;
long start = System.currentTimeMillis();
for (Iterator<Pair<TraceList, TraceList>> iterator = Files.list(inkmls.... | mathocr-myscript | positive | 3,167 |
@Test
public void testCounting() {
bolt = new DonableJoinBolt(config, 5, true);
collector = new CustomCollector();
context = new CustomTopologyContext();
this.bolt = ComponentUtils.prepare(new HashMap<>(), bolt, context, collector);
Query filterQuery = makeGroupAllFieldFilterQuery("timestamp", Arrays.asList("1", "2"), ... | @Test
public void testCounting() {
bolt = new DonableJoinBolt(config, 5, true);
<DeepExtract>
collector = new CustomCollector();
context = new CustomTopologyContext();
this.bolt = ComponentUtils.prepare(new HashMap<>(), bolt, context, collector);
</DeepExtract>
Query filterQuery = makeGroupAllFieldFilterQuery("timestam... | bullet-storm | positive | 3,168 |
public static Builder newBuilder(proto.RoleProto.ListTestReq_1001003 prototype) {
if (prototype instanceof proto.RoleProto.LoginReq_1001001) {
return mergeFrom((proto.RoleProto.LoginReq_1001001) prototype);
} else {
super.mergeFrom(prototype);
return this;
}
} | public static Builder newBuilder(proto.RoleProto.ListTestReq_1001003 prototype) {
<DeepExtract>
if (prototype instanceof proto.RoleProto.LoginReq_1001001) {
return mergeFrom((proto.RoleProto.LoginReq_1001001) prototype);
} else {
super.mergeFrom(prototype);
return this;
}
</DeepExtract>
} | NettyProtobufWebsocket | positive | 3,169 |
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
moment.setController(this);
grid.add(separatorBottom.getNode(), 1, 2);
momentName.textProperty().bind(moment.nameProperty());
commentArea.setVisible(moment.isCommentVisible());
commentArea.managedProperty().bind(commentArea.visibleProperty());
c... | @Override
public void initialize(URL url, ResourceBundle resourceBundle) {
moment.setController(this);
grid.add(separatorBottom.getNode(), 1, 2);
momentName.textProperty().bind(moment.nameProperty());
commentArea.setVisible(moment.isCommentVisible());
commentArea.managedProperty().bind(commentArea.visibleProperty());
c... | uPMT | positive | 3,171 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.