before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Override
public boolean addFixedChest(Location loc, String fixedChest) {
if (loc == null || fixedChest == null || fixedChest.equalsIgnoreCase(""))
return false;
if (fixedChests.keySet().contains(loc))
return false;
blacklistedChests.remove(loc);
if (!(loc.getBlock().getState() instanceof Chest))
return false;
Block b ... | @Override
public boolean addFixedChest(Location loc, String fixedChest) {
if (loc == null || fixedChest == null || fixedChest.equalsIgnoreCase(""))
return false;
if (fixedChests.keySet().contains(loc))
return false;
blacklistedChests.remove(loc);
if (!(loc.getBlock().getState() instanceof Chest))
return false;
<DeepExt... | MyHungerGames | positive | 1,851 |
private void sortComparingByIndicesIfEqualImpl(int from, int until) {
for (int i = from; i < until; ++i) {
scratch[i] = points[indices[i]][coordinate];
}
sortImplInside(from, until);
int last = from;
double lastX = scratch[from];
for (int i = from + 1; i < until; ++i) {
double currX = scratch[i];
if (currX != lastX) {
... | private void sortComparingByIndicesIfEqualImpl(int from, int until) {
<DeepExtract>
for (int i = from; i < until; ++i) {
scratch[i] = points[indices[i]][coordinate];
}
sortImplInside(from, until);
</DeepExtract>
int last = from;
double lastX = scratch[from];
for (int i = from + 1; i < until; ++i) {
double currX = scrat... | non-dominated-sorting | positive | 1,852 |
public boolean storeSellDetails(SellsDatabaseModel sell) {
database = dbHelper.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(dbHelper.COL_SELL_SELLS_CODE, sell.getSellsCode());
contentValues.put(dbHelper.COL_SELL_CUSTOMER_ID, sell.getCustomerId());
contentValues.put(dbHelpe... | public boolean storeSellDetails(SellsDatabaseModel sell) {
database = dbHelper.getWritableDatabase();
ContentValues contentValues = new ContentValues();
contentValues.put(dbHelper.COL_SELL_SELLS_CODE, sell.getSellsCode());
contentValues.put(dbHelper.COL_SELL_CUSTOMER_ID, sell.getCustomerId());
contentValues.put(dbHelpe... | Android-POS | positive | 1,853 |
public PageBean<SmProductEntity> getProductByCriteria(ProductCriteriaBo criteria) throws Exception {
TbkDgMaterialOptionalRequest request = new TbkDgMaterialOptionalRequest();
request.setMaterialId(6707L);
request.setAdzoneId(110173550272L);
request.setPageNo(criteria.getPageNum().longValue());
request.setPageSize(crit... | public PageBean<SmProductEntity> getProductByCriteria(ProductCriteriaBo criteria) throws Exception {
<DeepExtract>
TbkDgMaterialOptionalRequest request = new TbkDgMaterialOptionalRequest();
request.setMaterialId(6707L);
request.setAdzoneId(110173550272L);
request.setPageNo(criteria.getPageNum().longValue());
request.se... | cps-mall | positive | 1,854 |
@Override
public void showBrightnessDialog(int brightnessPercent) {
super.showBrightnessDialog(brightnessPercent);
if (mBrightnessDialog == null) {
View localView = LayoutInflater.from(jzvdContext).inflate(R.layout.jz_dialog_brightness, null);
mDialogBrightnessTextView = localView.findViewById(R.id.tv_brightness);
mDia... | @Override
public void showBrightnessDialog(int brightnessPercent) {
super.showBrightnessDialog(brightnessPercent);
if (mBrightnessDialog == null) {
View localView = LayoutInflater.from(jzvdContext).inflate(R.layout.jz_dialog_brightness, null);
mDialogBrightnessTextView = localView.findViewById(R.id.tv_brightness);
mDia... | JZVideo | positive | 1,855 |
public static void main(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
THE_LOGGER.info("***debug*** args[" + i + "]=" + args[i]);
}
final String outputPath = args[0];
final String numOfStudiesAsString = args[1];
final int K = Integer.parseInt(numOfStudiesAsString);
List<String> inputPathMulti... | public static void main(String[] args) throws Exception {
for (int i = 0; i < args.length; i++) {
THE_LOGGER.info("***debug*** args[" + i + "]=" + args[i]);
}
final String outputPath = args[0];
final String numOfStudiesAsString = args[1];
final int K = Integer.parseInt(numOfStudiesAsString);
List<String> inputPathMulti... | data-algorithms-book | positive | 1,856 |
@Override
public void onMarkerDragStart(Marker marker) {
if (marker.equals(centerMarker)) {
circle.setCenter(marker.getPosition());
radiusMarker.setPosition(toRadiusLatLng(marker.getPosition(), radiusMeters));
return true;
}
if (marker.equals(radiusMarker)) {
radiusMeters = toRadiusMeters(centerMarker.getPosition(), ra... | @Override
public void onMarkerDragStart(Marker marker) {
<DeepExtract>
if (marker.equals(centerMarker)) {
circle.setCenter(marker.getPosition());
radiusMarker.setPosition(toRadiusLatLng(marker.getPosition(), radiusMeters));
return true;
}
if (marker.equals(radiusMarker)) {
radiusMeters = toRadiusMeters(centerMarker.get... | android-samples | positive | 1,857 |
public void update() {
_mouseWorldX = FlxG.mouse.x / B2FlxB.RATIO;
_mouseWorldY = FlxG.mouse.y / B2FlxB.RATIO;
if (_mouseJoint == null && FlxG.mouse.justPressed()) {
_hitBody = null;
_testPoint.set(_mouseWorldX, _mouseWorldY);
B2FlxB.world.QueryAABB(getBodyCallback, _testPoint.x - 0.0001f, _testPoint.y - 0.0001f, _test... | public void update() {
_mouseWorldX = FlxG.mouse.x / B2FlxB.RATIO;
_mouseWorldY = FlxG.mouse.y / B2FlxB.RATIO;
if (_mouseJoint == null && FlxG.mouse.justPressed()) {
_hitBody = null;
_testPoint.set(_mouseWorldX, _mouseWorldY);
B2FlxB.world.QueryAABB(getBodyCallback, _testPoint.x - 0.0001f, _testPoint.y - 0.0001f, _test... | flixel-gdx-box2d | positive | 1,858 |
@Override
public synchronized void synchronize() {
try {
fileOutputStream.flush();
fileOutputStream.close();
} catch (ClosedChannelException e) {
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
try {
if (!this.pagesCache.isEmpty()) {
for (CachePage p : this.pagesCache.values()) {
p.flush();
}
this.pagesC... | @Override
public synchronized void synchronize() {
try {
fileOutputStream.flush();
fileOutputStream.close();
} catch (ClosedChannelException e) {
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
<DeepExtract>
try {
if (!this.pagesCache.isEmpty()) {
for (CachePage p : this.pagesCache.values()) {
p.flush();... | gazetteer | positive | 1,859 |
@Test
public void acquireWriteLocksOnTwoPages() throws Exception {
bp.getPage(tid1, p0, Permissions.READ_WRITE);
grabLock(tid2, p1, Permissions.READ_WRITE, true);
} | @Test
public void acquireWriteLocksOnTwoPages() throws Exception {
<DeepExtract>
bp.getPage(tid1, p0, Permissions.READ_WRITE);
grabLock(tid2, p1, Permissions.READ_WRITE, true);
</DeepExtract>
} | simple-db-hw-2021 | positive | 1,860 |
protected void initiateTaskGang(int inputSize) {
System.out.println("@@@ starting cycle " + currentCycle() + " with " + inputSize + " tasks@@@");
mExitBarrier = new CountDownLatch(inputSize);
if (getExecutor() == null)
setExecutor(Executors.newFixedThreadPool(MAX_THREADS));
List<Callable<Object>> workerCollection = new... | protected void initiateTaskGang(int inputSize) {
<DeepExtract>
System.out.println("@@@ starting cycle " + currentCycle() + " with " + inputSize + " tasks@@@");
mExitBarrier = new CountDownLatch(inputSize);
if (getExecutor() == null)
setExecutor(Executors.newFixedThreadPool(MAX_THREADS));
</DeepExtract>
List<Callable<Ob... | CS892 | positive | 1,862 |
@Override
public void onSessionClosed(Object session) {
ClientSession clientSession = (ClientSession) session;
sessions.remove(clientSession);
if (clientSession.isWorking() || clientSession.isFreeze()) {
serverSurrogate.clientSessionClosed(clientSession.getId());
}
} | @Override
public void onSessionClosed(Object session) {
ClientSession clientSession = (ClientSession) session;
<DeepExtract>
sessions.remove(clientSession);
</DeepExtract>
if (clientSession.isWorking() || clientSession.isFreeze()) {
serverSurrogate.clientSessionClosed(clientSession.getId());
}
} | anima | positive | 1,863 |
public static void writeDataToFile(Context context, String filename, String data) throws Exception {
String cacheDir = context.getCacheDir().getAbsolutePath();
File cacheFile = new File(cacheDir + "/" + FilenameUtils.getName(filename));
FileOutputStream os = new FileOutputStream(cacheFile);
os.write(data.getBytes());
o... | public static void writeDataToFile(Context context, String filename, String data) throws Exception {
String cacheDir = context.getCacheDir().getAbsolutePath();
File cacheFile = new File(cacheDir + "/" + FilenameUtils.getName(filename));
FileOutputStream os = new FileOutputStream(cacheFile);
os.write(data.getBytes());
o... | android_app_efidroidmanager | positive | 1,864 |
@SuppressWarnings("unused")
private void opCheckSig(Transaction context) throws ScriptException {
byte[] pubkey = stack.pop();
byte[] sigAndHashType = stack.pop();
byte hashType = sigAndHashType[sigAndHashType.length - 1];
boolean anyoneCanPay = hashType < 0;
hashType &= (byte) -1 >>> 1;
switch(hashType) {
case 1:
sigH... | @SuppressWarnings("unused")
private void opCheckSig(Transaction context) throws ScriptException {
byte[] pubkey = stack.pop();
byte[] sigAndHashType = stack.pop();
byte hashType = sigAndHashType[sigAndHashType.length - 1];
boolean anyoneCanPay = hashType < 0;
hashType &= (byte) -1 >>> 1;
switch(hashType) {
case 1:
sigH... | bitcoinj-minimal | positive | 1,865 |
public static void checkRequest(@Nonnull final Dhcp6Message msg, @Nonnull final DuidOption.Duid duid) throws InvalidMsgException {
if (!isMsgType(msg, Dhcp6MessageType.DHCP_REQUEST)) {
throw new InvalidMsgException(String.format("Incorrect type, expected: %s, but was: %s", Dhcp6MessageType.DHCP_REQUEST, msg.getMessageT... | public static void checkRequest(@Nonnull final Dhcp6Message msg, @Nonnull final DuidOption.Duid duid) throws InvalidMsgException {
if (!isMsgType(msg, Dhcp6MessageType.DHCP_REQUEST)) {
throw new InvalidMsgException(String.format("Incorrect type, expected: %s, but was: %s", Dhcp6MessageType.DHCP_REQUEST, msg.getMessageT... | dhcp4j | positive | 1,866 |
@Override
public void onClick(View view) {
mEmailView.setError(null);
mPasswordView.setError(null);
mUrlView.setError(null);
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
String url = mUrlView.getText().toString();
boolean cancel = false;
View focusView = null;
if... | @Override
public void onClick(View view) {
<DeepExtract>
mEmailView.setError(null);
mPasswordView.setError(null);
mUrlView.setError(null);
String email = mEmailView.getText().toString();
String password = mPasswordView.getText().toString();
String url = mUrlView.getText().toString();
boolean cancel = false;
View focusV... | nuxeo-java-client | positive | 1,867 |
public void addGroup(String sessionId, String categoryId, String columnId, Position position) {
final SaikuMasterModel model = sessionHolder.getModel(sessionId);
final List<SaikuColumn> columns = model.getColumns();
SaikuColumn saikuColumn = null;
for (Iterator<SaikuColumn> iterator = columns.iterator(); iterator.hasNe... | public void addGroup(String sessionId, String categoryId, String columnId, Position position) {
final SaikuMasterModel model = sessionHolder.getModel(sessionId);
<DeepExtract>
final List<SaikuColumn> columns = model.getColumns();
SaikuColumn saikuColumn = null;
for (Iterator<SaikuColumn> iterator = columns.iterator(); ... | saiku-adhoc | positive | 1,868 |
@Override
public void onSourceSelected(long sourceId) {
mDrawerLayout.closeDrawer(GravityCompat.START);
ItemListFragment fragment = (ItemListFragment) getFragmentManager().findFragmentById(R.id.details_frame);
if (fragment == null || fragment.getShownSourceId() != sourceId) {
fragment = ItemListFragment.newInstance(sou... | @Override
public void onSourceSelected(long sourceId) {
mDrawerLayout.closeDrawer(GravityCompat.START);
<DeepExtract>
ItemListFragment fragment = (ItemListFragment) getFragmentManager().findFragmentById(R.id.details_frame);
if (fragment == null || fragment.getShownSourceId() != sourceId) {
fragment = ItemListFragment.n... | Feeder | positive | 1,869 |
public static TMCPoint getPoint(int cid, int tabcd, int lcd) {
int ret = tabcd;
Integer tabcd = LTN_ALIASES.get(cid + ";" + tabcd);
if (tabcd != null)
ret = tabcd;
else {
LocationDataset lds = getLocationDataset(cid, tabcd);
if (lds != null)
putLtnAlias(cid, tabcd, lds.tabcd);
else
try {
PreparedStatement stmt = dbConn... | public static TMCPoint getPoint(int cid, int tabcd, int lcd) {
<DeepExtract>
int ret = tabcd;
Integer tabcd = LTN_ALIASES.get(cid + ";" + tabcd);
if (tabcd != null)
ret = tabcd;
else {
LocationDataset lds = getLocationDataset(cid, tabcd);
if (lds != null)
putLtnAlias(cid, tabcd, lds.tabcd);
else
try {
PreparedStatement... | RdsSurveyor | positive | 1,870 |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
pref_bitminterKey = prefs.getString("bitminterKey", "");
pref_widgetMiningPayoutUnit =... | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
pref_bitminterKey = prefs.getString("bitminterKey", "");
pref_widgetMiningPayoutUnit =... | bitcoinium | positive | 1,871 |
public Criteria andConsumerIdIsNull() {
if ("consumer_id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("consumer_id is null"));
return (Criteria) this;
} | public Criteria andConsumerIdIsNull() {
<DeepExtract>
if ("consumer_id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("consumer_id is null"));
</DeepExtract>
return (Criteria) this;
} | ssmxiaomi | positive | 1,872 |
@Override
public void onNext(String s) {
hud.dismiss();
ArrayList<Map<String, Object>> List = new ArrayList<>();
try {
JSONObject jsonObject = new JSONObject(s);
JSONObject jsonArray = jsonObject.getJSONObject("data");
JSONArray listjsonarrya = jsonArray.getJSONArray("list");
for (int i = 0; i < listjsonarrya.length();... | @Override
public void onNext(String s) {
hud.dismiss();
<DeepExtract>
ArrayList<Map<String, Object>> List = new ArrayList<>();
try {
JSONObject jsonObject = new JSONObject(s);
JSONObject jsonArray = jsonObject.getJSONObject("data");
JSONArray listjsonarrya = jsonArray.getJSONArray("list");
for (int i = 0; i < listjsona... | lingJuan | positive | 1,873 |
public static QualifiedName forFieldDeclaration(ValaFieldDeclaration fieldDeclaration) {
ValaDeclaration container = getParentOfType(fieldDeclaration.getParent(), ValaDeclaration.class, false);
if (container == null) {
qName = new QualifiedNameBuilder();
} else {
qName = container.getQName();
}
QualifiedNameBuilder new... | public static QualifiedName forFieldDeclaration(ValaFieldDeclaration fieldDeclaration) {
ValaDeclaration container = getParentOfType(fieldDeclaration.getParent(), ValaDeclaration.class, false);
if (container == null) {
qName = new QualifiedNameBuilder();
} else {
qName = container.getQName();
}
<DeepExtract>
QualifiedN... | vala-intellij-plugin | positive | 1,874 |
public Criteria andCreatorNotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "creator" + " cannot be null");
}
criteria.add(new Criterion("creator not between", value1, value2));
return (Criteria) this;
} | public Criteria andCreatorNotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "creator" + " cannot be null");
}
criteria.add(new Criterion("creator not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | dtsopensource | positive | 1,875 |
private void onLayout2(boolean changed, int left, int top, int right, int bottom) {
if (isInEditMode())
return;
View cv = mChildViews.get(mCurrent);
if (!mResetLayout) {
if (cv != null) {
boolean move;
cvOffset = subScreenSizeOffset(cv);
if (HORIZONTAL_SCROLLING)
move = cv.getLeft() + cv.getMeasuredWidth() + cvOffset.x... | private void onLayout2(boolean changed, int left, int top, int right, int bottom) {
if (isInEditMode())
return;
View cv = mChildViews.get(mCurrent);
if (!mResetLayout) {
if (cv != null) {
boolean move;
cvOffset = subScreenSizeOffset(cv);
if (HORIZONTAL_SCROLLING)
move = cv.getLeft() + cv.getMeasuredWidth() + cvOffset.x... | AndroidMuPDF | positive | 1,876 |
public void showFailView() {
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
child.setVisibility(failView == child ? View.VISIBLE : View.GONE);
}
} | public void showFailView() {
<DeepExtract>
for (int i = 0; i < getChildCount(); i++) {
View child = getChildAt(i);
child.setVisibility(failView == child ? View.VISIBLE : View.GONE);
}
</DeepExtract>
} | MainUiFrame | positive | 1,878 |
private void modelResetTableButtonActionPerformed(java.awt.event.ActionEvent evt) {
int rowCount = modelTable.getRowCount();
int columnCount = modelTable.getColumnCount();
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < columnCount; j++) {
modelTable.setValueAt(null, i, j);
}
}
} | private void modelResetTableButtonActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
int rowCount = modelTable.getRowCount();
int columnCount = modelTable.getColumnCount();
for (int i = 0; i < rowCount; i++) {
for (int j = 0; j < columnCount; j++) {
modelTable.setValueAt(null, i, j);
}
}
</DeepExtract>
} | fuelphp-netbeans | positive | 1,880 |
public void set(@NonNull final Target<T> s) {
checkNotNull(s);
do {
oldState = state;
newState = oldState.set(s);
} while (!STATE_UPDATER.compareAndSet(this, oldState, newState));
state.target.onDestroy();
} | public void set(@NonNull final Target<T> s) {
checkNotNull(s);
do {
oldState = state;
newState = oldState.set(s);
} while (!STATE_UPDATER.compareAndSet(this, oldState, newState));
<DeepExtract>
state.target.onDestroy();
</DeepExtract>
} | reark | positive | 1,881 |
@Override
public String toStringShort() {
StringBuilder sb = getToStringBase("").append(termPeriod);
StringBuilder sb = getToStringBase(getClass().getSimpleName()).append(',').append(getValue()).append(" pip");
return addSideStatusToString(sb).toString();
} | @Override
public String toStringShort() {
StringBuilder sb = getToStringBase("").append(termPeriod);
<DeepExtract>
StringBuilder sb = getToStringBase(getClass().getSimpleName()).append(',').append(getValue()).append(" pip");
return addSideStatusToString(sb).toString();
</DeepExtract>
} | FX-AlgorithmTrading | positive | 1,882 |
public ArrayList<ChartSet> prepareUpdateAnimation(ArrayList<float[][]> start, ArrayList<float[][]> end) {
final int nSets = start.size();
final int nEntries = start.get(0).length;
mCurrEntryDuration = new long[nEntries];
if (mOrder == null) {
mOrder = new int[nEntries];
for (int i = 0; i < mOrder.length; i++) mOrder[i]... | public ArrayList<ChartSet> prepareUpdateAnimation(ArrayList<float[][]> start, ArrayList<float[][]> end) {
<DeepExtract>
final int nSets = start.size();
final int nEntries = start.get(0).length;
mCurrEntryDuration = new long[nEntries];
if (mOrder == null) {
mOrder = new int[nEntries];
for (int i = 0; i < mOrder.length; ... | WilliamChart | positive | 1,883 |
void onSessionClosed() {
sessionDataListener.sessionClosed();
selectionKey.cancel();
closed = true;
Logger.log(Category.CONNECTION, "Session %d state -> %s%n", id, SessionState.DISCONNECTED.name());
state = SessionState.DISCONNECTED;
CloseHelper.quietClose(outputChannel);
CloseHelper.quietClose(inputChannel);
} | void onSessionClosed() {
sessionDataListener.sessionClosed();
selectionKey.cancel();
closed = true;
<DeepExtract>
Logger.log(Category.CONNECTION, "Session %d state -> %s%n", id, SessionState.DISCONNECTED.name());
state = SessionState.DISCONNECTED;
</DeepExtract>
CloseHelper.quietClose(outputChannel);
CloseHelper.quietC... | babl | positive | 1,884 |
public <T> T patchOfStandard(Class<T> responseClass, String url, Object body) {
Request request = new Request.Builder().method(PATCH, getRequestBody(false, body)).headers(Headers.of()).url(getBuilder(url, Parameters.of()).build()).build();
try (Response response = call(request, url)) {
try (ResponseBody responseBody = ... | public <T> T patchOfStandard(Class<T> responseClass, String url, Object body) {
<DeepExtract>
Request request = new Request.Builder().method(PATCH, getRequestBody(false, body)).headers(Headers.of()).url(getBuilder(url, Parameters.of()).build()).build();
try (Response response = call(request, url)) {
try (ResponseBody r... | Doramon | positive | 1,885 |
@Override
public void itemSwiped(int position, int direction) {
final FavouriteItem item = fastItemAdapter.getAdapterItem(position);
new FavouritesManager(requireContext()).removeFromFavourites(item.getApp());
fastItemAdapter.remove(position);
fastItemAdapter.notifyAdapterItemChanged(position);
updateSelectionText();
u... | @Override
public void itemSwiped(int position, int direction) {
final FavouriteItem item = fastItemAdapter.getAdapterItem(position);
new FavouritesManager(requireContext()).removeFromFavourites(item.getApp());
fastItemAdapter.remove(position);
fastItemAdapter.notifyAdapterItemChanged(position);
<DeepExtract>
updateSele... | AuroraDroid | positive | 1,886 |
private void deleteFBO() {
LogUtil.logd("deleteFBO(" + mFBOWidth + "x" + mFBOHeight + ")");
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
GLES20.glDeleteFramebuffers(1, mFBO, 0);
LogUtil.logd("deleteTex");
if (mTexFBO.length == 1) {
GLES20.glDeleteTextures(1, mTexFBO, 0);
}
mFBOWidth = mFBOHeight = 0;
} | private void deleteFBO() {
LogUtil.logd("deleteFBO(" + mFBOWidth + "x" + mFBOHeight + ")");
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);
GLES20.glDeleteFramebuffers(1, mFBO, 0);
<DeepExtract>
LogUtil.logd("deleteTex");
if (mTexFBO.length == 1) {
GLES20.glDeleteTextures(1, mTexFBO, 0);
}
</DeepExtract>
mFBOWidth ... | VideoRecorder | positive | 1,887 |
public BaseDAL buildDAL() {
ResolveDataBase resolveDataBase = new SimpleResolveDatabase();
resolveDataBase.setDataSource(dataSource);
if (null != cacheManager) {
resolveDataBase.setCacheManager(cacheManager);
}
CommonJdbcSupport commonJdbcSupport = new CommonJdbcSupport();
commonJdbcSupport.setDataSource(dataSource);
S... | public BaseDAL buildDAL() {
ResolveDataBase resolveDataBase = new SimpleResolveDatabase();
resolveDataBase.setDataSource(dataSource);
if (null != cacheManager) {
resolveDataBase.setCacheManager(cacheManager);
}
CommonJdbcSupport commonJdbcSupport = new CommonJdbcSupport();
commonJdbcSupport.setDataSource(dataSource);
S... | uncode-dal-all | positive | 1,888 |
public static int CCITT_FALSE(@NonNull final byte[] data, final int offset, final int length) {
int crc = 0xFFFF;
for (int i = offset; i < offset + length && i < data.length; ++i) {
final byte b = data[i];
for (int j = 0; j < 8; j++) {
final int k = false ? 7 - j : j;
final boolean bit = ((b >> (7 - k) & 1) == 1);
fina... | public static int CCITT_FALSE(@NonNull final byte[] data, final int offset, final int length) {
<DeepExtract>
int crc = 0xFFFF;
for (int i = offset; i < offset + length && i < data.length; ++i) {
final byte b = data[i];
for (int j = 0; j < 8; j++) {
final int k = false ? 7 - j : j;
final boolean bit = ((b >> (7 - k) & ... | Android-BLE-Common-Library | positive | 1,889 |
void ManyBlocks() {
for (int i = 0; i < 100000; i++) {
Write(NumberString(i));
}
for (int i = 0; i < 100000; i++) {
ASSERT_EQ(NumberString(i), Read());
}
if ("EOF".compareTo(Read()) != 0) {
System.out.println("EOF" + ", " + Read());
} else {
}
} | void ManyBlocks() {
for (int i = 0; i < 100000; i++) {
Write(NumberString(i));
}
for (int i = 0; i < 100000; i++) {
ASSERT_EQ(NumberString(i), Read());
}
<DeepExtract>
if ("EOF".compareTo(Read()) != 0) {
System.out.println("EOF" + ", " + Read());
} else {
}
</DeepExtract>
} | leveldb-java | positive | 1,890 |
public void setRegistrationLockPin(final String registrationLockPin) {
this.registrationLockPin = registrationLockPin;
synchronized (fileChannel) {
var rootNode = jsonProcessor.createObjectNode();
rootNode.put("version", CURRENT_STORAGE_VERSION).put("username", number).put("serviceEnvironment", serviceEnvironment == nu... | public void setRegistrationLockPin(final String registrationLockPin) {
this.registrationLockPin = registrationLockPin;
<DeepExtract>
synchronized (fileChannel) {
var rootNode = jsonProcessor.createObjectNode();
rootNode.put("version", CURRENT_STORAGE_VERSION).put("username", number).put("serviceEnvironment", serviceEnv... | signal-cli | positive | 1,891 |
public void onUserJoined(IrcUser user) {
userList.add(user);
nickUserMap.put(user.nick, user);
user.addObserver(this);
user.register();
if (statusBuffer != null) {
statusBuffer.setTopic(networkName + " (" + currentServer + ") | " + Quasseldroid.applicationContext.getResources().getString(R.string.users) + ": " + userLi... | public void onUserJoined(IrcUser user) {
userList.add(user);
nickUserMap.put(user.nick, user);
user.addObserver(this);
user.register();
<DeepExtract>
if (statusBuffer != null) {
statusBuffer.setTopic(networkName + " (" + currentServer + ") | " + Quasseldroid.applicationContext.getResources().getString(R.string.users) +... | QuasselDroid | positive | 1,893 |
public boolean onSingleTapUp(final MotionEvent motionEvent, final View view) {
if (mLayoutManagerBridge == null)
return onSingleTapUp(motionEvent);
final int scrollDistance = mLayoutManagerBridge.onSingleTapUp(mViewGroup, view);
if (!mScrollAnimator.isFinished())
mScrollAnimator.forceFinished(true);
final boolean isNot... | public boolean onSingleTapUp(final MotionEvent motionEvent, final View view) {
if (mLayoutManagerBridge == null)
return onSingleTapUp(motionEvent);
final int scrollDistance = mLayoutManagerBridge.onSingleTapUp(mViewGroup, view);
<DeepExtract>
if (!mScrollAnimator.isFinished())
mScrollAnimator.forceFinished(true);
final... | parchment | positive | 1,894 |
@Test
public void testCreateMethods() {
final String version = "4.2.1";
final String date = "2014/07/04";
final String buildNumber = "42";
BuildVersion.BuildInfo buildInfo1 = BuildVersion.BuildInfo.create(version);
BuildVersion.BuildInfo buildInfo2 = BuildVersion.BuildInfo.create(version, date);
BuildVersion.BuildInfo ... | @Test
public void testCreateMethods() {
final String version = "4.2.1";
final String date = "2014/07/04";
final String buildNumber = "42";
BuildVersion.BuildInfo buildInfo1 = BuildVersion.BuildInfo.create(version);
BuildVersion.BuildInfo buildInfo2 = BuildVersion.BuildInfo.create(version, date);
BuildVersion.BuildInfo ... | secretshare | positive | 1,895 |
@Override
public void onDrawFrame(GL10 gl10) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
Matrix.multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0);
Matrix.setIdentityM(modelMatrix, 0);
Matrix.rotateM(modelMatrix, 0, -90f, 1f, 0f, 0f);
Matrix.multiplyMM(modelViewProjectionMatrix, 0, viewProjection... | @Override
public void onDrawFrame(GL10 gl10) {
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
Matrix.multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0);
Matrix.setIdentityM(modelMatrix, 0);
Matrix.rotateM(modelMatrix, 0, -90f, 1f, 0f, 0f);
Matrix.multiplyMM(modelViewProjectionMatrix, 0, viewProjection... | OpenGL_Demo | positive | 1,896 |
@Override
public VisitorAction visit(DataField dataField) {
assertEquals(new HashSet<>(Collections.emptyList()), FieldUtil.nameSet(dependencies.get(dataField)));
return super.visit(dataField);
} | @Override
public VisitorAction visit(DataField dataField) {
<DeepExtract>
assertEquals(new HashSet<>(Collections.emptyList()), FieldUtil.nameSet(dependencies.get(dataField)));
</DeepExtract>
return super.visit(dataField);
} | jpmml-converter | positive | 1,897 |
public Velocity getOpposite() {
return new Velocity(x * (short) -1, y * (short) -1, z * (short) -1);
} | public Velocity getOpposite() {
<DeepExtract>
return new Velocity(x * (short) -1, y * (short) -1, z * (short) -1);
</DeepExtract>
} | Angelia-core | positive | 1,898 |
public static <T> Result<T> newFailureResult(CommonBizException commonBizException, T data) {
Result<T> result = new Result<>();
result.isSuccess = false;
result.errorCode = commonBizException.getCodeEnum().getCode();
return message;
result.data = data;
return result;
} | public static <T> Result<T> newFailureResult(CommonBizException commonBizException, T data) {
Result<T> result = new Result<>();
result.isSuccess = false;
result.errorCode = commonBizException.getCodeEnum().getCode();
<DeepExtract>
return message;
</DeepExtract>
result.data = data;
return result;
} | SpringBoot-Dubbo-Docker-Jenkins | positive | 1,899 |
@Test
public void shouldAcquireAndReleaseLocksDuringBackup() throws Exception {
when(fetcher.getItemsForDataType(any(DataType.class), any(ContactGroupIds.class), anyInt())).thenReturn(emptyCursor());
task.doInBackground(config);
verify(service).acquireLocks();
verify(service).releaseLocks();
verify(service).transition(... | @Test
public void shouldAcquireAndReleaseLocksDuringBackup() throws Exception {
<DeepExtract>
when(fetcher.getItemsForDataType(any(DataType.class), any(ContactGroupIds.class), anyInt())).thenReturn(emptyCursor());
</DeepExtract>
task.doInBackground(config);
verify(service).acquireLocks();
verify(service).releaseLocks()... | sms-backup-plus | positive | 1,900 |
public final void writeChars(String s) throws IOException {
int len;
long fileLength = file.length();
if (fileLength < dataEnd) {
len = dataEnd;
} else {
len = fileLength;
}
for (int i = 0; i < len; i++) {
int v = s.charAt(i);
write((v >>> 8) & 0xFF);
write((v) & 0xFF);
}
} | public final void writeChars(String s) throws IOException {
<DeepExtract>
int len;
long fileLength = file.length();
if (fileLength < dataEnd) {
len = dataEnd;
} else {
len = fileLength;
}
</DeepExtract>
for (int i = 0; i < len; i++) {
int v = s.charAt(i);
write((v >>> 8) & 0xFF);
write((v) & 0xFF);
}
} | NomadReader | positive | 1,901 |
public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxage, String encodeString) {
try {
if (cookieValue == null) {
cookieValue = "";
} else if (encodeString) {
cookieValue = URLEncoder.encode(cookieValue, "utf-8");
}
Cookie cookie = ne... | public static void setCookie(HttpServletRequest request, HttpServletResponse response, String cookieName, String cookieValue, int cookieMaxage, String encodeString) {
<DeepExtract>
try {
if (cookieValue == null) {
cookieValue = "";
} else if (encodeString) {
cookieValue = URLEncoder.encode(cookieValue, "utf-8");
}
Cook... | bookstore | positive | 1,902 |
@Override
public void run() {
RequestManager.addRequest(new GsonRequest(Const.WEATHER_CUR + getNextWeatherCode(App.getCurCityIndex()) + ".html", CurWeatherModel.CurWeatherRequestData.class, responseCurListener(), errorListener()), this);
RequestManager.addRequest(new GsonRequest(Const.WEATHER_NOW + getNextWeatherCode(A... | @Override
public void run() {
<DeepExtract>
RequestManager.addRequest(new GsonRequest(Const.WEATHER_CUR + getNextWeatherCode(App.getCurCityIndex()) + ".html", CurWeatherModel.CurWeatherRequestData.class, responseCurListener(), errorListener()), this);
RequestManager.addRequest(new GsonRequest(Const.WEATHER_NOW + getNex... | Sunday | positive | 1,903 |
public void ReInit(SimpleCharStream stream, int lexState) {
ReInit(stream);
if (lexState >= 3 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
} | public void ReInit(SimpleCharStream stream, int lexState) {
ReInit(stream);
<DeepExtract>
if (lexState >= 3 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
else
curLexState = lexState;
</DeepExtract>
} | el-spec | positive | 1,904 |
public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
try {
MessageDigest digest = MessageDigest.getInstance(SHA1);
if (salt != null) {
digest.update(salt);
}
byte[] result = digest.digest(input);
for (int i = 1; i < iterations; i++) {
digest.reset();
result = digest.digest(result);
}
return result;
} ... | public static byte[] sha1(byte[] input, byte[] salt, int iterations) {
<DeepExtract>
try {
MessageDigest digest = MessageDigest.getInstance(SHA1);
if (salt != null) {
digest.update(salt);
}
byte[] result = digest.digest(input);
for (int i = 1; i < iterations; i++) {
digest.reset();
result = digest.digest(result);
}
ret... | springmvc | positive | 1,905 |
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if (!command_enabled("commandUnload", sender))
return;
if (args.length != 0 && args.length != 1 && args.length != 2 && args.length != 4 && args.length != 7) {
throw new WrongUsageException(getUsage(sender));
}
Bl... | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
if (!command_enabled("commandUnload", sender))
return;
if (args.length != 0 && args.length != 1 && args.length != 2 && args.length != 4 && args.length != 7) {
throw new WrongUsageException(getUsage(sender));
}
Bl... | carpetmod112 | positive | 1,906 |
@Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
popupMenu.show(e.getComponent(), e.getX(), e.getY());
}
} | @Override
public void mousePressed(MouseEvent e) {
<DeepExtract>
if (e.isPopupTrigger()) {
popupMenu.show(e.getComponent(), e.getX(), e.getY());
}
</DeepExtract>
} | ifml2 | positive | 1,908 |
public void onClick(View v) {
btnStartServer.setEnabled(true);
btnStopServer.setEnabled(false);
UDPServerEnabled = false;
if (serverUDPSocket != null) {
try {
serverUDPSocket.close();
} catch (Exception e) {
}
}
} | public void onClick(View v) {
<DeepExtract>
btnStartServer.setEnabled(true);
btnStopServer.setEnabled(false);
UDPServerEnabled = false;
if (serverUDPSocket != null) {
try {
serverUDPSocket.close();
} catch (Exception e) {
}
}
</DeepExtract>
} | Android-BME | positive | 1,909 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
accentColor = getIntent().getIntExtra(EXTRA_ACCENT_COLOR, 0);
saveBtn = findViewById(R.id.save_btn);
declineBtn = findViewById(R.id.decline_btn);
name = (TextView) findViewById(R.id.condition_name);
fromText = (TextView) ... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
accentColor = getIntent().getIntExtra(EXTRA_ACCENT_COLOR, 0);
saveBtn = findViewById(R.id.save_btn);
declineBtn = findViewById(R.id.decline_btn);
name = (TextView) findViewById(R.id.condition_name);
fromText = (TextView) ... | clean_app | positive | 1,910 |
@Override
public void parseExclusiveGateway(Element exclusiveGwElement, ScopeImpl scope, ActivityImpl activity) {
if (executionListener != null) {
for (String event : EXECUTION_EVENTS) {
activity.addListener(event, executionListener);
}
}
} | @Override
public void parseExclusiveGateway(Element exclusiveGwElement, ScopeImpl scope, ActivityImpl activity) {
<DeepExtract>
if (executionListener != null) {
for (String event : EXECUTION_EVENTS) {
activity.addListener(event, executionListener);
}
}
</DeepExtract>
} | camunda-bpm-spring-boot-starter | positive | 1,911 |
public InputStream getInputStream() {
this.jdField_for = System.currentTimeMillis();
this.jdField_if = new a(super.getOutputStream());
a();
this.a = new Thread(this, "Timeseal thread");
this.a.start();
} | public InputStream getInputStream() {
<DeepExtract>
this.jdField_for = System.currentTimeMillis();
this.jdField_if = new a(super.getOutputStream());
a();
this.a = new Thread(this, "Timeseal thread");
this.a.start();
</DeepExtract>
} | android-chess | positive | 1,912 |
private void setCurrentLocale(Locale locale) {
if (locale.equals(mCurrentLocale)) {
return;
}
mCurrentLocale = locale;
if (mTempDate == null) {
mTempDate = Calendar.getInstance(locale);
} else {
final long currentTimeMillis = mTempDate.getTimeInMillis();
Calendar newCalendar = Calendar.getInstance(locale);
newCalendar.... | private void setCurrentLocale(Locale locale) {
if (locale.equals(mCurrentLocale)) {
return;
}
mCurrentLocale = locale;
if (mTempDate == null) {
mTempDate = Calendar.getInstance(locale);
} else {
final long currentTimeMillis = mTempDate.getTimeInMillis();
Calendar newCalendar = Calendar.getInstance(locale);
newCalendar.... | Box | positive | 1,913 |
public Criteria andIdBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id between", value1, value2));
return (Criteria) this;
} | public Criteria andIdBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | Online_Study_System | positive | 1,914 |
@Override
public void onError(Throwable e) {
procedure.handle(e);
if (disposable != null) {
disposable.dispose();
}
procedure.hideLoading();
} | @Override
public void onError(Throwable e) {
procedure.handle(e);
if (disposable != null) {
disposable.dispose();
}
<DeepExtract>
procedure.hideLoading();
</DeepExtract>
} | lefastdev | positive | 1,915 |
public void setPassword() {
String content = passwordVar.getText();
if (passwordVisibility) {
content = visPasswordVar.getText();
}
try {
WorldConfig.savePassword(content);
} catch (ConfigurationException e) {
e.printStackTrace();
}
loadedPassword = content;
log.debug("Done");
String password = getPassword();
passwordV... | public void setPassword() {
String content = passwordVar.getText();
if (passwordVisibility) {
content = visPasswordVar.getText();
}
try {
WorldConfig.savePassword(content);
} catch (ConfigurationException e) {
e.printStackTrace();
}
loadedPassword = content;
log.debug("Done");
<DeepExtract>
String password = getPasswor... | fwm | positive | 1,916 |
@Override
public SpringSessionAttributesRecord value3(byte[] value) {
set(2, value);
return this;
} | @Override
public SpringSessionAttributesRecord value3(byte[] value) {
<DeepExtract>
set(2, value);
</DeepExtract>
return this;
} | openvsx | positive | 1,917 |
@Test
public void decode_withIDT001010101_returnsValidMessage() {
InformationRequestMessage msg = interpreter.decode("IDT001010101");
assertNotNull(msg);
assertEquals(DataMemoryMessage.class, msg.getClass());
DataMemoryMessage dataMemoryMessage = (DataMemoryMessage) msg;
assertEquals(1, dataMemoryMessage.getLocation())... | @Test
public void decode_withIDT001010101_returnsValidMessage() {
InformationRequestMessage msg = interpreter.decode("IDT001010101");
assertNotNull(msg);
<DeepExtract>
assertEquals(DataMemoryMessage.class, msg.getClass());
DataMemoryMessage dataMemoryMessage = (DataMemoryMessage) msg;
assertEquals(1, dataMemoryMessage.... | waterrower-core | positive | 1,918 |
public void mousePressed(java.awt.event.MouseEvent evt) {
try {
URL url = new URL("http://wp-cli.org/");
HtmlBrowser.URLDisplayer.getDefault().showURL(url);
} catch (MalformedURLException ex) {
Exceptions.printStackTrace(ex);
}
} | public void mousePressed(java.awt.event.MouseEvent evt) {
<DeepExtract>
try {
URL url = new URL("http://wp-cli.org/");
HtmlBrowser.URLDisplayer.getDefault().showURL(url);
} catch (MalformedURLException ex) {
Exceptions.printStackTrace(ex);
}
</DeepExtract>
} | netbeans-wordpress-plugin | positive | 1,919 |
public void writeFromFlatFileReader(FlatFileReader flatFileReader) throws IOException, FFPojoException {
if (flatFileReader == null || flatFileReader.isClosed()) {
throw new IllegalArgumentException("FlatFileReader object is null or closed");
}
flatFileReader.reset();
for (Object record : flatFileReader) {
this.writeRe... | public void writeFromFlatFileReader(FlatFileReader flatFileReader) throws IOException, FFPojoException {
if (flatFileReader == null || flatFileReader.isClosed()) {
throw new IllegalArgumentException("FlatFileReader object is null or closed");
}
flatFileReader.reset();
for (Object record : flatFileReader) {
this.writeRe... | ffpojo | positive | 1,920 |
public void init(GLAutoDrawable drawable) {
drawable.setGL(new DebugGL2(drawable.getGL().getGL2()));
GL2 gl = drawable.getGL().getGL2();
gl.glEnable(GL2.GL_NORMALIZE);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
gl.glClearDepth(1.0f);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL2.GL_LIGHTING);
gl.glEnable(GL.GL_BLEND);
g... | public void init(GLAutoDrawable drawable) {
drawable.setGL(new DebugGL2(drawable.getGL().getGL2()));
GL2 gl = drawable.getGL().getGL2();
gl.glEnable(GL2.GL_NORMALIZE);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
gl.glClearDepth(1.0f);
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glEnable(GL2.GL_LIGHTING);
gl.glEnable(GL.GL_BLEND);
g... | AdaptiveMerging | positive | 1,921 |
public Criteria andRoleBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "role" + " cannot be null");
}
criteria.add(new Criterion("role between", value1, value2));
return (Criteria) this;
} | public Criteria andRoleBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "role" + " cannot be null");
}
criteria.add(new Criterion("role between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | Examination_System | positive | 1,922 |
public void wechatFavoriteAuthorize() {
Platform wechatFavorite = ShareSDK.getPlatform(WechatFavorite.NAME);
if (wechatFavorite != null) {
wechatFavorite.setPlatformActionListener(myPlatformActionListener);
if (wechatFavorite.isAuthValid()) {
wechatFavorite.removeAccount(true);
return;
}
wechatFavorite.authorize();
}
} | public void wechatFavoriteAuthorize() {
Platform wechatFavorite = ShareSDK.getPlatform(WechatFavorite.NAME);
<DeepExtract>
if (wechatFavorite != null) {
wechatFavorite.setPlatformActionListener(myPlatformActionListener);
if (wechatFavorite.isAuthValid()) {
wechatFavorite.removeAccount(true);
return;
}
wechatFavorite.au... | ShareSDK-for-Android | positive | 1,923 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
step();
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
step();
</DeepExtract>
} | drmips | positive | 1,926 |
public final void nextNonNegativeLongs(long[] buf, int offset, int length) {
at = (at + 7) & ~7;
while (length > 0) {
if (at >= page)
readPage();
int n = (page - at) / 8;
if (n > length)
n = length;
dataLongs.position(at / 8);
dataLongs.get(buf, offset, n);
at += n * 8;
offset += n;
length -= n;
}
for (int i = 0; i < l... | public final void nextNonNegativeLongs(long[] buf, int offset, int length) {
<DeepExtract>
at = (at + 7) & ~7;
while (length > 0) {
if (at >= page)
readPage();
int n = (page - at) / 8;
if (n > length)
n = length;
dataLongs.position(at / 8);
dataLongs.get(buf, offset, n);
at += n * 8;
offset += n;
length -= n;
}
</DeepE... | kiss | positive | 1,927 |
public static void stopServer() {
if (!isServerUp()) {
return;
}
metrics.removeMatching(bookKeeperMetrics.getMetricsFilter());
if (localServer != null) {
try {
bookKeeperMetrics.close();
} catch (IOException e) {
log.error("Metrics reporters could not be closed", e);
}
localServer.stop();
}
} | public static void stopServer() {
if (!isServerUp()) {
return;
}
<DeepExtract>
metrics.removeMatching(bookKeeperMetrics.getMetricsFilter());
</DeepExtract>
if (localServer != null) {
try {
bookKeeperMetrics.close();
} catch (IOException e) {
log.error("Metrics reporters could not be closed", e);
}
localServer.stop();
}... | rubix | positive | 1,928 |
private stmtType astForFlowStmt(Node n) {
try {
assert (n.dfaType == DFAType.flow_stmt);
} catch (PyExceptions e) {
throw new PyExceptions(ErrorType.AST_ERROR, "AST Error", n);
}
Node ch = n.getChild(0);
switch(ch.dfaType) {
case break_stmt:
return new Break(n.lineNo, n.colOffset);
case continue_stmt:
return new Contin... | private stmtType astForFlowStmt(Node n) {
<DeepExtract>
try {
assert (n.dfaType == DFAType.flow_stmt);
} catch (PyExceptions e) {
throw new PyExceptions(ErrorType.AST_ERROR, "AST Error", n);
}
</DeepExtract>
Node ch = n.getChild(0);
switch(ch.dfaType) {
case break_stmt:
return new Break(n.lineNo, n.colOffset);
case con... | JPython | positive | 1,929 |
public ImmersionBar navigationBarColor(String navigationBarColor, @FloatRange(from = 0f, to = 1f) float navigationAlpha) {
mBarParams.navigationBarColor = Color.parseColor(navigationBarColor);
mBarParams.navigationBarAlpha = navigationAlpha;
return this;
} | public ImmersionBar navigationBarColor(String navigationBarColor, @FloatRange(from = 0f, to = 1f) float navigationAlpha) {
<DeepExtract>
mBarParams.navigationBarColor = Color.parseColor(navigationBarColor);
mBarParams.navigationBarAlpha = navigationAlpha;
return this;
</DeepExtract>
} | MNImageBrowser | positive | 1,930 |
@Override
protected void onNightTurnTimeout(LGPlayer player) {
inMenu = false;
player.getPlayer().closeInventory();
player.hideView();
player.sendActionBarMessage("§6Tu rejoins le §a§lVillage.");
player.sendMessage("§6Tu rejoins le §a§lVillage.");
} | @Override
protected void onNightTurnTimeout(LGPlayer player) {
<DeepExtract>
inMenu = false;
player.getPlayer().closeInventory();
</DeepExtract>
player.hideView();
player.sendActionBarMessage("§6Tu rejoins le §a§lVillage.");
player.sendMessage("§6Tu rejoins le §a§lVillage.");
} | LoupGarou | positive | 1,931 |
public void setGIFResource(int resId) {
this.gifId = resId;
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
InputStream is = getContext().getResources().openRawResource(gifId);
mMovie = Movie.decodeStream(is);
} | public void setGIFResource(int resId) {
this.gifId = resId;
<DeepExtract>
setLayerType(View.LAYER_TYPE_SOFTWARE, null);
InputStream is = getContext().getResources().openRawResource(gifId);
mMovie = Movie.decodeStream(is);
</DeepExtract>
} | Trycorder5 | positive | 1,932 |
public void notHome() {
if (VERBOSE)
Log.d(TAG, "The phone is not in the home");
if (_homeState == HomeState.HOME) {
Intent i = new Intent();
i.setAction(LOCATION_UPDATE);
i.putExtra("state", StateChange.LEAVING_HOME);
_backgroundService.sendBroadcast(i);
}
_homeState = HomeState.NOT_HOME;
_settings.setPhoneIsInHome(fa... | public void notHome() {
<DeepExtract>
if (VERBOSE)
Log.d(TAG, "The phone is not in the home");
</DeepExtract>
if (_homeState == HomeState.HOME) {
Intent i = new Intent();
i.setAction(LOCATION_UPDATE);
i.putExtra("state", StateChange.LEAVING_HOME);
_backgroundService.sendBroadcast(i);
}
_homeState = HomeState.NOT_HOME;
... | android-wmon | positive | 1,933 |
@Override
public List<String> getRolesForUser(String name) {
try {
READ_WRITE_LOCK.readLock().lock();
return () -> super.getRolesForUser(name).get();
} finally {
READ_WRITE_LOCK.readLock().unlock();
}
} | @Override
public List<String> getRolesForUser(String name) {
<DeepExtract>
try {
READ_WRITE_LOCK.readLock().lock();
return () -> super.getRolesForUser(name).get();
} finally {
READ_WRITE_LOCK.readLock().unlock();
}
</DeepExtract>
} | jcasbin | positive | 1,934 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setCanScrollX();
int widthMiddle = getMeasuredWidth() / 2;
scrollTo(-widthMiddle, 0);
} | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
<DeepExtract>
setCanScrollX();
int widthMiddle = getMeasuredWidth() / 2;
scrollTo(-widthMiddle, 0);
</DeepExtract>
} | AduioRecordUI | positive | 1,935 |
@Override
public void onError() {
if (mContentView == null) {
throw new NullPointerException("The content view not set..");
}
if (!mErrorAdded) {
initAddedLayout();
if (mErrorView != null) {
rlAddedView.addView(mErrorView, mLayoutParams);
mErrorAdded = true;
}
}
dtvLoading.hideAndStop();
showViewWithStatus(LayoutStatus... | @Override
public void onError() {
<DeepExtract>
if (mContentView == null) {
throw new NullPointerException("The content view not set..");
}
</DeepExtract>
if (!mErrorAdded) {
initAddedLayout();
if (mErrorView != null) {
rlAddedView.addView(mErrorView, mLayoutParams);
mErrorAdded = true;
}
}
dtvLoading.hideAndStop();
sh... | InterviewQA | positive | 1,936 |
@Override
public PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, PendingIntent callbackIntent) {
throwIfNotConnected(client);
requestManager.requestLocationUpdates(client, request, callbackIntent);
clientManager.addPendingIntent(client, request, callbackIntent);
try {
service... | @Override
public PendingResult<Status> requestLocationUpdates(LostApiClient client, LocationRequest request, PendingIntent callbackIntent) {
throwIfNotConnected(client);
requestManager.requestLocationUpdates(client, request, callbackIntent);
clientManager.addPendingIntent(client, request, callbackIntent);
<DeepExtract>... | lost | positive | 1,937 |
public static String getExternalFileDir(Context context, String customPath) {
String path = context.getExternalFilesDir("") + formatPath(customPath);
File file = new File(path);
if (!(file.exists() && file.isDirectory())) {
file.mkdirs();
}
return path;
} | public static String getExternalFileDir(Context context, String customPath) {
String path = context.getExternalFilesDir("") + formatPath(customPath);
<DeepExtract>
File file = new File(path);
if (!(file.exists() && file.isDirectory())) {
file.mkdirs();
}
</DeepExtract>
return path;
} | Better | positive | 1,938 |
public byte[] getName() {
if (name != null)
return getBytes(name);
byte[] argument;
if (objects[0] == null) {
argument = EMPTY_BYTES;
} else if (objects[0] instanceof byte[]) {
argument = (byte[]) objects[0];
} else if (objects[0] instanceof ByteBuf) {
argument = ((ByteBuf) objects[0]).array();
} else if (objects[0] in... | public byte[] getName() {
if (name != null)
return getBytes(name);
<DeepExtract>
byte[] argument;
if (objects[0] == null) {
argument = EMPTY_BYTES;
} else if (objects[0] instanceof byte[]) {
argument = (byte[]) objects[0];
} else if (objects[0] instanceof ByteBuf) {
argument = ((ByteBuf) objects[0]).array();
} else if ... | hanbo-db | positive | 1,939 |
@Override
protected void onSetInitialValue(Object defaultValue) {
if (defaultValue == null) {
defaultValue = 0;
}
setValueInternal(getPersistedInt((Integer) defaultValue), true);
} | @Override
protected void onSetInitialValue(Object defaultValue) {
if (defaultValue == null) {
defaultValue = 0;
}
<DeepExtract>
setValueInternal(getPersistedInt((Integer) defaultValue), true);
</DeepExtract>
} | SamsungOneUi | positive | 1,940 |
@Override
public void run() {
mID = new Random().randomBytes(16);
mKey = new Random().randomBytes(SodiumConstants.XSALSA20_POLY1305_SECRETBOX_KEYBYTES);
mBox = new SecretBox(mKey);
Map<String, Object> data = new HashMap<>();
data.put("key", mKey);
data.put("box", mBox);
mArchive.put(Numeric.toHexString(mID), data);
mOn... | @Override
public void run() {
<DeepExtract>
mID = new Random().randomBytes(16);
mKey = new Random().randomBytes(SodiumConstants.XSALSA20_POLY1305_SECRETBOX_KEYBYTES);
mBox = new SecretBox(mKey);
Map<String, Object> data = new HashMap<>();
data.put("key", mKey);
data.put("box", mBox);
mArchive.put(Numeric.toHexString(mI... | autobahn-java | positive | 1,941 |
public static Object sendPacket(SkungeePacket packet) throws IllegalAccessException {
if (isBungeecord())
throw new IllegalAccessException("A SkungeePacket may only be sent on a Spigot implementation, try BungeePacket.");
SkungeeAPI.sendPacket(build(), packet);
} | public static Object sendPacket(SkungeePacket packet) throws IllegalAccessException {
if (isBungeecord())
throw new IllegalAccessException("A SkungeePacket may only be sent on a Spigot implementation, try BungeePacket.");
<DeepExtract>
SkungeeAPI.sendPacket(build(), packet);
</DeepExtract>
} | Skungee | positive | 1,942 |
@Override
public void onClick(View view) {
if (mAuthTask != null) {
return;
}
mUsernameView.setError(null);
mPasswordView.setError(null);
String username = mUsernameView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
if (!TextUtils.isEmpty(pass... | @Override
public void onClick(View view) {
<DeepExtract>
if (mAuthTask != null) {
return;
}
mUsernameView.setError(null);
mPasswordView.setError(null);
String username = mUsernameView.getText().toString();
String password = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
if (!TextUtil... | pivaa | positive | 1,943 |
@Test
public void noChangesWhenDriverNameNotFound() {
final Builder<RuleSetBuilder, DecisionTreeRuleSet> ruleSetBuilder = RuleSetBuilder.creator("commissions", Arrays.asList("EXMETHOD", "EXCHANGE", "PRODUCT", "REGION", "ASSET"));
if (CollectionUtils.isNotEmpty(null)) {
ruleSetBuilder.with(RuleSetBuilder::groups, null);... | @Test
public void noChangesWhenDriverNameNotFound() {
<DeepExtract>
final Builder<RuleSetBuilder, DecisionTreeRuleSet> ruleSetBuilder = RuleSetBuilder.creator("commissions", Arrays.asList("EXMETHOD", "EXCHANGE", "PRODUCT", "REGION", "ASSET"));
if (CollectionUtils.isNotEmpty(null)) {
ruleSetBuilder.with(RuleSetBuilder::... | swblocks-decisiontree | positive | 1,944 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
AddCanonicizerSelection();
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
AddCanonicizerSelection();
</DeepExtract>
} | JGAAP | positive | 1,946 |
public void insertData(int offset, String arg) throws DOMException {
if (offset < adaptee.start || adaptee.start + offset >= adaptee.end) {
throw new DOMException(DOMException.INDEX_SIZE_ERR, "Invalid offset");
}
StringBuilder sb = new StringBuilder(getNodeValue());
sb.insert(offset, arg);
setNodeValue(sb.toString());
... | public void insertData(int offset, String arg) throws DOMException {
if (offset < adaptee.start || adaptee.start + offset >= adaptee.end) {
throw new DOMException(DOMException.INDEX_SIZE_ERR, "Invalid offset");
}
StringBuilder sb = new StringBuilder(getNodeValue());
sb.insert(offset, arg);
<DeepExtract>
setNodeValue(sb... | jtidy | positive | 1,948 |
@Test
public void deleteNode1() {
expected = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
input = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
k = 1;
input.get(input.length() - k + 1).insertAfter(new ListNode<>(10));
DeleteKthLastNode.deleteNode(input, k);
LinkedListUtil.assertSameList(expected, input);
} | @Test
public void deleteNode1() {
expected = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
input = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
k = 1;
<DeepExtract>
input.get(input.length() - k + 1).insertAfter(new ListNode<>(10));
DeleteKthLastNode.deleteNode(input, k);
LinkedListUtil.assertSameList(expected, inp... | Elements-of-programming-interviews | positive | 1,949 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (_h5py_.isSelected() == true) {
if (_PIP_REPO_.isSelected() == true) {
str_python_h5py = " h5py ";
} else {
str_python_h5py = " python-h5py ";
}
} else {
str_python_h5py = " ";
}
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
if (_h5py_.isSelected() == true) {
if (_PIP_REPO_.isSelected() == true) {
str_python_h5py = " h5py ";
} else {
str_python_h5py = " python-h5py ";
}
} else {
str_python_h5py = " ";
}
</DeepExtract>
} | ERSN-OpenMC | positive | 1,950 |
@Override
protected void finalize() throws Throwable {
final File imageFile = new File(getContext().getCacheDir() + File.separator + IMAGE_FILE_NAME);
imageFile.delete();
super.finalize();
} | @Override
protected void finalize() throws Throwable {
<DeepExtract>
final File imageFile = new File(getContext().getCacheDir() + File.separator + IMAGE_FILE_NAME);
imageFile.delete();
</DeepExtract>
super.finalize();
} | xl-image_utils_lib-android | positive | 1,951 |
@Test
public void reportsErrorOnMoreThanOneReturnStatement() throws Exception {
MatcherAssert.assertThat(this.runValidation("ReturnCount.java", false), Matchers.hasItem(new ViolationMatcher("Return count is 2 (max allowed for non-void methods/lambdas is 1)", "ReturnCount.java")));
} | @Test
public void reportsErrorOnMoreThanOneReturnStatement() throws Exception {
<DeepExtract>
MatcherAssert.assertThat(this.runValidation("ReturnCount.java", false), Matchers.hasItem(new ViolationMatcher("Return count is 2 (max allowed for non-void methods/lambdas is 1)", "ReturnCount.java")));
</DeepExtract>
} | qulice | positive | 1,952 |
public void setValue(int y) {
if (Looper.myLooper() != Looper.getMainLooper()) {
throw new RuntimeException();
}
if (y > mConfig.rangeEnd || y < mConfig.rangeStart) {
throw new IllegalArgumentException(String.format("y = %d, not in [%d, %d]", y, mConfig.rangeStart, mConfig.rangeEnd));
}
float ratio = 1.0f * Math.abs(mC... | public void setValue(int y) {
if (Looper.myLooper() != Looper.getMainLooper()) {
throw new RuntimeException();
}
if (y > mConfig.rangeEnd || y < mConfig.rangeStart) {
throw new IllegalArgumentException(String.format("y = %d, not in [%d, %d]", y, mConfig.rangeStart, mConfig.rangeEnd));
}
float ratio = 1.0f * Math.abs(mC... | Android-BluetoothKit | positive | 1,953 |
private static void registerCakes() {
final String carrotcakeName = "carrotcake";
final String cheesecakeName = "cheesecake";
final String cherrycheesecakeName = "cherrycheesecake";
final String chocolatesprinklecakeName = "chocolatesprinklecake";
final String holidaycakeName = "holidaycake";
final String lamingtoncake... | private static void registerCakes() {
final String carrotcakeName = "carrotcake";
final String cheesecakeName = "cheesecake";
final String cherrycheesecakeName = "cherrycheesecake";
final String chocolatesprinklecakeName = "chocolatesprinklecake";
final String holidaycakeName = "holidaycake";
final String lamingtoncake... | harvestcraft | positive | 1,954 |
public boolean isPositionVisible(final int col, final int row, final HexRect2D rect, final boolean accurately) {
float cellX;
switch(this.orientation) {
case ORIENTATION_HORIZONTAL:
{
cellX = col * (this.scaledCellWidth - this.scaledOffsetForEdgeSide);
}
case ORIENTATION_VERTICAL:
{
cellX = (col * this.scaledCellWidth)... | public boolean isPositionVisible(final int col, final int row, final HexRect2D rect, final boolean accurately) {
float cellX;
switch(this.orientation) {
case ORIENTATION_HORIZONTAL:
{
cellX = col * (this.scaledCellWidth - this.scaledOffsetForEdgeSide);
}
case ORIENTATION_VERTICAL:
{
cellX = (col * this.scaledCellWidth)... | jhexed | positive | 1,955 |
@Test
public void testMulipleAttributeKeys() throws Exception {
final Map<Serializable, Set<IPersonAttributes>> cacheMap = new HashMap<>();
final Set<String> keyAttrs = new HashSet<>();
keyAttrs.add("name.first");
keyAttrs.add("name.last");
var dao = new CachingPersonAttributeDaoImpl();
dao.setCachedPersonAttributesDao... | @Test
public void testMulipleAttributeKeys() throws Exception {
final Map<Serializable, Set<IPersonAttributes>> cacheMap = new HashMap<>();
final Set<String> keyAttrs = new HashSet<>();
keyAttrs.add("name.first");
keyAttrs.add("name.last");
var dao = new CachingPersonAttributeDaoImpl();
dao.setCachedPersonAttributesDao... | person-directory | positive | 1,956 |
@Override
public void unset(Collection<Key<?>> keys) {
return current.without(keys);
return current.without(keys);
removed.addAll(keys);
} | @Override
public void unset(Collection<Key<?>> keys) {
<DeepExtract>
return current.without(keys);
</DeepExtract>
return current.without(keys);
removed.addAll(keys);
} | octarine | positive | 1,957 |
public String toDelimitedString(String delimiter) {
StringBuilder sb = new StringBuilder(columns * size());
if (header != null) {
accumulateRow(sb, delimiter, header);
sb.append('\n');
}
for (Row row : this) {
accumulateRow(sb, delimiter, row);
sb.append('\n');
}
sb.deleteCharAt(sb.length() - 1);
return toFormattedStri... | public String toDelimitedString(String delimiter) {
StringBuilder sb = new StringBuilder(columns * size());
if (header != null) {
accumulateRow(sb, delimiter, header);
sb.append('\n');
}
for (Row row : this) {
accumulateRow(sb, delimiter, row);
sb.append('\n');
}
sb.deleteCharAt(sb.length() - 1);
<DeepExtract>
return t... | Azzet | positive | 1,958 |
@Override
public Printer<?> getPrinter(DateFormat annotation, Class<?> fieldType) {
DateFormatter formatter = new DateFormatter();
formatter.setFormat(annotation.format());
return formatter;
} | @Override
public Printer<?> getPrinter(DateFormat annotation, Class<?> fieldType) {
<DeepExtract>
DateFormatter formatter = new DateFormatter();
formatter.setFormat(annotation.format());
return formatter;
</DeepExtract>
} | spring-mvc-examples | positive | 1,959 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.