before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
private void buildCatTable(SQLiteDatabase sqLiteDatabase) { Log.i("db", "creating category table"); sqLiteDatabase.execSQL("drop table if exists " + APP_CAT_MAP_TABLE); sqLiteDatabase.execSQL(APP_CAT_MAP_TABLE_CREATE); for (String createind : appcatmapcolumnsindex) { sqLiteDatabase.execSQL(buildIndexStmt(APP_CAT_MAP_TA...
private void buildCatTable(SQLiteDatabase sqLiteDatabase) { Log.i("db", "creating category table"); sqLiteDatabase.execSQL("drop table if exists " + APP_CAT_MAP_TABLE); sqLiteDatabase.execSQL(APP_CAT_MAP_TABLE_CREATE); for (String createind : appcatmapcolumnsindex) { sqLiteDatabase.execSQL(buildIndexStmt(APP_CAT_MAP_TA...
LaunchTime
positive
1,194
public Criteria andStatusIsNotNull() { if ("status is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("status is not null")); return (Criteria) this; }
public Criteria andStatusIsNotNull() { <DeepExtract> if ("status is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("status is not null")); </DeepExtract> return (Criteria) this; }
SSM_BookSystem
positive
1,195
public final Reader stdoutReaderUtf8() { return new InputStreamReader(stdoutStream(), UTF_8); }
public final Reader stdoutReaderUtf8() { <DeepExtract> return new InputStreamReader(stdoutStream(), UTF_8); </DeepExtract> }
ios-device-control
positive
1,196
@Test public void tryToTurnNextLightOnAfterAllLightsAreOn() { model.turnNextLightOn(); List<Light> lights = model.lights(); assertTrue("Light should be on", lights.get(0).isOn()); assertFalse("Light should be off", lights.get(1).isOn()); assertFalse("Light should be off", lights.get(2).isOn()); model.turnNextLightOn();...
@Test public void tryToTurnNextLightOnAfterAllLightsAreOn() { <DeepExtract> model.turnNextLightOn(); List<Light> lights = model.lights(); assertTrue("Light should be on", lights.get(0).isOn()); assertFalse("Light should be off", lights.get(1).isOn()); assertFalse("Light should be off", lights.get(2).isOn()); model.turn...
tomighty
positive
1,197
private void setCheckedArray() { int l = getEntries().length; checked = new boolean[l]; CharSequence[] values = getEntryValues(); String s = "," + getValue() + ","; int l = checked.length; for (int i = 0; i < l; i++) { checked[i] = s.contains("," + values[i] + ","); } }
private void setCheckedArray() { int l = getEntries().length; checked = new boolean[l]; <DeepExtract> CharSequence[] values = getEntryValues(); String s = "," + getValue() + ","; int l = checked.length; for (int i = 0; i < l; i++) { checked[i] = s.contains("," + values[i] + ","); } </DeepExtract> }
callmeter
positive
1,198
public void setMin(int min) { if (mMin == min) return; mMin = min; if (mMin > mMax) { setMax(mMin + 1); } int range = mMax - mMin; if ((mKeyProgressIncrement == 0) || (range / mKeyProgressIncrement > 20)) { mKeyProgressIncrement = Math.max(1, Math.round((float) range / 20)); } }
public void setMin(int min) { if (mMin == min) return; mMin = min; if (mMin > mMax) { setMax(mMin + 1); } <DeepExtract> int range = mMax - mMin; if ((mKeyProgressIncrement == 0) || (range / mKeyProgressIncrement > 20)) { mKeyProgressIncrement = Math.max(1, Math.round((float) range / 20)); } </DeepExtract> }
FaceUnityLegacy
positive
1,199
@Override public void setViewPager(ViewPager view) { if (mViewPager == view) { return; } if (mViewPager != null) { mViewPager.setOnPageChangeListener(null); } PagerAdapter adapter = view.getAdapter(); if (adapter == null) { throw new IllegalStateException("ViewPager does not have adapter instance."); } mViewPager = vie...
@Override public void setViewPager(ViewPager view) { if (mViewPager == view) { return; } if (mViewPager != null) { mViewPager.setOnPageChangeListener(null); } PagerAdapter adapter = view.getAdapter(); if (adapter == null) { throw new IllegalStateException("ViewPager does not have adapter instance."); } mViewPager = vie...
Place-Search-Service
positive
1,200
@Override @Deprecated public void setMidScale(float midScale) { checkZoomLevels(mMinScale, midScale, mMaxScale); mMidScale = midScale; }
@Override @Deprecated public void setMidScale(float midScale) { <DeepExtract> checkZoomLevels(mMinScale, midScale, mMaxScale); mMidScale = midScale; </DeepExtract> }
fresco-sample-usage
positive
1,201
public static void main(String[] args) { Class c = null; try { c = Class.forName("typeinfo.toys.FancyToy"); } catch (ClassNotFoundException e) { print("Can't find FancyToy"); System.exit(1); } print("Class name: " + c.getName() + " is interface? [" + c.isInterface() + "]"); print("Simple name: " + c.getSimpleName()); p...
public static void main(String[] args) { Class c = null; try { c = Class.forName("typeinfo.toys.FancyToy"); } catch (ClassNotFoundException e) { print("Can't find FancyToy"); System.exit(1); } print("Class name: " + c.getName() + " is interface? [" + c.isInterface() + "]"); print("Simple name: " + c.getSimpleName()); p...
bswen-project
positive
1,202
public boolean isRateLatency() { if (has_rate_latency_meta_info == true) { return; } rate_latencies = new ArrayList<Curve_Disco_Affine>(); switch(segments.length) { case 1: if (segments[0].getX().eqZero() && segments[0].getY().eqZero() && segments[0].getGrad().isFinite()) { rate_latencies.add(createRateLatency(segments...
public boolean isRateLatency() { <DeepExtract> if (has_rate_latency_meta_info == true) { return; } rate_latencies = new ArrayList<Curve_Disco_Affine>(); switch(segments.length) { case 1: if (segments[0].getX().eqZero() && segments[0].getY().eqZero() && segments[0].getGrad().isFinite()) { rate_latencies.add(createRateLa...
DNC
positive
1,203
public Connection commentsConnection(Long storyId) { if (loginSharedPreferences.isLoggedIn()) { return authorisedConnection(ITEM_BASE_URL + storyId, loginSharedPreferences.getCookie()); } else { return defaultConnection(ITEM_BASE_URL + storyId); } }
public Connection commentsConnection(Long storyId) { <DeepExtract> if (loginSharedPreferences.isLoggedIn()) { return authorisedConnection(ITEM_BASE_URL + storyId, loginSharedPreferences.getCookie()); } else { return defaultConnection(ITEM_BASE_URL + storyId); } </DeepExtract> }
yahnac
positive
1,204
@Test public void testGetEncondedByteLength_MultipleOfThreeChars() { final byte[] base64ConvertedValue = encoder.convert("A1x"); final int encondedByteLength = encoder.getEncondedByteLength("A1x".length()); assertEquals("Calculated encoded size should match the converted byte array size", base64ConvertedValue.length, e...
@Test public void testGetEncondedByteLength_MultipleOfThreeChars() { final byte[] base64ConvertedValue = encoder.convert("A1x"); final int encondedByteLength = encoder.getEncondedByteLength("A1x".length()); assertEquals("Calculated encoded size should match the converted byte array size", base64ConvertedValue.length, e...
ISO8583
positive
1,207
private void initScoreDisplay(Bundle savedBundle) { mCurrentTickNumber = 0; if (savedBundle != null) { mCurrentFinalScore = savedBundle.getFloat(BUNDLE_CURRENT_FINAL_SCORE); mCurrentExpEarned = savedBundle.getFloat(BUNDLE_CURRENT_EXP_EARNED); mCurrentExpEarned = savedBundle.getFloat(BUNDLE_CURRENT_EXP_BAR); } else { mC...
private void initScoreDisplay(Bundle savedBundle) { mCurrentTickNumber = 0; if (savedBundle != null) { mCurrentFinalScore = savedBundle.getFloat(BUNDLE_CURRENT_FINAL_SCORE); mCurrentExpEarned = savedBundle.getFloat(BUNDLE_CURRENT_EXP_EARNED); mCurrentExpEarned = savedBundle.getFloat(BUNDLE_CURRENT_EXP_BAR); } else { mC...
ChaseWhisplyProject
positive
1,208
public static void main(String[] args) throws Exception { String source = null; if (args.length > 0) { for (int i = 0; i < args.length; i++) { if (args[i].equals("-comm")) { source = args[++i]; } } } else if (args.length != 0) { usage(); System.exit(1); } TestPacketTimeSync me = new TestPacketTimeSync(source); me.moteI...
public static void main(String[] args) throws Exception { <DeepExtract> </DeepExtract> String source = null; <DeepExtract> </DeepExtract> if (args.length > 0) { <DeepExtract> </DeepExtract> for (int i = 0; i < args.length; i++) { <DeepExtract> </DeepExtract> if (args[i].equals("-comm")) { <DeepExtract> </DeepExtract> s...
tinyos-main
positive
1,209
public boolean isEgg() { if (AUnitType.Zerg_Egg == null) return false; if (this == AUnitType.Zerg_Egg) return true; if (!(AUnitType.Zerg_Egg instanceof AUnit)) return false; AUnit aUnit = (AUnit) AUnitType.Zerg_Egg; return id() == aUnit.id(); }
public boolean isEgg() { <DeepExtract> if (AUnitType.Zerg_Egg == null) return false; if (this == AUnitType.Zerg_Egg) return true; if (!(AUnitType.Zerg_Egg instanceof AUnit)) return false; AUnit aUnit = (AUnit) AUnitType.Zerg_Egg; return id() == aUnit.id(); </DeepExtract> }
Atlantis
positive
1,210
@Test public void testSetTwoWayEdgesMultipleVerticesIterable() { ComputerVertex dev6 = dev1.addAndConnectBothVertexTypedEdgeTyped(ComputerVertex.DEFAULT_INITIALIZER, NetworkConnectionEdge.DEFAULT_INITIALIZER); dev6.setName(newDevName); assertTwoWayConnection(dev1, dev6); ComputerVertex newDev = findDeviceByName(graph, ...
@Test public void testSetTwoWayEdgesMultipleVerticesIterable() { <DeepExtract> ComputerVertex dev6 = dev1.addAndConnectBothVertexTypedEdgeTyped(ComputerVertex.DEFAULT_INITIALIZER, NetworkConnectionEdge.DEFAULT_INITIALIZER); dev6.setName(newDevName); assertTwoWayConnection(dev1, dev6); </DeepExtract> ComputerVertex newD...
Ferma
positive
1,211
@Test public void testBusSendArrayObject(TestContext context) { Async consumerAsync = context.async(); Async terminatedLatch = context.async(); vertx.eventBus().consumer("the_address", msg -> { context.assertEquals(new JsonArray().add("foo").add(3), msg.body()); consumerAsync.complete(); }); Shell shell = server.create...
@Test public void testBusSendArrayObject(TestContext context) { Async consumerAsync = context.async(); <DeepExtract> Async terminatedLatch = context.async(); vertx.eventBus().consumer("the_address", msg -> { context.assertEquals(new JsonArray().add("foo").add(3), msg.body()); consumerAsync.complete(); }); Shell shell =...
vertx-shell
positive
1,212
public static Builder newBuilder() { return new Builder(); }
public static Builder newBuilder() { <DeepExtract> return new Builder(); </DeepExtract> }
Delite
positive
1,213
@Override public int compare(T t1, T t2) { int result; if (t1 != null && t2 != null) { result = 0; } else if (t1 == null && t2 == null) { result = 0; } else if (t1 != null && t2 == null) { result = 1; } else { result = -1; } return result == 0 ? realCompare(t1, t2) : result; }
@Override public int compare(T t1, T t2) { <DeepExtract> int result; if (t1 != null && t2 != null) { result = 0; } else if (t1 == null && t2 == null) { result = 0; } else if (t1 != null && t2 == null) { result = 1; } else { result = -1; } </DeepExtract> return result == 0 ? realCompare(t1, t2) : result; }
BookReader
positive
1,214
public Collection<InformationPointDTO> getInformationPoints() throws IOException { Request request = new Request.Builder().url(baseURL + "/v1/information-point").build(); Response response = client.newCall(request).execute(); if (!response.isSuccessful()) { throw new IOException("Controller returned HTTP " + response.c...
public Collection<InformationPointDTO> getInformationPoints() throws IOException { Request request = new Request.Builder().url(baseURL + "/v1/information-point").build(); Response response = client.newCall(request).execute(); if (!response.isSuccessful()) { throw new IOException("Controller returned HTTP " + response.c...
james
positive
1,215
public static void main(String[] args) throws Exception { String numbersString = new BufferedReader(new InputStreamReader(System.in)).readLine(); String[] numbers = numbersString.split(" "); int[] numArray = new int[numbers.length]; for (int x = 0; x < numbers.length; x++) { numArray[x] = Integer.parseInt(numbers[x]); ...
public static void main(String[] args) throws Exception { String numbersString = new BufferedReader(new InputStreamReader(System.in)).readLine(); String[] numbers = numbersString.split(" "); int[] numArray = new int[numbers.length]; for (int x = 0; x < numbers.length; x++) { numArray[x] = Integer.parseInt(numbers[x]); ...
Algorithms-and-Data-Structures-in-Java
positive
1,216
public boolean generate(World world, Random rand, int x, int y, int z) { if (world.getBiomeGenForCoords(x, z) != BiomeGenBase.desert && world.getBiomeGenForCoords(x, z) != BiomeGenBase.desertHills) { return false; } if (y < 50 || y > 80 || world.getBlock(x + 10, y + 15, z + 20) != Blocks.sand || world.getBlock(x + 10, ...
public boolean generate(World world, Random rand, int x, int y, int z) { if (world.getBiomeGenForCoords(x, z) != BiomeGenBase.desert && world.getBiomeGenForCoords(x, z) != BiomeGenBase.desertHills) { return false; } if (y < 50 || y > 80 || world.getBlock(x + 10, y + 15, z + 20) != Blocks.sand || world.getBlock(x + 10, ...
WuppyMods
positive
1,217
@Override public void destroyObject(PooledObject<TProtocol> pooledObject) throws Exception { TTransport transport = pooledObject.getObject().getTransport(); if (transport.isOpen()) { transport.flush(); transport.close(); } pooledObject.markAbandoned(); }
@Override public void destroyObject(PooledObject<TProtocol> pooledObject) throws Exception { <DeepExtract> TTransport transport = pooledObject.getObject().getTransport(); if (transport.isOpen()) { transport.flush(); transport.close(); } </DeepExtract> pooledObject.markAbandoned(); }
aiop-core
positive
1,218
public static String getYear(int year, String format) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.YEAR, year); if (calendar == null) { return null; } return date2Str(calendar.getTime(), format); }
public static String getYear(int year, String format) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.YEAR, year); <DeepExtract> if (calendar == null) { return null; } return date2Str(calendar.getTime(), format); </DeepExtract> }
CocoBill
positive
1,219
@Test public void createMetadataRequired() throws Exception { controller.metadataRequired = true; createDatasetModel.setXml(null); String view = controller.create(createDatasetModel, result, model); assertEquals("datasets/create", view); assertEquals(0, Dataset.countDatasets()); assertEquals(0, Metadata.countMetadatas(...
@Test public void createMetadataRequired() throws Exception { controller.metadataRequired = true; createDatasetModel.setXml(null); <DeepExtract> String view = controller.create(createDatasetModel, result, model); assertEquals("datasets/create", view); assertEquals(0, Dataset.countDatasets()); assertEquals(0, Metadata.c...
mds
positive
1,220
@Override public void onStop() { super.onStop(); SharedPreferences settings = getSharedPreferences(SettingsActivity.PREFS_NAME, MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); String text = inputWindow.getText().toString(); int cursorPosition = inputWindow.getEditText().getSelectionStart(); editor.put...
@Override public void onStop() { super.onStop(); <DeepExtract> SharedPreferences settings = getSharedPreferences(SettingsActivity.PREFS_NAME, MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); String text = inputWindow.getText().toString(); int cursorPosition = inputWindow.getEditText().getSelectionStart...
Chimee
positive
1,221
private boolean setLabel(Set<Integer> articleIds, Label label) { DBHelper.getInstance().insertLabels(articleIds, label, label.checked); if (!Controller.getInstance().isHeadless()) UpdateController.getInstance().notifyListeners(); boolean erg = false; if (Utils.isConnected(cm)) { Log.d(TAG, "Calling connector with Label...
private boolean setLabel(Set<Integer> articleIds, Label label) { DBHelper.getInstance().insertLabels(articleIds, label, label.checked); <DeepExtract> if (!Controller.getInstance().isHeadless()) UpdateController.getInstance().notifyListeners(); </DeepExtract> boolean erg = false; if (Utils.isConnected(cm)) { Log.d(TAG, ...
ttrss-reader-fork
positive
1,222
@Test public void itMustSetTheCurrentQuestion() throws ServletException, IOException { for (int i = 0; i < 1; i++) { QuestionBuilder.buildDefaultQuestion("Scrum").please(); } OnlineTest onlineTest = OnlineQuiz.createOnlineQuiz(1); request.getSession().setAttribute("onlineTest", onlineTest); controller.doGet(request, re...
@Test public void itMustSetTheCurrentQuestion() throws ServletException, IOException { <DeepExtract> for (int i = 0; i < 1; i++) { QuestionBuilder.buildDefaultQuestion("Scrum").please(); } OnlineTest onlineTest = OnlineQuiz.createOnlineQuiz(1); request.getSession().setAttribute("onlineTest", onlineTest); controller.doG...
snowball
positive
1,223
void initData() { View progressView = mInflater.inflate(R.layout.loading, null); mCategoryLayout.removeAllViews(); mCategoryLayout.addView(progressView); mProgressVisible = true; getCategory(mCategoryUrl); }
void initData() { <DeepExtract> View progressView = mInflater.inflate(R.layout.loading, null); mCategoryLayout.removeAllViews(); mCategoryLayout.addView(progressView); mProgressVisible = true; </DeepExtract> getCategory(mCategoryUrl); }
google_android_book_v2
positive
1,224
public static void main(String[] args) { Server server = new Server(9999); try { serverSocketChannelOpen(); bind(); selectorOpen(); register(SelectionKey.OP_ACCEPT); selectorStrategy.execute(selector); } catch (IOException e) { e.printStackTrace(); } }
public static void main(String[] args) { Server server = new Server(9999); <DeepExtract> try { serverSocketChannelOpen(); bind(); selectorOpen(); register(SelectionKey.OP_ACCEPT); selectorStrategy.execute(selector); } catch (IOException e) { e.printStackTrace(); } </DeepExtract> }
framework-nio
positive
1,225
public LongFraction negate() { if (-signum(numerator) == 0 || isZero(this)) return LongFraction.ZERO; int thisSignum = signum(); if ((thisSignum < 0 && -signum(numerator) > 0) || (thisSignum > 0 && -signum(numerator) < 0)) return new LongFraction(negateAndCheck(numerator), denominator, Reduced.YES); return this; }
public LongFraction negate() { <DeepExtract> if (-signum(numerator) == 0 || isZero(this)) return LongFraction.ZERO; int thisSignum = signum(); if ((thisSignum < 0 && -signum(numerator) > 0) || (thisSignum > 0 && -signum(numerator) < 0)) return new LongFraction(negateAndCheck(numerator), denominator, Reduced.YES); retur...
BigFraction
positive
1,227
private void subscribeToWithQosAndNoCleanSession(String topic, int qos) throws Exception { MqttConnectOptions opts = new MqttConnectOptions(); opts.setCleanSession(false); m_subscriber.connect(opts); m_subscriber.subscribe(topic, qos); }
private void subscribeToWithQosAndNoCleanSession(String topic, int qos) throws Exception { <DeepExtract> MqttConnectOptions opts = new MqttConnectOptions(); opts.setCleanSession(false); m_subscriber.connect(opts); </DeepExtract> m_subscriber.subscribe(topic, qos); }
moquette
positive
1,228
@Override public void onTextChanged(CharSequence s, int start, int before, int count) { recycler_view.setVisibility(View.VISIBLE); if (TextUtils.isEmpty(s)) { mAddressAdapter.clearAll(); mAddressAdapter.notifyAllSectionsDataSetChanged(); return; } List<String> relCitys = new ArrayList<>(); List<Province> provinces = ((...
@Override public void onTextChanged(CharSequence s, int start, int before, int count) { <DeepExtract> recycler_view.setVisibility(View.VISIBLE); if (TextUtils.isEmpty(s)) { mAddressAdapter.clearAll(); mAddressAdapter.notifyAllSectionsDataSetChanged(); return; } List<String> relCitys = new ArrayList<>(); List<Province> ...
DouDou
positive
1,229
public static void glBindSampler(int unit, int sampler) { if (!isContextCompatible()) throw new IllegalStateException("The context should be created before invoking the GL functions"); nglBindSampler(unit, WebGLObjectMap.get().toSampler(sampler)); }
public static void glBindSampler(int unit, int sampler) { <DeepExtract> if (!isContextCompatible()) throw new IllegalStateException("The context should be created before invoking the GL functions"); </DeepExtract> nglBindSampler(unit, WebGLObjectMap.get().toSampler(sampler)); }
WebGL4J
positive
1,230
@Test public void compare() { System.out.println("504, 332, 332:"); double[] rgb = { 504.0, 332.0, 332.0 }; HDR10.matrix.fromLumaCode(rgb, rgb); PQ.toLinear(rgb, rgb); var xyz = RGBtoXYZ.multiply(rgb); System.out.println(new CIEXYZ(xyz).CIExyY(10000.0)); var xyz = new CIExyY(0.587717785, 0.303261279, 32.77050068 / 1000...
@Test public void compare() { System.out.println("504, 332, 332:"); double[] rgb = { 504.0, 332.0, 332.0 }; HDR10.matrix.fromLumaCode(rgb, rgb); PQ.toLinear(rgb, rgb); var xyz = RGBtoXYZ.multiply(rgb); System.out.println(new CIEXYZ(xyz).CIExyY(10000.0)); var xyz = new CIExyY(0.587717785, 0.303261279, 32.77050068 / 1000...
testing-video
positive
1,231
public void showNoTasks() { mTasksView.setVisibility(View.GONE); mNoTasksView.setVisibility(View.VISIBLE); mNoTaskMainView.setText(resources.getString(R.string.no_tasks_all)); mNoTaskIcon.setImageDrawable(resources.getDrawable(R.drawable.ic_assignment_turned_in_24dp)); mNoTaskAddView.setVisibility(false ? View.VISIBLE ...
public void showNoTasks() { <DeepExtract> mTasksView.setVisibility(View.GONE); mNoTasksView.setVisibility(View.VISIBLE); mNoTaskMainView.setText(resources.getString(R.string.no_tasks_all)); mNoTaskIcon.setImageDrawable(resources.getDrawable(R.drawable.ic_assignment_turned_in_24dp)); mNoTaskAddView.setVisibility(false ?...
navigator
positive
1,232
private void initView() { mLuBottomMenu = (LuBottomMenu) findViewById(R.id.lu_bottom_menu); mRichTextView = (SimpleRichEditor) findViewById(R.id.rich_text_view); mToolbar = (Toolbar) findViewById(R.id.toolbar); mButton = (Button) findViewById(R.id.button); mRichTextView.setOnEditorClickListener(this); mRichTextView.set...
private void initView() { <DeepExtract> </DeepExtract> mLuBottomMenu = (LuBottomMenu) findViewById(R.id.lu_bottom_menu); <DeepExtract> </DeepExtract> mRichTextView = (SimpleRichEditor) findViewById(R.id.rich_text_view); <DeepExtract> </DeepExtract> mToolbar = (Toolbar) findViewById(R.id.toolbar); <DeepExtract> </DeepEx...
RichEditorWeb
positive
1,233
@Override public void onPageLoaded(MapFragment mapFragment) { long beginLoadContent = System.currentTimeMillis(); if (BuildConfig.DEBUG) { System.out.println("Load leaflet in " + (beginLoadContent - beginLoadPage) + " ms"); } SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); int measur...
@Override public void onPageLoaded(MapFragment mapFragment) { long beginLoadContent = System.currentTimeMillis(); if (BuildConfig.DEBUG) { System.out.println("Load leaflet in " + (beginLoadContent - beginLoadPage) + " ms"); } SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); int measur...
NoiseCapture
positive
1,234
public void startToDelete() { String content = mDialog.getContext().getString(R.string.deleting_progress, 0, mDeleteItemCount); DialogBuilder builder = new DialogBuilder(mDialog.getContext()); builder.title(R.string.delete).content(content).progress(true, 0); mDeleteProgressDialog = builder.build(); mDeleteProgressDial...
public void startToDelete() { String content = mDialog.getContext().getString(R.string.deleting_progress, 0, mDeleteItemCount); DialogBuilder builder = new DialogBuilder(mDialog.getContext()); builder.title(R.string.delete).content(content).progress(true, 0); mDeleteProgressDialog = builder.build(); mDeleteProgressDial...
pic-clean-master
positive
1,235
@Override public void onClick(View v) { Intent intent = new Intent(mContext, ImagePickerActivity.class); startActivityForResult(intent, INTENT_REQUEST_GET_IMAGES); }
@Override public void onClick(View v) { <DeepExtract> Intent intent = new Intent(mContext, ImagePickerActivity.class); startActivityForResult(intent, INTENT_REQUEST_GET_IMAGES); </DeepExtract> }
poly-picker
positive
1,236
public void updateNewBag() { viewTagFilesToolbarAction.setEnabled(true); bagPayloadTree.setEnabled(true); bagPayloadTreePanel.setEnabled(true); bagTagFileTree.setEnabled(true); bagTagFileTreePanel.setEnabled(true); infoInputPane.bagInfoInputPane.setEnabled(true); addDataToolBarAction.setEnabled(true); addDataExecutor.s...
public void updateNewBag() { viewTagFilesToolbarAction.setEnabled(true); <DeepExtract> bagPayloadTree.setEnabled(true); bagPayloadTreePanel.setEnabled(true); bagTagFileTree.setEnabled(true); bagTagFileTreePanel.setEnabled(true); infoInputPane.bagInfoInputPane.setEnabled(true); </DeepExtract> addDataToolBarAction.setEna...
bagger
positive
1,237
protected String linkTo(Integer page) { StringBuilder sb = new StringBuilder("?page=").append(page); String currentPage = parameters.remove("page"); for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("&").append(entry.getKey()).append("=").append(entry.getValue()); } if (currentPage != null) { pa...
protected String linkTo(Integer page) { StringBuilder sb = new StringBuilder("?page=").append(page); String currentPage = parameters.remove("page"); <DeepExtract> for (Map.Entry<String, String> entry : parameters.entrySet()) { sb.append("&").append(entry.getKey()).append("=").append(entry.getValue()); } </DeepExtract> ...
forest
positive
1,239
@Override public void onPasswordProvided(String password, int action) { String amountStr = amountText.getText().toString(); BigInteger newAmount = null; BigDecimal currAmountBigInt = null; if (currentSpinnerSelection == 0) { newAmount = BasicUtils.toNanoCoins(amountStr, 0); } else if (currentSpinnerSelection == 1) { Bi...
@Override public void onPasswordProvided(String password, int action) { String amountStr = amountText.getText().toString(); <DeepExtract> BigInteger newAmount = null; BigDecimal currAmountBigInt = null; if (currentSpinnerSelection == 0) { newAmount = BasicUtils.toNanoCoins(amountStr, 0); } else if (currentSpinnerSelect...
AegisWallet
positive
1,240
public File getGenTestSrcDir() { ConfigureUtil.configure(genTestSrcDir, this.file); }
public File getGenTestSrcDir() { <DeepExtract> ConfigureUtil.configure(genTestSrcDir, this.file); </DeepExtract> }
goomph
positive
1,241
@Override public void onPlaying() { super.onPlaying(); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, new Runnable() { @Override public void run() { playPauseButton.setImageResource(R.drawable.ic_pause_white); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, true, 200);...
@Override public void onPlaying() { super.onPlaying(); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, new Runnable() { @Override public void run() { playPauseButton.setImageResource(R.drawable.ic_pause_white); animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, true, 200);...
Float-Tube
positive
1,242
@JsonIgnore @Override public byte[] getBody() { ReplyBodyProto.Model.Builder builder = ReplyBodyProto.Model.newBuilder(); this.code = code; if (message != null) { builder.setMessage(message); } if (!data.isEmpty()) { builder.putAllData(data); } this.key = key; this.timestamp = timestamp; return builder.build().toByteAr...
@JsonIgnore @Override public byte[] getBody() { ReplyBodyProto.Model.Builder builder = ReplyBodyProto.Model.newBuilder(); this.code = code; if (message != null) { builder.setMessage(message); } if (!data.isEmpty()) { builder.putAllData(data); } this.key = key; <DeepExtract> this.timestamp = timestamp; </DeepExtract> re...
cim
positive
1,243
@Override public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); if (mListener != null) { mListener.onPlayListReadError("user canceled"); } }
@Override public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); <DeepExtract> if (mListener != null) { mListener.onPlayListReadError("user canceled"); } </DeepExtract> }
Canorum
positive
1,244
public Object readData(ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, ObjectInput input, ObjectSubstitutionInterface substitution) throws IOException { Object obj = metaData.newInstance(); cache.putObjectInCacheRead(referenceId, obj); try { ClassMetaDataSlot[]...
public Object readData(ClassLoader loader, StreamingClass streaming, ClassMetaData metaData, int referenceId, ObjectsCache cache, ObjectInput input, ObjectSubstitutionInterface substitution) throws IOException { Object obj = metaData.newInstance(); cache.putObjectInCacheRead(referenceId, obj); <DeepExtract> try { Class...
jetty-session-redis
positive
1,245
public ParseResult setLineStatistics(String mergeResult) { ParseResult result = Parser.parse(mergeResult); charStatistics.setTotal(result.getChars()); charStatistics.setNumOccurInConflict(result.getConflictingChars()); tokenStatistics.setTotal(result.getTokens()); tokenStatistics.setNumOccurInConflict(result.getConflic...
public ParseResult setLineStatistics(String mergeResult) { ParseResult result = Parser.parse(mergeResult); charStatistics.setTotal(result.getChars()); charStatistics.setNumOccurInConflict(result.getConflictingChars()); tokenStatistics.setTotal(result.getTokens()); tokenStatistics.setNumOccurInConflict(result.getConflic...
jdime
positive
1,246
@Override public void onPostExecute(Bitmap result) { if (result != null) { ImageView iv = (ImageView) findViewById(R.id.downloadedImage); iv.setImageBitmap(result); } if (progress != null) { progress.dismiss(); progress = null; } FragmentManager fm = getSupportFragmentManager(); Fragment frag = fm.findFragmentByTag(DOW...
@Override public void onPostExecute(Bitmap result) { if (result != null) { ImageView iv = (ImageView) findViewById(R.id.downloadedImage); iv.setImageBitmap(result); } <DeepExtract> if (progress != null) { progress.dismiss(); progress = null; } FragmentManager fm = getSupportFragmentManager(); Fragment frag = fm.findFra...
Asynchronous-Android-Programming
positive
1,247
public Criteria andUseridLessThanOrEqualTo(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "userid" + " cannot be null"); } criteria.add(new Criterion("userID <=", value)); return (Criteria) this; }
public Criteria andUseridLessThanOrEqualTo(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "userid" + " cannot be null"); } criteria.add(new Criterion("userID <=", value)); </DeepExtract> return (Criteria) this; }
JavaWeb-WeChatMini
positive
1,248
@Override public void start() { mAnimation.reset(); mStartingStartTrim = mStartTrim; mStartingEndTrim = mEndTrim; mStartingRotation = mRotation; if (mRing.getEndTrim() != mRing.getStartTrim()) { mParent.startAnimation(mFinishAnimation); } else { mRing.setColorIndex(0); mRing.resetOriginals(); mParent.startAnimation(mAn...
@Override public void start() { mAnimation.reset(); <DeepExtract> mStartingStartTrim = mStartTrim; mStartingEndTrim = mEndTrim; mStartingRotation = mRotation; </DeepExtract> if (mRing.getEndTrim() != mRing.getStartTrim()) { mParent.startAnimation(mFinishAnimation); } else { mRing.setColorIndex(0); mRing.resetOriginals(...
XRefreshView
positive
1,249
@Override public void reportPlaybackStateChanged(@NonNull final PlaybackState state, @Nullable final CharSequence errorMessage) { int playbackState; switch(state) { case STATE_LOADING: playbackState = PlaybackStateCompat.STATE_BUFFERING; case STATE_PLAYING: playbackState = PlaybackStateCompat.STATE_PLAYING; case STATE_...
@Override public void reportPlaybackStateChanged(@NonNull final PlaybackState state, @Nullable final CharSequence errorMessage) { <DeepExtract> int playbackState; switch(state) { case STATE_LOADING: playbackState = PlaybackStateCompat.STATE_BUFFERING; case STATE_PLAYING: playbackState = PlaybackStateCompat.STATE_PLAYIN...
PainlessMusicPlayer
positive
1,250
public static Bitmap compressByScale(final Bitmap src, final float scaleWidth, final float scaleHeight, final boolean recycle) { if (isEmptyBitmap(src)) { return null; } Bitmap ret = Bitmap.createScaledBitmap(src, scaleWidth, scaleHeight, true); if (recycle && !src.isRecycled() && ret != src) { src.recycle(); } return ...
public static Bitmap compressByScale(final Bitmap src, final float scaleWidth, final float scaleHeight, final boolean recycle) { <DeepExtract> if (isEmptyBitmap(src)) { return null; } Bitmap ret = Bitmap.createScaledBitmap(src, scaleWidth, scaleHeight, true); if (recycle && !src.isRecycled() && ret != src) { src.recycl...
Jetpack-From-Java-To-Kotlin
positive
1,251
@Override public void prepare() { Log.e(TAG, "prepare"); Context context = jzvd.getContext(); if (mMediaHandler != null && mMediaHandlerThread != null && simpleExoPlayer != null) { HandlerThread tmpHandlerThread = mMediaHandlerThread; ExoPlayer tmpMediaPlayer = simpleExoPlayer; JZMediaInterface.SAVED_SURFACE = null; mM...
@Override public void prepare() { Log.e(TAG, "prepare"); Context context = jzvd.getContext(); if (mMediaHandler != null && mMediaHandlerThread != null && simpleExoPlayer != null) { HandlerThread tmpHandlerThread = mMediaHandlerThread; ExoPlayer tmpMediaPlayer = simpleExoPlayer; JZMediaInterface.SAVED_SURFACE = null; mM...
SakuraAnime
positive
1,252
@Override public void onSuccess() { this.contactList = null; this.robotList = null; getModel().closeDB(); if (callback != null) { callback.onSuccess(); } }
@Override public void onSuccess() { this.contactList = null; <DeepExtract> this.robotList = null; </DeepExtract> getModel().closeDB(); if (callback != null) { callback.onSuccess(); } }
PrivateProtect
positive
1,253
private void readTrue() throws IOException { handler.startBoolean(); if (index == fill) { if (captureStart != -1) { captureBuffer.append(buffer, captureStart, fill - captureStart); captureStart = 0; } bufferOffset += fill; fill = reader.read(buffer, 0, buffer.length); index = 0; if (fill == -1) { current = -1; index++;...
private void readTrue() throws IOException { handler.startBoolean(); if (index == fill) { if (captureStart != -1) { captureBuffer.append(buffer, captureStart, fill - captureStart); captureStart = 0; } bufferOffset += fill; fill = reader.read(buffer, 0, buffer.length); index = 0; if (fill == -1) { current = -1; index++;...
Runescape-Web-Walker-Engine
positive
1,255
@Override public UserDataRecord value4(String value) { set(3, value); return this; }
@Override public UserDataRecord value4(String value) { <DeepExtract> set(3, value); </DeepExtract> return this; }
openvsx
positive
1,256
@Override public Response query(@Header("Authorization") String authToken, @Body Query query) { authToken = authToken.replace("CUSTOM ", ""); if (authToken == null || authToken.length() == 0 || authManager == null || authManager.getUser() == null || authManager.getUser().getAuthToken() == null || !authManager.getUser()...
@Override public Response query(@Header("Authorization") String authToken, @Body Query query) { <DeepExtract> authToken = authToken.replace("CUSTOM ", ""); if (authToken == null || authToken.length() == 0 || authManager == null || authManager.getUser() == null || authManager.getUser().getAuthToken() == null || !authMan...
divide
positive
1,257
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); superRecyclerView = (SuperRecyclerView) findViewById(R.id.super_recycle_view); LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(Linear...
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); superRecyclerView = (SuperRecyclerView) findViewById(R.id.super_recycle_view); LinearLayoutManager layoutManager = new LinearLayoutManager(this); layoutManager.setOrientation(Linear...
SuperRecycleView
positive
1,258
public final void setContentY(float y) { mContentY = (int) y - (getMeasuredHeight() - getScaledContentHeight()) / 2; if (SHOW_LOGS) { Logger.d(TAG, "updateMatrixTranslate, mContentX " + mContentX + ", mContentY " + mContentY); } float scaleX = mContentScaleX * mContentScaleMultiplier; float scaleY = mContentScaleY * mC...
public final void setContentY(float y) { mContentY = (int) y - (getMeasuredHeight() - getScaledContentHeight()) / 2; <DeepExtract> if (SHOW_LOGS) { Logger.d(TAG, "updateMatrixTranslate, mContentX " + mContentX + ", mContentY " + mContentY); } float scaleX = mContentScaleX * mContentScaleMultiplier; float scaleY = mCont...
ListVideoViewBaseOnVitamio
positive
1,259
public void notify(NewMasterEvent newMasterEvent) { System.err.println("Current Master node: " + newMasterEvent.getNodeName()); synchronized (masterLock) { masterName = newMasterEvent.getNodeName(); appMasterAddress = getAppSocketAddress(newMasterEvent.getSocketAddress()); } }
public void notify(NewMasterEvent newMasterEvent) { <DeepExtract> System.err.println("Current Master node: " + newMasterEvent.getNodeName()); synchronized (masterLock) { masterName = newMasterEvent.getNodeName(); appMasterAddress = getAppSocketAddress(newMasterEvent.getSocketAddress()); } </DeepExtract> }
berkeley-db
positive
1,260
@TargetApi(23) private void executePermissionsRequest(Object object, String[] perms, int requestCode) { boolean isActivity = object instanceof Activity; boolean isSupportFragment = object instanceof Fragment; boolean isAppFragment = object instanceof android.app.Fragment; boolean isMinSdkM = Build.VERSION.SDK_INT >= 23...
@TargetApi(23) private void executePermissionsRequest(Object object, String[] perms, int requestCode) { <DeepExtract> boolean isActivity = object instanceof Activity; boolean isSupportFragment = object instanceof Fragment; boolean isAppFragment = object instanceof android.app.Fragment; boolean isMinSdkM = Build.VERSION...
RePlugin-GameSdk
positive
1,261
public void setDoubleProperty(String name, double value) throws JMSException { setObjectProperty(name, new Double(value), true); }
public void setDoubleProperty(String name, double value) throws JMSException { <DeepExtract> setObjectProperty(name, new Double(value), true); </DeepExtract> }
stompjms
positive
1,262
@Override public void actionPerformed(ActionEvent e) { String tags = options.getOption(tag).split(",")[1].toUpperCase(); font = options.getFont(tag); example.setFont(font); AA = tags.contains("A"); chkAA.setSelected(AA); chkBold.setSelected(tags.contains("B")); chkItalic.setSelected(tags.contains("I")); }
@Override public void actionPerformed(ActionEvent e) { <DeepExtract> String tags = options.getOption(tag).split(",")[1].toUpperCase(); font = options.getFont(tag); example.setFont(font); AA = tags.contains("A"); chkAA.setSelected(AA); chkBold.setSelected(tags.contains("B")); chkItalic.setSelected(tags.contains("I")); <...
Spark-Reader
positive
1,263
@Override public synchronized CacheSpan startReadWrite(String key, long position) throws InterruptedException { CacheSpan lookupSpan = CacheSpan.createLookup(key, position); while (lockedSpans.containsKey(key)) { wait(); } CacheSpan spanningRegion = getSpan(lookupSpan); if (spanningRegion.isCached) { CacheSpan oldCache...
@Override public synchronized CacheSpan startReadWrite(String key, long position) throws InterruptedException { CacheSpan lookupSpan = CacheSpan.createLookup(key, position); while (lockedSpans.containsKey(key)) { wait(); } <DeepExtract> CacheSpan spanningRegion = getSpan(lookupSpan); if (spanningRegion.isCached) { Cach...
ExoPlayerLeanback
positive
1,264
public BaggageWriter exit() { currentLevel--; backing.finish(); if (isHeader(atoms.get(atoms.size() - 1))) { atoms.remove(atoms.size() - 1); } currentBagBeginIndex = atoms.size(); return this; }
public BaggageWriter exit() { currentLevel--; <DeepExtract> backing.finish(); </DeepExtract> if (isHeader(atoms.get(atoms.size() - 1))) { atoms.remove(atoms.size() - 1); } currentBagBeginIndex = atoms.size(); return this; }
tracingplane-java
positive
1,265
@Override public void render() { assert !server; if (modelBatch == null) { modelBatch = new ModelBatch(Gdx.files.internal("shaders/gdx/world.vert.glsl"), Gdx.files.internal("shaders/gdx/world.frag.glsl")); wiremeshBatch = new ModelBatch(Gdx.files.internal("shaders/gdx/world.vert.glsl"), Gdx.files.internal("shaders/gdx/...
@Override public void render() { assert !server; if (modelBatch == null) { modelBatch = new ModelBatch(Gdx.files.internal("shaders/gdx/world.vert.glsl"), Gdx.files.internal("shaders/gdx/world.frag.glsl")); wiremeshBatch = new ModelBatch(Gdx.files.internal("shaders/gdx/world.vert.glsl"), Gdx.files.internal("shaders/gdx/...
Radix
positive
1,266
public void gen_eval_body(Map<String, Object> context, QLSelect select, PrintWriter out) { Class<?> clazz = (Class<?>) context.get("class"); if (clazz == null) { throw new IllegalArgumentException("context not contains 'class'"); } String className = clazz.getName(); className = className.replaceAll("\\$", "."); String...
public void gen_eval_body(Map<String, Object> context, QLSelect select, PrintWriter out) { Class<?> clazz = (Class<?>) context.get("class"); if (clazz == null) { throw new IllegalArgumentException("context not contains 'class'"); } String className = clazz.getName(); className = className.replaceAll("\\$", "."); String...
simpleel
positive
1,267
public static Operation createCreateCollectionOperation(TypeReference tref) { Operation op = TransformationHelpers.createOperationWithAtomicParameters("createCollection", DATA_ROLE, VOID_TYPE, true, ID_ROLE, INT_TYPE); OperationResponsibility ov = MAPDecoratorHelpers.setPrimaryResponsibility(MAPDecoratorHelpers.STATE_C...
public static Operation createCreateCollectionOperation(TypeReference tref) { Operation op = TransformationHelpers.createOperationWithAtomicParameters("createCollection", DATA_ROLE, VOID_TYPE, true, ID_ROLE, INT_TYPE); <DeepExtract> OperationResponsibility ov = MAPDecoratorHelpers.setPrimaryResponsibility(MAPDecoratorH...
MDSL-Specification
positive
1,268
@Override public List<Resources> listUrlAndPermission() { List<SysResources> sysResources = resourceMapper.listUrlAndPermission(); if (CollectionUtils.isEmpty(sysResources)) { return null; } List<Resources> resources = new ArrayList<>(); for (SysResources r : sysResources) { resources.add(new Resources(r)); } return re...
@Override public List<Resources> listUrlAndPermission() { List<SysResources> sysResources = resourceMapper.listUrlAndPermission(); <DeepExtract> if (CollectionUtils.isEmpty(sysResources)) { return null; } List<Resources> resources = new ArrayList<>(); for (SysResources r : sysResources) { resources.add(new Resources(r)...
springboot-learn
positive
1,269
public int returnTypeIndexFromMethodIndex(int methodIndex) { if (methodIndex < 0 || methodIndex >= tableOfContents.methodIds.size) { throw new IndexOutOfBoundsException("index:" + methodIndex + ", length=" + tableOfContents.methodIds.size); } int position = tableOfContents.methodIds.off + (SizeOf.MEMBER_ID_ITEM * metho...
public int returnTypeIndexFromMethodIndex(int methodIndex) { if (methodIndex < 0 || methodIndex >= tableOfContents.methodIds.size) { throw new IndexOutOfBoundsException("index:" + methodIndex + ", length=" + tableOfContents.methodIds.size); } int position = tableOfContents.methodIds.off + (SizeOf.MEMBER_ID_ITEM * metho...
tinker-dex-dump
positive
1,270
@Test public void testKeyOpenRangeDesc() { List<Integer> keys = ENTITY3.<M>queryKeys(velvet, "key", SecQueries.<Integer, Integer>builder().ltKey(8).descending().build()); List<TestEnt3> values = ENTITY3.batchGetList(velvet, keys); String result = values.stream().map(TestEnt3::getStr).collect(Collectors.joining("")); As...
@Test public void testKeyOpenRangeDesc() { List<Integer> keys = ENTITY3.<M>queryKeys(velvet, "key", SecQueries.<Integer, Integer>builder().ltKey(8).descending().build()); List<TestEnt3> values = ENTITY3.batchGetList(velvet, keys); String result = values.stream().map(TestEnt3::getStr).collect(Collectors.joining("")); As...
velvetdb
positive
1,271
public void setCurrentItem(int item) { mPopulatePending = false; setCurrentItemInternal(item, !mFirstLayout, false, 0); }
public void setCurrentItem(int item) { mPopulatePending = false; <DeepExtract> setCurrentItemInternal(item, !mFirstLayout, false, 0); </DeepExtract> }
OkCalendar
positive
1,272
private Map<String, Long> getStats(String trough_name) { Map<String, Long> map = new TreeMap<String, Long>(); map.put("tables", 0L); map.put("items", 0L); map.put("key_size", 0L); map.put("data_size", 0L); long pos; Map<String, Integer> troughs = getTroughMap(); if (!troughs.containsKey(trough_name)) { throw new Runtim...
private Map<String, Long> getStats(String trough_name) { Map<String, Long> map = new TreeMap<String, Long>(); map.put("tables", 0L); map.put("items", 0L); map.put("key_size", 0L); map.put("data_size", 0L); long pos; Map<String, Integer> troughs = getTroughMap(); if (!troughs.containsKey(trough_name)) { throw new Runtim...
jelectrum
positive
1,273
@Override public synchronized void stopCapture() { if (isDisposed) { throw new RuntimeException("capturer is disposed."); } ThreadUtils.invokeAtFrontUninterruptibly(surfaceTextureHelper.getHandler(), new Runnable() { @Override public void run() { surfaceTextureHelper.stopListening(); capturerObserver.onCapturerStopped(...
@Override public synchronized void stopCapture() { <DeepExtract> if (isDisposed) { throw new RuntimeException("capturer is disposed."); } </DeepExtract> ThreadUtils.invokeAtFrontUninterruptibly(surfaceTextureHelper.getHandler(), new Runnable() { @Override public void run() { surfaceTextureHelper.stopListening(); captur...
VideoCRE
positive
1,274
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { SharedPreferences prefs = getPreferences(MODE_PRIVATE); if (!prefs.getBoolean("dbInitialized", false)) { prefs.edit().putBoolean("dbInitialized", true).commit(); rebuildList(); } if (adapter == null) { adapter = new MySimpleCursorAdapter(saved...
@Override public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) { <DeepExtract> SharedPreferences prefs = getPreferences(MODE_PRIVATE); if (!prefs.getBoolean("dbInitialized", false)) { prefs.edit().putBoolean("dbInitialized", true).commit(); rebuildList(); } if (adapter == null) { adapter = new MySimpleCurso...
MultiChoiceAdapter
positive
1,275
private String getAssociatedToken(EventSubSubscription sub) { return getAssociatedCredential(sub) != null ? getAssociatedCredential(sub).getAccessToken() : null; }
private String getAssociatedToken(EventSubSubscription sub) { <DeepExtract> return getAssociatedCredential(sub) != null ? getAssociatedCredential(sub).getAccessToken() : null; </DeepExtract> }
twitch4j
positive
1,276
public Criteria andRoleNotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "role" + " cannot be null"); } criteria.add(new Criterion("role not like", value)); return (Criteria) this; }
public Criteria andRoleNotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "role" + " cannot be null"); } criteria.add(new Criterion("role not like", value)); </DeepExtract> return (Criteria) this; }
CuitJavaEEPractice
positive
1,277
public static void d(Object msg) { if (!IS_SHOW_ChuMuKLog) { return; } String[] contents = wrapperContent(STACK_TRACE_INDEX_5, null, msg); String tag = contents[0]; String msg = contents[1]; String headString = contents[2]; switch(D) { case V: case D: case I: case W: case E: case A: ChuMuBaseLog.printDefault(D, tag, he...
public static void d(Object msg) { <DeepExtract> if (!IS_SHOW_ChuMuKLog) { return; } String[] contents = wrapperContent(STACK_TRACE_INDEX_5, null, msg); String tag = contents[0]; String msg = contents[1]; String headString = contents[2]; switch(D) { case V: case D: case I: case W: case E: case A: ChuMuBaseLog.printDefa...
ChuMuYa
positive
1,278
public static List<Mission> upcomingMissionWithoutIds() { return Lists.newArrayList(Mission.builder().id(Arrays.asList(null, null, null, null, null).get(0)).raceId(AggregateReference.to(RaceFixture.TEST_RACE_ID)).missionDuration(new DateTimeDuration(LocalDateTime.of(2020, 8, 14, 6, 50), LocalDateTime.of(2020, 8, 14, 7,...
public static List<Mission> upcomingMissionWithoutIds() { <DeepExtract> return Lists.newArrayList(Mission.builder().id(Arrays.asList(null, null, null, null, null).get(0)).raceId(AggregateReference.to(RaceFixture.TEST_RACE_ID)).missionDuration(new DateTimeDuration(LocalDateTime.of(2020, 8, 14, 6, 50), LocalDateTime.of(2...
2020-14f-guys
positive
1,280
public static Spannable getColorizedSpannableBrightWhite(String s, Context context) { Spannable sp = new SpannableString(s); if (context == null) { return; } if (sp.length() > 0) { sp.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.yellow)), 0, sp.length() > 10 ? 11 : sp.length(), Spannable.SPAN...
public static Spannable getColorizedSpannableBrightWhite(String s, Context context) { Spannable sp = new SpannableString(s); if (context == null) { return; } if (sp.length() > 0) { sp.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.yellow)), 0, sp.length() > 10 ? 11 : sp.length(), Spannable.SPAN...
kalium-android-wallet
positive
1,281
@Override protected void onDraw(Canvas canvas) { mFloorPaint.setColor(mFloorColor); int radius = mCenterPoint.x; canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, radius * mFloorScale, mFloorPaint); mPaint.setColor(mUnCheckedColor); float radius = (mCenterPoint.x - mStrokeWidth) * mScaleVal; canvas.drawCircle(mCenterPo...
@Override protected void onDraw(Canvas canvas) { mFloorPaint.setColor(mFloorColor); int radius = mCenterPoint.x; canvas.drawCircle(mCenterPoint.x, mCenterPoint.y, radius * mFloorScale, mFloorPaint); mPaint.setColor(mUnCheckedColor); float radius = (mCenterPoint.x - mStrokeWidth) * mScaleVal; canvas.drawCircle(mCenterPo...
FastWaiMai
positive
1,282
@OnClick({ R.id.main_bottom_mainpage_tv, R.id.main_bottom_discover_tv, R.id.main_bottom_post, R.id.main_bottom_group_tv, R.id.main_bottom_mine_tv }) public void onButtomClick(ImageView view) { int type = mainBottomLLY.indexOfChild(view); mainpageIv.setImageResource(R.drawable.main_mainpage_black); discoverIv.setImageRe...
@OnClick({ R.id.main_bottom_mainpage_tv, R.id.main_bottom_discover_tv, R.id.main_bottom_post, R.id.main_bottom_group_tv, R.id.main_bottom_mine_tv }) public void onButtomClick(ImageView view) { int type = mainBottomLLY.indexOfChild(view); mainpageIv.setImageResource(R.drawable.main_mainpage_black); discoverIv.setImageRe...
banciyuan-unofficial
positive
1,285
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.wechat_fragment_tab_first_msg, container, false); mToolbar = (Toolbar) view.findViewById(R.id.toolbar); mBtnSend = (Button) view.findViewById(...
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.wechat_fragment_tab_first_msg, container, false); <DeepExtract> mToolbar = (Toolbar) view.findViewById(R.id.toolbar); mBtnSend = (Button) view...
Fragmentation
positive
1,286
@Override public void onStart() { super.onStart(); Window window = getWindow(); if (window != null) { PromptEntity promptEntity = getPromptEntity(); window.setGravity(Gravity.CENTER); WindowManager.LayoutParams lp = window.getAttributes(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); if (promptEn...
@Override public void onStart() { super.onStart(); <DeepExtract> Window window = getWindow(); if (window != null) { PromptEntity promptEntity = getPromptEntity(); window.setGravity(Gravity.CENTER); WindowManager.LayoutParams lp = window.getAttributes(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics()...
XUpdate
positive
1,287
@Implementation public static Message obtain(Message msg) { Message m = new Message(); message.arg1 = msg.arg1; message.arg2 = msg.arg2; message.obj = msg.obj; message.what = msg.what; message.setData(msg.getData()); this.target = msg.getTarget(); return m; }
@Implementation public static Message obtain(Message msg) { Message m = new Message(); message.arg1 = msg.arg1; message.arg2 = msg.arg2; message.obj = msg.obj; message.what = msg.what; message.setData(msg.getData()); <DeepExtract> this.target = msg.getTarget(); </DeepExtract> return m; }
scdl
positive
1,289
public static String encodeBytes(byte[] source, int off, int len) { byte[] encoded; if (source == null) throw new NullPointerException("Cannot serialize a null array."); if (off < 0) throw new IllegalArgumentException("Cannot have negative offset: " + off); if (len < 0) throw new IllegalArgumentException("Cannot have l...
public static String encodeBytes(byte[] source, int off, int len) { <DeepExtract> byte[] encoded; if (source == null) throw new NullPointerException("Cannot serialize a null array."); if (off < 0) throw new IllegalArgumentException("Cannot have negative offset: " + off); if (len < 0) throw new IllegalArgumentException(...
nanoleaf-aurora
positive
1,290
protected void sendTextMessage(String thisMessage) { player.sendText(TrekAnsi.locate(22, 1, player)); player.sendText(TrekAnsi.deleteLines(1, player)); player.sendText(TrekAnsi.locate(24, 1, player)); player.sendText(thisMessage + TrekAnsi.eraseToEndOfLine(player)); hudobjects.put("MyHudLine22", getHudValueString("MyHu...
protected void sendTextMessage(String thisMessage) { player.sendText(TrekAnsi.locate(22, 1, player)); player.sendText(TrekAnsi.deleteLines(1, player)); player.sendText(TrekAnsi.locate(24, 1, player)); player.sendText(thisMessage + TrekAnsi.eraseToEndOfLine(player)); hudobjects.put("MyHudLine22", getHudValueString("MyHu...
jtrek
positive
1,293
@Override public void run() { Throwable cause = null; try { onComplete.beforeWrite(msg, args, null); out.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(out); out.writeMessageEnd(); out.getTransport().flush(); } catch (Throwable e) { cause = e; } onComplete.afterWrite(msg, cause, T...
@Override public void run() { <DeepExtract> Throwable cause = null; try { onComplete.beforeWrite(msg, args, null); out.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(out); out.writeMessageEnd(); out.getTransport().flush(); } catch (Throwable e) { cause = e; } onComplete.afterWrite...
netty-thrift
positive
1,294
@Override public void onInit() { super.onInit(); mSharpnessLocation = GLES20.glGetUniformLocation(getProgram(), "sharpness"); mImageWidthFactorLocation = GLES20.glGetUniformLocation(getProgram(), "imageWidthFactor"); mImageHeightFactorLocation = GLES20.glGetUniformLocation(getProgram(), "imageHeightFactor"); mSharpness...
@Override public void onInit() { super.onInit(); mSharpnessLocation = GLES20.glGetUniformLocation(getProgram(), "sharpness"); mImageWidthFactorLocation = GLES20.glGetUniformLocation(getProgram(), "imageWidthFactor"); mImageHeightFactorLocation = GLES20.glGetUniformLocation(getProgram(), "imageHeightFactor"); <DeepExtra...
MagicShow
positive
1,295
public static void main(String[] args) { byte[] ab = new byte[581969]; BitCoderContext ctx = new BitCoderContext(ab); for (int i = 0; i < 31; i++) { ctx.encodeVarBits((1 << i) + 3); } for (int i = 0; i < 100000; i += 13) { ctx.encodeVarBits(i); } flushBuffer(); if (bits > 0) { ab[++idx] = (byte) (b & 0xff); } return id...
public static void main(String[] args) { byte[] ab = new byte[581969]; BitCoderContext ctx = new BitCoderContext(ab); for (int i = 0; i < 31; i++) { ctx.encodeVarBits((1 << i) + 3); } for (int i = 0; i < 100000; i += 13) { ctx.encodeVarBits(i); } <DeepExtract> flushBuffer(); if (bits > 0) { ab[++idx] = (byte) (b & 0xff...
brouter
positive
1,296
public Criteria andPhoneNotEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "phone" + " cannot be null"); } criteria.add(new Criterion("phone <>", value)); return (Criteria) this; }
public Criteria andPhoneNotEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "phone" + " cannot be null"); } criteria.add(new Criterion("phone <>", value)); </DeepExtract> return (Criteria) this; }
garbage-collection
positive
1,298
public boolean updateRelationshipProperty(String type, String label1, String from, String label2, String to, int number, String property, Object value) { if (property.startsWith("~")) return false; int node1; if (!nodeKeys.containsKey(label1)) { node1 = -1; } else { node1 = nodeKeys.get(label1).getInt(from); } int node...
public boolean updateRelationshipProperty(String type, String label1, String from, String label2, String to, int number, String property, Object value) { if (property.startsWith("~")) return false; int node1; if (!nodeKeys.containsKey(label1)) { node1 = -1; } else { node1 = nodeKeys.get(label1).getInt(from); } int node...
uranusdb
positive
1,299
public void setZ(double z) { Point3D coords = new Point3D(0, 0, z); if (coordinates != null) { coords = new Point3D(this.coordinates.getX(), this.coordinates.getY(), z); } if (this.coordinates != null) { this.coordinates = coords; setChanged(); notifyObservers(ModelBoxChange.COORDINATES); } }
public void setZ(double z) { Point3D coords = new Point3D(0, 0, z); if (coordinates != null) { coords = new Point3D(this.coordinates.getX(), this.coordinates.getY(), z); } <DeepExtract> if (this.coordinates != null) { this.coordinates = coords; setChanged(); notifyObservers(ModelBoxChange.COORDINATES); } </DeepExtract>...
ObjectGraphVisualization
positive
1,300
public Bitmap miniThumbBitmap() { return fullSizeBitmap(THUMBNAIL_TARGET_SIZE, THUMBNAIL_MAX_NUM_PIXELS, IImage.ROTATE_AS_NEEDED); }
public Bitmap miniThumbBitmap() { <DeepExtract> return fullSizeBitmap(THUMBNAIL_TARGET_SIZE, THUMBNAIL_MAX_NUM_PIXELS, IImage.ROTATE_AS_NEEDED); </DeepExtract> }
LetsChat
positive
1,301
@Nonnull public ItemFilter notIn(ItemSet set) { return new Simple(mode, amount, s -> !set.contains(s)); }
@Nonnull public ItemFilter notIn(ItemSet set) { <DeepExtract> return new Simple(mode, amount, s -> !set.contains(s)); </DeepExtract> }
Technicalities
positive
1,302
public static void enter(Object obj) { System.out.println("Step 1"); System.out.println("Step 2"); synchronized (obj) { System.out.println("Step 3 (never reached here)"); } }
public static void enter(Object obj) { <DeepExtract> </DeepExtract> System.out.println("Step 1"); <DeepExtract> </DeepExtract> System.out.println("Step 2"); <DeepExtract> </DeepExtract> synchronized (obj) { <DeepExtract> </DeepExtract> System.out.println("Step 3 (never reached here)"); <DeepExtract> </DeepExtract> } <D...
ijmtdp
positive
1,303
private void initUI(Bundle savedInstanceState) { res = getResources(); initiateActionBar(); try { stock = Inventory.getInstance().getStock(); productCatalog = Inventory.getInstance().getProductCatalog(); } catch (NoDaoSetException e) { e.printStackTrace(); } id = getIntent().getStringExtra("id"); product = productCatal...
private void initUI(Bundle savedInstanceState) { <DeepExtract> res = getResources(); initiateActionBar(); try { stock = Inventory.getInstance().getStock(); productCatalog = Inventory.getInstance().getProductCatalog(); } catch (NoDaoSetException e) { e.printStackTrace(); } id = getIntent().getStringExtra("id"); product ...
pos
positive
1,304
public void setRenderer(GLSurfaceView.Renderer renderer) { if (mGLThread != null) { throw new IllegalStateException("setRenderer has already been called for this instance."); } if (mEGLConfigChooser == null) { mEGLConfigChooser = new SimpleEGLConfigChooser(true); } if (mEGLContextFactory == null) { mEGLContextFactory =...
public void setRenderer(GLSurfaceView.Renderer renderer) { if (mGLThread != null) { throw new IllegalStateException("setRenderer has already been called for this instance."); } if (mEGLConfigChooser == null) { mEGLConfigChooser = new SimpleEGLConfigChooser(true); } if (mEGLContextFactory == null) { mEGLContextFactory =...
VideoRecorder
positive
1,305