before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
void complete(int windingRule) {
if (currentSubPath != null) {
subPaths.add(currentSubPath);
currentSubPath = null;
}
this.windingRule = windingRule;
} | void complete(int windingRule) {
<DeepExtract>
if (currentSubPath != null) {
subPaths.add(currentSubPath);
currentSubPath = null;
}
</DeepExtract>
this.windingRule = windingRule;
} | testarea-pdfbox2 | positive | 437,120 |
@Test(expected = AlfrescoRuntimeException.class)
public void search1785_436() {
ExplicitShardingPolicy policy = new ExplicitShardingPolicy(4, 3, 6);
assertTrue(policy.configurationIsValid());
int[] found = new int[4];
for (int i = 0; i < 6; i++) {
Set<Integer> shardIds = new HashSet<>(policy.getShardIdsForNode(i + 1));... | @Test(expected = AlfrescoRuntimeException.class)
public void search1785_436() {
<DeepExtract>
ExplicitShardingPolicy policy = new ExplicitShardingPolicy(4, 3, 6);
assertTrue(policy.configurationIsValid());
int[] found = new int[4];
for (int i = 0; i < 6; i++) {
Set<Integer> shardIds = new HashSet<>(policy.getShardIdsFo... | alfresco-core | positive | 437,121 |
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
mRunning = false;
mReceiver.removeCallbacksAndMessages(null);
return super.quit();
mThread = null;
} | @Override
public void surfaceDestroyed(SurfaceHolder holder) {
<DeepExtract>
mRunning = false;
mReceiver.removeCallbacksAndMessages(null);
return super.quit();
</DeepExtract>
mThread = null;
} | android-recipes-5ed | positive | 437,122 |
public ArrayList<cgLog> loadLogs(String geocode) {
if (databaseRW == null || databaseRW.isOpen() == false) {
try {
if (dbHelper == null) {
dbHelper = new cgDbHelper(context);
}
databaseRW = dbHelper.getWritableDatabase();
if (databaseRW != null && databaseRW.isOpen()) {
Log.i(cgSettings.tag, "Connection to RW database ... | public ArrayList<cgLog> loadLogs(String geocode) {
<DeepExtract>
if (databaseRW == null || databaseRW.isOpen() == false) {
try {
if (dbHelper == null) {
dbHelper = new cgDbHelper(context);
}
databaseRW = dbHelper.getWritableDatabase();
if (databaseRW != null && databaseRW.isOpen()) {
Log.i(cgSettings.tag, "Connection t... | c-geo | positive | 437,124 |
private Iterable<String> keysWithPrefix(String pre) {
Queue<String> queue = new Queue<>();
if (get(root, pre, 0) == null)
return;
if (get(root, pre, 0).val != null) {
queue.enqueue(pre);
}
for (char c = 0; c < R; c++) {
collect(get(root, pre, 0).next[c], pre + c, queue);
}
return queue;
} | private Iterable<String> keysWithPrefix(String pre) {
Queue<String> queue = new Queue<>();
<DeepExtract>
if (get(root, pre, 0) == null)
return;
if (get(root, pre, 0).val != null) {
queue.enqueue(pre);
}
for (char c = 0; c < R; c++) {
collect(get(root, pre, 0).next[c], pre + c, queue);
}
</DeepExtract>
return queue;
} | Algorithm-fourth-edition | positive | 437,125 |
@Override
public DistkvAsyncSlistProxy slists() {
try {
if (!RouteTable.getInstance().refreshLeader(cliClientService, groupId, 1000).isOk()) {
throw new IllegalStateException("Refresh leader failed");
}
final PeerId leader = RouteTable.getInstance().selectLeader(groupId);
if (!leader.getIp().equals(leaderAddr)) {
leade... | @Override
public DistkvAsyncSlistProxy slists() {
<DeepExtract>
try {
if (!RouteTable.getInstance().refreshLeader(cliClientService, groupId, 1000).isOk()) {
throw new IllegalStateException("Refresh leader failed");
}
final PeerId leader = RouteTable.getInstance().selectLeader(groupId);
if (!leader.getIp().equals(leader... | distkv | positive | 437,128 |
public static AlipayTradeRoyaltyRelationBindResponse tradeRoyaltyRelationBind(AlipayTradeRoyaltyRelationBindModel model) throws AlipayApiException {
AlipayTradeRoyaltyRelationBindRequest request = new AlipayTradeRoyaltyRelationBindRequest();
request.setBizModel(model);
if (AliPayApiConfigKit.getAliPayApiConfig().isCert... | public static AlipayTradeRoyaltyRelationBindResponse tradeRoyaltyRelationBind(AlipayTradeRoyaltyRelationBindModel model) throws AlipayApiException {
AlipayTradeRoyaltyRelationBindRequest request = new AlipayTradeRoyaltyRelationBindRequest();
request.setBizModel(model);
<DeepExtract>
if (AliPayApiConfigKit.getAliPayApiC... | IJPay | positive | 437,133 |
private void btn_NbActionPerformed(java.awt.event.ActionEvent evt) {
lbl.setText(btn_Nb.getText());
X_Z.setText(41 + "");
X_A.removeAllItems();
String[] val = new String[95];
for (int i = 93; i <= val.length; i++) {
val[i] = Integer.toString(i + 0);
X_A.addItem(val[i]);
}
} | private void btn_NbActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
lbl.setText(btn_Nb.getText());
X_Z.setText(41 + "");
X_A.removeAllItems();
String[] val = new String[95];
for (int i = 93; i <= val.length; i++) {
val[i] = Integer.toString(i + 0);
X_A.addItem(val[i]);
}
</DeepExtract>
} | ERSN-OpenMC | positive | 437,134 |
@Override
public void update(TextureData data) {
if (isDisposed())
throw new IllegalStateException(TEXTURE_DISPOSED);
if (!created)
textureId = opengl.generateTexture();
bindStates.bindTexture(textureId, 0);
opengl.uploadTexture2DDataRGBA8(getPixelData(data), data.getWidth(), data.getHeight());
switch(data.getWrapMode(... | @Override
public void update(TextureData data) {
if (isDisposed())
throw new IllegalStateException(TEXTURE_DISPOSED);
if (!created)
textureId = opengl.generateTexture();
bindStates.bindTexture(textureId, 0);
opengl.uploadTexture2DDataRGBA8(getPixelData(data), data.getWidth(), data.getHeight());
switch(data.getWrapMode(... | WraithEngine | positive | 437,137 |
public static void main(String[] args) {
Recipe9_8 recipe = new Recipe9_8();
try {
doSomeWork();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
} | public static void main(String[] args) {
Recipe9_8 recipe = new Recipe9_8();
<DeepExtract>
try {
doSomeWork();
} catch (IOException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
</DeepExtract>
} | java-8-recipes | positive | 437,138 |
@Override
@SuppressWarnings("unchecked")
public <U> ContextAwareCompletableFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) {
ContextAwareCompletableFuture<U> contextAwareCompletableFuture = new ContextAwareCompletableFuture<>(snapshotHolder, takeNewSnapshot);
super.applyToEither(o... | @Override
@SuppressWarnings("unchecked")
public <U> ContextAwareCompletableFuture<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn) {
<DeepExtract>
ContextAwareCompletableFuture<U> contextAwareCompletableFuture = new ContextAwareCompletableFuture<>(snapshotHolder, takeNewSnapshot);
super.a... | context-propagation | positive | 437,140 |
@Override
public void onClick(View v) {
Inject.usageAnalytics().trackBookmarkEvent(getString(R.string.analytics_event_remove_bookmark_story), getStory());
snackbarView.hideCrouton();
persister.removeBookmark(story);
showRemovedBookmarkSnackbar(persister, story);
invalidateOptionsMenu();
} | @Override
public void onClick(View v) {
Inject.usageAnalytics().trackBookmarkEvent(getString(R.string.analytics_event_remove_bookmark_story), getStory());
snackbarView.hideCrouton();
<DeepExtract>
persister.removeBookmark(story);
showRemovedBookmarkSnackbar(persister, story);
</DeepExtract>
invalidateOptionsMenu();
} | yahnac | positive | 437,144 |
@Override
public void remove(@Nonnull Key key) {
if (mLock.getAndSet(true)) {
mException.add(new AssertionError());
}
try {
Thread.sleep(10);
} catch (InterruptedException e) {
mException.add(new AssertionError());
}
mLock.set(false);
} | @Override
public void remove(@Nonnull Key key) {
<DeepExtract>
if (mLock.getAndSet(true)) {
mException.add(new AssertionError());
}
try {
Thread.sleep(10);
} catch (InterruptedException e) {
mException.add(new AssertionError());
}
mLock.set(false);
</DeepExtract>
} | android-checkout | positive | 437,145 |
protected void onSetLayout(final String image_url, final String cctv) {
mImage = (PhotoView) findViewById(R.id.ssz_uk_co_senab_photoview);
mCurrMatrixTv = (TextView) findViewById(R.id.ssz_debug_textview);
mCaptv = (TextView) findViewById(R.id.ssz_caption_textview);
int color_i = ContextCompat.getColor(this, R.color.let... | protected void onSetLayout(final String image_url, final String cctv) {
mImage = (PhotoView) findViewById(R.id.ssz_uk_co_senab_photoview);
mCurrMatrixTv = (TextView) findViewById(R.id.ssz_debug_textview);
mCaptv = (TextView) findViewById(R.id.ssz_caption_textview);
<DeepExtract>
int color_i = ContextCompat.getColor(thi... | LoyalNativeSlider | positive | 437,148 |
public static SimplePolynomialFunction lightRandomFunction(int inputLen, int outputLen) {
Map<Monomial, BitVector> contributionMap = Maps.newHashMap();
for (int i = 0; i < outputLen; ++i) {
Set<Monomial> monomials = Sets.newHashSet();
while (monomials.size() < 10) {
Monomial monomial = Monomial.randomMonomial(inputLen,... | public static SimplePolynomialFunction lightRandomFunction(int inputLen, int outputLen) {
<DeepExtract>
Map<Monomial, BitVector> contributionMap = Maps.newHashMap();
for (int i = 0; i < outputLen; ++i) {
Set<Monomial> monomials = Sets.newHashSet();
while (monomials.size() < 10) {
Monomial monomial = Monomial.randomMono... | fhe-core | positive | 437,150 |
@Test
public void testByteToString() throws Exception {
String argString = (byte) 10.toString();
testThingtoString("byteToString", argString, argString);
} | @Test
public void testByteToString() throws Exception {
<DeepExtract>
String argString = (byte) 10.toString();
testThingtoString("byteToString", argString, argString);
</DeepExtract>
} | simplejmx | positive | 437,155 |
@Override
public void widgetSelected(SelectionEvent e) {
engine.getStatusModel().setVagrantRunning(false);
controllerManager.haltVagrant();
boolean allControllerStopped = true;
if (engine.getStatusModel().getCoreRunning() || engine.getStatusModel().getMininetRunning() || engine.getStatusModel().getDebuggerRunning() || ... | @Override
public void widgetSelected(SelectionEvent e) {
engine.getStatusModel().setVagrantRunning(false);
controllerManager.haltVagrant();
<DeepExtract>
boolean allControllerStopped = true;
if (engine.getStatusModel().getCoreRunning() || engine.getStatusModel().getMininetRunning() || engine.getStatusModel().getDebugge... | IDE | positive | 437,157 |
public static void main(String[] args) {
dataArray = new Data[3];
for (int i = 0; i < dataArray.length; i++) {
dataArray[i] = new Data("a String " + i, i, new Integer(i + 2), new Date());
}
dataList = new LinkedList<>();
for (Data dato : dataArray) {
dataList.add(dato);
}
Gson gson = new Gson();
System.out.println(gson... | public static void main(String[] args) {
dataArray = new Data[3];
for (int i = 0; i < dataArray.length; i++) {
dataArray[i] = new Data("a String " + i, i, new Integer(i + 2), new Date());
}
dataList = new LinkedList<>();
for (Data dato : dataArray) {
dataList.add(dato);
}
Gson gson = new Gson();
System.out.println(gson... | chuidiang-ejemplos | positive | 437,158 |
public void setNumericTransformer(NumericTransformer transformer) {
mNumericTransformer = transformer != null ? transformer : new DefaultNumericTransformer();
if (!isInEditMode() && mIndicator != null) {
if (mNumericTransformer.useStringTransform()) {
mIndicator.setIndicatorSizes(mNumericTransformer.transformToString(m... | public void setNumericTransformer(NumericTransformer transformer) {
mNumericTransformer = transformer != null ? transformer : new DefaultNumericTransformer();
if (!isInEditMode() && mIndicator != null) {
if (mNumericTransformer.useStringTransform()) {
mIndicator.setIndicatorSizes(mNumericTransformer.transformToString(m... | Genius-Android | positive | 437,160 |
@Override
public boolean test(@Nullable LivingEntity attacker, LivingEntity target) {
boolean isAttackable = false;
return target.getLastHurtByMob() != null && attacker != null && (target.getLastHurtByMob() == attacker || target.getLastHurtByMob().isAlliedTo(attacker));
if (!isAttackable && target instanceof Mob)
isAtt... | @Override
public boolean test(@Nullable LivingEntity attacker, LivingEntity target) {
boolean isAttackable = false;
<DeepExtract>
return target.getLastHurtByMob() != null && attacker != null && (target.getLastHurtByMob() == attacker || target.getLastHurtByMob().isAlliedTo(attacker));
</DeepExtract>
if (!isAttackable &&... | SlashBlade_2 | positive | 437,161 |
private void updateRelevantFields() {
if (mNameRow != null)
mNameRow.setVisibility(View.GONE);
if (mTypeRow != null)
mTypeRow.setVisibility(View.GONE);
if (mPowerRow != null)
mPowerRow.setVisibility(View.GONE);
if (mResolutionRow != null)
mResolutionRow.setVisibility(View.GONE);
if (mVendorRow != null)
mVendorRow.setVi... | private void updateRelevantFields() {
if (mNameRow != null)
mNameRow.setVisibility(View.GONE);
if (mTypeRow != null)
mTypeRow.setVisibility(View.GONE);
if (mPowerRow != null)
mPowerRow.setVisibility(View.GONE);
if (mResolutionRow != null)
mResolutionRow.setVisibility(View.GONE);
if (mVendorRow != null)
mVendorRow.setVi... | AndroidDemoProjects | positive | 437,162 |
public JTabbedPane createPanel() throws ParseException {
final ArrayList<JComponent> charts = new ArrayList<JComponent>();
JTabbedPane tabbedPaneBar = new JTabbedPane();
JPanel p = null;
JComponent chart = null;
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
tabbedPaneBar.add("Simple Grids", panel);
... | public JTabbedPane createPanel() throws ParseException {
final ArrayList<JComponent> charts = new ArrayList<JComponent>();
JTabbedPane tabbedPaneBar = new JTabbedPane();
JPanel p = null;
JComponent chart = null;
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
tabbedPaneBar.add("Simple Grids", panel);
... | Iceberg-Charts | positive | 437,164 |
@Override
public void teleopPeriodic() {
double forward = -1 * _gamepad.getY();
double turn = _gamepad.getTwist();
if (forward >= +0.05)
forward = forward;
if (forward <= -0.05)
forward = forward;
return 0;
if (turn >= +0.05)
turn = turn;
if (turn <= -0.05)
turn = turn;
return 0;
for (int i = 1; i < Constants.kNumButto... | @Override
public void teleopPeriodic() {
double forward = -1 * _gamepad.getY();
double turn = _gamepad.getTwist();
if (forward >= +0.05)
forward = forward;
if (forward <= -0.05)
forward = forward;
return 0;
if (turn >= +0.05)
turn = turn;
if (turn <= -0.05)
turn = turn;
return 0;
<DeepExtract>
for (int i = 1; i < Const... | Phoenix-Examples-Languages | positive | 437,165 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_downloaddir);
tv_dirPath = (TextView) findViewById(R.id.tv_dirPath);
btn_dirManual = (Button) findViewById(R.id.btn_dirManual);
btn_dirOk = (Button) findViewById(R.id.btn_dirOk);
btn_dirParent ... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_downloaddir);
tv_dirPath = (TextView) findViewById(R.id.tv_dirPath);
btn_dirManual = (Button) findViewById(R.id.btn_dirManual);
btn_dirOk = (Button) findViewById(R.id.btn_dirOk);
btn_dirParent ... | iBuka | positive | 437,166 |
public static void pitchUp(final int millis) {
Keyboard.pressKey(KeyEvent.VK_UP);
final long start = System.currentTimeMillis();
while (start + millis > System.currentTimeMillis()) {
Time.sleep(50);
}
Keyboard.releaseKey(KeyEvent.VK_UP);
} | public static void pitchUp(final int millis) {
<DeepExtract>
Keyboard.pressKey(KeyEvent.VK_UP);
final long start = System.currentTimeMillis();
while (start + millis > System.currentTimeMillis()) {
Time.sleep(50);
}
Keyboard.releaseKey(KeyEvent.VK_UP);
</DeepExtract>
} | RuneDream-API | positive | 437,167 |
private void registerHighTierPipes() {
generateFluidPipes(Materials.NiobiumTitanium, Materials.NiobiumTitanium.mName, GT_LanguageManager.i18nPlaceholder ? "%material" : Materials.NiobiumTitanium.mDefaultLocalName, 5180, 900, 2900, true);
generateFluidMultiPipes(Materials.NiobiumTitanium, Materials.NiobiumTitanium.mName... | private void registerHighTierPipes() {
generateFluidPipes(Materials.NiobiumTitanium, Materials.NiobiumTitanium.mName, GT_LanguageManager.i18nPlaceholder ? "%material" : Materials.NiobiumTitanium.mDefaultLocalName, 5180, 900, 2900, true);
generateFluidMultiPipes(Materials.NiobiumTitanium, Materials.NiobiumTitanium.mName... | NewHorizonsCoreMod | positive | 437,169 |
@Override
public void onClick(View v) {
mPlayer.setSpeed(0.5f);
float speed = mPlayer != null ? mPlayer.getSpeed() : 1;
speed_tv1.setTextColor(speed == 0.5f ? Color.parseColor("#2895E1") : Color.WHITE);
speed_tv2.setTextColor(speed == 1f ? Color.parseColor("#2895E1") : Color.WHITE);
speed_tv3.setTextColor(speed == 1.2f... | @Override
public void onClick(View v) {
mPlayer.setSpeed(0.5f);
<DeepExtract>
float speed = mPlayer != null ? mPlayer.getSpeed() : 1;
speed_tv1.setTextColor(speed == 0.5f ? Color.parseColor("#2895E1") : Color.WHITE);
speed_tv2.setTextColor(speed == 1f ? Color.parseColor("#2895E1") : Color.WHITE);
speed_tv3.setTextColor... | PinePlayer | positive | 437,170 |
@Override
public void run() {
RCLogger.i(TAG, "onVideoReattached");
RCLogger.i(TAG, "updateVideoView(), state: " + VideoViewState.ICE_CONNECTED);
if (this.localRenderLayout == null && this.remoteRenderLayout == null) {
return;
}
if (VideoViewState.ICE_CONNECTED == VideoViewState.NONE) {
localRender.setVisibility(View.I... | @Override
public void run() {
RCLogger.i(TAG, "onVideoReattached");
<DeepExtract>
RCLogger.i(TAG, "updateVideoView(), state: " + VideoViewState.ICE_CONNECTED);
if (this.localRenderLayout == null && this.remoteRenderLayout == null) {
return;
}
if (VideoViewState.ICE_CONNECTED == VideoViewState.NONE) {
localRender.setVis... | restcomm-android-sdk | positive | 437,172 |
public void makeDeposit(double cashToDeposit) {
cashInAccount += cashToDeposit;
System.out.println("Deposit Complete: Current Balance is " + getCashInAccount());
} | public void makeDeposit(double cashToDeposit) {
<DeepExtract>
cashInAccount += cashToDeposit;
</DeepExtract>
System.out.println("Deposit Complete: Current Balance is " + getCashInAccount());
} | JavaCode | positive | 437,173 |
@Test
public void calculateLargestRectangle1() throws Exception {
expected = 20;
heights = Arrays.asList(0, 1, 4, 2, 5, 6, 3, 2, 6, 6, 5, 2, 1, 3);
assertEquals(expected, ComputeLargestRectangle.calculateLargestRectangle(heights));
} | @Test
public void calculateLargestRectangle1() throws Exception {
expected = 20;
heights = Arrays.asList(0, 1, 4, 2, 5, 6, 3, 2, 6, 6, 5, 2, 1, 3);
<DeepExtract>
assertEquals(expected, ComputeLargestRectangle.calculateLargestRectangle(heights));
</DeepExtract>
} | elements-of-programming-interviews-solutions | positive | 437,177 |
public static int totalUnmappedReads(SamReader sfr) {
if (!sfr.hasIndex()) {
throw new IllegalArgumentException("bam file must be indexed");
}
int aligned = 0;
SAMRecordIterator sri = sfr.queryUnmapped();
while (sri.hasNext()) {
aligned++;
sri.next();
}
sfw.close();
return aligned;
} | public static int totalUnmappedReads(SamReader sfr) {
if (!sfr.hasIndex()) {
throw new IllegalArgumentException("bam file must be indexed");
}
int aligned = 0;
SAMRecordIterator sri = sfr.queryUnmapped();
while (sri.hasNext()) {
aligned++;
sri.next();
}
<DeepExtract>
sfw.close();
</DeepExtract>
return aligned;
} | isoscm | positive | 437,178 |
public static String generateSignedXml(final Map<String, String> data, String key, SignType signType) throws Exception {
String sign;
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray... | public static String generateSignedXml(final Map<String, String> data, String key, SignType signType) throws Exception {
String sign;
Set<String> keySet = data.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray... | payment-starter | positive | 437,179 |
@Override
public Set<String> keySet() {
RadixTreeVisitor<V, Set<String>> visitor = new RadixTreeVisitor<V, Set<String>>() {
Set<String> result = new TreeSet<>();
@Override
public void visit(String key, V value) {
result.add(key);
}
@Override
public Set<String> getResult() {
return result;
}
};
visit(root, "", "", visit... | @Override
public Set<String> keySet() {
RadixTreeVisitor<V, Set<String>> visitor = new RadixTreeVisitor<V, Set<String>>() {
Set<String> result = new TreeSet<>();
@Override
public void visit(String key, V value) {
result.add(key);
}
@Override
public Set<String> getResult() {
<DeepExtract>
return result;
</DeepExtract>
}... | iview-android-tv | positive | 437,183 |
void setText(char[] text, int length) {
this.text = text;
this.length = this.endBounds = length;
current = startBounds = end = 0;
skipPossessive = hasFinalPossessive = false;
while (startBounds < length && (isSubwordDelim(charType(text[startBounds])))) {
startBounds++;
}
while (endBounds > startBounds && (isSubwordDeli... | void setText(char[] text, int length) {
this.text = text;
this.length = this.endBounds = length;
current = startBounds = end = 0;
skipPossessive = hasFinalPossessive = false;
<DeepExtract>
while (startBounds < length && (isSubwordDelim(charType(text[startBounds])))) {
startBounds++;
}
while (endBounds > startBounds && ... | elasticsearch-plugin-bundle | positive | 437,185 |
public static void setFile(File f) {
m_File = f;
openFile();
write(sm_DATE_TIME_FORMAT.format(new Date()) + ": started.");
} | public static void setFile(File f) {
<DeepExtract>
m_File = f;
openFile();
write(sm_DATE_TIME_FORMAT.format(new Date()) + ": started.");
</DeepExtract>
} | twidlit | positive | 437,187 |
private static int deepHashCodeElement(Object element) {
if (element == null) {
return 0;
}
cl = element.getClass().getComponentType();
if (cl == null) {
return element.hashCode();
}
if (!cl.isPrimitive()) {
return deepHashCode((Object[]) element);
}
if (cl.equals(int.class)) {
return hashCode((int[]) element);
}
if (c... | private static int deepHashCodeElement(Object element) {
if (element == null) {
return 0;
}
cl = element.getClass().getComponentType();
if (cl == null) {
return element.hashCode();
}
if (!cl.isPrimitive()) {
return deepHashCode((Object[]) element);
}
if (cl.equals(int.class)) {
return hashCode((int[]) element);
}
if (c... | tvframe | positive | 437,189 |
public void reset() {
this.groupId = null;
this.artifactId = null;
this.version = null;
} | public void reset() {
this.groupId = null;
this.artifactId = null;
<DeepExtract>
this.version = null;
</DeepExtract>
} | maven-archetype | positive | 437,192 |
@Override
public void onStop() {
super.onStop();
if (mWebSocket != null && mWebSocket.isOpen()) {
mWebSocket.end();
mWebSocket = null;
}
} | @Override
public void onStop() {
super.onStop();
<DeepExtract>
if (mWebSocket != null && mWebSocket.isOpen()) {
mWebSocket.end();
mWebSocket = null;
}
</DeepExtract>
} | K6nele | positive | 437,194 |
@Override
public void decode(final FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if ((context.isPostback() && !isOnPostback()) || !isIf()) {
return;
}
ActionEvent e = new ActionEvent(this);
PhaseId phaseId;
String phase = getPhase();
if (phase == null) {
phaseId = null;
}
if ("APPLY... | @Override
public void decode(final FacesContext context) {
if (context == null) {
throw new NullPointerException();
}
if ((context.isPostback() && !isOnPostback()) || !isIf()) {
return;
}
ActionEvent e = new ActionEvent(this);
<DeepExtract>
PhaseId phaseId;
String phase = getPhase();
if (phase == null) {
phaseId = null... | faces | positive | 437,195 |
public static void main(String[] args) {
Node n1 = new Node(1);
Node n2 = new Node(2);
Node n3 = new Node(3);
this.next = n2;
this.next = n3;
System.out.println(n1.getData() + " -> " + n1.getNext().getData());
System.out.println(n2.getData() + " -> " + n2.getNext().getData());
Node x = new Node(11);
this.next = new Nod... | public static void main(String[] args) {
Node n1 = new Node(1);
Node n2 = new Node(2);
Node n3 = new Node(3);
this.next = n2;
this.next = n3;
System.out.println(n1.getData() + " -> " + n1.getNext().getData());
System.out.println(n2.getData() + " -> " + n2.getNext().getData());
Node x = new Node(11);
this.next = new Nod... | datastructures2018 | positive | 437,198 |
@Override
public void notify(Boolean connected) {
logger.debug("Connected (notification): {} : {}", url, connected);
logger.debug("Notifying device governor listener (connected): {} : {} : {}", url, bluetoothSmartDeviceListeners.size(), connected);
bluetoothSmartDeviceListeners.forEach(listener -> {
try {
if (connected... | @Override
public void notify(Boolean connected) {
logger.debug("Connected (notification): {} : {}", url, connected);
<DeepExtract>
logger.debug("Notifying device governor listener (connected): {} : {} : {}", url, bluetoothSmartDeviceListeners.size(), connected);
bluetoothSmartDeviceListeners.forEach(listener -> {
try {... | bluetooth-manager | positive | 437,199 |
public Object getCurrentUrl() {
int currentIndex = 0;
for (Object key : urlsMap.keySet()) {
if (currentIndex == index) {
return urlsMap.get(key);
}
currentIndex++;
}
return null;
} | public Object getCurrentUrl() {
<DeepExtract>
int currentIndex = 0;
for (Object key : urlsMap.keySet()) {
if (currentIndex == index) {
return urlsMap.get(key);
}
currentIndex++;
}
return null;
</DeepExtract>
} | IPlayer | positive | 437,200 |
@Override
public void documentChanged(@NotNull DocumentEvent e) {
myModified = true;
} | @Override
public void documentChanged(@NotNull DocumentEvent e) {
<DeepExtract>
myModified = true;
</DeepExtract>
} | testme-idea | positive | 437,201 |
public String getName(int node) {
if (node < 0 || node >= nNodes()) {
throw new RuntimeException("Node " + node + " does not exist");
}
if (node < nodeNames.size() && nodeNames.get(node).length() > 0) {
return nodeNames.get(node);
} else {
return Integer.toString(node);
}
} | public String getName(int node) {
<DeepExtract>
if (node < 0 || node >= nNodes()) {
throw new RuntimeException("Node " + node + " does not exist");
}
</DeepExtract>
if (node < nodeNames.size() && nodeNames.get(node).length() > 0) {
return nodeNames.get(node);
} else {
return Integer.toString(node);
}
} | monosat | positive | 437,202 |
public Configuration setMaxRedirect(Integer maxRedirect) {
data.put(KEY_MAX_REDIRECT, maxRedirect);
return this;
} | public Configuration setMaxRedirect(Integer maxRedirect) {
<DeepExtract>
data.put(KEY_MAX_REDIRECT, maxRedirect);
return this;
</DeepExtract>
} | WebCollector | positive | 437,203 |
void printPostOrderRecursive(Node root) {
if (root == null)
return;
printPostOrderRecursive(root.left);
printPostOrderRecursive(root.right);
if (root.data + " " == null)
return;
StringBuilder sb = new StringBuilder();
while (!root.data + " ".isEmpty()) {
sb.append(root.data + " ".pop().data).append(" ");
}
System.out.p... | void printPostOrderRecursive(Node root) {
if (root == null)
return;
printPostOrderRecursive(root.left);
printPostOrderRecursive(root.right);
<DeepExtract>
if (root.data + " " == null)
return;
StringBuilder sb = new StringBuilder();
while (!root.data + " ".isEmpty()) {
sb.append(root.data + " ".pop().data).append(" ");
... | GeeksforGeeks | positive | 437,204 |
@Action(value = "updateJobAdmin", results = { @Result(name = "success", location = "admin/jobSelect.jsp") })
public String updateJobAdmin() {
jobClass = adminService.selectJobClassById(jobClass.getJcid());
this.jobClass = jobClass;
adminService.updateJobName(jobName);
return SUCCESS;
} | @Action(value = "updateJobAdmin", results = { @Result(name = "success", location = "admin/jobSelect.jsp") })
public String updateJobAdmin() {
jobClass = adminService.selectJobClassById(jobClass.getJcid());
<DeepExtract>
this.jobClass = jobClass;
</DeepExtract>
adminService.updateJobName(jobName);
return SUCCESS;
} | jobs | positive | 437,205 |
private void revolt(Entity empire, int instability, InfluenceSource source, Optional<Influence> tile) {
policies.get(empire).stability += instability;
source.setPower(max(max(1, source.power() / 2), source.power() - instability / 5));
Culture culture = empires.get(empire).culture;
Empire data = new Empire(settings.gues... | private void revolt(Entity empire, int instability, InfluenceSource source, Optional<Influence> tile) {
policies.get(empire).stability += instability;
source.setPower(max(max(1, source.power() / 2), source.power() - instability / 5));
<DeepExtract>
Culture culture = empires.get(empire).culture;
Empire data = new Empire... | ShapeOfThingsThatWere | positive | 437,206 |
public static KafkaClientOptions fromProperties(Properties config, boolean isProducer) {
String tracePeerAddress = (String) config.getOrDefault(isProducer ? ProducerConfig.BOOTSTRAP_SERVERS_CONFIG : ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "");
this.tracePeerAddress = tracePeerAddress;
return this;
} | public static KafkaClientOptions fromProperties(Properties config, boolean isProducer) {
String tracePeerAddress = (String) config.getOrDefault(isProducer ? ProducerConfig.BOOTSTRAP_SERVERS_CONFIG : ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "");
<DeepExtract>
this.tracePeerAddress = tracePeerAddress;
return this;
</Deep... | vertx-kafka-client | positive | 437,208 |
@Override
public CompletableFuture<ResolutionResult<byte[]>> readBytesAndValidate(final URL source, final String relativePath, final HashAlgorithm algorithm, final String hash) {
final Path path = this.baseDirectory.resolve(relativePath);
if (path.toFile().isFile()) {
try {
if (algorithm.validate(hash, path)) {
return ... | @Override
public CompletableFuture<ResolutionResult<byte[]>> readBytesAndValidate(final URL source, final String relativePath, final HashAlgorithm algorithm, final String hash) {
<DeepExtract>
final Path path = this.baseDirectory.resolve(relativePath);
if (path.toFile().isFile()) {
try {
if (algorithm.validate(hash, pa... | VanillaGradle | positive | 437,210 |
@Test
public void SNI() throws Exception {
String appId = (String) Whitebox.getInternalState(client, "applicationID");
List<String> hostsArray = (List<String>) Whitebox.getInternalState(client, "readHosts");
hostsArray.set(0, appId + "-1.algolianet.com");
hostsArray.set(1, appId + "-2.algolianet.com");
hostsArray.set(2... | @Test
public void SNI() throws Exception {
String appId = (String) Whitebox.getInternalState(client, "applicationID");
List<String> hostsArray = (List<String>) Whitebox.getInternalState(client, "readHosts");
hostsArray.set(0, appId + "-1.algolianet.com");
hostsArray.set(1, appId + "-2.algolianet.com");
hostsArray.set(2... | algoliasearch-client-android | positive | 437,212 |
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
PreparedStatement ps = getConnection().prepareStatement(sql, resultSetType, resultSetConcurrency);
if (statements == null)
statements = new ArrayList<>();
statements.add(ps);
return ps;
} | public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
PreparedStatement ps = getConnection().prepareStatement(sql, resultSetType, resultSetConcurrency);
<DeepExtract>
if (statements == null)
statements = new ArrayList<>();
statements.add(ps);
</DeepExtr... | kareldb | positive | 437,213 |
public void testEdges() {
resources = q.getUsedArtifactsAsResources("st:p2");
assertTrue((resources != null) && resources.size() == 2);
resources = q.getGeneratedArtifactsAsResources("st:p2");
assertTrue((resources != null) && resources.size() == 1);
resources = q.getDerivedFromArtifactsAsResources("st:a4");
expected =... | public void testEdges() {
resources = q.getUsedArtifactsAsResources("st:p2");
assertTrue((resources != null) && resources.size() == 2);
resources = q.getGeneratedArtifactsAsResources("st:p2");
assertTrue((resources != null) && resources.size() == 1);
resources = q.getDerivedFromArtifactsAsResources("st:a4");
expected =... | OpenProvenanceModel | positive | 437,214 |
@Override
public String toString() {
if (value.length != BYTES) {
throw new IllegalArgumentException("We need exactly 4 bytes");
}
final long value = (((long) value[0] & 0xFF) << (3 * Byte.SIZE)) | (((long) value[1] & 0xFF) << (2 * Byte.SIZE)) | (((long) value[2] & 0xFF) << (Byte.SIZE)) | ((long) value[3] & 0xFF);
retu... | @Override
public String toString() {
<DeepExtract>
if (value.length != BYTES) {
throw new IllegalArgumentException("We need exactly 4 bytes");
}
final long value = (((long) value[0] & 0xFF) << (3 * Byte.SIZE)) | (((long) value[1] & 0xFF) << (2 * Byte.SIZE)) | (((long) value[2] & 0xFF) << (Byte.SIZE)) | ((long) value[3]... | JavaOSC | positive | 437,215 |
private void applyStringTz(DateFilter subject, String supplied, String expected, String tz) {
Instant instant = subject.executeParsers(supplied);
DateTime dateTime = new DateTime(instant);
System.out.println(dateTime.toString(STANDARD_DATE_FORMAT_UTC));
Assertions.assertEquals(expected, dateTime.toString(STANDARD_DATE_... | private void applyStringTz(DateFilter subject, String supplied, String expected, String tz) {
Instant instant = subject.executeParsers(supplied);
DateTime dateTime = new DateTime(instant);
System.out.println(dateTime.toString(STANDARD_DATE_FORMAT_UTC));
<DeepExtract>
Assertions.assertEquals(expected, dateTime.toString(... | ApplicationPower | positive | 437,216 |
public String paginAndTrans(int pageNumber, int pageSize, String... sql) {
String result = null;
DialectException.assureNotNull(trans(sql), "sql string can not be null");
String trimedSql = trans(sql).trim();
DialectException.assureNotEmpty(trimedSql, "sql string can not be empty");
if (!StrUtils.startsWithIgnoreCase(t... | public String paginAndTrans(int pageNumber, int pageSize, String... sql) {
<DeepExtract>
String result = null;
DialectException.assureNotNull(trans(sql), "sql string can not be null");
String trimedSql = trans(sql).trim();
DialectException.assureNotEmpty(trimedSql, "sql string can not be empty");
if (!StrUtils.startsWi... | jDialects | positive | 437,217 |
@Override
public void onClick(View view) {
playsound(R.raw.keyok2);
if (isChatty)
speak("Temperature sensor");
switchsensorlayout(4);
startsensors(4);
if (isMaster) {
saycommand("temperature");
sendtext("computer " + "temperature");
}
} | @Override
public void onClick(View view) {
playsound(R.raw.keyok2);
if (isChatty)
speak("Temperature sensor");
switchsensorlayout(4);
startsensors(4);
<DeepExtract>
if (isMaster) {
saycommand("temperature");
sendtext("computer " + "temperature");
}
</DeepExtract>
} | Trycorder5 | positive | 437,218 |
public Entity createEntity(Entity root, ColorPrimitiveVO vo) {
Entity entity = new Entity();
colorPrimitiveFactory.createComponents(root, entity, vo);
ComponentMapper<MainItemComponent> mainItemComponentComponentMapper = ComponentMapper.getFor(MainItemComponent.class);
MainItemComponent mainItemComponent = mainItemComp... | public Entity createEntity(Entity root, ColorPrimitiveVO vo) {
Entity entity = new Entity();
colorPrimitiveFactory.createComponents(root, entity, vo);
<DeepExtract>
ComponentMapper<MainItemComponent> mainItemComponentComponentMapper = ComponentMapper.getFor(MainItemComponent.class);
MainItemComponent mainItemComponent ... | overlap2d-runtime-libgdx | positive | 437,220 |
public static void main(String[] args) {
Recipe9_1 recipe = new Recipe9_1();
System.out.println("Is th string 1234 longer than 5 chars?:" + isStringShorterThanFiveCharacters("1234"));
System.out.println("Is th string 12345 longer than 5 chars?:" + isStringShorterThanFiveCharacters("12345"));
System.out.println("Is th s... | public static void main(String[] args) {
Recipe9_1 recipe = new Recipe9_1();
<DeepExtract>
System.out.println("Is th string 1234 longer than 5 chars?:" + isStringShorterThanFiveCharacters("1234"));
System.out.println("Is th string 12345 longer than 5 chars?:" + isStringShorterThanFiveCharacters("12345"));
System.out.pr... | java-8-recipes | positive | 437,222 |
public Criteria andCostLessThanOrEqualTo(Float value) {
if (value == null) {
throw new RuntimeException("Value for " + "cost" + " cannot be null");
}
criteria.add(new Criterion("cost <=", value));
return (Criteria) this;
} | public Criteria andCostLessThanOrEqualTo(Float value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "cost" + " cannot be null");
}
criteria.add(new Criterion("cost <=", value));
</DeepExtract>
return (Criteria) this;
} | ssmBillBook | positive | 437,224 |
public static Throwable getCause(Throwable throwable, String[] methodNames) {
if (throwable == null) {
return null;
}
Throwable cause;
if (throwable instanceof Nestable) {
cause = throwable.getCause();
} else if (throwable instanceof SQLException) {
cause = ((SQLException) throwable).getNextException();
} else if (thro... | public static Throwable getCause(Throwable throwable, String[] methodNames) {
if (throwable == null) {
return null;
}
<DeepExtract>
Throwable cause;
if (throwable instanceof Nestable) {
cause = throwable.getCause();
} else if (throwable instanceof SQLException) {
cause = ((SQLException) throwable).getNextException();
}... | commands | positive | 437,225 |
@Override
public void getAllUser(final ContextCallBack c) {
BaseRouterBean bean = new BaseRouterBean();
bean.setDhcpUsers(mActiveUsers);
if (isSupport(supportYes(bean))) {
BaseRouterBean bean = (BaseRouterBean) supportYes(bean).get(RouterInterface.BASEDATA);
mMacAddressFilterBeans = bean.getBlackUsers();
}
c.putData(su... | @Override
public void getAllUser(final ContextCallBack c) {
BaseRouterBean bean = new BaseRouterBean();
bean.setDhcpUsers(mActiveUsers);
<DeepExtract>
if (isSupport(supportYes(bean))) {
BaseRouterBean bean = (BaseRouterBean) supportYes(bean).get(RouterInterface.BASEDATA);
mMacAddressFilterBeans = bean.getBlackUsers();
... | RouterManager | positive | 437,227 |
private void disconnect() {
boolean wasConnected = outputStream != null;
try {
socket.close();
} catch (Exception e) {
}
try {
socketOutputStream.close();
} catch (Exception e) {
}
try {
socketInputStream.close();
} catch (Exception e) {
}
socket = null;
socketOutputStream = null;
outputStream = null;
socketInputStream... | private void disconnect() {
boolean wasConnected = outputStream != null;
try {
socket.close();
} catch (Exception e) {
}
try {
socketOutputStream.close();
} catch (Exception e) {
}
try {
socketInputStream.close();
} catch (Exception e) {
}
socket = null;
socketOutputStream = null;
outputStream = null;
socketInputStream... | javatari | positive | 437,231 |
private static void enqueueCacheRead(ImageRequest request, RequestKey key, boolean allowCachedRedirects) {
synchronized (pendingRequests) {
DownloaderContext downloaderContext = new DownloaderContext();
downloaderContext.request = request;
pendingRequests.put(key, downloaderContext);
downloaderContext.workItem = cacheR... | private static void enqueueCacheRead(ImageRequest request, RequestKey key, boolean allowCachedRedirects) {
<DeepExtract>
synchronized (pendingRequests) {
DownloaderContext downloaderContext = new DownloaderContext();
downloaderContext.request = request;
pendingRequests.put(key, downloaderContext);
downloaderContext.wor... | HypFacebook | positive | 437,232 |
public static String toAscii(String trytes) {
int cutPos;
for (cutPos = trytes.length(); cutPos > 0 && trytes.charAt(cutPos - 1) == '9'; cutPos--) ;
return trytes.substring(0, cutPos);
char[] padded = new char[trytes.length() + 2 - (trytes.length() + 2) % 3];
System.arraycopy(trytes.toCharArray(), 0, padded, 0, trytes.... | public static String toAscii(String trytes) {
int cutPos;
for (cutPos = trytes.length(); cutPos > 0 && trytes.charAt(cutPos - 1) == '9'; cutPos--) ;
return trytes.substring(0, cutPos);
<DeepExtract>
char[] padded = new char[trytes.length() + 2 - (trytes.length() + 2) % 3];
System.arraycopy(trytes.toCharArray(), 0, padd... | ict | positive | 437,233 |
public boolean previous() {
if (mIsClosed) {
throw new IllegalStateException("Client instance can't be used after being closed.");
}
if (mPlayerPlaylist.isEmpty()) {
return false;
}
PlaybackService.play(getContext(), mPlayerPlaylist.previous());
return true;
} | public boolean previous() {
<DeepExtract>
if (mIsClosed) {
throw new IllegalStateException("Client instance can't be used after being closed.");
}
</DeepExtract>
if (mPlayerPlaylist.isEmpty()) {
return false;
}
PlaybackService.play(getContext(), mPlayerPlaylist.previous());
return true;
} | pod-adddict | positive | 437,235 |
@Override
public void itemStateChanged(ItemEvent e) {
HandStateItem states = (HandStateItem) e.getItem();
tableScroller.setBorder(new TitledBorder(states.hand.game.id));
((HandStateTableModel) handTable.getModel()).setRows(states.states);
autoButton.setSelected(stateCombo.getSelectedIndex() == stateCombo.getItemCount()... | @Override
public void itemStateChanged(ItemEvent e) {
HandStateItem states = (HandStateItem) e.getItem();
tableScroller.setBorder(new TitledBorder(states.hand.game.id));
((HandStateTableModel) handTable.getModel()).setRows(states.states);
<DeepExtract>
autoButton.setSelected(stateCombo.getSelectedIndex() == stateCombo.... | poker | positive | 437,236 |
protected FileBasedBinlogParser getDefaultBinlogParser() throws Exception {
final FileBasedBinlogParser r = new FileBasedBinlogParser();
r.registerEventParser(new StopEventParser());
r.registerEventParser(new RotateEventParser());
r.registerEventParser(new IntvarEventParser());
r.registerEventParser(new XidEventParser(... | protected FileBasedBinlogParser getDefaultBinlogParser() throws Exception {
final FileBasedBinlogParser r = new FileBasedBinlogParser();
r.registerEventParser(new StopEventParser());
r.registerEventParser(new RotateEventParser());
r.registerEventParser(new IntvarEventParser());
r.registerEventParser(new XidEventParser(... | open-replicator | positive | 437,237 |
public static void gotoPickVideo(Fragment fragment, int requestCode) {
if (getPickVideoIntent() == null)
return;
if (null != null) {
null.startActivityForResult(getPickVideoIntent(), requestCode);
} else if (fragment != null) {
fragment.startActivityForResult(getPickVideoIntent(), requestCode);
}
} | public static void gotoPickVideo(Fragment fragment, int requestCode) {
<DeepExtract>
if (getPickVideoIntent() == null)
return;
if (null != null) {
null.startActivityForResult(getPickVideoIntent(), requestCode);
} else if (fragment != null) {
fragment.startActivityForResult(getPickVideoIntent(), requestCode);
}
</DeepEx... | Utils-Everywhere | positive | 437,238 |
public static TDJSONOption ofIndentFactor(int factor) {
this.indentFactor = factor;
indentStr = padEnd("", indentFactor);
return this;
} | public static TDJSONOption ofIndentFactor(int factor) {
<DeepExtract>
this.indentFactor = factor;
indentStr = padEnd("", indentFactor);
return this;
</DeepExtract>
} | jsonex | positive | 437,240 |
public static OutputStream createEncryptedOutputStream(Credentials credentials, KdbxHeader kdbxHeader, OutputStream outputStream) throws IOException {
MessageDigest messageDigest = Encryption.getSha256MessageDigestInstance();
DigestOutputStream digestOutputStream = new DigestOutputStream(outputStream, messageDigest);
L... | public static OutputStream createEncryptedOutputStream(Credentials credentials, KdbxHeader kdbxHeader, OutputStream outputStream) throws IOException {
MessageDigest messageDigest = Encryption.getSha256MessageDigestInstance();
DigestOutputStream digestOutputStream = new DigestOutputStream(outputStream, messageDigest);
L... | KeePassJava2 | positive | 437,241 |
@Test
public void testNumberLiterals() {
org.junit.Assert.assertEquals(" 0 ", compileAndRun("10 PRINT 0"));
org.junit.Assert.assertEquals(" 1 ", compileAndRun("10 PRINT 1"));
org.junit.Assert.assertEquals(" 2 ", compileAndRun("10 PRINT 2"));
org.junit.Assert.assertEquals(" 8192 ", compileAndRun("10 PRINT 8192"));
org.j... | @Test
public void testNumberLiterals() {
org.junit.Assert.assertEquals(" 0 ", compileAndRun("10 PRINT 0"));
org.junit.Assert.assertEquals(" 1 ", compileAndRun("10 PRINT 1"));
org.junit.Assert.assertEquals(" 2 ", compileAndRun("10 PRINT 2"));
org.junit.Assert.assertEquals(" 8192 ", compileAndRun("10 PRINT 8192"));
org.j... | BASICCompiler | positive | 437,242 |
protected void createAndShowNetworkErrorDialog(String serverName, String serverPath, boolean showResetButton, boolean showWifiButton) {
if (networkErrorDialog != null) {
try {
networkErrorDialog.dismiss();
} catch (Exception ignored) {
}
}
networkErrorDialog = new Dialog(this);
dialogNetworkErrorBinding = DataBindingUt... | protected void createAndShowNetworkErrorDialog(String serverName, String serverPath, boolean showResetButton, boolean showWifiButton) {
<DeepExtract>
if (networkErrorDialog != null) {
try {
networkErrorDialog.dismiss();
} catch (Exception ignored) {
}
}
</DeepExtract>
networkErrorDialog = new Dialog(this);
dialogNetwor... | hmdm-android | positive | 437,243 |
public void removeRigidBody(btRigidBody object) {
if (object == null) {
return;
}
dynamicsWorld.removeRigidBody(object);
collisionConfig.dispose();
dispatcher.dispose();
dynamicsWorld.dispose();
broadphase.dispose();
constraintSolver.dispose();
tickCallback.dispose();
callback.dispose();
super.dispose();
} | public void removeRigidBody(btRigidBody object) {
if (object == null) {
return;
}
dynamicsWorld.removeRigidBody(object);
<DeepExtract>
collisionConfig.dispose();
dispatcher.dispose();
dynamicsWorld.dispose();
broadphase.dispose();
constraintSolver.dispose();
tickCallback.dispose();
callback.dispose();
super.dispose();
... | Alien-Ark | positive | 437,244 |
void onError(Throwable throwable) {
if (cancelled) {
return;
}
if (!cancelled) {
cancelled = true;
if (scheduledFuture != null) {
scheduledFuture.cancel(true);
}
}
actual.onError(throwable);
} | void onError(Throwable throwable) {
if (cancelled) {
return;
}
<DeepExtract>
if (!cancelled) {
cancelled = true;
if (scheduledFuture != null) {
scheduledFuture.cancel(true);
}
}
</DeepExtract>
actual.onError(throwable);
} | Hands-On-Reactive-Programming-in-Spring-5 | positive | 437,245 |
@Override
public void dispose() {
if (!initialized)
return;
initialized = false;
fbo.dispose();
fbo = null;
} | @Override
public void dispose() {
<DeepExtract>
if (!initialized)
return;
initialized = false;
fbo.dispose();
fbo = null;
</DeepExtract>
} | gdx-vfx | positive | 437,246 |
private void validateService(Service service, String toolVersion) throws GeneratorException {
List<Deployref> dks = service.getDeployto().getDeployref();
int defaults = 0;
for (Deployref dk : dks) {
boolean isDefaultDeployment = dk.isDefault();
if (isDefaultDeployment) {
defaults++;
}
Deployment d = (Deployment) dk.get... | private void validateService(Service service, String toolVersion) throws GeneratorException {
List<Deployref> dks = service.getDeployto().getDeployref();
int defaults = 0;
for (Deployref dk : dks) {
boolean isDefaultDeployment = dk.isDefault();
if (isDefaultDeployment) {
defaults++;
}
Deployment d = (Deployment) dk.get... | interoperability-framework | positive | 437,247 |
private static boolean referenceExpression_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "referenceExpression_0"))
return false;
Marker m = enter_section_(b);
if (!recursion_guard_(b, l + 1, "variableExpression"))
r = false;
if (!nextTokenIsSmart(b, HASH))
r = false;
boolean r;
Marker m = enter_section_(b);
r = ... | private static boolean referenceExpression_0(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "referenceExpression_0"))
return false;
Marker m = enter_section_(b);
<DeepExtract>
if (!recursion_guard_(b, l + 1, "variableExpression"))
r = false;
if (!nextTokenIsSmart(b, HASH))
r = false;
boolean r;
Marker m = enter_sec... | Cofe-Mybatis | positive | 437,249 |
public String getTvBaseUrl() {
String deviceDefault = THETVDB_BASE_URL;
if (devicePrefsSpec != null) {
Object val = devicePrefsSpec.getDefaultValues().get(TV_BASE_URL);
if (val != null)
deviceDefault = (String) val;
}
return prefs.getString(TV_BASE_URL, deviceDefault);
} | public String getTvBaseUrl() {
<DeepExtract>
String deviceDefault = THETVDB_BASE_URL;
if (devicePrefsSpec != null) {
Object val = devicePrefsSpec.getDefaultValues().get(TV_BASE_URL);
if (val != null)
deviceDefault = (String) val;
}
return prefs.getString(TV_BASE_URL, deviceDefault);
</DeepExtract>
} | mythling | positive | 437,250 |
public ZPopupMenu addAction(String action, boolean isSelected) {
Item item = new Item();
this.text = action;
return this;
item.isSelected = isSelected;
addAction(item);
return this;
} | public ZPopupMenu addAction(String action, boolean isSelected) {
Item item = new Item();
<DeepExtract>
this.text = action;
return this;
</DeepExtract>
item.isSelected = isSelected;
addAction(item);
return this;
} | ZUILib | positive | 437,251 |
public RoleBuilder withSupplierAuthorities() {
addAuthorities.add(new AddAuthority(Authority.ROLE_PUBLIC));
return this;
addAuthorities.add(new AddAuthority(Authority.ROLE_SUPPLIER));
return this;
return this;
} | public RoleBuilder withSupplierAuthorities() {
addAuthorities.add(new AddAuthority(Authority.ROLE_PUBLIC));
return this;
<DeepExtract>
addAuthorities.add(new AddAuthority(Authority.ROLE_SUPPLIER));
return this;
</DeepExtract>
return this;
} | multibit-merchant | positive | 437,254 |
protected static MethodConfig getMethodConfig(ServiceConfig serviceConfig, String methodName) {
Method method;
switch(methodName) {
case METHOD_1:
method = getMethod(methodName, Object.class);
case METHOD_2:
method = getMethod(methodName, new Class<?>[] {});
case METHOD_3:
method = getMethod(methodName, long.class);
ca... | protected static MethodConfig getMethodConfig(ServiceConfig serviceConfig, String methodName) {
<DeepExtract>
Method method;
switch(methodName) {
case METHOD_1:
method = getMethod(methodName, Object.class);
case METHOD_2:
method = getMethod(methodName, new Class<?>[] {});
case METHOD_3:
method = getMethod(methodName, l... | SilverWare | positive | 437,255 |
private static MapType<String> getEmptyBlockPalette() {
final MapType<String> airBlockState = Types.NBT.createEmptyMap();
airBlockState.setString("Name", "minecraft:air");
final ListType emptyBlockPalette = Types.NBT.createEmptyList();
emptyBlockPalette.addMap(airBlockState);
return wrapPalette(emptyBlockPalette, null)... | private static MapType<String> getEmptyBlockPalette() {
final MapType<String> airBlockState = Types.NBT.createEmptyMap();
airBlockState.setString("Name", "minecraft:air");
final ListType emptyBlockPalette = Types.NBT.createEmptyList();
emptyBlockPalette.addMap(airBlockState);
<DeepExtract>
return wrapPalette(emptyBlock... | DataConverter | positive | 437,256 |
public static BarcodesDetectedEvent obtain(int viewTag, WritableArray barcodes, byte[] compressedImage) {
BarcodesDetectedEvent event = EVENTS_POOL.acquire();
if (event == null) {
event = new BarcodesDetectedEvent();
}
super.init(viewTag);
mBarcodes = barcodes;
mCompressedImage = compressedImage;
return event;
} | public static BarcodesDetectedEvent obtain(int viewTag, WritableArray barcodes, byte[] compressedImage) {
BarcodesDetectedEvent event = EVENTS_POOL.acquire();
if (event == null) {
event = new BarcodesDetectedEvent();
}
<DeepExtract>
super.init(viewTag);
mBarcodes = barcodes;
mCompressedImage = compressedImage;
</DeepEx... | react-native-camera | positive | 437,258 |
@Override
public String getPath() {
if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(contentUri.getScheme())) {
return contentUri.getPath();
}
String path = EnvironmentUtil.getFilePathFromContentUri(MyApplication.getApplication(), contentUri);
if (!TextUtils.isEmpty(path))
return path;
return contentUri.toString();
} | @Override
public String getPath() {
if (ContentResolver.SCHEME_FILE.equalsIgnoreCase(contentUri.getScheme())) {
return contentUri.getPath();
}
String path = EnvironmentUtil.getFilePathFromContentUri(MyApplication.getApplication(), contentUri);
if (!TextUtils.isEmpty(path))
return path;
<DeepExtract>
return contentUri.t... | apkextractor | positive | 437,259 |
@Test
public void complexSequence() throws Exception {
lexer.lex("FSM:fsm{this}");
assertEquals("#FSM#,C,#fsm#,OB,#this#,CB", tokens);
} | @Test
public void complexSequence() throws Exception {
<DeepExtract>
lexer.lex("FSM:fsm{this}");
assertEquals("#FSM#,C,#fsm#,OB,#this#,CB", tokens);
</DeepExtract>
} | CC_SMC | positive | 437,260 |
@Override
public void onDateChanged() {
if (true) {
mSelectedDay.set(mController.getSelectedDay());
}
mTempDay.set(mController.getSelectedDay());
final int position = (mController.getSelectedDay().year - mController.getMinDate().year) * SimpleMonthAdapter.MONTHS_IN_YEAR + (mController.getSelectedDay().month - mControll... | @Override
public void onDateChanged() {
<DeepExtract>
if (true) {
mSelectedDay.set(mController.getSelectedDay());
}
mTempDay.set(mController.getSelectedDay());
final int position = (mController.getSelectedDay().year - mController.getMinDate().year) * SimpleMonthAdapter.MONTHS_IN_YEAR + (mController.getSelectedDay().mon... | android-betterpickers | positive | 437,263 |
private void hideAll() {
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
if (view != null) {
view.setVisibility(View.INVISIBLE);
}
return this;
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
$.id(R.id.app_video_bottom... | private void hideAll() {
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
if (view != null) {
view.setVisibility(View.INVISIBLE);
}
return this;
if (view != null) {
view.setVisibility(View.GONE);
}
return this;
$.id(R.id.app_video_bottom... | FastVideoPlayer | positive | 437,264 |
private static UriComponents applyContributors(UriComponentsBuilder builder, Method method, Object... args) {
CompositeUriComponentsContributor contributor;
WebApplicationContext wac = getWebApplicationContext();
if (wac == null) {
contributor = null;
}
try {
contributor = wac.getBean(MVC_URI_COMPONENTS_CONTRIBUTOR_BEA... | private static UriComponents applyContributors(UriComponentsBuilder builder, Method method, Object... args) {
CompositeUriComponentsContributor contributor;
WebApplicationContext wac = getWebApplicationContext();
if (wac == null) {
contributor = null;
}
try {
contributor = wac.getBean(MVC_URI_COMPONENTS_CONTRIBUTOR_BEA... | springlets | positive | 437,265 |
public AtomContext merge(AtomContext other) {
if (other == null || other.atoms == null || other.atoms.object == null) {
return this;
}
if (atoms == null || atoms.object == null) {
return this;
}
if (atoms.exclusive()) {
atoms.object = Lexicographic.merge(atoms.object, other.atoms.object);
other.discard();
return this;
... | public AtomContext merge(AtomContext other) {
if (other == null || other.atoms == null || other.atoms.object == null) {
return this;
}
if (atoms == null || atoms.object == null) {
return this;
}
if (atoms.exclusive()) {
atoms.object = Lexicographic.merge(atoms.object, other.atoms.object);
other.discard();
return this;
... | tracingplane-java | positive | 437,266 |
private void init(Context context) {
mContext = context;
LayoutInflater.from(mContext).inflate(R.layout.wootric_survey_layout, this);
Typeface iconFont = FontManager.getTypeface(context, FontManager.FONTAWESOME);
mSurveyLayout = (RelativeLayout) findViewById(R.id.wootric_nps_layout);
mTvSurveyQuestion = (TextView) find... | private void init(Context context) {
mContext = context;
LayoutInflater.from(mContext).inflate(R.layout.wootric_survey_layout, this);
Typeface iconFont = FontManager.getTypeface(context, FontManager.FONTAWESOME);
mSurveyLayout = (RelativeLayout) findViewById(R.id.wootric_nps_layout);
mTvSurveyQuestion = (TextView) find... | WootricSDK-Android | positive | 437,267 |
public ListTag<LongArrayTag> asLongArrayTagList() {
checkTypeClass(LongArrayTag.class);
return (ListTag<L>) this;
} | public ListTag<LongArrayTag> asLongArrayTagList() {
<DeepExtract>
checkTypeClass(LongArrayTag.class);
return (ListTag<L>) this;
</DeepExtract>
} | NBT | positive | 437,268 |
public Result isSatisfiable(Expression<Boolean> expr) {
push();
add(Arrays.asList(expr));
Result res = isSatisfiable();
pop(1);
return res;
} | public Result isSatisfiable(Expression<Boolean> expr) {
push();
add(Arrays.asList(expr));
Result res = isSatisfiable();
<DeepExtract>
pop(1);
</DeepExtract>
return res;
} | jconstraints | positive | 437,269 |
@Override
public CompletableFuture<OvsdbClient> connect(String ip, int port) {
CompletableFuture<OvsdbClient> ovsdbClientFuture = new CompletableFuture<>();
EventLoopGroup group = new NioEventLoopGroup();
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(group).channel(NioSocketChannel.class).option(ChannelOption.... | @Override
public CompletableFuture<OvsdbClient> connect(String ip, int port) {
<DeepExtract>
CompletableFuture<OvsdbClient> ovsdbClientFuture = new CompletableFuture<>();
EventLoopGroup group = new NioEventLoopGroup();
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(group).channel(NioSocketChannel.class).option(... | ovsdb-client-library | positive | 437,271 |
private void computeAngles(H3Graph graph, HyperbolicLayout layout) {
Children children = new Children();
int childIndex = graph.getNodeChildIndex(graph.getRootNode());
int nontreeIndex = graph.getNodeNontreeIndex(graph.getRootNode());
if (childIndex < nontreeIndex) {
{
for (int i = childIndex; i < nontreeIndex; i++) {
... | private void computeAngles(H3Graph graph, HyperbolicLayout layout) {
Children children = new Children();
<DeepExtract>
int childIndex = graph.getNodeChildIndex(graph.getRootNode());
int nontreeIndex = graph.getNodeNontreeIndex(graph.getRootNode());
if (childIndex < nontreeIndex) {
{
for (int i = childIndex; i < nontree... | walrus | positive | 437,272 |
public void putLShort(int s) {
if (Binary.writeLShort(s) == null) {
return;
}
this.ensureCapacity(this.count + Binary.writeLShort(s).length);
System.arraycopy(Binary.writeLShort(s), 0, this.buffer, this.count, Binary.writeLShort(s).length);
this.count += Binary.writeLShort(s).length;
} | public void putLShort(int s) {
<DeepExtract>
if (Binary.writeLShort(s) == null) {
return;
}
this.ensureCapacity(this.count + Binary.writeLShort(s).length);
System.arraycopy(Binary.writeLShort(s), 0, this.buffer, this.count, Binary.writeLShort(s).length);
this.count += Binary.writeLShort(s).length;
</DeepExtract>
} | Dragonet-Legacy | positive | 437,274 |
public char readChar() throws JMSException {
checkWriteOnlyBody();
if (dataIn == null) {
Buffer buffer = getContent();
if (buffer == null) {
buffer = new Buffer(0);
}
dataIn = new DataInputStream(new ByteArrayInputStream(buffer));
this.length = buffer.getLength();
}
try {
return this.dataIn.readChar();
} catch (ArrayIn... | public char readChar() throws JMSException {
<DeepExtract>
checkWriteOnlyBody();
if (dataIn == null) {
Buffer buffer = getContent();
if (buffer == null) {
buffer = new Buffer(0);
}
dataIn = new DataInputStream(new ByteArrayInputStream(buffer));
this.length = buffer.getLength();
}
</DeepExtract>
try {
return this.dataIn... | stompjms | positive | 437,275 |
@Test
public void withSpinnerText_withString_addsCorrectMatcher() {
notCompletable.withSpinnerText("test");
assertThat(cortado.matchers).hasSize(1);
Utils.assertThat(cortado.matchers.get(0)).isEqualTo(ViewMatchers.withSpinnerText("test"));
} | @Test
public void withSpinnerText_withString_addsCorrectMatcher() {
notCompletable.withSpinnerText("test");
<DeepExtract>
assertThat(cortado.matchers).hasSize(1);
Utils.assertThat(cortado.matchers.get(0)).isEqualTo(ViewMatchers.withSpinnerText("test"));
</DeepExtract>
} | cortado | positive | 437,276 |
public void parseSuspiciousMethod(File javaFile, int buggyLine) {
this.javaFile = javaFile;
char[] javaCode = readFileToCharArray(javaFile);
ASTParser parser = createASTParser(javaCode);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
return unit;
ITree roo... | public void parseSuspiciousMethod(File javaFile, int buggyLine) {
this.javaFile = javaFile;
char[] javaCode = readFileToCharArray(javaFile);
ASTParser parser = createASTParser(javaCode);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
CompilationUnit unit = (CompilationUnit) parser.createAST(null);
return unit;
ITree roo... | AVATAR | positive | 437,277 |
public void acceptClassType(final SignatureVisitor v) throws SignatureException {
String signature = this.signature;
int len = signature.length();
int pos;
char c;
if (signature.charAt(0) == '<') {
pos = 2;
do {
int end = signature.indexOf(':', pos);
v.visitFormalTypeParameter(signature.substring(pos - 1, end));
pos = ... | public void acceptClassType(final SignatureVisitor v) throws SignatureException {
<DeepExtract>
String signature = this.signature;
int len = signature.length();
int pos;
char c;
if (signature.charAt(0) == '<') {
pos = 2;
do {
int end = signature.indexOf(':', pos);
v.visitFormalTypeParameter(signature.substring(pos - 1,... | Retroguard | positive | 437,279 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.