before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
public void reload() {
currentAnimation = GameManager.assetManager().getAnimation(animationName);
if (currentAnimation != null) {
TextureRegion currentTexture = currentAnimation.getKeyFrame(stateTime, looping);
sprite.setTexture(currentTexture.getTexture());
sprite.setRegion(currentTexture);
sprite.setSize(sprite.getRegionWidth(), sprite.getRegionHeight());
sprite.setBounds(sprite.getX(), sprite.getY(), sprite.getWidth(), sprite.getHeight());
sprite.setOrigin(Math.abs(sprite.getWidth()) / 2, 0);
}
} | public void reload() {
currentAnimation = GameManager.assetManager().getAnimation(animationName);
<DeepExtract>
if (currentAnimation != null) {
TextureRegion currentTexture = currentAnimation.getKeyFrame(stateTime, looping);
sprite.setTexture(currentTexture.getTexture());
sprite.setRegion(currentTexture);
sprite.setSize(sprite.getRegionWidth(), sprite.getRegionHeight());
sprite.setBounds(sprite.getX(), sprite.getY(), sprite.getWidth(), sprite.getHeight());
sprite.setOrigin(Math.abs(sprite.getWidth()) / 2, 0);
}
</DeepExtract>
} | ProjectVisualNovel | positive | 2,657 |
public static Message setPedalSensivity(int sensivity) {
byte value = (byte) (sensivity & 0xFF);
Message msg = new Message();
return value;
return value;
msg.data = new byte[] { 0x25, value, 0x64 };
return msg;
} | public static Message setPedalSensivity(int sensivity) {
byte value = (byte) (sensivity & 0xFF);
Message msg = new Message();
<DeepExtract>
return value;
</DeepExtract>
return value;
msg.data = new byte[] { 0x25, value, 0x64 };
return msg;
} | Wheellog.Android | positive | 2,658 |
public static Subject getSubject(final AccessControlContext context) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(_SUBJECT);
}
if (context == null) {
throw new NullPointerException("auth.09");
}
PrivilegedAction<DomainCombiner> action = new PrivilegedAction<DomainCombiner>() {
public DomainCombiner run() {
return context.getDomainCombiner();
}
};
DomainCombiner combiner = AccessController.doPrivileged(action);
if ((combiner == null) || !(combiner instanceof SubjectDomainCombiner)) {
return null;
}
return ((SubjectDomainCombiner) combiner).getSubject();
} | public static Subject getSubject(final AccessControlContext context) {
<DeepExtract>
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(_SUBJECT);
}
</DeepExtract>
if (context == null) {
throw new NullPointerException("auth.09");
}
PrivilegedAction<DomainCombiner> action = new PrivilegedAction<DomainCombiner>() {
public DomainCombiner run() {
return context.getDomainCombiner();
}
};
DomainCombiner combiner = AccessController.doPrivileged(action);
if ((combiner == null) || !(combiner instanceof SubjectDomainCombiner)) {
return null;
}
return ((SubjectDomainCombiner) combiner).getSubject();
} | android-client | positive | 2,659 |
public FloatingActionButton create() {
final FloatingActionButton button = new FloatingActionButton(activity);
init(this.color);
mBitmap = ((BitmapDrawable) this.drawable).getBitmap();
invalidate();
params.gravity = this.gravity;
ViewGroup root = (ViewGroup) activity.findViewById(android.R.id.content);
root.addView(button, params);
return button;
} | public FloatingActionButton create() {
final FloatingActionButton button = new FloatingActionButton(activity);
init(this.color);
<DeepExtract>
mBitmap = ((BitmapDrawable) this.drawable).getBitmap();
invalidate();
</DeepExtract>
params.gravity = this.gravity;
ViewGroup root = (ViewGroup) activity.findViewById(android.R.id.content);
root.addView(button, params);
return button;
} | MonitoraBrasil | positive | 2,660 |
public JdHttpUtils fork() {
JdHttpUtils jdHttpUtils = new JdHttpUtils("");
this.cookies = cookies;
return jdHttpUtils;
} | public JdHttpUtils fork() {
JdHttpUtils jdHttpUtils = new JdHttpUtils("");
<DeepExtract>
this.cookies = cookies;
</DeepExtract>
return jdHttpUtils;
} | SimpleCase | positive | 2,661 |
@Override
public void accept(Throwable throwable) throws Exception {
setLoadingFinish();
mBaseView.onError(throwable);
} | @Override
public void accept(Throwable throwable) throws Exception {
<DeepExtract>
setLoadingFinish();
mBaseView.onError(throwable);
</DeepExtract>
} | Aequorea | positive | 2,662 |
@Override
public int getEndViewBound() {
return lm.getDecoratedRight(lm.getCanvas().getRightView());
} | @Override
public int getEndViewBound() {
<DeepExtract>
return lm.getDecoratedRight(lm.getCanvas().getRightView());
</DeepExtract>
} | Factor_Launcher_Reboot | positive | 2,664 |
@Override
public void onDeleted(Run run) {
while (run.getParent() != null) {
if (run.getParent() instanceof AbstractFolder) {
((AbstractFolder) run.getParent()).invalidateBuildHealthReports();
}
if (run.getParent().getParent() instanceof Item) {
run.getParent() = (Item) run.getParent().getParent();
} else {
break;
}
}
} | @Override
public void onDeleted(Run run) {
<DeepExtract>
while (run.getParent() != null) {
if (run.getParent() instanceof AbstractFolder) {
((AbstractFolder) run.getParent()).invalidateBuildHealthReports();
}
if (run.getParent().getParent() instanceof Item) {
run.getParent() = (Item) run.getParent().getParent();
} else {
break;
}
}
</DeepExtract>
} | cloudbees-folder-plugin | positive | 2,666 |
@Override
public void mouseEntered(MouseEvent evt) {
m_jlStatusBar.setText((String) m_genKeyPairAction.getValue(Action.LONG_DESCRIPTION));
} | @Override
public void mouseEntered(MouseEvent evt) {
<DeepExtract>
m_jlStatusBar.setText((String) m_genKeyPairAction.getValue(Action.LONG_DESCRIPTION));
</DeepExtract>
} | portecle | positive | 2,667 |
@Override
protected void initData() {
loading.setVisibility(View.GONE);
adapter.removeAllFooterView();
if (adapter.getData().isEmpty()) {
list = getList(week);
if (list.size() == 0) {
if (!application.error.isEmpty()) {
errorTitle.setText(application.error);
adapter.setEmptyView(errorView);
}
} else
adapter.setNewData(list);
}
} | @Override
protected void initData() {
<DeepExtract>
loading.setVisibility(View.GONE);
adapter.removeAllFooterView();
if (adapter.getData().isEmpty()) {
list = getList(week);
if (list.size() == 0) {
if (!application.error.isEmpty()) {
errorTitle.setText(application.error);
adapter.setEmptyView(errorView);
}
} else
adapter.setNewData(list);
}
</DeepExtract>
} | Silisili | positive | 2,668 |
public SLStatementNode createBreak(Token breakToken) {
final SLBreakNode breakNode = new SLBreakNode();
breakNode.setSourceSection(breakToken.getStartIndex(), breakToken.getText().length());
return breakNode;
} | public SLStatementNode createBreak(Token breakToken) {
final SLBreakNode breakNode = new SLBreakNode();
<DeepExtract>
breakNode.setSourceSection(breakToken.getStartIndex(), breakToken.getText().length());
</DeepExtract>
return breakNode;
} | simplelanguage | positive | 2,669 |
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (mScriptDirectionState == ScriptDirectionChecker.UNSPECIFIED) {
mScriptDirectionState = ScriptDirectionChecker.checkSelfScriptDirection(recyclerView.getContext());
}
switch(newState) {
case RecyclerView.SCROLL_STATE_DRAGGING:
mDragging = true;
final int[] range = AbstractLayoutManagerUtils.getVisibleRange(recyclerView);
mDraggingStart = range[0];
mDraggingEnd = range[1];
break;
case RecyclerView.SCROLL_STATE_SETTLING:
mDragging = false;
break;
case RecyclerView.SCROLL_STATE_IDLE:
mDragging = false;
updateVisibleRange(recyclerView);
AbstractLogUtils.e(this, "==> visible range: [" + mDraggingStart + ", " + mDraggingEnd + "]");
MeasurableRecyclerViewHelper.notifyMeasurableViewHolderDataRangeChanged(recyclerView, mDraggingStart, mDraggingEnd);
mDraggingStart = RecyclerView.NO_POSITION;
mDraggingEnd = RecyclerView.NO_POSITION;
final int state = ScriptDirectionChecker.checkSelfScriptDirection(recyclerView.getContext());
if (mScriptDirectionState != ScriptDirectionChecker.UNSPECIFIED && state != ScriptDirectionChecker.UNSPECIFIED && mScriptDirectionState != state) {
final List<IMeasurableViewHolder> holders = MeasurableRecyclerViewHelper.getViewHolders(recyclerView, IMeasurableViewHolder.class);
for (IMeasurableViewHolder holder : holders) {
holder.flush();
}
if (AbstractLayoutManagerUtils.getOrientation(recyclerView.getLayoutManager()) == OrientationHelper.HORIZONTAL) {
AbstractLayoutManagerUtils.setReverseLayout(recyclerView.getLayoutManager(), state == ScriptDirectionChecker.RIGHT_TO_LEFT);
}
mScriptDirectionState = state;
}
break;
default:
break;
}
} | @Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
<DeepExtract>
if (mScriptDirectionState == ScriptDirectionChecker.UNSPECIFIED) {
mScriptDirectionState = ScriptDirectionChecker.checkSelfScriptDirection(recyclerView.getContext());
}
</DeepExtract>
switch(newState) {
case RecyclerView.SCROLL_STATE_DRAGGING:
mDragging = true;
final int[] range = AbstractLayoutManagerUtils.getVisibleRange(recyclerView);
mDraggingStart = range[0];
mDraggingEnd = range[1];
break;
case RecyclerView.SCROLL_STATE_SETTLING:
mDragging = false;
break;
case RecyclerView.SCROLL_STATE_IDLE:
mDragging = false;
updateVisibleRange(recyclerView);
AbstractLogUtils.e(this, "==> visible range: [" + mDraggingStart + ", " + mDraggingEnd + "]");
MeasurableRecyclerViewHelper.notifyMeasurableViewHolderDataRangeChanged(recyclerView, mDraggingStart, mDraggingEnd);
mDraggingStart = RecyclerView.NO_POSITION;
mDraggingEnd = RecyclerView.NO_POSITION;
final int state = ScriptDirectionChecker.checkSelfScriptDirection(recyclerView.getContext());
if (mScriptDirectionState != ScriptDirectionChecker.UNSPECIFIED && state != ScriptDirectionChecker.UNSPECIFIED && mScriptDirectionState != state) {
final List<IMeasurableViewHolder> holders = MeasurableRecyclerViewHelper.getViewHolders(recyclerView, IMeasurableViewHolder.class);
for (IMeasurableViewHolder holder : holders) {
holder.flush();
}
if (AbstractLayoutManagerUtils.getOrientation(recyclerView.getLayoutManager()) == OrientationHelper.HORIZONTAL) {
AbstractLayoutManagerUtils.setReverseLayout(recyclerView.getLayoutManager(), state == ScriptDirectionChecker.RIGHT_TO_LEFT);
}
mScriptDirectionState = state;
}
break;
default:
break;
}
} | tenor-android-core | positive | 2,670 |
public boolean createBackupDataFile(byte[] payload) throws IOException {
byte[] apdu = new byte[13];
apdu[0] = (byte) 0x90;
apdu[1] = (byte) Command.CREATE_BACKUP_DATA_FILE.getCode();
apdu[2] = 0x00;
apdu[3] = 0x00;
apdu[4] = 0x07;
System.arraycopy(payload, 0, apdu, 5, 7);
apdu[12] = 0x00;
preprocess(apdu, DesfireFileCommunicationSettings.PLAIN);
byte[] responseAPDU = transmit(apdu);
feedback(apdu, responseAPDU);
return postprocess(responseAPDU, DesfireFileCommunicationSettings.PLAIN) != null;
} | public boolean createBackupDataFile(byte[] payload) throws IOException {
<DeepExtract>
byte[] apdu = new byte[13];
apdu[0] = (byte) 0x90;
apdu[1] = (byte) Command.CREATE_BACKUP_DATA_FILE.getCode();
apdu[2] = 0x00;
apdu[3] = 0x00;
apdu[4] = 0x07;
System.arraycopy(payload, 0, apdu, 5, 7);
apdu[12] = 0x00;
preprocess(apdu, DesfireFileCommunicationSettings.PLAIN);
byte[] responseAPDU = transmit(apdu);
feedback(apdu, responseAPDU);
return postprocess(responseAPDU, DesfireFileCommunicationSettings.PLAIN) != null;
</DeepExtract>
} | desfire-tools-for-android | positive | 2,671 |
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(getLayoutId());
this.mContext = this;
mContentView = findViewById(android.R.id.content);
unbinder = ButterKnife.bind(this);
StatusBarUtils.setColorBar(this, this.getResources().getColor(R.color.colorPrimary), true);
initData();
initView();
} | @Override
<DeepExtract>
</DeepExtract>
protected void onCreate(@Nullable Bundle savedInstanceState) {
<DeepExtract>
</DeepExtract>
super.onCreate(savedInstanceState);
<DeepExtract>
</DeepExtract>
this.setContentView(getLayoutId());
<DeepExtract>
</DeepExtract>
this.mContext = this;
<DeepExtract>
</DeepExtract>
mContentView = findViewById(android.R.id.content);
<DeepExtract>
</DeepExtract>
unbinder = ButterKnife.bind(this);
<DeepExtract>
</DeepExtract>
StatusBarUtils.setColorBar(this, this.getResources().getColor(R.color.colorPrimary), true);
<DeepExtract>
</DeepExtract>
initData();
<DeepExtract>
</DeepExtract>
initView();
<DeepExtract>
</DeepExtract>
} | DouDou | positive | 2,672 |
public Criteria andSexIsNull() {
if ("sex is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("sex is null"));
return (Criteria) this;
} | public Criteria andSexIsNull() {
<DeepExtract>
if ("sex is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("sex is null"));
</DeepExtract>
return (Criteria) this;
} | health_online | positive | 2,673 |
@Test
public void testSink() {
ArrayHeap<String> pq = new ArrayHeap<>();
pq.size = 7;
for (int i = 1; i <= 7; i += 1) {
pq.contents[i] = new ArrayHeap<String>.Node("x" + i, i);
}
pq.contents[1].myPriority = 10;
System.out.println("PQ before sinking:");
System.out.println(pq);
validateSinkSwimArg(1);
int min = min(leftIndex(1), rightIndex(1));
while (contents[min].priority() < contents[1].priority()) {
swap(min, 1);
1 = min;
min = min(leftIndex(1), rightIndex(1));
if (leftIndex(1) > size) {
break;
}
}
System.out.println("PQ after sinking:");
System.out.println(pq);
assertEquals("x2", pq.contents[1].myItem);
assertEquals("x4", pq.contents[2].myItem);
assertEquals("x3", pq.contents[3].myItem);
assertEquals("x1", pq.contents[4].myItem);
assertEquals("x5", pq.contents[5].myItem);
assertEquals("x6", pq.contents[6].myItem);
assertEquals("x7", pq.contents[7].myItem);
} | @Test
public void testSink() {
ArrayHeap<String> pq = new ArrayHeap<>();
pq.size = 7;
for (int i = 1; i <= 7; i += 1) {
pq.contents[i] = new ArrayHeap<String>.Node("x" + i, i);
}
pq.contents[1].myPriority = 10;
System.out.println("PQ before sinking:");
System.out.println(pq);
<DeepExtract>
validateSinkSwimArg(1);
int min = min(leftIndex(1), rightIndex(1));
while (contents[min].priority() < contents[1].priority()) {
swap(min, 1);
1 = min;
min = min(leftIndex(1), rightIndex(1));
if (leftIndex(1) > size) {
break;
}
}
</DeepExtract>
System.out.println("PQ after sinking:");
System.out.println(pq);
assertEquals("x2", pq.contents[1].myItem);
assertEquals("x4", pq.contents[2].myItem);
assertEquals("x3", pq.contents[3].myItem);
assertEquals("x1", pq.contents[4].myItem);
assertEquals("x5", pq.contents[5].myItem);
assertEquals("x6", pq.contents[6].myItem);
assertEquals("x7", pq.contents[7].myItem);
} | cs61b-sp18-Data-Structure | positive | 2,675 |
@Override
public void shutdown() {
daemon.setRun(false);
if (daemonThread != null) {
daemonThread.interrupt();
}
daemon.persistCache();
if (cache != null) {
cache.clear();
}
} | @Override
public void shutdown() {
daemon.setRun(false);
if (daemonThread != null) {
daemonThread.interrupt();
}
daemon.persistCache();
<DeepExtract>
if (cache != null) {
cache.clear();
}
</DeepExtract>
} | joice | positive | 2,676 |
@Redirect(method = "spawn", at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/arguments/StringArgumentType;getString(Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;)Ljava/lang/String;"), require = 2, remap = false)
private static String getStringWithPrefixAtSpawn(final CommandContext<?> context, final String name) {
String playerName = StringArgumentType.getString(context, name);
String rulePrefix = CarpetTISAdditionSettings.fakePlayerNamePrefix;
String ruleSuffix = CarpetTISAdditionSettings.fakePlayerNameSuffix;
if (!rulePrefix.equals(CarpetTISAdditionSettings.fakePlayerNameNoExtra) && !playerName.startsWith(rulePrefix)) {
playerName = rulePrefix + playerName;
}
if (!ruleSuffix.equals(CarpetTISAdditionSettings.fakePlayerNameNoExtra) && !playerName.endsWith(ruleSuffix)) {
playerName = playerName + ruleSuffix;
}
return playerName;
} | @Redirect(method = "spawn", at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/arguments/StringArgumentType;getString(Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;)Ljava/lang/String;"), require = 2, remap = false)
private static String getStringWithPrefixAtSpawn(final CommandContext<?> context, final String name) {
<DeepExtract>
String playerName = StringArgumentType.getString(context, name);
String rulePrefix = CarpetTISAdditionSettings.fakePlayerNamePrefix;
String ruleSuffix = CarpetTISAdditionSettings.fakePlayerNameSuffix;
if (!rulePrefix.equals(CarpetTISAdditionSettings.fakePlayerNameNoExtra) && !playerName.startsWith(rulePrefix)) {
playerName = rulePrefix + playerName;
}
if (!ruleSuffix.equals(CarpetTISAdditionSettings.fakePlayerNameNoExtra) && !playerName.endsWith(ruleSuffix)) {
playerName = playerName + ruleSuffix;
}
return playerName;
</DeepExtract>
} | Carpet-TIS-Addition | positive | 2,677 |
public Criteria andNameGreaterThanOrEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name >=", value));
return (Criteria) this;
} | public Criteria andNameGreaterThanOrEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name >=", value));
</DeepExtract>
return (Criteria) this;
} | Hospital | positive | 2,678 |
@Test
@Transactional
@WithMockUser(authorities = "SUPER-ADMIN")
public void getAllBalancesByEntityIdIsLessThanSomething() throws Exception {
balanceRepository.saveAndFlush(balance);
restBalanceMockMvc.perform(get("/api/balances?sort=id,desc&" + "entityId.lessThan=" + DEFAULT_ENTITY_ID)).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)).andExpect(jsonPath("$").isArray()).andExpect(jsonPath("$").isEmpty());
restBalanceMockMvc.perform(get("/api/balances?sort=id,desc&" + "entityId.lessThan=" + UPDATED_ENTITY_ID)).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)).andExpect(jsonPath("$.[*].id").value(hasItem(balance.getId().intValue()))).andExpect(jsonPath("$.[*].key").value(hasItem(DEFAULT_KEY.toString()))).andExpect(jsonPath("$.[*].typeKey").value(hasItem(DEFAULT_TYPE_KEY.toString()))).andExpect(jsonPath("$.[*].measureKey").value(hasItem(DEFAULT_MEASURE_KEY.toString()))).andExpect(jsonPath("$.[*].reserved").value(hasItem(DEFAULT_RESERVED.intValue()))).andExpect(jsonPath("$.[*].entityId").value(hasItem(DEFAULT_ENTITY_ID.intValue()))).andExpect(jsonPath("$.[*].createdBy").value(hasItem(DEFAULT_CREATED_BY.toString())));
} | @Test
@Transactional
@WithMockUser(authorities = "SUPER-ADMIN")
public void getAllBalancesByEntityIdIsLessThanSomething() throws Exception {
balanceRepository.saveAndFlush(balance);
restBalanceMockMvc.perform(get("/api/balances?sort=id,desc&" + "entityId.lessThan=" + DEFAULT_ENTITY_ID)).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)).andExpect(jsonPath("$").isArray()).andExpect(jsonPath("$").isEmpty());
<DeepExtract>
restBalanceMockMvc.perform(get("/api/balances?sort=id,desc&" + "entityId.lessThan=" + UPDATED_ENTITY_ID)).andExpect(status().isOk()).andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)).andExpect(jsonPath("$.[*].id").value(hasItem(balance.getId().intValue()))).andExpect(jsonPath("$.[*].key").value(hasItem(DEFAULT_KEY.toString()))).andExpect(jsonPath("$.[*].typeKey").value(hasItem(DEFAULT_TYPE_KEY.toString()))).andExpect(jsonPath("$.[*].measureKey").value(hasItem(DEFAULT_MEASURE_KEY.toString()))).andExpect(jsonPath("$.[*].reserved").value(hasItem(DEFAULT_RESERVED.intValue()))).andExpect(jsonPath("$.[*].entityId").value(hasItem(DEFAULT_ENTITY_ID.intValue()))).andExpect(jsonPath("$.[*].createdBy").value(hasItem(DEFAULT_CREATED_BY.toString())));
</DeepExtract>
} | xm-ms-balance | positive | 2,679 |
public void init() {
logger.info("start jobstepbean:{}", jobStepBean);
jobStepBean.setExitId(-999);
} | public void init() {
logger.info("start jobstepbean:{}", jobStepBean);
<DeepExtract>
jobStepBean.setExitId(-999);
</DeepExtract>
} | harrier | positive | 2,680 |
public Criteria andTimeLessThanOrEqualTo(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "time" + " cannot be null");
}
criteria.add(new Criterion("time <=", value));
return (Criteria) this;
} | public Criteria andTimeLessThanOrEqualTo(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "time" + " cannot be null");
}
criteria.add(new Criterion("time <=", value));
</DeepExtract>
return (Criteria) this;
} | webim | positive | 2,682 |
@Override
public View onCreateInputView() {
layout = getLayoutInflater().inflate(R.layout.ime, null);
categoryAllButton = (Button) layout.findViewById(R.id.ime_category_button_all);
myEmojiButton = (Button) layout.findViewById(R.id.ime_category_button_my_emoji);
final CategoryManager categoryManager = CategoryManager.getInstance();
categoryManager.initialize(this);
final ViewGroup categoriesView = (ViewGroup) layout.findViewById(R.id.ime_categories);
for (final String categoryName : emojidex.getCategoryNames()) {
categoryManager.add(categoryName, categoryName);
}
final int categoryCount = categoryManager.getCategoryCount();
for (int i = 0; i < categoryCount; ++i) {
final RadioButton newButton = new RadioButton(this);
newButton.setText(categoryManager.getCategoryText(i));
newButton.setContentDescription(categoryManager.getCategoryId(i));
newButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onClickCategoryButton(v);
}
});
categoriesView.addView(newButton);
}
categoryScrollView = (HorizontalScrollView) layout.findViewById(R.id.ime_category_scrollview);
keyboardViewFlipper = (ViewFlipper) layout.findViewById(R.id.keyboard_viewFlipper);
keyboardViewManager = new KeyboardViewManager(this, new CustomOnKeyboardActionListener(), new CustomOnTouchListener());
for (View view : keyboardViewManager.getViews()) keyboardViewFlipper.addView(view);
subKeyboardView = new EmojidexSubKeyboardView(this, null, R.attr.subKeyboardViewStyle);
subKeyboardView.setOnKeyboardActionListener(new CustomOnKeyboardActionListener());
subKeyboardView.setPreviewEnabled(false);
Keyboard keyboard = new Keyboard(this, R.xml.sub_keyboard);
subKeyboardView.setKeyboard(keyboard);
ViewGroup targetView = (ViewGroup) layout.findViewById(R.id.ime_sub_keyboard);
targetView.addView(subKeyboardView);
final int[] enterCodes = { KeyEvent.KEYCODE_ENTER };
final List<Keyboard.Key> keys = keyboard.getKeys();
final int count = keys.size();
for (keyEnterIndex = 0; keyEnterIndex < count; ++keyEnterIndex) {
final Keyboard.Key key = keys.get(keyEnterIndex);
if (Arrays.equals(key.codes, enterCodes)) {
keyEnter = key;
break;
}
}
if (userdata.isLogined())
myEmojiButton.setVisibility(View.VISIBLE);
else
myEmojiButton.setVisibility(View.GONE);
historyManager.loadFromUser();
favoriteManager.loadFromUser();
return layout;
} | @Override
public View onCreateInputView() {
layout = getLayoutInflater().inflate(R.layout.ime, null);
categoryAllButton = (Button) layout.findViewById(R.id.ime_category_button_all);
myEmojiButton = (Button) layout.findViewById(R.id.ime_category_button_my_emoji);
final CategoryManager categoryManager = CategoryManager.getInstance();
categoryManager.initialize(this);
final ViewGroup categoriesView = (ViewGroup) layout.findViewById(R.id.ime_categories);
for (final String categoryName : emojidex.getCategoryNames()) {
categoryManager.add(categoryName, categoryName);
}
final int categoryCount = categoryManager.getCategoryCount();
for (int i = 0; i < categoryCount; ++i) {
final RadioButton newButton = new RadioButton(this);
newButton.setText(categoryManager.getCategoryText(i));
newButton.setContentDescription(categoryManager.getCategoryId(i));
newButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onClickCategoryButton(v);
}
});
categoriesView.addView(newButton);
}
categoryScrollView = (HorizontalScrollView) layout.findViewById(R.id.ime_category_scrollview);
keyboardViewFlipper = (ViewFlipper) layout.findViewById(R.id.keyboard_viewFlipper);
keyboardViewManager = new KeyboardViewManager(this, new CustomOnKeyboardActionListener(), new CustomOnTouchListener());
for (View view : keyboardViewManager.getViews()) keyboardViewFlipper.addView(view);
subKeyboardView = new EmojidexSubKeyboardView(this, null, R.attr.subKeyboardViewStyle);
subKeyboardView.setOnKeyboardActionListener(new CustomOnKeyboardActionListener());
subKeyboardView.setPreviewEnabled(false);
Keyboard keyboard = new Keyboard(this, R.xml.sub_keyboard);
subKeyboardView.setKeyboard(keyboard);
ViewGroup targetView = (ViewGroup) layout.findViewById(R.id.ime_sub_keyboard);
targetView.addView(subKeyboardView);
final int[] enterCodes = { KeyEvent.KEYCODE_ENTER };
final List<Keyboard.Key> keys = keyboard.getKeys();
final int count = keys.size();
for (keyEnterIndex = 0; keyEnterIndex < count; ++keyEnterIndex) {
final Keyboard.Key key = keys.get(keyEnterIndex);
if (Arrays.equals(key.codes, enterCodes)) {
keyEnter = key;
break;
}
}
<DeepExtract>
if (userdata.isLogined())
myEmojiButton.setVisibility(View.VISIBLE);
else
myEmojiButton.setVisibility(View.GONE);
</DeepExtract>
historyManager.loadFromUser();
favoriteManager.loadFromUser();
return layout;
} | emojidex-android | positive | 2,683 |
public Single<List<Sendable>> loadMoreMessagesFrom(Date fromDate, Integer limit, boolean desc) {
return Fire.stream().getFirebaseService().core.loadMoreMessages(messagesPath(), fromDate, null, limit).map(sendables -> {
Collections.sort(sendables, (s1, s2) -> {
if (desc) {
return s2.getDate().compareTo(s1.getDate());
} else {
return s1.getDate().compareTo(s2.getDate());
}
});
return sendables;
}).observeOn(RX.main());
} | public Single<List<Sendable>> loadMoreMessagesFrom(Date fromDate, Integer limit, boolean desc) {
<DeepExtract>
return Fire.stream().getFirebaseService().core.loadMoreMessages(messagesPath(), fromDate, null, limit).map(sendables -> {
Collections.sort(sendables, (s1, s2) -> {
if (desc) {
return s2.getDate().compareTo(s1.getDate());
} else {
return s1.getDate().compareTo(s2.getDate());
}
});
return sendables;
}).observeOn(RX.main());
</DeepExtract>
} | firestream-android | positive | 2,686 |
public static String base64encoder(byte[] input) {
try {
return new String(Base64.encodeBase64(input), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
} | public static String base64encoder(byte[] input) {
<DeepExtract>
try {
return new String(Base64.encodeBase64(input), "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
</DeepExtract>
} | java-saml | positive | 2,687 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Settings");
actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.side_nav_bar));
}
} | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<DeepExtract>
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle("Settings");
actionBar.setBackgroundDrawable(getResources().getDrawable(R.drawable.side_nav_bar));
}
</DeepExtract>
} | FluentERP | positive | 2,689 |
public void setArmor(Armor armor) {
if (armor != null) {
if (!equipList.contains(armor)) {
equipList.add(0, armor);
}
if (armorWorn != armor) {
equipList.remove(armorWorn);
}
}
armorWorn = armor;
attack = computeAttack();
armorClass = computeArmorClass();
moveInches = computeMoveInches();
hitDice = getTopClass().getHitDice();
equivalentHitDice = hitDice.getNum();
maxHitPoints = findSupMaxHitPoints();
sweepRate = computeSweepRate();
boundHitPoints();
} | public void setArmor(Armor armor) {
if (armor != null) {
if (!equipList.contains(armor)) {
equipList.add(0, armor);
}
if (armorWorn != armor) {
equipList.remove(armorWorn);
}
}
armorWorn = armor;
<DeepExtract>
attack = computeAttack();
armorClass = computeArmorClass();
moveInches = computeMoveInches();
hitDice = getTopClass().getHitDice();
equivalentHitDice = hitDice.getNum();
maxHitPoints = findSupMaxHitPoints();
sweepRate = computeSweepRate();
boundHitPoints();
</DeepExtract>
} | Arena | positive | 2,690 |
private void writeCounts(Molecule molecule, Writer writer) {
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(ZERO3, writer);
writeCounts(ZERO3, writer);
writeAtoms(ZERO3, writer);
writeBonds(ZERO3, writer);
writeProperties(ZERO3, writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(ZERO3, writer);
writeCounts(ZERO3, writer);
writeAtoms(ZERO3, writer);
writeBonds(ZERO3, writer);
writeProperties(ZERO3, writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(CHIRAL_OFF, writer);
writeCounts(CHIRAL_OFF, writer);
writeAtoms(CHIRAL_OFF, writer);
writeBonds(CHIRAL_OFF, writer);
writeProperties(CHIRAL_OFF, writer);
return writer.getString();
for (int i = 0; i < 5; i++) {
writer.write(ZERO3);
}
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(VERSION, writer);
writeCounts(VERSION, writer);
writeAtoms(VERSION, writer);
writeBonds(VERSION, writer);
writeProperties(VERSION, writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(NEWLINE, writer);
writeCounts(NEWLINE, writer);
writeAtoms(NEWLINE, writer);
writeBonds(NEWLINE, writer);
writeProperties(NEWLINE, writer);
return writer.getString();
} | private void writeCounts(Molecule molecule, Writer writer) {
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(molecule.countAtoms()), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(molecule.countBonds()), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(ZERO3, writer);
writeCounts(ZERO3, writer);
writeAtoms(ZERO3, writer);
writeBonds(ZERO3, writer);
writeProperties(ZERO3, writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(ZERO3, writer);
writeCounts(ZERO3, writer);
writeAtoms(ZERO3, writer);
writeBonds(ZERO3, writer);
writeProperties(ZERO3, writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(CHIRAL_OFF, writer);
writeCounts(CHIRAL_OFF, writer);
writeAtoms(CHIRAL_OFF, writer);
writeBonds(CHIRAL_OFF, writer);
writeProperties(CHIRAL_OFF, writer);
return writer.getString();
for (int i = 0; i < 5; i++) {
writer.write(ZERO3);
}
Writer writer = new Writer();
writeHeader(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeCounts(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeAtoms(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeBonds(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
writeProperties(MDLStringKit.padLeft(String.valueOf(0), 3), writer);
return writer.getString();
Writer writer = new Writer();
writeHeader(VERSION, writer);
writeCounts(VERSION, writer);
writeAtoms(VERSION, writer);
writeBonds(VERSION, writer);
writeProperties(VERSION, writer);
return writer.getString();
<DeepExtract>
Writer writer = new Writer();
writeHeader(NEWLINE, writer);
writeCounts(NEWLINE, writer);
writeAtoms(NEWLINE, writer);
writeBonds(NEWLINE, writer);
writeProperties(NEWLINE, writer);
return writer.getString();
</DeepExtract>
} | mx | positive | 2,691 |
@Test
public void shouldRenderTitleAtLevel0ByDefault() {
builder.title(level0Title);
assertEquals("= " + level0Title + newLine() + newLine(), builder.toString());
} | @Test
public void shouldRenderTitleAtLevel0ByDefault() {
builder.title(level0Title);
<DeepExtract>
assertEquals("= " + level0Title + newLine() + newLine(), builder.toString());
</DeepExtract>
} | cukedoctor | positive | 2,692 |
public static FixedDelay ofHours(int hours) {
if (hours <= 0) {
throw new IllegalArgumentException("argument must be greater than 0");
}
return new FixedDelay(Duration.ofHours(hours));
} | public static FixedDelay ofHours(int hours) {
<DeepExtract>
if (hours <= 0) {
throw new IllegalArgumentException("argument must be greater than 0");
}
</DeepExtract>
return new FixedDelay(Duration.ofHours(hours));
} | db-scheduler | positive | 2,693 |
public Criteria andBizActionNameLessThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "bizActionName" + " cannot be null");
}
criteria.add(new Criterion("biz_action_name <", value));
return (Criteria) this;
} | public Criteria andBizActionNameLessThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "bizActionName" + " cannot be null");
}
criteria.add(new Criterion("biz_action_name <", value));
</DeepExtract>
return (Criteria) this;
} | dtsopensource | positive | 2,694 |
public int getLineCount() {
nlines = 0;
maxlinelen = 0;
for (int j = JMAX - 1; j >= 0; j--) {
linelen[j] = getOneLineLength(j);
if ((nlines == 0) && (linelen[j] > 0))
nlines = j + 1;
if (linelen[j] > maxlinelen)
maxlinelen = linelen[j];
}
for (int i = 0; i < IMAX; i++) cColons[i] = (charTable[RULER][i] == ':') ? ':' : ' ';
manageVSB();
return nlines;
} | public int getLineCount() {
<DeepExtract>
nlines = 0;
maxlinelen = 0;
for (int j = JMAX - 1; j >= 0; j--) {
linelen[j] = getOneLineLength(j);
if ((nlines == 0) && (linelen[j] > 0))
nlines = j + 1;
if (linelen[j] > maxlinelen)
maxlinelen = linelen[j];
}
for (int i = 0; i < IMAX; i++) cColons[i] = (charTable[RULER][i] == ':') ? ':' : ' ';
manageVSB();
return nlines;
</DeepExtract>
} | BeamFour | positive | 2,695 |
public Criteria andImageurlIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "imageurl" + " cannot be null");
}
criteria.add(new Criterion("imageUrl in", values));
return (Criteria) this;
} | public Criteria andImageurlIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "imageurl" + " cannot be null");
}
criteria.add(new Criterion("imageUrl in", values));
</DeepExtract>
return (Criteria) this;
} | garbage-collection | positive | 2,696 |
@Override
public void run() {
cancelTimer();
this.currentEvent = "";
this.gameService.sendAnimationSpeed(this.lobbyId, 0);
sendCompleteGameState();
for (Map.Entry<Player, List<Card>> entry : this.christmasMap.entrySet()) {
for (Card card : entry.getValue()) {
entry.getKey().pushCardToHand(card);
}
}
this.gameService.sendAnimationSpeed(this.lobbyId, 500);
this.gameService.sendChatMessage(this.lobbyId, this.eventLogs);
sendCompleteGameState();
this.eventResponses = new ArrayList<>();
this.eventLogs = new ArrayList<>();
this.christmasMap = new HashMap<>();
finishTurn();
} | @Override
public void run() {
<DeepExtract>
cancelTimer();
this.currentEvent = "";
this.gameService.sendAnimationSpeed(this.lobbyId, 0);
sendCompleteGameState();
for (Map.Entry<Player, List<Card>> entry : this.christmasMap.entrySet()) {
for (Card card : entry.getValue()) {
entry.getKey().pushCardToHand(card);
}
}
this.gameService.sendAnimationSpeed(this.lobbyId, 500);
this.gameService.sendChatMessage(this.lobbyId, this.eventLogs);
sendCompleteGameState();
this.eventResponses = new ArrayList<>();
this.eventLogs = new ArrayList<>();
this.christmasMap = new HashMap<>();
finishTurn();
</DeepExtract>
} | frantic-server | positive | 2,698 |
private void checkProjectOutput_compareDirs(ComparsionEnvironment env, File refDir, File chkedDir) throws IOException {
File[] refDirFiles = refDir.listFiles();
if (refDirFiles == null) {
throw new IOException("Reference directory not found: " + refDir.getAbsolutePath());
}
int ln = refDirFiles.length;
ArrayList list = new ArrayList(ln);
boolean changed = false;
for (int i = 0; i < ln; i++) {
String name = refDirFiles[i].getName().toLowerCase();
if (!name.equals("cvs") && !name.startsWith(".#") && !name.equals(".svn") && !name.equals(".gitignore")) {
list.add(refDirFiles[i]);
} else {
changed = true;
}
}
if (changed) {
ln = list.size();
refDirFiles = new File[ln];
for (int i = 0; i < ln; i++) {
refDirFiles[i] = (File) list.get(i);
}
}
return refDirFiles;
File[] chkedDirFiles = chkedDir.listFiles();
if (chkedDirFiles == null) {
throw new IOException("Checked directory not found: " + chkedDir.getAbsolutePath());
}
int ln = chkedDirFiles.length;
ArrayList list = new ArrayList(ln);
boolean changed = false;
for (int i = 0; i < ln; i++) {
String name = chkedDirFiles[i].getName().toLowerCase();
if (!name.equals("cvs") && !name.startsWith(".#") && !name.equals(".svn") && !name.equals(".gitignore")) {
list.add(chkedDirFiles[i]);
} else {
changed = true;
}
}
if (changed) {
ln = list.size();
chkedDirFiles = new File[ln];
for (int i = 0; i < ln; i++) {
chkedDirFiles[i] = (File) list.get(i);
}
}
return chkedDirFiles;
for (int ci = 0; ci < chkedDirFiles.length; ci++) {
File cf = chkedDirFiles[ci];
boolean isDir = cf.isDirectory();
int ri = findCounterpart(refDirFiles, cf);
if (ri != -1) {
if (isDir) {
checkProjectOutput_compareDirs(env, refDirFiles[ri], cf);
} else {
checkProjectOutput_compareFiles(env, refDirFiles[ri], cf);
}
refDirFiles[ri] = null;
} else {
env.logDiff(FileUtil.getRelativePath(env.currentProjOutputDir, cf) + ": " + (isDir ? "Directory" : "File") + " shouldn't exist.");
}
}
for (int ri = 0; ri < refDirFiles.length; ri++) {
File rf = refDirFiles[ri];
if (rf != null) {
env.logDiff(FileUtil.getRelativePath(env.currentProjRefDir, rf) + ": " + (rf.isDirectory() ? "Directory" : "File") + " is missing.");
}
}
} | private void checkProjectOutput_compareDirs(ComparsionEnvironment env, File refDir, File chkedDir) throws IOException {
File[] refDirFiles = refDir.listFiles();
if (refDirFiles == null) {
throw new IOException("Reference directory not found: " + refDir.getAbsolutePath());
}
int ln = refDirFiles.length;
ArrayList list = new ArrayList(ln);
boolean changed = false;
for (int i = 0; i < ln; i++) {
String name = refDirFiles[i].getName().toLowerCase();
if (!name.equals("cvs") && !name.startsWith(".#") && !name.equals(".svn") && !name.equals(".gitignore")) {
list.add(refDirFiles[i]);
} else {
changed = true;
}
}
if (changed) {
ln = list.size();
refDirFiles = new File[ln];
for (int i = 0; i < ln; i++) {
refDirFiles[i] = (File) list.get(i);
}
}
return refDirFiles;
File[] chkedDirFiles = chkedDir.listFiles();
if (chkedDirFiles == null) {
throw new IOException("Checked directory not found: " + chkedDir.getAbsolutePath());
}
<DeepExtract>
int ln = chkedDirFiles.length;
ArrayList list = new ArrayList(ln);
boolean changed = false;
for (int i = 0; i < ln; i++) {
String name = chkedDirFiles[i].getName().toLowerCase();
if (!name.equals("cvs") && !name.startsWith(".#") && !name.equals(".svn") && !name.equals(".gitignore")) {
list.add(chkedDirFiles[i]);
} else {
changed = true;
}
}
if (changed) {
ln = list.size();
chkedDirFiles = new File[ln];
for (int i = 0; i < ln; i++) {
chkedDirFiles[i] = (File) list.get(i);
}
}
return chkedDirFiles;
</DeepExtract>
for (int ci = 0; ci < chkedDirFiles.length; ci++) {
File cf = chkedDirFiles[ci];
boolean isDir = cf.isDirectory();
int ri = findCounterpart(refDirFiles, cf);
if (ri != -1) {
if (isDir) {
checkProjectOutput_compareDirs(env, refDirFiles[ri], cf);
} else {
checkProjectOutput_compareFiles(env, refDirFiles[ri], cf);
}
refDirFiles[ri] = null;
} else {
env.logDiff(FileUtil.getRelativePath(env.currentProjOutputDir, cf) + ": " + (isDir ? "Directory" : "File") + " shouldn't exist.");
}
}
for (int ri = 0; ri < refDirFiles.length; ri++) {
File rf = refDirFiles[ri];
if (rf != null) {
env.logDiff(FileUtil.getRelativePath(env.currentProjRefDir, rf) + ": " + (rf.isDirectory() ? "Directory" : "File") + " is missing.");
}
}
} | fmpp | positive | 2,699 |
public Criteria andTopicIdLessThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "topicId" + " cannot be null");
}
criteria.add(new Criterion("topic_id <=", value));
return (Criteria) this;
} | public Criteria andTopicIdLessThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "topicId" + " cannot be null");
}
criteria.add(new Criterion("topic_id <=", value));
</DeepExtract>
return (Criteria) this;
} | zheng-lite | positive | 2,700 |
public void validate(BPMNProcess process, ValidationResult result) throws ValidationException {
String processAsString = xmlOutputter.outputString(process.getProcessAsDoc());
LOGGER.debug(processAsString);
if (process.hasConditionalSeqFlowTasks()) {
result.addWarning(createMojoWarning("Unable to perform valid mojo execution. " + "Conditional sequence flows attached to tasks are not supported.", process));
return;
}
if (process.hasBoundaryEvents()) {
result.addWarning(createMojoWarning("Unable to perform valid mojo execution. " + "Boundary Events attached to tasks are not supported.", process));
return;
}
if (process.isMultiProcessModel()) {
result.addWarning(createMojoWarning("BPMN model contains more than one participant or process definition." + "mojo is not capable of analyzing collaborations or BPMN files containing more than one process correctly." + "Processes have been checked singularly instead.", process));
handleMultiProcessModel(process, result);
return;
}
AnalysisInformation analysisInformation = new AnalysisInformation();
List<Annotation> mojoResult = Collections.emptyList();
try {
mojoResult = mojo.verify(process.getBaseURI(), processAsString, "bpmn.xml", analysisInformation, StandardCharsets.UTF_8);
} catch (Exception e) {
LOGGER.warn("Validation of process " + process.getBaseURI() + " failed due to internal problems in mojo: ", e);
result.addWarning(createMojoWarning("Mojo validation failed due to internal problems.", process));
}
if (!mojoResult.isEmpty()) {
addMojoResultToVerificationResult(mojoResult, result, process);
}
} | public void validate(BPMNProcess process, ValidationResult result) throws ValidationException {
String processAsString = xmlOutputter.outputString(process.getProcessAsDoc());
LOGGER.debug(processAsString);
if (process.hasConditionalSeqFlowTasks()) {
result.addWarning(createMojoWarning("Unable to perform valid mojo execution. " + "Conditional sequence flows attached to tasks are not supported.", process));
return;
}
if (process.hasBoundaryEvents()) {
result.addWarning(createMojoWarning("Unable to perform valid mojo execution. " + "Boundary Events attached to tasks are not supported.", process));
return;
}
if (process.isMultiProcessModel()) {
result.addWarning(createMojoWarning("BPMN model contains more than one participant or process definition." + "mojo is not capable of analyzing collaborations or BPMN files containing more than one process correctly." + "Processes have been checked singularly instead.", process));
handleMultiProcessModel(process, result);
return;
}
<DeepExtract>
AnalysisInformation analysisInformation = new AnalysisInformation();
List<Annotation> mojoResult = Collections.emptyList();
try {
mojoResult = mojo.verify(process.getBaseURI(), processAsString, "bpmn.xml", analysisInformation, StandardCharsets.UTF_8);
} catch (Exception e) {
LOGGER.warn("Validation of process " + process.getBaseURI() + " failed due to internal problems in mojo: ", e);
result.addWarning(createMojoWarning("Mojo validation failed due to internal problems.", process));
}
if (!mojoResult.isEmpty()) {
addMojoResultToVerificationResult(mojoResult, result, process);
}
</DeepExtract>
} | BPMNspector | positive | 2,701 |
public static void main(String[] args) {
int[] A = { 1, 5, 10, 20, 40, 80, 100, 100 };
int[] B = { 6, 7, 20, 80, 100, 100 };
int[] C = { 3, 4, 15, 20, 30, 70, 80, 100, 100, 120 };
int i = 0, j = 0, k = 0;
int last = 0;
while (i < A.length && j < B.length && k < C.length) {
if (A[i] > B[j] && A[i] > C[k]) {
j++;
k++;
} else if (B[j] > A[i] && B[j] > C[k]) {
i++;
k++;
} else if (C[k] > A[i] && C[k] > B[j]) {
i++;
j++;
} else if (A[i] == B[j] && A[i] == C[k]) {
if (last != A[i])
System.out.println(A[i]);
last = A[i];
i++;
k++;
j++;
} else if (A[i] < B[j] || A[i] < C[k]) {
i++;
} else if (B[j] < A[i] || B[j] < C[k]) {
j++;
} else if (C[k] < A[i] || C[k] < B[j]) {
k++;
}
}
} | public static void main(String[] args) {
int[] A = { 1, 5, 10, 20, 40, 80, 100, 100 };
int[] B = { 6, 7, 20, 80, 100, 100 };
int[] C = { 3, 4, 15, 20, 30, 70, 80, 100, 100, 120 };
<DeepExtract>
int i = 0, j = 0, k = 0;
int last = 0;
while (i < A.length && j < B.length && k < C.length) {
if (A[i] > B[j] && A[i] > C[k]) {
j++;
k++;
} else if (B[j] > A[i] && B[j] > C[k]) {
i++;
k++;
} else if (C[k] > A[i] && C[k] > B[j]) {
i++;
j++;
} else if (A[i] == B[j] && A[i] == C[k]) {
if (last != A[i])
System.out.println(A[i]);
last = A[i];
i++;
k++;
j++;
} else if (A[i] < B[j] || A[i] < C[k]) {
i++;
} else if (B[j] < A[i] || B[j] < C[k]) {
j++;
} else if (C[k] < A[i] || C[k] < B[j]) {
k++;
}
}
</DeepExtract>
} | Java-Solutions | positive | 2,702 |
public boolean validateDialog() {
if (isExampleSelected()) {
if (dialog != null)
dialog.updateControls(true);
clearMessage();
return true;
}
final String item = (String) getComponentSelection().getSelectedItem();
if (item == null || item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) {
if (dialog != null)
dialog.updateControls(false);
diplayMessage("Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API", true);
return false;
} else if (!isExampleSelected()) {
if (dialog != null)
dialog.updateControls(false);
diplayMessage(AsposeConstants.ASPOSE_SELECT_EXAMPLE, true);
return false;
}
if (dialog != null)
dialog.updateControls(true);
jLabelMessage.setText("");
return true;
} | public boolean validateDialog() {
if (isExampleSelected()) {
if (dialog != null)
dialog.updateControls(true);
clearMessage();
return true;
}
final String item = (String) getComponentSelection().getSelectedItem();
if (item == null || item.equals(AsposeConstants.API_DEPENDENCY_NOT_FOUND)) {
if (dialog != null)
dialog.updateControls(false);
diplayMessage("Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API", true);
return false;
} else if (!isExampleSelected()) {
if (dialog != null)
dialog.updateControls(false);
diplayMessage(AsposeConstants.ASPOSE_SELECT_EXAMPLE, true);
return false;
}
if (dialog != null)
dialog.updateControls(true);
<DeepExtract>
jLabelMessage.setText("");
</DeepExtract>
return true;
} | Aspose.BarCode-for-Java | positive | 2,704 |
@Override
public void onClick(View v) {
root.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
TransitionHelper.startExitAnim(root);
}
});
WaterFragment waterFragment = new WaterFragment();
this.introAnimate = true;
((RootActivity) getActivity()).goToFragment(waterFragment);
if (((RootActivity) getActivity()).isMenuVisible)
((RootActivity) getActivity()).hideMenu();
View actionbarShadow = root.findViewById(R.id.actionbar_shadow);
actionbarShadow.setVisibility(View.GONE);
bearsScene.setPause(true);
} | @Override
public void onClick(View v) {
root.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
root.getViewTreeObserver().removeOnGlobalLayoutListener(this);
TransitionHelper.startExitAnim(root);
}
});
WaterFragment waterFragment = new WaterFragment();
this.introAnimate = true;
((RootActivity) getActivity()).goToFragment(waterFragment);
if (((RootActivity) getActivity()).isMenuVisible)
((RootActivity) getActivity()).hideMenu();
<DeepExtract>
View actionbarShadow = root.findViewById(R.id.actionbar_shadow);
actionbarShadow.setVisibility(View.GONE);
</DeepExtract>
bearsScene.setPause(true);
} | Depth | positive | 2,705 |
public void insert(long key, byte[] data) throws IOException {
if (DATA_HEADER_SIZE + BLOB_HEADER_SIZE + data.length > mMaxBytes) {
throw new RuntimeException("blob is too large!");
}
if (mActiveBytes + BLOB_HEADER_SIZE + data.length > mMaxBytes || mActiveEntries * 2 >= mMaxEntries) {
flipRegion();
}
if (!lookupInternal(key, mActiveHashStart)) {
mActiveEntries++;
writeInt(mIndexHeader, IH_ACTIVE_ENTRIES, mActiveEntries);
}
byte[] header = mBlobHeader;
int sum = checkSum(data);
writeLong(header, BH_KEY, key);
writeInt(header, BH_CHECKSUM, sum);
writeInt(header, BH_OFFSET, mActiveBytes);
writeInt(header, BH_LENGTH, data.length);
mActiveDataFile.write(header);
mActiveDataFile.write(data, 0, data.length);
mIndexBuffer.putLong(mSlotOffset, key);
mIndexBuffer.putInt(mSlotOffset + 8, mActiveBytes);
mActiveBytes += BLOB_HEADER_SIZE + data.length;
writeInt(mIndexHeader, IH_ACTIVE_BYTES, mActiveBytes);
writeInt(mIndexHeader, IH_CHECKSUM, checkSum(mIndexHeader, 0, IH_CHECKSUM));
mIndexBuffer.position(0);
mIndexBuffer.put(mIndexHeader);
} | public void insert(long key, byte[] data) throws IOException {
if (DATA_HEADER_SIZE + BLOB_HEADER_SIZE + data.length > mMaxBytes) {
throw new RuntimeException("blob is too large!");
}
if (mActiveBytes + BLOB_HEADER_SIZE + data.length > mMaxBytes || mActiveEntries * 2 >= mMaxEntries) {
flipRegion();
}
if (!lookupInternal(key, mActiveHashStart)) {
mActiveEntries++;
writeInt(mIndexHeader, IH_ACTIVE_ENTRIES, mActiveEntries);
}
byte[] header = mBlobHeader;
int sum = checkSum(data);
writeLong(header, BH_KEY, key);
writeInt(header, BH_CHECKSUM, sum);
writeInt(header, BH_OFFSET, mActiveBytes);
writeInt(header, BH_LENGTH, data.length);
mActiveDataFile.write(header);
mActiveDataFile.write(data, 0, data.length);
mIndexBuffer.putLong(mSlotOffset, key);
mIndexBuffer.putInt(mSlotOffset + 8, mActiveBytes);
mActiveBytes += BLOB_HEADER_SIZE + data.length;
writeInt(mIndexHeader, IH_ACTIVE_BYTES, mActiveBytes);
<DeepExtract>
writeInt(mIndexHeader, IH_CHECKSUM, checkSum(mIndexHeader, 0, IH_CHECKSUM));
mIndexBuffer.position(0);
mIndexBuffer.put(mIndexHeader);
</DeepExtract>
} | aMysqlClient | positive | 2,706 |
@Override
public void update(long value) {
super.update(value);
String metricType = this.getClass().getSuperclass().getSimpleName();
metricUpdateTracer.log(Level.FINE, "Updated " + metricType + ":" + this.getMetricName());
} | @Override
public void update(long value) {
super.update(value);
<DeepExtract>
String metricType = this.getClass().getSuperclass().getSimpleName();
metricUpdateTracer.log(Level.FINE, "Updated " + metricType + ":" + this.getMetricName());
</DeepExtract>
} | JInsight | positive | 2,708 |
public Map[] agencyDailyStatistics(Integer id, Date startDate) throws XmlRpcException {
if (!isValidSessionId())
throw new IllegalArgumentException("Not logined to server");
return agencyService.agencyDailyStatistics(id, startDate);
} | public Map[] agencyDailyStatistics(Integer id, Date startDate) throws XmlRpcException {
<DeepExtract>
if (!isValidSessionId())
throw new IllegalArgumentException("Not logined to server");
</DeepExtract>
return agencyService.agencyDailyStatistics(id, startDate);
} | openx-2.8.8 | positive | 2,709 |
public void actionPerformed(ActionEvent ev) {
selectedCorpus.setFilter(filterField.getText());
selectedCorpus.writeDocumentList();
Container contentPane = mainFrame.getContentPane();
contentPane.removeAll();
assembleFrame(contentPane);
mainFrame.validate();
mainFrame.repaint();
} | public void actionPerformed(ActionEvent ev) {
selectedCorpus.setFilter(filterField.getText());
selectedCorpus.writeDocumentList();
<DeepExtract>
Container contentPane = mainFrame.getContentPane();
contentPane.removeAll();
assembleFrame(contentPane);
mainFrame.validate();
mainFrame.repaint();
</DeepExtract>
} | ice | positive | 2,710 |
@Override
public void onChanged() {
if (mHeader != null) {
removeView(mHeader);
mHeader = null;
mHeaderId = null;
mHeaderPosition = null;
mHeaderOffset = null;
mList.setTopClippingLength(0);
updateHeaderVisibilities();
}
} | @Override
public void onChanged() {
<DeepExtract>
if (mHeader != null) {
removeView(mHeader);
mHeader = null;
mHeaderId = null;
mHeaderPosition = null;
mHeaderOffset = null;
mList.setTopClippingLength(0);
updateHeaderVisibilities();
}
</DeepExtract>
} | ele_demo | positive | 2,711 |
@Override
public void buttonPressed(Button button) {
Component component = inputs.get(inputs.size() - 1);
remove(component);
inputs.remove(component);
removeInputButton.setEnabled(inputs.size() > 1);
} | @Override
public void buttonPressed(Button button) {
<DeepExtract>
Component component = inputs.get(inputs.size() - 1);
remove(component);
inputs.remove(component);
removeInputButton.setEnabled(inputs.size() > 1);
</DeepExtract>
} | Piwigo-Java | positive | 2,712 |
@Override
public List<TableData> transformParseTree(List<CreateTableStatement> createTableStatements) {
List<TableData> tableData = new ArrayList<TableData>();
for (CreateTableStatement statement : createTableStatements) {
tableData.add(transformCreateTableStatement(statement));
}
return tableData;
} | @Override
public List<TableData> transformParseTree(List<CreateTableStatement> createTableStatements) {
<DeepExtract>
List<TableData> tableData = new ArrayList<TableData>();
for (CreateTableStatement statement : createTableStatements) {
tableData.add(transformCreateTableStatement(statement));
}
return tableData;
</DeepExtract>
} | Tosa | positive | 2,714 |
public void setNetworkName(String networkName) throws IOException {
this.networkName = networkName;
if (!connected)
return;
MultiuserNetworkNamePacket network = new MultiuserNetworkNamePacket(networkName);
if (!MultiuserPacket.legalMultiuserType(network.getType()))
throw new IOException("Illegal packet type!");
ptmpConnection.send(network);
} | public void setNetworkName(String networkName) throws IOException {
this.networkName = networkName;
if (!connected)
return;
MultiuserNetworkNamePacket network = new MultiuserNetworkNamePacket(networkName);
<DeepExtract>
if (!MultiuserPacket.legalMultiuserType(network.getType()))
throw new IOException("Illegal packet type!");
ptmpConnection.send(network);
</DeepExtract>
} | ptbridge | positive | 2,715 |
@Override
public void setSurface(Surface surface) {
if (mScreenOnWhilePlaying && surface != null) {
DebugLog.w(TAG, "setScreenOnWhilePlaying(true) is ineffective for Surface");
}
mSurfaceHolder = null;
_setVideoSurface(surface);
if (mSurfaceHolder != null) {
mSurfaceHolder.setKeepScreenOn(mScreenOnWhilePlaying && mStayAwake);
}
} | @Override
public void setSurface(Surface surface) {
if (mScreenOnWhilePlaying && surface != null) {
DebugLog.w(TAG, "setScreenOnWhilePlaying(true) is ineffective for Surface");
}
mSurfaceHolder = null;
_setVideoSurface(surface);
<DeepExtract>
if (mSurfaceHolder != null) {
mSurfaceHolder.setKeepScreenOn(mScreenOnWhilePlaying && mStayAwake);
}
</DeepExtract>
} | IjkplayerDemo | positive | 2,716 |
@Override
public void run() {
for (JarFile jarFile : lstJarFile) {
try {
jarFile.close();
} catch (IOException e) {
}
}
String sPersistentFile = System.getProperty("user.home") + File.separator + ".JarClassLoader";
deleteOldNative(sPersistentFile);
persistNewNative(sPersistentFile);
} | @Override
public void run() {
<DeepExtract>
for (JarFile jarFile : lstJarFile) {
try {
jarFile.close();
} catch (IOException e) {
}
}
String sPersistentFile = System.getProperty("user.home") + File.separator + ".JarClassLoader";
deleteOldNative(sPersistentFile);
persistNewNative(sPersistentFile);
</DeepExtract>
} | fsoinstaller | positive | 2,717 |
public Criteria andColIdIsNull() {
if ("id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("id is null"));
return (Criteria) this;
} | public Criteria andColIdIsNull() {
<DeepExtract>
if ("id is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("id is null"));
</DeepExtract>
return (Criteria) this;
} | Resource | positive | 2,718 |
@Override
public void gameStarted(Field field) {
launchBarrier = field.getFieldElementById("LaunchBarrier");
topBlocker = field.getFieldElementById("TopRampBlocker");
rightKicker = field.getFieldElementById("RightRampKicker");
multiballKickers = Arrays.asList(field.getFieldElementById("MultiballKicker1"), field.getFieldElementById("MultiballKicker2"), field.getFieldElementById("MultiballKicker3"));
lockedBallRollovers = Arrays.asList(field.getFieldElementById("LockedBallRollover1"), field.getFieldElementById("LockedBallRollover2"), field.getFieldElementById("LockedBallRollover3"));
for (RolloverGroupElement rollover : lockedBallRollovers) {
rollover.setRolloverActiveAtIndex(0, false);
rollover.setVisible(false);
rollover.setIgnoreBall(true);
}
lockedBallKickers = Arrays.asList(field.getFieldElementById("LockedBallKicker1"), field.getFieldElementById("LockedBallKicker2"), field.getFieldElementById("LockedBallKicker3"));
lockedBallKickers.get(1).setRetracted(true);
lockedBallKickers.get(2).setRetracted(true);
multiballStatusRollovers = new HashMap<>();
for (String suffix : COLOR_SUFFIXES) {
multiballStatusRollovers.put(suffix, field.getFieldElementById("Rollovers." + suffix));
}
setAllMultiballStatusRolloversActive(false);
setIgnoreBallForMultiballStatusRollovers(true);
ballsLocked = 0;
inMultiball = false;
isMultiballStarting = false;
launchBarrier.setRetracted(true);
rightKicker.setRetracted(true);
} | @Override
public void gameStarted(Field field) {
launchBarrier = field.getFieldElementById("LaunchBarrier");
topBlocker = field.getFieldElementById("TopRampBlocker");
rightKicker = field.getFieldElementById("RightRampKicker");
multiballKickers = Arrays.asList(field.getFieldElementById("MultiballKicker1"), field.getFieldElementById("MultiballKicker2"), field.getFieldElementById("MultiballKicker3"));
lockedBallRollovers = Arrays.asList(field.getFieldElementById("LockedBallRollover1"), field.getFieldElementById("LockedBallRollover2"), field.getFieldElementById("LockedBallRollover3"));
for (RolloverGroupElement rollover : lockedBallRollovers) {
rollover.setRolloverActiveAtIndex(0, false);
rollover.setVisible(false);
rollover.setIgnoreBall(true);
}
lockedBallKickers = Arrays.asList(field.getFieldElementById("LockedBallKicker1"), field.getFieldElementById("LockedBallKicker2"), field.getFieldElementById("LockedBallKicker3"));
lockedBallKickers.get(1).setRetracted(true);
lockedBallKickers.get(2).setRetracted(true);
multiballStatusRollovers = new HashMap<>();
for (String suffix : COLOR_SUFFIXES) {
multiballStatusRollovers.put(suffix, field.getFieldElementById("Rollovers." + suffix));
}
<DeepExtract>
setAllMultiballStatusRolloversActive(false);
setIgnoreBallForMultiballStatusRollovers(true);
ballsLocked = 0;
inMultiball = false;
isMultiballStarting = false;
</DeepExtract>
launchBarrier.setRetracted(true);
rightKicker.setRetracted(true);
} | Vector-Pinball | positive | 2,719 |
public void computeProperties() {
enginePower = new EnginePower(INITIAL_ENGINE_POWER);
fuelCapacity = new FuelCapacity(INITIAL_FUEL_CAPACITY);
luck = new Luck(INITIAL_LUCK);
shieldCapacity = new ShieldCapacity(INITIAL_SHIELD_CAPACITY);
landslide = new Landslide(INITIAL_LANDSLIDE);
scanRadius = new ScanRadius(INITIAL_SCAN_RADIUS);
inertia = new Inertia(INITIAL_INERTIA);
for (Attribute attribute : getAttributes()) {
for (Alien alien : aliens) {
alien.modifyAttribute(attribute);
}
}
} | public void computeProperties() {
<DeepExtract>
enginePower = new EnginePower(INITIAL_ENGINE_POWER);
fuelCapacity = new FuelCapacity(INITIAL_FUEL_CAPACITY);
luck = new Luck(INITIAL_LUCK);
shieldCapacity = new ShieldCapacity(INITIAL_SHIELD_CAPACITY);
landslide = new Landslide(INITIAL_LANDSLIDE);
scanRadius = new ScanRadius(INITIAL_SCAN_RADIUS);
inertia = new Inertia(INITIAL_INERTIA);
</DeepExtract>
for (Attribute attribute : getAttributes()) {
for (Alien alien : aliens) {
alien.modifyAttribute(attribute);
}
}
} | Alien-Ark | positive | 2,720 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle("Choose Bible File");
chooser.showOpenDialog(this);
if (chooser.getSelectedFile() == null)
return;
try {
BibleKeeper.getInstance().loadBible(chooser.getSelectedFile());
versionlabel.setText("<html>Current: " + chooser.getSelectedFile().getName() + "</html>");
submitScripture();
} catch (IOException ex) {
Logger.getLogger(AddBibleDialog.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, "Can't open Bible File");
} catch (JDOMException ex) {
Logger.getLogger(AddBibleDialog.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, "Can't open Bible File");
}
} | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
JFileChooser chooser = new JFileChooser();
chooser.setDialogTitle("Choose Bible File");
chooser.showOpenDialog(this);
if (chooser.getSelectedFile() == null)
return;
try {
BibleKeeper.getInstance().loadBible(chooser.getSelectedFile());
versionlabel.setText("<html>Current: " + chooser.getSelectedFile().getName() + "</html>");
submitScripture();
} catch (IOException ex) {
Logger.getLogger(AddBibleDialog.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, "Can't open Bible File");
} catch (JDOMException ex) {
Logger.getLogger(AddBibleDialog.class.getName()).log(Level.SEVERE, null, ex);
JOptionPane.showMessageDialog(this, "Can't open Bible File");
}
</DeepExtract>
} | epicworship | positive | 2,721 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<html><head><title>Sample Wab Application Bundle</title></head></html>");
out.println("<body><h1>");
out.println("Web Application Bundle");
out.println("</h1></body></html>");
} | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
<DeepExtract>
PrintWriter out = response.getWriter();
out.println("<html><head><title>Sample Wab Application Bundle</title></head></html>");
out.println("<body><h1>");
out.println("Web Application Bundle");
out.println("</h1></body></html>");
</DeepExtract>
} | ci.maven | positive | 2,722 |
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME + ";");
db.execSQL("DROP TABLE IF EXISTS " + DRAFT_TABLE_NAME + ";");
db.execSQL("CREATE TABLE " + TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, localContact TEXT NOT NULL, remoteContact TEXT NOT NULL, direction INTEGER, message TEXT, image BLOB, url TEXT, time NUMERIC, read INTEGER, status INTEGER);");
db.execSQL("CREATE TABLE " + DRAFT_TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, remoteContact TEXT NOT NULL, message TEXT);");
} | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME + ";");
db.execSQL("DROP TABLE IF EXISTS " + DRAFT_TABLE_NAME + ";");
<DeepExtract>
db.execSQL("CREATE TABLE " + TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, localContact TEXT NOT NULL, remoteContact TEXT NOT NULL, direction INTEGER, message TEXT, image BLOB, url TEXT, time NUMERIC, read INTEGER, status INTEGER);");
db.execSQL("CREATE TABLE " + DRAFT_TABLE_NAME + " (id INTEGER PRIMARY KEY AUTOINCREMENT, remoteContact TEXT NOT NULL, message TEXT);");
</DeepExtract>
} | linphone-android | positive | 2,723 |
private static String timestamp(long startTime) {
double elapsedMillis = (System.nanoTime() - startTime) / 1000000.0;
String tString = String.valueOf(elapsedMillis);
StringBuilder sb = new StringBuilder("t=");
sb.append(tString);
int n = 10 - tString.length();
for (int i = 0; i < n; i++) {
sb.append('0');
}
return Strings.encode(buf, 0, count, Strings.HEX);
} | private static String timestamp(long startTime) {
double elapsedMillis = (System.nanoTime() - startTime) / 1000000.0;
String tString = String.valueOf(elapsedMillis);
StringBuilder sb = new StringBuilder("t=");
sb.append(tString);
int n = 10 - tString.length();
for (int i = 0; i < n; i++) {
sb.append('0');
}
<DeepExtract>
return Strings.encode(buf, 0, count, Strings.HEX);
</DeepExtract>
} | headlong | positive | 2,725 |
@Override
public boolean contains(Object o) {
int hash = hashOf(o);
return segmentFor(hash).containsKey(o, hash);
} | @Override
public boolean contains(Object o) {
<DeepExtract>
int hash = hashOf(o);
return segmentFor(hash).containsKey(o, hash);
</DeepExtract>
} | webx-restful | positive | 2,726 |
@Override
public void onDetailsClicked(Message message, Dialog dialog) {
PreviewMessageDialog.startDialog(getActivity(), message, activeUser);
} | @Override
public void onDetailsClicked(Message message, Dialog dialog) {
<DeepExtract>
PreviewMessageDialog.startDialog(getActivity(), message, activeUser);
</DeepExtract>
} | Spika | positive | 2,727 |
@Deprecated
public String getCustomerKey() {
return key;
} | @Deprecated
public String getCustomerKey() {
<DeepExtract>
return key;
</DeepExtract>
} | FuelSDK-Java | positive | 2,729 |
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
if (jobUri == null)
return;
String printer = (String) printersListView.getItemAtPosition(position);
ini.setDefaultPrinter(printer);
Intent sendIntent = new Intent(this, PrintJobActivity.class);
sendIntent.putExtra("type", "static");
sendIntent.putExtra("printer", printer);
sendIntent.putExtra("mimeType", mimeType);
sendIntent.setData(jobUri);
this.startActivityForResult(sendIntent, 500);
} | @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
if (jobUri == null)
return;
String printer = (String) printersListView.getItemAtPosition(position);
ini.setDefaultPrinter(printer);
<DeepExtract>
Intent sendIntent = new Intent(this, PrintJobActivity.class);
sendIntent.putExtra("type", "static");
sendIntent.putExtra("printer", printer);
sendIntent.putExtra("mimeType", mimeType);
sendIntent.setData(jobUri);
this.startActivityForResult(sendIntent, 500);
</DeepExtract>
} | JfCupsPrintService | positive | 2,730 |
@Subscribe
public void onUploadError(UploadErrorEvent event) {
UUID videoId = event.getVideoId();
String message = event.getErrorMessage();
this.adapter.hideProgress(videoId);
if (message == null) {
message = getString(R.string.upload_error);
}
SnackbarManager.show(Snackbar.with(getActivity()).text(message));
} | @Subscribe
public void onUploadError(UploadErrorEvent event) {
<DeepExtract>
UUID videoId = event.getVideoId();
String message = event.getErrorMessage();
this.adapter.hideProgress(videoId);
if (message == null) {
message = getString(R.string.upload_error);
}
SnackbarManager.show(Snackbar.with(getActivity()).text(message));
</DeepExtract>
} | AchSo | positive | 2,731 |
public void connect(BleConnectOptions options, BleGeneralResponse response) {
checkRuntime();
if (mBleWorkList.size() < MAX_REQUEST_COUNT) {
new BleConnectRequest(options, response).setRuntimeChecker(this);
new BleConnectRequest(options, response).setAddress(mAddress);
new BleConnectRequest(options, response).setWorker(mWorker);
mBleWorkList.add(new BleConnectRequest(options, response));
} else {
new BleConnectRequest(options, response).onResponse(Code.REQUEST_OVERFLOW);
}
scheduleNextRequest(10);
} | public void connect(BleConnectOptions options, BleGeneralResponse response) {
<DeepExtract>
checkRuntime();
if (mBleWorkList.size() < MAX_REQUEST_COUNT) {
new BleConnectRequest(options, response).setRuntimeChecker(this);
new BleConnectRequest(options, response).setAddress(mAddress);
new BleConnectRequest(options, response).setWorker(mWorker);
mBleWorkList.add(new BleConnectRequest(options, response));
} else {
new BleConnectRequest(options, response).onResponse(Code.REQUEST_OVERFLOW);
}
scheduleNextRequest(10);
</DeepExtract>
} | Android-BluetoothKit | positive | 2,732 |
public Extension getExtension(Char c, int style) {
Typeface f = c.getFont();
int fc = c.getFontCode();
float s;
if (style < TeXConstants.STYLE_TEXT)
s = 1;
else if (style < TeXConstants.STYLE_SCRIPT)
s = generalSettings.get("textfactor").floatValue();
else if (style < TeXConstants.STYLE_SCRIPT_SCRIPT)
s = generalSettings.get("scriptfactor").floatValue();
else
s = generalSettings.get("scriptscriptfactor").floatValue();
FontInfo info = fontInfo[fc];
int[] ext = info.getExtension(c.getChar());
Char[] parts = new Char[ext.length];
for (int i = 0; i < ext.length; i++) {
if (ext[i] == NONE) {
parts[i] = null;
} else {
parts[i] = new Char((char) ext[i], f, fc, getMetrics(new CharFont((char) ext[i], fc), s));
}
}
return new Extension(parts[TOP], parts[MID], parts[REP], parts[BOT]);
} | public Extension getExtension(Char c, int style) {
Typeface f = c.getFont();
int fc = c.getFontCode();
<DeepExtract>
float s;
if (style < TeXConstants.STYLE_TEXT)
s = 1;
else if (style < TeXConstants.STYLE_SCRIPT)
s = generalSettings.get("textfactor").floatValue();
else if (style < TeXConstants.STYLE_SCRIPT_SCRIPT)
s = generalSettings.get("scriptfactor").floatValue();
else
s = generalSettings.get("scriptscriptfactor").floatValue();
</DeepExtract>
FontInfo info = fontInfo[fc];
int[] ext = info.getExtension(c.getChar());
Char[] parts = new Char[ext.length];
for (int i = 0; i < ext.length; i++) {
if (ext[i] == NONE) {
parts[i] = null;
} else {
parts[i] = new Char((char) ext[i], f, fc, getMetrics(new CharFont((char) ext[i], fc), s));
}
}
return new Extension(parts[TOP], parts[MID], parts[REP], parts[BOT]);
} | jlatexmath-android | positive | 2,733 |
public void addEntity(Entity unit) {
if ((unit.getCurrentPosition().getTileY() >= 0) && (unit.getCurrentPosition().getTileX() >= 0) && (unit.getCurrentPosition().getTileX() <= getWidth()) && (unit.getCurrentPosition().getTileY() <= getHeight())) {
final int originalScore = stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].getScore();
final int newScore = unit.getScore();
final int difference = newScore - originalScore;
score += difference;
stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].setUnit(unit);
stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].setOccupied(true);
units.put(unit.getEntityID(), unit);
unit.setOnlyCurrentPosition(new TiledMapPosition().setPositionFromTiles(unit.getCurrentPosition().getTileX(), unit.getCurrentPosition().getTileY()));
}
} | public void addEntity(Entity unit) {
<DeepExtract>
if ((unit.getCurrentPosition().getTileY() >= 0) && (unit.getCurrentPosition().getTileX() >= 0) && (unit.getCurrentPosition().getTileX() <= getWidth()) && (unit.getCurrentPosition().getTileY() <= getHeight())) {
final int originalScore = stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].getScore();
final int newScore = unit.getScore();
final int difference = newScore - originalScore;
score += difference;
stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].setUnit(unit);
stateOfField[unit.getCurrentPosition().getTileX()][unit.getCurrentPosition().getTileY()].setOccupied(true);
units.put(unit.getEntityID(), unit);
unit.setOnlyCurrentPosition(new TiledMapPosition().setPositionFromTiles(unit.getCurrentPosition().getTileX(), unit.getCurrentPosition().getTileY()));
}
</DeepExtract>
} | Norii | positive | 2,734 |
private void working() {
if (rootDir == null || !rootDir.exists())
return;
if (rootDir.isFile()) {
try {
curScan.put(rootDir.getCanonicalPath(), new TimeSize(rootDir.lastModified(), rootDir.length()));
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
} else if (rootDir.isDirectory()) {
File[] fs = rootDir.listFiles();
if (fs != null)
for (File f : fs) scan(f);
}
if (preScan.size() == 0)
return;
if (!preScan.equals(curScan))
onChange();
preScan.clear();
preScan.putAll(curScan);
curScan.clear();
} | private void working() {
if (rootDir == null || !rootDir.exists())
return;
if (rootDir.isFile()) {
try {
curScan.put(rootDir.getCanonicalPath(), new TimeSize(rootDir.lastModified(), rootDir.length()));
} catch (IOException e) {
logger.error(e.getMessage(), e);
}
} else if (rootDir.isDirectory()) {
File[] fs = rootDir.listFiles();
if (fs != null)
for (File f : fs) scan(f);
}
<DeepExtract>
if (preScan.size() == 0)
return;
if (!preScan.equals(curScan))
onChange();
</DeepExtract>
preScan.clear();
preScan.putAll(curScan);
curScan.clear();
} | ICERest | positive | 2,738 |
@SuppressWarnings("unused")
public Boolean getPositionAccurate() {
return getDecodedValue(() -> positionAccuracy, value -> positionAccuracy = value, () -> Boolean.TRUE, () -> BOOLEAN_DECODER.apply(getBits(56, 57)));
} | @SuppressWarnings("unused")
public Boolean getPositionAccurate() {
<DeepExtract>
return getDecodedValue(() -> positionAccuracy, value -> positionAccuracy = value, () -> Boolean.TRUE, () -> BOOLEAN_DECODER.apply(getBits(56, 57)));
</DeepExtract>
} | aismessages | positive | 2,739 |
private void addIngestionResource(String resourceTypeName, String storageUrl) throws URISyntaxException {
ResourceType resourceType;
for (ResourceType resourceType : values()) {
if (resourceType.resourceTypeName.equalsIgnoreCase(resourceTypeName)) {
resourceType = resourceType;
}
}
throw new IllegalArgumentException(resourceTypeName);
switch(resourceType) {
case TEMP_STORAGE:
this.containers.addResource(new ContainerWithSas(storageUrl, httpClient));
break;
case INGESTIONS_STATUS_TABLE:
this.statusTable.addResource(new TableWithSas(storageUrl, httpClient));
break;
case SECURED_READY_FOR_AGGREGATION_QUEUE:
this.queues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
case SUCCESSFUL_INGESTIONS_QUEUE:
this.successfulIngestionsQueues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
case FAILED_INGESTIONS_QUEUE:
this.failedIngestionsQueues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
default:
throw new IllegalStateException("Unexpected value: " + resourceType);
}
} | private void addIngestionResource(String resourceTypeName, String storageUrl) throws URISyntaxException {
<DeepExtract>
ResourceType resourceType;
for (ResourceType resourceType : values()) {
if (resourceType.resourceTypeName.equalsIgnoreCase(resourceTypeName)) {
resourceType = resourceType;
}
}
throw new IllegalArgumentException(resourceTypeName);
</DeepExtract>
switch(resourceType) {
case TEMP_STORAGE:
this.containers.addResource(new ContainerWithSas(storageUrl, httpClient));
break;
case INGESTIONS_STATUS_TABLE:
this.statusTable.addResource(new TableWithSas(storageUrl, httpClient));
break;
case SECURED_READY_FOR_AGGREGATION_QUEUE:
this.queues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
case SUCCESSFUL_INGESTIONS_QUEUE:
this.successfulIngestionsQueues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
case FAILED_INGESTIONS_QUEUE:
this.failedIngestionsQueues.addResource(new QueueWithSas(storageUrl, httpClient, this.queueRequestOptions));
break;
default:
throw new IllegalStateException("Unexpected value: " + resourceType);
}
} | azure-kusto-java | positive | 2,740 |
public void engineInitDecrypt(byte[] key) throws CryptoException {
if (key == null)
throw new CryptoException(getAlgorithm() + ": Null user key");
int len = key.length;
if (len == 0)
throw new CryptoException(getAlgorithm() + ": Invalid user key length");
x = y = 0;
for (int i = 0; i < 256; i++) sBox[i] = i;
int i1 = 0, i2 = 0, t;
for (int i = 0; i < 256; i++) {
i2 = ((key[i1] & 0xFF) + sBox[i] + i2) & 0xFF;
t = sBox[i];
sBox[i] = sBox[i2];
sBox[i2] = t;
i1 = (i1 + 1) % len;
}
state = ENCRYPT;
} | public void engineInitDecrypt(byte[] key) throws CryptoException {
<DeepExtract>
if (key == null)
throw new CryptoException(getAlgorithm() + ": Null user key");
int len = key.length;
if (len == 0)
throw new CryptoException(getAlgorithm() + ": Invalid user key length");
x = y = 0;
for (int i = 0; i < 256; i++) sBox[i] = i;
int i1 = 0, i2 = 0, t;
for (int i = 0; i < 256; i++) {
i2 = ((key[i1] & 0xFF) + sBox[i] + i2) & 0xFF;
t = sBox[i];
sBox[i] = sBox[i2];
sBox[i2] = t;
i1 = (i1 + 1) % len;
}
</DeepExtract>
state = ENCRYPT;
} | JavaRDP | positive | 2,741 |
public String getDockerHubUrl() {
String name = dockerHubUrl.getName();
T tValue = dockerHubUrl.getValue();
Class<T> type = dockerHubUrl.getType();
return resolver(name, tValue, type);
} | public String getDockerHubUrl() {
<DeepExtract>
String name = dockerHubUrl.getName();
T tValue = dockerHubUrl.getValue();
Class<T> type = dockerHubUrl.getType();
return resolver(name, tValue, type);
</DeepExtract>
} | webdrivermanager | positive | 2,742 |
@Test
public void onDSTOffsetReceived_invalid() {
final Data data = new Data(new byte[] { 17 });
success = false;
invalidData = false;
result = null;
super.onDataReceived(null, data);
assertTrue(invalidData);
} | @Test
public void onDSTOffsetReceived_invalid() {
final Data data = new Data(new byte[] { 17 });
<DeepExtract>
success = false;
invalidData = false;
result = null;
super.onDataReceived(null, data);
</DeepExtract>
assertTrue(invalidData);
} | Android-BLE-Common-Library | positive | 2,743 |
public Criteria andPositionGreaterThanOrEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "position" + " cannot be null");
}
criteria.add(new Criterion("position >=", value));
return (Criteria) this;
} | public Criteria andPositionGreaterThanOrEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "position" + " cannot be null");
}
criteria.add(new Criterion("position >=", value));
</DeepExtract>
return (Criteria) this;
} | tools-bar | positive | 2,745 |
public Criteria andMessageNotIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "message" + " cannot be null");
}
criteria.add(new Criterion("message not in", values));
return (Criteria) this;
} | public Criteria andMessageNotIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "message" + " cannot be null");
}
criteria.add(new Criterion("message not in", values));
</DeepExtract>
return (Criteria) this;
} | cloud | positive | 2,746 |
public static void write(boolean x) {
buffer <<= 1;
if (x)
buffer |= 1;
N++;
if (N == 8)
clearBuffer();
} | public static void write(boolean x) {
<DeepExtract>
buffer <<= 1;
if (x)
buffer |= 1;
N++;
if (N == 8)
clearBuffer();
</DeepExtract>
} | java_jail | positive | 2,747 |
public Criteria andUserNumberIsNotNull() {
if ("user_number is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("user_number is not null"));
return (Criteria) this;
} | public Criteria andUserNumberIsNotNull() {
<DeepExtract>
if ("user_number is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("user_number is not null"));
</DeepExtract>
return (Criteria) this;
} | SSM_BookSystem | positive | 2,748 |
@ResponseBody
@ExceptionHandler(value = IOException.class)
public ResponseEntity exceptionHandler(IOException exc) {
log.error("catch IOException: []", exc);
RetCode errorDetail;
RetCode response = ErrorCodeHandleUtils.handleErrorMsg(exc.getMessage());
if (response == null) {
errorDetail = new RetCode(500, exc.getMessage());
} else {
errorDetail = response;
}
Map<String, Object> map = new HashMap<>();
map.put("errorMessage", errorDetail.getMessage());
map.put("code", errorDetail.getCode());
log.warn("bindExceptionHandler return:{}", JsonUtils.toJSONString(map));
return ResponseEntity.status(500).body(map);
} | @ResponseBody
@ExceptionHandler(value = IOException.class)
public ResponseEntity exceptionHandler(IOException exc) {
log.error("catch IOException: []", exc);
<DeepExtract>
RetCode errorDetail;
RetCode response = ErrorCodeHandleUtils.handleErrorMsg(exc.getMessage());
if (response == null) {
errorDetail = new RetCode(500, exc.getMessage());
} else {
errorDetail = response;
}
</DeepExtract>
Map<String, Object> map = new HashMap<>();
map.put("errorMessage", errorDetail.getMessage());
map.put("code", errorDetail.getCode());
log.warn("bindExceptionHandler return:{}", JsonUtils.toJSONString(map));
return ResponseEntity.status(500).body(map);
} | WeBASE-Front | positive | 2,749 |
@Test
public void testServiceGet() throws SparkAPIClientException {
c.stubGet("/listings/20060725224713296297000000", "listing.json", 200);
ListingService s = new ListingService(c);
assertEquals("20060725224713296297000000", s.get("20060725224713296297000000").getId());
assertEquals("Bonners Ferry", s.get("20060725224713296297000000").getStandardFields().getCity());
assertEquals(s.get("20060725224713296297000000").getId(), s.get("20060725224713296297000000").getStandardFields().getListingKey());
assertEquals(0, s.get("20060725224713296297000000").getAttributes().size());
assertEquals(0, s.get("20060725224713296297000000").getStandardFields().getAttributes().size());
} | @Test
public void testServiceGet() throws SparkAPIClientException {
c.stubGet("/listings/20060725224713296297000000", "listing.json", 200);
ListingService s = new ListingService(c);
<DeepExtract>
assertEquals("20060725224713296297000000", s.get("20060725224713296297000000").getId());
assertEquals("Bonners Ferry", s.get("20060725224713296297000000").getStandardFields().getCity());
assertEquals(s.get("20060725224713296297000000").getId(), s.get("20060725224713296297000000").getStandardFields().getListingKey());
assertEquals(0, s.get("20060725224713296297000000").getAttributes().size());
assertEquals(0, s.get("20060725224713296297000000").getStandardFields().getAttributes().size());
</DeepExtract>
} | SparkJava | positive | 2,750 |
@Test
public void checkHelloObservable(TestContext context) {
checkRequest(200, "onetwo", "/hello-observable", context, null);
} | @Test
public void checkHelloObservable(TestContext context) {
<DeepExtract>
checkRequest(200, "onetwo", "/hello-observable", context, null);
</DeepExtract>
} | redpipe | positive | 2,751 |
public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LAPS);
db.execSQL("CREATE TABLE " + TABLE_LAPS + " (" + COLUMN_ID + " INTEGER PRIMARY KEY, " + COLUMN_T1 + " INTEGER NOT NULL, " + COLUMN_T2 + " INTEGER NOT NULL, " + COLUMN_PAUSE_TIME + " INTEGER NOT NULL, " + COLUMN_TOTAL_TIME_TEXT + " TEXT);");
} | public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_LAPS);
<DeepExtract>
db.execSQL("CREATE TABLE " + TABLE_LAPS + " (" + COLUMN_ID + " INTEGER PRIMARY KEY, " + COLUMN_T1 + " INTEGER NOT NULL, " + COLUMN_T2 + " INTEGER NOT NULL, " + COLUMN_PAUSE_TIME + " INTEGER NOT NULL, " + COLUMN_TOTAL_TIME_TEXT + " TEXT);");
</DeepExtract>
} | ClockPlus | positive | 2,752 |
public Criteria andPidLessThan(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "pid" + " cannot be null");
}
criteria.add(new Criterion("pid <", value));
return (Criteria) this;
} | public Criteria andPidLessThan(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "pid" + " cannot be null");
}
criteria.add(new Criterion("pid <", value));
</DeepExtract>
return (Criteria) this;
} | ssmxiaomi | positive | 2,753 |
public String getDockerBrowserTwilioImageFormat() {
String name = dockerBrowserTwilioImageFormat.getName();
T tValue = dockerBrowserTwilioImageFormat.getValue();
Class<T> type = dockerBrowserTwilioImageFormat.getType();
return resolver(name, tValue, type);
} | public String getDockerBrowserTwilioImageFormat() {
<DeepExtract>
String name = dockerBrowserTwilioImageFormat.getName();
T tValue = dockerBrowserTwilioImageFormat.getValue();
Class<T> type = dockerBrowserTwilioImageFormat.getType();
return resolver(name, tValue, type);
</DeepExtract>
} | webdrivermanager | positive | 2,754 |
public void onStartTrackingTouch(SeekBar bar) {
mDragging = true;
if (!mShowing && mAnchor != null && mAnchor.getWindowToken() != null) {
if (mPauseButton != null)
mPauseButton.requestFocus();
if (mFromXml) {
setVisibility(View.VISIBLE);
} else {
int[] location = new int[2];
mAnchor.getLocationOnScreen(location);
Rect anchorRect = new Rect(location[0], location[1], location[0] + mAnchor.getWidth(), location[1] + mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
setWindowLayoutType();
mWindow.showAtLocation(mAnchor, Gravity.NO_GRAVITY, anchorRect.left, anchorRect.bottom);
}
mShowing = true;
if (mShownListener != null)
mShownListener.onShown();
}
updatePausePlay();
mHandler.sendEmptyMessage(SHOW_PROGRESS);
if (3600000 != 0) {
mHandler.removeMessages(FADE_OUT);
mHandler.sendMessageDelayed(mHandler.obtainMessage(FADE_OUT), 3600000);
}
mHandler.removeMessages(SHOW_PROGRESS);
if (mInstantSeeking)
mAM.setStreamMute(AudioManager.STREAM_MUSIC, true);
if (mInfoView != null) {
mInfoView.setText("");
mInfoView.setVisibility(View.VISIBLE);
}
} | public void onStartTrackingTouch(SeekBar bar) {
mDragging = true;
<DeepExtract>
if (!mShowing && mAnchor != null && mAnchor.getWindowToken() != null) {
if (mPauseButton != null)
mPauseButton.requestFocus();
if (mFromXml) {
setVisibility(View.VISIBLE);
} else {
int[] location = new int[2];
mAnchor.getLocationOnScreen(location);
Rect anchorRect = new Rect(location[0], location[1], location[0] + mAnchor.getWidth(), location[1] + mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
setWindowLayoutType();
mWindow.showAtLocation(mAnchor, Gravity.NO_GRAVITY, anchorRect.left, anchorRect.bottom);
}
mShowing = true;
if (mShownListener != null)
mShownListener.onShown();
}
updatePausePlay();
mHandler.sendEmptyMessage(SHOW_PROGRESS);
if (3600000 != 0) {
mHandler.removeMessages(FADE_OUT);
mHandler.sendMessageDelayed(mHandler.obtainMessage(FADE_OUT), 3600000);
}
</DeepExtract>
mHandler.removeMessages(SHOW_PROGRESS);
if (mInstantSeeking)
mAM.setStreamMute(AudioManager.STREAM_MUSIC, true);
if (mInfoView != null) {
mInfoView.setText("");
mInfoView.setVisibility(View.VISIBLE);
}
} | ListVideoViewBaseOnVitamio | positive | 2,755 |
public void execute() {
options.getLogFile().delete();
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println("---------------------------------------------------------------");
ModelTest.getMainConsole().println("* *");
ModelTest.getMainConsole().println("* COMPUTATION OF LIKELIHOOD SCORES WITH PHYML *");
ModelTest.getMainConsole().println("* *");
ModelTest.getMainConsole().println("---------------------------------------------------------------");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println("::Settings::");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println(" Phyml version = " + PHYML_VERSION);
ModelTest.getMainConsole().println(" Phyml binary = " + phymlBinary.getName());
ModelTest.getMainConsole().println(" Phyml path = " + phymlBinary.getAbsolutePath().substring(0, phymlBinary.getAbsolutePath().lastIndexOf(File.separator)) + File.separator);
ModelTest.getMainConsole().println(" Candidate models = " + models.length);
ModelTest.getMainConsole().print(" number of substitution schemes = ");
if (options.getSubstTypeCode() == 0)
ModelTest.getMainConsole().println("3");
else if (options.getSubstTypeCode() == 1)
ModelTest.getMainConsole().println("5");
else if (options.getSubstTypeCode() == 2)
ModelTest.getMainConsole().println("7");
else
ModelTest.getMainConsole().println("11");
if (options.doF)
ModelTest.getMainConsole().println(" including models with equal/unequal base frequencies (+F)");
else
ModelTest.getMainConsole().println(" including only models with equal base frequencies");
if (options.doI)
ModelTest.getMainConsole().println(" including models with/without a proportion of invariable sites (+I)");
else
ModelTest.getMainConsole().println(" including only models without a proportion of invariable sites");
if (options.doG)
ModelTest.getMainConsole().println(" including models with/without rate variation among sites (+G)" + " (nCat = " + options.numGammaCat + ")");
else
ModelTest.getMainConsole().println(" including only models without rate variation among sites");
ModelTest.getMainConsole().print(" Optimized free parameters (K) =");
ModelTest.getMainConsole().print(" substitution parameters");
if (options.countBLasParameters)
ModelTest.getMainConsole().print(" + " + options.getNumBranches() + " branch lengths");
if (options.optimizeMLTopology)
ModelTest.getMainConsole().print(" + topology");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().print(" Base tree for likelihood calculations = ");
if (options.userTopologyExists) {
ModelTest.getMainConsole().println("fixed user tree topology.");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().print("User tree " + "(" + options.getInputTreeFile().getName() + ") = ");
ModelTest.getMainConsole().println(options.getUserTree());
ModelTest.getMainConsole().println(" ");
} else if (options.fixedTopology) {
ModelTest.getMainConsole().println("fixed BIONJ-JC tree topology");
} else if (options.optimizeMLTopology) {
ModelTest.getMainConsole().println("ML tree");
} else {
ModelTest.getMainConsole().println("BIONJ tree");
}
if (options.optimizeMLTopology) {
ModelTest.getMainConsole().print(" Tree topology search operation = ");
switch(options.treeSearchOperations) {
case NNI:
ModelTest.getMainConsole().println("NNI");
break;
case SPR:
ModelTest.getMainConsole().println("SPR");
break;
case BEST:
ModelTest.getMainConsole().println("BEST");
break;
}
}
if (options.isClusteringSearch()) {
ModelTest.getMainConsole().println(" Using hill-climbing hierarchical clustering");
}
if (options.isGuidedSearch()) {
ModelTest.getMainConsole().println(" Using heuristic model filtering ");
}
ModelTest.getMainConsole().println(" ");
if (options.doI && options.doG) {
searchFor = "GTR+I+G";
gtrParams = 10;
} else if (options.doI) {
searchFor = "GTR+I";
gtrParams = 9;
} else if (options.doG) {
searchFor = "GTR+G";
gtrParams = 9;
} else {
searchFor = "GTR";
gtrParams = 8;
}
for (int i = (models.length - 1); i >= 0; i--) {
if (models[i].getName().startsWith(searchFor)) {
gtrModel = models[i];
break;
}
}
if (gtrModel == null) {
gtrModel = new Model(0, searchFor, "012345", gtrParams, false, false, false, true, options.doI, options.doG, 2, 4);
}
if (options.fixedTopology) {
Model jcModel = null;
for (Model model : models) {
if (model.getName().equals("JC")) {
jcModel = model;
break;
}
}
if (jcModel != null) {
notifyObservers(ProgressInfo.BASE_TREE_INIT, 0, jcModel, null);
PhymlSingleModel jcModelPhyml = new PhymlSingleModel(jcModel, 0, true, false, options);
jcModelPhyml.addObserver(this);
jcModelPhyml.run();
TextOutputStream JCtreeFile = new TextOutputStream(options.getTreeFile().getAbsolutePath(), false);
JCtreeFile.print(jcModel.getTreeString() + "\n");
JCtreeFile.close();
notifyObservers(ProgressInfo.BASE_TREE_COMPUTED, 0, jcModel, null);
}
}
if (options.isGuidedSearch()) {
if (gtrModel != null) {
notifyObservers(ProgressInfo.GTR_OPTIMIZATION_INIT, models.length, gtrModel, null);
PhymlSingleModel gtrPhymlModel = new PhymlSingleModel(gtrModel, 0, false, false, options);
gtrPhymlModel.run();
notifyObservers(ProgressInfo.GTR_OPTIMIZATION_COMPLETED, models.length, gtrModel, null);
GuidedSearchManager gsm = new GuidedSearchManager(options.getGuidedSearchThreshold(), gtrModel, filterFrequencies, filterRateMatrix, filterRateVariation);
models = gsm.filterModels(models);
ModelTest.setCandidateModels(models);
} else {
notifyObservers(ProgressInfo.GTR_NOT_FOUND, models.length, models[0], null);
}
}
setChanged();
notifyObservers(new ProgressInfo(ProgressInfo.OPTIMIZATION_INIT, 0, models[0], null));
doPhyml();
} | public void execute() {
options.getLogFile().delete();
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println("---------------------------------------------------------------");
ModelTest.getMainConsole().println("* *");
ModelTest.getMainConsole().println("* COMPUTATION OF LIKELIHOOD SCORES WITH PHYML *");
ModelTest.getMainConsole().println("* *");
ModelTest.getMainConsole().println("---------------------------------------------------------------");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println("::Settings::");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().println(" Phyml version = " + PHYML_VERSION);
ModelTest.getMainConsole().println(" Phyml binary = " + phymlBinary.getName());
ModelTest.getMainConsole().println(" Phyml path = " + phymlBinary.getAbsolutePath().substring(0, phymlBinary.getAbsolutePath().lastIndexOf(File.separator)) + File.separator);
ModelTest.getMainConsole().println(" Candidate models = " + models.length);
ModelTest.getMainConsole().print(" number of substitution schemes = ");
if (options.getSubstTypeCode() == 0)
ModelTest.getMainConsole().println("3");
else if (options.getSubstTypeCode() == 1)
ModelTest.getMainConsole().println("5");
else if (options.getSubstTypeCode() == 2)
ModelTest.getMainConsole().println("7");
else
ModelTest.getMainConsole().println("11");
if (options.doF)
ModelTest.getMainConsole().println(" including models with equal/unequal base frequencies (+F)");
else
ModelTest.getMainConsole().println(" including only models with equal base frequencies");
if (options.doI)
ModelTest.getMainConsole().println(" including models with/without a proportion of invariable sites (+I)");
else
ModelTest.getMainConsole().println(" including only models without a proportion of invariable sites");
if (options.doG)
ModelTest.getMainConsole().println(" including models with/without rate variation among sites (+G)" + " (nCat = " + options.numGammaCat + ")");
else
ModelTest.getMainConsole().println(" including only models without rate variation among sites");
ModelTest.getMainConsole().print(" Optimized free parameters (K) =");
ModelTest.getMainConsole().print(" substitution parameters");
if (options.countBLasParameters)
ModelTest.getMainConsole().print(" + " + options.getNumBranches() + " branch lengths");
if (options.optimizeMLTopology)
ModelTest.getMainConsole().print(" + topology");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().print(" Base tree for likelihood calculations = ");
if (options.userTopologyExists) {
ModelTest.getMainConsole().println("fixed user tree topology.");
ModelTest.getMainConsole().println(" ");
ModelTest.getMainConsole().print("User tree " + "(" + options.getInputTreeFile().getName() + ") = ");
ModelTest.getMainConsole().println(options.getUserTree());
ModelTest.getMainConsole().println(" ");
} else if (options.fixedTopology) {
ModelTest.getMainConsole().println("fixed BIONJ-JC tree topology");
} else if (options.optimizeMLTopology) {
ModelTest.getMainConsole().println("ML tree");
} else {
ModelTest.getMainConsole().println("BIONJ tree");
}
if (options.optimizeMLTopology) {
ModelTest.getMainConsole().print(" Tree topology search operation = ");
switch(options.treeSearchOperations) {
case NNI:
ModelTest.getMainConsole().println("NNI");
break;
case SPR:
ModelTest.getMainConsole().println("SPR");
break;
case BEST:
ModelTest.getMainConsole().println("BEST");
break;
}
}
if (options.isClusteringSearch()) {
ModelTest.getMainConsole().println(" Using hill-climbing hierarchical clustering");
}
if (options.isGuidedSearch()) {
ModelTest.getMainConsole().println(" Using heuristic model filtering ");
}
ModelTest.getMainConsole().println(" ");
if (options.doI && options.doG) {
searchFor = "GTR+I+G";
gtrParams = 10;
} else if (options.doI) {
searchFor = "GTR+I";
gtrParams = 9;
} else if (options.doG) {
searchFor = "GTR+G";
gtrParams = 9;
} else {
searchFor = "GTR";
gtrParams = 8;
}
for (int i = (models.length - 1); i >= 0; i--) {
if (models[i].getName().startsWith(searchFor)) {
gtrModel = models[i];
break;
}
}
if (gtrModel == null) {
gtrModel = new Model(0, searchFor, "012345", gtrParams, false, false, false, true, options.doI, options.doG, 2, 4);
}
if (options.fixedTopology) {
Model jcModel = null;
for (Model model : models) {
if (model.getName().equals("JC")) {
jcModel = model;
break;
}
}
if (jcModel != null) {
notifyObservers(ProgressInfo.BASE_TREE_INIT, 0, jcModel, null);
PhymlSingleModel jcModelPhyml = new PhymlSingleModel(jcModel, 0, true, false, options);
jcModelPhyml.addObserver(this);
jcModelPhyml.run();
TextOutputStream JCtreeFile = new TextOutputStream(options.getTreeFile().getAbsolutePath(), false);
JCtreeFile.print(jcModel.getTreeString() + "\n");
JCtreeFile.close();
notifyObservers(ProgressInfo.BASE_TREE_COMPUTED, 0, jcModel, null);
}
}
if (options.isGuidedSearch()) {
if (gtrModel != null) {
notifyObservers(ProgressInfo.GTR_OPTIMIZATION_INIT, models.length, gtrModel, null);
PhymlSingleModel gtrPhymlModel = new PhymlSingleModel(gtrModel, 0, false, false, options);
gtrPhymlModel.run();
notifyObservers(ProgressInfo.GTR_OPTIMIZATION_COMPLETED, models.length, gtrModel, null);
GuidedSearchManager gsm = new GuidedSearchManager(options.getGuidedSearchThreshold(), gtrModel, filterFrequencies, filterRateMatrix, filterRateVariation);
models = gsm.filterModels(models);
ModelTest.setCandidateModels(models);
} else {
notifyObservers(ProgressInfo.GTR_NOT_FOUND, models.length, models[0], null);
}
}
<DeepExtract>
setChanged();
notifyObservers(new ProgressInfo(ProgressInfo.OPTIMIZATION_INIT, 0, models[0], null));
</DeepExtract>
doPhyml();
} | jmodeltest2 | positive | 2,756 |
public void run() {
final EditText promptInput = new EditText(cordova.getActivity());
Resources resources = cordova.getActivity().getResources();
int promptInputTextColor = resources.getColor(android.R.color.primary_text_light);
promptInput.setTextColor(promptInputTextColor);
promptInput.setText(defaultText);
AlertDialog.Builder dlg;
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {
dlg = new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
} else {
dlg = new AlertDialog.Builder(cordova.getActivity());
}
dlg.setMessage(message);
dlg.setTitle(title);
dlg.setCancelable(true);
dlg.setView(promptInput);
final JSONObject result = new JSONObject();
if (buttonLabels.length() > 0) {
try {
dlg.setNegativeButton(buttonLabels.getString(0), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 1);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on first button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on first button.");
}
}
if (buttonLabels.length() > 1) {
try {
dlg.setNeutralButton(buttonLabels.getString(1), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 2);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on second button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on second button.");
}
}
if (buttonLabels.length() > 2) {
try {
dlg.setPositiveButton(buttonLabels.getString(2), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 3);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on third button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on third button.");
}
}
dlg.setOnCancelListener(new AlertDialog.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
dialog.dismiss();
try {
result.put("buttonIndex", 0);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
e.printStackTrace();
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
dlg.create();
AlertDialog dialog = dlg.show();
if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
TextView messageview = (TextView) dialog.findViewById(android.R.id.message);
messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
}
} | public void run() {
final EditText promptInput = new EditText(cordova.getActivity());
Resources resources = cordova.getActivity().getResources();
int promptInputTextColor = resources.getColor(android.R.color.primary_text_light);
promptInput.setTextColor(promptInputTextColor);
promptInput.setText(defaultText);
AlertDialog.Builder dlg;
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
if (currentapiVersion >= android.os.Build.VERSION_CODES.HONEYCOMB) {
dlg = new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
} else {
dlg = new AlertDialog.Builder(cordova.getActivity());
}
dlg.setMessage(message);
dlg.setTitle(title);
dlg.setCancelable(true);
dlg.setView(promptInput);
final JSONObject result = new JSONObject();
if (buttonLabels.length() > 0) {
try {
dlg.setNegativeButton(buttonLabels.getString(0), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 1);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on first button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on first button.");
}
}
if (buttonLabels.length() > 1) {
try {
dlg.setNeutralButton(buttonLabels.getString(1), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 2);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on second button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on second button.");
}
}
if (buttonLabels.length() > 2) {
try {
dlg.setPositiveButton(buttonLabels.getString(2), new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
try {
result.put("buttonIndex", 3);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on third button.", e);
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
} catch (JSONException e) {
LOG.d(LOG_TAG, "JSONException on third button.");
}
}
dlg.setOnCancelListener(new AlertDialog.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
dialog.dismiss();
try {
result.put("buttonIndex", 0);
result.put("input1", promptInput.getText().toString().trim().length() == 0 ? defaultText : promptInput.getText());
} catch (JSONException e) {
e.printStackTrace();
}
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.OK, result));
}
});
<DeepExtract>
int currentapiVersion = android.os.Build.VERSION.SDK_INT;
dlg.create();
AlertDialog dialog = dlg.show();
if (currentapiVersion >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR1) {
TextView messageview = (TextView) dialog.findViewById(android.R.id.message);
messageview.setTextDirection(android.view.View.TEXT_DIRECTION_LOCALE);
}
</DeepExtract>
} | vuejs-cordova-sample | positive | 2,758 |
@Override
public List<GiteaRepository> fetchOrganizationRepositories(GiteaOwner owner) throws IOException, InterruptedException {
if (organizations.containsKey(owner.getUsername()) || users.containsKey(owner.getUsername())) {
List<GiteaRepository> result = new ArrayList<>();
for (Map.Entry<String, GiteaRepository> entry : repositories.entrySet()) {
if (entry.getKey().startsWith(owner.getUsername() + "/")) {
result.add(entry.getValue().clone());
}
}
return result;
}
return notFoundIfNull(null);
} | @Override
public List<GiteaRepository> fetchOrganizationRepositories(GiteaOwner owner) throws IOException, InterruptedException {
<DeepExtract>
if (organizations.containsKey(owner.getUsername()) || users.containsKey(owner.getUsername())) {
List<GiteaRepository> result = new ArrayList<>();
for (Map.Entry<String, GiteaRepository> entry : repositories.entrySet()) {
if (entry.getKey().startsWith(owner.getUsername() + "/")) {
result.add(entry.getValue().clone());
}
}
return result;
}
return notFoundIfNull(null);
</DeepExtract>
} | gitea-plugin | positive | 2,760 |
public void performPruning(double UB) throws ContradictionException {
double delta = UB - treeCost;
assert delta >= 0;
ISet nei;
for (int i = 0; i < n; i++) {
ccTp[i] = -1;
}
useful.clear();
useful.set(0);
ccTp[0] = 0;
int first = 0;
int last = first;
int k = 0;
fifo[last++] = k;
while (first < last) {
k = fifo[first++];
nei = Tree.getNeighOf(k);
for (int s : nei) {
if (ccTp[s] == -1) {
ccTp[s] = k;
map[s][k] = -1;
map[k][s] = -1;
if (!useful.get(s)) {
fifo[last++] = s;
useful.set(s);
}
}
}
}
if (selectRelevantArcs(delta)) {
lca.preprocess(cctRoot, ccTree);
pruning(delta);
}
} | public void performPruning(double UB) throws ContradictionException {
double delta = UB - treeCost;
assert delta >= 0;
<DeepExtract>
ISet nei;
for (int i = 0; i < n; i++) {
ccTp[i] = -1;
}
useful.clear();
useful.set(0);
ccTp[0] = 0;
int first = 0;
int last = first;
int k = 0;
fifo[last++] = k;
while (first < last) {
k = fifo[first++];
nei = Tree.getNeighOf(k);
for (int s : nei) {
if (ccTp[s] == -1) {
ccTp[s] = k;
map[s][k] = -1;
map[k][s] = -1;
if (!useful.get(s)) {
fifo[last++] = s;
useful.set(s);
}
}
}
}
</DeepExtract>
if (selectRelevantArcs(delta)) {
lca.preprocess(cctRoot, ccTree);
pruning(delta);
}
} | choco-graph | positive | 2,761 |
public static LocalDateTime parseDateDefaultStrToLocalDateTime(String text) {
Objects.requireNonNull(EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT, "formatter");
LocalDateTime localDateTime = null;
try {
localDateTime = DateTimeConverterUtil.toLocalDateTime(EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT.parse(text));
} catch (DateTimeException e) {
if (e.getMessage().startsWith(Constant.PARSE_LOCAL_DATE_EXCEPTION)) {
localDateTime = DateTimeConverterUtil.toLocalDateTime(LocalDate.parse(text, EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT));
} else {
throw e;
}
}
return localDateTime;
} | public static LocalDateTime parseDateDefaultStrToLocalDateTime(String text) {
<DeepExtract>
Objects.requireNonNull(EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT, "formatter");
LocalDateTime localDateTime = null;
try {
localDateTime = DateTimeConverterUtil.toLocalDateTime(EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT.parse(text));
} catch (DateTimeException e) {
if (e.getMessage().startsWith(Constant.PARSE_LOCAL_DATE_EXCEPTION)) {
localDateTime = DateTimeConverterUtil.toLocalDateTime(LocalDate.parse(text, EEE_MMM_DD_HH_MM_SS_ZZZ_YYYY_FMT));
} else {
throw e;
}
}
return localDateTime;
</DeepExtract>
} | jstarcraft-nlp | positive | 2,762 |
public Set<String> getAllDPNNetIDs() {
Set<String> s = new HashSet<String>();
Cursor c = null;
try {
c = getReadableDatabase().rawQuery("SELECT network from dataPoint group by network", null);
} catch (Exception e) {
msg("Error during query. Q=" + "SELECT network from dataPoint group by network");
closeCursor(c);
return s;
}
if (c == null)
return s;
if (c.getCount() < 1) {
msg("Warning: No records found using Q=" + "SELECT network from dataPoint group by network");
} else {
c.moveToFirst();
}
String thisData = "";
while (!c.isAfterLast()) {
thisData = c.getString(0);
if (thisData.length() > 0)
s.add(thisData);
c.moveToNext();
}
closeCursor(c);
return s;
} | public Set<String> getAllDPNNetIDs() {
<DeepExtract>
Set<String> s = new HashSet<String>();
Cursor c = null;
try {
c = getReadableDatabase().rawQuery("SELECT network from dataPoint group by network", null);
} catch (Exception e) {
msg("Error during query. Q=" + "SELECT network from dataPoint group by network");
closeCursor(c);
return s;
}
if (c == null)
return s;
if (c.getCount() < 1) {
msg("Warning: No records found using Q=" + "SELECT network from dataPoint group by network");
} else {
c.moveToFirst();
}
String thisData = "";
while (!c.isAfterLast()) {
thisData = c.getString(0);
if (thisData.length() > 0)
s.add(thisData);
c.moveToNext();
}
closeCursor(c);
return s;
</DeepExtract>
} | libvoyager | positive | 2,763 |
public void smoothScrollBy(int distance, int duration) {
if (mFlingRunnable == null) {
mFlingRunnable = new FlingRunnable();
} else {
mFlingRunnable.endFling();
}
int initialY = distance < 0 ? Integer.MAX_VALUE : 0;
mLastFlingY = initialY;
mScroller.startScroll(0, initialY, 0, distance, duration);
mTouchMode = TOUCH_MODE_FLING;
post(this);
} | public void smoothScrollBy(int distance, int duration) {
if (mFlingRunnable == null) {
mFlingRunnable = new FlingRunnable();
} else {
mFlingRunnable.endFling();
}
<DeepExtract>
int initialY = distance < 0 ? Integer.MAX_VALUE : 0;
mLastFlingY = initialY;
mScroller.startScroll(0, initialY, 0, distance, duration);
mTouchMode = TOUCH_MODE_FLING;
post(this);
</DeepExtract>
} | mshopping-android | positive | 2,764 |
public Criteria andSCreateTimeIsNotNull() {
if ("s_create_time is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("s_create_time is not null"));
return (Criteria) this;
} | public Criteria andSCreateTimeIsNotNull() {
<DeepExtract>
if ("s_create_time is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("s_create_time is not null"));
</DeepExtract>
return (Criteria) this;
} | webike | positive | 2,765 |
public static void launchForAppInfo(Context context) {
Intent intent = new Intent(context, VoIPGRIDPortalWebActivity.class);
intent.putExtra(VoIPGRIDPortalWebActivity.TITLE, context.getString(R.string.info_menu_item_title));
intent.putExtra(VoIPGRIDPortalWebActivity.PAGE, context.getString(R.string.url_app_info));
context.startActivity(intent);
} | public static void launchForAppInfo(Context context) {
<DeepExtract>
Intent intent = new Intent(context, VoIPGRIDPortalWebActivity.class);
intent.putExtra(VoIPGRIDPortalWebActivity.TITLE, context.getString(R.string.info_menu_item_title));
intent.putExtra(VoIPGRIDPortalWebActivity.PAGE, context.getString(R.string.url_app_info));
context.startActivity(intent);
</DeepExtract>
} | vialer-android | positive | 2,766 |
public static void main(String[] args) {
int[] num = null;
int use = 0;
Scanner sc = new Scanner(System.in);
use = sc.nextInt();
if (!(use > 10)) {
num = new int[use];
}
for (int i = 0; i < num.length; i++) {
num[i] = sc.nextInt();
}
Arrays.sort(num);
for (int k = num.length - 1; k >= 0; k--) {
System.out.print(num[k] + " ");
}
} | public static void main(String[] args) {
int[] num = null;
int use = 0;
Scanner sc = new Scanner(System.in);
use = sc.nextInt();
if (!(use > 10)) {
num = new int[use];
}
for (int i = 0; i < num.length; i++) {
num[i] = sc.nextInt();
}
<DeepExtract>
Arrays.sort(num);
for (int k = num.length - 1; k >= 0; k--) {
System.out.print(num[k] + " ");
}
</DeepExtract>
} | OnAlSt | positive | 2,767 |
@Override
public Message createMessage() throws JMSException {
if (closed) {
throw new IllegalStateException("Session is closed");
}
connection.checkNotClosed();
return new PulsarSimpleMessage();
} | @Override
public Message createMessage() throws JMSException {
<DeepExtract>
if (closed) {
throw new IllegalStateException("Session is closed");
}
connection.checkNotClosed();
</DeepExtract>
return new PulsarSimpleMessage();
} | pulsar-jms | positive | 2,768 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_register);
EventBus.getDefault().register(this);
ButterKnife.bind(this);
List<Fragment> lists = new ArrayList<>();
lists.add(new UserLoginFragment());
lists.add(new UserRegisterFragment());
mViewPager.setAdapter(new LoginRegisterPagerAdapter(getSupportFragmentManager(), lists));
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
public void onPageSelected(int position) {
switch(position) {
case 0:
showLoginFragment();
break;
case 1:
showRegisterFragment();
break;
}
}
public void onPageScrollStateChanged(int state) {
}
});
login_tv.setOnClickListener(this);
register_tv.setOnClickListener(this);
} | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_register);
EventBus.getDefault().register(this);
ButterKnife.bind(this);
List<Fragment> lists = new ArrayList<>();
lists.add(new UserLoginFragment());
lists.add(new UserRegisterFragment());
mViewPager.setAdapter(new LoginRegisterPagerAdapter(getSupportFragmentManager(), lists));
mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
public void onPageSelected(int position) {
switch(position) {
case 0:
showLoginFragment();
break;
case 1:
showRegisterFragment();
break;
}
}
public void onPageScrollStateChanged(int state) {
}
});
<DeepExtract>
login_tv.setOnClickListener(this);
register_tv.setOnClickListener(this);
</DeepExtract>
} | CinemaTicket | positive | 2,769 |
public List getAncestors() {
if (getParent() == null)
return null;
List ancestors = new ArrayList();
Tree t = this;
return null;
while (t != null) {
ancestors.add(0, t);
t = t.getParent();
}
return ancestors;
} | public List getAncestors() {
if (getParent() == null)
<DeepExtract>
return null;
</DeepExtract>
List ancestors = new ArrayList();
Tree t = this;
<DeepExtract>
return null;
</DeepExtract>
while (t != null) {
ancestors.add(0, t);
t = t.getParent();
}
return ancestors;
} | jtcc | positive | 2,770 |
public Criteria andTradeIdNotIn(List<Integer> values) {
if (values == null) {
throw new RuntimeException("Value for " + "tradeId" + " cannot be null");
}
criteria.add(new Criterion("trade_id not in", values));
return (Criteria) this;
} | public Criteria andTradeIdNotIn(List<Integer> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "tradeId" + " cannot be null");
}
criteria.add(new Criterion("trade_id not in", values));
</DeepExtract>
return (Criteria) this;
} | springcloud-e-book | positive | 2,771 |
protected void attackEntity(Entity target) {
if (this.thrower != null)
this.thrower.getEntityData().setInt("LastHitSummonedSwords", this.getEntityId());
if (target != null) {
this.hitYaw = this.rotationYaw - target.rotationYaw;
this.hitPitch = this.rotationPitch - target.rotationPitch;
this.hitX = this.lastTickPosX - target.posX;
this.hitY = this.lastTickPosY - target.posY;
this.hitZ = this.lastTickPosZ - target.posZ;
this.ridingEntity2 = target;
this.ticksExisted = 0;
}
if (!this.world.isRemote) {
float magicDamage = Math.max(1.0f, AttackLevel);
target.hurtResistantTime = 0;
DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setDamageBypassesArmor().setMagicDamage();
target.attackEntityFrom(ds, magicDamage);
if (!blade.isEmpty() && target instanceof EntityLivingBase && thrower != null && thrower instanceof EntityLivingBase) {
StylishRankManager.setNextAttackType(this.thrower, StylishRankManager.AttackTypes.PhantomSword);
((ItemSlashBlade) blade.getItem()).hitEntity(blade, (EntityLivingBase) target, (EntityLivingBase) thrower);
ReflectionAccessHelper.setVelocity(target, 0, 0, 0);
target.addVelocity(0.0, 0.1D, 0.0);
((EntityLivingBase) target).hurtTime = 1;
((ItemSlashBlade) blade.getItem()).setDaunting(((EntityLivingBase) target));
}
}
} | protected void attackEntity(Entity target) {
if (this.thrower != null)
this.thrower.getEntityData().setInt("LastHitSummonedSwords", this.getEntityId());
<DeepExtract>
if (target != null) {
this.hitYaw = this.rotationYaw - target.rotationYaw;
this.hitPitch = this.rotationPitch - target.rotationPitch;
this.hitX = this.lastTickPosX - target.posX;
this.hitY = this.lastTickPosY - target.posY;
this.hitZ = this.lastTickPosZ - target.posZ;
this.ridingEntity2 = target;
this.ticksExisted = 0;
}
</DeepExtract>
if (!this.world.isRemote) {
float magicDamage = Math.max(1.0f, AttackLevel);
target.hurtResistantTime = 0;
DamageSource ds = new EntityDamageSource("directMagic", this.getThrower()).setDamageBypassesArmor().setMagicDamage();
target.attackEntityFrom(ds, magicDamage);
if (!blade.isEmpty() && target instanceof EntityLivingBase && thrower != null && thrower instanceof EntityLivingBase) {
StylishRankManager.setNextAttackType(this.thrower, StylishRankManager.AttackTypes.PhantomSword);
((ItemSlashBlade) blade.getItem()).hitEntity(blade, (EntityLivingBase) target, (EntityLivingBase) thrower);
ReflectionAccessHelper.setVelocity(target, 0, 0, 0);
target.addVelocity(0.0, 0.1D, 0.0);
((EntityLivingBase) target).hurtTime = 1;
((ItemSlashBlade) blade.getItem()).setDaunting(((EntityLivingBase) target));
}
}
} | SlashBlade | positive | 2,772 |
protected void onQueueItemProcessed() {
if (queueCountBroadcastsAllowed()) {
Intent broadcast = new Intent(ACTION_QUEUE_COUNT);
broadcast.putExtra(EXTRA_QUEUE_COUNT, getQueueCount());
broadcast.putExtra(EXTRA_QUEUE_NAME, getQueueName());
Log.d(DEBUG_TAG, "Dispatching queue count...");
sendBroadcast(broadcast);
} else {
Log.d(DEBUG_TAG, "NOT dispatching queue count (queueCountRequestsAllowed() returned false)...");
}
} | protected void onQueueItemProcessed() {
<DeepExtract>
if (queueCountBroadcastsAllowed()) {
Intent broadcast = new Intent(ACTION_QUEUE_COUNT);
broadcast.putExtra(EXTRA_QUEUE_COUNT, getQueueCount());
broadcast.putExtra(EXTRA_QUEUE_NAME, getQueueName());
Log.d(DEBUG_TAG, "Dispatching queue count...");
sendBroadcast(broadcast);
} else {
Log.d(DEBUG_TAG, "NOT dispatching queue count (queueCountRequestsAllowed() returned false)...");
}
</DeepExtract>
} | geohashdroid | positive | 2,774 |
private void testPredictionsNoManifest(Channel inferChannel, Channel mgmtChannel) throws InterruptedException, NoSuchFieldException, IllegalAccessException {
Field f = configManager.getClass().getDeclaredField("prop");
f.setAccessible(true);
Properties p = (Properties) f.get(configManager);
p.setProperty("default_service_handler", "service:handle");
result = null;
latch = new CountDownLatch(1);
String url = "/models?url=" + "noop-no-manifest" + "&model_name=" + "nomanifest" + "&initial_workers=1&synchronous=true";
HttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url);
mgmtChannel.writeAndFlush(req);
latch.await();
result = null;
latch = new CountDownLatch(1);
DefaultFullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/predictions/nomanifest");
req.content().writeCharSequence("{\"data\": \"test\"}", CharsetUtil.UTF_8);
HttpUtil.setContentLength(req, req.content().readableBytes());
req.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
inferChannel.writeAndFlush(req);
latch.await();
Assert.assertEquals(httpStatus, HttpResponseStatus.OK);
Assert.assertEquals(result, "OK");
result = null;
latch = new CountDownLatch(1);
String expected = "Model \"" + "nomanifest" + "\" unregistered";
String url = "/models/" + "nomanifest";
HttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.DELETE, url);
mgmtChannel.writeAndFlush(req);
latch.await();
StatusResponse resp = JsonUtils.GSON.fromJson(result, StatusResponse.class);
Assert.assertEquals(resp.getStatus(), expected);
} | private void testPredictionsNoManifest(Channel inferChannel, Channel mgmtChannel) throws InterruptedException, NoSuchFieldException, IllegalAccessException {
Field f = configManager.getClass().getDeclaredField("prop");
f.setAccessible(true);
Properties p = (Properties) f.get(configManager);
p.setProperty("default_service_handler", "service:handle");
result = null;
latch = new CountDownLatch(1);
String url = "/models?url=" + "noop-no-manifest" + "&model_name=" + "nomanifest" + "&initial_workers=1&synchronous=true";
HttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, url);
mgmtChannel.writeAndFlush(req);
latch.await();
result = null;
latch = new CountDownLatch(1);
DefaultFullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/predictions/nomanifest");
req.content().writeCharSequence("{\"data\": \"test\"}", CharsetUtil.UTF_8);
HttpUtil.setContentLength(req, req.content().readableBytes());
req.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.APPLICATION_JSON);
inferChannel.writeAndFlush(req);
latch.await();
Assert.assertEquals(httpStatus, HttpResponseStatus.OK);
Assert.assertEquals(result, "OK");
<DeepExtract>
result = null;
latch = new CountDownLatch(1);
String expected = "Model \"" + "nomanifest" + "\" unregistered";
String url = "/models/" + "nomanifest";
HttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.DELETE, url);
mgmtChannel.writeAndFlush(req);
latch.await();
StatusResponse resp = JsonUtils.GSON.fromJson(result, StatusResponse.class);
Assert.assertEquals(resp.getStatus(), expected);
</DeepExtract>
} | multi-model-server | positive | 2,775 |
@Test(expected = IllegalStateException.class)
public void shouldFailToSubmitTwoTimesTheSameTask() {
mAwex = new Awex(mThreadHelper, new ConsoleLogger(), new LinearWithRealTimePriorityPolicy(0, 1));
VoidTask someTask = new VoidTask() {
@Override
protected void runWithoutResult() throws InterruptedException {
}
};
mAwex.submit(someTask);
mAwex.submit(someTask);
} | @Test(expected = IllegalStateException.class)
public void shouldFailToSubmitTwoTimesTheSameTask() {
<DeepExtract>
mAwex = new Awex(mThreadHelper, new ConsoleLogger(), new LinearWithRealTimePriorityPolicy(0, 1));
</DeepExtract>
VoidTask someTask = new VoidTask() {
@Override
protected void runWithoutResult() throws InterruptedException {
}
};
mAwex.submit(someTask);
mAwex.submit(someTask);
} | awex | positive | 2,776 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.