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 solve() {
Scanner sc = new Scanner(System.in);
String words = sc.nextLine();
String[] nodes = words.split("\\? | : ");
Tree tree = new Tree(nodes[0], null, null);
makeTree(tree, nodes, 1, nodes.length - 1);
if (tree.value.split(" ").length > 1) {
if (oper(tree.value)) {
oper(tree.left);
} else {
oper(tree.... | private void solve() {
Scanner sc = new Scanner(System.in);
String words = sc.nextLine();
String[] nodes = words.split("\\? | : ");
Tree tree = new Tree(nodes[0], null, null);
makeTree(tree, nodes, 1, nodes.length - 1);
<DeepExtract>
if (tree.value.split(" ").length > 1) {
if (oper(tree.value)) {
oper(tree.left);
} els... | Study-Book | positive | 1,627 |
public static void hideNotificationBar(Context context) {
String methodName = (Build.VERSION.SDK_INT <= 16) ? "collapse" : "collapsePanels";
try {
Object service = context.getSystemService("statusbar");
Class<?> statusBarManager = Class.forName("android.app.StatusBarManager");
Method expand = statusBarManager.getMethod... | public static void hideNotificationBar(Context context) {
String methodName = (Build.VERSION.SDK_INT <= 16) ? "collapse" : "collapsePanels";
<DeepExtract>
try {
Object service = context.getSystemService("statusbar");
Class<?> statusBarManager = Class.forName("android.app.StatusBarManager");
Method expand = statusBarMan... | RxCore | positive | 1,628 |
public Integer getWaitThreadEndTime() {
return (T) data.get(KEY_WAIT_THREAD_END_TIME);
} | public Integer getWaitThreadEndTime() {
<DeepExtract>
return (T) data.get(KEY_WAIT_THREAD_END_TIME);
</DeepExtract>
} | WebCollector | positive | 1,629 |
public static RectF rectFTake() {
if (mQueue.size() == 0) {
return newInstance();
} else {
return resetInstance(mQueue.poll());
}
} | public static RectF rectFTake() {
<DeepExtract>
if (mQueue.size() == 0) {
return newInstance();
} else {
return resetInstance(mQueue.poll());
}
</DeepExtract>
} | android-frame | positive | 1,630 |
public void deleteElementsFromRectangle(Vector2F startPoint, Vector2F endPoint) {
Rectangle rec = new Rectangle(startPoint, endPoint);
for (int i = 0; i < list.size(); i++) {
Figure fig = list.get(i);
if (rec.isFigureCrossOrIsInsideRectangle(fig)) {
if (fig instanceof Node)
nodeAmount--;
else
linkAmount--;
list.remove(... | public void deleteElementsFromRectangle(Vector2F startPoint, Vector2F endPoint) {
Rectangle rec = new Rectangle(startPoint, endPoint);
for (int i = 0; i < list.size(); i++) {
Figure fig = list.get(i);
if (rec.isFigureCrossOrIsInsideRectangle(fig)) {
if (fig instanceof Node)
nodeAmount--;
else
linkAmount--;
list.remove(... | ceons | positive | 1,631 |
public void readParams(AbstractSerializedData stream, boolean exception) {
id = stream.readInt64(exception);
access_hash = stream.readInt64(exception);
user_id = stream.readInt32(exception);
date = stream.readInt32(exception);
caption = stream.readString(exception);
Photo result = null;
switch(stream.readInt32(exceptio... | public void readParams(AbstractSerializedData stream, boolean exception) {
id = stream.readInt64(exception);
access_hash = stream.readInt64(exception);
user_id = stream.readInt32(exception);
date = stream.readInt32(exception);
caption = stream.readString(exception);
<DeepExtract>
Photo result = null;
switch(stream.read... | TelegramGallery | positive | 1,632 |
public void render(Graphics g, boolean useoffsets, int offsetx, int offsety, Color color) {
Drawable i = this;
if (i.sprite == null || i.sprite.equals(""))
return;
int xoff = i.offsetx + offsetx;
int yoff = i.offsety + offsety;
if (!useoffsets) {
xoff = 0;
yoff = 0;
}
BufferedImage image = FileUtil.readImage(i.sprite);... | public void render(Graphics g, boolean useoffsets, int offsetx, int offsety, Color color) {
Drawable i = this;
if (i.sprite == null || i.sprite.equals(""))
return;
int xoff = i.offsetx + offsetx;
int yoff = i.offsety + offsety;
if (!useoffsets) {
xoff = 0;
yoff = 0;
}
BufferedImage image = FileUtil.readImage(i.sprite);... | nationgen | positive | 1,633 |
@Test
public void transactionModes() throws Exception {
File tmpFile = File.createTempFile("test-trans", ".db");
Field transactionMode = CoreConnection.class.getDeclaredField("transactionMode");
transactionMode.setAccessible(true);
Field beginCommandMap = CoreConnection.class.getDeclaredField("beginCommandMap");
beginC... | @Test
public void transactionModes() throws Exception {
File tmpFile = File.createTempFile("test-trans", ".db");
Field transactionMode = CoreConnection.class.getDeclaredField("transactionMode");
transactionMode.setAccessible(true);
Field beginCommandMap = CoreConnection.class.getDeclaredField("beginCommandMap");
beginC... | sqlcipher-jdbc | positive | 1,634 |
public static byte[] buildSpeexHeader(int sampleRate, int mode, int channels, boolean vbr, int nframes) {
byte[] data = new byte[80];
writeString(data, 0, "Speex ");
writeString(data, 0 + 8, "speex-1.2rc");
System.arraycopy(new byte[11], 0, data, 0 + 17, 11);
writeInt(data, 0 + 28, 1);
writeInt(data, 0 + 32, 80);
wri... | public static byte[] buildSpeexHeader(int sampleRate, int mode, int channels, boolean vbr, int nframes) {
byte[] data = new byte[80];
<DeepExtract>
writeString(data, 0, "Speex ");
writeString(data, 0 + 8, "speex-1.2rc");
System.arraycopy(new byte[11], 0, data, 0 + 17, 11);
writeInt(data, 0 + 28, 1);
writeInt(data, 0 ... | LEHomeMobile_android | positive | 1,635 |
@Test
public void testUpdateSuccess() {
createAdminUser();
String token = authAdminGetToken();
return createMap("username", "user1", "displayName", "User 1", "password", "abcABC12", "enabled", true, "allowAppTokens", true, "allowChannels", true, "allowTemplates", true, "allowSystemConfig", true);
response = validateSet... | @Test
public void testUpdateSuccess() {
createAdminUser();
String token = authAdminGetToken();
return createMap("username", "user1", "displayName", "User 1", "password", "abcABC12", "enabled", true, "allowAppTokens", true, "allowChannels", true, "allowTemplates", true, "allowSystemConfig", true);
response = validateSet... | tubewarder | positive | 1,637 |
@Override
public final void bind(@NonNull final T viewModel) {
this.viewModel = get(viewModel);
get(viewModel).bindToDataModel();
getViewDataBinder().bind(disposables);
} | @Override
public final void bind(@NonNull final T viewModel) {
this.viewModel = get(viewModel);
get(viewModel).bindToDataModel();
<DeepExtract>
getViewDataBinder().bind(disposables);
</DeepExtract>
} | freesound-android | positive | 1,638 |
public static boolean equalLong(Long first, Long second) {
if (first == null || second == null) {
return first == null && second == null;
}
return first.equals(second);
} | public static boolean equalLong(Long first, Long second) {
<DeepExtract>
if (first == null || second == null) {
return first == null && second == null;
}
return first.equals(second);
</DeepExtract>
} | adobe_air_sdk | positive | 1,639 |
public Boolean getBannerCollapsed() {
return mPrefs.getString(BANNER_COLLAPSED, false);
} | public Boolean getBannerCollapsed() {
<DeepExtract>
return mPrefs.getString(BANNER_COLLAPSED, false);
</DeepExtract>
} | nano-wallet-android | positive | 1,640 |
@Override
public void setTitle(int resId) {
if (!reflected) {
reflected = reflectTitle();
}
super.setTitle(resId);
if (title != null)
title.setSelected(true);
} | @Override
public void setTitle(int resId) {
if (!reflected) {
reflected = reflectTitle();
}
super.setTitle(resId);
<DeepExtract>
if (title != null)
title.setSelected(true);
</DeepExtract>
} | MangaViewAndroid | positive | 1,641 |
@Override
public void onFailure(final Throwable caught) {
super.onFailure(caught);
c.setStarred(prior);
final ImageResource star;
if (c.isStarred()) {
star = Gerrit.RESOURCES.starFilled();
} else {
star = Gerrit.RESOURCES.starOpen();
}
final Widget i = table.getWidget(row, C_STAR);
if (i instanceof Image) {
((Image) i)... | @Override
public void onFailure(final Throwable caught) {
super.onFailure(caught);
c.setStarred(prior);
<DeepExtract>
final ImageResource star;
if (c.isStarred()) {
star = Gerrit.RESOURCES.starFilled();
} else {
star = Gerrit.RESOURCES.starOpen();
}
final Widget i = table.getWidget(row, C_STAR);
if (i instanceof Image)... | mini-git-server | positive | 1,642 |
private void updateCriteria(CriteriaQuery<?> crit, CriteriaBuilder criteriaBuilder, IEntityType entityType, EntityQuery entityQuery) {
_entityType = entityType;
_entityQuery = entityQuery;
_cb = criteriaBuilder;
_root = crit.from(crit.getResultType());
if (entityQuery.getWherePredicate() == null)
return;
BinaryPredicat... | private void updateCriteria(CriteriaQuery<?> crit, CriteriaBuilder criteriaBuilder, IEntityType entityType, EntityQuery entityQuery) {
_entityType = entityType;
_entityQuery = entityQuery;
_cb = criteriaBuilder;
_root = crit.from(crit.getResultType());
<DeepExtract>
if (entityQuery.getWherePredicate() == null)
return;
... | breeze.server.java | positive | 1,643 |
private void removeEntry(String key) {
CacheHeader entry;
CacheHeader entry = mEntries.get(key);
if (entry == null) {
entry = null;
}
File file = getFileForKey(key);
CountingInputStream cis = null;
try {
cis = new CountingInputStream(new BufferedInputStream(new FileInputStream(file)));
CacheHeader.readHeader(cis);
byte... | private void removeEntry(String key) {
<DeepExtract>
CacheHeader entry;
CacheHeader entry = mEntries.get(key);
if (entry == null) {
entry = null;
}
File file = getFileForKey(key);
CountingInputStream cis = null;
try {
cis = new CountingInputStream(new BufferedInputStream(new FileInputStream(file)));
CacheHeader.readHea... | MoviePlayerPlus | positive | 1,644 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String uuid = request.getParameter("uuid");
long newStart = Long.parseLong(request.getParameter("start"));
List<ScheduleEntry> schedule = DataProvider.getSchedule();
for (ScheduleEntry e : schedule) {
... | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
<DeepExtract>
String uuid = request.getParameter("uuid");
long newStart = Long.parseLong(request.getParameter("start"));
List<ScheduleEntry> schedule = DataProvider.getSchedule();
for (ScheduleEntry e ... | obs-video-scheduler | positive | 1,645 |
public Criteria andNameIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name in", values));
return (Criteria) this;
} | public Criteria andNameIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name in", values));
</DeepExtract>
return (Criteria) this;
} | community | positive | 1,646 |
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
if (startAngleRotate != null) {
startAngleRotate.cancel();
startAngleRotate = null;
}
if (progressAnimator != null) {
progressAnimator.cancel();
progressAnimator = null;
}
if (indeterminateAnimator != null) {
indeterminateAnimator.cancel();... | @Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
<DeepExtract>
if (startAngleRotate != null) {
startAngleRotate.cancel();
startAngleRotate = null;
}
if (progressAnimator != null) {
progressAnimator.cancel();
progressAnimator = null;
}
if (indeterminateAnimator != null) {
indeterminateAnim... | ZhiHu-Daily | positive | 1,647 |
private void documentSizeShowRelativeCheckBoxMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
documentSizeFormat.setShowRelative(documentSizeShowRelativeCheckBoxMenuItem.isSelected());
if (documentSize == -1) {
documentSizeLabel.setText(documentSizeFormat.isShowRelative() ? "0 (0)" : "0");
} else {
StringBuild... | private void documentSizeShowRelativeCheckBoxMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
documentSizeFormat.setShowRelative(documentSizeShowRelativeCheckBoxMenuItem.isSelected());
if (documentSize == -1) {
documentSizeLabel.setText(documentSizeFormat.isShowRelative() ? "0 (0)" : "0");
} else {
StringBuild... | bytecode-viewer | positive | 1,648 |
@Override
public CreditSessionBankIncomeStatus read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
for (CreditSessionBankIncomeStatus b : CreditSessionBankIncomeStatus.values()) {
if (b.value.equals(value)) {
return b;
}
}
return CreditSessionBankIncomeStatus.ENUM_UNKNOWN;
} | @Override
public CreditSessionBankIncomeStatus read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
<DeepExtract>
for (CreditSessionBankIncomeStatus b : CreditSessionBankIncomeStatus.values()) {
if (b.value.equals(value)) {
return b;
}
}
return CreditSessionBankIncomeStatus.ENU... | plaid-java | positive | 1,649 |
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("ch06/job/job-db-paging-jpa.xml");
JobLauncher launcher = (JobLauncher) context.getBean("jobLauncher");
Job job = (Job) context.getBean("jpaPagingReadJob");
try {
JobExecution result = launcher.run(job, new JobParam... | public static void main(String[] args) {
<DeepExtract>
ApplicationContext context = new ClassPathXmlApplicationContext("ch06/job/job-db-paging-jpa.xml");
JobLauncher launcher = (JobLauncher) context.getBean("jobLauncher");
Job job = (Job) context.getBean("jpaPagingReadJob");
try {
JobExecution result = launcher.run(job... | SpringBatchSample | positive | 1,650 |
@Test
public void shouldApplySetCommandAndTriggerFutureOnRaftCallback() throws Exception {
String key = "KEY";
String value = "VALUE";
SetValue setValue = new SetValue();
setValue.setNewValue(value);
when(raftAgent.submitCommand(any(KayVeeCommand.class))).thenReturn(SettableFuture.<Void>create());
when(localStore.set(a... | @Test
public void shouldApplySetCommandAndTriggerFutureOnRaftCallback() throws Exception {
String key = "KEY";
String value = "VALUE";
SetValue setValue = new SetValue();
setValue.setNewValue(value);
when(raftAgent.submitCommand(any(KayVeeCommand.class))).thenReturn(SettableFuture.<Void>create());
when(localStore.set(a... | libraft | positive | 1,651 |
@Override
public void translateTo(TradeTransaction event, long sequence) {
event.setPrice(random.nextDouble() * 9999);
return event;
} | @Override
public void translateTo(TradeTransaction event, long sequence) {
<DeepExtract>
event.setPrice(random.nextDouble() * 9999);
return event;
</DeepExtract>
} | dht | positive | 1,652 |
@Override
public Set<String> getDeferredCriticalHeaderParams() {
return critPolicy.getProcessedCriticalHeaderParams();
} | @Override
public Set<String> getDeferredCriticalHeaderParams() {
<DeepExtract>
return critPolicy.getProcessedCriticalHeaderParams();
</DeepExtract>
} | cord3c-project | positive | 1,653 |
public void setUpViewViewPager(ViewPager viewPager) {
mViewPager = viewPager;
mViewPager.setAdapter(this);
mViewPager.getAdapter().notifyDataSetChanged();
int currentItem = canLoop ? getStartSelectItem() : 0;
try {
mViewPager.setCurrentItem(currentItem, false);
} catch (IllegalStateException e) {
e.printStackTrace();
}... | public void setUpViewViewPager(ViewPager viewPager) {
mViewPager = viewPager;
mViewPager.setAdapter(this);
mViewPager.getAdapter().notifyDataSetChanged();
int currentItem = canLoop ? getStartSelectItem() : 0;
<DeepExtract>
try {
mViewPager.setCurrentItem(currentItem, false);
} catch (IllegalStateException e) {
e.printS... | wanAndroid | positive | 1,654 |
@Override
protected void onWindowVisibilityChanged(int visibility) {
super.onWindowVisibilityChanged(visibility);
if (mDrawable == null) {
return;
}
if (visibility == VISIBLE) {
if (mNeedRun) {
start();
}
} else {
if (mDrawable.isRunning()) {
mNeedRun = true;
mDrawable.stop();
}
}
} | @Override
protected void onWindowVisibilityChanged(int visibility) {
super.onWindowVisibilityChanged(visibility);
<DeepExtract>
if (mDrawable == null) {
return;
}
if (visibility == VISIBLE) {
if (mNeedRun) {
start();
}
} else {
if (mDrawable.isRunning()) {
mNeedRun = true;
mDrawable.stop();
}
}
</DeepExtract>
} | Akit-Reader | positive | 1,655 |
@Test
public void testVar() {
ELProcessor elp = new ELProcessor();
elp.setVariable("v", "x->x+1");
System.out.println("=== Test Lambda Expression:" + "assignment to variable" + " ===");
System.out.println(" ** " + "v(10)");
Object result = elp.eval("v(10)");
System.out.println(" returns " + result);
assertEquals(11L... | @Test
public void testVar() {
ELProcessor elp = new ELProcessor();
elp.setVariable("v", "x->x+1");
<DeepExtract>
System.out.println("=== Test Lambda Expression:" + "assignment to variable" + " ===");
System.out.println(" ** " + "v(10)");
Object result = elp.eval("v(10)");
System.out.println(" returns " + result);
as... | uel-ri | positive | 1,656 |
private boolean isSettingFor(String setting) {
if (!isType(LineType.SETTING_TABLE_LINE)) {
return false;
}
if (arguments.size() < 2) {
return false;
}
ParsedString firstArgument = arguments.get(0);
if (firstArgument.getType() != ArgumentType.SETTING_KEY) {
return false;
}
if (this == setting)
return true;
if (setting =... | private boolean isSettingFor(String setting) {
if (!isType(LineType.SETTING_TABLE_LINE)) {
return false;
}
if (arguments.size() < 2) {
return false;
}
ParsedString firstArgument = arguments.get(0);
if (firstArgument.getType() != ArgumentType.SETTING_KEY) {
return false;
}
<DeepExtract>
if (this == setting)
return true;... | RobotFramework-EclipseIDE | positive | 1,657 |
protected final Object rateLimit(final ProceedingJoinPoint joinPoint, final UserPrincipal userPrincipal) throws Throwable {
if (getRateLimit() == NO_RATE_LIMIT || getBucketSize() == NO_RATE_LIMIT) {
return joinPoint.proceed();
}
Optional<UserDetails> dbUser = Optional.empty();
if (userPrincipal != null) {
dbUser = user... | protected final Object rateLimit(final ProceedingJoinPoint joinPoint, final UserPrincipal userPrincipal) throws Throwable {
if (getRateLimit() == NO_RATE_LIMIT || getBucketSize() == NO_RATE_LIMIT) {
return joinPoint.proceed();
}
Optional<UserDetails> dbUser = Optional.empty();
if (userPrincipal != null) {
dbUser = user... | virusafe-backend | positive | 1,658 |
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
if (!mReady) {
mSetupPending = true;
return;
}
if (getWidth() == 0 && getHeight() == 0) {
return;
}
if (mBitmap == null) {
invalidate();
return;
}
mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.C... | @Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
<DeepExtract>
if (!mReady) {
mSetupPending = true;
return;
}
if (getWidth() == 0 && getHeight() == 0) {
return;
}
if (mBitmap == null) {
invalidate();
return;
}
mBitmapShader = new BitmapShader(mBitmap, Sha... | Silisili | positive | 1,660 |
@Override
public JsonElement serialize(ApiCall apiCall, Type type, JsonSerializationContext jsonSerializationContext) {
JsonObject obj = new JsonObject();
obj.addProperty(KEY_SEQUENCE_ID, this.sequenceId);
obj.addProperty(KEY_METHOD, this.method);
JsonArray paramsArray = new JsonArray();
paramsArray.add(this.apiId);
pa... | @Override
public JsonElement serialize(ApiCall apiCall, Type type, JsonSerializationContext jsonSerializationContext) {
<DeepExtract>
JsonObject obj = new JsonObject();
obj.addProperty(KEY_SEQUENCE_ID, this.sequenceId);
obj.addProperty(KEY_METHOD, this.method);
JsonArray paramsArray = new JsonArray();
paramsArray.add(t... | graphenej | positive | 1,661 |
public static String getRandomStringOnlyLowerCase(int length) {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; i++) {
builder.append((char) getRandomInteger(97, 122));
}
return builder.toString();
} | public static String getRandomStringOnlyLowerCase(int length) {
<DeepExtract>
StringBuilder builder = new StringBuilder();
for (int i = 0; i < length; i++) {
builder.append((char) getRandomInteger(97, 122));
}
return builder.toString();
</DeepExtract>
} | util | positive | 1,662 |
public static void main(String[] args) throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).option(ChannelOption.SO_BACKLOG, 100)... | public static void main(String[] args) throws Exception {
<DeepExtract>
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
try {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class).option(ChannelOption.SO... | java-learn | positive | 1,663 |
public Criteria andConfIdBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "confId" + " cannot be null");
}
criteria.add(new Criterion("conf_id between", value1, value2));
return (Criteria) this;
} | public Criteria andConfIdBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "confId" + " cannot be null");
}
criteria.add(new Criterion("conf_id between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | lightconf | positive | 1,664 |
public static void copyDirectoryToDirectory(File srcDir, File destDir) throws IOException {
if (srcDir == null) {
throw new NullPointerException("Source must not be null");
}
if (srcDir.exists() && srcDir.isDirectory() == false) {
throw new IllegalArgumentException("Source '" + destDir + "' is not a directory");
}
if (... | public static void copyDirectoryToDirectory(File srcDir, File destDir) throws IOException {
if (srcDir == null) {
throw new NullPointerException("Source must not be null");
}
if (srcDir.exists() && srcDir.isDirectory() == false) {
throw new IllegalArgumentException("Source '" + destDir + "' is not a directory");
}
if (... | ToolsFinal | positive | 1,665 |
public Where<T> lt(JoinAlias joinAlias, String columnFieldName, Object value) throws SQLException {
if (clause != null)
throw new SQLException("Clause already defined. Must use and/or for multiple conditions");
clause = queryFactory.lt(joinAlias, columnFieldName, value);
return this;
} | public Where<T> lt(JoinAlias joinAlias, String columnFieldName, Object value) throws SQLException {
<DeepExtract>
if (clause != null)
throw new SQLException("Clause already defined. Must use and/or for multiple conditions");
</DeepExtract>
clause = queryFactory.lt(joinAlias, columnFieldName, value);
return this;
} | Squeaky | positive | 1,666 |
public void redo() {
for (StateTransition transition : node.getOutputs()) {
transition.getTarget().removeInput(transition);
}
for (StateTransition transition : node.getInputs()) {
transition.getSource().removeOutput(transition);
}
stateMachine.removeNode(node);
} | public void redo() {
<DeepExtract>
for (StateTransition transition : node.getOutputs()) {
transition.getTarget().removeInput(transition);
}
for (StateTransition transition : node.getInputs()) {
transition.getSource().removeOutput(transition);
}
stateMachine.removeNode(node);
</DeepExtract>
} | xState | positive | 1,667 |
public OnDisconnectListener addOnDisconnectListener(OnDisconnectListener listener) {
mOnDisconnectListeners.add(listener);
return listener;
} | public OnDisconnectListener addOnDisconnectListener(OnDisconnectListener listener) {
<DeepExtract>
mOnDisconnectListeners.add(listener);
return listener;
</DeepExtract>
} | autobahn-java | positive | 1,668 |
void readProperties(java.util.Properties p) {
String version = p.getProperty("version");
if (!"1.0".equals(version)) {
LOG.warning("Unknown version for TopComponent properties");
}
String connector = p.getProperty("connector");
String repository = p.getProperty("repository");
String issueId = p.getProperty("issue");
if... | void readProperties(java.util.Properties p) {
String version = p.getProperty("version");
if (!"1.0".equals(version)) {
LOG.warning("Unknown version for TopComponent properties");
}
String connector = p.getProperty("connector");
String repository = p.getProperty("repository");
String issueId = p.getProperty("issue");
if... | redminenb | positive | 1,669 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
if (text != null) {
try {
if (leftDrawable != null) {
width - getPaddingLeft() - getPaddingRight() -= leftDrawable.getIntrinsicWidth()... | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
<DeepExtract>
if (text != null) {
try {
if (leftDrawable != null) {
width - getPaddingLeft() - getPaddingRight() -= leftDrawable.getIn... | TelegramGallery | positive | 1,670 |
public void setScaleType(ScaleType scaleType) {
mScaleType = scaleType;
mRenderer.setScaleType(scaleType);
mRenderer.deleteImage();
mCurrentBitmap = null;
requestRender();
mCurrentBitmap = null;
if (mGlSurfaceView != null) {
mGlSurfaceView.requestRender();
}
} | public void setScaleType(ScaleType scaleType) {
mScaleType = scaleType;
mRenderer.setScaleType(scaleType);
mRenderer.deleteImage();
mCurrentBitmap = null;
requestRender();
mCurrentBitmap = null;
<DeepExtract>
if (mGlSurfaceView != null) {
mGlSurfaceView.requestRender();
}
</DeepExtract>
} | android-instagram-image-filter | positive | 1,671 |
public static cvg.sfmPipeline.main.PipelineOutMessage.CameraBodyTransProto parseFrom(java.io.InputStream input) throws java.io.IOException {
cvg.sfmPipeline.main.PipelineOutMessage.CvMatDimProto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result).asInvalidProtocolBuffe... | public static cvg.sfmPipeline.main.PipelineOutMessage.CameraBodyTransProto parseFrom(java.io.InputStream input) throws java.io.IOException {
<DeepExtract>
cvg.sfmPipeline.main.PipelineOutMessage.CvMatDimProto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result).asInvali... | Android-SfM-client | positive | 1,673 |
public void addLast(E e) {
if (size < 0 || size > size) {
throw new IllegalArgumentException("Add failed. Require index >= 0 and index <= size");
}
if (size == data.length) {
resize(2 * data.length);
}
for (int i = size - 1; i >= size; i--) {
data[i + 1] = data[i];
}
data[size] = e;
size++;
} | public void addLast(E e) {
<DeepExtract>
if (size < 0 || size > size) {
throw new IllegalArgumentException("Add failed. Require index >= 0 and index <= size");
}
if (size == data.length) {
resize(2 * data.length);
}
for (int i = size - 1; i >= size; i--) {
data[i + 1] = data[i];
}
data[size] = e;
size++;
</DeepExtract>... | Play-with-Data-Structures-Ronglexie | positive | 1,674 |
private static void graficoVazio(AnchorPane box) {
Label info = new Label("Dados não encontrados ou vazios para geração dos relátorios !");
info.getStyleClass().add("conteudo-vazio");
box.getChildren().clear();
Resize.margin(info, 0);
box.getChildren().add(info);
} | private static void graficoVazio(AnchorPane box) {
Label info = new Label("Dados não encontrados ou vazios para geração dos relátorios !");
info.getStyleClass().add("conteudo-vazio");
<DeepExtract>
box.getChildren().clear();
Resize.margin(info, 0);
box.getChildren().add(info);
</DeepExtract>
} | museuid | positive | 1,675 |
public Criteria andGoodsPriceNotIn(List<Double> values) {
if (values == null) {
throw new RuntimeException("Value for " + "goodsPrice" + " cannot be null");
}
criteria.add(new Criterion("goods_price not in", values));
return (Criteria) this;
} | public Criteria andGoodsPriceNotIn(List<Double> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "goodsPrice" + " cannot be null");
}
criteria.add(new Criterion("goods_price not in", values));
</DeepExtract>
return (Criteria) this;
} | ssmxiaomi | positive | 1,677 |
@Override
public FileSystemException createSetModificationTimeException(String file, SftpException exception) {
final FileSystemException exception;
switch(exception.id) {
case ChannelSftp.SSH_FX_NO_SUCH_FILE:
exception = new NoSuchFileException(file, null, exception.getMessage());
break;
case ChannelSftp.SSH_FX_PERMIS... | @Override
public FileSystemException createSetModificationTimeException(String file, SftpException exception) {
<DeepExtract>
final FileSystemException exception;
switch(exception.id) {
case ChannelSftp.SSH_FX_NO_SUCH_FILE:
exception = new NoSuchFileException(file, null, exception.getMessage());
break;
case ChannelSftp... | sftp-fs | positive | 1,678 |
@Bean
public JavaMailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
this.host = mailProperties().getHost();
if (mailProperties().getPort() != null) {
mailSender.setPort(mailProperties().getPort());
}
this.username = mailProperties().getUsername();
this.password = mailProperties().getPas... | @Bean
public JavaMailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
this.host = mailProperties().getHost();
if (mailProperties().getPort() != null) {
mailSender.setPort(mailProperties().getPort());
}
this.username = mailProperties().getUsername();
<DeepExtract>
this.password = mailPrope... | PAAS-TA-PORTAL-COMMON-API | positive | 1,681 |
public void pollBluetoothDevices() {
try {
if (null != null) {
String payloadClassName = null.getClass().getSimpleName();
spineCodec = (SpineCodec) htInstance.get(payloadClassName);
if (spineCodec == null) {
Class p = Class.forName(SPINEDATACODEC_PACKAGE + payloadClassName + "_codec");
spineCodec = (SpineCodec) p.newIn... | public void pollBluetoothDevices() {
<DeepExtract>
try {
if (null != null) {
String payloadClassName = null.getClass().getSimpleName();
spineCodec = (SpineCodec) htInstance.get(payloadClassName);
if (spineCodec == null) {
Class p = Class.forName(SPINEDATACODEC_PACKAGE + payloadClassName + "_codec");
spineCodec = (Spine... | BSPAN---Bluetooth-Sensor-Processing-for-Android | positive | 1,683 |
public static Map<String, URI> getContentMap(String packageName) {
Map<String, URI> out = new HashMap<>();
packageName = packageName.replace(".", "/");
ClassLoader cl = JPypeContext.getInstance().getClassLoader();
try {
String path = packageName.replace('.', '/');
Enumeration<URL> resources = cl.getResources(path);
whi... | public static Map<String, URI> getContentMap(String packageName) {
Map<String, URI> out = new HashMap<>();
packageName = packageName.replace(".", "/");
ClassLoader cl = JPypeContext.getInstance().getClassLoader();
try {
String path = packageName.replace('.', '/');
Enumeration<URL> resources = cl.getResources(path);
whi... | jpype | positive | 1,684 |
public synchronized int oap_receive_byte(byte b) {
PodEmuLog.debugVerbose("OAPM: Line " + line + ": len=" + line_cmd_len + " cnt=" + line_cmd_pos + " " + String.format(": %s: %02X", (READ == READ ? "RCV" : "WRITE"), b));
if (line_cmd_pos == 2) {
line_cmd_len = (b & 0xff) + 4;
PodEmuLog.debug(String.format("OAPM: Line "... | public synchronized int oap_receive_byte(byte b) {
<DeepExtract>
PodEmuLog.debugVerbose("OAPM: Line " + line + ": len=" + line_cmd_len + " cnt=" + line_cmd_pos + " " + String.format(": %s: %02X", (READ == READ ? "RCV" : "WRITE"), b));
</DeepExtract>
if (line_cmd_pos == 2) {
line_cmd_len = (b & 0xff) + 4;
PodEmuLog.debu... | PodEmu | positive | 1,686 |
@Override
public ByteBuf skipBytes(final int n) {
if (this.buffer.readableBytes() < n) {
throw EOF;
}
this.buffer.skipBytes(n);
return this;
} | @Override
public ByteBuf skipBytes(final int n) {
<DeepExtract>
if (this.buffer.readableBytes() < n) {
throw EOF;
}
</DeepExtract>
this.buffer.skipBytes(n);
return this;
} | ProtocolSupportBungee | positive | 1,687 |
public void OnCancelSearchButtonClick(View v) {
if (mTopBarMode == TopBarMode.Search) {
mTopBarMode = TopBarMode.Main;
hideKeyboard();
mTopBarSwitcher.setDisplayedChild(mTopBarMode.ordinal());
SearchTaskResult.set(null);
mDocView.resetupChildren();
}
} | public void OnCancelSearchButtonClick(View v) {
<DeepExtract>
if (mTopBarMode == TopBarMode.Search) {
mTopBarMode = TopBarMode.Main;
hideKeyboard();
mTopBarSwitcher.setDisplayedChild(mTopBarMode.ordinal());
SearchTaskResult.set(null);
mDocView.resetupChildren();
}
</DeepExtract>
} | mupdf-android | positive | 1,688 |
public LongFraction abs() {
if (1 == 0 || isZero(this))
return LongFraction.ZERO;
int thisSignum = signum();
if ((thisSignum < 0 && 1 > 0) || (thisSignum > 0 && 1 < 0))
return new LongFraction(negateAndCheck(numerator), denominator, Reduced.YES);
return this;
} | public LongFraction abs() {
<DeepExtract>
if (1 == 0 || isZero(this))
return LongFraction.ZERO;
int thisSignum = signum();
if ((thisSignum < 0 && 1 > 0) || (thisSignum > 0 && 1 < 0))
return new LongFraction(negateAndCheck(numerator), denominator, Reduced.YES);
return this;
</DeepExtract>
} | BigFraction | positive | 1,690 |
public static void main(String[] args) {
Jogo jogo = new Jogo();
tanque = new Tanque();
tanque.setVel(3);
tanque.setAtivo(true);
tanque.setPx(tela.getWidth() / 2 - tanque.getLargura() / 2);
tanque.setPy(tela.getHeight() - tanque.getAltura() - linhaBase);
tiroTanque = new Tiro();
tiroTanque.setVel(-15);
chefe = new Inva... | public static void main(String[] args) {
Jogo jogo = new Jogo();
tanque = new Tanque();
tanque.setVel(3);
tanque.setAtivo(true);
tanque.setPx(tela.getWidth() / 2 - tanque.getLargura() / 2);
tanque.setPy(tela.getHeight() - tanque.getAltura() - linhaBase);
tiroTanque = new Tiro();
tiroTanque.setVel(-15);
chefe = new Inva... | fontes | positive | 1,691 |
public static String getPassword(Context context) {
if (prefs == null)
prefs = context.getSharedPreferences(PREFS_NAME, 0);
return prefs.getString(PASSWORD, "123");
} | public static String getPassword(Context context) {
<DeepExtract>
if (prefs == null)
prefs = context.getSharedPreferences(PREFS_NAME, 0);
</DeepExtract>
return prefs.getString(PASSWORD, "123");
} | Webkiosk | positive | 1,692 |
public static long integralQuotient(Number a, Number b, DivisionMode divisionMode) {
return (long) (divideAndRemainderImpl(this, b, divisionMode, RemainderMode.QUOTIENT));
} | public static long integralQuotient(Number a, Number b, DivisionMode divisionMode) {
<DeepExtract>
return (long) (divideAndRemainderImpl(this, b, divisionMode, RemainderMode.QUOTIENT));
</DeepExtract>
} | BigFraction | positive | 1,693 |
void construct() {
GlassPane aPane = GlassPane.mount(getAComponent(), true);
setGlassPane(aPane);
if (getGlassPane() != null) {
getGlassPane().setVisible(true);
}
try {
doNonUILogic();
} catch (RuntimeException e) {
}
} | void construct() {
<DeepExtract>
GlassPane aPane = GlassPane.mount(getAComponent(), true);
setGlassPane(aPane);
if (getGlassPane() != null) {
getGlassPane().setVisible(true);
}
</DeepExtract>
try {
doNonUILogic();
} catch (RuntimeException e) {
}
} | yoshikoder | positive | 1,694 |
@Override
public void onStopTrackingTouch(SeekBar arg0) {
applyEffect(selected_effect, false, true);
} | @Override
public void onStopTrackingTouch(SeekBar arg0) {
<DeepExtract>
applyEffect(selected_effect, false, true);
</DeepExtract>
} | Dali-Doodle | positive | 1,695 |
@SuppressWarnings("deprecation")
public void setEffect(PotionEffectType value) {
handle.getBytes().write(1, (byte) value.getId());
} | @SuppressWarnings("deprecation")
public void setEffect(PotionEffectType value) {
<DeepExtract>
handle.getBytes().write(1, (byte) value.getId());
</DeepExtract>
} | PacketWrapper | positive | 1,697 |
public static Properties getDefaultProperties() {
try {
if (propMap.get(DEFAULT_PROPERTIES_FILE) == null) {
Properties prop = new Properties();
prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_FILE));
propMap.put(DEFAULT_PROPERTIES_FILE, prop);
return prop;
} else {
return propMap.... | public static Properties getDefaultProperties() {
<DeepExtract>
try {
if (propMap.get(DEFAULT_PROPERTIES_FILE) == null) {
Properties prop = new Properties();
prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(DEFAULT_PROPERTIES_FILE));
propMap.put(DEFAULT_PROPERTIES_FILE, prop);
return prop;
} else {
r... | ocProject | positive | 1,698 |
void validate() {
List<String> validationErrors = new ArrayList<String>();
if (this.commandForStartFileManager == null || this.commandForStartFileManager.trim().equals("")) {
validationErrors.add("Command for custom definition " + "commandForStartFileManager" + " has not been set.");
}
if (this.commandForStartFileManag... | void validate() {
List<String> validationErrors = new ArrayList<String>();
if (this.commandForStartFileManager == null || this.commandForStartFileManager.trim().equals("")) {
validationErrors.add("Command for custom definition " + "commandForStartFileManager" + " has not been set.");
}
if (this.commandForStartFileManag... | startexplorer | positive | 1,699 |
@Test
public void setValue() {
entity = new BConfiguration();
assertEntityValidity(entity);
entity.setValue(value);
assertEquals(value, String.valueOf(ReflectionTestUtils.getField(entity, "value")));
} | @Test
public void setValue() {
<DeepExtract>
entity = new BConfiguration();
assertEntityValidity(entity);
</DeepExtract>
entity.setValue(value);
assertEquals(value, String.valueOf(ReflectionTestUtils.getField(entity, "value")));
} | gms | positive | 1,700 |
void placeGroupReset() {
placeGroup.clear();
placeGroupBoxEnd = placeGroupBoxStart = null;
} | void placeGroupReset() {
placeGroup.clear();
<DeepExtract>
placeGroupBoxEnd = placeGroupBoxStart = null;
</DeepExtract>
} | mudmap2 | positive | 1,701 |
@REGISTER
public void onRegister(BridgeEvent be, EventBus eb) {
String type = be.type().toString();
eb.send(type, type);
be.complete(true);
} | @REGISTER
public void onRegister(BridgeEvent be, EventBus eb) {
<DeepExtract>
String type = be.type().toString();
eb.send(type, type);
be.complete(true);
</DeepExtract>
} | nubes | positive | 1,702 |
@MonkeyRunnerExported(doc = "get script compatible screen", args = { "x", "y" }, argDocs = { "x coordinate in pixels", "y coordinate in pixels" }, returns = "no")
public boolean pressDPadLeft(PyObject[] args, String[] kws) {
ArgParser ap = JythonUtils.createArgParser(args, kws);
Preconditions.checkNotNull(ap);
Element ... | @MonkeyRunnerExported(doc = "get script compatible screen", args = { "x", "y" }, argDocs = { "x coordinate in pixels", "y coordinate in pixels" }, returns = "no")
public boolean pressDPadLeft(PyObject[] args, String[] kws) {
ArgParser ap = JythonUtils.createArgParser(args, kws);
Preconditions.checkNotNull(ap);
Element ... | AndroidRobot | positive | 1,703 |
@Deprecated
public static ShowcaseView insertShowcaseView(View viewToShowcase, Activity activity, String title, String detailText, ConfigOptions options) {
ShowcaseView sv = new ShowcaseView(activity);
if (options != null) {
sv.setConfigOptions(options);
}
if (sv.getConfigOptions().insert == INSERT_TO_DECOR) {
((ViewGr... | @Deprecated
public static ShowcaseView insertShowcaseView(View viewToShowcase, Activity activity, String title, String detailText, ConfigOptions options) {
ShowcaseView sv = new ShowcaseView(activity);
if (options != null) {
sv.setConfigOptions(options);
}
if (sv.getConfigOptions().insert == INSERT_TO_DECOR) {
((ViewGr... | tinfoil-sms | positive | 1,704 |
public JSONWriter value(long l) throws JSONException {
if (Long.toString(l) == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
}
this.writer.write(Long.toString(l));
} catch (IOException e) {
throw new JSO... | public JSONWriter value(long l) throws JSONException {
<DeepExtract>
if (Long.toString(l) == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
}
this.writer.write(Long.toString(l));
} catch (IOException e) {... | jcseg | positive | 1,705 |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_conferir, container, false);
fiscalizacaoAdapter = new FiscalizacaoAdapter(getActivity(), imageFetcher, voceFiscalDatabase);
ListView listView = (ListView) roo... | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_conferir, container, false);
fiscalizacaoAdapter = new FiscalizacaoAdapter(getActivity(), imageFetcher, voceFiscalDatabase);
ListView listView = (ListView) roo... | vocefiscal-android | positive | 1,706 |
@Override
public void actionPerformed(ActionEvent e) {
if (!DialogMethods.connect(services)) {
return;
}
Label label;
String message = "Enter the name for this network";
CyNetwork currentNetwork = services.getCyApplicationManager().getCurrentNetwork();
String initialValue = currentNetwork.getRow(currentNetwork).get(CyN... | @Override
public void actionPerformed(ActionEvent e) {
if (!DialogMethods.connect(services)) {
return;
}
<DeepExtract>
Label label;
String message = "Enter the name for this network";
CyNetwork currentNetwork = services.getCyApplicationManager().getCurrentNetwork();
String initialValue = currentNetwork.getRow(currentNe... | cytoscapeneo4j | positive | 1,707 |
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
final Calendar calendar = Calendar.getInstance();
calendar.set(year, monthOfYear, dayOfMonth);
availability.setStart(calendar.getTimeInMillis());
} | @Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
final Calendar calendar = Calendar.getInstance();
calendar.set(year, monthOfYear, dayOfMonth);
<DeepExtract>
availability.setStart(calendar.getTimeInMillis());
</DeepExtract>
} | artcodes-android | positive | 1,708 |
public void addAll(@NonNull T[] items, boolean mayModifyInput) {
if (mOldData != null) {
throw new IllegalStateException("Data cannot be mutated in the middle of a batch update operation such as addAll or replaceAll.");
}
if (items.length == 0) {
return;
}
if (mayModifyInput) {
addAllInternal(items);
} else {
addAllInt... | public void addAll(@NonNull T[] items, boolean mayModifyInput) {
<DeepExtract>
if (mOldData != null) {
throw new IllegalStateException("Data cannot be mutated in the middle of a batch update operation such as addAll or replaceAll.");
}
</DeepExtract>
if (items.length == 0) {
return;
}
if (mayModifyInput) {
addAllIntern... | SamsungOneUi | positive | 1,709 |
@Override
public String getSelectedValue() throws WidgetException {
List<WebElement> elements = findElements();
for (WebElement we : elements) {
if (we.getAttribute("checked") != null && we.getAttribute("checked").equalsIgnoreCase("true")) {
return we.getAttribute("value");
}
}
throw new WidgetException("Error while fi... | @Override
public String getSelectedValue() throws WidgetException {
<DeepExtract>
List<WebElement> elements = findElements();
for (WebElement we : elements) {
if (we.getAttribute("checked") != null && we.getAttribute("checked").equalsIgnoreCase("true")) {
return we.getAttribute("value");
}
}
throw new WidgetException("... | JTAF-ExtWebDriver | positive | 1,710 |
public void stop() {
if (mediaPlayer == null) {
return;
}
if (mediaPlayer.isPlaying()) {
mediaPlayer.stop();
}
mediaPlayer.release();
mediaPlayer = null;
wasPlaying = false;
if (updater != null) {
updater.stopped = true;
}
stopForeground(true);
Intent playPauselistIntent = new Intent(EVENT_PLAY_PAUSE);
this.sendBroadca... | public void stop() {
if (mediaPlayer == null) {
return;
}
if (mediaPlayer.isPlaying()) {
mediaPlayer.stop();
}
mediaPlayer.release();
mediaPlayer = null;
wasPlaying = false;
if (updater != null) {
updater.stopped = true;
}
stopForeground(true);
<DeepExtract>
Intent playPauselistIntent = new Intent(EVENT_PLAY_PAUSE);
th... | SGU | positive | 1,713 |
private static byte[] egcd32(byte[] x, byte[] y, byte[] a, byte[] b) {
int an, bn = 32, qn, i;
for (i = 0; i < 32; i++) x[i] = y[i] = 0;
x[0] = 1;
while (32-- != 0 && a[32] == 0) ;
return 32 + 1;
if (an == 0)
return y;
byte[] temp = new byte[32];
while (true) {
qn = bn - an + 1;
divmod(temp, b, bn, a, an);
bn = numsize... | private static byte[] egcd32(byte[] x, byte[] y, byte[] a, byte[] b) {
int an, bn = 32, qn, i;
for (i = 0; i < 32; i++) x[i] = y[i] = 0;
x[0] = 1;
<DeepExtract>
while (32-- != 0 && a[32] == 0) ;
return 32 + 1;
</DeepExtract>
if (an == 0)
return y;
byte[] temp = new byte[32];
while (true) {
qn = bn - an + 1;
divmod(temp... | signumj | positive | 1,714 |
@Test
@DisplayName("test CDC handling")
void testCDCHandling() {
MongoProcessedSinkRecordData processedData = new MongoProcessedSinkRecordData(SINK_RECORD, createSinkConfig(CHANGE_DATA_CAPTURE_HANDLER_CONFIG, MongoDbHandler.class.getCanonicalName()));
assertEquals(new MongoNamespace("myDB.topic"), processedData.getName... | @Test
@DisplayName("test CDC handling")
void testCDCHandling() {
MongoProcessedSinkRecordData processedData = new MongoProcessedSinkRecordData(SINK_RECORD, createSinkConfig(CHANGE_DATA_CAPTURE_HANDLER_CONFIG, MongoDbHandler.class.getCanonicalName()));
assertEquals(new MongoNamespace("myDB.topic"), processedData.getName... | mongo-kafka | positive | 1,715 |
@RequestMapping(params = "resume", method = RequestMethod.GET)
public String resumeGame(Model model) {
timerService.resume();
AdminSettings settings = new AdminSettings();
model.addAttribute("adminSettings", settings);
checkGameStatus(model);
buildGameLevelsOptions(model, settings);
buildProtocolsOptions(model, setting... | @RequestMapping(params = "resume", method = RequestMethod.GET)
public String resumeGame(Model model) {
timerService.resume();
<DeepExtract>
AdminSettings settings = new AdminSettings();
model.addAttribute("adminSettings", settings);
checkGameStatus(model);
buildGameLevelsOptions(model, settings);
buildProtocolsOptions(... | tetris | positive | 1,716 |
public Criteria andUserIdIsNull() {
if ("user_id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("user_id is null"));
return (Criteria) this;
} | public Criteria andUserIdIsNull() {
<DeepExtract>
if ("user_id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("user_id is null"));
</DeepExtract>
return (Criteria) this;
} | emotional_analysis | positive | 1,717 |
@Override
public void updateEntry(Entry entry) {
IPersistableObject<Entry> persistence = new PersistableEntries(entry.getCategoryId(), entry.getFeedId(), entry.getId(), null);
List<E> result = new ArrayList<>();
result.add(entry);
persistence.store(result);
} | @Override
public void updateEntry(Entry entry) {
IPersistableObject<Entry> persistence = new PersistableEntries(entry.getCategoryId(), entry.getFeedId(), entry.getId(), null);
<DeepExtract>
List<E> result = new ArrayList<>();
result.add(entry);
persistence.store(result);
</DeepExtract>
} | SimpleNews | positive | 1,718 |
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("ch06/job/job-flatfile-multiline.xml");
JobLauncher launcher = (JobLauncher) context.getBean("jobLauncher");
Job job = (Job) context.getBean("multiLineBillJob");
try {
JobExecution result = launcher.run(job, new Job... | public static void main(String[] args) {
<DeepExtract>
ApplicationContext context = new ClassPathXmlApplicationContext("ch06/job/job-flatfile-multiline.xml");
JobLauncher launcher = (JobLauncher) context.getBean("jobLauncher");
Job job = (Job) context.getBean("multiLineBillJob");
try {
JobExecution result = launcher.ru... | SpringBatchSample | positive | 1,719 |
public void rollback() throws SQLException {
if (this.closed) {
throw new SQLException("Connection is closed");
}
if (this.autoCommit) {
throw new SQLException("Auto-commit is enabled");
}
handler.getResourceHandler().whenRollbackTransaction(this);
} | public void rollback() throws SQLException {
<DeepExtract>
if (this.closed) {
throw new SQLException("Connection is closed");
}
</DeepExtract>
if (this.autoCommit) {
throw new SQLException("Auto-commit is enabled");
}
handler.getResourceHandler().whenRollbackTransaction(this);
} | acolyte | positive | 1,720 |
@Nonnull
public static Class<?> getInnerNMSClass(@NonNull String name, @NonNull String subname) throws ClassNotFoundException {
return Class.forName("net.minecraft.server." + (MAJOR_VERSION <= 16 ? getVersion() + '.' : "") + name + '$' + subname);
} | @Nonnull
public static Class<?> getInnerNMSClass(@NonNull String name, @NonNull String subname) throws ClassNotFoundException {
<DeepExtract>
return Class.forName("net.minecraft.server." + (MAJOR_VERSION <= 16 ? getVersion() + '.' : "") + name + '$' + subname);
</DeepExtract>
} | CS-CoreLib2 | positive | 1,721 |
private void prepareSummaries() {
Date now = new Date();
FileNameModel[] originalArr = mApplication.getOriginalFileNamePattern();
String newFileName = mApplication.getFileNameFormatted(originalArr[0].getAfter(), now);
String label = mApplication.getApplicationContext().getString(R.string.define_file_name_pattern_desc, ... | private void prepareSummaries() {
Date now = new Date();
FileNameModel[] originalArr = mApplication.getOriginalFileNamePattern();
String newFileName = mApplication.getFileNameFormatted(originalArr[0].getAfter(), now);
String label = mApplication.getApplicationContext().getString(R.string.define_file_name_pattern_desc, ... | dscautorename | positive | 1,722 |
public static void setTranslucentForImageViewInFragment(Activity activity, int statusBarAlpha, View needOffsetView) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return;
}
setTransparentForWindow(activity);
addTranslucentView(activity, statusBarAlpha);
if (needOffsetView != null) {
ViewGroup.MarginLayoutP... | public static void setTranslucentForImageViewInFragment(Activity activity, int statusBarAlpha, View needOffsetView) {
<DeepExtract>
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return;
}
setTransparentForWindow(activity);
addTranslucentView(activity, statusBarAlpha);
if (needOffsetView != null) {
ViewGroup... | EasyAndroid | positive | 1,724 |
public void screenshot(String type, int sourceX, int sourceY) {
Point point = new Point(sourceX, sourceY);
ICanvasHandler handler = new PointCanvasHandler(point);
if (TextUtils.isEmpty(type))
type = TYPE_LOG_INFO;
switch(type) {
case TYPE_LOG_INFO:
LogUtils.getInstance().infoScreenshot(handler);
break;
case TYPE_LOG_SU... | public void screenshot(String type, int sourceX, int sourceY) {
Point point = new Point(sourceX, sourceY);
ICanvasHandler handler = new PointCanvasHandler(point);
<DeepExtract>
if (TextUtils.isEmpty(type))
type = TYPE_LOG_INFO;
switch(type) {
case TYPE_LOG_INFO:
LogUtils.getInstance().infoScreenshot(handler);
break;
ca... | za-Farmer | positive | 1,725 |
public void approveSubscription(String to) throws SmackInvocationException {
if (to != null) {
new Presence(Presence.Type.subscribed).setTo(to);
}
try {
con.sendPacket(new Presence(Presence.Type.subscribed));
} catch (NotConnectedException e) {
throw new SmackInvocationException(e);
}
} | public void approveSubscription(String to) throws SmackInvocationException {
<DeepExtract>
if (to != null) {
new Presence(Presence.Type.subscribed).setTo(to);
}
try {
con.sendPacket(new Presence(Presence.Type.subscribed));
} catch (NotConnectedException e) {
throw new SmackInvocationException(e);
}
</DeepExtract>
} | LetsChat | positive | 1,726 |
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
localSongsList = MediaUtils.getLocalSongs(Ting.getInstance());
if (localSongsList.size() == 0) {
view = inflater.inflate(R.layout.fragment_not_songs, container, false);
return view;
}
view =... | @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
localSongsList = MediaUtils.getLocalSongs(Ting.getInstance());
if (localSongsList.size() == 0) {
view = inflater.inflate(R.layout.fragment_not_songs, container, false);
return view;
}
view =... | ting | positive | 1,727 |
public Criteria andCollegeidEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "collegeid" + " cannot be null");
}
criteria.add(new Criterion("collegeID =", value));
return (Criteria) this;
} | public Criteria andCollegeidEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "collegeid" + " cannot be null");
}
criteria.add(new Criterion("collegeID =", value));
</DeepExtract>
return (Criteria) this;
} | Examination_System | positive | 1,728 |
public EasyTime blur(final int blurMinutes) {
int minuteShift = rand.nextInt(blurMinutes) - (blurMinutes / 2);
this.hour += 0;
this.minute += minuteShift;
normalize();
return this;
return this;
} | public EasyTime blur(final int blurMinutes) {
int minuteShift = rand.nextInt(blurMinutes) - (blurMinutes / 2);
<DeepExtract>
this.hour += 0;
this.minute += minuteShift;
normalize();
return this;
</DeepExtract>
return this;
} | Siafu | positive | 1,729 |
public void resetCurrentTable() {
reset();
currentTable = currentTable;
boolean success = false;
try {
stmt = conn.createStatement();
this.res = stmt.executeQuery("select * from " + currentTable);
parseResultSet();
success = true;
} catch (SQLException ex) {
System.out.println("getdatafromtable");
System.out.println("S... | public void resetCurrentTable() {
<DeepExtract>
reset();
currentTable = currentTable;
boolean success = false;
try {
stmt = conn.createStatement();
this.res = stmt.executeQuery("select * from " + currentTable);
parseResultSet();
success = true;
} catch (SQLException ex) {
System.out.println("getdatafromtable");
System.... | Topiary-Explorer | positive | 1,731 |
@Override
public void updateChallenge(@Nullable String tablePrefix, @NotNull String id, @NotNull String data) throws IOException {
File file = new File(dataFolder, id + ".json");
if (file.exists())
file.delete();
Files.write(Paths.get(file.getPath()), data.getBytes(StandardCharsets.UTF_8));
} | @Override
public void updateChallenge(@Nullable String tablePrefix, @NotNull String id, @NotNull String data) throws IOException {
File file = new File(dataFolder, id + ".json");
if (file.exists())
file.delete();
<DeepExtract>
Files.write(Paths.get(file.getPath()), data.getBytes(StandardCharsets.UTF_8));
</DeepExtract>... | Guilds | positive | 1,732 |
public long toMilliseconds() {
switch(this.intervalId) {
case YEAR_CALENDAR_UNIT:
return YEAR_CALENDAR_UNIT_MS;
case MONTH_CALENDAR_UNIT:
return MONTH_CALENDAR_UNIT_MS;
case DAY_CALENDAR_UNIT:
return DAY_CALENDAR_UNIT_MS;
case HOUR_CALENDAR_UNIT:
return HOUR_CALENDAR_UNIT_MS;
case MINUTE_CALENDAR_UNIT:
return MINUTE_CA... | public long toMilliseconds() {
<DeepExtract>
switch(this.intervalId) {
case YEAR_CALENDAR_UNIT:
return YEAR_CALENDAR_UNIT_MS;
case MONTH_CALENDAR_UNIT:
return MONTH_CALENDAR_UNIT_MS;
case DAY_CALENDAR_UNIT:
return DAY_CALENDAR_UNIT_MS;
case HOUR_CALENDAR_UNIT:
return HOUR_CALENDAR_UNIT_MS;
case MINUTE_CALENDAR_UNIT:
re... | JKLocalNotifications-ANE | positive | 1,734 |
public String convertDBCursorToString(EDataType eDataType, Object instanceValue) {
switch(eDataType.getClassifierID()) {
case ModelPackage.DB_OBJECT:
return convertDBObjectToString(eDataType, instanceValue);
case ModelPackage.DB_CURSOR:
return convertDBCursorToString(eDataType, instanceValue);
case ModelPackage.DB_COLL... | public String convertDBCursorToString(EDataType eDataType, Object instanceValue) {
<DeepExtract>
switch(eDataType.getClassifierID()) {
case ModelPackage.DB_OBJECT:
return convertDBObjectToString(eDataType, instanceValue);
case ModelPackage.DB_CURSOR:
return convertDBCursorToString(eDataType, instanceValue);
case ModelP... | mongo-emf | positive | 1,735 |
public Criteria andCommentCountNotEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "commentCount" + " cannot be null");
}
criteria.add(new Criterion("comment_count <>", value));
return (Criteria) this;
} | public Criteria andCommentCountNotEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "commentCount" + " cannot be null");
}
criteria.add(new Criterion("comment_count <>", value));
</DeepExtract>
return (Criteria) this;
} | community | positive | 1,736 |
@Test
public void testGreaterThanOrEq() throws DbException, TransactionAbortedException, IOException {
HeapFile f = createTable(2, 42);
Predicate predicate = new Predicate(2, Predicate.Op.GREATER_THAN_OR_EQ, new IntField(42));
assertEquals(ROWS, runTransactionForPredicate(f, predicate));
f = Utility.openHeapFile(COLUMN... | @Test
public void testGreaterThanOrEq() throws DbException, TransactionAbortedException, IOException {
<DeepExtract>
HeapFile f = createTable(2, 42);
Predicate predicate = new Predicate(2, Predicate.Op.GREATER_THAN_OR_EQ, new IntField(42));
assertEquals(ROWS, runTransactionForPredicate(f, predicate));
f = Utility.openH... | ToyDB | positive | 1,737 |
public void addStream(InputStream inputStream, ZipParameters parameters) throws ZipException {
if (inputStream == null) {
throw new ZipException("inputstream is null, cannot add file to zip");
}
if (parameters == null) {
throw new ZipException("zip parameters are null");
}
this.runInThread = false;
if (this.zipModel ==... | public void addStream(InputStream inputStream, ZipParameters parameters) throws ZipException {
if (inputStream == null) {
throw new ZipException("inputstream is null, cannot add file to zip");
}
if (parameters == null) {
throw new ZipException("zip parameters are null");
}
this.runInThread = false;
<DeepExtract>
if (th... | secure-zip-notes | positive | 1,738 |
private void successfulUse(Skill sk) {
int durDec = (int) Math.round((double) sk.getDurCost() / (buffExist(Buff.waste_not) ? 2 : 1) / (cs == CraftingStatus.Sturdy ? 2 : 1));
int cpDec = (int) Math.round((double) sk.getCPCost() / (cs == CraftingStatus.Pliant ? 2 : 1));
presentDurability -= durDec;
presentCP -= cpDec;
ro... | private void successfulUse(Skill sk) {
int durDec = (int) Math.round((double) sk.getDurCost() / (buffExist(Buff.waste_not) ? 2 : 1) / (cs == CraftingStatus.Sturdy ? 2 : 1));
int cpDec = (int) Math.round((double) sk.getCPCost() / (cs == CraftingStatus.Pliant ? 2 : 1));
presentDurability -= durDec;
presentCP -= cpDec;
ro... | FFXIVCraftingSim | positive | 1,739 |
public static void assertValueNotStartsWith(String prefix, WebElement webElement) {
BotUtils.assertNotStartsWith("Element attribute " + "value", prefix, attributeIn("value", webElement), webElement);
} | public static void assertValueNotStartsWith(String prefix, WebElement webElement) {
<DeepExtract>
BotUtils.assertNotStartsWith("Element attribute " + "value", prefix, attributeIn("value", webElement), webElement);
</DeepExtract>
} | webdriverextensions | positive | 1,740 |
public UnitFeature createUnitFeature() {
prefs = (prefs == null) ? abapCiPluginHelper.getPreferenceStore() : prefs;
final UnitFeature feature = new UnitFeature();
feature.setActive(prefs.getBoolean(PreferenceConstants.PREF_UNIT_RUN_ON_SAVE));
feature.setRunActivatedObjectsOnly(prefs.getBoolean(PreferenceConstants.PREF_... | public UnitFeature createUnitFeature() {
<DeepExtract>
prefs = (prefs == null) ? abapCiPluginHelper.getPreferenceStore() : prefs;
</DeepExtract>
final UnitFeature feature = new UnitFeature();
feature.setActive(prefs.getBoolean(PreferenceConstants.PREF_UNIT_RUN_ON_SAVE));
feature.setRunActivatedObjectsOnly(prefs.getBool... | abapCI | positive | 1,741 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.