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 static void main(String[] args) {
MultiGraph graph = new MultiGraph("Test Size");
Viewer viewer = new FxViewer(graph, FxViewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
ViewerPipe pipeIn = viewer.newViewerPipe();
FxDefaultView view = (FxDefaultView) viewer.addView("view1", new FxGraphRenderer());
DefaultApplicati... | public static void main(String[] args) {
<DeepExtract>
MultiGraph graph = new MultiGraph("Test Size");
Viewer viewer = new FxViewer(graph, FxViewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
ViewerPipe pipeIn = viewer.newViewerPipe();
FxDefaultView view = (FxDefaultView) viewer.addView("view1", new FxGraphRenderer());
De... | gs-ui-javafx | positive | 2,068 |
public void mouseExited(MouseEvent e) {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
} | public void mouseExited(MouseEvent e) {
<DeepExtract>
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
</DeepExtract>
} | gomule | positive | 2,069 |
public static boolean is3G(Context context) {
NetworkInfo activeNetInfo = getNetworkInfo(context);
return activeNetInfo != null && activeNetInfo.getType() == 1;
} | public static boolean is3G(Context context) {
<DeepExtract>
NetworkInfo activeNetInfo = getNetworkInfo(context);
return activeNetInfo != null && activeNetInfo.getType() == 1;
</DeepExtract>
} | TradeIn | positive | 2,070 |
public V add(K key, V value) {
if (key == null)
throw new IllegalArgumentException("Null key");
Entry<K, V> newEntry = new Entry<>(key, value);
int bucketIndex = normalizeIndex(newEntry.hash);
return bucketInsertEntry(bucketIndex, newEntry);
} | public V add(K key, V value) {
<DeepExtract>
if (key == null)
throw new IllegalArgumentException("Null key");
Entry<K, V> newEntry = new Entry<>(key, value);
int bucketIndex = normalizeIndex(newEntry.hash);
return bucketInsertEntry(bucketIndex, newEntry);
</DeepExtract>
} | DEPRECATED-data-structures | positive | 2,072 |
public int read(SFTPv3FileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException {
boolean errorOccured = false;
if (handle.client != this) {
throw new IOException("The file handle was created with another SFTPv3FileHandle instance.");
}
if (handle.isClosed) {
throw new IOException("The fil... | public int read(SFTPv3FileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException {
boolean errorOccured = false;
<DeepExtract>
if (handle.client != this) {
throw new IOException("The file handle was created with another SFTPv3FileHandle instance.");
}
if (handle.isClosed) {
throw new IOExce... | Testingbot-Tunnel | positive | 2,073 |
public void launchPurchaseFlow(Activity act, String sku, String itemType, List<String> oldSkus, int requestCode, OnIabPurchaseFinishedListener listener, String extraData) throws IabAsyncInProgressException {
if (mDisposed)
throw new IllegalStateException("IabHelper was disposed of, so it cannot be used.");
if (!mSetupD... | public void launchPurchaseFlow(Activity act, String sku, String itemType, List<String> oldSkus, int requestCode, OnIabPurchaseFinishedListener listener, String extraData) throws IabAsyncInProgressException {
if (mDisposed)
throw new IllegalStateException("IabHelper was disposed of, so it cannot be used.");
if (!mSetupD... | Trivia-Knowledge | positive | 2,074 |
@Override
public List<HttpCookie> get(URI uri) {
mLock.lock();
if (isEnable() && mCookieEntityDao == null) {
mCookieEntityDao = new CookieEntityDao(mContext);
Where where = new Where(CookieSQLHelper.EXPIRY, Options.EQUAL, -1L);
mCookieEntityDao.delete(where.get());
}
mLock.unlock();
mLock.lock();
try {
if (uri == null ... | @Override
public List<HttpCookie> get(URI uri) {
<DeepExtract>
mLock.lock();
if (isEnable() && mCookieEntityDao == null) {
mCookieEntityDao = new CookieEntityDao(mContext);
Where where = new Where(CookieSQLHelper.EXPIRY, Options.EQUAL, -1L);
mCookieEntityDao.delete(where.get());
}
mLock.unlock();
</DeepExtract>
mLock.l... | NoHttp | positive | 2,075 |
@Override
public Properties getClientInfo() throws SQLException {
if (!pooledObject.isBorrowed()) {
throw new SQLException("PooledConnection has been returned to pool");
}
return connection.getClientInfo();
} | @Override
public Properties getClientInfo() throws SQLException {
<DeepExtract>
if (!pooledObject.isBorrowed()) {
throw new SQLException("PooledConnection has been returned to pool");
}
</DeepExtract>
return connection.getClientInfo();
} | jsql | positive | 2,076 |
@Override
public void setIs24HourView(boolean is24HourView) {
if (is24HourView == mIs24HourView) {
return;
}
mIs24HourView = is24HourView;
final int k0 = KeyEvent.KEYCODE_0;
final int k1 = KeyEvent.KEYCODE_1;
final int k2 = KeyEvent.KEYCODE_2;
final int k3 = KeyEvent.KEYCODE_3;
final int k4 = KeyEvent.KEYCODE_4;
final ... | @Override
public void setIs24HourView(boolean is24HourView) {
if (is24HourView == mIs24HourView) {
return;
}
mIs24HourView = is24HourView;
final int k0 = KeyEvent.KEYCODE_0;
final int k1 = KeyEvent.KEYCODE_1;
final int k2 = KeyEvent.KEYCODE_2;
final int k3 = KeyEvent.KEYCODE_3;
final int k4 = KeyEvent.KEYCODE_4;
final ... | AppCompat-Extension-Library | positive | 2,077 |
@Override
public void run() {
if (Build.VERSION.SDK_INT < 26)
return;
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
in... | @Override
public void run() {
<DeepExtract>
if (Build.VERSION.SDK_INT < 26)
return;
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_P... | apkextractor | positive | 2,078 |
private int serialize(final int activePathIndex) {
if (this.serialized.length < size + ARC_SIZE * MAX_LABELS) {
serialized = Arrays.copyOf(serialized, serialized.length + bufferGrowthSize);
serializationBufferReallocations++;
}
final int newState = size;
final int start = activePath[activePathIndex];
final int len = ne... | private int serialize(final int activePathIndex) {
<DeepExtract>
if (this.serialized.length < size + ARC_SIZE * MAX_LABELS) {
serialized = Arrays.copyOf(serialized, serialized.length + bufferGrowthSize);
serializationBufferReallocations++;
}
</DeepExtract>
final int newState = size;
final int start = activePath[activeP... | elasticsearch-plugin-bundle | positive | 2,079 |
@Override
public void _main(String[] args) throws IOException {
new MH().run(args, null);
} | @Override
public void _main(String[] args) throws IOException {
<DeepExtract>
new MH().run(args, null);
</DeepExtract>
} | iNotes-exporter | positive | 2,080 |
@Override
public void onClick(View v) {
int value;
try {
value = forceInRange(minValue, maxValue, inputToInt(customValueView.getText().toString()));
} catch (Exception e) {
Log.e(TAG, "worng input(non-integer): " + customValueView.getText().toString());
notifyWrongInput();
return;
}
if (persistValueListener != null) {
... | @Override
public void onClick(View v) {
<DeepExtract>
int value;
try {
value = forceInRange(minValue, maxValue, inputToInt(customValueView.getText().toString()));
} catch (Exception e) {
Log.e(TAG, "worng input(non-integer): " + customValueView.getText().toString());
notifyWrongInput();
return;
}
if (persistValueListen... | EucWorldAndroid | positive | 2,081 |
public HashMap<Long, String> loadIdSymbolMapFromTable() {
HashMap<Long, String> map = new HashMap<Long, String>();
String sql = "SELECT * FROM " + Config.relConstants;
ResultSet rs;
if (Config.exiting_mode)
ExceptionMan.die("");
try {
Statement stmt = con.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT, 1);
currentl... | public HashMap<Long, String> loadIdSymbolMapFromTable() {
HashMap<Long, String> map = new HashMap<Long, String>();
String sql = "SELECT * FROM " + Config.relConstants;
<DeepExtract>
ResultSet rs;
if (Config.exiting_mode)
ExceptionMan.die("");
try {
Statement stmt = con.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT... | tuffy | positive | 2,084 |
public Criteria andNameGreaterThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name >", value));
return (Criteria) this;
} | public Criteria andNameGreaterThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name >", value));
</DeepExtract>
return (Criteria) this;
} | health_online | positive | 2,086 |
@Override
public void onClick(View view) {
fragment.addToQuickPlaylist(track);
} | @Override
public void onClick(View view) {
<DeepExtract>
fragment.addToQuickPlaylist(track);
</DeepExtract>
} | IdealMedia | positive | 2,087 |
private void begin() {
Lib.debug(dbgThread, "Beginning thread: " + toString());
Lib.assertTrue(this == currentThread);
Lib.debug(dbgThread, "Running thread: " + currentThread.toString());
Lib.assertTrue(Machine.interrupt().disabled());
Lib.assertTrue(this == currentThread);
Lib.assertTrue(tcb == TCB.currentTCB());
Mach... | private void begin() {
Lib.debug(dbgThread, "Beginning thread: " + toString());
Lib.assertTrue(this == currentThread);
<DeepExtract>
Lib.debug(dbgThread, "Running thread: " + currentThread.toString());
Lib.assertTrue(Machine.interrupt().disabled());
Lib.assertTrue(this == currentThread);
Lib.assertTrue(tcb == TCB.curre... | CS162 | positive | 2,088 |
private void drawInfluence(Graphics2D g, int influenceX, int influenceY, double influence) {
if (Math.abs(influence) < 0.01) {
return;
}
if (influence > 0) {
g.setColor(COLOR_INFLUENCE_BLACK);
} else {
g.setColor(COLOR_INFLUENCE_WHITE);
}
int radius = (int) (stoneRadius * 0.5 * Math.abs(influence));
g.fillRect(influenc... | private void drawInfluence(Graphics2D g, int influenceX, int influenceY, double influence) {
if (Math.abs(influence) < 0.01) {
return;
}
if (influence > 0) {
g.setColor(COLOR_INFLUENCE_BLACK);
} else {
g.setColor(COLOR_INFLUENCE_WHITE);
}
int radius = (int) (stoneRadius * 0.5 * Math.abs(influence));
<DeepExtract>
g.fil... | mylizzie | positive | 2,089 |
public List<PLUSEdge> getEdgesByString(String pattern) {
ArrayList<PLUSEdge> ret = new ArrayList<PLUSEdge>();
for (String key : edges.keySet()) if (key.contains(pattern))
ret.add(edges.get(key));
return ret;
} | public List<PLUSEdge> getEdgesByString(String pattern) {
<DeepExtract>
ArrayList<PLUSEdge> ret = new ArrayList<PLUSEdge>();
for (String key : edges.keySet()) if (key.contains(pattern))
ret.add(edges.get(key));
return ret;
</DeepExtract>
} | plus | positive | 2,090 |
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mListener != null) {
mListener.onItemSelected(mItems.get(position));
}
if (mPopupWindow != null && mPopupWindow.isShowing()) {
mPopupWindow.dismiss();
}
} | public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mListener != null) {
mListener.onItemSelected(mItems.get(position));
}
<DeepExtract>
if (mPopupWindow != null && mPopupWindow.isShowing()) {
mPopupWindow.dismiss();
}
</DeepExtract>
} | UltraExplorer | positive | 2,091 |
public static void main(final String[] args) {
logger.entry();
initVertex();
;
refreshDoc();
logger.exit();
} | public static void main(final String[] args) {
<DeepExtract>
logger.entry();
initVertex();
;
refreshDoc();
logger.exit();
</DeepExtract>
} | light | positive | 2,092 |
public String getZhiShui() {
int offset = 4 - Solar.fromJulianDay(getMonth(1).getFirstJulianDay()).getLunar().getDayZhiIndex();
if (offset < 0) {
offset += 12;
}
return "å‡ é¾™æ²»æ°´".replaceFirst("å‡ ", LunarUtil.NUMBER[offset + 1]);
} | public String getZhiShui() {
<DeepExtract>
int offset = 4 - Solar.fromJulianDay(getMonth(1).getFirstJulianDay()).getLunar().getDayZhiIndex();
if (offset < 0) {
offset += 12;
}
return "å‡ é¾™æ²»æ°´".replaceFirst("å‡ ", LunarUtil.NUMBER[offset + 1]);
</DeepExtract>
} | lunar-java | positive | 2,093 |
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
JmcInit.start(this);
setContentView(R.layout.jconnect_droid_feedback);
baseConfig = new BaseConfig(this);
feedbackServiceBinder = new RemoteFeedbackServiceBinder(this);
if (baseConfig.hasError()) {
Toast.makeText(getApplicat... | @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
JmcInit.start(this);
setContentView(R.layout.jconnect_droid_feedback);
baseConfig = new BaseConfig(this);
feedbackServiceBinder = new RemoteFeedbackServiceBinder(this);
if (baseConfig.hasError()) {
Toast.makeText(getApplicat... | Impeller | positive | 2,094 |
private void initDefaultConfig() {
this.maxCacheSize = 10 * 1024 * 1024;
return this;
if (30 <= 0)
throw new IllegalArgumentException("connectTimeout must be > 0");
this.connectTimeout = 30;
return this;
if (30 <= 0)
throw new IllegalArgumentException("readTimeout must be > 0");
this.readTimeout = 30;
return this;
if (... | private void initDefaultConfig() {
this.maxCacheSize = 10 * 1024 * 1024;
return this;
if (30 <= 0)
throw new IllegalArgumentException("connectTimeout must be > 0");
this.connectTimeout = 30;
return this;
if (30 <= 0)
throw new IllegalArgumentException("readTimeout must be > 0");
this.readTimeout = 30;
return this;
if (... | OkHttp3 | positive | 2,095 |
public Criteria andIncomeNumEqualTo(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "incomeNum" + " cannot be null");
}
criteria.add(new Criterion("income_num =", value));
return (Criteria) this;
} | public Criteria andIncomeNumEqualTo(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "incomeNum" + " cannot be null");
}
criteria.add(new Criterion("income_num =", value));
</DeepExtract>
return (Criteria) this;
} | Maven_SSM | positive | 2,096 |
private void loadTextures() {
texture = new Texture(Gdx.files.internal("images/atlas.png"));
TextureRegion[][] tmpLeftRight = TextureRegion.split(texture, texture.getWidth() / 2, texture.getHeight());
TextureRegion[][] tmpMain = tmpLeftRight[0][0].split(tmpLeftRight[0][0].getRegionWidth(), tmpLeftRight[0][0].getRegionH... | private void loadTextures() {
<DeepExtract>
texture = new Texture(Gdx.files.internal("images/atlas.png"));
TextureRegion[][] tmpLeftRight = TextureRegion.split(texture, texture.getWidth() / 2, texture.getHeight());
TextureRegion[][] tmpMain = tmpLeftRight[0][0].split(tmpLeftRight[0][0].getRegionWidth(), tmpLeftRight[0]... | libgdx | positive | 2,097 |
private void initialise(double[] data, double[] xCategories, String[] toolTipLabels, String xLabel, String yLabel, String graphTitle) {
this.data = data;
this.xCategories = xCategories;
this.toolTipLabels = toolTipLabels;
this.xLabel = xLabel;
this.yLabel = yLabel;
this.graphTitle = graphTitle;
double[] minmax = new do... | private void initialise(double[] data, double[] xCategories, String[] toolTipLabels, String xLabel, String yLabel, String graphTitle) {
this.data = data;
this.xCategories = xCategories;
this.toolTipLabels = toolTipLabels;
this.xLabel = xLabel;
this.yLabel = yLabel;
this.graphTitle = graphTitle;
double[] minmax = new do... | BamQC | positive | 2,098 |
public void read(org.apache.thrift.protocol.TProtocol iprot, add_args struct) throws org.apache.thrift.TException {
iprot.readStructBegin();
while (true) {
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch(schemeField.id) {
case 1:
if (schemeField.typ... | public void read(org.apache.thrift.protocol.TProtocol iprot, add_args struct) throws org.apache.thrift.TException {
iprot.readStructBegin();
while (true) {
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch(schemeField.id) {
case 1:
if (schemeField.typ... | thrift-example | positive | 2,099 |
protected void selectOverflowIcon() {
if (mCard == null)
return;
CardHeader header = mCard.getCardHeader();
if (header != null) {
this.selected = true;
header.setOverflowSelected(true);
}
CardView cardView = mCard.getCardView();
if (cardView != null) {
if (cardView.getInternalHeaderLayout() != null && cardView.getInter... | protected void selectOverflowIcon() {
<DeepExtract>
if (mCard == null)
return;
CardHeader header = mCard.getCardHeader();
if (header != null) {
this.selected = true;
header.setOverflowSelected(true);
}
CardView cardView = mCard.getCardView();
if (cardView != null) {
if (cardView.getInternalHeaderLayout() != null && car... | BabySay | positive | 2,100 |
public Set<R> modifiableSet() {
TreeSet<R> copy = new TreeSet<R>(set.comparator());
for (R range : set) {
add(range);
}
return copy;
} | public Set<R> modifiableSet() {
TreeSet<R> copy = new TreeSet<R>(set.comparator());
<DeepExtract>
for (R range : set) {
add(range);
}
</DeepExtract>
return copy;
} | commons-ip-math | positive | 2,101 |
public static void setTranslucentForImageViewInFragment(Activity activity, int statusBarAlpha, View needOffsetView) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return;
}
setTransparentForWindow(activity);
addTranslucentView(activity, statusBarAlpha);
if (needOffsetView != null) {
Object haveSetOffset = ... | public static void setTranslucentForImageViewInFragment(Activity activity, int statusBarAlpha, View needOffsetView) {
<DeepExtract>
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return;
}
setTransparentForWindow(activity);
addTranslucentView(activity, statusBarAlpha);
if (needOffsetView != null) {
Object ha... | AndroidRapidDevelopLibrarys | positive | 2,102 |
static <B extends Buffer> CLGLImage2d<B> createFromGLRenderbuffer(CLContext context, B directBuffer, int flags, int glObject) {
CLGLBuffer.checkBuffer(directBuffer, flags);
CL cl = getCL(context);
int[] result = new int[1];
CLGL clgli = (CLGL) cl;
long id = clgli.clCreateFromGLRenderbuffer(context.ID, flags, glObject, ... | static <B extends Buffer> CLGLImage2d<B> createFromGLRenderbuffer(CLContext context, B directBuffer, int flags, int glObject) {
CLGLBuffer.checkBuffer(directBuffer, flags);
CL cl = getCL(context);
int[] result = new int[1];
CLGL clgli = (CLGL) cl;
long id = clgli.clCreateFromGLRenderbuffer(context.ID, flags, glObject, ... | jocl | positive | 2,103 |
public SearchResponse matchQuery(MatchEntity entity) throws Exception {
SearchRequest searchRequest = new SearchRequest(entity.getIndexName());
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder().trackTotalHits(true);
for (Map.Entry<String, Object> m : entity.getMap().entrySet()) {
if (StringUtils.isNot... | public SearchResponse matchQuery(MatchEntity entity) throws Exception {
SearchRequest searchRequest = new SearchRequest(entity.getIndexName());
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder().trackTotalHits(true);
<DeepExtract>
for (Map.Entry<String, Object> m : entity.getMap().entrySet()) {
if (Str... | spring-cloud-alibaba | positive | 2,104 |
@Override
public Collection<CacheObject<V>> values() {
if (validTime == -1) {
return 0;
}
int count = 0;
for (Entry<K, CacheObject<V>> entry : cache.entrySet()) {
if (entry != null && isExpired(entry.getValue())) {
cache.remove(entry.getKey());
count++;
}
}
return count;
return cache.values();
} | @Override
public Collection<CacheObject<V>> values() {
<DeepExtract>
if (validTime == -1) {
return 0;
}
int count = 0;
for (Entry<K, CacheObject<V>> entry : cache.entrySet()) {
if (entry != null && isExpired(entry.getValue())) {
cache.remove(entry.getKey());
count++;
}
}
return count;
</DeepExtract>
return cache.values... | android-common | positive | 2,105 |
public void onTickFull(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
} | public void onTickFull(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
<DeepExtract>
</DeepExtract>
} | Minechem | positive | 2,106 |
public boolean block(int i, int x, int y) {
int hi = 0;
while (i != father[i]) {
help[hi++] = i;
i = father[i];
}
for (hi--; hi >= 0; hi--) {
father[help[hi]] = i;
}
return i;
return (xmin[i] <= 0 && xmax[i] >= x) || (ymin[i] <= 0 && ymax[i] >= y) || (xmin[i] <= 0 && ymin[i] <= 0) || (xmax[i] >= x && ymax[i] >= y);
} | public boolean block(int i, int x, int y) {
<DeepExtract>
int hi = 0;
while (i != father[i]) {
help[hi++] = i;
i = father[i];
}
for (hi--; hi >= 0; hi--) {
father[help[hi]] = i;
}
return i;
</DeepExtract>
return (xmin[i] <= 0 && xmax[i] >= x) || (ymin[i] <= 0 && ymax[i] >= y) || (xmin[i] <= 0 && ymin[i] <= 0) || (xmax[... | publicclass2020 | positive | 2,107 |
public void addToHome(UserApp app) {
Factor factor = app.toFactor();
userFactors.add(factor);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
factor.setShortcuts(getShortcutsFromFactor(factor));
factor.setOrder(userFactors.indexOf(factor));
new Thread(() -> {
daoReference.insert(factor);
adapter.addFactorBroadc... | public void addToHome(UserApp app) {
Factor factor = app.toFactor();
userFactors.add(factor);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1)
factor.setShortcuts(getShortcutsFromFactor(factor));
factor.setOrder(userFactors.indexOf(factor));
new Thread(() -> {
daoReference.insert(factor);
adapter.addFactorBroadc... | Factor_Launcher_Reboot | positive | 2,108 |
public void writeString(String str) {
FsService.writeMonitor(false, str);
try {
strBytes = str.getBytes(encoding);
} catch (UnsupportedEncodingException e) {
Log.e(TAG, "Unsupported encoding: " + encoding);
strBytes = str.getBytes();
}
try {
BufferedOutputStream out = new BufferedOutputStream(cmdSocket.getOutputStream(... | public void writeString(String str) {
FsService.writeMonitor(false, str);
try {
strBytes = str.getBytes(encoding);
} catch (UnsupportedEncodingException e) {
Log.e(TAG, "Unsupported encoding: " + encoding);
strBytes = str.getBytes();
}
<DeepExtract>
try {
BufferedOutputStream out = new BufferedOutputStream(cmdSocket.ge... | iTransfer | positive | 2,109 |
public ConstExprValue foldModulo(final Modulo expression) throws ConstExprException {
throw new UnkownOperation("Unkown mod operation on '" + this.className() + "'.");
} | public ConstExprValue foldModulo(final Modulo expression) throws ConstExprException {
<DeepExtract>
throw new UnkownOperation("Unkown mod operation on '" + this.className() + "'.");
</DeepExtract>
} | cytosm | positive | 2,110 |
@SuppressWarnings("rawtypes")
@Override
public List getSerListFromCtObjChart(final Object ctObjChart) {
if (ctObjChart instanceof CTPieChart) {
return ((CTPieChart) ctObjChart).getSerList();
}
return emptySerlist;
} | @SuppressWarnings("rawtypes")
@Override
public List getSerListFromCtObjChart(final Object ctObjChart) {
if (ctObjChart instanceof CTPieChart) {
return ((CTPieChart) ctObjChart).getSerList();
}
<DeepExtract>
return emptySerlist;
</DeepExtract>
} | TieFaces | positive | 2,111 |
public static Boom me() {
return new Boom();
} | public static Boom me() {
<DeepExtract>
return new Boom();
</DeepExtract>
} | Boomvc | positive | 2,112 |
public SoMap toKebabCase() {
SoMap so = new SoMap();
for (String key : this.keySet()) {
so.set(wordEachKebabCase(key), this.get(key));
}
if (so != null) {
for (String key : so.keySet()) {
this.set(key, so.get(key));
}
}
return this;
return this;
} | public SoMap toKebabCase() {
SoMap so = new SoMap();
for (String key : this.keySet()) {
so.set(wordEachKebabCase(key), this.get(key));
}
<DeepExtract>
if (so != null) {
for (String key : so.keySet()) {
this.set(key, so.get(key));
}
}
return this;
</DeepExtract>
return this;
} | sa-plus | positive | 2,113 |
@Override
public void onAnimationRepeat(Animation animation) {
mStartingStartTrim = mStartTrim;
mStartingEndTrim = mEndTrim;
mStartingRotation = mRotation;
mColorIndex = (mColorIndex + 1) % (mColors.length);
mStartTrim = ring.getEndTrim();
invalidateSelf();
if (mFinishing) {
mFinishing = false;
animation.setDuration(AN... | @Override
public void onAnimationRepeat(Animation animation) {
mStartingStartTrim = mStartTrim;
mStartingEndTrim = mEndTrim;
mStartingRotation = mRotation;
mColorIndex = (mColorIndex + 1) % (mColors.length);
<DeepExtract>
mStartTrim = ring.getEndTrim();
invalidateSelf();
</DeepExtract>
if (mFinishing) {
mFinishing = fa... | Keep_Nice | positive | 2,114 |
public void preRunConfigure(Double sigmaThreshold, Granularity granularity, Integer granularityRange) {
if (p == null) {
log.error("Egads properties have not been set! Attempting to load from file.");
p = DetectorConfig.fromFile();
if (p == null) {
init();
}
}
p.setProperty("AUTO_SENSITIVITY_SD", sigmaThreshold.toStrin... | public void preRunConfigure(Double sigmaThreshold, Granularity granularity, Integer granularityRange) {
if (p == null) {
log.error("Egads properties have not been set! Attempting to load from file.");
p = DetectorConfig.fromFile();
if (p == null) {
init();
}
}
p.setProperty("AUTO_SENSITIVITY_SD", sigmaThreshold.toStrin... | sherlock | positive | 2,115 |
public static Bitmap scaleImageTo(Bitmap org, int newWidth, int newHeight) {
if (org == null) {
return null;
}
Matrix matrix = new Matrix();
matrix.postScale((float) newWidth / org.getWidth(), (float) newHeight / org.getHeight());
return Bitmap.createBitmap(org, 0, 0, org.getWidth(), org.getHeight(), matrix, true);
} | public static Bitmap scaleImageTo(Bitmap org, int newWidth, int newHeight) {
<DeepExtract>
if (org == null) {
return null;
}
Matrix matrix = new Matrix();
matrix.postScale((float) newWidth / org.getWidth(), (float) newHeight / org.getHeight());
return Bitmap.createBitmap(org, 0, 0, org.getWidth(), org.getHeight(), matr... | BaiSiBuDeLi | positive | 2,116 |
public static void toggleCombatMenuShown() {
COMBAT_MENU_SHOWN.put(currentProfile, !COMBAT_MENU_SHOWN.get(currentProfile));
if (COMBAT_MENU_SHOWN.get(currentProfile)) {
Client.displayMessage("@cya@Combat style is now shown", Client.CHAT_NONE);
} else {
Client.displayMessage("@cya@Combat style is now hidden", Client.CHA... | public static void toggleCombatMenuShown() {
COMBAT_MENU_SHOWN.put(currentProfile, !COMBAT_MENU_SHOWN.get(currentProfile));
if (COMBAT_MENU_SHOWN.get(currentProfile)) {
Client.displayMessage("@cya@Combat style is now shown", Client.CHAT_NONE);
} else {
Client.displayMessage("@cya@Combat style is now hidden", Client.CHA... | rscplus | positive | 2,117 |
public Property<Boolean> andNot(Property<?> value) {
return new Property<Boolean>(this, And, value.not());
} | public Property<Boolean> andNot(Property<?> value) {
<DeepExtract>
return new Property<Boolean>(this, And, value.not());
</DeepExtract>
} | SmartMoving | positive | 2,118 |
@Override
public void onClick(DialogInterface dialog, int which) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
switch(RomUtils.getRomName()) {
case RomUtils.ROM_MIUI:
applyMiuiPermission(context);
break;
case RomUtils.ROM_EMUI:
applyHuaweiPermission(context);
break;
case RomUtils.ROM_VIVO:
applyVivoPermission(... | @Override
public void onClick(DialogInterface dialog, int which) {
<DeepExtract>
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
switch(RomUtils.getRomName()) {
case RomUtils.ROM_MIUI:
applyMiuiPermission(context);
break;
case RomUtils.ROM_EMUI:
applyHuaweiPermission(context);
break;
case RomUtils.ROM_VIVO:
applyV... | ndileber | positive | 2,119 |
@Deprecated
public void setColorScheme(@ColorRes int... colors) {
final Context context = getContext();
int[] colorRes = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
colorRes[i] = ContextCompat.getColor(context, colors[i]);
}
setColorSchemeColors(colorRes);
} | @Deprecated
public void setColorScheme(@ColorRes int... colors) {
<DeepExtract>
final Context context = getContext();
int[] colorRes = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
colorRes[i] = ContextCompat.getColor(context, colors[i]);
}
setColorSchemeColors(colorRes);
</DeepExtract>
} | SamsungOneUi | positive | 2,120 |
public void testValuesRemoveAll() {
try {
map = makePopulatedMap();
} catch (UnsupportedOperationException e) {
return;
}
Collection<V> valueCollection = map.values();
Set<V> valuesToRemove = singleton(valueCollection.iterator().next());
if (supportsRemove) {
valueCollection.removeAll(valuesToRemove);
for (V value : va... | public void testValuesRemoveAll() {
try {
map = makePopulatedMap();
} catch (UnsupportedOperationException e) {
return;
}
Collection<V> valueCollection = map.values();
Set<V> valuesToRemove = singleton(valueCollection.iterator().next());
if (supportsRemove) {
valueCollection.removeAll(valuesToRemove);
for (V value : va... | JDBM3 | positive | 2,122 |
public String listVolumes() throws NotAuthorizedException, NotFoundException, ServerException, ServiceUnAvailableOrInternalError, IOException, MalformedURLException, ProtocolException, ParseException, CertificateException {
String gapiver = U.getGlanceEndpointAPIVER();
String napiver = U.getNeutronEndpointAPIVER();
if ... | public String listVolumes() throws NotAuthorizedException, NotFoundException, ServerException, ServiceUnAvailableOrInternalError, IOException, MalformedURLException, ProtocolException, ParseException, CertificateException {
<DeepExtract>
String gapiver = U.getGlanceEndpointAPIVER();
String napiver = U.getNeutronEndpoin... | DroidStack | positive | 2,123 |
public static int createProgram(final int vertexShader, final int pixelShader) throws GLException {
final int program = glCreateProgram();
Log.d(TAG, "createProgram: ...program:" + program, new RuntimeException("sssss"));
checkGlError("createProgram");
if (program == 0) {
throw new RuntimeException("Could not create pr... | public static int createProgram(final int vertexShader, final int pixelShader) throws GLException {
final int program = glCreateProgram();
Log.d(TAG, "createProgram: ...program:" + program, new RuntimeException("sssss"));
checkGlError("createProgram");
if (program == 0) {
throw new RuntimeException("Could not create pr... | VideoClipEditViewTest | positive | 2,124 |
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (mStatus == Status.CLOSE) {
mTarget = mFrontView;
} else {
mTarget = mBehindView;
}
if (null == mTarget) {
return false;
}
if (!isEnabled()) {
return false;
}
final int aciton = MotionEventCompat.getActionMasked(ev);
boolean shouldIntercept = false;
sw... | @Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
<DeepExtract>
if (mStatus == Status.CLOSE) {
mTarget = mFrontView;
} else {
mTarget = mBehindView;
}
</DeepExtract>
if (null == mTarget) {
return false;
}
if (!isEnabled()) {
return false;
}
final int aciton = MotionEventCompat.getActionMasked(ev);
boolea... | shop-front-android | positive | 2,125 |
public Criteria andCommentThreadIdIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "commentThreadId" + " cannot be null");
}
criteria.add(new Criterion("comment_thread_id in", values));
return (Criteria) this;
} | public Criteria andCommentThreadIdIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "commentThreadId" + " cannot be null");
}
criteria.add(new Criterion("comment_thread_id in", values));
</DeepExtract>
return (Criteria) this;
} | ReptilianDemo | positive | 2,126 |
public void createSync(@Nonnull final DeviceInfo deviceInfo, @Nonnull final String nativeLibraryPath) throws ProducerException {
Preconditions.checkNotNull(deviceInfo);
Preconditions.checkState(!isInitialized());
mDeviceInfo = deviceInfo;
synchronized (mSyncObject) {
if (!mLibraryInitialized) {
initializeLibrary(native... | public void createSync(@Nonnull final DeviceInfo deviceInfo, @Nonnull final String nativeLibraryPath) throws ProducerException {
<DeepExtract>
Preconditions.checkNotNull(deviceInfo);
Preconditions.checkState(!isInitialized());
mDeviceInfo = deviceInfo;
synchronized (mSyncObject) {
if (!mLibraryInitialized) {
initialize... | amazon-kinesis-video-streams-producer-sdk-java | positive | 2,128 |
@SuppressWarnings({ "unused", "WeakerAccess" })
public void debugl(String message) {
Log.println(DEBUG, getTag(), message);
} | @SuppressWarnings({ "unused", "WeakerAccess" })
public void debugl(String message) {
<DeepExtract>
Log.println(DEBUG, getTag(), message);
</DeepExtract>
} | weechat-android | positive | 2,129 |
public String getDefaultUserAgent() {
return (T) data.get(KEY_DEFAULT_USER_AGENT);
} | public String getDefaultUserAgent() {
<DeepExtract>
return (T) data.get(KEY_DEFAULT_USER_AGENT);
</DeepExtract>
} | WebCollector | positive | 2,130 |
@Override
public void handleArrowAction(Snipe snipe) {
Block targetBlock = getTargetBlock();
ToolkitProperties toolkitProperties = snipe.getToolkitProperties();
SnipeMessenger messenger = snipe.createMessenger();
if (this.seedPercent < SEED_PERCENT_MIN || this.seedPercent > SEED_PERCENT_MAX) {
messenger.sendMessage(Cha... | @Override
public void handleArrowAction(Snipe snipe) {
Block targetBlock = getTargetBlock();
<DeepExtract>
ToolkitProperties toolkitProperties = snipe.getToolkitProperties();
SnipeMessenger messenger = snipe.createMessenger();
if (this.seedPercent < SEED_PERCENT_MIN || this.seedPercent > SEED_PERCENT_MAX) {
messenger.s... | FastAsyncVoxelSniper | positive | 2,131 |
public View getVerticalScrollRepresentative() {
int tallestHeight = 0;
View tallestView = null;
for (final View view : mViews) {
final int height = view.getHeight();
if (height > tallestHeight) {
tallestHeight = height;
tallestView = view;
}
}
return tallestView;
} | public View getVerticalScrollRepresentative() {
<DeepExtract>
int tallestHeight = 0;
View tallestView = null;
for (final View view : mViews) {
final int height = view.getHeight();
if (height > tallestHeight) {
tallestHeight = height;
tallestView = view;
}
}
return tallestView;
</DeepExtract>
} | parchment | positive | 2,132 |
public <T> T delete(Class<T> reqres) {
HttpURLConnection conn = null;
try {
conn = initializeConnection(uri, "DELETE");
if (null != null) {
prepareRequestEntity(null, conn);
}
return runRequest(uri, getJavaType(reqres), conn);
} catch (IOException e) {
return throwLocalException(e);
} finally {
IOUtils.disconnectQuietl... | public <T> T delete(Class<T> reqres) {
<DeepExtract>
HttpURLConnection conn = null;
try {
conn = initializeConnection(uri, "DELETE");
if (null != null) {
prepareRequestEntity(null, conn);
}
return runRequest(uri, getJavaType(reqres), conn);
} catch (IOException e) {
return throwLocalException(e);
} finally {
IOUtils.di... | intercom-java | positive | 2,133 |
private void enableVpnService(@Nullable View view) {
PreferenceHelper.setAbBlockMethod(requireContext(), UNDEFINED);
this.binding.rootCardView.setCardBackgroundColor(this.cardColor);
this.binding.vpnCardView.setCardBackgroundColor(this.cardColor);
if (false) {
blockNext();
new MaterialAlertDialogBuilder(requireContext(... | private void enableVpnService(@Nullable View view) {
<DeepExtract>
PreferenceHelper.setAbBlockMethod(requireContext(), UNDEFINED);
this.binding.rootCardView.setCardBackgroundColor(this.cardColor);
this.binding.vpnCardView.setCardBackgroundColor(this.cardColor);
if (false) {
blockNext();
new MaterialAlertDialogBuilder(r... | AdAway | positive | 2,134 |
public void setColabDir(String colabDir) {
this.colabDir = colabDir;
Ignore.writeDefaultIgnores(this);
IFile fileByIoFile = iFactory.findFileByIoFile(new File(colabDir));
ignoreTree = Ignore.BuildIgnore(fileByIoFile);
} | public void setColabDir(String colabDir) {
this.colabDir = colabDir;
Ignore.writeDefaultIgnores(this);
<DeepExtract>
IFile fileByIoFile = iFactory.findFileByIoFile(new File(colabDir));
ignoreTree = Ignore.BuildIgnore(fileByIoFile);
</DeepExtract>
} | floobits-intellij | positive | 2,135 |
public int searchWords(String key) {
mConvResult.clear();
mCandTable.clear();
mOutputNum = 0;
mInputPinyin = null;
mGetCandidateFrom = 0;
mSingleClauseMode = false;
return 0;
} | public int searchWords(String key) {
<DeepExtract>
mConvResult.clear();
mCandTable.clear();
mOutputNum = 0;
mInputPinyin = null;
mGetCandidateFrom = 0;
mSingleClauseMode = false;
</DeepExtract>
return 0;
} | SoftWareTest | positive | 2,136 |
private void generateAndSaveHighQualityVersion(Bitmap bitmap) {
Display display = mContext.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Bitmap scaledBitmap;
if (bitmap == null)
throw new AssertionError("can not resize null bitmap");
if... | private void generateAndSaveHighQualityVersion(Bitmap bitmap) {
Display display = mContext.getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Bitmap scaledBitmap;
if (bitmap == null)
throw new AssertionError("can not resize null bitmap");
if... | Canorum | positive | 2,137 |
public static Bitmap compressBySampleSize(final Bitmap src, final int maxWidth, final int maxHeight, final boolean recycle) {
if (isEmptyBitmap(src)) {
return null;
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
ByteArrayOutputStream baos = new ByteArrayOutputStream();... | public static Bitmap compressBySampleSize(final Bitmap src, final int maxWidth, final int maxHeight, final boolean recycle) {
if (isEmptyBitmap(src)) {
return null;
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
ByteArrayOutputStream baos = new ByteArrayOutputStream();... | TraceFix | positive | 2,138 |
@Override
public byte[] getPostBody() {
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", mRequestBody, PROTOCOL_CHARSET);
return null;
}
} | @Override
public byte[] getPostBody() {
<DeepExtract>
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s", mRequestBody, PROTOCOL_CHARSET);
return null;
}
</Deep... | VolleyAir | positive | 2,139 |
public void setTabData(ArrayList<CustomTabEntity> tabEntitys) {
if (tabEntitys == null || tabEntitys.size() == 0) {
throw new IllegalStateException("TabEntitys can not be NULL or EMPTY !");
}
this.mTabEntitys.clear();
this.mTabEntitys.addAll(tabEntitys);
mTabsContainer.removeAllViews();
this.mTabCount = mTabEntitys.siz... | public void setTabData(ArrayList<CustomTabEntity> tabEntitys) {
if (tabEntitys == null || tabEntitys.size() == 0) {
throw new IllegalStateException("TabEntitys can not be NULL or EMPTY !");
}
this.mTabEntitys.clear();
this.mTabEntitys.addAll(tabEntitys);
<DeepExtract>
mTabsContainer.removeAllViews();
this.mTabCount = m... | Shopping | positive | 2,140 |
private void setAllReferences() {
List<PermissionEntity> entities = new ArrayList<>();
int userId = PermsDbFlavor.getUserIdForPermRefs(mPkg.getUid());
synchronized (mSortedPermList) {
for (Permission perm : mSortedPermList) {
if (!perm.isChangeable()) {
continue;
}
permState = perm.refString();
isPerUid = MySettings.IN... | private void setAllReferences() {
List<PermissionEntity> entities = new ArrayList<>();
int userId = PermsDbFlavor.getUserIdForPermRefs(mPkg.getUid());
synchronized (mSortedPermList) {
for (Permission perm : mSortedPermList) {
if (!perm.isChangeable()) {
continue;
}
permState = perm.refString();
isPerUid = MySettings.IN... | PermissionManagerX | positive | 2,141 |
public void startTimer() {
mView.startTimer();
this.removeMessages(0);
sendMessage(obtainMessage(0));
} | public void startTimer() {
mView.startTimer();
<DeepExtract>
this.removeMessages(0);
sendMessage(obtainMessage(0));
</DeepExtract>
} | Beats | positive | 2,142 |
public boolean isBound(Parameter<?> param) {
if (!em.isOpen()) {
throw new IllegalStateException(Localiser.msg("EM.IsClosed"));
}
if (parameters == null) {
return false;
}
if (param.getName() != null) {
if (query.getImplicitParameters().containsKey(param.getName())) {
return true;
}
} else {
if (isNativeQuery()) {
if (... | public boolean isBound(Parameter<?> param) {
<DeepExtract>
if (!em.isOpen()) {
throw new IllegalStateException(Localiser.msg("EM.IsClosed"));
}
</DeepExtract>
if (parameters == null) {
return false;
}
if (param.getName() != null) {
if (query.getImplicitParameters().containsKey(param.getName())) {
return true;
}
} else ... | datanucleus-api-jpa | positive | 2,143 |
private final void writeClientFromQueue() {
ByteBuffer b0 = cq.poll();
for (; ; ) {
ByteBuffer b1 = cq.peek();
if (b1 == null) {
break;
}
int r0 = b0.remaining();
int s1 = b1.position();
if (s1 > r0) {
break;
} else {
if (b0 != b1) {
}
b0.put(b1);
cq.poll();
BufferTools.returnBuffer(b1);
}
}
try {
b0.flip();
cc.write0(... | private final void writeClientFromQueue() {
ByteBuffer b0 = cq.poll();
for (; ; ) {
ByteBuffer b1 = cq.peek();
if (b1 == null) {
break;
}
int r0 = b0.remaining();
int s1 = b1.position();
if (s1 > r0) {
break;
} else {
if (b0 != b1) {
}
b0.put(b1);
cq.poll();
BufferTools.returnBuffer(b1);
}
}
<DeepExtract>
try {
b0.flip... | waterwave | positive | 2,144 |
@Override
public void handlePause(boolean keepRunning) {
if (!isInitialized()) {
return;
}
hasPausedEver = true;
pluginManager.onPause(keepRunning);
if (appPlugin == null) {
appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
}
if (appPlugin == null) {
LOG.w(TAG, "Unable to fire event without ex... | @Override
public void handlePause(boolean keepRunning) {
if (!isInitialized()) {
return;
}
hasPausedEver = true;
pluginManager.onPause(keepRunning);
<DeepExtract>
if (appPlugin == null) {
appPlugin = (CoreAndroid) pluginManager.getPlugin(CoreAndroid.PLUGIN_NAME);
}
if (appPlugin == null) {
LOG.w(TAG, "Unable to fire ev... | openvegemap-cordova | positive | 2,146 |
public static String appendIfMissingIgnoreCase(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) {
if (str == null || isEmpty(suffix) || endWith(str, suffix, true)) {
return str(str);
}
if (suffixes != null && suffixes.length > 0) {
for (final CharSequence s : suffixes) {
if (endWith(st... | public static String appendIfMissingIgnoreCase(final CharSequence str, final CharSequence suffix, final CharSequence... suffixes) {
<DeepExtract>
if (str == null || isEmpty(suffix) || endWith(str, suffix, true)) {
return str(str);
}
if (suffixes != null && suffixes.length > 0) {
for (final CharSequence s : suffixes) {
... | Resource | positive | 2,147 |
public void setDisableCircularTransformation(boolean disableCircularTransformation) {
if (mDisableCircularTransformation == disableCircularTransformation) {
return;
}
mDisableCircularTransformation = disableCircularTransformation;
if (mDisableCircularTransformation) {
mBitmap = null;
} else {
mBitmap = getBitmapFromDra... | public void setDisableCircularTransformation(boolean disableCircularTransformation) {
if (mDisableCircularTransformation == disableCircularTransformation) {
return;
}
mDisableCircularTransformation = disableCircularTransformation;
<DeepExtract>
if (mDisableCircularTransformation) {
mBitmap = null;
} else {
mBitmap = ge... | FUNimDemoDroid | positive | 2,148 |
protected static void do_table_as_string(PrintWriter out, short[][] sa) {
out.println("new String[] {");
out.print(" \"");
int nchar = 0, nbytes = 0;
int nchar = 0, nbytes = 0;
StringBuffer escape = new StringBuffer();
if ((char) (sa.length >> 16) <= 0xFF) {
escape.append(Integer.toOctalString((char) (sa.length >> 1... | protected static void do_table_as_string(PrintWriter out, short[][] sa) {
out.println("new String[] {");
out.print(" \"");
int nchar = 0, nbytes = 0;
int nchar = 0, nbytes = 0;
StringBuffer escape = new StringBuffer();
if ((char) (sa.length >> 16) <= 0xFF) {
escape.append(Integer.toOctalString((char) (sa.length >> 1... | Compiler | positive | 2,149 |
@Override
public void onStop() {
super.onStop();
if (mActivity == null)
return;
mActivity.dispatchFragmentLifecycle(LifecycleHelper.LIFECYLCE_ONSTOP, BaseFragment.this, null, false);
} | @Override
public void onStop() {
super.onStop();
<DeepExtract>
if (mActivity == null)
return;
mActivity.dispatchFragmentLifecycle(LifecycleHelper.LIFECYLCE_ONSTOP, BaseFragment.this, null, false);
</DeepExtract>
} | Headline_News_Kotlin_App | positive | 2,150 |
public JDefinedClass _enum(String name) throws JClassAlreadyExistsException {
return _class(JMod.PUBLIC, name, ClassType.ENUM ? ClassType.INTERFACE : ClassType.CLASS);
} | public JDefinedClass _enum(String name) throws JClassAlreadyExistsException {
<DeepExtract>
return _class(JMod.PUBLIC, name, ClassType.ENUM ? ClassType.INTERFACE : ClassType.CLASS);
</DeepExtract>
} | jaxb-codemodel | positive | 2,151 |
private boolean render(float timeDelta) {
GL11.glLoadIdentity();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
if (!map_load_started) {
map_load_started = true;
setLightMode(lightMode);
}
GL11.glPushMatrix();
camera.applyCameraTransformation();
currentCameraPosX = -camera.getPosition().x;
currentCa... | private boolean render(float timeDelta) {
GL11.glLoadIdentity();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
if (!map_load_started) {
map_load_started = true;
setLightMode(lightMode);
}
GL11.glPushMatrix();
camera.applyCameraTransformation();
currentCameraPosX = -camera.getPosition().x;
currentCa... | minecraftxray | positive | 2,152 |
public void setMax(int max) {
mMax = max;
if (mMax < mMin) {
setMin(mMax - 1);
}
int range = mMax - mMin;
if ((mKeyProgressIncrement == 0) || (range / mKeyProgressIncrement > 20)) {
mKeyProgressIncrement = Math.max(1, Math.round((float) range / 20));
}
if (mValue < mMin || mValue > mMax) {
setProgress(mMin);
}
} | public void setMax(int max) {
mMax = max;
if (mMax < mMin) {
setMin(mMax - 1);
}
<DeepExtract>
int range = mMax - mMin;
if ((mKeyProgressIncrement == 0) || (range / mKeyProgressIncrement > 20)) {
mKeyProgressIncrement = Math.max(1, Math.round((float) range / 20));
}
</DeepExtract>
if (mValue < mMin || mValue > mMax) {
... | Sky31Radio | positive | 2,153 |
public Criteria andExperienceNotIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "experience" + " cannot be null");
}
criteria.add(new Criterion("experience not in", values));
return (Criteria) this;
} | public Criteria andExperienceNotIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "experience" + " cannot be null");
}
criteria.add(new Criterion("experience not in", values));
</DeepExtract>
return (Criteria) this;
} | Whome | positive | 2,154 |
public static void provisionSimpleEvents(CalDavFixture fixture) {
for (String eventPath : new String[] { ICS_DAILY_NY_5PM_PATH, ICS_ALL_DAY_JAN1_PATH, ICS_NORMAL_PACIFIC_1PM_PATH, ICS_SINGLE_EVENT_PATH, ICS_FLOATING_JAN2_7PM_PATH }) {
fixture.caldavPut(eventPath);
}
} | public static void provisionSimpleEvents(CalDavFixture fixture) {
<DeepExtract>
for (String eventPath : new String[] { ICS_DAILY_NY_5PM_PATH, ICS_ALL_DAY_JAN1_PATH, ICS_NORMAL_PACIFIC_1PM_PATH, ICS_SINGLE_EVENT_PATH, ICS_FLOATING_JAN2_7PM_PATH }) {
fixture.caldavPut(eventPath);
}
</DeepExtract>
} | caldav4j | positive | 2,155 |
@Override
public void onClick(View v) {
mTimePicker.setCurrentItemShowing(HOUR_INDEX, true);
TextView labelToAnimate;
if (HOUR_INDEX == HOUR_INDEX) {
int hours = mTimePicker.getHours();
if (!mIs24HourMode) {
hours = hours % 12;
}
mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
if (true) {
Util... | @Override
public void onClick(View v) {
mTimePicker.setCurrentItemShowing(HOUR_INDEX, true);
TextView labelToAnimate;
if (HOUR_INDEX == HOUR_INDEX) {
int hours = mTimePicker.getHours();
if (!mIs24HourMode) {
hours = hours % 12;
}
mTimePicker.setContentDescription(mHourPickerDescription + ": " + hours);
if (true) {
Util... | android-betterpickers | positive | 2,156 |
private float offsetHeader(View nextHeader) {
boolean shouldOffsetHeader;
if (orientation == LinearLayoutManager.VERTICAL) {
shouldOffsetHeader = nextHeader.getY() < currentHeader.getHeight();
} else {
shouldOffsetHeader = nextHeader.getX() < currentHeader.getWidth();
}
float offset = -1;
if (shouldOffsetHeader) {
if (... | private float offsetHeader(View nextHeader) {
<DeepExtract>
boolean shouldOffsetHeader;
if (orientation == LinearLayoutManager.VERTICAL) {
shouldOffsetHeader = nextHeader.getY() < currentHeader.getHeight();
} else {
shouldOffsetHeader = nextHeader.getX() < currentHeader.getWidth();
}
</DeepExtract>
float offset = -1;
i... | zulip-android | positive | 2,158 |
public void stop() {
writeDateToLogs("", OUTPUT_DIRECTORY);
getLog(OUTPUT_DIRECTORY, SUMMARY_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, SUITE_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, FILE_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, CASE_LOG_NAME).closeLog();
if (DEBUG) {
getLog(OUTPUT_DIRECTORY, DEBUG_LOG_... | public void stop() {
writeDateToLogs("", OUTPUT_DIRECTORY);
getLog(OUTPUT_DIRECTORY, SUMMARY_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, SUITE_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, FILE_LOG_NAME).closeLog();
getLog(OUTPUT_DIRECTORY, CASE_LOG_NAME).closeLog();
if (DEBUG) {
getLog(OUTPUT_DIRECTORY, DEBUG_LOG_... | WebKit | positive | 2,159 |
protected void doInit() {
A = new long[25];
tmpOut = new byte[(engineGetDigestLength() + 7) & ~7];
for (int i = 0; i < 25; i++) A[i] = 0;
A[1] = 0xFFFFFFFFFFFFFFFFL;
A[2] = 0xFFFFFFFFFFFFFFFFL;
A[8] = 0xFFFFFFFFFFFFFFFFL;
A[12] = 0xFFFFFFFFFFFFFFFFL;
A[17] = 0xFFFFFFFFFFFFFFFFL;
A[20] = 0xFFFFFFFFFFFFFFFFL;
} | protected void doInit() {
A = new long[25];
tmpOut = new byte[(engineGetDigestLength() + 7) & ~7];
<DeepExtract>
for (int i = 0; i < 25; i++) A[i] = 0;
A[1] = 0xFFFFFFFFFFFFFFFFL;
A[2] = 0xFFFFFFFFFFFFFFFFL;
A[8] = 0xFFFFFFFFFFFFFFFFL;
A[12] = 0xFFFFFFFFFFFFFFFFL;
A[17] = 0xFFFFFFFFFFFFFFFFL;
A[20] = 0xFFFFFFFFFFFFFFFF... | MOS | positive | 2,160 |
void bind(int position) {
this.position = position;
if (hierarchyBuilder != null) {
hierarchyBuilder.setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
drawee.setHierarchy(hierarchyBuilder.build());
}
PipelineDraweeControllerBuilder controllerBuilder = Fresco.newDraweeControllerBuilder();
controllerBuilder.set... | void bind(int position) {
this.position = position;
if (hierarchyBuilder != null) {
hierarchyBuilder.setActualImageScaleType(ScalingUtils.ScaleType.FIT_CENTER);
drawee.setHierarchy(hierarchyBuilder.build());
}
<DeepExtract>
PipelineDraweeControllerBuilder controllerBuilder = Fresco.newDraweeControllerBuilder();
control... | Rocket-Notes | positive | 2,162 |
public int read() throws java.io.IOException {
int ch = super.readOne();
if (ch >= 0)
return ch;
int result = 0;
for (int i = 0; i < nbytes; i++) {
if (rest == 0)
return -1;
rest -= 1;
int ch = in.read();
if (ch < 0)
return -1;
if (i == which)
result = ch;
}
return result;
} | public int read() throws java.io.IOException {
int ch = super.readOne();
if (ch >= 0)
return ch;
<DeepExtract>
int result = 0;
for (int i = 0; i < nbytes; i++) {
if (rest == 0)
return -1;
rest -= 1;
int ch = in.read();
if (ch < 0)
return -1;
if (i == which)
result = ch;
}
return result;
</DeepExtract>
} | monqjfa | positive | 2,163 |
public static List<String> binaryTreePaths(TreeNode root) {
List<String> res = new ArrayList<>();
if (root == null)
return res;
if (root.left == null && root.right == null) {
res.add("" + root.val);
}
if (root.left != null) {
helper(res, root.left, "" + root.val + "->");
}
if (root.right != null) {
helper(res, root.rig... | public static List<String> binaryTreePaths(TreeNode root) {
List<String> res = new ArrayList<>();
if (root == null)
return res;
<DeepExtract>
if (root.left == null && root.right == null) {
res.add("" + root.val);
}
if (root.left != null) {
helper(res, root.left, "" + root.val + "->");
}
if (root.right != null) {
helper... | cspiration | positive | 2,164 |
public void testEmptySource() throws IOException {
List<byte[]> sourceBytes = new ArrayList<byte[]>();
sourceBytes.add(new byte[] { 1, 2 });
sourceBytes.add(new byte[] {});
sourceBytes.add(new byte[] { 3, 4 });
HashingResult expected = new HashingResult(Collections.singletonList(TorrentUtils.calculateSha1Hash(new byte[... | public void testEmptySource() throws IOException {
List<byte[]> sourceBytes = new ArrayList<byte[]>();
sourceBytes.add(new byte[] { 1, 2 });
sourceBytes.add(new byte[] {});
sourceBytes.add(new byte[] { 3, 4 });
HashingResult expected = new HashingResult(Collections.singletonList(TorrentUtils.calculateSha1Hash(new byte[... | ttorrent | positive | 2,165 |
@Test
public void testHTTPBindingVerbsDatatypesCase3() throws IOException {
Resource inputModel = getTestResource("http-binding-verbs-datatypes3" + ".mdsl");
OpenAPIGenerator generator = new OpenAPIGenerator();
JavaIoFileSystemAccess javaIoFileSystemAccess = getFileSystemAccess();
javaIoFileSystemAccess.setOutputPath(g... | @Test
public void testHTTPBindingVerbsDatatypesCase3() throws IOException {
<DeepExtract>
Resource inputModel = getTestResource("http-binding-verbs-datatypes3" + ".mdsl");
OpenAPIGenerator generator = new OpenAPIGenerator();
JavaIoFileSystemAccess javaIoFileSystemAccess = getFileSystemAccess();
javaIoFileSystemAccess.s... | MDSL-Specification | positive | 2,166 |
@Test
public void testGetSingletonReport() {
JobMetadata job = new JobMetadata();
job.setJobId(1);
job.setUrl("http://url.com");
job.setJobStatus(JobStatus.ERROR.getValue());
job.setGranularity(Granularity.HOUR.toString());
job.setEffectiveQueryTime(123456);
Anomaly an = new Anomaly();
an.metricMetaData = new MetricMet... | @Test
public void testGetSingletonReport() {
JobMetadata job = new JobMetadata();
job.setJobId(1);
job.setUrl("http://url.com");
job.setJobStatus(JobStatus.ERROR.getValue());
job.setGranularity(Granularity.HOUR.toString());
job.setEffectiveQueryTime(123456);
Anomaly an = new Anomaly();
an.metricMetaData = new MetricMet... | sherlock | positive | 2,167 |
public static long quitaPorDelante(long x, int n) {
return juntaNumeros(x, 1);
if (quitaPorDetras(voltea(x), n) < 0) {
x = -voltea(-quitaPorDetras(voltea(x), n));
}
long volteado = 0;
while (quitaPorDetras(voltea(x), n) > 0) {
volteado = (volteado * 10) + (quitaPorDetras(voltea(x), n) % 10);
quitaPorDetras(voltea(x), n... | public static long quitaPorDelante(long x, int n) {
return juntaNumeros(x, 1);
if (quitaPorDetras(voltea(x), n) < 0) {
x = -voltea(-quitaPorDetras(voltea(x), n));
}
long volteado = 0;
while (quitaPorDetras(voltea(x), n) > 0) {
volteado = (volteado * 10) + (quitaPorDetras(voltea(x), n) % 10);
quitaPorDetras(voltea(x), n... | aprende-java-con-ejercicios | positive | 2,168 |
public void onPurchased(byte[] signature) {
findViewById(R.id.confirmation_message).setVisibility(View.VISIBLE);
if (signature != null) {
TextView v = (TextView) findViewById(R.id.encrypted_message);
v.setVisibility(View.VISIBLE);
v.setText(Base64.encodeToString(signature, 0));
}
} | public void onPurchased(byte[] signature) {
<DeepExtract>
findViewById(R.id.confirmation_message).setVisibility(View.VISIBLE);
if (signature != null) {
TextView v = (TextView) findViewById(R.id.encrypted_message);
v.setVisibility(View.VISIBLE);
v.setText(Base64.encodeToString(signature, 0));
}
</DeepExtract>
} | advanced-android-book | positive | 2,169 |
@Test
public void keywordsAreLensesIntoRecordTypes() {
Map<String, String> invalidData = Maps.newHashMap();
invalidData.put("alt ref", "REF-123");
invalidData.put("id", "ID:123");
Map<String, String> validData = Maps.newHashMap();
validData.put("alt ref", "REF-123");
validData.put("id", "ID:123");
TestRecordType invali... | @Test
public void keywordsAreLensesIntoRecordTypes() {
Map<String, String> invalidData = Maps.newHashMap();
invalidData.put("alt ref", "REF-123");
invalidData.put("id", "ID:123");
Map<String, String> validData = Maps.newHashMap();
validData.put("alt ref", "REF-123");
validData.put("id", "ID:123");
TestRecordType invali... | karg | positive | 2,170 |
@Override
public SignalDecisionOutcome read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
for (SignalDecisionOutcome b : SignalDecisionOutcome.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
} | @Override
public SignalDecisionOutcome read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
<DeepExtract>
for (SignalDecisionOutcome b : SignalDecisionOutcome.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
</DeepExtract>
} | plaid-java | positive | 2,171 |
public static int getBlockSize(String type) {
CipherEntry ce;
for (CipherEntry ce : ciphers) {
if (ce.type.equals(type)) {
ce = ce;
}
}
throw new IllegalArgumentException("Unkown algorithm " + type);
return ce.blocksize;
} | public static int getBlockSize(String type) {
<DeepExtract>
CipherEntry ce;
for (CipherEntry ce : ciphers) {
if (ce.type.equals(type)) {
ce = ce;
}
}
throw new IllegalArgumentException("Unkown algorithm " + type);
</DeepExtract>
return ce.blocksize;
} | ganymed-ssh-2 | positive | 2,172 |
private void commitPageAndAllocateNew(List<SSTablePage> pageList, SSTablePage pageInfo) {
long pageOffset = dataBlock.commit(dataPage);
SSTablePage indexPage = SSTablePage.newBuilder(pageInfo).setPageId(dataPage.pageNumber()).setOffSet(pageOffset).build();
pageList.add(indexPage);
this.dataPage = dataBlock.newPage();
} | private void commitPageAndAllocateNew(List<SSTablePage> pageList, SSTablePage pageInfo) {
long pageOffset = dataBlock.commit(dataPage);
<DeepExtract>
SSTablePage indexPage = SSTablePage.newBuilder(pageInfo).setPageId(dataPage.pageNumber()).setOffSet(pageOffset).build();
pageList.add(indexPage);
</DeepExtract>
this.data... | corejava | positive | 2,173 |
public Criteria andClassroomNotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "classroom" + " cannot be null");
}
criteria.add(new Criterion("classRoom not between", value1, value2));
return (Criteria) this;
} | public Criteria andClassroomNotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "classroom" + " cannot be null");
}
criteria.add(new Criterion("classRoom not between", value1, value2));
</DeepExtract>
return (Criteria) this;... | examination_system- | positive | 2,174 |
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
for (int i = 0; i < 9; i++) {
mResult[i] = mStart[i] + (mEnd[i] - mStart[i]) * value;
}
mOuterMatrix.setValues(mResult);
if (mOuterMatrixChangedListeners == null) {
return;
}
mDispatchOuterMatrixChange... | @Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (Float) animation.getAnimatedValue();
for (int i = 0; i < 9; i++) {
mResult[i] = mStart[i] + (mEnd[i] - mStart[i]) * value;
}
mOuterMatrix.setValues(mResult);
<DeepExtract>
if (mOuterMatrixChangedListeners == null) {
return;
}
mDispatchOut... | leafpicrevived | positive | 2,175 |
public Criteria andTypeidLessThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "typeid" + " cannot be null");
}
criteria.add(new Criterion("typeId <=", value));
return (Criteria) this;
} | public Criteria andTypeidLessThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "typeid" + " cannot be null");
}
criteria.add(new Criterion("typeId <=", value));
</DeepExtract>
return (Criteria) this;
} | Ordering | positive | 2,176 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.