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 List<DistributedNode> getOnlineProcessors() {
List<DistributedNode> distributedNodes = new ArrayList<>();
String nodePath = null;
switch(DistributedNode.NodeType.PROCESSOR) {
case CRAWLER:
nodePath = ZookeeperPathConsts.CRAWLER;
break;
case PROCESSOR:
nodePath = ZookeeperPathConsts.PROCESSOR;
break;
default:
}
t... | public List<DistributedNode> getOnlineProcessors() {
<DeepExtract>
List<DistributedNode> distributedNodes = new ArrayList<>();
String nodePath = null;
switch(DistributedNode.NodeType.PROCESSOR) {
case CRAWLER:
nodePath = ZookeeperPathConsts.CRAWLER;
break;
case PROCESSOR:
nodePath = ZookeeperPathConsts.PROCESSOR;
break... | webhunger | positive | 4,305 |
public void generateCube(IBlock block) {
BoundingBox box = block.getBoundingBox(new BlockNode(0, 0, 0));
double x = box.min.x - 0.5;
double y = box.min.y - 0.5;
double z = box.min.z - 0.5;
double xsize = box.max.x;
double ysize = box.max.y;
double zsize = box.max.z;
this.pos.add(new Vector3d(x, y + ysize, z + zsize));
... | public void generateCube(IBlock block) {
BoundingBox box = block.getBoundingBox(new BlockNode(0, 0, 0));
double x = box.min.x - 0.5;
double y = box.min.y - 0.5;
double z = box.min.z - 0.5;
double xsize = box.max.x;
double ysize = box.max.y;
double zsize = box.max.z;
this.pos.add(new Vector3d(x, y + ysize, z + zsize));
... | Voxel | positive | 4,308 |
@Override
public void onAnimationEnd(Animator animation) {
mCallbacks.onDismiss(mView, mToken);
} | @Override
public void onAnimationEnd(Animator animation) {
<DeepExtract>
mCallbacks.onDismiss(mView, mToken);
</DeepExtract>
} | natrium-android-wallet | positive | 4,309 |
public boolean isSymmetric(TreeNode root) {
if (null == root)
return true;
if (null == root.left && null == root.right)
return true;
if (null != root.left && null != root.right && root.left.val == root.right.val) {
return isMirror(root.left.left, root.right.right) && isMirror(root.left.right, root.right.left);
}
return... | public boolean isSymmetric(TreeNode root) {
if (null == root)
return true;
<DeepExtract>
if (null == root.left && null == root.right)
return true;
if (null != root.left && null != root.right && root.left.val == root.right.val) {
return isMirror(root.left.left, root.right.right) && isMirror(root.left.right, root.right.l... | leetcode-java | positive | 4,310 |
@Override
public void start() {
Log.i(TAG, "prepare:: Preparing listener for sensor " + getSensorName());
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_WB... | @Override
public void start() {
<DeepExtract>
Log.i(TAG, "prepare:: Preparing listener for sensor " + getSensorName());
mRecorder = new MediaRecorder();
mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.Audio... | DataLogger | positive | 4,311 |
public static List<Integer> inorderTraversal(TreeNode root) {
List<Integer> res = new ArrayList<>();
if (root == null)
return res;
if (root == null)
return;
helper(res, root.left);
res.add(root.val);
helper(res, root.right);
return res;
} | public static List<Integer> inorderTraversal(TreeNode root) {
List<Integer> res = new ArrayList<>();
if (root == null)
return res;
<DeepExtract>
if (root == null)
return;
helper(res, root.left);
res.add(root.val);
helper(res, root.right);
</DeepExtract>
return res;
} | cspiration | positive | 4,312 |
private void sendOPEN(byte[] path, int mode) throws Exception {
packet.reset();
putHEAD(buf, SSH_FXP_OPEN, 17 + path.length);
buf.putInt(seq++);
buf.putString(path);
buf.putInt(mode);
buf.putInt(0);
getSession().write(packet, this, 17 + path.length + 4);
} | private void sendOPEN(byte[] path, int mode) throws Exception {
packet.reset();
<DeepExtract>
putHEAD(buf, SSH_FXP_OPEN, 17 + path.length);
</DeepExtract>
buf.putInt(seq++);
buf.putString(path);
buf.putInt(mode);
buf.putInt(0);
getSession().write(packet, this, 17 + path.length + 4);
} | jsch-documentation | positive | 4,314 |
public void debuggingTerminated() {
for (final IJavaLineBreakpoint breakpoint : breakpoints) {
try {
breakpoint.delete();
} catch (final CoreException e) {
Activator.log(e);
}
}
} | public void debuggingTerminated() {
<DeepExtract>
</DeepExtract>
for (final IJavaLineBreakpoint breakpoint : breakpoints) {
<DeepExtract>
</DeepExtract>
try {
<DeepExtract>
</DeepExtract>
breakpoint.delete();
<DeepExtract>
</DeepExtract>
} catch (final CoreException e) {
<DeepExtract>
</DeepExtract>
Activator.log(e);
<... | reactive-inspector | positive | 4,315 |
@Override
public void onClick(View v) {
SetTalkerItemDialog dialog = (SetTalkerItemDialog) ((AppCompatActivity) mContext).getSupportFragmentManager().findFragmentByTag("SetTalkerItemDialog");
if (dialog == null) {
dialog = SetTalkerItemDialog.getNewInstance(username, position);
dialog.setAdapter(adapter);
}
if (dialog.... | @Override
public void onClick(View v) {
<DeepExtract>
SetTalkerItemDialog dialog = (SetTalkerItemDialog) ((AppCompatActivity) mContext).getSupportFragmentManager().findFragmentByTag("SetTalkerItemDialog");
if (dialog == null) {
dialog = SetTalkerItemDialog.getNewInstance(username, position);
dialog.setAdapter(adapter);... | videocall-android | positive | 4,318 |
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
List<String> tokens = getTokens();
String sanitizedText = joinStrings(tokens, ",");
SpannableStringBuilder ssb = new SpannableStringBuilder(sanitizedText);
Matcher matcher = mTokenPattern.matcher(sanitizedText);
while (matcher.... | @Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
<DeepExtract>
List<String> tokens = getTokens();
String sanitizedText = joinStrings(tokens, ",");
SpannableStringBuilder ssb = new SpannableStringBuilder(sanitizedText);
Matcher matcher = mTokenPattern.matcher(sanitizedText);
w... | quill | positive | 4,320 |
public Criteria andProductIdGreaterThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "productId" + " cannot be null");
}
criteria.add(new Criterion("product_id >", value));
return (Criteria) this;
} | public Criteria andProductIdGreaterThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "productId" + " cannot be null");
}
criteria.add(new Criterion("product_id >", value));
</DeepExtract>
return (Criteria) this;
} | springboot-weixin-alipay | positive | 4,321 |
public static void addData(i.gishreloaded.gishcode.xray.XRayData data) {
if (Block.getBlockById(data.getId()) == null) {
ChatUtils.error("Block is null.");
return;
}
LinkedList<XRayData> list = getDataById(data.getId());
if (list.isEmpty()) {
addData(data);
return;
}
boolean isId = false;
boolean isMeta = false;
for (X... | public static void addData(i.gishreloaded.gishcode.xray.XRayData data) {
<DeepExtract>
if (Block.getBlockById(data.getId()) == null) {
ChatUtils.error("Block is null.");
return;
}
LinkedList<XRayData> list = getDataById(data.getId());
if (list.isEmpty()) {
addData(data);
return;
}
boolean isId = false;
boolean isMeta =... | Gish-Code-1.12.2 | positive | 4,322 |
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
super.writeToNBT(nbttagcompound);
nbttagcompound.setInteger("currentTime", currentTime);
nbttagcompound.setBoolean("canPlay", canPlay);
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
... | @Override
public Packet getDescriptionPacket() {
NBTTagCompound nbttagcompound = new NBTTagCompound();
<DeepExtract>
super.writeToNBT(nbttagcompound);
nbttagcompound.setInteger("currentTime", currentTime);
nbttagcompound.setBoolean("canPlay", canPlay);
</DeepExtract>
return new S35PacketUpdateTileEntity(xCoord, yCoord,... | Totemic | positive | 4,323 |
@Override
public ChessBitSet alliedPieces() {
final ChessBitSet allBlackPieces = new ChessBitSet();
allBlackPieces.or(blackRooks);
allBlackPieces.or(blackKnights);
allBlackPieces.or(blackBishops);
allBlackPieces.or(blackQueens);
allBlackPieces.or(blackPawns);
return allBlackPieces;
} | @Override
public ChessBitSet alliedPieces() {
<DeepExtract>
final ChessBitSet allBlackPieces = new ChessBitSet();
allBlackPieces.or(blackRooks);
allBlackPieces.or(blackKnights);
allBlackPieces.or(blackBishops);
allBlackPieces.or(blackQueens);
allBlackPieces.or(blackPawns);
return allBlackPieces;
</DeepExtract>
} | BlackWidow-Chess | positive | 4,324 |
private void timerInterrupt() {
int delay = Stats.TimerTicks;
delay += Lib.random(delay / 10) - (delay / 20);
privilege.interrupt.schedule(delay, "timer", timerInterrupt);
privilege.interrupt.schedule(1, "timerAG", autoGraderInterrupt);
return privilege.stats.totalTicks;
if (handler != null)
handler.run();
} | private void timerInterrupt() {
int delay = Stats.TimerTicks;
delay += Lib.random(delay / 10) - (delay / 20);
privilege.interrupt.schedule(delay, "timer", timerInterrupt);
privilege.interrupt.schedule(1, "timerAG", autoGraderInterrupt);
<DeepExtract>
return privilege.stats.totalTicks;
</DeepExtract>
if (handler != null... | CS162 | positive | 4,325 |
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
NBTTagCompound nbt = pkt.func_148857_g();
super.readFromNBT(nbt);
facing = nbt.getInteger("facing");
isOn = nbt.getBoolean("isOn");
} | @Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
NBTTagCompound nbt = pkt.func_148857_g();
<DeepExtract>
super.readFromNBT(nbt);
facing = nbt.getInteger("facing");
isOn = nbt.getBoolean("isOn");
</DeepExtract>
} | Electro-Magic-Tools | positive | 4,326 |
public void sendMesg(int i, String s) {
Log.userinfo("AliceICQ: " + "Response to [" + i + "]: " + s, Log.LISTENERS);
try {
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
bytearrayoutputstream.write(14);
bytearrayoutputstream.write(1);
bytearrayoutputstream.write(toBytes(i));
bytearrayoutputs... | public void sendMesg(int i, String s) {
<DeepExtract>
Log.userinfo("AliceICQ: " + "Response to [" + i + "]: " + s, Log.LISTENERS);
</DeepExtract>
try {
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
bytearrayoutputstream.write(14);
bytearrayoutputstream.write(1);
bytearrayoutputstream.write(... | charliebot | positive | 4,327 |
@Override
@SuppressWarnings("unchecked")
public T top() {
if (size == 0) {
throw new EmptyStackException();
}
return (T) elements[size - 1];
} | @Override
@SuppressWarnings("unchecked")
public T top() {
<DeepExtract>
if (size == 0) {
throw new EmptyStackException();
}
return (T) elements[size - 1];
</DeepExtract>
} | spork | positive | 4,328 |
public static void line(double x0, double y0, double x1, double y1) {
offscreen.draw(new Line2D.Double(scaleX(x0), scaleY(y0), scaleX(x1), scaleY(y1)));
if (defer)
return;
onscreen.drawImage(offscreenImage, 0, 0, null);
frame.repaint();
} | public static void line(double x0, double y0, double x1, double y1) {
offscreen.draw(new Line2D.Double(scaleX(x0), scaleY(y0), scaleX(x1), scaleY(y1)));
<DeepExtract>
if (defer)
return;
onscreen.drawImage(offscreenImage, 0, 0, null);
frame.repaint();
</DeepExtract>
} | skeleton-sp16 | positive | 4,330 |
public String getJCR_SCORE() {
if (cache) {
Map<Integer, String> map;
if (JCR_NS.hashCode() == JCR_NS.hashCode())
map = jcrCacheMap;
else
map = ntCacheMap;
String result = map.get(JCR_SCORE.hashCode());
if (result == null)
result = computeName(JCR_NS, JCR_SCORE);
map.put(JCR_SCORE.hashCode(), result);
return result;
}
... | public String getJCR_SCORE() {
<DeepExtract>
if (cache) {
Map<Integer, String> map;
if (JCR_NS.hashCode() == JCR_NS.hashCode())
map = jcrCacheMap;
else
map = ntCacheMap;
String result = map.get(JCR_SCORE.hashCode());
if (result == null)
result = computeName(JCR_NS, JCR_SCORE);
map.put(JCR_SCORE.hashCode(), result);
ret... | jcr-springextension | positive | 4,331 |
public void recruitWalkOns() {
walkon = true;
int needs = minQBs - teamQBs.size();
for (int i = 0; i < teamQBs.size(); ++i) {
if (teamQBs.get(i).isRedshirt || teamQBs.get(i).isTransfer) {
needs++;
}
}
for (int i = 0; i < needs; ++i) {
star = (int) Math.random() * 2 + 1;
teamQBs.add(new PlayerQB(league.getRandName(), 1,... | public void recruitWalkOns() {
walkon = true;
int needs = minQBs - teamQBs.size();
for (int i = 0; i < teamQBs.size(); ++i) {
if (teamQBs.get(i).isRedshirt || teamQBs.get(i).isTransfer) {
needs++;
}
}
for (int i = 0; i < needs; ++i) {
star = (int) Math.random() * 2 + 1;
teamQBs.add(new PlayerQB(league.getRandName(), 1,... | CFB-Coach-v1 | positive | 4,332 |
@Override
public void set(T value) {
set(value);
} | @Override
public void set(T value) {
<DeepExtract>
set(value);
</DeepExtract>
} | durian | positive | 4,333 |
public void attachToListView(@NonNull AbsListView listView, ScrollDirectionListener scrollDirectionListener, AbsListView.OnScrollListener onScrollListener) {
AbsListViewScrollDetectorImpl scrollDetector = new AbsListViewScrollDetectorImpl();
mScrollDirectionListener = scrollDirectionListener;
mOnScrollListener = onScro... | public void attachToListView(@NonNull AbsListView listView, ScrollDirectionListener scrollDirectionListener, AbsListView.OnScrollListener onScrollListener) {
AbsListViewScrollDetectorImpl scrollDetector = new AbsListViewScrollDetectorImpl();
mScrollDirectionListener = scrollDirectionListener;
mOnScrollListener = onScro... | TaoSchool | positive | 4,334 |
@Override
public void run() {
collidable = !collidable;
visible = collidable;
} | @Override
public void run() {
<DeepExtract>
collidable = !collidable;
visible = collidable;
</DeepExtract>
} | AndroidPunk | positive | 4,336 |
@Override
public void onAnimationCancel(Animator animation) {
String currentPassphraseType = AdminActions.getCurrentPassphraseType();
if (!Utility.checkForNullAndWarn(currentPassphraseType, LOG_TAG)) {
if (currentPassphraseType.equals(Passphrase.TYPE_PATTERN) && AdminActions.getCurrentPassphraseString() != null) {
getC... | @Override
public void onAnimationCancel(Animator animation) {
<DeepExtract>
String currentPassphraseType = AdminActions.getCurrentPassphraseType();
if (!Utility.checkForNullAndWarn(currentPassphraseType, LOG_TAG)) {
if (currentPassphraseType.equals(Passphrase.TYPE_PATTERN) && AdminActions.getCurrentPassphraseString() !... | SmartLockScreen | positive | 4,337 |
@Test
public void noDuplicate() throws Exception {
JobParameters jobParameters = new JobParametersBuilder().addLong("date", System.currentTimeMillis()).toJobParameters();
emptyQueue();
fillInQueue();
Assert.assertEquals(13, orderQueueView.getQueueSize());
JobExecution exec = jobLauncher.run(updateInventoryJob, jobParam... | @Test
public void noDuplicate() throws Exception {
JobParameters jobParameters = new JobParametersBuilder().addLong("date", System.currentTimeMillis()).toJobParameters();
emptyQueue();
fillInQueue();
Assert.assertEquals(13, orderQueueView.getQueueSize());
JobExecution exec = jobLauncher.run(updateInventoryJob, jobParam... | Spring-Batch-in-Action | positive | 4,338 |
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
} | @Override
public void onClick(View v) {
<DeepExtract>
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE);
</DeepExtract>
} | ssuet-android-adv-mar17 | positive | 4,339 |
public void removeSubtype(IMELanguageWrapper item) {
if (item.getType() == IMELanguageWrapper.TYPE_MULTI) {
VertexInputMethodManager.getInstance().removeSubtype(item.getMultiIMELanguage().getSubtypeIMEList());
} else {
VertexInputMethodManager.getInstance().removeSubtype(item.getIMELanguage());
}
singleAddedList = Vert... | public void removeSubtype(IMELanguageWrapper item) {
if (item.getType() == IMELanguageWrapper.TYPE_MULTI) {
VertexInputMethodManager.getInstance().removeSubtype(item.getMultiIMELanguage().getSubtypeIMEList());
} else {
VertexInputMethodManager.getInstance().removeSubtype(item.getIMELanguage());
}
<DeepExtract>
singleAd... | Android-Keyboard | positive | 4,341 |
@TargetApi(18)
private static void endSectionV18() {
if (ExoPlayerLibraryInfo.TRACE_ENABLED && Util.SDK_INT >= 18) {
endSectionV18();
}
} | @TargetApi(18)
private static void endSectionV18() {
<DeepExtract>
if (ExoPlayerLibraryInfo.TRACE_ENABLED && Util.SDK_INT >= 18) {
endSectionV18();
}
</DeepExtract>
} | ExoPlayerLeanback | positive | 4,342 |
@Override
public void hSet(@NonNull CacheHashKey key, Object value, boolean... cacheNullValues) {
if (value == null) {
return;
}
Caffeine<Object, Object> builder = Caffeine.newBuilder().maximumSize(DEF_MAX_SIZE);
if (key.tran().getExpire() != null) {
builder.expireAfterWrite(key.tran().getExpire());
}
Cache<String, Obj... | @Override
public void hSet(@NonNull CacheHashKey key, Object value, boolean... cacheNullValues) {
<DeepExtract>
if (value == null) {
return;
}
Caffeine<Object, Object> builder = Caffeine.newBuilder().maximumSize(DEF_MAX_SIZE);
if (key.tran().getExpire() != null) {
builder.expireAfterWrite(key.tran().getExpire());
}
Cac... | lamp-util | positive | 4,344 |
public <T> List<T> getBeanListByRaw(String sql, Class theClass) throws InstantiationException, IllegalAccessException {
Cursor cursor = getReadableDatabase().rawQuery(sql, null);
if (cursor == null)
return null;
return cursor2List(cursor, theClass, null);
} | public <T> List<T> getBeanListByRaw(String sql, Class theClass) throws InstantiationException, IllegalAccessException {
Cursor cursor = getReadableDatabase().rawQuery(sql, null);
if (cursor == null)
return null;
<DeepExtract>
return cursor2List(cursor, theClass, null);
</DeepExtract>
} | DereHelper | positive | 4,346 |
@Override
public Set<String> getSpikes(Reuters21578 story) {
Set<String> spikes = new HashSet<String>();
cal.setTime(story.getDate());
spikes.add("month=" + cal.get(Calendar.MONTH));
spikes.add("day_of_week=" + cal.get(Calendar.DAY_OF_WEEK));
spikes.add("year=" + cal.get(Calendar.YEAR));
spikes.add("day_of_month=" + ca... | @Override
public Set<String> getSpikes(Reuters21578 story) {
Set<String> spikes = new HashSet<String>();
cal.setTime(story.getDate());
spikes.add("month=" + cal.get(Calendar.MONTH));
spikes.add("day_of_week=" + cal.get(Calendar.DAY_OF_WEEK));
spikes.add("year=" + cal.get(Calendar.YEAR));
spikes.add("day_of_month=" + ca... | AHaH | positive | 4,347 |
public void newActivity(Vertex vertex) throws IOException {
String s = keyword("activity") + "(" + vertex.getID() + "," + attOrMarker(vertex.getAttribute("startTime")) + "," + attOrMarker(vertex.getAttribute("endTime")) + optionalAttributes(vertex.getAttributes()) + ")";
buffer.write(s);
if (!standaloneExpression) {
bu... | public void newActivity(Vertex vertex) throws IOException {
String s = keyword("activity") + "(" + vertex.getID() + "," + attOrMarker(vertex.getAttribute("startTime")) + "," + attOrMarker(vertex.getAttribute("endTime")) + optionalAttributes(vertex.getAttributes()) + ")";
<DeepExtract>
buffer.write(s);
if (!standaloneEx... | prov-viewer | positive | 4,348 |
@Test
public void testReferenceTypeFieldsClassPackBufferUnpack() throws Exception {
super.testReferenceTypeFieldsClass();
} | @Test
public void testReferenceTypeFieldsClassPackBufferUnpack() throws Exception {
<DeepExtract>
super.testReferenceTypeFieldsClass();
</DeepExtract>
} | msgpack-java | positive | 4,350 |
public AccountDto getAccountByPhoneNumber(String phoneNumber) {
Account account = accountRepo.findAccountByPhoneNumber(phoneNumber);
if (account == null) {
throw new ServiceException(ResultCode.NOT_FOUND, "User with specified phonenumber not found");
}
return modelMapper.map(account, AccountDto.class);
} | public AccountDto getAccountByPhoneNumber(String phoneNumber) {
Account account = accountRepo.findAccountByPhoneNumber(phoneNumber);
if (account == null) {
throw new ServiceException(ResultCode.NOT_FOUND, "User with specified phonenumber not found");
}
<DeepExtract>
return modelMapper.map(account, AccountDto.class);
</... | staffjoy | positive | 4,351 |
public final void inverse_attr(AST _t, String forClass) throws RecognitionException {
AST inverse_attr_AST_in;
if (_t == ASTNULL) {
inverse_attr_AST_in = null;
} else {
inverse_attr_AST_in = _t;
}
returnAST = null;
ASTPair currentAST = new ASTPair();
AST inverse_attr_AST = null;
String attrib, entity, attrib_ref = "";
... | public final void inverse_attr(AST _t, String forClass) throws RecognitionException {
<DeepExtract>
AST inverse_attr_AST_in;
if (_t == ASTNULL) {
inverse_attr_AST_in = null;
} else {
inverse_attr_AST_in = _t;
}
</DeepExtract>
returnAST = null;
ASTPair currentAST = new ASTPair();
AST inverse_attr_AST = null;
String attr... | BuildingSMARTLibrary | positive | 4,352 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
(Graphics2D) g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
(Graphics2D) g.setColor(new Color(180, 180, 180));
(Graphics2D) g.setFont(new Font("Arial", Font.ITALIC | Font.BOLD, 9));
(Graphics2D... | @Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
<DeepExtract>
(Graphics2D) g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
(Graphics2D) g.setColor(new Color(180, 180, 180));
(Graphics2D) g.setFont(new Font("Arial", Font.ITALIC | Font.BOLD, 9)... | ToastAPI | positive | 4,354 |
@CallSuper
@Override
public void onBindViewHolder(final PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
View view = holder.findViewById(R.id.compound_button);
if (view instanceof CompoundButton) {
CompoundButton compoundButton = (CompoundButton) view;
compoundButton.setOnCheckedChangeListener(null);
comp... | @CallSuper
@Override
public void onBindViewHolder(final PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
<DeepExtract>
View view = holder.findViewById(R.id.compound_button);
if (view instanceof CompoundButton) {
CompoundButton compoundButton = (CompoundButton) view;
compoundButton.setOnCheckedChangeListen... | AndroidMaterialPreferences | positive | 4,355 |
private void validateNetwork(MultiLayerPerceptron network) {
int numberOfWinners = 0;
int numberOfGames = 0;
NetworkMetrics metrics = networkMetricsCache.get(network);
log.info("********* BEGINNING VALIDATION FOR YEARS " + Arrays.toString(metrics.getSimulationYears()) + " **************");
for (Integer yearToSimulate :... | private void validateNetwork(MultiLayerPerceptron network) {
int numberOfWinners = 0;
int numberOfGames = 0;
NetworkMetrics metrics = networkMetricsCache.get(network);
log.info("********* BEGINNING VALIDATION FOR YEARS " + Arrays.toString(metrics.getSimulationYears()) + " **************");
for (Integer yearToSimulate :... | developerWorks | positive | 4,356 |
@CheckForNull
public static String getToneCompensationAsString(final int toneComp) {
String string = (String) toneCompMap.get(toneComp);
return (string != null) ? string : ("#" + toneComp + " - 0x" + Integer.toHexString(toneComp));
} | @CheckForNull
public static String getToneCompensationAsString(final int toneComp) {
<DeepExtract>
String string = (String) toneCompMap.get(toneComp);
return (string != null) ? string : ("#" + toneComp + " - 0x" + Integer.toHexString(toneComp));
</DeepExtract>
} | jrawio-src | positive | 4,357 |
public static String getAuthUsername() {
if (cacheMap.containsKey(CONFIG_AUTH_USERNAME)) {
return (String) cacheMap.get(CONFIG_AUTH_USERNAME);
}
String val = getConfig(CONFIG_AUTH_USERNAME);
if (StringUtils.isBlank(val)) {
return null;
}
cacheMap.put(CONFIG_AUTH_USERNAME, val);
return val;
} | public static String getAuthUsername() {
<DeepExtract>
if (cacheMap.containsKey(CONFIG_AUTH_USERNAME)) {
return (String) cacheMap.get(CONFIG_AUTH_USERNAME);
}
String val = getConfig(CONFIG_AUTH_USERNAME);
if (StringUtils.isBlank(val)) {
return null;
}
cacheMap.put(CONFIG_AUTH_USERNAME, val);
return val;
</DeepExtract>
... | apollo-sentinel-dashboard | positive | 4,358 |
@Override
public void run() {
if (--refCount == 0) {
releaseCallback.run();
}
} | @Override
public void run() {
<DeepExtract>
if (--refCount == 0) {
releaseCallback.run();
}
</DeepExtract>
} | VideoCRE | positive | 4,359 |
public Criteria andTempurlidLessThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "tempurlid" + " cannot be null");
}
criteria.add(new Criterion("tempUrlID <=", value));
return (Criteria) this;
} | public Criteria andTempurlidLessThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "tempurlid" + " cannot be null");
}
criteria.add(new Criterion("tempUrlID <=", value));
</DeepExtract>
return (Criteria) this;
} | answerWeb | positive | 4,360 |
private void init() {
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setOrientation(VERTICAL);
mStatus = new RelativeLayout(getContext());
setStatusBarBackgroundColor(statusBarBackgroundColor);
setNavigationBarBackgroundColor(statusBarBackgroundColor);
mStatus.setLayoutParams(n... | private void init() {
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
setOrientation(VERTICAL);
mStatus = new RelativeLayout(getContext());
setStatusBarBackgroundColor(statusBarBackgroundColor);
setNavigationBarBackgroundColor(statusBarBackgroundColor);
mStatus.setLayoutParams(n... | Auie | positive | 4,361 |
public ImageIcon RefreshIcon() {
try {
URL iconPath = getClass().getClassLoader().getResource(Refresh);
return new ImageIcon(new ImageIcon(iconPath).getImage());
} catch (Exception ex) {
LogWriter.WriteToLog(ex.fillInStackTrace());
return new ImageIcon(createTransparentImage(1, 1));
}
} | public ImageIcon RefreshIcon() {
<DeepExtract>
try {
URL iconPath = getClass().getClassLoader().getResource(Refresh);
return new ImageIcon(new ImageIcon(iconPath).getImage());
} catch (Exception ex) {
LogWriter.WriteToLog(ex.fillInStackTrace());
return new ImageIcon(createTransparentImage(1, 1));
}
</DeepExtract>
} | MQAdminTool | positive | 4,362 |
public void reset() {
fields.forEach(PropertyField::resetToDefault);
if (model.get() != null) {
for (final PropertyField<?, M, ?> field : fields) {
if (field.isDifferent(model.get())) {
diffFlag.set(true);
return;
}
}
diffFlag.set(false);
}
} | public void reset() {
fields.forEach(PropertyField::resetToDefault);
<DeepExtract>
if (model.get() != null) {
for (final PropertyField<?, M, ?> field : fields) {
if (field.isDifferent(model.get())) {
diffFlag.set(true);
return;
}
}
diffFlag.set(false);
}
</DeepExtract>
} | javafx-qiniu-tinypng-client | positive | 4,363 |
private String getOutput() {
csvPrinter.flush();
final String output = writer.getBuffer().toString();
writer.getBuffer().setLength(0);
return output;
} | private String getOutput() {
<DeepExtract>
csvPrinter.flush();
</DeepExtract>
final String output = writer.getBuffer().toString();
writer.getBuffer().setLength(0);
return output;
} | freemarker-generator | positive | 4,365 |
public byte[] getBytes() {
ByteBuffer data = this.data.duplicate();
byte[] result = new byte[data.capacity()];
data.position(0);
checkBounds(result, tableOfContents.stringIds.size);
int stringOff = openSection(tableOfContents.stringIds.off + (result * SizeOf.STRING_ID_ITEM)).readInt();
return openSection(stringOff).rea... | public byte[] getBytes() {
ByteBuffer data = this.data.duplicate();
byte[] result = new byte[data.capacity()];
data.position(0);
<DeepExtract>
checkBounds(result, tableOfContents.stringIds.size);
int stringOff = openSection(tableOfContents.stringIds.off + (result * SizeOf.STRING_ID_ITEM)).readInt();
return openSection(... | tinker-dex-dump | positive | 4,366 |
public Schema getAvroSchema() {
if (_valueSchema != null) {
return _valueSchema;
}
if (_builder == null) {
throw new IllegalStateException("No visit methods called on " + getClass().getName() + ": no schema generated");
}
return Schema.create(Schema.Type.BYTES);
} | public Schema getAvroSchema() {
if (_valueSchema != null) {
return _valueSchema;
}
if (_builder == null) {
throw new IllegalStateException("No visit methods called on " + getClass().getName() + ": no schema generated");
}
<DeepExtract>
return Schema.create(Schema.Type.BYTES);
</DeepExtract>
} | jackson-dataformat-avro | positive | 4,367 |
public Criteria andDeliverOrderIdNotEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "deliverOrderId" + " cannot be null");
}
criteria.add(new Criterion("deliver_order_id <>", value));
return (Criteria) this;
} | public Criteria andDeliverOrderIdNotEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "deliverOrderId" + " cannot be null");
}
criteria.add(new Criterion("deliver_order_id <>", value));
</DeepExtract>
return (Criteria) this;
} | XiaoMiShop | positive | 4,368 |
@Nonnull
public static Value readSettings(Context context, SharedPreferences prefs, String sharedPrefsName) {
final SerialLineConfiguration conf;
final String baudrate, dataBits, parity, stopBits;
conf = new SerialLineConfiguration();
baudrate = prefs.getString(KEY_DEVICE_BAUDRATE, null);
dataBits = prefs.getString(KEY... | @Nonnull
public static Value readSettings(Context context, SharedPreferences prefs, String sharedPrefsName) {
final SerialLineConfiguration conf;
final String baudrate, dataBits, parity, stopBits;
conf = new SerialLineConfiguration();
baudrate = prefs.getString(KEY_DEVICE_BAUDRATE, null);
dataBits = prefs.getString(KEY... | RtkGps | positive | 4,369 |
private void addRadarScanFragment() {
android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction ft = fragmentManager.beginTransaction();
boolean fragmentPopped = false;
Fragment fragment = fragmentManager.findFragmentByTag(Constants.TAG_FRAGMENT_SCAN_RADAR);
if (fragmentM... | private void addRadarScanFragment() {
<DeepExtract>
android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction ft = fragmentManager.beginTransaction();
boolean fragmentPopped = false;
Fragment fragment = fragmentManager.findFragmentByTag(Constants.TAG_FRAGMENT_SCAN_RADAR);... | beaconloc | positive | 4,370 |
@Override
@SuppressWarnings("unchecked")
public Decision given(FactMap facts) {
_rule.given(facts);
for (Field field : getAnnotatedFields(Given.class, _rulePojo.getClass())) {
Given given = field.getAnnotation(Given.class);
try {
field.setAccessible(true);
if (field.getType() == Fact.class) {
field.set(_rulePojo, getFa... | @Override
@SuppressWarnings("unchecked")
public Decision given(FactMap facts) {
_rule.given(facts);
<DeepExtract>
for (Field field : getAnnotatedFields(Given.class, _rulePojo.getClass())) {
Given given = field.getAnnotation(Given.class);
try {
field.setAccessible(true);
if (field.getType() == Fact.class) {
field.set(_r... | rulebook | positive | 4,372 |
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload_main);
vodCertificateMultiUpload = (Button) findViewById(R.id.vod_certificate_multi_upload);
vodCertificateMultiUpload.setOnClickListener(this);
if (!checkPermissionsGroup(this, PE... | @Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.upload_main);
vodCertificateMultiUpload = (Button) findViewById(R.id.vod_certificate_multi_upload);
vodCertificateMultiUpload.setOnClickListener(this);
<DeepExtract>
if (!checkPermissions... | alibabacloud-vodupload-sdk | positive | 4,373 |
public void setStatusErrorMessage(String message) {
Runnable task = () -> setStatusMessageInternal(message, new Color(Display.getCurrent(), new RGB(255, 0, 0)));
Display.getDefault().asyncExec(task);
} | public void setStatusErrorMessage(String message) {
<DeepExtract>
Runnable task = () -> setStatusMessageInternal(message, new Color(Display.getCurrent(), new RGB(255, 0, 0)));
Display.getDefault().asyncExec(task);
</DeepExtract>
} | abapCI | positive | 4,374 |
private void addNodeToArray(final ViterbiNode node, final int index, ViterbiNode[][] arr, int[] sizes) {
int count = sizes[index];
if (count == 0) {
arr[index] = new ViterbiNode[10];
}
if (arr[index].length <= count) {
arr[index] = extendArray(arr[index]);
}
arr[index][count] = node;
sizes[index] = count + 1;
} | private void addNodeToArray(final ViterbiNode node, final int index, ViterbiNode[][] arr, int[] sizes) {
int count = sizes[index];
<DeepExtract>
if (count == 0) {
arr[index] = new ViterbiNode[10];
}
if (arr[index].length <= count) {
arr[index] = extendArray(arr[index]);
}
</DeepExtract>
arr[index][count] = node;
sizes[... | kuromoji | positive | 4,376 |
@SuppressWarnings("unused")
void setRotation(float rotation) {
mRotation = rotation;
mRingCallback.invalidateDrawable(null);
} | @SuppressWarnings("unused")
void setRotation(float rotation) {
mRotation = rotation;
<DeepExtract>
mRingCallback.invalidateDrawable(null);
</DeepExtract>
} | Swface | positive | 4,377 |
public static void matrixGiven(Matrix matrix) {
if (matrix != null && mQueue.size() < mSize) {
mQueue.offer(matrix);
}
} | public static void matrixGiven(Matrix matrix) {
<DeepExtract>
if (matrix != null && mQueue.size() < mSize) {
mQueue.offer(matrix);
}
</DeepExtract>
} | SRich | positive | 4,378 |
@Override
public Boolean doInTransaction() throws Exception {
Set<String> playerGroupNames = new HashSet<>();
playerGroupNames.addAll(Utils.toGroupNames(Utils.filterExpired(storageStrategy.getPermissionService().getGroups(uuid))));
if (playerGroupNames.isEmpty())
playerGroupNames.add(resolver.getDefaultGroup());
Set<St... | @Override
public Boolean doInTransaction() throws Exception {
Set<String> playerGroupNames = new HashSet<>();
playerGroupNames.addAll(Utils.toGroupNames(Utils.filterExpired(storageStrategy.getPermissionService().getGroups(uuid))));
if (playerGroupNames.isEmpty())
playerGroupNames.add(resolver.getDefaultGroup());
<DeepE... | zPermissions | positive | 4,379 |
public boolean run() {
super.log("# " + "Symbol range map extraction starting");
String[] files = input.gatherAll(".java").stream().map(f -> f.replaceAll("\\\\", "/")).sorted().toArray(String[]::new);
super.log("# " + "Processing " + files.length + " files");
if (files.length == 0) {
cleanup();
return true;
}
if (canBa... | public boolean run() {
super.log("# " + "Symbol range map extraction starting");
String[] files = input.gatherAll(".java").stream().map(f -> f.replaceAll("\\\\", "/")).sorted().toArray(String[]::new);
<DeepExtract>
super.log("# " + "Processing " + files.length + " files");
</DeepExtract>
if (files.length == 0) {
cleanu... | Srg2Source | positive | 4,380 |
@Override
public void beforeEach(ExtensionContext context) throws Exception {
this.copy = new ByteArrayOutputStream();
this.captureOut = new CaptureOutputStream(System.out, this.copy);
this.captureErr = new CaptureOutputStream(System.err, this.copy);
System.setOut(new PrintStream(this.captureOut));
System.setErr(new Pr... | @Override
public void beforeEach(ExtensionContext context) throws Exception {
<DeepExtract>
this.copy = new ByteArrayOutputStream();
this.captureOut = new CaptureOutputStream(System.out, this.copy);
this.captureErr = new CaptureOutputStream(System.err, this.copy);
System.setOut(new PrintStream(this.captureOut));
System... | spring-5-examples | positive | 4,382 |
public static InnerClassesInfo create(DataInput din) throws IOException {
InnerClassesInfo ici = new InnerClassesInfo();
this.u2innerClassInfoIndex = din.readUnsignedShort();
this.u2outerClassInfoIndex = din.readUnsignedShort();
this.u2innerNameIndex = din.readUnsignedShort();
this.u2innerClassAccessFlags = din.readUns... | public static InnerClassesInfo create(DataInput din) throws IOException {
InnerClassesInfo ici = new InnerClassesInfo();
<DeepExtract>
this.u2innerClassInfoIndex = din.readUnsignedShort();
this.u2outerClassInfoIndex = din.readUnsignedShort();
this.u2innerNameIndex = din.readUnsignedShort();
this.u2innerClassAccessFlags... | Retroguard | positive | 4,383 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mListView = (ListView) findViewById(R.id.list);
mAdapter = new ArrayAdapter<String>(this, R.layout.list_item);
mListView.setAdapter(mAdapter);
getWindow().addFlags(WindowManager.Lay... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mListView = (ListView) findViewById(R.id.list);
mAdapter = new ArrayAdapter<String>(this, R.layout.list_item);
mListView.setAdapter(mAdapter);
getWindow().addFlags(WindowManager.Lay... | AndroidDemoProjects | positive | 4,384 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
JobOperator jo = BatchRuntime.getJobOperator();
long id = jo.start("simplejob", null);
ejb.se... | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
<DeepExtract>
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
JobOperator jo = BatchRuntime.getJobOperator();
long id = jo.start("simplejob",... | practical-javaee7-development-wildfly | positive | 4,385 |
public Criteria andSonglistplaycountNotEqualTo(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "songlistplaycount" + " cannot be null");
}
criteria.add(new Criterion("songListPlayCount <>", value));
return (Criteria) this;
} | public Criteria andSonglistplaycountNotEqualTo(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "songlistplaycount" + " cannot be null");
}
criteria.add(new Criterion("songListPlayCount <>", value));
</DeepExtract>
return (Criteria) this;
} | music | positive | 4,386 |
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
assertSize(position);
checkStates.set(position, isChecked);
} | @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
<DeepExtract>
assertSize(position);
checkStates.set(position, isChecked);
</DeepExtract>
} | leanchat-android | positive | 4,387 |
public void startTransitions(View view) {
if (view != null) {
Rect locRect = new Rect();
view.getGlobalVisibleRect(locRect);
setTransitionsRegion(locRect.left, locRect.top, locRect.right, locRect.bottom, view.getWidth(), view.getHeight());
}
return this;
startTransitions();
} | public void startTransitions(View view) {
<DeepExtract>
if (view != null) {
Rect locRect = new Rect();
view.getGlobalVisibleRect(locRect);
setTransitionsRegion(locRect.left, locRect.top, locRect.right, locRect.bottom, view.getWidth(), view.getHeight());
}
return this;
</DeepExtract>
startTransitions();
} | MeiWidgetView | positive | 4,388 |
@Override
public void renderForeground() {
angleClockwise++;
if (angleClockwise >= 360) {
angleClockwise -= 360;
}
angleAntiClockwise--;
if (angleAntiClockwise <= 0) {
angleAntiClockwise += 360;
}
double lastRadius = 0;
for (int i = 0; i < RINGS; i++) {
if (radii[i] > 0 || lastRadius > space) {
radii[i] += SPEED;
if (r... | @Override
public void renderForeground() {
angleClockwise++;
if (angleClockwise >= 360) {
angleClockwise -= 360;
}
angleAntiClockwise--;
if (angleAntiClockwise <= 0) {
angleAntiClockwise += 360;
}
<DeepExtract>
double lastRadius = 0;
for (int i = 0; i < RINGS; i++) {
if (radii[i] > 0 || lastRadius > space) {
radii[i] +... | DemoFX | positive | 4,389 |
public static void main(String[] args) {
CRSFactory csFactory = new CRSFactory();
CoordinateReferenceSystem cs = csFactory.createFromName(ProjectionGridTest.class);
if (cs == null)
return;
ProjectionGridRoundTripper tripper = new ProjectionGridRoundTripper(cs);
boolean isOK = tripper.runGrid(TOLERANCE);
double[] extent... | public static void main(String[] args) {
<DeepExtract>
CRSFactory csFactory = new CRSFactory();
CoordinateReferenceSystem cs = csFactory.createFromName(ProjectionGridTest.class);
if (cs == null)
return;
ProjectionGridRoundTripper tripper = new ProjectionGridRoundTripper(cs);
boolean isOK = tripper.runGrid(TOLERANCE);
d... | proj4j | positive | 4,390 |
@Override
public List<Job> loadFavoriteJobs(List<JenkinsSettings.FavoriteJob> favoriteJobs) {
if (handleNotYetLoggedInState())
return Collections.emptyList();
final List<Job> jobs = new LinkedList<>();
for (JenkinsSettings.FavoriteJob favoriteJob : favoriteJobs) {
jobs.add(loadJob(favoriteJob.getUrl()));
}
final List<J... | @Override
public List<Job> loadFavoriteJobs(List<JenkinsSettings.FavoriteJob> favoriteJobs) {
if (handleNotYetLoggedInState())
return Collections.emptyList();
final List<Job> jobs = new LinkedList<>();
for (JenkinsSettings.FavoriteJob favoriteJob : favoriteJobs) {
jobs.add(loadJob(favoriteJob.getUrl()));
}
<DeepExtract... | jenkins-control-plugin | positive | 4,391 |
@Override
public void onLoad(Bundle savedInstanceState) {
super.onLoad(savedInstanceState);
if (getView() == null)
return;
getView().toggleAnimation();
} | @Override
public void onLoad(Bundle savedInstanceState) {
super.onLoad(savedInstanceState);
if (getView() == null)
return;
<DeepExtract>
getView().toggleAnimation();
</DeepExtract>
} | u2020-mortar | positive | 4,392 |
private String _toString(boolean withOrigin) {
if (simpleText != null)
return simpleText;
if (parts == null)
return null;
StringBuilder sb = new StringBuilder();
if (withOrigin && origin != null) {
sb.append("{!--@ORIGIN:");
sb.append(origin);
sb.append("@--}");
}
for (SnippetPart part : parts) {
sb.append(part.toStrin... | private String _toString(boolean withOrigin) {
if (simpleText != null)
return simpleText;
if (parts == null)
return null;
StringBuilder sb = new StringBuilder();
if (withOrigin && origin != null) {
sb.append("{!--@ORIGIN:");
sb.append(origin);
sb.append("@--}");
}
for (SnippetPart part : parts) {
sb.append(part.toStrin... | chunk-templates | positive | 4,393 |
@Override
public void putBitmap(String key, Bitmap bitmap) {
if (Looper.myLooper() == Looper.getMainLooper()) {
throw new RuntimeException("Can not operate in the main thread !!!");
}
Optional.checkNotNull(bitmap, "obj is null !!!");
Optional.checkNotNull(new BitmapByteMapper(), "mapper is null !!!");
String k = absolu... | @Override
public void putBitmap(String key, Bitmap bitmap) {
<DeepExtract>
if (Looper.myLooper() == Looper.getMainLooper()) {
throw new RuntimeException("Can not operate in the main thread !!!");
}
Optional.checkNotNull(bitmap, "obj is null !!!");
Optional.checkNotNull(new BitmapByteMapper(), "mapper is null !!!");
Str... | TLRLoadRefresh | positive | 4,394 |
public Criteria andBz18NotLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "bz18" + " cannot be null");
}
criteria.add(new Criterion("`bz18` not like", value));
return (Criteria) this;
} | public Criteria andBz18NotLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "bz18" + " cannot be null");
}
criteria.add(new Criterion("`bz18` not like", value));
</DeepExtract>
return (Criteria) this;
} | blockhealth | positive | 4,395 |
@Override
public void writeString(String value) {
if (!_expectValue) {
throw new IllegalStateException("Expecting FIELD_NAME, not value");
}
_expectValue = false;
_data.put(_currentName, value);
} | @Override
public void writeString(String value) {
<DeepExtract>
if (!_expectValue) {
throw new IllegalStateException("Expecting FIELD_NAME, not value");
}
_expectValue = false;
</DeepExtract>
_data.put(_currentName, value);
} | jackson-dataformat-avro | positive | 4,396 |
public String SendAndWaitResponse(String strReqData, String strUrl) {
ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null && ni.isAvailable() && ni.getType() == ConnectivityManager.TYPE_MOBILE) {
String proxyH... | public String SendAndWaitResponse(String strReqData, String strUrl) {
<DeepExtract>
ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();
if (ni != null && ni.isAvailable() && ni.getType() == ConnectivityManager.TYPE_MOBILE) {... | world | positive | 4,397 |
public CPUOpDependency checkOutputDependency(CPUOpDependency dep) {
if (outputDeps == null)
outputDeps = spec.getOutputDependencies(args);
return outputDeps;
CPUOpDependency dep2 = new CPUOpDependency(dep);
for (CPUOpDependency outDep : outputDeps) {
dep2.remove(outDep);
}
if (dep2.isEmpty())
return null;
return dep2;
... | public CPUOpDependency checkOutputDependency(CPUOpDependency dep) {
<DeepExtract>
if (outputDeps == null)
outputDeps = spec.getOutputDependencies(args);
return outputDeps;
</DeepExtract>
CPUOpDependency dep2 = new CPUOpDependency(dep);
for (CPUOpDependency outDep : outputDeps) {
dep2.remove(outDep);
}
if (dep2.isEmpty(... | mdlz80optimizer | positive | 4,398 |
@Override
boolean sameValue(DNSRecord other) {
return (((Pointer) other)._alias instanceof DNSRecord) && super.equals(((Pointer) other)._alias) && sameValue((DNSRecord) ((Pointer) other)._alias);
} | @Override
boolean sameValue(DNSRecord other) {
<DeepExtract>
return (((Pointer) other)._alias instanceof DNSRecord) && super.equals(((Pointer) other)._alias) && sameValue((DNSRecord) ((Pointer) other)._alias);
</DeepExtract>
} | droidpad-android | positive | 4,400 |
@Override
public void execute(double timestamp) {
scrollDelay.cancel();
double scrollPosition = 0.0;
if (delegateScrollGridTarget != null) {
scrollPosition = delegateScrollGridTarget.getScrollTop();
}
delegatingVerticalScroll = true;
try {
getWidget().getScrollContainer().setScrollTop(Double.valueOf(scrollPosition).int... | @Override
public void execute(double timestamp) {
<DeepExtract>
scrollDelay.cancel();
double scrollPosition = 0.0;
if (delegateScrollGridTarget != null) {
scrollPosition = delegateScrollGridTarget.getScrollTop();
}
delegatingVerticalScroll = true;
try {
getWidget().getScrollContainer().setScrollTop(Double.valueOf(scrol... | gantt | positive | 4,401 |
public void setPref(String key, String value) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
setPref(key, value);
for (String s : keys) if (s.equals(key)) {
values.set(keys.indexOf(s), value);
return;
}
values.add(value);
keys.add(key);
editor.apply();
logPref("'" + key + "' saved with value '" + value ... | public void setPref(String key, String value) {
SharedPreferences.Editor editor = mSharedPreferences.edit();
setPref(key, value);
for (String s : keys) if (s.equals(key)) {
values.set(keys.indexOf(s), value);
return;
}
values.add(value);
keys.add(key);
editor.apply();
<DeepExtract>
logPref("'" + key + "' saved with val... | Cornowser | positive | 4,402 |
@Override
public void run() {
if (isJumpWhenMore)
cancelToast();
if (sToast == null) {
sToast = Toast.makeText(context.getApplicationContext(), resId, Toast.LENGTH_LONG);
} else {
sToast.setText(resId);
sToast.setDuration(Toast.LENGTH_LONG);
}
sToast.show();
} | @Override
public void run() {
<DeepExtract>
if (isJumpWhenMore)
cancelToast();
if (sToast == null) {
sToast = Toast.makeText(context.getApplicationContext(), resId, Toast.LENGTH_LONG);
} else {
sToast.setText(resId);
sToast.setDuration(Toast.LENGTH_LONG);
}
sToast.show();
</DeepExtract>
} | HeavenlyModule | positive | 4,405 |
public void iniSlice(SliceSources slice) {
debug.accept("Initializing " + slice.getName());
if (guiState.nSlices() == 1) {
iCurrentSlice = 0;
navigateCurrentSlice();
}
debug.accept(slice.getName() + " z position changed");
guiState.runSlice(slice, guiState -> {
guiState.slicePositionChanged();
updateSliceDisplayedPosit... | public void iniSlice(SliceSources slice) {
debug.accept("Initializing " + slice.getName());
if (guiState.nSlices() == 1) {
iCurrentSlice = 0;
navigateCurrentSlice();
}
debug.accept(slice.getName() + " z position changed");
guiState.runSlice(slice, guiState -> {
guiState.slicePositionChanged();
updateSliceDisplayedPosit... | ijp-imagetoatlas | positive | 4,406 |
@Override
public void run() {
if (mProgressListener != null && mMediaPlayer.isPlaying()) {
mProgressListener.onProgress(mMediaPlayer.getCurrentPosition());
}
mProgressHandler.postDelayed(runnable, 1000);
} | @Override
public void run() {
<DeepExtract>
if (mProgressListener != null && mMediaPlayer.isPlaying()) {
mProgressListener.onProgress(mMediaPlayer.getCurrentPosition());
}
mProgressHandler.postDelayed(runnable, 1000);
</DeepExtract>
} | io2014-codelabs | positive | 4,407 |
public Object onCall(final MuleEventContext eventContext) throws Exception {
logger.info(buildLogEntry(eventContext));
return null;
} | public Object onCall(final MuleEventContext eventContext) throws Exception {
<DeepExtract>
logger.info(buildLogEntry(eventContext));
</DeepExtract>
return null;
} | mule-in-action | positive | 4,408 |
@Override
@Nullable
public Boolean isDeleted(final K key) {
Entry<K, V> entry;
try {
final Block<K, V> valueBlock = rootBlock().getValueBlock(key);
if (valueBlock == null)
entry = null;
entry = valueBlock.get(key);
} catch (InternalError e) {
throw new RuntimeException("file " + indexFile.normalize() + " length is curr... | @Override
@Nullable
public Boolean isDeleted(final K key) {
<DeepExtract>
Entry<K, V> entry;
try {
final Block<K, V> valueBlock = rootBlock().getValueBlock(key);
if (valueBlock == null)
entry = null;
entry = valueBlock.get(key);
} catch (InternalError e) {
throw new RuntimeException("file " + indexFile.normalize() + " ... | lsmtree | positive | 4,409 |
public void read(TProtocol iprot) throws TException {
iprot.readStructBegin();
while (true) {
field = iprot.readFieldBegin();
if (field.type == TType.STOP) {
break;
}
switch(field.id) {
case SUCCESS:
if (field.type == TType.MAP) {
{
TMap _map0 = iprot.readMapBegin();
this.success = new HashMap<String, Long>(2 * _map0.s... | public void read(TProtocol iprot) throws TException {
<DeepExtract>
</DeepExtract>
iprot.readStructBegin();
<DeepExtract>
</DeepExtract>
while (true) {
<DeepExtract>
</DeepExtract>
field = iprot.readFieldBegin();
<DeepExtract>
</DeepExtract>
if (field.type == TType.STOP) {
<DeepExtract>
</DeepExtract>
break;
<DeepExtra... | Scribe-log4j-Appender | positive | 4,410 |
public byte i6() {
assert (6 <= 8);
return (byte) readInt(6, true);
} | public byte i6() {
<DeepExtract>
assert (6 <= 8);
return (byte) readInt(6, true);
</DeepExtract>
} | testing-video | positive | 4,411 |
public void openVideo() {
if ((mUri == null) || (mSurfaceTexture == null)) {
Log.d(TAG, "Cannot open video, uri or surface texture is null.");
return;
}
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
mContext.sendBroadcast(i);
Log.d(TAG, "Releasing media player.");
if (m... | public void openVideo() {
if ((mUri == null) || (mSurfaceTexture == null)) {
Log.d(TAG, "Cannot open video, uri or surface texture is null.");
return;
}
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
mContext.sendBroadcast(i);
<DeepExtract>
Log.d(TAG, "Releasing media pl... | Filmstrip | positive | 4,412 |
@Test
public void testBufferPackBufferUnpack() throws Exception {
super.testByteArray();
} | @Test
public void testBufferPackBufferUnpack() throws Exception {
<DeepExtract>
super.testByteArray();
</DeepExtract>
} | msgpack-java | positive | 4,413 |
public Criteria andDidNotIn(List<Long> values) {
if (values == null) {
throw new RuntimeException("Value for " + "did" + " cannot be null");
}
criteria.add(new Criterion("did not in", values));
return (Criteria) this;
} | public Criteria andDidNotIn(List<Long> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "did" + " cannot be null");
}
criteria.add(new Criterion("did not in", values));
</DeepExtract>
return (Criteria) this;
} | Hospital | positive | 4,414 |
@Override
public LimitOrder deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject object = json.getAsJsonObject();
String id = object.get(KEY_ID).getAsString();
String expiration = object.get(KEY_EXPIRATION).getAsString();
UserAccount seller = context.des... | @Override
public LimitOrder deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject object = json.getAsJsonObject();
String id = object.get(KEY_ID).getAsString();
String expiration = object.get(KEY_EXPIRATION).getAsString();
UserAccount seller = context.des... | graphenej | positive | 4,415 |
public Criteria andRecordStatusNotBetween(int value1, int value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "recordStatus" + " cannot be null");
}
criteria.add(new Criterion("record_status not between", value1, value2));
return (Criteria) this;
} | public Criteria andRecordStatusNotBetween(int value1, int value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "recordStatus" + " cannot be null");
}
criteria.add(new Criterion("record_status not between", value1, value2));
</DeepExtract>
return (Criteria) t... | oauth2-resource | positive | 4,416 |
@Override
public void onSuccess(@Nullable Object responseData) {
ElectrodeBridgeResponse response = ElectrodeBridgeResponse.createResponseForRequest(request, responseData, null);
Logger.d(TAG, "Handling bridge response");
BridgeTransaction transaction = sPendingTransactions.get(response.getId());
if (transaction != nul... | @Override
public void onSuccess(@Nullable Object responseData) {
ElectrodeBridgeResponse response = ElectrodeBridgeResponse.createResponseForRequest(request, responseData, null);
<DeepExtract>
Logger.d(TAG, "Handling bridge response");
BridgeTransaction transaction = sPendingTransactions.get(response.getId());
if (tran... | react-native-electrode-bridge | positive | 4,419 |
public String addDiffResponseListenerOnSameUrl(String originUrl, String qualifier, ProgressListener listener) {
String newUrl = originUrl + HttpProgressInterceptor.IDENTIFICATION_NUMBER + qualifier;
List<WeakReference<ProgressListener>> progressListeners;
synchronized (HttpManager.class) {
progressListeners = mProgress... | public String addDiffResponseListenerOnSameUrl(String originUrl, String qualifier, ProgressListener listener) {
String newUrl = originUrl + HttpProgressInterceptor.IDENTIFICATION_NUMBER + qualifier;
<DeepExtract>
List<WeakReference<ProgressListener>> progressListeners;
synchronized (HttpManager.class) {
progressListene... | DevRing | positive | 4,420 |
@Override
public void onClick(DialogInterface dialog, int which) {
removeDialog(DIALOG_REMOVE_PROJECT_ID);
ApiService.deleteProject(ProjectsActivity.this, projectPath);
mAdapter.remove(projectPath);
} | @Override
public void onClick(DialogInterface dialog, int which) {
removeDialog(DIALOG_REMOVE_PROJECT_ID);
<DeepExtract>
ApiService.deleteProject(ProjectsActivity.this, projectPath);
mAdapter.remove(projectPath);
</DeepExtract>
} | VideoEditor | positive | 4,421 |
public void loadFile(String path, String filename) throws Exception {
BookmarkReader reader = EngineUtils.getSortedBookmarkReader(path, filename);
Map<Integer, Double> collectiveTags = EngineUtils.calcTopEntities(reader, EntityType.TAG);
Map<String, Double> collectiveTagNames = new LinkedHashMap<String, Double>();
for ... | public void loadFile(String path, String filename) throws Exception {
BookmarkReader reader = EngineUtils.getSortedBookmarkReader(path, filename);
Map<Integer, Double> collectiveTags = EngineUtils.calcTopEntities(reader, EntityType.TAG);
Map<String, Double> collectiveTagNames = new LinkedHashMap<String, Double>();
for ... | TagRec | positive | 4,422 |
private static MetaObject getMetaObjectFromJar(String className, File archiveFile) {
MetaObject result = null;
try {
clazz = ClassUtils.loadClassFromJar(archiveFile.getPath(), className);
} catch (ClassNotFoundException e) {
clazz = Exception.class;
} catch (MalformedURLException e) {
clazz = Exception.class;
} catch (... | private static MetaObject getMetaObjectFromJar(String className, File archiveFile) {
MetaObject result = null;
try {
clazz = ClassUtils.loadClassFromJar(archiveFile.getPath(), className);
} catch (ClassNotFoundException e) {
clazz = Exception.class;
} catch (MalformedURLException e) {
clazz = Exception.class;
} catch (... | android-classyshark | positive | 4,423 |
public static void registerRecipes() {
return Registry.register(Registry.RECIPE_TYPE, ArtOfAlchemy.id("calcination"), new RecipeType<T>() {
public String toString() {
CALCINATION = ArtOfAlchemy.id("calcination").toString();
}
});
return Registry.register(Registry.RECIPE_SERIALIZER, ArtOfAlchemy.id("calcination"), new S... | public static void registerRecipes() {
return Registry.register(Registry.RECIPE_TYPE, ArtOfAlchemy.id("calcination"), new RecipeType<T>() {
public String toString() {
CALCINATION = ArtOfAlchemy.id("calcination").toString();
}
});
return Registry.register(Registry.RECIPE_SERIALIZER, ArtOfAlchemy.id("calcination"), new S... | art-of-alchemy | positive | 4,424 |
public final Where bracket() {
builder.append(')');
return this;
} | public final Where bracket() {
<DeepExtract>
builder.append(')');
return this;
</DeepExtract>
} | NoHttp | positive | 4,425 |
public Criteria andFineGreaterThanOrEqualTo(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "fine" + " cannot be null");
}
criteria.add(new Criterion("fine >=", value));
return (Criteria) this;
} | public Criteria andFineGreaterThanOrEqualTo(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "fine" + " cannot be null");
}
criteria.add(new Criterion("fine >=", value));
</DeepExtract>
return (Criteria) this;
} | BookLibrarySystem | positive | 4,426 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.