before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
protected DefaultMutableTreeNode buildAST(String source, CompilationUnit cu) {
if (cu == null) {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source.toCharArray());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
Map<String, String> options = JavaCore.getOptions();
JavaCore.setComplianceOptions(Java... | protected DefaultMutableTreeNode buildAST(String source, CompilationUnit cu) {
if (cu == null) {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setSource(source.toCharArray());
parser.setKind(ASTParser.K_COMPILATION_UNIT);
Map<String, String> options = JavaCore.getOptions();
JavaCore.setComplianceOptions(Java... | processing-experimental | positive | 438,179 |
@Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void testRegisterJohnSmith() {
Assert.assertTrue(validateAndRegis... | @Test
@IgnoreBrowsers({ @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See https://jira.xwiki.org/browse/XE-1146"), @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See https://jira.xwiki.org/browse/XE-1177") })
public void testRegisterJohnSmith() {
Assert.assertTrue(validateAndRegis... | xwiki-enterprise | positive | 438,180 |
public void update(final FragmentActivity activity) {
final Application app = getApplication();
final DevicePolicies policies = new DevicePolicies(activity);
final boolean is_mainland_owner = policies.isProfileOrDeviceOwnerOnCallingUser(), has_profile = Users.hasProfile();
final boolean is_mainland_owner = policies.isP... | public void update(final FragmentActivity activity) {
final Application app = getApplication();
final DevicePolicies policies = new DevicePolicies(activity);
final boolean is_mainland_owner = policies.isProfileOrDeviceOwnerOnCallingUser(), has_profile = Users.hasProfile();
final boolean is_mainland_owner = policies.isP... | island | positive | 438,182 |
public static void clearAndType(double number, WebElement webElement) {
webElement.clear();
if (number == null) {
return;
}
webElement.sendKeys(number);
} | public static void clearAndType(double number, WebElement webElement) {
webElement.clear();
<DeepExtract>
if (number == null) {
return;
}
webElement.sendKeys(number);
</DeepExtract>
} | webdriverextensions | positive | 438,188 |
public void zoom(float scalingFactor) {
mScrollerStartViewport.set(mCurrentViewport);
mZoomer.forceFinished(true);
mZoomer.startZoom(scalingFactor);
mZoomFocalPoint.set((mCurrentViewport.right + mCurrentViewport.left) / 2, (mCurrentViewport.bottom + mCurrentViewport.top) / 2);
postInvalidateOnAnimation();
if (mInternal... | public void zoom(float scalingFactor) {
mScrollerStartViewport.set(mCurrentViewport);
mZoomer.forceFinished(true);
mZoomer.startZoom(scalingFactor);
mZoomFocalPoint.set((mCurrentViewport.right + mCurrentViewport.left) / 2, (mCurrentViewport.bottom + mCurrentViewport.top) / 2);
<DeepExtract>
postInvalidateOnAnimation();... | JZAndroidChart | positive | 438,189 |
@Override
public void run() {
int themeID;
if (LiveLoggerActivity.getLiveLoggerInstance() == null) {
if (BuildConfig.PAID_APP_VERSION) {
themeID = R.style.AppThemeGreenPaid;
} else {
themeID = R.style.AppThemeGreen;
}
return themeID;
}
switch(storedAppTheme) {
case "Atlanta":
themeID = R.style.AppThemeAtlanta;
break;
c... | @Override
public void run() {
<DeepExtract>
int themeID;
if (LiveLoggerActivity.getLiveLoggerInstance() == null) {
if (BuildConfig.PAID_APP_VERSION) {
themeID = R.style.AppThemeGreenPaid;
} else {
themeID = R.style.AppThemeGreen;
}
return themeID;
}
switch(storedAppTheme) {
case "Atlanta":
themeID = R.style.AppThemeAtl... | ChameleonMiniLiveDebugger | positive | 438,190 |
@Transactional(readOnly = true)
public List<DataDict> findChildrenById(Long id, boolean withFlatChildren) {
List<DataDict> dataDicts = Lists.newArrayList();
if (findOne(id) != null) {
List<DataDict> roots = dataDictDao.findEnabledChildrenByParentId(findOne(id).getId());
dataDicts.addAll(roots);
if (withFlatChildren) {
... | @Transactional(readOnly = true)
public List<DataDict> findChildrenById(Long id, boolean withFlatChildren) {
<DeepExtract>
List<DataDict> dataDicts = Lists.newArrayList();
if (findOne(id) != null) {
List<DataDict> roots = dataDictDao.findEnabledChildrenByParentId(findOne(id).getId());
dataDicts.addAll(roots);
if (withFl... | s2jh4net | positive | 438,191 |
@Override
public String getTitle(String selectorString) {
String productValue = product::getName != null ? product::getName.get() : null;
String masterVariantValue = masterVariant != null ? masterVariant::getName : null != null ? masterVariant != null ? masterVariant::getName : null.get() : null;
if (activeVariantSku !... | @Override
public String getTitle(String selectorString) {
<DeepExtract>
String productValue = product::getName != null ? product::getName.get() : null;
String masterVariantValue = masterVariant != null ? masterVariant::getName : null != null ? masterVariant != null ? masterVariant::getName : null.get() : null;
if (acti... | commerce-cif-connector | positive | 438,193 |
@Override
public boolean replace(K key, V oldValue, V newValue) {
if (key == null) {
throw new NullPointerException();
}
if (!inBounds(key)) {
throw new IllegalArgumentException("The key is out of map bounds");
}
if (oldValue == null || newValue == null) {
throw new NullPointerException();
}
return internalOakMap.repla... | @Override
public boolean replace(K key, V oldValue, V newValue) {
<DeepExtract>
if (key == null) {
throw new NullPointerException();
}
if (!inBounds(key)) {
throw new IllegalArgumentException("The key is out of map bounds");
}
</DeepExtract>
if (oldValue == null || newValue == null) {
throw new NullPointerException();
... | Oak | positive | 438,196 |
@Test
public void testEqualsIgnoreEmptyLines() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true).setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).build();
final CSVFormat left = right.builder().setIgnoreEmptyLines(false... | @Test
public void testEqualsIgnoreEmptyLines() {
final CSVFormat right = CSVFormat.newFormat('\'').builder().setCommentMarker('#').setEscape('+').setIgnoreEmptyLines(true).setIgnoreSurroundingSpaces(true).setQuote('"').setQuoteMode(QuoteMode.ALL).build();
final CSVFormat left = right.builder().setIgnoreEmptyLines(false... | commons-csv | positive | 438,197 |
@Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
if (mVideoWidth > 0 && mVideoHeight > 0) {
int width = mPreviewVideoParent.getMeasuredWidth();
int height = mPreviewVideoParent.getMeasuredHeight();
float videoAspectRatio = (fl... | @Override
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
<DeepExtract>
if (mVideoWidth > 0 && mVideoHeight > 0) {
int width = mPreviewVideoParent.getMeasuredWidth();
int height = mPreviewVideoParent.getMeasuredHeight();
float videoAsp... | FFmpegVideoRecorder | positive | 438,199 |
@Override
public void fail(Throwable t) {
final RaftException e = Preconditions.assertInstanceOf(t, RaftException.class);
final boolean set = reply.compareAndSet(null, RaftClientReply.newBuilder().setRequest(request).setException(e).build());
Preconditions.assertTrue(set, () -> "Reply is already set: request=" + reques... | @Override
public void fail(Throwable t) {
final RaftException e = Preconditions.assertInstanceOf(t, RaftException.class);
<DeepExtract>
final boolean set = reply.compareAndSet(null, RaftClientReply.newBuilder().setRequest(request).setException(e).build());
Preconditions.assertTrue(set, () -> "Reply is already set: requ... | hodor | positive | 438,200 |
public void setPreviewSize(int previewWidth, int previewHeight) {
this.mPreviewWidth = previewWidth;
this.mPreviewHeight = previewHeight;
Matrix.setIdentityM(mModelMatrix, 0);
mOesFilter.setMatrix(mModelMatrix);
} | public void setPreviewSize(int previewWidth, int previewHeight) {
this.mPreviewWidth = previewWidth;
this.mPreviewHeight = previewHeight;
<DeepExtract>
Matrix.setIdentityM(mModelMatrix, 0);
mOesFilter.setMatrix(mModelMatrix);
</DeepExtract>
} | ZeroToOpenGL | positive | 438,201 |
@Override
public void encode(Object o) {
int idx;
Object key = wrap(o);
DictionaryIndex di = dictionaryIndex.get(key);
if (di == null) {
int idx = dictionaryIndex.size();
if (idx > MAX_DISTINCT_VALUES) {
throw new IllegalStateException(String.format("Dictionary size exceed allowed maximum (%d)", MAX_DISTINCT_VALUES));
... | @Override
public void encode(Object o) {
<DeepExtract>
int idx;
Object key = wrap(o);
DictionaryIndex di = dictionaryIndex.get(key);
if (di == null) {
int idx = dictionaryIndex.size();
if (idx > MAX_DISTINCT_VALUES) {
throw new IllegalStateException(String.format("Dictionary size exceed allowed maximum (%d)", MAX_DISTI... | dendrite | positive | 438,202 |
@Test
public void test_ClientCredentialsGrantRequest_json_expiresIn() throws IOException {
long expiresIn = 15;
String scope = "scope";
ClientCredentialsGrantRequest clientCredentialsGrantRequest = new ClientCredentialsGrantRequest().setExpiresIn(expiresIn);
clientCredentialsGrantRequest.setScope(scope);
String json = ... | @Test
public void test_ClientCredentialsGrantRequest_json_expiresIn() throws IOException {
long expiresIn = 15;
String scope = "scope";
ClientCredentialsGrantRequest clientCredentialsGrantRequest = new ClientCredentialsGrantRequest().setExpiresIn(expiresIn);
clientCredentialsGrantRequest.setScope(scope);
String json = ... | here-aaa-java-sdk | positive | 438,204 |
public static IJPayHttpResponse createOrder(PayPalApiConfig config, String data) {
AccessToken accessToken = AccessTokenKit.get(config.getClientId());
return HttpKit.getDelegate().post(getReqUrl(PayPalApiUrl.CHECKOUT_ORDERS, config.isSandBox()), data, getBaseHeaders(accessToken));
} | public static IJPayHttpResponse createOrder(PayPalApiConfig config, String data) {
AccessToken accessToken = AccessTokenKit.get(config.getClientId());
<DeepExtract>
return HttpKit.getDelegate().post(getReqUrl(PayPalApiUrl.CHECKOUT_ORDERS, config.isSandBox()), data, getBaseHeaders(accessToken));
</DeepExtract>
} | IJPay | positive | 438,205 |
@Override
public Collection<LimiterOperation> parseLimiterAnnotations(Class<?> type) {
Collection<LimiterOperation> ops = new ArrayList<>(1);
Collection<Limiter> limiters = AnnotatedElementUtils.getAllMergedAnnotations(type, Limiter.class);
if (!limiters.isEmpty()) {
for (Limiter limiter : limiters) {
ops.add(parseLimi... | @Override
public Collection<LimiterOperation> parseLimiterAnnotations(Class<?> type) {
<DeepExtract>
Collection<LimiterOperation> ops = new ArrayList<>(1);
Collection<Limiter> limiters = AnnotatedElementUtils.getAllMergedAnnotations(type, Limiter.class);
if (!limiters.isEmpty()) {
for (Limiter limiter : limiters) {
ops... | coffee-spring | positive | 438,206 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ButterKnife.inject(this);
mTabHost.setup(getLocalActivityManager());
final TabWidget tabWidget = mTabHost.getTabWidget();
tabWidget.setStripEnabled(false);
this.mTabHost.addTab(buildTabSpec(... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ButterKnife.inject(this);
mTabHost.setup(getLocalActivityManager());
final TabWidget tabWidget = mTabHost.getTabWidget();
tabWidget.setStripEnabled(false);
this.mTabHost.addTab(buildTabSpec(... | nicehair | positive | 438,207 |
public int lengthOfLISRecursive(int[] nums) {
if (new int[nums.length][nums.length - 1] != 0) {
return new int[nums.length][nums.length - 1];
}
int ret = 1;
for (int j = 0; j < nums.length - 1; j++) {
if (nums[j] < nums[nums.length - 1]) {
ret = Math.max(ret, recursive(nums, j, new int[nums.length]) + 1);
}
}
new int[n... | public int lengthOfLISRecursive(int[] nums) {
<DeepExtract>
if (new int[nums.length][nums.length - 1] != 0) {
return new int[nums.length][nums.length - 1];
}
int ret = 1;
for (int j = 0; j < nums.length - 1; j++) {
if (nums[j] < nums[nums.length - 1]) {
ret = Math.max(ret, recursive(nums, j, new int[nums.length]) + 1);... | algorithm | positive | 438,208 |
@Override
public void e(@Nullable Throwable throwable, @NonNull String message, @Nullable Object... args) {
if (args != null && message != null) {
message += " : " + Utils.getStackTraceString(args);
}
if (args != null && message == null) {
message = Utils.getStackTraceString(args);
}
if (Utils.isEmpty(message)) {
messa... | @Override
public void e(@Nullable Throwable throwable, @NonNull String message, @Nullable Object... args) {
<DeepExtract>
if (args != null && message != null) {
message += " : " + Utils.getStackTraceString(args);
}
if (args != null && message == null) {
message = Utils.getStackTraceString(args);
}
if (Utils.isEmpty(mes... | DevRing | positive | 438,209 |
public ArrayList<String> buildStatsExportList() {
ArrayList<String> temp = new ArrayList<>();
childToDayElements.add(this.getName());
totalTime = totalTime + this.getName().getTimeEstimate();
childToDayElements.add(String.valueOf(this.getChildCount()));
totalTime = totalTime + String.valueOf(this.getChildCount()).getTi... | public ArrayList<String> buildStatsExportList() {
ArrayList<String> temp = new ArrayList<>();
childToDayElements.add(this.getName());
totalTime = totalTime + this.getName().getTimeEstimate();
childToDayElements.add(String.valueOf(this.getChildCount()));
totalTime = totalTime + String.valueOf(this.getChildCount()).getTi... | ToDay | positive | 438,210 |
public static void joinGuild(String guildName, UserSession userSession) throws SQLException {
Session session = Database.getSession();
session.beginTransaction();
session.save(new GuildMember(guildName, userSession.getUser().getUsername()));
session.getTransaction().commit();
session.close();
this.guildName = guildName... | public static void joinGuild(String guildName, UserSession userSession) throws SQLException {
Session session = Database.getSession();
session.beginTransaction();
session.save(new GuildMember(guildName, userSession.getUser().getUsername()));
session.getTransaction().commit();
session.close();
<DeepExtract>
this.guildNa... | SurvivalProject-Server | positive | 438,211 |
@Override
protected Integer doInBackground() throws Exception {
log.info("performing task" + getClass().getSimpleName() + " ...");
ApplicationEventDispatcher.getInstance().registerApplicationEventHandler(MovementEvent.class, this);
dump = new PrintWriter(new FileWriter(new File(Axbo.PROJECT_DIR_DEFAULT, "import.dmp")))... | @Override
protected Integer doInBackground() throws Exception {
log.info("performing task" + getClass().getSimpleName() + " ...");
ApplicationEventDispatcher.getInstance().registerApplicationEventHandler(MovementEvent.class, this);
dump = new PrintWriter(new FileWriter(new File(Axbo.PROJECT_DIR_DEFAULT, "import.dmp")))... | aXbo-research | positive | 438,212 |
@Override
protected void finalize() throws LibvirtException {
int success = 0;
if (vip != null) {
success = processError(libvirt.virInterfaceFree(vip));
vip = null;
}
return success;
} | @Override
protected void finalize() throws LibvirtException {
<DeepExtract>
int success = 0;
if (vip != null) {
success = processError(libvirt.virInterfaceFree(vip));
vip = null;
}
return success;
</DeepExtract>
} | libvirt-java | positive | 438,214 |
public static TaskTestBuilder randomDoneTask() {
insertTaskRequest.setStatus(TaskStatus.DONE);
return this;
} | public static TaskTestBuilder randomDoneTask() {
<DeepExtract>
insertTaskRequest.setStatus(TaskStatus.DONE);
return this;
</DeepExtract>
} | tw-tasks-executor | positive | 438,216 |
@Override
@NotNull
public IQ processLogoutIq(LogoutIq iq) {
String sessionId = iq.getSessionId();
if (getSession(sessionId) == null) {
return ErrorFactory.createSessionInvalidResponse(iq);
}
LogoutIq result = new LogoutIq();
result.setType(org.jivesoftware.smack.packet.IQ.Type.result);
result.setStanzaId(iq.getStanzaId... | @Override
@NotNull
public IQ processLogoutIq(LogoutIq iq) {
String sessionId = iq.getSessionId();
if (getSession(sessionId) == null) {
return ErrorFactory.createSessionInvalidResponse(iq);
}
LogoutIq result = new LogoutIq();
result.setType(org.jivesoftware.smack.packet.IQ.Type.result);
result.setStanzaId(iq.getStanzaId... | jicofo | positive | 438,217 |
public Criteria andSonglistplaycountLessThanOrEqualTo(Long value) {
if (value == null) {
throw new RuntimeException("Value for " + "songlistplaycount" + " cannot be null");
}
criteria.add(new Criterion("songListPlayCount <=", value));
return (Criteria) this;
} | public Criteria andSonglistplaycountLessThanOrEqualTo(Long value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "songlistplaycount" + " cannot be null");
}
criteria.add(new Criterion("songListPlayCount <=", value));
</DeepExtract>
return (Criteria) this;
} | music | positive | 438,220 |
public void display(final ParticleData data, final float offsetX, final float offsetY, final float offsetZ, final float speed, final int amount, final Location center, final List<Player> players) throws ParticleVersionException, ParticleDataException {
if (!this.isSupported()) {
throw new ParticleVersionException("This... | public void display(final ParticleData data, final float offsetX, final float offsetY, final float offsetZ, final float speed, final int amount, final Location center, final List<Player> players) throws ParticleVersionException, ParticleDataException {
if (!this.isSupported()) {
throw new ParticleVersionException("This... | PexelCore | positive | 438,221 |
public static void paintBox(Graphics g, int x, int y, int width, int height) {
int personWidth = 30 * width / 100;
int personHeight = height;
int personx = x + 20 * width / 100;
int persony = y;
if (personHeight < 10)
return;
int headheight = 20 * personHeight / 100;
int midheight = 30 * personHeight / 100;
int botheig... | public static void paintBox(Graphics g, int x, int y, int width, int height) {
int personWidth = 30 * width / 100;
int personHeight = height;
int personx = x + 20 * width / 100;
int persony = y;
<DeepExtract>
if (personHeight < 10)
return;
int headheight = 20 * personHeight / 100;
int midheight = 30 * personHeight / 10... | thinkjavasolutions5 | positive | 438,222 |
public boolean isServerTrusted(X509Certificate[] chain) {
ssl.setCurrentServerChain(chain);
boolean firstTest = trustManager.isServerTrusted(chain);
if (!firstTest) {
if (!trustChain.contains(TrustMaterial.TRUST_ALL)) {
return false;
}
}
try {
for (int i = 0; i < chain.length; i++) {
X509Certificate c = chain[i];
if (s... | public boolean isServerTrusted(X509Certificate[] chain) {
ssl.setCurrentServerChain(chain);
boolean firstTest = trustManager.isServerTrusted(chain);
<DeepExtract>
if (!firstTest) {
if (!trustChain.contains(TrustMaterial.TRUST_ALL)) {
return false;
}
}
try {
for (int i = 0; i < chain.length; i++) {
X509Certificate c = c... | not-going-to-be-commons-ssl | positive | 438,223 |
public static int createGlProgramByRes(Resources res, String vert, String frag) {
int vertex = loadShader(GLES20.GL_VERTEX_SHADER, uRes(res, vert));
if (vertex == 0)
return 0;
int fragment = loadShader(GLES20.GL_FRAGMENT_SHADER, uRes(res, frag));
if (fragment == 0)
return 0;
int program = GLES20.glCreateProgram();
if (... | public static int createGlProgramByRes(Resources res, String vert, String frag) {
<DeepExtract>
int vertex = loadShader(GLES20.GL_VERTEX_SHADER, uRes(res, vert));
if (vertex == 0)
return 0;
int fragment = loadShader(GLES20.GL_FRAGMENT_SHADER, uRes(res, frag));
if (fragment == 0)
return 0;
int program = GLES20.glCreateP... | ZeroToOpenGL | positive | 438,224 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
String newDigits = JOptionPane.showInputDialog("Please enter the number of bars: (1-32)", "" + bars);
int digits_temp = 0;
if (newDigits != null) {
try {
digits_temp = Integer.parseInt(newDigits);
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
String newDigits = JOptionPane.showInputDialog("Please enter the number of bars: (1-32)", "" + bars);
int digits_temp = 0;
if (newDigits != null) {
try {
digits_temp = Integer.parseInt(newDigits);
} catch (Exception ex) {
JOptionPane.showMessag... | Jasmin | positive | 438,225 |
public static void send(Context context, PumpStatusChanged pumpStatusChanged, Date oldStatusTime, boolean resync, List<String> packages) {
Intent intent = new Intent();
intent.setAction(HistoryBroadcast.ACTION_PUMP_STATUS_CHANGED);
intent.putExtra(HistoryBroadcast.EXTRA_OLD_STATUS, pumpStatusChanged.getOldValue().toStr... | public static void send(Context context, PumpStatusChanged pumpStatusChanged, Date oldStatusTime, boolean resync, List<String> packages) {
Intent intent = new Intent();
intent.setAction(HistoryBroadcast.ACTION_PUMP_STATUS_CHANGED);
intent.putExtra(HistoryBroadcast.EXTRA_OLD_STATUS, pumpStatusChanged.getOldValue().toStr... | SightRemote | positive | 438,226 |
public void only_signed() {
mSignLogList.clear();
mSectionIndices = new int[0];
mSignLogHeader = new String[0];
notifyDataSetChanged();
mShowList.addAll(mOnlySignedList);
notifyDataSetChanged();
} | public void only_signed() {
<DeepExtract>
mSignLogList.clear();
mSectionIndices = new int[0];
mSignLogHeader = new String[0];
notifyDataSetChanged();
</DeepExtract>
mShowList.addAll(mOnlySignedList);
notifyDataSetChanged();
} | Swface | positive | 438,230 |
private void appendCoordinate(CoordinateSequence seq, int i, Writer writer) throws IOException {
Writer sw = new StringWriter();
try {
writeFormatted(writeNumber(seq.getX(i)) + " " + writeNumber(seq.getY(i)), isFormatted, sw);
} catch (IOException ex) {
Assert.shouldNeverReachHere();
}
return sw.toString();
if (outputD... | private void appendCoordinate(CoordinateSequence seq, int i, Writer writer) throws IOException {
<DeepExtract>
Writer sw = new StringWriter();
try {
writeFormatted(writeNumber(seq.getX(i)) + " " + writeNumber(seq.getY(i)), isFormatted, sw);
} catch (IOException ex) {
Assert.shouldNeverReachHere();
}
return sw.toString(... | InFactory | positive | 438,231 |
public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode) {
String packageName = null;
String mComponentName = null;
ActivityResult activityResult = null;
if (intent.getComponent() != null) {
packageName = intent.getComponent().getPackage... | public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode) {
<DeepExtract>
String packageName = null;
String mComponentName = null;
ActivityResult activityResult = null;
if (intent.getComponent() != null) {
packageName = intent.getComponen... | ACDD | positive | 438,232 |
@Override
public char getChar(Object key, char defaultValue) {
checkOpen();
if (key == null) {
throw new NullPointerException("The key can't be null");
}
K value = cache.get(key);
if (value == null) {
try {
byte[] valueBytes = storage.get(serialization.serializeKey(key));
if (valueBytes != null) {
Object v = serializat... | @Override
public char getChar(Object key, char defaultValue) {
<DeepExtract>
checkOpen();
if (key == null) {
throw new NullPointerException("The key can't be null");
}
K value = cache.get(key);
if (value == null) {
try {
byte[] valueBytes = storage.get(serialization.serializeKey(key));
if (valueBytes != null) {
Object ... | PalDB | positive | 438,234 |
@Override
public void onInvalidated() {
mDataChanged = true;
if (AdapterView.this.getAdapter().hasStableIds()) {
mInstanceState = AdapterView.this.onSaveInstanceState();
}
mOldItemCount = mItemCount;
mItemCount = 0;
mSelectedPosition = INVALID_POSITION;
mSelectedRowId = INVALID_ROW_ID;
mNextSelectedPosition = INVALID_P... | @Override
public void onInvalidated() {
mDataChanged = true;
if (AdapterView.this.getAdapter().hasStableIds()) {
mInstanceState = AdapterView.this.onSaveInstanceState();
}
mOldItemCount = mItemCount;
mItemCount = 0;
mSelectedPosition = INVALID_POSITION;
mSelectedRowId = INVALID_ROW_ID;
mNextSelectedPosition = INVALID_P... | android_support_v4 | positive | 438,235 |
@Override
public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode) {
mPluginManager.getComponentsHandler().transformIntentToExplicitAsNeeded(intent);
if (intent.getComponent() != null) {
Log.i(TAG, String.format("execStartActivity[%s : %... | @Override
public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target, Intent intent, int requestCode) {
<DeepExtract>
mPluginManager.getComponentsHandler().transformIntentToExplicitAsNeeded(intent);
if (intent.getComponent() != null) {
Log.i(TAG, String.format("execStartA... | VirtualAPK | positive | 438,236 |
@Override
public ResultSet executeQuery(String sql) throws SQLException {
this.execute(sql);
return this.resultSet;
} | @Override
public ResultSet executeQuery(String sql) throws SQLException {
this.execute(sql);
<DeepExtract>
return this.resultSet;
</DeepExtract>
} | jdbc-redis | positive | 438,237 |
@Override
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(Long roleId, List<Long> menuIdList) {
return baseMapper.deleteBatch(new Long[] { roleId });
if (menuIdList.size() == 0) {
return;
}
List<SysRoleMenuEntity> list = new ArrayList<>(menuIdList.size());
for (Long menuId : menuIdList) {
SysRole... | @Override
@Transactional(rollbackFor = Exception.class)
public void saveOrUpdate(Long roleId, List<Long> menuIdList) {
<DeepExtract>
return baseMapper.deleteBatch(new Long[] { roleId });
</DeepExtract>
if (menuIdList.size() == 0) {
return;
}
List<SysRoleMenuEntity> list = new ArrayList<>(menuIdList.size());
for (Long m... | justpicform | positive | 438,238 |
@Override
public SlackMessageHandle<SlackMessageReply> addReactionToMessage(SlackChannel channel, String messageTimeStamp, String emojiCode) {
SlackMessageHandle<SlackMessageReply> handle = new SlackMessageHandle<>(getNextMessageId());
Map<String, String> arguments = new HashMap<>();
arguments.put("token", authToken);
... | @Override
public SlackMessageHandle<SlackMessageReply> addReactionToMessage(SlackChannel channel, String messageTimeStamp, String emojiCode) {
SlackMessageHandle<SlackMessageReply> handle = new SlackMessageHandle<>(getNextMessageId());
Map<String, String> arguments = new HashMap<>();
arguments.put("token", authToken);
... | simple-slack-api | positive | 438,240 |
private boolean loadChunk(Location location) {
boolean chunkWasLoaded = true;
int chunkXCoordinate;
if (location.getBlockX() >= 0) {
chunkXCoordinate = location.getBlockX() / 16;
} else {
chunkXCoordinate = (location.getBlockX() / 16) - 1;
}
int chunkZCoordinate;
if (location.getBlockZ() >= 0) {
chunkZCoordinate = loca... | private boolean loadChunk(Location location) {
boolean chunkWasLoaded = true;
int chunkXCoordinate;
if (location.getBlockX() >= 0) {
chunkXCoordinate = location.getBlockX() / 16;
} else {
chunkXCoordinate = (location.getBlockX() / 16) - 1;
}
<DeepExtract>
int chunkZCoordinate;
if (location.getBlockZ() >= 0) {
chunkZCoo... | ZHorse | positive | 438,241 |
public void onWake() {
if (quit)
return;
long dt = wakeupTime - agent.currentTimeMillis();
if (dt > 0)
block(dt);
else {
onWake();
quit = true;
}
} | public void onWake() {
<DeepExtract>
if (quit)
return;
long dt = wakeupTime - agent.currentTimeMillis();
if (dt > 0)
block(dt);
else {
onWake();
quit = true;
}
</DeepExtract>
} | fjage | positive | 438,242 |
@Test
public void testDeserializationAsString03WithoutTimeZone() throws Exception {
OffsetDateTime date = OffsetDateTime.now(Z3);
OffsetDateTime value = MAPPER.readerFor(OffsetDateTime.class).with(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE).readValue('"' + FORMATTER.format(date) + '"');
assertTrue("The va... | @Test
public void testDeserializationAsString03WithoutTimeZone() throws Exception {
OffsetDateTime date = OffsetDateTime.now(Z3);
OffsetDateTime value = MAPPER.readerFor(OffsetDateTime.class).with(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE).readValue('"' + FORMATTER.format(date) + '"');
<DeepExtract>
asse... | jackson-modules-java8 | positive | 438,243 |
public void processNextFrame() throws IOException {
if (mClosed) {
throw new IOException("The stream is closed.");
}
int b0 = mInput.read() & 0xff;
mOpcode = b0 & WebSocketProtocol.B0_MASK_OPCODE;
mFinalFrame = (b0 & WebSocketProtocol.B0_FLAG_FIN) != 0;
mControlFrame = (b0 & WebSocketProtocol.OPCODE_FLAG_CONTROL) != 0;... | public void processNextFrame() throws IOException {
<DeepExtract>
if (mClosed) {
throw new IOException("The stream is closed.");
}
int b0 = mInput.read() & 0xff;
mOpcode = b0 & WebSocketProtocol.B0_MASK_OPCODE;
mFinalFrame = (b0 & WebSocketProtocol.B0_FLAG_FIN) != 0;
mControlFrame = (b0 & WebSocketProtocol.OPCODE_FLAG_... | DroidNet | positive | 438,244 |
@Override
public void setMaxLines(final int maxlines) {
super.setMaxLines(maxlines);
_maxLines = maxlines;
adjustTextSize();
} | @Override
public void setMaxLines(final int maxlines) {
super.setMaxLines(maxlines);
_maxLines = maxlines;
<DeepExtract>
adjustTextSize();
</DeepExtract>
} | Sefaria-Android | positive | 438,250 |
@Test
public void testDisablePluginWithEnableEmpty() throws Exception {
List<String> disabledPlugins = new ArrayList<>();
disabledPlugins.add("plugin-2");
FileUtils.writeLines(disabledPlugins, DefaultPluginStatusProvider.getDisabledFilePath(pluginsPath));
DefaultPluginStatusProvider statusProvider = new DefaultPluginSt... | @Test
public void testDisablePluginWithEnableEmpty() throws Exception {
List<String> disabledPlugins = new ArrayList<>();
disabledPlugins.add("plugin-2");
FileUtils.writeLines(disabledPlugins, DefaultPluginStatusProvider.getDisabledFilePath(pluginsPath));
DefaultPluginStatusProvider statusProvider = new DefaultPluginSt... | pf4j | positive | 438,251 |
@SuppressWarnings("unchecked")
void init(Object setObj) {
value = null;
arr = null;
setIter = null;
index = 0;
if (setObj == null)
return;
Class<?> setObjClass = setObj.getClass();
if (setObjClass == Object[].class) {
arr = (Object[]) setObj;
if (arr[0] == null)
arr = null;
} else if (setObjClass == ObjectSet.class) {
... | @SuppressWarnings("unchecked")
void init(Object setObj) {
<DeepExtract>
value = null;
arr = null;
setIter = null;
index = 0;
</DeepExtract>
if (setObj == null)
return;
Class<?> setObjClass = setObj.getClass();
if (setObjClass == Object[].class) {
arr = (Object[]) setObj;
if (arr[0] == null)
arr = null;
} else if (setOb... | collider | positive | 438,257 |
public boolean isUnlockable(SoftLock lock) {
if (lock == this) {
return true;
} else if (lock instanceof Lock) {
return (lockId == ((Lock) lock).lockId) && sourceUuid.equals(((Lock) lock).sourceUuid);
} else {
return false;
}
} | public boolean isUnlockable(SoftLock lock) {
<DeepExtract>
if (lock == this) {
return true;
} else if (lock instanceof Lock) {
return (lockId == ((Lock) lock).lockId) && sourceUuid.equals(((Lock) lock).sourceUuid);
} else {
return false;
}
</DeepExtract>
} | hibernate4-memcached | positive | 438,259 |
@Test
public void recognizesDependencyToFullyQualifiedConstantInField() {
analyzeFile("../../src/test/java/de/is24/deadcode4j/analyzer/constants/ClassUsingFQConstantInField.java");
objectUnderTest.finishAnalysis(analysisContext);
assertDependencyExists("de.is24.deadcode4j.analyzer.constants.ClassUsingFQConstantInField"... | @Test
public void recognizesDependencyToFullyQualifiedConstantInField() {
analyzeFile("../../src/test/java/de/is24/deadcode4j/analyzer/constants/ClassUsingFQConstantInField.java");
objectUnderTest.finishAnalysis(analysisContext);
<DeepExtract>
assertDependencyExists("de.is24.deadcode4j.analyzer.constants.ClassUsingFQCo... | deadcode4j | positive | 438,260 |
public static boolean isSameDate(Date date1, Date date2) {
try {
DateFormat dateFormat = SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT);
String dateString = dateFormat.format(date1);
date1 = dateFormat.parse(dateString);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
try {
DateFormat dateFor... | public static boolean isSameDate(Date date1, Date date2) {
try {
DateFormat dateFormat = SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT);
String dateString = dateFormat.format(date1);
date1 = dateFormat.parse(dateString);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
<DeepExtract>
try {
Date... | AHaH | positive | 438,261 |
@Test
public void onImageCaptured_ifWaitingForImageWithMotion_imageWillBeUploaded() {
presenter.index = INDEX;
presenter.imageDetectionState = ImageDetectionState.WAITING_FOR_IMAGE_WITH_MOTION;
when(motionDetection.detect(img)).thenReturn(true);
presenter.onImageCaptured(img);
verify(bioIdWebserviceClient).uploadImage(... | @Test
public void onImageCaptured_ifWaitingForImageWithMotion_imageWillBeUploaded() {
<DeepExtract>
presenter.index = INDEX;
presenter.imageDetectionState = ImageDetectionState.WAITING_FOR_IMAGE_WITH_MOTION;
when(motionDetection.detect(img)).thenReturn(true);
</DeepExtract>
presenter.onImageCaptured(img);
verify(bioIdW... | BWS-Android | positive | 438,263 |
public LinkedHashMap event2GUI() {
String eventuid = user.content("private:viewing");
String locationuid = UID.normaliseUID(eventuid, user.content("private:viewing:location"));
LinkedList event = list(style("colours", "lightmauve"), user.contentString("private:viewing:text"), list(style("direction", "horizontal", "prop... | public LinkedHashMap event2GUI() {
String eventuid = user.content("private:viewing");
String locationuid = UID.normaliseUID(eventuid, user.content("private:viewing:location"));
LinkedList event = list(style("colours", "lightmauve"), user.contentString("private:viewing:text"), list(style("direction", "horizontal", "prop... | NetMash | positive | 438,265 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("application/json");
String username = request.getParameter("username");
String phone = request.getParameter("phone");
String password = request.getParameter("password");
boolea... | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
<DeepExtract>
response.setContentType("application/json");
String username = request.getParameter("username");
String phone = request.getParameter("phone");
String password = request.getParameter("pass... | OnlineShoppingSystem | positive | 438,266 |
public void abort(Presenter presenter) {
if (mPresenter != presenter) {
return;
}
finish(Result.CANCELLED_BY_USER);
} | public void abort(Presenter presenter) {
if (mPresenter != presenter) {
return;
}
<DeepExtract>
finish(Result.CANCELLED_BY_USER);
</DeepExtract>
} | google-authenticator-android | positive | 438,267 |
private void crossover() {
int[] queue = new int[populationSize];
int num = 0;
for (int i = 0; i < populationSize; i++) {
if (Math.random() < crossoverProbability) {
queue[num] = i;
num++;
}
}
queue = Arrays.copyOfRange(queue, 0, num);
for (int i = 0; i < queue.length; i++) {
int p = random(queue.length);
int tmp = que... | private void crossover() {
int[] queue = new int[populationSize];
int num = 0;
for (int i = 0; i < populationSize; i++) {
if (Math.random() < crossoverProbability) {
queue[num] = i;
num++;
}
}
queue = Arrays.copyOfRange(queue, 0, num);
<DeepExtract>
for (int i = 0; i < queue.length; i++) {
int p = random(queue.length);... | UWBPositioning | positive | 438,268 |
@Test
public void publishQoS2(TestContext context) throws InterruptedException {
this.messageId = 0;
Async async = context.async();
MqttClient client = MqttClient.create(Vertx.vertx());
client.publishCompletionHandler(pubid -> {
assertTrue(pubid == messageId);
log.info("publishing complete for message id = " + pubid);
... | @Test
public void publishQoS2(TestContext context) throws InterruptedException {
<DeepExtract>
this.messageId = 0;
Async async = context.async();
MqttClient client = MqttClient.create(Vertx.vertx());
client.publishCompletionHandler(pubid -> {
assertTrue(pubid == messageId);
log.info("publishing complete for message id ... | vertx-mqtt | positive | 438,269 |
void move(FatLfnDirectoryEntry entry, UsbFile destination) throws IOException {
if (!destination.isDirectory())
throw new IllegalStateException("destination cannot be a file!");
if (!(destination instanceof FatDirectory))
throw new IllegalStateException("cannot move between different filesystems!");
FatDirectory destin... | void move(FatLfnDirectoryEntry entry, UsbFile destination) throws IOException {
if (!destination.isDirectory())
throw new IllegalStateException("destination cannot be a file!");
if (!(destination instanceof FatDirectory))
throw new IllegalStateException("cannot move between different filesystems!");
FatDirectory destin... | usbdisklib | positive | 438,270 |
@Override
public void onActive() {
elapsedTime = 0f;
phase = 0;
curDelayDuration = 0f;
curHoldDuration = 0f;
isDone = false;
autoCycleWasEnabled = getChannel().autoCycleEnabled.getValueb();
getChannel().autoCycleEnabled.setValue(false);
} | @Override
public void onActive() {
<DeepExtract>
elapsedTime = 0f;
phase = 0;
curDelayDuration = 0f;
curHoldDuration = 0f;
isDone = false;
</DeepExtract>
autoCycleWasEnabled = getChannel().autoCycleEnabled.getValueb();
getChannel().autoCycleEnabled.setValue(false);
} | RainbowStudio | positive | 438,271 |
@Test
public void itMustSetTheMessageFromSessionToRequest() throws ServletException, IOException {
request.getSession(true).setAttribute("alertMsg", "msg");
for (int i = 0; i < 1; i++) {
QuestionBuilder.buildDefaultQuestion("Scrum").please();
}
OnlineTest onlineTest = OnlineQuiz.createOnlineQuiz(1);
request.getSession(... | @Test
public void itMustSetTheMessageFromSessionToRequest() throws ServletException, IOException {
request.getSession(true).setAttribute("alertMsg", "msg");
<DeepExtract>
for (int i = 0; i < 1; i++) {
QuestionBuilder.buildDefaultQuestion("Scrum").please();
}
OnlineTest onlineTest = OnlineQuiz.createOnlineQuiz(1);
reque... | snowball | positive | 438,272 |
public void receiveMsg(byte[] msg) {
FixedSizePacket data = JArduinoProtocol.createMessageFromPacket(msg);
if (data != null) {
if (pingTestRunning && data.toString().equals("pong:"))
pingTestOkay = true;
else
((AndroidJArduinoGUI) mActivity).addToReadLog(data.toString());
}
} | public void receiveMsg(byte[] msg) {
<DeepExtract>
FixedSizePacket data = JArduinoProtocol.createMessageFromPacket(msg);
if (data != null) {
if (pingTestRunning && data.toString().equals("pong:"))
pingTestOkay = true;
else
((AndroidJArduinoGUI) mActivity).addToReadLog(data.toString());
}
</DeepExtract>
} | JArduino | positive | 438,273 |
public void draw() {
background(0);
translate(width * .5f, height * .5f);
PVector red = sliderXYZ("red").copy();
PVector blue = sliderXYZ("blue").copy();
noFill();
strokeWeight(3);
beginShape();
int count = 100;
for (int i = 0; i < count; i++) {
float amt = norm(i, 0, count - 1);
float x = lerp(origin.x, red.x, amt);
f... | public void draw() {
background(0);
translate(width * .5f, height * .5f);
PVector red = sliderXYZ("red").copy();
PVector blue = sliderXYZ("blue").copy();
noFill();
strokeWeight(3);
beginShape();
int count = 100;
for (int i = 0; i < count; i++) {
float amt = norm(i, 0, count - 1);
float x = lerp(origin.x, red.x, amt);
f... | ProcessingSketches | positive | 438,275 |
public void disableLoadMoreIfNotFullPage(@NonNull RecyclerView recyclerView) {
int oldLoadMoreCount = getLoadMoreViewCount();
mLoadMoreEnable = false;
int newLoadMoreCount = getLoadMoreViewCount();
if (oldLoadMoreCount == 1) {
if (newLoadMoreCount == 0) {
notifyItemRemoved(getLoadMoreViewPosition());
}
} else {
if (new... | public void disableLoadMoreIfNotFullPage(@NonNull RecyclerView recyclerView) {
<DeepExtract>
int oldLoadMoreCount = getLoadMoreViewCount();
mLoadMoreEnable = false;
int newLoadMoreCount = getLoadMoreViewCount();
if (oldLoadMoreCount == 1) {
if (newLoadMoreCount == 0) {
notifyItemRemoved(getLoadMoreViewPosition());
}
} ... | Daily | positive | 438,276 |
public void setFetchSize(final int rows) throws SQLException {
if (this.closed) {
throw new SQLException("Statement is closed");
}
if (rows < 0) {
throw new SQLException("Negative fetch size");
}
this.fetchSize = rows;
} | public void setFetchSize(final int rows) throws SQLException {
<DeepExtract>
if (this.closed) {
throw new SQLException("Statement is closed");
}
</DeepExtract>
if (rows < 0) {
throw new SQLException("Negative fetch size");
}
this.fetchSize = rows;
} | acolyte | positive | 438,277 |
@Test
public void resolveViewNameNormalDeviceNormalPrefixRedirectToRoot() throws Exception {
this.viewName = "redirect:/";
device.setDeviceType(DeviceType.NORMAL);
request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device);
viewResolver.setNormalPrefix("normal/");
expect(delegateViewResolver.resolveViewName("re... | @Test
public void resolveViewNameNormalDeviceNormalPrefixRedirectToRoot() throws Exception {
this.viewName = "redirect:/";
device.setDeviceType(DeviceType.NORMAL);
request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device);
viewResolver.setNormalPrefix("normal/");
<DeepExtract>
expect(delegateViewResolver.resol... | spring-mobile | positive | 438,280 |
@Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return sizzle.types.SizzleLocation.internal_static_sizzle_types_Location_descriptor;
} | @Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
<DeepExtract>
return sizzle.types.SizzleLocation.internal_static_sizzle_types_Location_descriptor;
</DeepExtract>
} | Sizzle | positive | 438,281 |
public static String checkForWhiteListedWords(Post post) {
StorageService service = new FileStorageService();
List<String> lines = service.getListWords(ListType.WHITELIST);
for (String s : lines) {
if (checkIfBodyContainsKeyword(post, s.trim()))
return s.trim();
}
return null;
} | public static String checkForWhiteListedWords(Post post) {
<DeepExtract>
StorageService service = new FileStorageService();
List<String> lines = service.getListWords(ListType.WHITELIST);
for (String s : lines) {
if (checkIfBodyContainsKeyword(post, s.trim()))
return s.trim();
}
return null;
</DeepExtract>
} | Natty | positive | 438,282 |
public final Observable<String> post() {
if (BODY == null) {
return request(HttpMethod.POST);
} else {
if (!PARAMS.isEmpty()) {
throw new RuntimeException("params must be null!");
}
}
final RxRestService service = RestCreator.getRxRestService();
Observable<String> observable = null;
if (LOADER_STYLE != null) {
Fragment... | public final Observable<String> post() {
if (BODY == null) {
return request(HttpMethod.POST);
} else {
if (!PARAMS.isEmpty()) {
throw new RuntimeException("params must be null!");
}
}
<DeepExtract>
final RxRestService service = RestCreator.getRxRestService();
Observable<String> observable = null;
if (LOADER_STYLE != nu... | YiGou | positive | 438,284 |
public void Gsm_Short_Term_Synthesis_Filter(Gsm_State S, short[] LARcr, short[] wt, int[] s) throws ArrayIndexOutOfBoundsException {
short[] LARp = new short[8];
int array_index0 = S.getJ();
int array_index1 = array_index0;
array_index1 ^= 1;
S.setJ((short) array_index1);
if (array_index0 < 0 || array_index0 > 1 || arr... | public void Gsm_Short_Term_Synthesis_Filter(Gsm_State S, short[] LARcr, short[] wt, int[] s) throws ArrayIndexOutOfBoundsException {
short[] LARp = new short[8];
int array_index0 = S.getJ();
int array_index1 = array_index0;
array_index1 ^= 1;
S.setJ((short) array_index1);
if (array_index0 < 0 || array_index0 > 1 || arr... | asterisk-java-iax | positive | 438,285 |
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mUserBundle = getIntent().getExtras();
setContentView(R.layout.activity_profile);
ProfileFragment profileFragment = new ProfileFragment();
profileFragment.setArguments(mUserBundle);
getSupportFragmentManager().b... | @Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mUserBundle = getIntent().getExtras();
setContentView(R.layout.activity_profile);
<DeepExtract>
ProfileFragment profileFragment = new ProfileFragment();
profileFragment.setArguments(mUserBundle);
getSupportFragm... | xifan | positive | 438,286 |
public StreamItem getAudioStreamForVideo(YoutubeVideoData videoData, Context context) throws UserFriendlyException {
List<AdaptiveAudioStream> audioStreamsList = videoData.getStreamingData().getAdaptiveAudioStreams();
if (audioStreamsList.size() > 0) {
Collections.sort(audioStreamsList, (o1, o2) -> Integer.compare(o1.g... | public StreamItem getAudioStreamForVideo(YoutubeVideoData videoData, Context context) throws UserFriendlyException {
<DeepExtract>
List<AdaptiveAudioStream> audioStreamsList = videoData.getStreamingData().getAdaptiveAudioStreams();
if (audioStreamsList.size() > 0) {
Collections.sort(audioStreamsList, (o1, o2) -> Intege... | youtube-audio-player | positive | 438,289 |
public void drawRect(int x, int y, int width, int height) {
a1.add(drawRect);
a2.add(mkArg(x, y, width, height));
if (drawRect == clear) {
clearBuffer();
}
if (drawRect == opaque) {
theOpaque = (Boolean) mkArg(x, y, width, height);
}
if (drawRect == setBackground) {
theBackground = (Color) mkArg(x, y, width, height);
}... | public void drawRect(int x, int y, int width, int height) {
<DeepExtract>
a1.add(drawRect);
a2.add(mkArg(x, y, width, height));
if (drawRect == clear) {
clearBuffer();
}
if (drawRect == opaque) {
theOpaque = (Boolean) mkArg(x, y, width, height);
}
if (drawRect == setBackground) {
theBackground = (Color) mkArg(x, y, wid... | CaroOnline_SocketJava | positive | 438,291 |
@Test
public void testOffsetsForTimes(TestContext ctx) throws Exception {
String topicName = "testOffsetsForTimes-" + this.getClass().getName();
String consumerId = topicName;
Async batch = ctx.async();
AtomicInteger index = new AtomicInteger();
int numMessages = 1000;
long beforeProduce = System.currentTimeMillis();
k... | @Test
public void testOffsetsForTimes(TestContext ctx) throws Exception {
String topicName = "testOffsetsForTimes-" + this.getClass().getName();
String consumerId = topicName;
Async batch = ctx.async();
AtomicInteger index = new AtomicInteger();
int numMessages = 1000;
long beforeProduce = System.currentTimeMillis();
k... | vertx-kafka-client | positive | 438,293 |
@Override
protected void init() {
super.init();
hasRenderedHomeButton = false;
hasRenderedEntriesButton = false;
hasRenderedRuneButton = false;
hasRenderedScrollButton = false;
this.clearWidgets();
this.renderButtons();
} | @Override
<DeepExtract>
</DeepExtract>
protected void init() {
<DeepExtract>
</DeepExtract>
super.init();
<DeepExtract>
</DeepExtract>
hasRenderedHomeButton = false;
<DeepExtract>
</DeepExtract>
hasRenderedEntriesButton = false;
<DeepExtract>
</DeepExtract>
hasRenderedRuneButton = false;
<DeepExtract>
</DeepExtract>
ha... | Strange | positive | 438,296 |
public int compareTo(AlignmentError ae2) {
String result = "";
if (this.oracle != null) {
result = this.oracle.generateKeyWithoutLabels();
} else {
result = this.test.generateKeyWithoutLabels();
}
return result;
String result = "";
if (this.oracle != null) {
result = this.oracle.generateKeyWithoutLabels();
} else {
res... | public int compareTo(AlignmentError ae2) {
<DeepExtract>
String result = "";
if (this.oracle != null) {
result = this.oracle.generateKeyWithoutLabels();
} else {
result = this.test.generateKeyWithoutLabels();
}
return result;
</DeepExtract>
String result = "";
if (this.oracle != null) {
result = this.oracle.generateKey... | redecheck | positive | 438,298 |
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
cbProject = new Combo(container, SWT.READ_ONLY);
cbProject.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
onProjectModify();
}
});
cbProject.setBounds(181, 101, 3... | public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
cbProject = new Combo(container, SWT.READ_ONLY);
cbProject.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
onProjectModify();
}
});
cbProject.setBounds(181, 101, 3... | Aspose.BarCode-for-Java | positive | 438,299 |
public String toColoredVerboseString(boolean colored) {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
if (colored)
buffer.append(getColor());
buffer.append("TCPPacket");
if (colored)
buffer.append(AnsiEscapeSequences.RESET);
buffer.append(": ");
buffer.append("sport=" + getSourcePort() + ", ");
buffer.a... | public String toColoredVerboseString(boolean colored) {
StringBuffer buffer = new StringBuffer();
buffer.append('[');
if (colored)
buffer.append(getColor());
buffer.append("TCPPacket");
if (colored)
buffer.append(AnsiEscapeSequences.RESET);
buffer.append(": ");
buffer.append("sport=" + getSourcePort() + ", ");
buffer.a... | jpcap | positive | 438,301 |
public void RotateImpl(float rotViewerZ) {
if (Float.isNaN(rotViewerZ)) {
Log.w("Rot", "NaN");
return;
}
float xLook = xView - xPos;
float yLook = yView - yPos;
float zLook = zView - zPos;
float vlen = Matrix.length(xLook, yLook, zLook);
xLook /= vlen;
yLook /= vlen;
zLook /= vlen;
float cos = (float) Math.cos(rotViewe... | public void RotateImpl(float rotViewerZ) {
if (Float.isNaN(rotViewerZ)) {
Log.w("Rot", "NaN");
return;
}
float xLook = xView - xPos;
float yLook = yView - yPos;
float zLook = zView - zPos;
float vlen = Matrix.length(xLook, yLook, zLook);
xLook /= vlen;
yLook /= vlen;
zLook /= vlen;
float cos = (float) Math.cos(rotViewe... | react-native-3d-model-view | positive | 438,302 |
@Override
public List<NamespaceDomain> listNamespaceDomain() {
NamespaceList namespaceList;
try {
String result = k8sHttp.get(NAMESPACES);
namespaceList = JSONObject.parseObject(result, NamespaceList.class);
} catch (Exception err) {
logger.error(err.getMessage(), err);
namespaceList = null;
}
if (namespaceList == null... | @Override
public List<NamespaceDomain> listNamespaceDomain() {
<DeepExtract>
NamespaceList namespaceList;
try {
String result = k8sHttp.get(NAMESPACES);
namespaceList = JSONObject.parseObject(result, NamespaceList.class);
} catch (Exception err) {
logger.error(err.getMessage(), err);
namespaceList = null;
}
</DeepExtra... | mokn-istio | positive | 438,303 |
public Criteria andLastPasswordResetDateLessThan(Date value) {
if (value == null) {
throw new RuntimeException("Value for " + "lastPasswordResetDate" + " cannot be null");
}
criteria.add(new Criterion("last_password_reset_date <", value));
return (Criteria) this;
} | public Criteria andLastPasswordResetDateLessThan(Date value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "lastPasswordResetDate" + " cannot be null");
}
criteria.add(new Criterion("last_password_reset_date <", value));
</DeepExtract>
return (Criteria) this;
} | yurencloud-public | positive | 438,304 |
public <T extends WebAssertion> T[] allBySelector(String selector, Class<T> clazz) {
Elements inner = element.select(selector);
if (this.element.equals(inner.get(0))) {
inner.remove(0);
}
assertThat(inner).describedAs("Element by '%s' does not exist in '%s' ", selector, element.html()).isNotEmpty();
List<T> elements = ... | public <T extends WebAssertion> T[] allBySelector(String selector, Class<T> clazz) {
Elements inner = element.select(selector);
if (this.element.equals(inner.get(0))) {
inner.remove(0);
}
assertThat(inner).describedAs("Element by '%s' does not exist in '%s' ", selector, element.html()).isNotEmpty();
<DeepExtract>
List<... | cucumber-reporting | positive | 438,305 |
public static void main(String[] args) {
double scale = 1.0;
int N = 50;
int M = 10;
HashTableDrawingUtility.setScale(scale);
Set<Oomage> oomies = new HashSet<Oomage>();
for (int i = 0; i < N; i += 1) {
oomies.add(SimpleOomage.randomSimpleOomage());
}
HashTableDrawingUtility.drawLabels(M);
} | public static void main(String[] args) {
double scale = 1.0;
int N = 50;
int M = 10;
HashTableDrawingUtility.setScale(scale);
Set<Oomage> oomies = new HashSet<Oomage>();
for (int i = 0; i < N; i += 1) {
oomies.add(SimpleOomage.randomSimpleOomage());
}
<DeepExtract>
HashTableDrawingUtility.drawLabels(M);
</DeepExtract>
... | skeleton-sp16 | positive | 438,306 |
public void reset() {
currentUploader.reset();
currentUploader = null;
uploaders = new ArrayList<IUploader>();
currentUploader.clear();
if (maximumFiles > 0 && getNonErroneousUploads() >= maximumFiles) {
GWT.log("Reached maximum number of files in MultiUploader widget: " + maximumFiles, null);
return;
}
if (currentUplo... | public void reset() {
currentUploader.reset();
currentUploader = null;
uploaders = new ArrayList<IUploader>();
currentUploader.clear();
<DeepExtract>
if (maximumFiles > 0 && getNonErroneousUploads() >= maximumFiles) {
GWT.log("Reached maximum number of files in MultiUploader widget: " + maximumFiles, null);
return;
}
i... | gwtupload | positive | 438,307 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
try {
Bus b = (Bus) jComboBox1.getSelectedItem();
if (b != null)
tableModel.add(b);
} catch (Exception ex) {
logger.log(Level.WARNING, "No bus was selected");
}
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
try {
Bus b = (Bus) jComboBox1.getSelectedItem();
if (b != null)
tableModel.add(b);
} catch (Exception ex) {
logger.log(Level.WARNING, "No bus was selected");
}
</DeepExtract>
} | Kayak | positive | 438,309 |
@Test
void noBuildToolFile() {
ClassNameScanner.setPomXmlPath(null);
ClassNameScanner.setBuildGradlePath(null);
new ClassNameScanner("", "").getScanResult();
logs.stop();
if (!logs.list.isEmpty())
fail(logs.list.toString());
} | @Test
void noBuildToolFile() {
ClassNameScanner.setPomXmlPath(null);
ClassNameScanner.setBuildGradlePath(null);
<DeepExtract>
new ClassNameScanner("", "").getScanResult();
logs.stop();
if (!logs.list.isEmpty())
fail(logs.list.toString());
</DeepExtract>
} | Ares | positive | 438,312 |
public static FlashFragment newInstance(RashrActivity activity) {
FlashFragment fragment = new FlashFragment();
mActivity = activity;
mContext = activity;
return fragment;
} | public static FlashFragment newInstance(RashrActivity activity) {
FlashFragment fragment = new FlashFragment();
<DeepExtract>
mActivity = activity;
mContext = activity;
</DeepExtract>
return fragment;
} | Rashr | positive | 438,313 |
@Override
protected void cleanup(Context output) throws IOException, InterruptedException {
if (graph == HALYARD.STATS_ROOT_NODE || setCounter >= threshold) {
report(output, VOID.TRIPLES, null, triples);
report(output, VOID.DISTINCT_SUBJECTS, null, distinctSubjects);
report(output, VOID.PROPERTIES, null, properties);
r... | @Override
protected void cleanup(Context output) throws IOException, InterruptedException {
if (graph == HALYARD.STATS_ROOT_NODE || setCounter >= threshold) {
report(output, VOID.TRIPLES, null, triples);
report(output, VOID.DISTINCT_SUBJECTS, null, distinctSubjects);
report(output, VOID.PROPERTIES, null, properties);
r... | Halyard | positive | 438,314 |
@Override
public void onSuccess(List<Tag> result) {
treeStore.removeAll();
for (Tag tag : result) {
treeStore.add(new TagData(tag), true);
}
} | @Override
public void onSuccess(List<Tag> result) {
<DeepExtract>
treeStore.removeAll();
for (Tag tag : result) {
treeStore.add(new TagData(tag), true);
}
</DeepExtract>
} | webpasswordsafe | positive | 438,315 |
public static void main(String[] args) {
System.setProperty("LOG_LOCATION", "logs");
System.setProperty("METRICS_LOCATION", "logs");
Cts cts = new Cts();
ConfigManager.init(new ConfigManager.Arguments());
ConfigManager configManager = ConfigManager.getInstance();
ModelServer server = new ModelServer(configManager);
Log... | public static void main(String[] args) {
System.setProperty("LOG_LOCATION", "logs");
System.setProperty("METRICS_LOCATION", "logs");
Cts cts = new Cts();
<DeepExtract>
ConfigManager.init(new ConfigManager.Arguments());
ConfigManager configManager = ConfigManager.getInstance();
ModelServer server = new ModelServer(confi... | multi-model-server | positive | 438,317 |
@Test
@Disabled
public void testPostgreSqlCsvNullOutput() throws IOException {
Object[] s = new String[] { "NULL", null };
CSVFormat format = CSVFormat.POSTGRESQL_CSV.withQuote(DQUOTE_CHAR).withNullString("NULL").withQuoteMode(QuoteMode.ALL_NON_NULL);
StringWriter writer = new StringWriter();
try (final CSVPrinter prin... | @Test
@Disabled
public void testPostgreSqlCsvNullOutput() throws IOException {
Object[] s = new String[] { "NULL", null };
CSVFormat format = CSVFormat.POSTGRESQL_CSV.withQuote(DQUOTE_CHAR).withNullString("NULL").withQuoteMode(QuoteMode.ALL_NON_NULL);
StringWriter writer = new StringWriter();
try (final CSVPrinter prin... | commons-csv | positive | 438,319 |
public Vector3 add(Vector3... others) {
double newX = x;
double newY = y;
double newZ = z;
for (Vector3 other : others) {
newX += other.x;
newY += other.y;
newZ += other.z;
}
int yTrunc = (int) newY;
switch(yTrunc) {
case 0:
if (newX == 0 && newY == 0 && newZ == 0) {
return ZERO;
}
break;
case 1:
if (newX == 1 && newY ... | public Vector3 add(Vector3... others) {
double newX = x;
double newY = y;
double newZ = z;
for (Vector3 other : others) {
newX += other.x;
newY += other.y;
newZ += other.z;
}
<DeepExtract>
int yTrunc = (int) newY;
switch(yTrunc) {
case 0:
if (newX == 0 && newY == 0 && newZ == 0) {
return ZERO;
}
break;
case 1:
if (newX... | CodeUtilities | positive | 438,320 |
public void putInt(int i) {
if (Binary.writeInt(i) == null) {
return;
}
this.ensureCapacity(this.count + Binary.writeInt(i).length);
System.arraycopy(Binary.writeInt(i), 0, this.buffer, this.count, Binary.writeInt(i).length);
this.count += Binary.writeInt(i).length;
} | public void putInt(int i) {
<DeepExtract>
if (Binary.writeInt(i) == null) {
return;
}
this.ensureCapacity(this.count + Binary.writeInt(i).length);
System.arraycopy(Binary.writeInt(i), 0, this.buffer, this.count, Binary.writeInt(i).length);
this.count += Binary.writeInt(i).length;
</DeepExtract>
} | Dragonet-Legacy | positive | 438,321 |
public static void initRecipes() {
for (int i = 0; i < 16; i++) {
GameRegistry.addRecipe(new ItemStack(ThaumicExploration.blankSeal, 1, i), " X ", "XZX", " X ", 'X', new ItemStack(ConfigItems.itemResource, 1, 4), 'Z', new ItemStack(Items.dye, 1, i));
}
registerCraftingRecipe("BLANKSEAL", new ItemStack(ThaumicExploratio... | public static void initRecipes() {
<DeepExtract>
</DeepExtract>
for (int i = 0; i < 16; i++) {
<DeepExtract>
</DeepExtract>
GameRegistry.addRecipe(new ItemStack(ThaumicExploration.blankSeal, 1, i), " X ", "XZX", " X ", 'X', new ItemStack(ConfigItems.itemResource, 1, 4), 'Z', new ItemStack(Items.dye, 1, i));
<DeepExtrac... | Thaumic_Exploration | positive | 438,322 |
private void buttonUpActionPerformed(java.awt.event.ActionEvent evt) {
if (currentHighlight != null) {
textareaMessage.getHighlighter().removeHighlight(currentHighlight);
currentHighlight = null;
}
try {
selectIndex--;
if (selectIndex < 0) {
selectIndex = myHighlights.size() - 1;
}
SentinelHighlight nextHighlight = myH... | private void buttonUpActionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
if (currentHighlight != null) {
textareaMessage.getHighlighter().removeHighlight(currentHighlight);
currentHighlight = null;
}
try {
selectIndex--;
if (selectIndex < 0) {
selectIndex = myHighlights.size() - 1;
}
SentinelHighlight nextH... | BurpSentinel | positive | 438,323 |
void appendFromWhere(SQLStatement stat, boolean log) {
stat.appendSQL(" FROM ");
from.appendSQL(stat);
for (SelectTable<T> join : joins) {
join.appendSQLAsJoin(stat, this);
}
if (conditionDepth != 0) {
throw new IciqlException("unmatch condition open-close count");
}
if (!conditions.isEmpty()) {
stat.appendSQL(" WHERE ... | void appendFromWhere(SQLStatement stat, boolean log) {
stat.appendSQL(" FROM ");
from.appendSQL(stat);
for (SelectTable<T> join : joins) {
join.appendSQLAsJoin(stat, this);
}
<DeepExtract>
if (conditionDepth != 0) {
throw new IciqlException("unmatch condition open-close count");
}
if (!conditions.isEmpty()) {
stat.appe... | iciql | positive | 438,325 |
@Test
public void testSessionFileUnsaved() {
mainModel.sessionFileProperty().set(SESSION_FILE);
mainModel.changesSavedProperty().set(false);
String actual = mainModel.titleProperty().get();
assertEquals(DEFAULT_DRAW_NAME + " (saved.file) - Unsaved Changes - Santulator", actual, "Title");
} | @Test
public void testSessionFileUnsaved() {
mainModel.sessionFileProperty().set(SESSION_FILE);
mainModel.changesSavedProperty().set(false);
<DeepExtract>
String actual = mainModel.titleProperty().get();
assertEquals(DEFAULT_DRAW_NAME + " (saved.file) - Unsaved Changes - Santulator", actual, "Title");
</DeepExtract>
} | Santulator | positive | 438,327 |
public static void eraseFolderContents(String path) {
File f = new File(path);
for (File file : f.listFiles()) {
if (file.isDirectory())
purgeDirectory(file);
file.delete();
}
} | public static void eraseFolderContents(String path) {
File f = new File(path);
<DeepExtract>
for (File file : f.listFiles()) {
if (file.isDirectory())
purgeDirectory(file);
file.delete();
}
</DeepExtract>
} | TrajectoryClustering | positive | 438,328 |
@Test
public void stringClasspath() {
assertEquals("simple", RamlLoaders.fromClasspath("guru/nidi/ramltester").load("simple.raml").getRaml().getTitle());
} | @Test
public void stringClasspath() {
<DeepExtract>
assertEquals("simple", RamlLoaders.fromClasspath("guru/nidi/ramltester").load("simple.raml").getRaml().getTitle());
</DeepExtract>
} | raml-tester | positive | 438,329 |
private void switchToSmallVideoView(int bigBgUid) {
HashMap<Integer, SurfaceView> slice = new HashMap<>(1);
slice.put(bigBgUid, mUidsList.get(bigBgUid));
Iterator<SurfaceView> iterator = mUidsList.values().iterator();
while (iterator.hasNext()) {
SurfaceView s = iterator.next();
s.setZOrderOnTop(true);
s.setZOrderMedia... | private void switchToSmallVideoView(int bigBgUid) {
HashMap<Integer, SurfaceView> slice = new HashMap<>(1);
slice.put(bigBgUid, mUidsList.get(bigBgUid));
Iterator<SurfaceView> iterator = mUidsList.values().iterator();
while (iterator.hasNext()) {
SurfaceView s = iterator.next();
s.setZOrderOnTop(true);
s.setZOrderMedia... | CloudBlindDate | positive | 438,330 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.