before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Test
public void shouldPassSslSessionAndHostnameToHostnameVerifierCDI() {
ConfigurableHostnameVerifier.setAccepting(true);
assertEquals("bar", clientWithHostnameVerifier.get("1").getString("foo"));
try {
assertEquals("localhost", ConfigurableHostnameVerifier.getHostname());
assertNotNull(ConfigurableHostnameVerifier.g... | @Test
public void shouldPassSslSessionAndHostnameToHostnameVerifierCDI() {
ConfigurableHostnameVerifier.setAccepting(true);
assertEquals("bar", clientWithHostnameVerifier.get("1").getString("foo"));
<DeepExtract>
try {
assertEquals("localhost", ConfigurableHostnameVerifier.getHostname());
assertNotNull(ConfigurableHost... | microprofile-rest-client | positive | 867 |
public void showAnalyze() {
addScreen(Screens.ANALYZE, new Object[] {});
setContentView(R.layout.activity_main);
SeparatedListAdapter sadapter = new SeparatedListAdapter(this, 0);
sadapter.addSection(getString(R.string.analyze_analyze), new ArrayAdapter<>(getApplicationContext(), R.layout.listitem, new String[] { getSt... | public void showAnalyze() {
<DeepExtract>
addScreen(Screens.ANALYZE, new Object[] {});
</DeepExtract>
setContentView(R.layout.activity_main);
SeparatedListAdapter sadapter = new SeparatedListAdapter(this, 0);
sadapter.addSection(getString(R.string.analyze_analyze), new ArrayAdapter<>(getApplicationContext(), R.layout.l... | sensordatacollector | positive | 868 |
public void rebuildOjectGraphAndInject() {
Mortar.destroyRootScope(applicationScope);
long start = System.nanoTime();
ObjectGraph objectGraph = ObjectGraph.create(Modules.list(this));
objectGraph.inject(this);
applicationScope = Mortar.createRootScope(BuildConfig.DEBUG, objectGraph);
long diff = TimeUnit.NANOSECONDS.to... | public void rebuildOjectGraphAndInject() {
Mortar.destroyRootScope(applicationScope);
<DeepExtract>
long start = System.nanoTime();
ObjectGraph objectGraph = ObjectGraph.create(Modules.list(this));
objectGraph.inject(this);
applicationScope = Mortar.createRootScope(BuildConfig.DEBUG, objectGraph);
long diff = TimeUnit.... | u2020-mortar | positive | 869 |
public int executeUpdate(String sql) throws SQLException {
String methodCall = "executeUpdate(" + sql + ")";
_reportSql((DriverSpy.StatementUsageWarn ? StatementSqlWarning : "") + sql, methodCall);
long tstart = System.currentTimeMillis();
try {
int result = realStatement.executeUpdate(sql);
reportStatementSqlTiming(Sy... | public int executeUpdate(String sql) throws SQLException {
String methodCall = "executeUpdate(" + sql + ")";
<DeepExtract>
_reportSql((DriverSpy.StatementUsageWarn ? StatementSqlWarning : "") + sql, methodCall);
</DeepExtract>
long tstart = System.currentTimeMillis();
try {
int result = realStatement.executeUpdate(sql)... | miniprofiler-jvm | positive | 870 |
public static void main(String[] args) {
MarioGame game = new MarioGame();
System.out.println("****************************************************************");
System.out.println("Game Status: " + game.runGame(new agents.robinBaumgarten.Agent(), getLevel("./levels/original/lvl-1.txt"), 20, 0, true).getGameStatus().t... | public static void main(String[] args) {
MarioGame game = new MarioGame();
<DeepExtract>
System.out.println("****************************************************************");
System.out.println("Game Status: " + game.runGame(new agents.robinBaumgarten.Agent(), getLevel("./levels/original/lvl-1.txt"), 20, 0, true).get... | Mario-AI-Framework | positive | 871 |
public Criteria andGmtModifiedGreaterThan(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "gmtModified" + " cannot be null");
}
criteria.add(new Criterion("gmt_modified >", value));
return (Criteria) this;
} | public Criteria andGmtModifiedGreaterThan(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "gmtModified" + " cannot be null");
}
criteria.add(new Criterion("gmt_modified >", value));
</DeepExtract>
return (Criteria) this;
} | community | positive | 872 |
@UiThread
private void transitionForward(State oldState, final State newState) {
mPreviousStateView.setVisibility(View.VISIBLE);
mCurrentStateView.setVisibility(View.VISIBLE);
switch(oldState) {
case SEARCHING:
mPreviousStateView.setBackgroundResource(R.color.state_searching);
mPreviousStateView.setText(R.string.status... | @UiThread
private void transitionForward(State oldState, final State newState) {
mPreviousStateView.setVisibility(View.VISIBLE);
mCurrentStateView.setVisibility(View.VISIBLE);
switch(oldState) {
case SEARCHING:
mPreviousStateView.setBackgroundResource(R.color.state_searching);
mPreviousStateView.setText(R.string.status... | connectivity-samples | positive | 873 |
@Override
public void onDraw(Canvas canvas) {
frame = CameraManager.get().getFramingRect();
if (frame == null) {
return;
}
int width = canvas.getWidth();
int height = canvas.getHeight();
if (mSlideTop == -1) {
mSlideTop = frame.top;
}
paint.reset();
paint.setAntiAlias(true);
paint.setColor(getResources().getColor(R.col... | @Override
public void onDraw(Canvas canvas) {
frame = CameraManager.get().getFramingRect();
if (frame == null) {
return;
}
int width = canvas.getWidth();
int height = canvas.getHeight();
if (mSlideTop == -1) {
mSlideTop = frame.top;
}
paint.reset();
paint.setAntiAlias(true);
paint.setColor(getResources().getColor(R.col... | AndroidDemo | positive | 874 |
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(getString(R.string.heading_edit_exercise));
final EditExerciseView editView = (EditExerciseView) getActivity().getLayoutInflater().inflate(R.layout.dialog_edit_exerc... | @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(getString(R.string.heading_edit_exercise));
final EditExerciseView editView = (EditExerciseView) getActivity().getLayoutInflater().inflate(R.layout.dialog_edit_exerc... | HIITMe | positive | 875 |
public static CityForecastEntity fromContentValues(ContentValues contentValues) {
CityForecastEntity cityForecastEntity = new CityForecastEntity();
if (contentValues == null) {
return cityForecastEntity;
}
city_name = contentValues.getAsString(COLUMN_NAME);
this.adcode = contentValues.getAsString(COLUMN_CODE);
this.dat... | public static CityForecastEntity fromContentValues(ContentValues contentValues) {
CityForecastEntity cityForecastEntity = new CityForecastEntity();
if (contentValues == null) {
return cityForecastEntity;
}
city_name = contentValues.getAsString(COLUMN_NAME);
this.adcode = contentValues.getAsString(COLUMN_CODE);
this.dat... | WeatherApp | positive | 876 |
public void play(int start, PlayDirection direction) {
if (mPlaying)
return;
mTotal = mPlayable.getTotal();
if (mTotal <= 1) {
return;
}
mPlaying = true;
mPlayable.playTo(start);
final Handler handler = new Handler(Looper.myLooper());
mTimerTask = new Runnable() {
@Override
public void run() {
if (!mPaused) {
playNextF... | public void play(int start, PlayDirection direction) {
if (mPlaying)
return;
mTotal = mPlayable.getTotal();
if (mTotal <= 1) {
return;
}
mPlaying = true;
<DeepExtract>
mPlayable.playTo(start);
</DeepExtract>
final Handler handler = new Handler(Looper.myLooper());
mTimerTask = new Runnable() {
@Override
public void run(... | cube-sdk | positive | 877 |
@Override
public String component7() {
return (String) get(6);
} | @Override
public String component7() {
<DeepExtract>
return (String) get(6);
</DeepExtract>
} | wdumper | positive | 878 |
private void deleteContact() {
contentResolver.delete(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, contact.getLookupKey()), null, null);
changed = true;
if (changed)
setResult(RESULT_OK);
super.finish();
} | private void deleteContact() {
contentResolver.delete(Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, contact.getLookupKey()), null, null);
changed = true;
<DeepExtract>
if (changed)
setResult(RESULT_OK);
super.finish();
</DeepExtract>
} | BaldPhone | positive | 879 |
public static void isNull(Object object, CodeMessage errorEnum, Object... params) {
if (!object == null) {
throw newException(errorEnum, params);
}
} | public static void isNull(Object object, CodeMessage errorEnum, Object... params) {
<DeepExtract>
if (!object == null) {
throw newException(errorEnum, params);
}
</DeepExtract>
} | mayfly | positive | 880 |
public static boolean verify(String rspContent, String signature, String alipayPublicKey) throws Exception {
PublicKey publicKey = getPublicKeyFromBase64String(alipayPublicKey);
Signature publicSignature = Signature.getInstance(SHA256WITHRSA);
publicSignature.initVerify(publicKey);
publicSignature.update(rspContent.get... | public static boolean verify(String rspContent, String signature, String alipayPublicKey) throws Exception {
<DeepExtract>
PublicKey publicKey = getPublicKeyFromBase64String(alipayPublicKey);
Signature publicSignature = Signature.getInstance(SHA256WITHRSA);
publicSignature.initVerify(publicKey);
publicSignature.update(... | global-open-sdk-java | positive | 881 |
public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-" + APPLICATION_NAME + "-alert", "A " + entityName + " is updated with identifier " + param);
headers.add("X-" + APPLICATION_NAME + "-params", param);
return headers;
} | public static HttpHeaders createEntityUpdateAlert(String entityName, String param) {
<DeepExtract>
HttpHeaders headers = new HttpHeaders();
headers.add("X-" + APPLICATION_NAME + "-alert", "A " + entityName + " is updated with identifier " + param);
headers.add("X-" + APPLICATION_NAME + "-params", param);
return headers... | JMPisces | positive | 882 |
@Override
public Stormtrooper updateStormtrooper(String id, Stormtrooper stormtrooper) {
if (stormtrooper.getId() == null || stormtrooper.getId().trim().isEmpty()) {
stormtrooper.setId(generateRandomId());
}
trooperMap.put(stormtrooper.getId(), stormtrooper);
return stormtrooper;
} | @Override
public Stormtrooper updateStormtrooper(String id, Stormtrooper stormtrooper) {
<DeepExtract>
if (stormtrooper.getId() == null || stormtrooper.getId().trim().isEmpty()) {
stormtrooper.setId(generateRandomId());
}
trooperMap.put(stormtrooper.getId(), stormtrooper);
return stormtrooper;
</DeepExtract>
} | okta-auth-java | positive | 883 |
public void attachSound() {
if (soundEffects != null)
throw new RuntimeException("Already attached.");
soundEffects = new JavaSoundSFX();
this.proxy.addListener(soundEffects);
} | public void attachSound() {
if (soundEffects != null)
throw new RuntimeException("Already attached.");
soundEffects = new JavaSoundSFX();
<DeepExtract>
this.proxy.addListener(soundEffects);
</DeepExtract>
} | jdyna | positive | 884 |
private Map<String, String> getAttributionParameters(String initiatedBy) {
ContentResolver contentResolver = adjustConfig.context.getContentResolver();
Map<String, String> parameters = new HashMap<String, String>();
Map<String, String> imeiParameters = Reflection.getImeiParameters(adjustConfig.context, logger);
if (ime... | private Map<String, String> getAttributionParameters(String initiatedBy) {
ContentResolver contentResolver = adjustConfig.context.getContentResolver();
Map<String, String> parameters = new HashMap<String, String>();
Map<String, String> imeiParameters = Reflection.getImeiParameters(adjustConfig.context, logger);
if (ime... | adobe_air_sdk | positive | 885 |
public Criteria andIntervaltimeBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "intervaltime" + " cannot be null");
}
criteria.add(new Criterion("intervalTime between", value1, value2));
return (Criteria) this;
} | public Criteria andIntervaltimeBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "intervaltime" + " cannot be null");
}
criteria.add(new Criterion("intervalTime between", value1, value2));
</DeepExtract>
return (Criteria) t... | emotional_analysis | positive | 886 |
public Criteria andUsernameNotEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "username" + " cannot be null");
}
criteria.add(new Criterion("username <>", value));
return (Criteria) this;
} | public Criteria andUsernameNotEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "username" + " cannot be null");
}
criteria.add(new Criterion("username <>", value));
</DeepExtract>
return (Criteria) this;
} | BookLibrarySystem | positive | 887 |
@Override
public int read() throws IOException {
if (end) {
return -1;
}
if (inBufPos < 16) {
return;
}
if (end) {
return;
}
int read = BlockInputStream.fullyRead(this.in, cipherBuf, 0, 16);
if (read == -1) {
this.end = true;
} else if (read != 16) {
throw new IOException("Couldn't read 16 bytes of data " + read);
} el... | @Override
public int read() throws IOException {
if (end) {
return -1;
}
<DeepExtract>
if (inBufPos < 16) {
return;
}
if (end) {
return;
}
int read = BlockInputStream.fullyRead(this.in, cipherBuf, 0, 16);
if (read == -1) {
this.end = true;
} else if (read != 16) {
throw new IOException("Couldn't read 16 bytes of data "... | jrpip | positive | 888 |
@Override
public void putCached(final int[] ngram, final int startPos, final int endPos, final float f, final int hash) {
final int[] arrayHere = !threadSafe ? threadUnsafeArray : threadSafeArray.get();
return arrayHere[startOfStruct(hash) + VAL_OFFSET] = Float.floatToIntBits(f);
return arrayHere[startOfStruct(hash) + ... | @Override
public void putCached(final int[] ngram, final int startPos, final int endPos, final float f, final int hash) {
final int[] arrayHere = !threadSafe ? threadUnsafeArray : threadSafeArray.get();
return arrayHere[startOfStruct(hash) + VAL_OFFSET] = Float.floatToIntBits(f);
<DeepExtract>
return arrayHere[startOfS... | maul | positive | 890 |
public void put(Object routeKey, DataSource dataSource, boolean isDefault) {
wrapperDataSources.put(routeKey, dataSource);
if (isDefault ? dataSource : null != null) {
this.setDefaultTargetDataSource(isDefault ? dataSource : null);
}
this.setTargetDataSources(wrapperDataSources);
this.afterPropertiesSet();
} | public void put(Object routeKey, DataSource dataSource, boolean isDefault) {
wrapperDataSources.put(routeKey, dataSource);
<DeepExtract>
if (isDefault ? dataSource : null != null) {
this.setDefaultTargetDataSource(isDefault ? dataSource : null);
}
this.setTargetDataSources(wrapperDataSources);
this.afterPropertiesSet()... | Milkomeda | positive | 891 |
public String getSelection() {
return "SelectionBuilder[table=" + mTable + ", selection=" + getSelection() + ", selectionArgs=" + Arrays.toString(getSelectionArgs()) + "]";
} | public String getSelection() {
<DeepExtract>
return "SelectionBuilder[table=" + mTable + ", selection=" + getSelection() + ", selectionArgs=" + Arrays.toString(getSelectionArgs()) + "]";
</DeepExtract>
} | ElectricSleep | positive | 892 |
private ResponseMessage loadResponse() throws IOException {
int len;
if (false) {
len = 0;
} else {
byte tmp = (byte) inStream.read();
if (tmp >= 0) {
len = tmp;
} else {
int result = tmp & 127;
if (false) {
len = 0;
} else {
if ((tmp = (byte) inStream.read()) >= 0) {
result |= tmp << 7;
} else {
result |= (tmp & 127) ... | private ResponseMessage loadResponse() throws IOException {
<DeepExtract>
int len;
if (false) {
len = 0;
} else {
byte tmp = (byte) inStream.read();
if (tmp >= 0) {
len = tmp;
} else {
int result = tmp & 127;
if (false) {
len = 0;
} else {
if ((tmp = (byte) inStream.read()) >= 0) {
result |= tmp << 7;
} else {
result |... | timecrypt | positive | 893 |
public ProcessingMessage setLogLevel(final LogLevel level) {
BUNDLE.checkNotNull(level, "processing.nullLevel");
this.level = level;
if ("level" == null)
return this;
if (level == null)
return putNull("level");
map.put("level", level.deepCopy());
return this;
} | public ProcessingMessage setLogLevel(final LogLevel level) {
BUNDLE.checkNotNull(level, "processing.nullLevel");
this.level = level;
<DeepExtract>
if ("level" == null)
return this;
if (level == null)
return putNull("level");
map.put("level", level.deepCopy());
return this;
</DeepExtract>
} | json-schema-core | positive | 894 |
public FacetResult runDrillDown() throws IOException {
IndexWriterConfig iwc = new IndexWriterConfig(new WhitespaceAnalyzer()).setOpenMode(OpenMode.CREATE);
IndexWriter indexWriter = new IndexWriter(indexDir, iwc);
DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
Document doc = new Document();... | public FacetResult runDrillDown() throws IOException {
IndexWriterConfig iwc = new IndexWriterConfig(new WhitespaceAnalyzer()).setOpenMode(OpenMode.CREATE);
IndexWriter indexWriter = new IndexWriter(indexDir, iwc);
DirectoryTaxonomyWriter taxoWriter = new DirectoryTaxonomyWriter(taxoDir);
Document doc = new Document();... | kooder | positive | 895 |
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "type" + " cannot be null");
}
criteria.add(new Criterion("TYPE >=", value));
return (Criteria) this;
} | public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "type" + " cannot be null");
}
criteria.add(new Criterion("TYPE >=", value));
</DeepExtract>
return (Criteria) this;
} | communitycode | positive | 896 |
private void setDaysOfWeekTitles() {
settingsManager.setShowDaysOfWeekTitle(settingsManager.getCalendarOrientation() != LinearLayoutManager.HORIZONTAL);
if (settingsManager.getCalendarOrientation() != LinearLayoutManager.HORIZONTAL) {
showDaysOfWeekTitle();
} else {
hideDaysOfWeekTitle();
}
settingsManager.setShowDaysO... | private void setDaysOfWeekTitles() {
settingsManager.setShowDaysOfWeekTitle(settingsManager.getCalendarOrientation() != LinearLayoutManager.HORIZONTAL);
if (settingsManager.getCalendarOrientation() != LinearLayoutManager.HORIZONTAL) {
showDaysOfWeekTitle();
} else {
hideDaysOfWeekTitle();
}
<DeepExtract>
settingsManage... | CosmoCalendar | positive | 897 |
@Test
public void test() throws Exception {
ReadExcel readExcel = new ReadExcel();
File file = ResourceUtils.getFile("D:/javatest/test2.xls");
List listProduct = readExcel.readExcel(file);
Class.forName("com.mysql.jdbc.Driver");
Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://" + "192.168.100.91... | @Test
public void test() throws Exception {
ReadExcel readExcel = new ReadExcel();
File file = ResourceUtils.getFile("D:/javatest/test2.xls");
List listProduct = readExcel.readExcel(file);
<DeepExtract>
Class.forName("com.mysql.jdbc.Driver");
Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://" + "... | youhuigou123 | positive | 898 |
public void setLedState(final boolean ledEnable) {
settingCommandReady = true;
byte[] canBuffer = getBytes();
byte check = computeCheck(canBuffer);
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(0xAA);
out.write(0xAA);
try {
out.write(escape(canBuffer));
} catch (IOException e) {
e.printStackTrace()... | public void setLedState(final boolean ledEnable) {
settingCommandReady = true;
<DeepExtract>
byte[] canBuffer = getBytes();
byte check = computeCheck(canBuffer);
ByteArrayOutputStream out = new ByteArrayOutputStream();
out.write(0xAA);
out.write(0xAA);
try {
out.write(escape(canBuffer));
} catch (IOException e) {
e.pri... | EucWorldAndroid | positive | 900 |
@Test
public void testJsonObjectNested() throws Exception {
assetJSONEquals("{\"a\":{\"b\":{\"c\":\"d\",\"e\":[\"f\",\"g\"]}}}", writeAndCaptureJSON("'" + "{\"a\":{\"b\":{\"c\":\"d\",\"e\":[\"f\",\"g\"]}}}" + "'"));
} | @Test
public void testJsonObjectNested() throws Exception {
<DeepExtract>
assetJSONEquals("{\"a\":{\"b\":{\"c\":\"d\",\"e\":[\"f\",\"g\"]}}}", writeAndCaptureJSON("'" + "{\"a\":{\"b\":{\"c\":\"d\",\"e\":[\"f\",\"g\"]}}}" + "'"));
</DeepExtract>
} | mysql-binlog-connector-java | positive | 901 |
@Bean
public MapperScannerConfigurer mapperScannerConfigurer1() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory1");
mapperScannerConfigurer.setAnnotationClass(Mapper.class);
mapperScannerConfigurer.setBasePackage(... | @Bean
public MapperScannerConfigurer mapperScannerConfigurer1() {
<DeepExtract>
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory1");
mapperScannerConfigurer.setAnnotationClass(Mapper.class);
mapperScannerConfigurer.s... | enumdemo | positive | 902 |
public void setLeftFlippersEngaged(boolean engaged) {
activatedFlippers.clear();
boolean allFlippersPreviouslyActive = true;
int fsize = layout.getLeftFlipperElements().size();
for (int i = 0; i < fsize; i++) {
FlipperElement flipper = layout.getLeftFlipperElements().get(i);
if (!flipper.isFlipperEngaged()) {
allFlippe... | public void setLeftFlippersEngaged(boolean engaged) {
<DeepExtract>
activatedFlippers.clear();
boolean allFlippersPreviouslyActive = true;
int fsize = layout.getLeftFlipperElements().size();
for (int i = 0; i < fsize; i++) {
FlipperElement flipper = layout.getLeftFlipperElements().get(i);
if (!flipper.isFlipperEngaged(... | homescreenarcade | positive | 903 |
public View getView(int id) {
View view = views.get(id);
if (view == null) {
view = itemView.findViewById(id);
views.put(id, view);
}
return (T) view;
} | public View getView(int id) {
<DeepExtract>
View view = views.get(id);
if (view == null) {
view = itemView.findViewById(id);
views.put(id, view);
}
return (T) view;
</DeepExtract>
} | MaNaoShop | positive | 904 |
@Override
public void fromTag(BlockState state, CompoundTag tag) {
super.fromTag(state, tag);
Inventories.fromTag(tag, items);
alkahest = tag.getInt("alkahest");
progress = tag.getInt("progress");
maxProgress = tag.getInt("max_progress");
status = tag.getInt("status");
essentia = new EssentiaContainer(tag.getCompound("... | @Override
public void fromTag(BlockState state, CompoundTag tag) {
super.fromTag(state, tag);
Inventories.fromTag(tag, items);
alkahest = tag.getInt("alkahest");
progress = tag.getInt("progress");
maxProgress = tag.getInt("max_progress");
status = tag.getInt("status");
essentia = new EssentiaContainer(tag.getCompound("... | art-of-alchemy | positive | 905 |
@TargetApi(23)
@Override
public void onAttach(Context context) {
super.onAttach(context);
this.context = context;
} | @TargetApi(23)
@Override
public void onAttach(Context context) {
super.onAttach(context);
<DeepExtract>
this.context = context;
</DeepExtract>
} | AndroidCommonLibrary | positive | 906 |
@UiHandler("executeToEndButton")
void onExecuteToEndButtonClicked(ClickEvent event) {
if (eventBus != null)
eventBus.fireEvent(new ExecuteToEndEvent());
} | @UiHandler("executeToEndButton")
void onExecuteToEndButtonClicked(ClickEvent event) {
<DeepExtract>
if (eventBus != null)
eventBus.fireEvent(new ExecuteToEndEvent());
</DeepExtract>
} | nevada | positive | 907 |
public Builder clone() {
if (buildPartial() == com.conveyal.transitwand.TransitWandProtos.Upload.Route.Point.getDefaultInstance())
return this;
if (buildPartial().hasLat()) {
setLat(buildPartial().getLat());
}
if (buildPartial().hasLon()) {
setLon(buildPartial().getLon());
}
if (buildPartial().hasTimeoffset()) {
setTim... | public Builder clone() {
<DeepExtract>
if (buildPartial() == com.conveyal.transitwand.TransitWandProtos.Upload.Route.Point.getDefaultInstance())
return this;
if (buildPartial().hasLat()) {
setLat(buildPartial().getLat());
}
if (buildPartial().hasLon()) {
setLon(buildPartial().getLon());
}
if (buildPartial().hasTimeoffs... | transit-wand | positive | 908 |
public static void mergeFiles(File[] files, File destinationFile, String[] filterRegex) throws IOException {
if (filterRegex.length < files.length) {
filterRegex = ArrayUtils.concatArrays(filterRegex, new String[files.length - filterRegex.length]);
}
return createNewFile(new File(destinationFile));
int i = 0;
for (File... | public static void mergeFiles(File[] files, File destinationFile, String[] filterRegex) throws IOException {
if (filterRegex.length < files.length) {
filterRegex = ArrayUtils.concatArrays(filterRegex, new String[files.length - filterRegex.length]);
}
<DeepExtract>
return createNewFile(new File(destinationFile));
</Deep... | util | positive | 910 |
public static String buildQueryString(Map<String, ?> data, String url) {
if (data == null || data.size() == 0) {
return url;
}
StringBuilder sb = new StringBuilder();
boolean append = false;
if (url != null) {
sb.append(url);
if (url.contains(CHAR_QM)) {
append = true;
} else {
sb.append(CHAR_QM);
}
}
Iterator<? extend... | public static String buildQueryString(Map<String, ?> data, String url) {
if (data == null || data.size() == 0) {
return url;
}
StringBuilder sb = new StringBuilder();
boolean append = false;
if (url != null) {
sb.append(url);
if (url.contains(CHAR_QM)) {
append = true;
} else {
sb.append(CHAR_QM);
}
}
Iterator<? extend... | cube-sdk | positive | 911 |
public void decorateChart(Chart node, JsonObject jsonObject) {
x = jsonObject.getDouble("x");
y = jsonObject.getDouble("y");
width = jsonObject.getDouble("width");
height = jsonObject.getDouble("height");
node.setX(x == null ? 0 : x);
node.setY(y == null ? 0 : y);
if (width != null)
node.setWidth(width);
if (height != ... | public void decorateChart(Chart node, JsonObject jsonObject) {
x = jsonObject.getDouble("x");
y = jsonObject.getDouble("y");
width = jsonObject.getDouble("width");
height = jsonObject.getDouble("height");
node.setX(x == null ? 0 : x);
node.setY(y == null ? 0 : y);
if (width != null)
node.setWidth(width);
if (height != ... | xbrowser | positive | 912 |
public Criteria andMarkNotEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "mark" + " cannot be null");
}
criteria.add(new Criterion("mark <>", value));
return (Criteria) this;
} | public Criteria andMarkNotEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "mark" + " cannot be null");
}
criteria.add(new Criterion("mark <>", value));
</DeepExtract>
return (Criteria) this;
} | Student-Information-Management-System | positive | 914 |
public List<T> getByName(String name) {
Search<T, String> search = createSearch(name);
Result<T, String> result = search.run();
if (result.getReturnedRecordCount() == SEARCH_LIMIT) {
Logger.error("Search returned maximum records - dashboard will be missing items. Filters: " + name);
}
return new ArrayList<>(result.getR... | public List<T> getByName(String name) {
<DeepExtract>
Search<T, String> search = createSearch(name);
Result<T, String> result = search.run();
if (result.getReturnedRecordCount() == SEARCH_LIMIT) {
Logger.error("Search returned maximum records - dashboard will be missing items. Filters: " + name);
}
return new ArrayList... | AppleSeed | positive | 915 |
@Override
public void tick() {
world.getProfiler().startSection(Technicalities.MODID + ".tube_stack_tick");
this.stacks.values().removeIf(stack -> {
if (!stack.isValid())
return true;
stack.tick();
return false;
});
world.getProfiler().endSection();
} | @Override
public void tick() {
<DeepExtract>
world.getProfiler().startSection(Technicalities.MODID + ".tube_stack_tick");
this.stacks.values().removeIf(stack -> {
if (!stack.isValid())
return true;
stack.tick();
return false;
});
world.getProfiler().endSection();
</DeepExtract>
} | Technicalities | positive | 916 |
void storeFile(int fileId, String sourceName, String sourcePath) {
int len = fileTable == null ? 0 : fileTable.length;
if (fileIndex >= len) {
int i;
int newLen = len == 0 ? INIT_SIZE_FILE : len * 2;
FileTableRecord[] newTable = new FileTableRecord[newLen];
for (i = 0; i < len; ++i) {
newTable[i] = fileTable[i];
}
for ... | void storeFile(int fileId, String sourceName, String sourcePath) {
<DeepExtract>
int len = fileTable == null ? 0 : fileTable.length;
if (fileIndex >= len) {
int i;
int newLen = len == 0 ? INIT_SIZE_FILE : len * 2;
FileTableRecord[] newTable = new FileTableRecord[newLen];
for (i = 0; i < len; ++i) {
newTable[i] = fileTa... | jdk-sa-jdwp | positive | 917 |
@Override
public boolean mouseMoved(int screenX, int screenY) {
if (controllerHasFocus) {
Gdx.app.debug(this.getClass().getSimpleName(), "input focus -> desktop");
}
controllerHasFocus = false;
return false;
} | @Override
public boolean mouseMoved(int screenX, int screenY) {
<DeepExtract>
if (controllerHasFocus) {
Gdx.app.debug(this.getClass().getSimpleName(), "input focus -> desktop");
}
controllerHasFocus = false;
</DeepExtract>
return false;
} | SpaceProject | positive | 918 |
@Transactional(readOnly = true)
private List<BdBatch> fetchBdBatch(String group, String name, final int max, String[] status) {
SqlRowSet srs = this.jdbcTemplate.queryForRowSet(insertParametersFromList(getSql(BATCH_FETCH_BY_NAME), status), new Object[] { group, name, max });
List<BdBatch> results = new ArrayList<BdBatc... | @Transactional(readOnly = true)
private List<BdBatch> fetchBdBatch(String group, String name, final int max, String[] status) {
SqlRowSet srs = this.jdbcTemplate.queryForRowSet(insertParametersFromList(getSql(BATCH_FETCH_BY_NAME), status), new Object[] { group, name, max });
<DeepExtract>
List<BdBatch> results = new Ar... | appstatus | positive | 919 |
public Criteria andSexLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "sex" + " cannot be null");
}
criteria.add(new Criterion("sex like", value));
return (Criteria) this;
} | public Criteria andSexLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "sex" + " cannot be null");
}
criteria.add(new Criterion("sex like", value));
</DeepExtract>
return (Criteria) this;
} | springboot-weixin-alipay | positive | 920 |
private boolean isConnectedToWifiNetwork() {
NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
return isConnectedToCellNetwork() || isConnectedToWifiNetwork();
} | private boolean isConnectedToWifiNetwork() {
NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
<DeepExtract>
return isConnectedToCellNetwork() || isConnectedToWifiNetwork();
</DeepExtract>
} | yahnac | positive | 921 |
public void setTintResource(int res) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundResource(res);
}
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundResource(res);
}
} | public void setTintResource(int res) {
if (mStatusBarAvailable) {
mStatusBarTintView.setBackgroundResource(res);
}
<DeepExtract>
if (mNavBarAvailable) {
mNavBarTintView.setBackgroundResource(res);
}
</DeepExtract>
} | MissZzzReader | positive | 922 |
@Override
public void onSubscribe(Subscription subscription) {
Trader.this.subscription = subscription;
subscription.request(1);
} | @Override
public void onSubscribe(Subscription subscription) {
Trader.this.subscription = subscription;
<DeepExtract>
subscription.request(1);
</DeepExtract>
} | conga | positive | 923 |
@Override
public void initProgramHandle() {
super.initProgramHandle();
mCurveTextureHandle = GLES30.glGetUniformLocation(mProgramHandle, "curveTexture");
mMaskTextureHandle = GLES30.glGetUniformLocation(mProgramHandle, "maskTexture");
mMaskTexture1Handle = GLES30.glGetUniformLocation(mProgramHandle, "maskTexture1");
by... | @Override
public void initProgramHandle() {
super.initProgramHandle();
mCurveTextureHandle = GLES30.glGetUniformLocation(mProgramHandle, "curveTexture");
mMaskTextureHandle = GLES30.glGetUniformLocation(mProgramHandle, "maskTexture");
mMaskTexture1Handle = GLES30.glGetUniformLocation(mProgramHandle, "maskTexture1");
<D... | VideoClipEditViewTest | positive | 924 |
private void voiceTextSearch(String keyword) {
Log.i(TAG, "keyword=[" + keyword + "]");
String curCharacter;
if (null == keyword) {
curCharacter = keyword;
} else {
curCharacter = keyword.trim();
}
if (TextUtils.isEmpty(curCharacter)) {
AppInfoHelper.getInstance().t9Search(null, true);
} else {
AppInfoHelper.getInstanc... | private void voiceTextSearch(String keyword) {
<DeepExtract>
Log.i(TAG, "keyword=[" + keyword + "]");
String curCharacter;
if (null == keyword) {
curCharacter = keyword;
} else {
curCharacter = keyword.trim();
}
if (TextUtils.isEmpty(curCharacter)) {
AppInfoHelper.getInstance().t9Search(null, true);
} else {
AppInfoHel... | XDesktopHelper | positive | 925 |
public static int getInt(String key, int defValue) {
if (CACHED_PARAMS.containsKey(key)) {
return (int) CACHED_PARAMS.get(key);
}
int result = preferences.getInt(key, defValue);
if (result == null) {
return;
}
putString(key, JSON.toJSONString(result));
return result;
} | public static int getInt(String key, int defValue) {
if (CACHED_PARAMS.containsKey(key)) {
return (int) CACHED_PARAMS.get(key);
}
int result = preferences.getInt(key, defValue);
<DeepExtract>
if (result == null) {
return;
}
putString(key, JSON.toJSONString(result));
</DeepExtract>
return result;
} | jixieshou-autowatch-kuaishou | positive | 926 |
@Override
public void run() {
for (Iterator<Block> iterator = this.cachedSigns.iterator(); iterator.hasNext(); ) {
Block b = iterator.next();
if (b.getChunk().isLoaded()) {
if (b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST) {
if (!this.updateSign(b)) {
iterator.remove();
}
} else {
iterator.remove()... | @Override
public void run() {
<DeepExtract>
for (Iterator<Block> iterator = this.cachedSigns.iterator(); iterator.hasNext(); ) {
Block b = iterator.next();
if (b.getChunk().isLoaded()) {
if (b.getType() == Material.SIGN || b.getType() == Material.SIGN_POST) {
if (!this.updateSign(b)) {
iterator.remove();
}
} else {
ite... | PexelCore | positive | 927 |
private void notifyOnImagePickComplete(ImageItem imageItem) {
ArrayList<ImageItem> list = new ArrayList<>();
list.add(imageItem);
Intent intent = new Intent();
intent.putExtra(ImagePicker.INTENT_KEY_PICKER_RESULT, list);
setResult(ImagePicker.REQ_PICKER_RESULT_CODE, intent);
super.finish();
if (dialogInterface != null)... | private void notifyOnImagePickComplete(ImageItem imageItem) {
ArrayList<ImageItem> list = new ArrayList<>();
list.add(imageItem);
Intent intent = new Intent();
intent.putExtra(ImagePicker.INTENT_KEY_PICKER_RESULT, list);
setResult(ImagePicker.REQ_PICKER_RESULT_CODE, intent);
<DeepExtract>
super.finish();
if (dialogInte... | BaseDemo | positive | 928 |
public static void main(String[] args) {
try {
Display.setDisplayMode(new DisplayMode(WINDOW_DIMENSIONS[0], WINDOW_DIMENSIONS[1]));
Display.setTitle(WINDOW_TITLE);
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
cleanUp(true);
}
pbo = glGenBuffers();
glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo);
glReadBu... | public static void main(String[] args) {
try {
Display.setDisplayMode(new DisplayMode(WINDOW_DIMENSIONS[0], WINDOW_DIMENSIONS[1]));
Display.setTitle(WINDOW_TITLE);
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
cleanUp(true);
}
pbo = glGenBuffers();
glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo);
glReadBu... | YouTube-tutorials | positive | 929 |
public boolean onZkException(String path, byte[] data, CountBean count) {
if (count.getCount() > retryTime) {
return false;
} else {
return RedisZookeeperUtils.zkCreateNode(zookeeper, path, data, CreateMode.PERSISTENT, count, this);
}
} | public boolean onZkException(String path, byte[] data, CountBean count) {
<DeepExtract>
if (count.getCount() > retryTime) {
return false;
} else {
return RedisZookeeperUtils.zkCreateNode(zookeeper, path, data, CreateMode.PERSISTENT, count, this);
}
</DeepExtract>
} | redis-cluster | positive | 931 |
@Override
public boolean offer(T value) {
final Node<T> newNode = new Node<>(this, value);
_size++;
modCount++;
if (_first == null) {
assert (_last == null);
_first = _last = newNode;
} else {
assert (_last != null);
_last._next = newNode;
newNode._previous = _last;
_last = newNode;
}
assert (_first._previous == null);... | @Override
public boolean offer(T value) {
<DeepExtract>
final Node<T> newNode = new Node<>(this, value);
_size++;
modCount++;
if (_first == null) {
assert (_last == null);
_first = _last = newNode;
} else {
assert (_last != null);
_last._next = newNode;
newNode._previous = _last;
_last = newNode;
}
assert (_first._prev... | tektosyne | positive | 932 |
private void initView() {
mTimeRulerView = findViewById(R.id.ruler_id_timeRulerView);
mTimeRulerPickScaleView = findViewById(R.id.ruler_id_timeRulerPickView);
mShowTimeTv = findViewById(R.id.time_tv);
mResetBtn = findViewById(R.id.btn_reset);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().... | private void initView() {
mTimeRulerView = findViewById(R.id.ruler_id_timeRulerView);
mTimeRulerPickScaleView = findViewById(R.id.ruler_id_timeRulerPickView);
mShowTimeTv = findViewById(R.id.time_tv);
mResetBtn = findViewById(R.id.btn_reset);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().... | WidgetCase | positive | 933 |
private static void ParseCommandLineSettings(String[] args) throws Exception {
HashMap<String, String> keyValueMap = new HashMap<String, String>();
for (String arg : args) if (arg.contains("=")) {
String[] parts = arg.split("=");
if (parts.length == 2 && parts[0].length() > 0 && parts[1].length() > 0)
keyValueMap.put(p... | private static void ParseCommandLineSettings(String[] args) throws Exception {
HashMap<String, String> keyValueMap = new HashMap<String, String>();
for (String arg : args) if (arg.contains("=")) {
String[] parts = arg.split("=");
if (parts.length == 2 && parts[0].length() > 0 && parts[1].length() > 0)
keyValueMap.put(p... | ML-Flex | positive | 934 |
@Override
public void onEnable() {
GameBoxSettings.defineGameBoxData(this);
if ((NmsFactory.getNmsUtility()) == null) {
sendVersionError();
Bukkit.getPluginManager().disablePlugin(this);
return;
}
this.gameRegistry = new GameRegistry(this);
if (!prepareForReload())
return;
if (pManager != null) {
pManager.shutDown();
H... | @Override
public void onEnable() {
GameBoxSettings.defineGameBoxData(this);
if ((NmsFactory.getNmsUtility()) == null) {
sendVersionError();
Bukkit.getPluginManager().disablePlugin(this);
return;
}
this.gameRegistry = new GameRegistry(this);
if (!prepareForReload())
return;
if (pManager != null) {
pManager.shutDown();
H... | gamebox | positive | 935 |
public void preInit(FMLPreInitializationEvent event) {
registry.init();
NetworkRegistry.INSTANCE.registerGuiHandler(AuraCascade.instance, new GuiHandler());
PylonRecipeRegistry.init();
ProcessorRecipeRegistry.init();
PotionManager.init();
eventHandler = new EventHandler();
MinecraftForge.EVENT_BUS.register(eventHandler... | public void preInit(FMLPreInitializationEvent event) {
<DeepExtract>
registry.init();
NetworkRegistry.INSTANCE.registerGuiHandler(AuraCascade.instance, new GuiHandler());
PylonRecipeRegistry.init();
ProcessorRecipeRegistry.init();
PotionManager.init();
eventHandler = new EventHandler();
MinecraftForge.EVENT_BUS.registe... | Aura-Cascade | positive | 936 |
@Override
public void onClick(View view) {
mEmailView.setError(null);
mPasswordView.setError(null);
clearErrorMessage();
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
if (!TextUtils.isEmpty(password) && !isPasswordVal... | @Override
public void onClick(View view) {
<DeepExtract>
mEmailView.setError(null);
mPasswordView.setError(null);
clearErrorMessage();
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
if (!TextUtils.isEmpty(password) && ... | grapevine | positive | 937 |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragdialogactivity);
FragmentManager fm = getSupportFragmentManager();
EditNameDialogFrag editNameDialog = new EditNameDialogFrag();
editNameDialog.show(fm, "fragment_edit_name");
} | @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragdialogactivity);
<DeepExtract>
FragmentManager fm = getSupportFragmentManager();
EditNameDialogFrag editNameDialog = new EditNameDialogFrag();
editNameDialog.show(fm, "fragment_edit_name");
</Deep... | Android-Examples | positive | 938 |
public void handleClose(CloseEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Panel Closed", "Closed panel id:'" + event.getComponent().getId() + "'");
FacesContext.getCurrentInstance().addMessage(null, message);
} | public void handleClose(CloseEvent event) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Panel Closed", "Closed panel id:'" + event.getComponent().getId() + "'");
<DeepExtract>
FacesContext.getCurrentInstance().addMessage(null, message);
</DeepExtract>
} | primefaces-showcase | positive | 939 |
@Override
public StandardField getField(MSDOSHeaderKey key) {
return getField(key).getValue();
} | @Override
public StandardField getField(MSDOSHeaderKey key) {
<DeepExtract>
return getField(key).getValue();
</DeepExtract>
} | PortEx | positive | 940 |
public static void main(String[] args) throws Exception {
Small s = new Small();
Window w = s.getFrame();
w.setLocation(100, 180);
Thread.sleep(999);
ins.scale(w);
w.pack();
} | public static void main(String[] args) throws Exception {
Small s = new Small();
Window w = s.getFrame();
w.setLocation(100, 180);
Thread.sleep(999);
<DeepExtract>
ins.scale(w);
w.pack();
</DeepExtract>
} | SmallSimpleSafe | positive | 941 |
public static void main(String[] args) {
int[] arr = new int[] { 4, 5, 6, 3, 2, 1 };
int n = arr.length, i, j;
for (i = n - 1; i >= 1; i--) if (arr[i - 1] < arr[i]) {
i--;
break;
}
for (j = i; j < n - 1; j++) if (arr[j] > arr[j + 1]) {
break;
}
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
for (int l = j, k = n - ... | public static void main(String[] args) {
int[] arr = new int[] { 4, 5, 6, 3, 2, 1 };
<DeepExtract>
int n = arr.length, i, j;
for (i = n - 1; i >= 1; i--) if (arr[i - 1] < arr[i]) {
i--;
break;
}
for (j = i; j < n - 1; j++) if (arr[j] > arr[j + 1]) {
break;
}
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
for (int l... | Cracking-The-Coding-Interview-Solutions | positive | 942 |
public Builder setLottieText(String text) {
if (mCircleParams.lottieParams == null) {
mCircleParams.lottieParams = new LottieParams();
}
mCircleParams.lottieParams.text = text;
return this;
} | public Builder setLottieText(String text) {
<DeepExtract>
if (mCircleParams.lottieParams == null) {
mCircleParams.lottieParams = new LottieParams();
}
</DeepExtract>
mCircleParams.lottieParams.text = text;
return this;
} | Android-CircleDialog | positive | 943 |
public Criteria andJeNotEqualTo(BigDecimal value) {
if (value == null) {
throw new RuntimeException("Value for " + "je" + " cannot be null");
}
criteria.add(new Criterion("je <>", value));
return (Criteria) this;
} | public Criteria andJeNotEqualTo(BigDecimal value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "je" + " cannot be null");
}
criteria.add(new Criterion("je <>", value));
</DeepExtract>
return (Criteria) this;
} | einvoice | positive | 944 |
public void mouseExited(java.awt.event.MouseEvent evt) {
btn_comment_tallies.setBackground(BUTTON_BACKGROUD_COLOR__UNSELECTED_STATE);
} | public void mouseExited(java.awt.event.MouseEvent evt) {
<DeepExtract>
btn_comment_tallies.setBackground(BUTTON_BACKGROUD_COLOR__UNSELECTED_STATE);
</DeepExtract>
} | ERSN-OpenMC | positive | 945 |
@Override
public void onDateChanged() {
mAdapter.notifyDataSetChanged();
postSetSelectionFromTop(mController.getSelectedDay().year - mController.getMinYear(), mViewSize / 2 - mChildSize / 2);
} | @Override
public void onDateChanged() {
mAdapter.notifyDataSetChanged();
<DeepExtract>
postSetSelectionFromTop(mController.getSelectedDay().year - mController.getMinYear(), mViewSize / 2 - mChildSize / 2);
</DeepExtract>
} | HijriDatePicker | positive | 946 |
@FXML
private void deleteButtonAction(ActionEvent event) {
final int idx = fullMediaList.indexOf(factory.getSelectedCell().getItem());
final MediaFile item = fullMediaList.get(idx);
item.setDeleted(true);
imageView.setImage(null);
getTitleLabel().setVisible(false);
getCameraLabel().setVisible(false);
getFilenameLabel()... | @FXML
private void deleteButtonAction(ActionEvent event) {
<DeepExtract>
final int idx = fullMediaList.indexOf(factory.getSelectedCell().getItem());
final MediaFile item = fullMediaList.get(idx);
item.setDeleted(true);
imageView.setImage(null);
getTitleLabel().setVisible(false);
getCameraLabel().setVisible(false);
getF... | PhotoSlide | positive | 947 |
@Override
protected Boolean process(Object input) throws Exception {
if (!Validate.isPortValid(port)) {
throw new IllegalArgumentException("Specified port " + port + " is not a valid port.");
}
ServerSocket ss = null;
Socket s = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
ds = new DatagramSocket(... | @Override
protected Boolean process(Object input) throws Exception {
<DeepExtract>
if (!Validate.isPortValid(port)) {
throw new IllegalArgumentException("Specified port " + port + " is not a valid port.");
}
ServerSocket ss = null;
Socket s = null;
DatagramSocket ds = null;
try {
ss = new ServerSocket(port);
ds = new D... | arquillian-droidium | positive | 949 |
public JsonParser setInput(final String inpnam, final Reader inpsrc, final boolean inpcls) {
if (inpClose && inpReader != null) {
try {
inpReader.close();
} catch (final Throwable ign) {
;
}
}
objectStack.clear();
accumulator.setLength(0);
if (false) {
accumulator.trimToSize();
}
inpName = null;
inpReader = null;
inpLi... | public JsonParser setInput(final String inpnam, final Reader inpsrc, final boolean inpcls) {
<DeepExtract>
if (inpClose && inpReader != null) {
try {
inpReader.close();
} catch (final Throwable ign) {
;
}
}
objectStack.clear();
accumulator.setLength(0);
if (false) {
accumulator.trimToSize();
}
inpName = null;
inpReader... | marc4j | positive | 950 |
public void download(final String url, final String saveapkpath, final long fileSize, final OnDownloadListener listener) {
DownLoadCallBack downLoadCallBack = new DownLoadCallBack();
this.listener = listener;
this.saveapkpath = saveapkpath;
this.fileSize = fileSize;
Request request = new Request.Builder().url(url).buil... | public void download(final String url, final String saveapkpath, final long fileSize, final OnDownloadListener listener) {
DownLoadCallBack downLoadCallBack = new DownLoadCallBack();
<DeepExtract>
this.listener = listener;
this.saveapkpath = saveapkpath;
this.fileSize = fileSize;
</DeepExtract>
Request request = new Re... | AppServiceRestFul | positive | 951 |
public void sendRedirect(String location) throws IOException {
List valueList = new ArrayList();
headers.put("Location", valueList);
valueList.add(location);
wasRedirectSent = true;
} | public void sendRedirect(String location) throws IOException {
<DeepExtract>
List valueList = new ArrayList();
headers.put("Location", valueList);
valueList.add(location);
</DeepExtract>
wasRedirectSent = true;
} | cdi-unit | positive | 953 |
protected void onReset() {
mIsBeingDragged = false;
mLayoutVisibilityChangesEnabled = true;
mHeaderLayout.reset();
mFooterLayout.reset();
smoothScrollTo(0, getPullToRefreshScrollDuration());
} | protected void onReset() {
mIsBeingDragged = false;
mLayoutVisibilityChangesEnabled = true;
mHeaderLayout.reset();
mFooterLayout.reset();
<DeepExtract>
smoothScrollTo(0, getPullToRefreshScrollDuration());
</DeepExtract>
} | GotyeSDK-Android | positive | 955 |
@Test
public void handle_withMessage0x312D_notifiesOnDistanceUpdatedUpdate() {
return new DisplayedDistanceSubscription() {
@Override
protected void onDistanceUpdated(int distance) {
internalSubscription.onDistanceUpdated(distance);
}
};
subscription.handle(new DataMemoryMessage(DISTANCE_LOW.getLocation(), 0x31, 0x2D))... | @Test
public void handle_withMessage0x312D_notifiesOnDistanceUpdatedUpdate() {
return new DisplayedDistanceSubscription() {
@Override
protected void onDistanceUpdated(int distance) {
internalSubscription.onDistanceUpdated(distance);
}
};
subscription.handle(new DataMemoryMessage(DISTANCE_LOW.getLocation(), 0x31, 0x2D))... | waterrower-core | positive | 956 |
private void obtainAttrs(AttributeSet attrs) {
TypedArray ta = mContext.obtainStyledAttributes(attrs, R.styleable.TitleView);
mLeftText = ta.getString(R.styleable.TitleView_leftText);
mRightText = ta.getString(R.styleable.TitleView_rightText);
mTitle = ta.getString(R.styleable.TitleView_title);
mLeftTextColor = ta.getC... | private void obtainAttrs(AttributeSet attrs) {
TypedArray ta = mContext.obtainStyledAttributes(attrs, R.styleable.TitleView);
mLeftText = ta.getString(R.styleable.TitleView_leftText);
mRightText = ta.getString(R.styleable.TitleView_rightText);
mTitle = ta.getString(R.styleable.TitleView_title);
mLeftTextColor = ta.getC... | CommonLibrary | positive | 957 |
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
getWritableDatabase().execSQL(SQL_DELETE_TABLE);
Logger.e(TAG, SQL_CREATE_TABLE);
db.execSQL(SQL_CREATE_TABLE);
} | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
getWritableDatabase().execSQL(SQL_DELETE_TABLE);
<DeepExtract>
Logger.e(TAG, SQL_CREATE_TABLE);
db.execSQL(SQL_CREATE_TABLE);
</DeepExtract>
} | NutritionMaster | positive | 958 |
@Override
public void actionPerformed(ActionEvent arg0) {
zoomFactor = Math.round(LatticeView.getZoomFactor() - 0.01 * 100) / 100.0;
guiConf.zoomFactor = zoomFactor;
if (LatticeView.getZoomFactor() < 0) {
LatticeView.setZoomFactor(0);
}
latticeGraphView.repaint();
} | @Override
public void actionPerformed(ActionEvent arg0) {
<DeepExtract>
zoomFactor = Math.round(LatticeView.getZoomFactor() - 0.01 * 100) / 100.0;
guiConf.zoomFactor = zoomFactor;
</DeepExtract>
if (LatticeView.getZoomFactor() < 0) {
LatticeView.setZoomFactor(0);
}
latticeGraphView.repaint();
} | conexp-ng | positive | 959 |
private AVLNode doubleRotateRL(AVLNode n) {
AVLNode left1 = n.right.left;
n.right.left = left1.right;
left1.right = n.right;
n.right.height = Math.max(height(n.right.left), height(n.right.right)) + 1;
left1.height = Math.max(height(left1.left), n.right.height) + 1;
return left1;
AVLNode right1 = n.right;
n.right = righ... | private AVLNode doubleRotateRL(AVLNode n) {
AVLNode left1 = n.right.left;
n.right.left = left1.right;
left1.right = n.right;
n.right.height = Math.max(height(n.right.left), height(n.right.right)) + 1;
left1.height = Math.max(height(left1.left), n.right.height) + 1;
return left1;
<DeepExtract>
AVLNode right1 = n.right;
... | Algorithm-and-Leetcode | positive | 960 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
Object source = evt.getSource();
if (source == groundToggle) {
Globals.tab = Tab.ground;
setCurrentTab(groundPanel);
} else if (source == heightToggle) {
Globals.tab = Tab.height;
setCurrentTab(heightPanel);
} else if (source == floorsToggle) {
Globals.tab =... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
Object source = evt.getSource();
if (source == groundToggle) {
Globals.tab = Tab.ground;
setCurrentTab(groundPanel);
} else if (source == heightToggle) {
Globals.tab = Tab.height;
setCurrentTab(heightPanel);
} else if (source == floorsToggle) {... | DeedPlanner-2 | positive | 962 |
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
if (getDrawable() == null) {
mBitmap = null;
}
if (getDrawable() instanceof BitmapDrawable) {
mBitmap = ((BitmapDrawable) getDrawable()).getBitmap();
}
try {
Bitmap bitmap;
if (getDrawable() instanceof ColorDrawable) {
bitmap = Bitmap.cr... | @Override
public void setImageResource(int resId) {
super.setImageResource(resId);
if (getDrawable() == null) {
mBitmap = null;
}
if (getDrawable() instanceof BitmapDrawable) {
mBitmap = ((BitmapDrawable) getDrawable()).getBitmap();
}
try {
Bitmap bitmap;
if (getDrawable() instanceof ColorDrawable) {
bitmap = Bitmap.cr... | nicehair | positive | 963 |
@Override
public boolean getAutoCommit() throws SQLException {
if (isClosed)
throw new SQLException("The connection is closed");
if (xaConnection == null)
throw new SQLException("The connection is invalid");
return xaConnection.getConnection().getAutoCommit();
} | @Override
public boolean getAutoCommit() throws SQLException {
<DeepExtract>
if (isClosed)
throw new SQLException("The connection is closed");
if (xaConnection == null)
throw new SQLException("The connection is invalid");
</DeepExtract>
return xaConnection.getConnection().getAutoCommit();
} | kumuluzee | positive | 965 |
public EventDecorator getDisconnectEvent(final QueryDisconnectEvent event, int[] colorPalette) {
return new EventDecorator(event.message);
} | public EventDecorator getDisconnectEvent(final QueryDisconnectEvent event, int[] colorPalette) {
<DeepExtract>
return new EventDecorator(event.message);
</DeepExtract>
} | HoloIRC | positive | 967 |
public Criteria andMoneyIsNotNull() {
if ("money is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("money is not null"));
return (Criteria) this;
} | public Criteria andMoneyIsNotNull() {
<DeepExtract>
if ("money is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("money is not null"));
</DeepExtract>
return (Criteria) this;
} | garbage-collection | positive | 968 |
void initFromCameraParameters(Camera paramCamera) {
Camera.Parameters localParameters = paramCamera.getParameters();
return this.previewFormat;
this.previewFormatString = localParameters.get("preview-format");
Log.d(TAG, "Default preview format: " + this.previewFormat + '/' + this.previewFormatString);
Display localDis... | void initFromCameraParameters(Camera paramCamera) {
Camera.Parameters localParameters = paramCamera.getParameters();
return this.previewFormat;
this.previewFormatString = localParameters.get("preview-format");
Log.d(TAG, "Default preview format: " + this.previewFormat + '/' + this.previewFormatString);
Display localDis... | deviceShow | positive | 969 |
@Test
public void shouldFindAValueTowardsTargetWithDomainAcrossZeroMarker() {
assertThatFor(integers().from(-4000).upToAndIncluding(4000)).check(i -> i <= -3900);
assertTrue("Expected to be greater than " + -3900 + ", but received " + smallestValueFound(), smallestValueFound() > -3900);
} | @Test
public void shouldFindAValueTowardsTargetWithDomainAcrossZeroMarker() {
assertThatFor(integers().from(-4000).upToAndIncluding(4000)).check(i -> i <= -3900);
<DeepExtract>
assertTrue("Expected to be greater than " + -3900 + ", but received " + smallestValueFound(), smallestValueFound() > -3900);
</DeepExtract>
} | QuickTheories | positive | 970 |
public int submit(T item) {
Objects.requireNonNull(item);
int lag = 0;
boolean complete, unowned;
ReentrantLock lock = this.lock;
lock.lock();
try {
Thread t = Thread.currentThread(), o;
BufferedSubscription<T> b = clients;
if ((unowned = ((o = owner) != t)) && o != null)
owner = null;
if (b == null)
complete = closed;... | public int submit(T item) {
<DeepExtract>
Objects.requireNonNull(item);
int lag = 0;
boolean complete, unowned;
ReentrantLock lock = this.lock;
lock.lock();
try {
Thread t = Thread.currentThread(), o;
BufferedSubscription<T> b = clients;
if ((unowned = ((o = owner) != t)) && o != null)
owner = null;
if (b == null)
comp... | java9-concurrent-backport | positive | 971 |
public void init(Context context) {
this.context = context;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
AudioAttributes attributes = new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE).setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION).build(... | public void init(Context context) {
this.context = context;
<DeepExtract>
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
AudioAttributes attributes = new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE).setContentType(AudioAttributes.CONTENT_TYPE_SONIFI... | VMChat | positive | 972 |
public void onCreateRouter(ActionEvent event) {
txtRouterPackage.setDisable(!chkCreateRouter.isSelected());
txtRouterName.setDisable(!chkCreateRouter.isSelected());
} | public void onCreateRouter(ActionEvent event) {
<DeepExtract>
txtRouterPackage.setDisable(!chkCreateRouter.isSelected());
txtRouterName.setDisable(!chkCreateRouter.isSelected());
</DeepExtract>
} | vertx-generator | positive | 973 |
public CVPipelineSettings getCurrentPipelineSettings() {
if (currentPipelineIndex < 0) {
switch(currentPipelineIndex) {
case DRIVERMODE_INDEX:
return driverModePipeline.getSettings();
case CAL_3D_INDEX:
return calibration3dPipeline.getSettings();
}
}
for (var setting : userPipelineSettings) {
if (setting.pipelineIndex ... | public CVPipelineSettings getCurrentPipelineSettings() {
<DeepExtract>
if (currentPipelineIndex < 0) {
switch(currentPipelineIndex) {
case DRIVERMODE_INDEX:
return driverModePipeline.getSettings();
case CAL_3D_INDEX:
return calibration3dPipeline.getSettings();
}
}
for (var setting : userPipelineSettings) {
if (setting.... | photonvision | positive | 974 |
public static void main(String[] args) {
Date date1 = new Date(18, 05, 1992);
Date date2 = new Date(07, 03, 2019);
int date1Days = date1.convertToDays();
int date2Days = date2.convertToDays();
int difference = Math.abs(date1Days - date2Days);
System.out.println("---------------------------------------------------------... | public static void main(String[] args) {
Date date1 = new Date(18, 05, 1992);
Date date2 = new Date(07, 03, 2019);
<DeepExtract>
int date1Days = date1.convertToDays();
int date2Days = date2.convertToDays();
int difference = Math.abs(date1Days - date2Days);
System.out.println("-------------------------------------------... | PGR-103-2020 | positive | 975 |
void importDocument(BlockContainer asciidocFile) {
Document document = asciidoctor.loadFile(file, parameters);
for (Object o : document.getBlocks()) {
if (o instanceof StructuralNode) {
StructuralNode block = (StructuralNode) o;
if (block instanceof ListItem)
continue;
try {
AsciidocBlockDescriptor blockDescriptor = sc... | void importDocument(BlockContainer asciidocFile) {
Document document = asciidoctor.loadFile(file, parameters);
<DeepExtract>
for (Object o : document.getBlocks()) {
if (o instanceof StructuralNode) {
StructuralNode block = (StructuralNode) o;
if (block instanceof ListItem)
continue;
try {
AsciidocBlockDescriptor blockD... | jqassistant-plugins | positive | 976 |
protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException {
long skipped = lineReader.skip(1);
pos += skipped;
if (skipped == 0)
return false;
int bytesRead = lineReader.readLine(key, MAX_LINE_LENGTH);
if (bytesRead <= 0)
throw new EOFException();
pos += bytesRead;
return bytesRead;
valu... | protected boolean lowLevelFastqRead(Text key, SequencedFragment value) throws IOException {
long skipped = lineReader.skip(1);
pos += skipped;
if (skipped == 0)
return false;
int bytesRead = lineReader.readLine(key, MAX_LINE_LENGTH);
if (bytesRead <= 0)
throw new EOFException();
pos += bytesRead;
return bytesRead;
valu... | Hadoop-BAM | positive | 977 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.