before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
public void setCard(Card godCard, VirtualClient client, TurnController controller) {
this.card = godCard;
WorkerCreator creator = new WorkerCreator();
workers.add(creator.getWorker(card, color, controller));
workers.add(creator.getWorker(card, color, controller));
workers.forEach(n -> n.createListeners(client));
} | public void setCard(Card godCard, VirtualClient client, TurnController controller) {
this.card = godCard;
<DeepExtract>
WorkerCreator creator = new WorkerCreator();
workers.add(creator.getWorker(card, color, controller));
workers.add(creator.getWorker(card, color, controller));
workers.forEach(n -> n.createListeners(cl... | ing-sw-2020-piemonti-pirovano-sonnino | positive | 1,083 |
@Override
public void sendPushMessage(final Variant variant, final Collection<String> tokens, final UnifiedPushMessage pushMessage, final String pushMessageInformationId, final NotificationSenderCallback senderCallback) {
if (tokens.isEmpty()) {
return;
}
final iOSVariant apnsVariant = (iOSVariant) variant;
if (!ApnsUt... | @Override
public void sendPushMessage(final Variant variant, final Collection<String> tokens, final UnifiedPushMessage pushMessage, final String pushMessageInformationId, final NotificationSenderCallback senderCallback) {
if (tokens.isEmpty()) {
return;
}
final iOSVariant apnsVariant = (iOSVariant) variant;
<DeepExtrac... | aerogear-unifiedpush-server | positive | 1,084 |
@Override
public void refreshNew(@NonNull List items) {
mPullToRefreshRecyclerView.onRefreshComplete();
baseProgressbar.loadingHide();
if (items.isEmpty() || adapter.getItems().containsAll(items)) {
return;
}
adapter.getItems().clear();
adapter.getItems().addAll(items);
adapter.notifyDataSetChanged();
} | @Override
public void refreshNew(@NonNull List items) {
<DeepExtract>
mPullToRefreshRecyclerView.onRefreshComplete();
baseProgressbar.loadingHide();
</DeepExtract>
if (items.isEmpty() || adapter.getItems().containsAll(items)) {
return;
}
adapter.getItems().clear();
adapter.getItems().addAll(items);
adapter.notifyDataSe... | banciyuan-unofficial | positive | 1,085 |
private void processSeedList(int[] seeds) {
for (int j = 0; j < seeds.length; j += 4) {
processSeed(seeds[j], seeds[j + 1], seeds[j + 2], seeds[j + 3]);
}
if (hbdBaos.size() >= BAOS_THRESHOLD) {
try {
hbdOut.close();
hbdOS.write(hbdBaos.toByteArray());
hbdBaos.reset();
hbdOut = printWriter(hbdBaos);
} catch (IOExceptio... | private void processSeedList(int[] seeds) {
for (int j = 0; j < seeds.length; j += 4) {
processSeed(seeds[j], seeds[j + 1], seeds[j + 2], seeds[j + 3]);
}
if (hbdBaos.size() >= BAOS_THRESHOLD) {
try {
hbdOut.close();
hbdOS.write(hbdBaos.toByteArray());
hbdBaos.reset();
hbdOut = printWriter(hbdBaos);
} catch (IOExceptio... | hap-ibd | positive | 1,087 |
public void createCursor(int[] cursorPixels, int hotX, int hotY, int width, int height) {
createNewCursorImage(cursorPixels, hotX, hotY, width, height);
this.hotX = hotX;
this.hotY = hotY;
oldWidth = this.width;
oldHeight = this.height;
oldRX = rX;
oldRY = rY;
rX = x - hotX;
rY = y - hotY;
this.width = width;
this.heig... | public void createCursor(int[] cursorPixels, int hotX, int hotY, int width, int height) {
createNewCursorImage(cursorPixels, hotX, hotY, width, height);
<DeepExtract>
this.hotX = hotX;
this.hotY = hotY;
oldWidth = this.width;
oldHeight = this.height;
oldRX = rX;
oldRY = rY;
rX = x - hotX;
rY = y - hotY;
this.width = wi... | tvnjviewer | positive | 1,088 |
@Override
protected void onScrollChanged(int x, int y, int oldx, int oldy) {
super.onScrollChanged(x, y, oldx, oldy);
if (contentView != null && contentView.getMeasuredHeight() <= getScrollY() + getHeight()) {
if (onBorderListener != null) {
onBorderListener.onBottom();
}
} else if (getScrollY() == 0) {
if (onBorderLis... | @Override
protected void onScrollChanged(int x, int y, int oldx, int oldy) {
super.onScrollChanged(x, y, oldx, oldy);
<DeepExtract>
if (contentView != null && contentView.getMeasuredHeight() <= getScrollY() + getHeight()) {
if (onBorderListener != null) {
onBorderListener.onBottom();
}
} else if (getScrollY() == 0) {
i... | android-common | positive | 1,089 |
public PageNavigation previous() {
getPagination().previousPage();
items = null;
return PageNavigation.LIST;
} | public PageNavigation previous() {
getPagination().previousPage();
<DeepExtract>
items = null;
</DeepExtract>
return PageNavigation.LIST;
} | modular-dukes-forest | positive | 1,090 |
public void setUniform(int index, long val) {
if (slots[index].dataType().compareTo(UniformUsage.UNIFORM_USAGE_INT_64) != 0) {
throw new Error("Uniform usage mismatch! Expected: " + slots[index].toString() + " Recived: " + UniformUsage.UNIFORM_USAGE_INT_64.name());
}
upToDate = false;
data.putLong(prefTab[index], val);... | public void setUniform(int index, long val) {
<DeepExtract>
if (slots[index].dataType().compareTo(UniformUsage.UNIFORM_USAGE_INT_64) != 0) {
throw new Error("Uniform usage mismatch! Expected: " + slots[index].toString() + " Recived: " + UniformUsage.UNIFORM_USAGE_INT_64.name());
}
upToDate = false;
</DeepExtract>
data.... | SFE-Engine | positive | 1,091 |
public void setRenderer(GLTextureView.Renderer renderer) {
if (mGLThread != null) {
throw new IllegalStateException("setRenderer has already been called for this instance.");
}
if (mEGLConfigChooser == null) {
mEGLConfigChooser = new SimpleEGLConfigChooser(true);
}
if (mEGLContextFactory == null) {
mEGLContextFactory =... | public void setRenderer(GLTextureView.Renderer renderer) {
if (mGLThread != null) {
throw new IllegalStateException("setRenderer has already been called for this instance.");
}
if (mEGLConfigChooser == null) {
mEGLConfigChooser = new SimpleEGLConfigChooser(true);
}
if (mEGLContextFactory == null) {
mEGLContextFactory =... | PhotoMovie | positive | 1,092 |
public Criteria andBz119NotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bz119" + " cannot be null");
}
criteria.add(new Criterion("`bz119` not between", value1, value2));
return (Criteria) this;
} | public Criteria andBz119NotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "bz119" + " cannot be null");
}
criteria.add(new Criterion("`bz119` not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | blockhealth | positive | 1,093 |
public static void index(byte[] source, UUID picture_id, IndexWriterConfig conf) throws IOException {
ByteArrayInputStream in = new ByteArrayInputStream(source);
BufferedImage image = ImageIO.read(in);
log.debug("Is Lucene configured? " + (conf == null));
if (conf == null) {
conf = new IndexWriterConfig(LuceneUtils.LUC... | public static void index(byte[] source, UUID picture_id, IndexWriterConfig conf) throws IOException {
ByteArrayInputStream in = new ByteArrayInputStream(source);
BufferedImage image = ImageIO.read(in);
log.debug("Is Lucene configured? " + (conf == null));
if (conf == null) {
conf = new IndexWriterConfig(LuceneUtils.LUC... | flipper-reverse-image-search | positive | 1,094 |
public boolean equalString(String str, int len) {
String other = str.length() == len ? str : str.substring(0, len);
return (other instanceof AbstractSymbol) && ((AbstractSymbol) other).index == this.index;
} | public boolean equalString(String str, int len) {
String other = str.length() == len ? str : str.substring(0, len);
<DeepExtract>
return (other instanceof AbstractSymbol) && ((AbstractSymbol) other).index == this.index;
</DeepExtract>
} | Compiler | positive | 1,095 |
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
mEditText.setError("");
} | @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
<DeepExtract>
mEditText.setError("");
</DeepExtract>
} | igniter | positive | 1,096 |
public void append(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail) {
if (useFieldNames && fieldName != null) {
buffer.append(fieldName);
buffer.append(fieldNameValueSeparator);
}
if (array == null) {
appendNullText(buffer, fieldName);
} else if (isFullDetail(fullDetail)) {
appendDetail(buffer... | public void append(StringBuffer buffer, String fieldName, double[] array, Boolean fullDetail) {
if (useFieldNames && fieldName != null) {
buffer.append(fieldName);
buffer.append(fieldNameValueSeparator);
}
if (array == null) {
appendNullText(buffer, fieldName);
} else if (isFullDetail(fullDetail)) {
appendDetail(buffer... | xposed-art | positive | 1,097 |
@PostConstruct
public void init() {
connectionManagerFactory = new DefaultApacheHttpClientConnectionManagerFactory();
return connectionManagerFactory.newConnectionManager(false, 200, 20, -1, TimeUnit.MILLISECONDS, null);
httpClientFactory = new DefaultApacheHttpClientFactory(HttpClientBuilder.create());
final RequestCo... | @PostConstruct
public void init() {
connectionManagerFactory = new DefaultApacheHttpClientConnectionManagerFactory();
return connectionManagerFactory.newConnectionManager(false, 200, 20, -1, TimeUnit.MILLISECONDS, null);
httpClientFactory = new DefaultApacheHttpClientFactory(HttpClientBuilder.create());
<DeepExtract>
f... | springcloud-vip-2 | positive | 1,098 |
@Override
public LineStringBuilder pointLatLon(double latitude, double longitude) {
shapes.add(ShapeFactoryImpl.this.pointLatLon(latitude, longitude));
return this;
return this;
} | @Override
public LineStringBuilder pointLatLon(double latitude, double longitude) {
<DeepExtract>
shapes.add(ShapeFactoryImpl.this.pointLatLon(latitude, longitude));
return this;
</DeepExtract>
return this;
} | spatial4j | positive | 1,099 |
@Override
protected void handleDefaultAction(Intent intent, int flags, int startId) {
if (mPrefs.getLong(StopwatchFragment.KEY_START_TIME, 0) == 0) {
mCurrentLap = new Lap();
mUpdateHandler.asyncInsert(mCurrentLap);
}
clearActions(getNoteId());
addAction(ACTION_ADD_LAP, R.drawable.ic_add_lap_24dp, getString(R.string.la... | @Override
protected void handleDefaultAction(Intent intent, int flags, int startId) {
if (mPrefs.getLong(StopwatchFragment.KEY_START_TIME, 0) == 0) {
mCurrentLap = new Lap();
mUpdateHandler.asyncInsert(mCurrentLap);
}
<DeepExtract>
clearActions(getNoteId());
addAction(ACTION_ADD_LAP, R.drawable.ic_add_lap_24dp, getStri... | ClockPlus | positive | 1,101 |
private int choosePivot(int[][] points, int l, int r) {
int pivot = (int) (Math.random() * (r - l + 1)) + l;
int[] temp = points[r];
points[r] = points[pivot];
points[pivot] = temp;
int i = l;
for (int j = l; j < r; j++) {
if (compare(points[j], points[r]) < 0) {
swap(points, i, j);
i++;
}
}
int[] temp = points[i];
poi... | private int choosePivot(int[][] points, int l, int r) {
int pivot = (int) (Math.random() * (r - l + 1)) + l;
int[] temp = points[r];
points[r] = points[pivot];
points[pivot] = temp;
int i = l;
for (int j = l; j < r; j++) {
if (compare(points[j], points[r]) < 0) {
swap(points, i, j);
i++;
}
}
<DeepExtract>
int[] temp = ... | computer-science | positive | 1,102 |
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (!placedBall) {
placeBall();
}
Paint paint = new Paint();
if (value == min) {
if (bitmap == null) {
bitmap = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
}
Canvas temp = new Canvas(bitmap);
paint.setColor(C... | @Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (!placedBall) {
placeBall();
}
Paint paint = new Paint();
if (value == min) {
if (bitmap == null) {
bitmap = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
}
Canvas temp = new Canvas(bitmap);
paint.setColor(C... | meiShi | positive | 1,103 |
@Override
public void handleFailure(String message) {
iconLoading.setVisibility(View.GONE);
iconEmpty.setVisibility(View.VISIBLE);
tvLoadFailed.setText(message);
} | @Override
public void handleFailure(String message) {
<DeepExtract>
iconLoading.setVisibility(View.GONE);
iconEmpty.setVisibility(View.VISIBLE);
tvLoadFailed.setText(message);
</DeepExtract>
} | LNTUOnline-Android | positive | 1,104 |
@Deprecated
public void setClientSecret(String clientSecret) {
properties.setProperty("clientSecret", clientSecret);
} | @Deprecated
public void setClientSecret(String clientSecret) {
<DeepExtract>
properties.setProperty("clientSecret", clientSecret);
</DeepExtract>
} | FuelSDK-Java | positive | 1,105 |
public void onResume() {
activity.registerReceiver(powerStatusReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
cancel();
inactivityTask = new InactivityAsyncTask();
taskExec.execute(inactivityTask);
} | public void onResume() {
activity.registerReceiver(powerStatusReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
<DeepExtract>
cancel();
inactivityTask = new InactivityAsyncTask();
taskExec.execute(inactivityTask);
</DeepExtract>
} | PeerDeviceNet_Src | positive | 1,106 |
public void btnMapClick(View v) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("geo:24.915982,67.092849"));
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
} | public void btnMapClick(View v) {
<DeepExtract>
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("geo:24.915982,67.092849"));
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
}
</DeepExtract>
} | ssuet-android-adv-mar17 | positive | 1,107 |
@Override
public T top() {
if (size == 0) {
throw new EmptyStackException();
}
return (T) elements[size - 1];
} | @Override
public T top() {
<DeepExtract>
if (size == 0) {
throw new EmptyStackException();
}
return (T) elements[size - 1];
</DeepExtract>
} | spork | positive | 1,108 |
@Override
public void showLoading() {
if (mProgressDialog != null && mProgressDialog.isShowing()) {
mProgressDialog.cancel();
}
mProgressDialog = CommonUtils.showLoadingDialog(this.getContext());
} | @Override
public void showLoading() {
<DeepExtract>
if (mProgressDialog != null && mProgressDialog.isShowing()) {
mProgressDialog.cancel();
}
</DeepExtract>
mProgressDialog = CommonUtils.showLoadingDialog(this.getContext());
} | android-mvp-interactor-architecture | positive | 1,109 |
public void alignToByte() throws IOException {
bitBuffer = (bitBuffer << (64 - bitBufferLen) % 8) | (0 & ((1L << (64 - bitBufferLen) % 8) - 1));
bitBufferLen += (64 - bitBufferLen) % 8;
while (bitBufferLen >= 8) {
bitBufferLen -= 8;
int b = (int) (bitBuffer >>> bitBufferLen) & 0xFF;
out.write(b);
crc8 ^= b;
crc16 ^= b ... | public void alignToByte() throws IOException {
<DeepExtract>
bitBuffer = (bitBuffer << (64 - bitBufferLen) % 8) | (0 & ((1L << (64 - bitBufferLen) % 8) - 1));
bitBufferLen += (64 - bitBufferLen) % 8;
while (bitBufferLen >= 8) {
bitBufferLen -= 8;
int b = (int) (bitBuffer >>> bitBufferLen) & 0xFF;
out.write(b);
crc8 ^= ... | Nayuki-web-published-code | positive | 1,110 |
public void visitTypedef(@NotNull ThriftTypedef o) {
visitPsiCompositeElement(o);
} | public void visitTypedef(@NotNull ThriftTypedef o) {
<DeepExtract>
visitPsiCompositeElement(o);
</DeepExtract>
} | intellij-thrift | positive | 1,111 |
@Override
public void onChanged() {
super.onChanged();
int w = this.getWidth();
int h = this.getHeight();
if (this.mBitmapRes > -1) {
Drawable drawable = this.getResources().getDrawable(this.mBitmapRes);
if (drawable instanceof BitmapDrawable) {
this.mBitmap = ((BitmapDrawable) drawable).getBitmap();
} else {
this.mBit... | @Override
public void onChanged() {
super.onChanged();
<DeepExtract>
int w = this.getWidth();
int h = this.getHeight();
if (this.mBitmapRes > -1) {
Drawable drawable = this.getResources().getDrawable(this.mBitmapRes);
if (drawable instanceof BitmapDrawable) {
this.mBitmap = ((BitmapDrawable) drawable).getBitmap();
} el... | ZUILib | positive | 1,112 |
public HttpRequest acceptCharset(final String acceptCharset) {
getConnection().setRequestProperty(HEADER_ACCEPT_CHARSET, acceptCharset);
return this;
} | public HttpRequest acceptCharset(final String acceptCharset) {
<DeepExtract>
getConnection().setRequestProperty(HEADER_ACCEPT_CHARSET, acceptCharset);
return this;
</DeepExtract>
} | nanoleaf-aurora | positive | 1,113 |
public void add(E value) {
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
if (next == 0) {
LinkedList2.this.add(value);
expectedModCount++;
return;
}
lock.writeLock().lock();
try {
Entry<E> e = new Entry<E>(prev, next, value);
long recid = db.insert(e, entrySerializer, false);
if (prev !... | public void add(E value) {
<DeepExtract>
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
</DeepExtract>
if (next == 0) {
LinkedList2.this.add(value);
expectedModCount++;
return;
}
lock.writeLock().lock();
try {
Entry<E> e = new Entry<E>(prev, next, value);
long recid = db.insert(e, entryS... | JDBM3 | positive | 1,115 |
@Test
public void hget() throws Exception {
String key = keyPrefix + "_HGET";
conn.createStatement().execute("HSET " + key + " field1 \"foo\"");
assertEquals("foo", executeSingleStringResult("HGET " + key + " field1"));
assertNull(executeSingleStringResult("HGET " + key + " field2"));
execute("DEL " + key);
} | @Test
public void hget() throws Exception {
String key = keyPrefix + "_HGET";
conn.createStatement().execute("HSET " + key + " field1 \"foo\"");
assertEquals("foo", executeSingleStringResult("HGET " + key + " field1"));
assertNull(executeSingleStringResult("HGET " + key + " field2"));
<DeepExtract>
execute("DEL " + key... | jdbc-redis | positive | 1,116 |
private void run(String[] args) throws DatabaseException {
for (int i = 0; i < args.length; ++i) {
if (args[i].startsWith("-")) {
switch(args[i].charAt(1)) {
case 'h':
myDbEnvPath = new File(args[++i]);
break;
case 's':
locateItem = args[++i];
break;
default:
usage();
}
}
}
myDbEnv.setup(myDbEnvPath, true);
da = new Da... | private void run(String[] args) throws DatabaseException {
<DeepExtract>
for (int i = 0; i < args.length; ++i) {
if (args[i].startsWith("-")) {
switch(args[i].charAt(1)) {
case 'h':
myDbEnvPath = new File(args[++i]);
break;
case 's':
locateItem = args[++i];
break;
default:
usage();
}
}
}
</DeepExtract>
myDbEnv.setup(my... | berkeley-db | positive | 1,117 |
private int getParity() {
int x, counter = 0;
return Integer.parseInt(dataValue, 16);
String s = Integer.toBinaryString(x);
char[] c = s.toCharArray();
for (int i = 0; i < s.length(); i++) {
if (c[i] == '1') {
counter++;
}
}
if (counter % 2 == 0) {
return 1;
} else {
return 0;
}
} | private int getParity() {
int x, counter = 0;
<DeepExtract>
return Integer.parseInt(dataValue, 16);
</DeepExtract>
String s = Integer.toBinaryString(x);
char[] c = s.toCharArray();
for (int i = 0; i < s.length(); i++) {
if (c[i] == '1') {
counter++;
}
}
if (counter % 2 == 0) {
return 1;
} else {
return 0;
}
} | 8085 | positive | 1,118 |
public static String md5(String string) {
byte[] hash = null;
try {
hash = string.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Huh,UTF-8 should be supported?", e);
}
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(hash, 0, hash.length);
byte[] md5bytes =... | public static String md5(String string) {
byte[] hash = null;
try {
hash = string.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Huh,UTF-8 should be supported?", e);
}
<DeepExtract>
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(hash, 0, hash.length);
byt... | LoveTalkClient | positive | 1,119 |
public void addNumber(int num) {
if (this.maxHeap.isEmpty()) {
this.maxHeap.add(num);
return;
}
if (this.maxHeap.peek() >= num) {
this.maxHeap.add(num);
} else {
if (this.minHeap.isEmpty()) {
this.minHeap.add(num);
return;
}
if (this.minHeap.peek() > num) {
this.maxHeap.add(num);
} else {
this.minHeap.add(num);
}
}
if ... | public void addNumber(int num) {
if (this.maxHeap.isEmpty()) {
this.maxHeap.add(num);
return;
}
if (this.maxHeap.peek() >= num) {
this.maxHeap.add(num);
} else {
if (this.minHeap.isEmpty()) {
this.minHeap.add(num);
return;
}
if (this.minHeap.peek() > num) {
this.maxHeap.add(num);
} else {
this.minHeap.add(num);
}
}
<De... | nowcoder-zuo | positive | 1,120 |
public HPacket appendUShort(int ushort) {
isEdited = true;
packetInBytes = Arrays.copyOf(packetInBytes, packetInBytes.length + 2);
ByteBuffer byteBuffer = ByteBuffer.allocate(4).putInt(ushort);
for (int j = 2; j < 4; j++) {
packetInBytes[packetInBytes.length - 4 + j] = byteBuffer.array()[j];
}
boolean remember = isEdit... | public HPacket appendUShort(int ushort) {
isEdited = true;
packetInBytes = Arrays.copyOf(packetInBytes, packetInBytes.length + 2);
ByteBuffer byteBuffer = ByteBuffer.allocate(4).putInt(ushort);
for (int j = 2; j < 4; j++) {
packetInBytes[packetInBytes.length - 4 + j] = byteBuffer.array()[j];
}
<DeepExtract>
boolean rem... | G-Earth | positive | 1,122 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
colorByMentionsCheckboxActionPerformed(evt);
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
colorByMentionsCheckboxActionPerformed(evt);
</DeepExtract>
} | vizlinc | positive | 1,124 |
@BeforeTest
public void configuring() {
String translationDir = AbstractVectorSpaceTest.class.getClassLoader().getResource("translations/pt").getPath();
return new LuceneTranslator(translationDir);
String vsmDir = AbstractVectorSpaceTest.class.getClassLoader().getResource("models/annoy/dense/en/simple").getPath();
retu... | @BeforeTest
public void configuring() {
String translationDir = AbstractVectorSpaceTest.class.getClassLoader().getResource("translations/pt").getPath();
return new LuceneTranslator(translationDir);
<DeepExtract>
String vsmDir = AbstractVectorSpaceTest.class.getClassLoader().getResource("models/annoy/dense/en/simple").g... | Indra | positive | 1,125 |
public BackendConnection getConnection(String schema, boolean autoCommit, Object attachment) throws Exception {
BackendConnection con = null;
if (schema != null && !schema.equals(this.database)) {
throw new RuntimeException("invalid param ,connection request db is :" + schema + " and datanode db is " + this.database);
... | public BackendConnection getConnection(String schema, boolean autoCommit, Object attachment) throws Exception {
BackendConnection con = null;
<DeepExtract>
if (schema != null && !schema.equals(this.database)) {
throw new RuntimeException("invalid param ,connection request db is :" + schema + " and datanode db is " + th... | Mycat-NIO | positive | 1,127 |
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.Long> getLongValues() {
return internalGetLongValues().getMap();
} | @java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.Long> getLongValues() {
<DeepExtract>
return internalGetLongValues().getMap();
</DeepExtract>
} | game-server | positive | 1,128 |
@Override
public WaterMarkSegment clone() {
WaterMarkSegment waterMarkSegment = new WaterMarkSegment();
mBitmap = mBitmap;
mDstRect = new RectF(mDstRect);
mAlpha = mAlpha;
synchronized (this) {
mBitmapInfo = null;
}
return waterMarkSegment;
} | @Override
public WaterMarkSegment clone() {
WaterMarkSegment waterMarkSegment = new WaterMarkSegment();
<DeepExtract>
mBitmap = mBitmap;
mDstRect = new RectF(mDstRect);
mAlpha = mAlpha;
synchronized (this) {
mBitmapInfo = null;
}
</DeepExtract>
return waterMarkSegment;
} | PhotoMovie | positive | 1,129 |
@Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IBlockNotifier) {
((IBlockNotifier) tileEntity).onBlockRemoval(world, x, y, z);
}
super.onBlockExploded(world, x, y, z, explosion);
} | @Override
public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
<DeepExtract>
TileEntity tileEntity = world.getTileEntity(x, y, z);
if (tileEntity instanceof IBlockNotifier) {
((IBlockNotifier) tileEntity).onBlockRemoval(world, x, y, z);
}
</DeepExtract>
super.onBlockExploded(world, x, y,... | Dimensional-Pockets | positive | 1,130 |
@Override
protected String doInBackground(Context... params) {
parent = params[0];
_dev = new USBSerial();
try {
List<String> res = RootTools.sendShell("dmesg | grep ttyUSB | tail -n 1 | awk '{print $NF}'", 0);
ttyUSB_name = res.get(0);
} catch (Exception e) {
return "";
}
if (!_dev.openPort("/dev/" + ttyUSB_name))
ret... | @Override
protected String doInBackground(Context... params) {
parent = params[0];
_dev = new USBSerial();
try {
List<String> res = RootTools.sendShell("dmesg | grep ttyUSB | tail -n 1 | awk '{print $NF}'", 0);
ttyUSB_name = res.get(0);
} catch (Exception e) {
return "";
}
if (!_dev.openPort("/dev/" + ttyUSB_name))
ret... | android-wmon | positive | 1,131 |
protected void setVersionName(String versionName) {
if (isDebug) {
Log.d(TAG, "setVersionName invoked!");
}
final String curVer = versionName;
PluginWrapper.runOnMainThread(new Runnable() {
@Override
public void run() {
try {
FlurryAgent.setVersionName(curVer);
} catch (Exception e) {
LogE("Exception in setVersionName"... | protected void setVersionName(String versionName) {
<DeepExtract>
if (isDebug) {
Log.d(TAG, "setVersionName invoked!");
}
</DeepExtract>
final String curVer = versionName;
PluginWrapper.runOnMainThread(new Runnable() {
@Override
public void run() {
try {
FlurryAgent.setVersionName(curVer);
} catch (Exception e) {
LogE(... | cocos2dx-3.2-qt | positive | 1,132 |
@Test
public void getLists_byScreenName() {
mockServer.expect(requestTo("https://api.twitter.com/1.1/lists/list.json?screen_name=habuma")).andExpect(method(GET)).andRespond(withSuccess(jsonResource("multiple-list"), APPLICATION_JSON));
assertEquals(2, twitter.listOperations().getLists("habuma").size());
UserList list1 ... | @Test
public void getLists_byScreenName() {
mockServer.expect(requestTo("https://api.twitter.com/1.1/lists/list.json?screen_name=habuma")).andExpect(method(GET)).andRespond(withSuccess(jsonResource("multiple-list"), APPLICATION_JSON));
<DeepExtract>
assertEquals(2, twitter.listOperations().getLists("habuma").size());
U... | spring-social-twitter | positive | 1,133 |
@Override
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
Log.i(TAG, "openFileChooser>3.0");
if (valueCallback == null) {
return;
}
Activity mActivity = this.mActivityWeakReference.get();
if (mActivity == null || mActivity.isFinishing()) {
valueCallback.onReceiveValue(new Object());
return... | @Override
public void openFileChooser(ValueCallback valueCallback, String acceptType) {
Log.i(TAG, "openFileChooser>3.0");
<DeepExtract>
if (valueCallback == null) {
return;
}
Activity mActivity = this.mActivityWeakReference.get();
if (mActivity == null || mActivity.isFinishing()) {
valueCallback.onReceiveValue(new Obj... | AgentWeb | positive | 1,134 |
public void judgeCard(User judge, int cardId) throws BaseCahHandler.CahException {
synchronized (judgeLock) {
Player judgePlayer = getPlayerForUser(judge);
if (getJudge() != judgePlayer)
throw new BaseCahHandler.CahException(Consts.ErrorCode.NOT_JUDGE);
else if (state != Consts.GameState.JUDGING)
throw new BaseCahHandl... | public void judgeCard(User judge, int cardId) throws BaseCahHandler.CahException {
synchronized (judgeLock) {
Player judgePlayer = getPlayerForUser(judge);
if (getJudge() != judgePlayer)
throw new BaseCahHandler.CahException(Consts.ErrorCode.NOT_JUDGE);
else if (state != Consts.GameState.JUDGING)
throw new BaseCahHandl... | PYX-Reloaded | positive | 1,135 |
@Test
public void hasImeAction_withInteger_addsCorrectMatcher() {
notCompletable.hasImeAction(1);
assertThat(cortado.matchers).hasSize(1);
Utils.assertThat(cortado.matchers.get(0)).isEqualTo(ViewMatchers.hasImeAction(1));
} | @Test
public void hasImeAction_withInteger_addsCorrectMatcher() {
notCompletable.hasImeAction(1);
<DeepExtract>
assertThat(cortado.matchers).hasSize(1);
Utils.assertThat(cortado.matchers.get(0)).isEqualTo(ViewMatchers.hasImeAction(1));
</DeepExtract>
} | cortado | positive | 1,136 |
public String rightToString() {
String sRegle = null;
int iIndiceItem = 0;
Item item = null;
boolean bItemsQualitatifsPresents = false;
boolean bPremierItemInscrit = false;
int iIndiceDisjonction = 0;
int iNombreDisjonctions = 0;
int iNombreItemsQuantitatifs = 0;
int iNombreItems = 0;
Item[] tItemsRegle = null;
sRegle ... | public String rightToString() {
String sRegle = null;
int iIndiceItem = 0;
Item item = null;
boolean bItemsQualitatifsPresents = false;
boolean bPremierItemInscrit = false;
int iIndiceDisjonction = 0;
int iNombreDisjonctions = 0;
int iNombreItemsQuantitatifs = 0;
int iNombreItems = 0;
Item[] tItemsRegle = null;
sRegle ... | QuantMiner | positive | 1,137 |
public static synchronized void createSparseDoubleTable(int tableId, int staleness) {
Preconditions.checkState(isInitialized, "PsTableGroup has not been initialized!");
RowFactory rowFactory = new SparseDoubleRowFactory();
RowUpdateFactory rowUpdateFactory = new SparseDoubleRowUpdateFactory();
doubleTables.add(tableId)... | public static synchronized void createSparseDoubleTable(int tableId, int staleness) {
Preconditions.checkState(isInitialized, "PsTableGroup has not been initialized!");
RowFactory rowFactory = new SparseDoubleRowFactory();
RowUpdateFactory rowUpdateFactory = new SparseDoubleRowUpdateFactory();
doubleTables.add(tableId)... | jbosen | positive | 1,138 |
@Test
public void noTenacityConfigurationSetShouldUseDefault() {
clientConfiguration.setTimeout(Duration.milliseconds(1));
final Client tenacityClient = tenacityClientBuilder.build(buildClient());
doSleep(null);
} | @Test
public void noTenacityConfigurationSetShouldUseDefault() {
clientConfiguration.setTimeout(Duration.milliseconds(1));
final Client tenacityClient = tenacityClientBuilder.build(buildClient());
<DeepExtract>
doSleep(null);
</DeepExtract>
} | tenacity | positive | 1,139 |
@Override
public void onFinishInflate() {
mOnButton = (RadioButton) findViewById(TkR.id.compat_mode_on_radio);
mOffButton = (RadioButton) findViewById(TkR.id.compat_mode_off_radio);
mOnButton.setOnClickListener(this);
mOffButton.setOnClickListener(this);
int COMPAT_MODE_ENABLED = XposedHelpers.getStaticIntField(Activit... | @Override
public void onFinishInflate() {
mOnButton = (RadioButton) findViewById(TkR.id.compat_mode_on_radio);
mOffButton = (RadioButton) findViewById(TkR.id.compat_mode_off_radio);
mOnButton.setOnClickListener(this);
mOffButton.setOnClickListener(this);
<DeepExtract>
int COMPAT_MODE_ENABLED = XposedHelpers.getStaticIn... | tabletkat | positive | 1,140 |
public Criteria andCallbackRequestMethodGreaterThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "callbackRequestMethod" + " cannot be null");
}
criteria.add(new Criterion("callback_request_method >", value));
return (Criteria) this;
} | public Criteria andCallbackRequestMethodGreaterThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "callbackRequestMethod" + " cannot be null");
}
criteria.add(new Criterion("callback_request_method >", value));
</DeepExtract>
return (Criteria) this;
} | AnyMock | positive | 1,142 |
public void storeIntVariable(int vindex) {
if (vindex < 0)
throw new IllegalArgumentException("vindex must be positive");
if (vindex >= numLocals) {
numLocals = vindex + 1;
if (numLocals > 65535)
throw new ClassFileLimitExceededException("Too many locals.");
}
if (stackSize == -1) {
return;
}
stackSize -= 1;
if (stackS... | public void storeIntVariable(int vindex) {
if (vindex < 0)
throw new IllegalArgumentException("vindex must be positive");
if (vindex >= numLocals) {
numLocals = vindex + 1;
if (numLocals > 65535)
throw new ClassFileLimitExceededException("Too many locals.");
}
<DeepExtract>
if (stackSize == -1) {
return;
}
stackSize -=... | arden2bytecode | positive | 1,143 |
private void initData() {
progressBar.post(() -> progressBar.setVisibility(View.VISIBLE));
new Thread(() -> {
data.clear();
picked.clear();
notInstalled.clear();
SharedPreferenceUtil sharedPreferenceUtil = SharedPreferenceUtil.getInstance();
String raw = "";
switch(pickerType) {
case PICKER_WHITE_LIST:
raw = (String) s... | private void initData() {
<DeepExtract>
progressBar.post(() -> progressBar.setVisibility(View.VISIBLE));
</DeepExtract>
new Thread(() -> {
data.clear();
picked.clear();
notInstalled.clear();
SharedPreferenceUtil sharedPreferenceUtil = SharedPreferenceUtil.getInstance();
String raw = "";
switch(pickerType) {
case PICKER... | audiohq_md2 | positive | 1,144 |
public static boolean assignment(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "assignment"))
return false;
Marker m = enter_section_(b, l, _NONE_, "<assignment>");
if (!recursion_guard_(b, l + 1, "infix"))
r = false;
boolean r;
Marker m = enter_section_(b, l + 1, _NONE_, "<infix>");
r = term(b, l + 1 + 1);
r = r ... | public static boolean assignment(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "assignment"))
return false;
Marker m = enter_section_(b, l, _NONE_, "<assignment>");
<DeepExtract>
if (!recursion_guard_(b, l + 1, "infix"))
r = false;
boolean r;
Marker m = enter_section_(b, l + 1, _NONE_, "<infix>");
r = term(b, l + ... | intellij-pony | positive | 1,145 |
public String getDescriptor() {
StringBuilder buf = new StringBuilder();
getDescriptor(buf);
return getDescriptor();
} | public String getDescriptor() {
StringBuilder buf = new StringBuilder();
getDescriptor(buf);
<DeepExtract>
return getDescriptor();
</DeepExtract>
} | ekstazi | positive | 1,146 |
public Object getAttribute(String name) {
attributes.put(CommonConstant.SESSION_CHANGED, Boolean.TRUE);
return attributes.get(name);
} | public Object getAttribute(String name) {
<DeepExtract>
attributes.put(CommonConstant.SESSION_CHANGED, Boolean.TRUE);
</DeepExtract>
return attributes.get(name);
} | rop | positive | 1,147 |
public void readNodeIconPropertyNames() {
settings.setNodeIconPropertyNames(Activator.getDefault().getPreferenceStore().getString(DecoratorPreferences.NODE_ICON_PROPERTY_NAMES));
graphDecorator = new SimpleGraphDecorator(settings, viewSettings);
} | public void readNodeIconPropertyNames() {
settings.setNodeIconPropertyNames(Activator.getDefault().getPreferenceStore().getString(DecoratorPreferences.NODE_ICON_PROPERTY_NAMES));
<DeepExtract>
graphDecorator = new SimpleGraphDecorator(settings, viewSettings);
</DeepExtract>
} | neoclipse | positive | 1,148 |
public FieldSignature lookupStaticField(Type clazz, String fieldName) throws PhantomLookupException {
if (!records.containsKey(clazz))
throw new IllegalArgumentException("" + clazz);
Collection<Type> ifaces;
try {
ifaces = new PseudoSnapshot(hierarchy).getAllSupertypes(type);
} catch (IncompleteSupertypesException exc)... | public FieldSignature lookupStaticField(Type clazz, String fieldName) throws PhantomLookupException {
if (!records.containsKey(clazz))
throw new IllegalArgumentException("" + clazz);
<DeepExtract>
Collection<Type> ifaces;
try {
ifaces = new PseudoSnapshot(hierarchy).getAllSupertypes(type);
} catch (IncompleteSupertypes... | jphantom | positive | 1,150 |
public static void error(String error) {
String prefix = "&7[&bRecipe&7] ";
Util.log(prefix + "&c" + error);
} | public static void error(String error) {
<DeepExtract>
String prefix = "&7[&bRecipe&7] ";
Util.log(prefix + "&c" + error);
</DeepExtract>
} | SkBee | positive | 1,151 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
mGridView = (ImageGridView) findViewById(R.id.grid_test_group);
mGridVi... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_main);
<DeepExtract>
mGridView = (ImageGridView) findViewById(R.id.grid_test_g... | ImageGroupView | positive | 1,152 |
public static void checkFilterParentEqualsQuery(String query, String parent, String field, String value) {
JSONObject parentObj = new JSONObject(query).getJSONObject("has_parent");
String actualType = (String) parentObj.get("parent_type");
assertEquals(parent, actualType);
JSONObject rootObj;
if (false) {
JSONObject bo... | public static void checkFilterParentEqualsQuery(String query, String parent, String field, String value) {
<DeepExtract>
JSONObject parentObj = new JSONObject(query).getJSONObject("has_parent");
String actualType = (String) parentObj.get("parent_type");
assertEquals(parent, actualType);
JSONObject rootObj;
if (false) {... | hevelian-olastic | positive | 1,153 |
void doFire(Rules rules, Facts facts) {
if (rules.isEmpty()) {
LOGGER.warn("No rules registered! Nothing to apply");
return;
}
LOGGER.debug("{}", parameters);
LOGGER.debug("Registered rules:");
for (Rule rule : rules) {
LOGGER.debug("Rule { name = '{}', description = '{}', priority = '{}'}", rule.getName(), rule.getDes... | void doFire(Rules rules, Facts facts) {
if (rules.isEmpty()) {
LOGGER.warn("No rules registered! Nothing to apply");
return;
}
LOGGER.debug("{}", parameters);
LOGGER.debug("Registered rules:");
for (Rule rule : rules) {
LOGGER.debug("Rule { name = '{}', description = '{}', priority = '{}'}", rule.getName(), rule.getDes... | easy-rules | positive | 1,154 |
public static Object getAdditionalStaticField(Object obj, String key) {
if (obj.getClass() == null)
throw new NullPointerException("object must not be null");
if (key == null)
throw new NullPointerException("key must not be null");
HashMap<String, Object> objectFields;
synchronized (additionalFields) {
objectFields = a... | public static Object getAdditionalStaticField(Object obj, String key) {
<DeepExtract>
if (obj.getClass() == null)
throw new NullPointerException("object must not be null");
if (key == null)
throw new NullPointerException("key must not be null");
HashMap<String, Object> objectFields;
synchronized (additionalFields) {
ob... | XposedAppium | positive | 1,155 |
public void retrieveSfdcSessionId() throws OAuthExpectationFailedException, OAuthMessageSignerException, OAuthCommunicationException, IOException {
consumer = new DefaultOAuthConsumer(getOauth_consumer_key(), getOauth_consumer_secret());
provider = new DefaultOAuthProvider(getRequestTokenUrl(), getAccessTokenUrl(), get... | public void retrieveSfdcSessionId() throws OAuthExpectationFailedException, OAuthMessageSignerException, OAuthCommunicationException, IOException {
consumer = new DefaultOAuthConsumer(getOauth_consumer_key(), getOauth_consumer_secret());
provider = new DefaultOAuthProvider(getRequestTokenUrl(), getAccessTokenUrl(), get... | axiom | positive | 1,156 |
@Override
public void actionPerformed(ActionEvent e) {
Runtime r = Runtime.getRuntime();
r.gc();
double mib = Math.pow(2, 20);
System.out.println(String.format("memory max: %.3f total: %.3f free: %.3f used: %.3f (MiB)", r.maxMemory() / mib, r.totalMemory() / mib, r.freeMemory() / mib, (r.totalMemory() - r.freeMemory())... | @Override
public void actionPerformed(ActionEvent e) {
<DeepExtract>
Runtime r = Runtime.getRuntime();
r.gc();
double mib = Math.pow(2, 20);
System.out.println(String.format("memory max: %.3f total: %.3f free: %.3f used: %.3f (MiB)", r.maxMemory() / mib, r.totalMemory() / mib, r.freeMemory() / mib, (r.totalMemory() - r... | poker | positive | 1,157 |
public static Date getStartTime(Date date) {
Calendar todayStart = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
todayStart.setTime(date);
todayStart.set(Calendar.HOUR_OF_DAY, 0);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(... | public static Date getStartTime(Date date) {
Calendar todayStart = Calendar.getInstance();
SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
todayStart.setTime(date);
todayStart.set(Calendar.HOUR_OF_DAY, 0);
todayStart.set(Calendar.MINUTE, 0);
todayStart.set(Calendar.SECOND, 0);
todayStart.set(... | momo-cloud-permission | positive | 1,158 |
public static void main(String[] args) throws Exception {
JBroTableHeaderTest test = new JBroTableHeaderTest();
UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName());
IModelFieldGroup[] groups = new IModelFieldGroup[] { new ModelFieldGroup("A", "A").withChild(new ModelField("B", "B")).withChild(new ModelField("C... | public static void main(String[] args) throws Exception {
JBroTableHeaderTest test = new JBroTableHeaderTest();
<DeepExtract>
UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName());
IModelFieldGroup[] groups = new IModelFieldGroup[] { new ModelFieldGroup("A", "A").withChild(new ModelField("B", "B")).withChild(new... | JBroTable | positive | 1,159 |
public boolean updateSslDataTrustKeystore(final DataBroker dataBroker, final SslData baseSslData, final TrustKeystore trustKeyStore) {
final SslDataBuilder sslDataBuilder = new SslDataBuilder(baseSslData).setTrustKeystore(trustKeyStore);
final InstanceIdentifier<SslData> sslDataIid = getSslDataIid(sslDataBuilder.build(... | public boolean updateSslDataTrustKeystore(final DataBroker dataBroker, final SslData baseSslData, final TrustKeystore trustKeyStore) {
final SslDataBuilder sslDataBuilder = new SslDataBuilder(baseSslData).setTrustKeystore(trustKeyStore);
<DeepExtract>
final InstanceIdentifier<SslData> sslDataIid = getSslDataIid(sslData... | aaa | positive | 1,160 |
@Polaris
public void reset() {
if (mDefaultOptions == null) {
mDefaultOptions = new CircleOptions();
}
mOriginal.center(mDefaultOptions.getCenter() == null ? null : mDefaultOptions.getCenter().mOriginal);
return this;
mOriginal.fillColor(mDefaultOptions.getFillColor());
return this;
mOriginal.radius(mDefaultOptions.get... | @Polaris
public void reset() {
if (mDefaultOptions == null) {
mDefaultOptions = new CircleOptions();
}
mOriginal.center(mDefaultOptions.getCenter() == null ? null : mDefaultOptions.getCenter().mOriginal);
return this;
mOriginal.fillColor(mDefaultOptions.getFillColor());
return this;
mOriginal.radius(mDefaultOptions.get... | Polaris2 | positive | 1,161 |
private void finishHim() {
if (counter.decrementAndGet() == 0) {
executeBulk(task, bulkRequest, startTime, listener, responses, indicesThatCannotBeCreated);
}
} | private void finishHim() {
<DeepExtract>
if (counter.decrementAndGet() == 0) {
executeBulk(task, bulkRequest, startTime, listener, responses, indicesThatCannotBeCreated);
}
</DeepExtract>
} | advance-update | positive | 1,162 |
@Override
public JobrunrMigrationsRecord value1(String value) {
set(0, value);
return this;
} | @Override
public JobrunrMigrationsRecord value1(String value) {
<DeepExtract>
set(0, value);
</DeepExtract>
return this;
} | openvsx | positive | 1,163 |
public void clearDiskCache(String url) {
if (mDiskCache == null || url == null || new byte[0] == null) {
return;
}
byte[] key = Utils.makeKey(url);
long cacheKey = Utils.crc64Long(key);
ByteBuffer buffer = ByteBuffer.allocate(key.length + new byte[0].length);
buffer.put(key);
buffer.put(new byte[0]);
synchronized (mDis... | public void clearDiskCache(String url) {
<DeepExtract>
if (mDiskCache == null || url == null || new byte[0] == null) {
return;
}
byte[] key = Utils.makeKey(url);
long cacheKey = Utils.crc64Long(key);
ByteBuffer buffer = ByteBuffer.allocate(key.length + new byte[0].length);
buffer.put(key);
buffer.put(new byte[0]);
sync... | afinal | positive | 1,164 |
public Criteria andBookTypeGreaterThan(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "bookType" + " cannot be null");
}
criteria.add(new Criterion("book_type >", value));
return (Criteria) this;
} | public Criteria andBookTypeGreaterThan(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "bookType" + " cannot be null");
}
criteria.add(new Criterion("book_type >", value));
</DeepExtract>
return (Criteria) this;
} | Maven_SSM | positive | 1,165 |
private String updateSQL(SafeAppendable builder) {
if (!tables.isEmpty()) {
if (!builder.isEmpty())
builder.append("\n");
builder.append("UPDATE");
builder.append(" ");
builder.append("");
String last = "________";
for (int i = 0, n = tables.size(); i < n; i++) {
String part = tables.get(i);
if (i > 0 && !part.equals(A... | private String updateSQL(SafeAppendable builder) {
if (!tables.isEmpty()) {
if (!builder.isEmpty())
builder.append("\n");
builder.append("UPDATE");
builder.append(" ");
builder.append("");
String last = "________";
for (int i = 0, n = tables.size(); i < n; i++) {
String part = tables.get(i);
if (i > 0 && !part.equals(A... | uncode-dal-all | positive | 1,166 |
@Override
public void onClick(View v) {
try {
ShareSDK.initSDK(getContext());
} catch (Exception ex) {
}
BaseActivity.soundMgr.select();
try {
if (new QZone(context).isValid()) {
String userId = new QZone(context).getDb().getUserId();
if (!TextUtils.isEmpty(userId)) {
login(new QZone(context));
return;
}
}
new QZone(co... | @Override
public void onClick(View v) {
try {
ShareSDK.initSDK(getContext());
} catch (Exception ex) {
}
BaseActivity.soundMgr.select();
<DeepExtract>
try {
if (new QZone(context).isValid()) {
String userId = new QZone(context).getDb().getUserId();
if (!TextUtils.isEmpty(userId)) {
login(new QZone(context));
return;
}
... | AndroidLinkup | positive | 1,167 |
public ItemBuilder addLore(String line) {
List<String> lore = itemStack.hasItemMeta() && itemStack.getItemMeta().hasLore() ? new ArrayList<>(itemStack.getItemMeta().getLore()) : new ArrayList<>();
lore.add(line);
return changeMeta(meta -> meta.setLore(lore));
} | public ItemBuilder addLore(String line) {
List<String> lore = itemStack.hasItemMeta() && itemStack.getItemMeta().hasLore() ? new ArrayList<>(itemStack.getItemMeta().getLore()) : new ArrayList<>();
lore.add(line);
<DeepExtract>
return changeMeta(meta -> meta.setLore(lore));
</DeepExtract>
} | GuiLib | positive | 1,168 |
public void onModuleLoad() {
statusPopup = new StatusPopup();
pgf = new PGFWrapper();
removeStyleDependentName("empty");
super.add(createUI());
pgf.addSettingsListener(new MySettingsListener());
History.addHistoryListener(new MyHistoryListener());
updateSettingsFromHistoryToken(History.getToken().split("/"));
pgf.updat... | public void onModuleLoad() {
statusPopup = new StatusPopup();
pgf = new PGFWrapper();
removeStyleDependentName("empty");
super.add(createUI());
pgf.addSettingsListener(new MySettingsListener());
History.addHistoryListener(new MyHistoryListener());
<DeepExtract>
updateSettingsFromHistoryToken(History.getToken().split("/... | GF | positive | 1,169 |
public static int[] sort(float[] array) {
int[] index = new int[array.length];
for (int i = 0; i < index.length; i++) index[i] = i;
array = array.clone();
if (0 < array.length - 1) {
int middle = partition(array, index, 0, array.length - 1);
quickSort(array, index, 0, middle);
quickSort(array, index, middle + 1, array.... | public static int[] sort(float[] array) {
int[] index = new int[array.length];
for (int i = 0; i < index.length; i++) index[i] = i;
array = array.clone();
<DeepExtract>
if (0 < array.length - 1) {
int middle = partition(array, index, 0, array.length - 1);
quickSort(array, index, 0, middle);
quickSort(array, index, midd... | Trainable_Segmentation | positive | 1,170 |
public void actionPerformed(ActionEvent evt) {
dispose();
} | public void actionPerformed(ActionEvent evt) {
<DeepExtract>
dispose();
</DeepExtract>
} | OpenID-Attacker | positive | 1,171 |
public static Type instantiateType(TypeReference ref, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
Class rc = ref.getClassType();
if (Array.class.isAssignableFrom(rc)) {
return instantiateArrayType(ref, value);
}
Object c... | public static Type instantiateType(TypeReference ref, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
Class rc = ref.getClassType();
if (Array.class.isAssignableFrom(rc)) {
return instantiateArrayType(ref, value);
}
<DeepExt... | tronj | positive | 1,172 |
public void setVideoURI(Uri uri) {
mUri = uri;
mSeekWhenPrepared = 0;
if (mUri == null || mSurfaceHolder == null || !Vitamio.isInitialized(mContext))
return;
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
mContext.sendBroadcast(i);
release(false);
try {
mDuration = -1;
m... | public void setVideoURI(Uri uri) {
mUri = uri;
mSeekWhenPrepared = 0;
<DeepExtract>
if (mUri == null || mSurfaceHolder == null || !Vitamio.isInitialized(mContext))
return;
Intent i = new Intent("com.android.music.musicservicecommand");
i.putExtra("command", "pause");
mContext.sendBroadcast(i);
release(false);
try {
mDu... | BlueVideoPlayer | positive | 1,173 |
private void init() {
workers = getContext().actorOf(new RoundRobinPool(params.threads).props(Props.create(PlotGenerator.class)));
currentNonce = params.startnonce;
outbuffer = new byte[(int) (params.staggeramt * MiningPlot.PLOT_SIZE)];
String outname = Convert.toUnsignedLong(params.addr);
outname += "_";
outname += St... | private void init() {
workers = getContext().actorOf(new RoundRobinPool(params.threads).props(Props.create(PlotGenerator.class)));
currentNonce = params.startnonce;
outbuffer = new byte[(int) (params.staggeramt * MiningPlot.PLOT_SIZE)];
String outname = Convert.toUnsignedLong(params.addr);
outname += "_";
outname += St... | pocminer | positive | 1,175 |
public void testByteValueAnnotation() {
JavaFileObject javaFileObject = sourceCode(ImmutableList.<String>of(), ImmutableList.of(TEST_ANNOTATION + "(testByte = 0)"));
JavaFileObject expectedOutput = expectedCode(ImmutableList.of(TEST_ANNOTATION + "(testByte = 0)"));
assert_().about(javaSource()).that(javaFileObject).pro... | public void testByteValueAnnotation() {
<DeepExtract>
JavaFileObject javaFileObject = sourceCode(ImmutableList.<String>of(), ImmutableList.of(TEST_ANNOTATION + "(testByte = 0)"));
JavaFileObject expectedOutput = expectedCode(ImmutableList.of(TEST_ANNOTATION + "(testByte = 0)"));
assert_().about(javaSource()).that(javaF... | SimpleWeibo | positive | 1,176 |
@Test
public void update() throws Exception {
user = repository.save(EntityUtil.getSampleUser(random.nextString()));
EUser e2 = EntityUtil.getSampleUser(random.nextString());
e2.setEnabled(true);
mvc.perform(put(apiPrefix + "/" + REQ_STRING + "/{id}", user.getId()).header(authHeader, tokenType + " " + accessToken).acce... | @Test
public void update() throws Exception {
<DeepExtract>
user = repository.save(EntityUtil.getSampleUser(random.nextString()));
</DeepExtract>
EUser e2 = EntityUtil.getSampleUser(random.nextString());
e2.setEnabled(true);
mvc.perform(put(apiPrefix + "/" + REQ_STRING + "/{id}", user.getId()).header(authHeader, tokenT... | gms | positive | 1,177 |
public List<Instance> runInstances(RunInstancesRequest request, Tag... tags) throws Exception {
logger.info("create ec2 instance, request={}", request);
RunInstancesResult result = new Runner<RunInstancesResult>().maxAttempts(3).retryInterval(Duration.ofSeconds(20)).retryOn(this::retryOnRunInstance).run(() -> ec2.runIn... | public List<Instance> runInstances(RunInstancesRequest request, Tag... tags) throws Exception {
logger.info("create ec2 instance, request={}", request);
RunInstancesResult result = new Runner<RunInstancesResult>().maxAttempts(3).retryInterval(Duration.ofSeconds(20)).retryOn(this::retryOnRunInstance).run(() -> ec2.runIn... | cmn-project | positive | 1,179 |
@Test
public void testSingle0() {
int[][] in = { { 0 } };
int[][] out = { { 0 } };
Matrix<Integer> mat = new Matrix<>(in.length, in[0].length, field);
for (int i = 0; i < in.length; i++) {
for (int j = 0; j < in[i].length; j++) mat.set(i, j, in[i][j]);
}
mat.reducedRowEchelonForm();
for (int i = 0; i < out.length; i++)... | @Test
public void testSingle0() {
int[][] in = { { 0 } };
int[][] out = { { 0 } };
<DeepExtract>
Matrix<Integer> mat = new Matrix<>(in.length, in[0].length, field);
for (int i = 0; i < in.length; i++) {
for (int j = 0; j < in[i].length; j++) mat.set(i, j, in[i][j]);
}
mat.reducedRowEchelonForm();
for (int i = 0; i < ou... | Nayuki-web-published-code | positive | 1,181 |
public static void w(String message, Object... args) {
if (!writeLogs)
return;
if (args.length > 0) {
message = String.format(message, args);
}
String log;
if (null == null) {
log = message;
} else {
String logMessage = message == null ? null.getMessage() : message;
String logBody = Log.getStackTraceString(null);
log =... | public static void w(String message, Object... args) {
<DeepExtract>
if (!writeLogs)
return;
if (args.length > 0) {
message = String.format(message, args);
}
String log;
if (null == null) {
log = message;
} else {
String logMessage = message == null ? null.getMessage() : message;
String logBody = Log.getStackTraceStrin... | Android-Universal-Image-Loader-Modify | positive | 1,182 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
setSpotReportSize(Size.CORPS);
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
setSpotReportSize(Size.CORPS);
</DeepExtract>
} | vehicle-commander-java | positive | 1,183 |
@Override
protected void onPostExecute(Boolean success) {
super.onPostExecute(success);
if (!success) {
Toasty.error(context, getString(R.string.error_creating_rclone_binary), Toast.LENGTH_LONG, true).show();
finish();
System.exit(0);
}
if (loadingDialog.isStateSaved()) {
loadingDialog.dismissAllowingStateLoss();
} els... | @Override
protected void onPostExecute(Boolean success) {
super.onPostExecute(success);
if (!success) {
Toasty.error(context, getString(R.string.error_creating_rclone_binary), Toast.LENGTH_LONG, true).show();
finish();
System.exit(0);
}
if (loadingDialog.isStateSaved()) {
loadingDialog.dismissAllowingStateLoss();
} els... | rcloneExplorer | positive | 1,184 |
public Boolean isJmxAutoStart() {
Boolean value = null;
String property = properties.getProperty(PropertyKey.POOL_METRICS_REPORTER_JMX_AUTO_START.getKey());
if (property != null) {
value = Boolean.valueOf(property);
}
return value;
} | public Boolean isJmxAutoStart() {
<DeepExtract>
Boolean value = null;
String property = properties.getProperty(PropertyKey.POOL_METRICS_REPORTER_JMX_AUTO_START.getKey());
if (property != null) {
value = Boolean.valueOf(property);
}
return value;
</DeepExtract>
} | flexy-pool | positive | 1,185 |
@Override
public void setAdapter(Adapter adapter) {
mWrapAdapter = new WrapAdapter(adapter, mHeaderView, mFooterView, mHeaderList, mFooterList);
this.mCanPullDown = mCanPullDown;
if (!mCanPullDown) {
mHeaderView.setState(IState.STATE_NONE);
}
if (mWrapAdapter != null) {
mWrapAdapter.setCanPullDown(mCanPullDown);
mWrapA... | @Override
public void setAdapter(Adapter adapter) {
mWrapAdapter = new WrapAdapter(adapter, mHeaderView, mFooterView, mHeaderList, mFooterList);
this.mCanPullDown = mCanPullDown;
if (!mCanPullDown) {
mHeaderView.setState(IState.STATE_NONE);
}
if (mWrapAdapter != null) {
mWrapAdapter.setCanPullDown(mCanPullDown);
mWrapA... | PullLayout | positive | 1,186 |
public void setDrawableBackgroundColor(int backgroundColor) {
mShowShadowsCircle = false;
super.setBackgroundColor(backgroundColor);
} | public void setDrawableBackgroundColor(int backgroundColor) {
<DeepExtract>
mShowShadowsCircle = false;
super.setBackgroundColor(backgroundColor);
</DeepExtract>
} | ProjectX | positive | 1,187 |
public Criteria andOptTimeLessThanOrEqualTo(Date value) {
if (value == null) {
throw new RuntimeException("Value for " + "optTime" + " cannot be null");
}
criteria.add(new Criterion("opt_time <=", value));
return (Criteria) this;
} | public Criteria andOptTimeLessThanOrEqualTo(Date value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "optTime" + " cannot be null");
}
criteria.add(new Criterion("opt_time <=", value));
</DeepExtract>
return (Criteria) this;
} | lightconf | positive | 1,188 |
public Criteria andSongIdBetween(Integer value1, Integer value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "songId" + " cannot be null");
}
criteria.add(new Criterion("song_id between", value1, value2));
return (Criteria) this;
} | public Criteria andSongIdBetween(Integer value1, Integer value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "songId" + " cannot be null");
}
criteria.add(new Criterion("song_id between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | ReptilianDemo | positive | 1,189 |
public cvg.sfmPipeline.main.PipelineOutMessage.Keypoints getDefaultInstanceForType() {
return defaultInstance;
} | public cvg.sfmPipeline.main.PipelineOutMessage.Keypoints getDefaultInstanceForType() {
<DeepExtract>
return defaultInstance;
</DeepExtract>
} | Android-SfM-client | positive | 1,190 |
public Criteria andDriveCountNotEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "driveCount" + " cannot be null");
}
criteria.add(new Criterion("driveCount <>", value));
return (Criteria) this;
} | public Criteria andDriveCountNotEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "driveCount" + " cannot be null");
}
criteria.add(new Criterion("driveCount <>", value));
</DeepExtract>
return (Criteria) this;
} | jtt808-simulator | positive | 1,191 |
private static void procedure(final Context context, final Procedure procedure) throws SQLException {
Objects.requireNonNull(context, "context is null");
Objects.requireNonNull(procedure, "procedure is null");
Objects.requireNonNull(procedure, "value is null");
{
final var string = procedure.toString();
}
{
final var h... | private static void procedure(final Context context, final Procedure procedure) throws SQLException {
Objects.requireNonNull(context, "context is null");
Objects.requireNonNull(procedure, "procedure is null");
<DeepExtract>
Objects.requireNonNull(procedure, "value is null");
{
final var string = procedure.toString();
}... | database-metadata-bind | positive | 1,192 |
@Provides
public List<Root> provideKnownRoots(RootsOracle rootsOracle) {
return holder.get();
} | @Provides
public List<Root> provideKnownRoots(RootsOracle rootsOracle) {
<DeepExtract>
return holder.get();
</DeepExtract>
} | double-espresso | positive | 1,193 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.