before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Test
public void shouldRemoveCustomTagForFileConstructor() throws Exception {
File filename = new File(MP3_WITH_ID3V1_AND_ID3V23_AND_CUSTOM_TAGS);
String saveFilename = new Mp3File(filename).getFilename() + ".copy";
try {
new Mp3File(filename).removeCustomTag();
new Mp3File(filename).save(saveFilename);
Mp3File newMp3... | @Test
public void shouldRemoveCustomTagForFileConstructor() throws Exception {
File filename = new File(MP3_WITH_ID3V1_AND_ID3V23_AND_CUSTOM_TAGS);
<DeepExtract>
String saveFilename = new Mp3File(filename).getFilename() + ".copy";
try {
new Mp3File(filename).removeCustomTag();
new Mp3File(filename).save(saveFilename);
... | mp3agic | positive | 2,837 |
public void actionPerformed(ActionEvent evt) {
String action = evt.getActionCommand();
Consumer<ContentInfo> applyContentTag = contentInfo -> {
if (contentInfo != null) {
String tag = contentInfo.toMDTag();
markdownWindow.insert(tag + " ", markdownWindow.getCaretPosition());
markdownWindow.moveCaretPosition(markdownWin... | public void actionPerformed(ActionEvent evt) {
<DeepExtract>
String action = evt.getActionCommand();
Consumer<ContentInfo> applyContentTag = contentInfo -> {
if (contentInfo != null) {
String tag = contentInfo.toMDTag();
markdownWindow.insert(tag + " ", markdownWindow.getCaretPosition());
markdownWindow.moveCaretPositi... | ProjectIntelligence | positive | 2,839 |
@Override
protected Void doInBackground() throws Exception {
boolean externalLogger = true;
long tstart = System.nanoTime();
solutions = algorithmWorker.execute();
long tend = System.nanoTime();
double totalTime = tend - tstart;
totalTime /= 1000000000.0;
ArrayList<Double> extFitnesses = new ArrayList<Double>();
String... | @Override
protected Void doInBackground() throws Exception {
<DeepExtract>
boolean externalLogger = true;
long tstart = System.nanoTime();
solutions = algorithmWorker.execute();
long tend = System.nanoTime();
double totalTime = tend - tstart;
totalTime /= 1000000000.0;
ArrayList<Double> extFitnesses = new ArrayList<Dou... | Pac-Man | positive | 2,841 |
public Criteria andCountryNotIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "country" + " cannot be null");
}
criteria.add(new Criterion("country not in", values));
return (Criteria) this;
} | public Criteria andCountryNotIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "country" + " cannot be null");
}
criteria.add(new Criterion("country not in", values));
</DeepExtract>
return (Criteria) this;
} | answerWeb | positive | 2,842 |
private void presentFragmentInternalRemoveOld(boolean removeLast, final BaseFragment fragment) {
if (fragment == null) {
return;
}
if (!fragmentsStack.isEmpty()) {
BaseFragment lastFragment = fragmentsStack.get(fragmentsStack.size() - 1);
lastFragment.onPause();
}
if (removeLast) {
fragment.onFragmentDestroy();
fragmen... | private void presentFragmentInternalRemoveOld(boolean removeLast, final BaseFragment fragment) {
if (fragment == null) {
return;
}
<DeepExtract>
if (!fragmentsStack.isEmpty()) {
BaseFragment lastFragment = fragmentsStack.get(fragmentsStack.size() - 1);
lastFragment.onPause();
}
</DeepExtract>
if (removeLast) {
fragment... | TelegramGallery | positive | 2,843 |
@Override
public void onScroll(AbsListView v, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (top != null) {
top.setVisibility(v.canScrollVertically(-1) ? View.VISIBLE : View.INVISIBLE);
}
if (bottom != null) {
bottom.setVisibility(v.canScrollVertically(1) ? View.VISIBLE : View.INVISIBLE);
}
} | @Override
public void onScroll(AbsListView v, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
<DeepExtract>
if (top != null) {
top.setVisibility(v.canScrollVertically(-1) ? View.VISIBLE : View.INVISIBLE);
}
if (bottom != null) {
bottom.setVisibility(v.canScrollVertically(1) ? View.VISIBLE : View.INVIS... | SamsungOneUi | positive | 2,844 |
@Override
public void onResponse(String response) {
Document doc = Jsoup.parse(response);
Elements elements = doc.select("div[class=zm-item-answer ]");
ZHAnswer answer = ParseUtils.parseHtmlToAnswer(elements.get(0));
mBus.post(new FetchAnswerHRE(answer));
} | @Override
public void onResponse(String response) {
<DeepExtract>
Document doc = Jsoup.parse(response);
Elements elements = doc.select("div[class=zm-item-answer ]");
ZHAnswer answer = ParseUtils.parseHtmlToAnswer(elements.get(0));
mBus.post(new FetchAnswerHRE(answer));
</DeepExtract>
} | ZhihuDemo | positive | 2,846 |
public static ConsentTask create(Context context, String taskId) {
Resources r = context.getResources();
List<Step> steps = new ArrayList<>();
ConsentSectionModel data = ResourceManager.getInstance().getConsentSections().create(context);
String participant = r.getString(R.string.rss_participant);
ConsentSignature signa... | public static ConsentTask create(Context context, String taskId) {
Resources r = context.getResources();
List<Step> steps = new ArrayList<>();
ConsentSectionModel data = ResourceManager.getInstance().getConsentSections().create(context);
String participant = r.getString(R.string.rss_participant);
ConsentSignature signa... | ResearchStack | positive | 2,847 |
@Test
public void getOnceAndStream_WithId_WithNoData_ReturnsNoneValue_AndDoesNotComplete() {
Consumer<String> insert = value -> getProvider().insert(core.getUriForId(SimpleMockStore.getIdFor(value)), core.getContentValuesForItem(value));
try {
insert.accept("parsnip");
insert.accept("lettuce");
insert.accept("spinach")... | @Test
public void getOnceAndStream_WithId_WithNoData_ReturnsNoneValue_AndDoesNotComplete() {
<DeepExtract>
Consumer<String> insert = value -> getProvider().insert(core.getUriForId(SimpleMockStore.getIdFor(value)), core.getContentValuesForItem(value));
try {
insert.accept("parsnip");
insert.accept("lettuce");
insert.acc... | reark | positive | 2,848 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
changeLocationMode(LocationMode.SIMULATOR);
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
changeLocationMode(LocationMode.SIMULATOR);
</DeepExtract>
} | vehicle-commander-java | positive | 2,849 |
@Override
public HasClickHandlers drawCircle(StyleMapShape<Circle> circle, String text) {
drawCircle(circle);
TextOverlay textOverlay = new TextOverlay(GoogleMapsAdapters.getLatLng(circle.getMapShape().getCenter()), text);
addOverlay(textOverlay);
return textOverlay.getTextWidget();
} | @Override
public HasClickHandlers drawCircle(StyleMapShape<Circle> circle, String text) {
drawCircle(circle);
<DeepExtract>
TextOverlay textOverlay = new TextOverlay(GoogleMapsAdapters.getLatLng(circle.getMapShape().getCenter()), text);
addOverlay(textOverlay);
return textOverlay.getTextWidget();
</DeepExtract>
} | linked-data-visualization-tools | positive | 2,850 |
public boolean isExecutable() {
if (released) {
return false;
}
if (buildStatusMap == null) {
Map<CLDevice, Status> map = new HashMap<CLDevice, Status>();
CLDevice[] devices = getCLDevices();
for (CLDevice device : devices) {
Status status = getBuildStatus(device);
if (status == Status.BUILD_SUCCESS) {
executable = tru... | public boolean isExecutable() {
if (released) {
return false;
}
<DeepExtract>
if (buildStatusMap == null) {
Map<CLDevice, Status> map = new HashMap<CLDevice, Status>();
CLDevice[] devices = getCLDevices();
for (CLDevice device : devices) {
Status status = getBuildStatus(device);
if (status == Status.BUILD_SUCCESS) {
ex... | jocl | positive | 2,851 |
public static void queueMessage(TextChannel channel, String message) {
if (channel == null) {
DiscordSRV.debug("Tried sending a message to a null channel");
return;
}
return translateEmotes(message, channel.getGuild().getEmotes());
if (StringUtils.isBlank(message))
return;
queueMessage(channel, new MessageBuilder().app... | public static void queueMessage(TextChannel channel, String message) {
if (channel == null) {
DiscordSRV.debug("Tried sending a message to a null channel");
return;
}
<DeepExtract>
return translateEmotes(message, channel.getGuild().getEmotes());
</DeepExtract>
if (StringUtils.isBlank(message))
return;
queueMessage(chan... | DiscordSRV | positive | 2,852 |
private void login(final String myChannelJid, final String passwordTxt) {
if (isEmpty(myChannelJid)) {
showErrorToolTip(mUsernameErrorTooltip, getString(R.string.message_account_username_mandatory));
return;
}
if (isEmpty(passwordTxt)) {
showErrorToolTip(mPasswordErrorTooltip, getString(R.string.message_account_passwor... | private void login(final String myChannelJid, final String passwordTxt) {
if (isEmpty(myChannelJid)) {
showErrorToolTip(mUsernameErrorTooltip, getString(R.string.message_account_username_mandatory));
return;
}
if (isEmpty(passwordTxt)) {
showErrorToolTip(mPasswordErrorTooltip, getString(R.string.message_account_passwor... | buddycloud-android | positive | 2,853 |
private void autofitParam(DataSheet dataSheet, Parameter parameter) {
Parameter parameter = getParameterForAxis(parameter);
setMin(parameter, dataSheet.getMinValueOf(parameter));
Parameter parameter = getParameterForAxis(parameter);
setMax(parameter, dataSheet.getMinValueOf(parameter));
} | private void autofitParam(DataSheet dataSheet, Parameter parameter) {
Parameter parameter = getParameterForAxis(parameter);
setMin(parameter, dataSheet.getMinValueOf(parameter));
<DeepExtract>
Parameter parameter = getParameterForAxis(parameter);
setMax(parameter, dataSheet.getMinValueOf(parameter));
</DeepExtract>
} | xdat | positive | 2,854 |
@Override
public void print(String string) {
if (realPrinter == null) {
realPrinter = new Printer(name);
}
realPrinter.print(string);
} | @Override
public void print(String string) {
<DeepExtract>
if (realPrinter == null) {
realPrinter = new Printer(name);
}
</DeepExtract>
realPrinter.print(string);
} | Java-Notes | positive | 2,855 |
@Override
protected void doPush(final int down, final V value) {
if (arraySize == array.length)
array = Arrays.copyOf(array, arraySize + SIZE_INCREASE);
System.arraycopy(array, down, array, down + 1, arraySize - down);
array[down] = value;
arraySize++;
} | @Override
protected void doPush(final int down, final V value) {
<DeepExtract>
if (arraySize == array.length)
array = Arrays.copyOf(array, arraySize + SIZE_INCREASE);
</DeepExtract>
System.arraycopy(array, down, array, down + 1, arraySize - down);
array[down] = value;
arraySize++;
} | grappa | positive | 2,856 |
@Test
public void getFriendIdsInCursor_byUserId_appAuthorization() {
appAuthMockServer.expect(requestTo("https://api.twitter.com/1.1/friends/ids.json?cursor=123456&user_id=98765")).andExpect(method(GET)).andExpect(header("Authorization", "Bearer APP_ACCESS_TOKEN")).andRespond(withSuccess(jsonResource("friend-or-followe... | @Test
public void getFriendIdsInCursor_byUserId_appAuthorization() {
appAuthMockServer.expect(requestTo("https://api.twitter.com/1.1/friends/ids.json?cursor=123456&user_id=98765")).andExpect(method(GET)).andExpect(header("Authorization", "Bearer APP_ACCESS_TOKEN")).andRespond(withSuccess(jsonResource("friend-or-followe... | spring-social-twitter | positive | 2,857 |
public static void nextSlide() {
if (slideShowSlides != null) {
if (slideShowIndex < slideShowSlides.size()) {
slideShowIndex++;
} else {
slideShowIndex = 1;
}
}
ActionListener listener = null;
if (slideShowSlides != null) {
listener = getCurrentSlideAction();
}
if (listener != null) {
listener.actionPerformed(null);
}... | public static void nextSlide() {
<DeepExtract>
if (slideShowSlides != null) {
if (slideShowIndex < slideShowSlides.size()) {
slideShowIndex++;
} else {
slideShowIndex = 1;
}
}
</DeepExtract>
ActionListener listener = null;
if (slideShowSlides != null) {
listener = getCurrentSlideAction();
}
if (listener != null) {
list... | java-concurrent-animated | positive | 2,858 |
public EntityEntitySimilarity getEntityEntitySimilarity(String eeIdentifier, Entities entities, Tracer tracer) throws Exception {
EntityEntitySimilarity eeSim = null;
EntitiesContextSettings settings = new EntitiesContextSettings();
settings.setEntityCoherenceKeyphraseAlpha(entityCohKeyphraseAlpha);
settings.setEntityC... | public EntityEntitySimilarity getEntityEntitySimilarity(String eeIdentifier, Entities entities, Tracer tracer) throws Exception {
EntityEntitySimilarity eeSim = null;
EntitiesContextSettings settings = new EntitiesContextSettings();
settings.setEntityCoherenceKeyphraseAlpha(entityCohKeyphraseAlpha);
settings.setEntityC... | aida | positive | 2,859 |
protected void _test(EXIFactory exiFactory, byte[] isBytes, int numberOfEXIDocuments) throws AssertionFailedError, Exception {
ByteArrayOutputStream osEXI = new ByteArrayOutputStream();
for (int i = 0; i < numberOfEXIDocuments; i++) {
EXIResult exiResult = new EXIResult(exiFactory);
exiResult.setOutputStream(osEXI);
XM... | protected void _test(EXIFactory exiFactory, byte[] isBytes, int numberOfEXIDocuments) throws AssertionFailedError, Exception {
ByteArrayOutputStream osEXI = new ByteArrayOutputStream();
for (int i = 0; i < numberOfEXIDocuments; i++) {
EXIResult exiResult = new EXIResult(exiFactory);
exiResult.setOutputStream(osEXI);
XM... | exificient | positive | 2,860 |
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mHeader != null) {
final int width = getMeasuredWidth() - mPaddingLeft - mPaddingRight;
final int parentWidthMeasureSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
... | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
<DeepExtract>
if (mHeader != null) {
final int width = getMeasuredWidth() - mPaddingLeft - mPaddingRight;
final int parentWidthMeasureSpec = MeasureSpec.makeMeasureSpec(width, MeasureS... | MobileSafeApp | positive | 2,862 |
public Criteria andDropLessThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "drop" + " cannot be null");
}
criteria.add(new Criterion("`drop` <", value));
return (Criteria) this;
} | public Criteria andDropLessThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "drop" + " cannot be null");
}
criteria.add(new Criterion("`drop` <", value));
</DeepExtract>
return (Criteria) this;
} | mybatis-generator-gui-extension | positive | 2,863 |
public void invalidate() {
} | public void invalidate() {
<DeepExtract>
</DeepExtract>
} | gwt-android-emu | positive | 2,864 |
@Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
switch(mState) {
case STATE_PREVIEW:
{
break;
}
case STATE_WAITING_LOCK:
{
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
if (afState == null) {
captureSt... | @Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
<DeepExtract>
switch(mState) {
case STATE_PREVIEW:
{
break;
}
case STATE_WAITING_LOCK:
{
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
if (afState == nul... | Trycorder5 | positive | 2,865 |
public void lookupAsMethod(Symbols syms) {
Symbols newSyms = new Symbols(syms);
newSyms.putNew(SymbolThis.NAME);
size = newSyms.size();
} | public void lookupAsMethod(Symbols syms) {
<DeepExtract>
</DeepExtract>
Symbols newSyms = new Symbols(syms);
<DeepExtract>
</DeepExtract>
newSyms.putNew(SymbolThis.NAME);
<DeepExtract>
</DeepExtract>
size = newSyms.size();
<DeepExtract>
</DeepExtract>
} | Stone-language | positive | 2,866 |
@Override
public void onClick(View view) {
if (mode == MODE_MULTI) {
new SubscriptionEditTask(global, SubredditSelectActivity.this, SubredditSelectActivity.this, SubscriptionEditTask.ACTION_MULTI_SUB_REMOVE).execute(multiPath, subreddit);
} else {
if (global.mRedditData.isLoggedIn())
new SubscriptionEditTask(global, Su... | @Override
public void onClick(View view) {
<DeepExtract>
if (mode == MODE_MULTI) {
new SubscriptionEditTask(global, SubredditSelectActivity.this, SubredditSelectActivity.this, SubscriptionEditTask.ACTION_MULTI_SUB_REMOVE).execute(multiPath, subreddit);
} else {
if (global.mRedditData.isLoggedIn())
new SubscriptionEditT... | reddinator | positive | 2,867 |
@Test
public void deleteNode1() {
node = new ListNode<>(10);
expected = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
listToDeleteFrom = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
listToDeleteFrom.get(3).insertAfter(node);
DeleteNode.deleteNode(node);
LinkedListUtil.assertSameList(expected, listToDeleteFrom);
} | @Test
public void deleteNode1() {
node = new ListNode<>(10);
expected = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
listToDeleteFrom = LinkedListUtil.createLinkedList(1, 2, 3, 4, 5);
listToDeleteFrom.get(3).insertAfter(node);
<DeepExtract>
DeleteNode.deleteNode(node);
LinkedListUtil.assertSameList(expected, listToD... | Elements-of-programming-interviews | positive | 2,868 |
public Criteria andMarketingSmallLabel1NotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "marketingSmallLabel1" + " cannot be null");
}
criteria.add(new Criterion("marketing_small_label_1 not between", value1, value2));
return (Criteria... | public Criteria andMarketingSmallLabel1NotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "marketingSmallLabel1" + " cannot be null");
}
criteria.add(new Criterion("marketing_small_label_1 not between", value1, value2));
</... | uccn | positive | 2,869 |
public void openElement(String name, int indent, Attribute... attrs) throws TechnicalException {
try {
indent(indent);
myWriter.append("<");
myWriter.append(name);
for (Attribute a : attrs) {
myWriter.append(" ");
myWriter.append(a.myName);
myWriter.append("=\"");
myWriter.append(a.myValue.replaceAll("\"", """));
... | public void openElement(String name, int indent, Attribute... attrs) throws TechnicalException {
<DeepExtract>
try {
indent(indent);
myWriter.append("<");
myWriter.append(name);
for (Attribute a : attrs) {
myWriter.append(" ");
myWriter.append(a.myName);
myWriter.append("=\"");
myWriter.append(a.myValue.replaceAll("\""... | servlex | positive | 2,870 |
@Override
public MediaCodecInfo next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
mIndex++;
return MediaCodecList.getCodecInfoAt(mIndex);
} | @Override
public MediaCodecInfo next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
mIndex++;
<DeepExtract>
return MediaCodecList.getCodecInfoAt(mIndex);
</DeepExtract>
} | DogCamera | positive | 2,871 |
public Criteria andRatioGreaterThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "ratio" + " cannot be null");
}
criteria.add(new Criterion("ratio >=", value));
return (Criteria) this;
} | public Criteria andRatioGreaterThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "ratio" + " cannot be null");
}
criteria.add(new Criterion("ratio >=", value));
</DeepExtract>
return (Criteria) this;
} | jtt808-simulator | positive | 2,872 |
public static void notifyContainerAboutLogin(Subject clientSubject, CallbackHandler handler, Principal callerPrincipal, Set<String> groups) {
if (clientSubject == null) {
throw new IllegalArgumentException("Null clientSubject!");
}
if (handler == null) {
throw new IllegalArgumentException("Null callback handler!");
}
t... | public static void notifyContainerAboutLogin(Subject clientSubject, CallbackHandler handler, Principal callerPrincipal, Set<String> groups) {
<DeepExtract>
if (clientSubject == null) {
throw new IllegalArgumentException("Null clientSubject!");
}
if (handler == null) {
throw new IllegalArgumentException("Null callback h... | soteria | positive | 2,874 |
@Override
protected void afterShowing() {
portLabel.setText("" + streamConfiguration.servicePort);
parallelInstancesLabel.setText("" + streamConfiguration.maximumParallelInstances);
timeFractionLabel.setText("" + streamConfiguration.timeFractionBeforeNewTrace);
GridBagConstraints c = new GridBagConstraints();
c.gridx =... | @Override
protected void afterShowing() {
portLabel.setText("" + streamConfiguration.servicePort);
parallelInstancesLabel.setText("" + streamConfiguration.maximumParallelInstances);
timeFractionLabel.setText("" + streamConfiguration.timeFractionBeforeNewTrace);
GridBagConstraints c = new GridBagConstraints();
c.gridx =... | plg | positive | 2,875 |
public void land() throws IOException {
cmd_queue.add(new LandCommand());
if (State.LANDING == State.ERROR)
changeToErrorState(null);
synchronized (state_mutex) {
if (state != State.LANDING) {
log.fine("State changed from " + state + " to " + State.LANDING);
state = State.LANDING;
if (state == State.BOOTSTRAP)
sendDemo... | public void land() throws IOException {
cmd_queue.add(new LandCommand());
<DeepExtract>
if (State.LANDING == State.ERROR)
changeToErrorState(null);
synchronized (state_mutex) {
if (state != State.LANDING) {
log.fine("State changed from " + state + " to " + State.LANDING);
state = State.LANDING;
if (state == State.BOOTS... | javadrone | positive | 2,876 |
@Test
public void testCircleDateLineWrapping() {
JtsShapeFactory shapeFactory = JtsSpatialContext.GEO.getShapeFactory();
Circle circle = shapeFactory.circle(-179.99, 51.22, DistanceUtils.dist2Degrees(5, DistanceUtils.EARTH_MEAN_RADIUS_KM));
Geometry geom = shapeFactory.getGeometryFrom(circle);
assertTrue(circle.getBoun... | @Test
public void testCircleDateLineWrapping() {
JtsShapeFactory shapeFactory = JtsSpatialContext.GEO.getShapeFactory();
Circle circle = shapeFactory.circle(-179.99, 51.22, DistanceUtils.dist2Degrees(5, DistanceUtils.EARTH_MEAN_RADIUS_KM));
Geometry geom = shapeFactory.getGeometryFrom(circle);
assertTrue(circle.getBoun... | spatial4j | positive | 2,877 |
public Builder newBuilderForType() {
return Builder.create();
} | public Builder newBuilderForType() {
<DeepExtract>
return Builder.create();
</DeepExtract>
} | Delite | positive | 2,880 |
protected void checkOperationMembers(LiveDownloadOperation operation, String method, String path, Object userState) {
BufferedReader reader = new BufferedReader(new InputStreamReader(method));
StringBuilder sb = new StringBuilder();
try {
String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} fi... | protected void checkOperationMembers(LiveDownloadOperation operation, String method, String path, Object userState) {
BufferedReader reader = new BufferedReader(new InputStreamReader(method));
StringBuilder sb = new StringBuilder();
try {
String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
} fi... | LiveSDK-for-Android | positive | 2,881 |
public Criteria andUserIdEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "userId" + " cannot be null");
}
criteria.add(new Criterion("user_id =", value));
return (Criteria) this;
} | public Criteria andUserIdEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "userId" + " cannot be null");
}
criteria.add(new Criterion("user_id =", value));
</DeepExtract>
return (Criteria) this;
} | library_manager_system | positive | 2,882 |
public void visitModule(ModuleTree node, TreeVisitor<?, ?> visitor) {
var name;
switch(node.getName().getKind()) {
case IDENTIFIER:
name = ((IdentifierTree) node.getName()).getName().toString();
case MEMBER_SELECT:
var select = (MemberSelectTree) node.getName();
name = qualifiedString(select.getExpression()) + '.' + se... | public void visitModule(ModuleTree node, TreeVisitor<?, ?> visitor) {
<DeepExtract>
var name;
switch(node.getName().getKind()) {
case IDENTIFIER:
name = ((IdentifierTree) node.getName()).getName().toString();
case MEMBER_SELECT:
var select = (MemberSelectTree) node.getName();
name = qualifiedString(select.getExpression... | pro | positive | 2,883 |
@Override
public void onViewDetachedFromWindow(View v) {
mSceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
mSceneRoot.removeOnAttachStateChangeListener(this);
sPendingTransitions.remove(mSceneRoot);
ArrayList<Transition> runningTransitions = getRunningTransitions().get(mSceneRoot);
if (runningTransitions ... | @Override
public void onViewDetachedFromWindow(View v) {
<DeepExtract>
mSceneRoot.getViewTreeObserver().removeOnPreDrawListener(this);
mSceneRoot.removeOnAttachStateChangeListener(this);
</DeepExtract>
sPendingTransitions.remove(mSceneRoot);
ArrayList<Transition> runningTransitions = getRunningTransitions().get(mSceneR... | TransitionsDemo | positive | 2,885 |
static Element getOptionalChildElement(Element parent, String tagName) {
NodeList nodes = parent.getElementsByTagName(tagName);
if (nodes == null || nodes.getLength() == 0) {
if (false) {
throw new IllegalStateException(String.format("Missing tag %s in element %s.", tagName, parent));
} else {
return null;
}
}
return (... | static Element getOptionalChildElement(Element parent, String tagName) {
<DeepExtract>
NodeList nodes = parent.getElementsByTagName(tagName);
if (nodes == null || nodes.getLength() == 0) {
if (false) {
throw new IllegalStateException(String.format("Missing tag %s in element %s.", tagName, parent));
} else {
return null... | appengine-java-vm-runtime | positive | 2,886 |
@Test
public void testMethodArrayParamType() throws Exception {
Class<?> longClass = Long.class;
Class<?> numberClass = Number.class;
Class<?> stringClass = String.class;
Class<?> objectClass = Object.class;
assert (numberClass.isAssignableFrom(longClass));
assert (objectClass.isAssignableFrom(numberClass));
assert (ob... | @Test
public void testMethodArrayParamType() throws Exception {
Class<?> longClass = Long.class;
Class<?> numberClass = Number.class;
Class<?> stringClass = String.class;
Class<?> objectClass = Object.class;
assert (numberClass.isAssignableFrom(longClass));
assert (objectClass.isAssignableFrom(numberClass));
assert (ob... | QLExpress | positive | 2,888 |
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
for (int i = 0; i < radioGroup.getChildCount(); i++) {
View view = radioGroup.getChildAt(i);
if (view instanceof RadioButton) {
RadioButton radioButton = (RadioButton) view;
if (radioButton.getText().equals(getPersistedString("Male")))... | @Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
<DeepExtract>
for (int i = 0; i < radioGroup.getChildCount(); i++) {
View view = radioGroup.getChildAt(i);
if (view instanceof RadioButton) {
RadioButton radioButton = (RadioButton) view;
if (radioButton.getText().equals(getPersistedSt... | meiShi | positive | 2,889 |
@Test
public void readAttributesAllBasic() throws IOException {
AmazonS3ClientMock client = AmazonS3MockFactory.getAmazonClientMock();
Files.write(client.bucket("bucketA").dir("dir").resolve("dir/file"), "sample".getBytes());
FileSystem fs;
try {
fs = s3fsProvider.getFileSystem(S3EndpointConstant.S3_GLOBAL_URI_TEST);
}... | @Test
public void readAttributesAllBasic() throws IOException {
AmazonS3ClientMock client = AmazonS3MockFactory.getAmazonClientMock();
Files.write(client.bucket("bucketA").dir("dir").resolve("dir/file"), "sample".getBytes());
<DeepExtract>
FileSystem fs;
try {
fs = s3fsProvider.getFileSystem(S3EndpointConstant.S3_GLOBA... | nifi-minio | positive | 2,890 |
@Test
public void testJsonBundleStrings() {
JavaRDD<String> jsonBundlesRdd = spark.sparkContext().wholeTextFiles("src/test/resources/json/bundles", 1).toJavaRDD().map(tuple -> tuple._2());
Dataset<String> jsonBundles = spark.createDataset(jsonBundlesRdd.rdd(), Encoders.STRING());
jsonBundles.write().saveAsTable("json_b... | @Test
public void testJsonBundleStrings() {
JavaRDD<String> jsonBundlesRdd = spark.sparkContext().wholeTextFiles("src/test/resources/json/bundles", 1).toJavaRDD().map(tuple -> tuple._2());
Dataset<String> jsonBundles = spark.createDataset(jsonBundlesRdd.rdd(), Encoders.STRING());
jsonBundles.write().saveAsTable("json_b... | bunsen | positive | 2,891 |
public <T> UpdateResults updateAll() {
MorphiaQuery q = new MorphiaQuery(c_).findBy((QueryImpl) ds().createQuery(c_), (UpdateOperations<T>) u_);
return ds().update((Query<T>) q.getMorphiaQuery(), (UpdateOperations<T>) u_);
} | public <T> UpdateResults updateAll() {
<DeepExtract>
MorphiaQuery q = new MorphiaQuery(c_).findBy((QueryImpl) ds().createQuery(c_), (UpdateOperations<T>) u_);
return ds().update((Query<T>) q.getMorphiaQuery(), (UpdateOperations<T>) u_);
</DeepExtract>
} | play-morphia | positive | 2,892 |
public void testSequenceFileWriter() throws Exception {
PropertiesConfiguration properties = new PropertiesConfiguration();
properties.addProperty("secor.file.reader.writer.factory", "com.pinterest.secor.io.impl.SequenceFileReaderWriterFactory");
mConfig = new SecorConfig(properties);
Path fsPath = (!false) ? new Path(... | public void testSequenceFileWriter() throws Exception {
PropertiesConfiguration properties = new PropertiesConfiguration();
properties.addProperty("secor.file.reader.writer.factory", "com.pinterest.secor.io.impl.SequenceFileReaderWriterFactory");
mConfig = new SecorConfig(properties);
Path fsPath = (!false) ? new Path(... | secor | positive | 2,893 |
public List<Long> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemor... | public List<Long> getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemor... | news-duplicated | positive | 2,894 |
private boolean hasLock(boolean skipShared) throws ServerException {
if (activeLocks == null) {
String activeLocksJson = ExtendedAttributesExtension.getExtendedAttribute(getFullPath().toString(), activeLocksAttribute);
activeLocks = new ArrayList<>(SerializationUtils.deserializeList(LockInfo.class, activeLocksJson));
}... | private boolean hasLock(boolean skipShared) throws ServerException {
<DeepExtract>
if (activeLocks == null) {
String activeLocksJson = ExtendedAttributesExtension.getExtendedAttribute(getFullPath().toString(), activeLocksAttribute);
activeLocks = new ArrayList<>(SerializationUtils.deserializeList(LockInfo.class, active... | WebDAVServerSamplesJava | positive | 2,895 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mCl = (CoordinatorLayout) findViewById(R.id.main_cl);
mCoverIv = (AppCompatImageView) findViewById(R.id.main_tb_cover);
mTb = (Toolbar) findViewById(R.id.main_tb);
mTl = (TabLayout)... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mCl = (CoordinatorLayout) findViewById(R.id.main_cl);
mCoverIv = (AppCompatImageView) findViewById(R.id.main_tb_cover);
mTb = (Toolbar) findViewById(R.id.main_tb);
mTl = (TabLayout)... | DelegateAdapter | positive | 2,896 |
public void union(BitSet other) {
int newLen = Math.max(wlen, other.wlen);
if (bits.length < newLen) {
bits = grow(bits, newLen);
}
long[] thisArr = this.bits;
long[] otherArr = other.bits;
int pos = Math.min(wlen, other.wlen);
while (--pos >= 0) {
thisArr[pos] |= otherArr[pos];
}
if (this.wlen < newLen) {
System.array... | public void union(BitSet other) {
int newLen = Math.max(wlen, other.wlen);
<DeepExtract>
if (bits.length < newLen) {
bits = grow(bits, newLen);
}
</DeepExtract>
long[] thisArr = this.bits;
long[] otherArr = other.bits;
int pos = Math.min(wlen, other.wlen);
while (--pos >= 0) {
thisArr[pos] |= otherArr[pos];
}
if (this.... | hppc | positive | 2,897 |
private Component createUserIsRegisteredQuestion() {
Container container = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3));
container.add(new JLabel("Do you want to create a new WatchDog " + this.getRegistrationType() + " registration?"));
ButtonGroup buttons = new ButtonGroup();
JRadioButton yes = new JRadioButton("... | private Component createUserIsRegisteredQuestion() {
Container container = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 3));
container.add(new JLabel("Do you want to create a new WatchDog " + this.getRegistrationType() + " registration?"));
ButtonGroup buttons = new ButtonGroup();
JRadioButton yes = new JRadioButton("... | watchdog | positive | 2,898 |
@Override
public void sentEventWithClientContext(Event event, IResponseListener responseListener) {
DcsRequestBody dcsRequestBody = new DcsRequestBody(event);
dcsRequestBody.setClientContext(clientContexts());
dcsClient.sendRequest(dcsRequestBody, responseListener);
} | @Override
public void sentEventWithClientContext(Event event, IResponseListener responseListener) {
<DeepExtract>
DcsRequestBody dcsRequestBody = new DcsRequestBody(event);
dcsRequestBody.setClientContext(clientContexts());
dcsClient.sendRequest(dcsRequestBody, responseListener);
</DeepExtract>
} | dcs-sdk-java | positive | 2,899 |
public Attachment getAttachment(int slotIndex, String name) {
if (slotIndex < 0)
throw new IllegalArgumentException("slotIndex must be >= 0.");
if (name == null)
throw new IllegalArgumentException("name cannot be null.");
this.slotIndex = slotIndex;
this.name = name;
hashCode = 31 * (31 + name.hashCode()) + slotIndex;
... | public Attachment getAttachment(int slotIndex, String name) {
if (slotIndex < 0)
throw new IllegalArgumentException("slotIndex must be >= 0.");
<DeepExtract>
if (name == null)
throw new IllegalArgumentException("name cannot be null.");
this.slotIndex = slotIndex;
this.name = name;
hashCode = 31 * (31 + name.hashCode())... | libgdxjam | positive | 2,901 |
@Override
public boolean removeTransactionWithIndex(long index) {
if (index < 0) {
throw new NegativeIndexException();
} else if (index == 0) {
throw new ZeroIndexException();
}
if (data.containsKey(index)) {
HttpTransaction deletedTransaction = data.get(index);
data.remove(index);
sendDataChangeEvent(Event.DELETED, de... | @Override
public boolean removeTransactionWithIndex(long index) {
<DeepExtract>
if (index < 0) {
throw new NegativeIndexException();
} else if (index == 0) {
throw new ZeroIndexException();
}
</DeepExtract>
if (data.containsKey(index)) {
HttpTransaction deletedTransaction = data.get(index);
data.remove(index);
sendData... | Gander | positive | 2,903 |
@Test
public void testTransferTransaction() {
ECKey sourcePrivateKey = new BrainKey(BILTHON_7_BRAIN_KEY, 0).getPrivateKey();
PublicKey to1 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_5_BRAIN_KEY, 0).getPublicKey()));
PublicKey to2 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_16_BRAIN_KEY, 0).... | @Test
public void testTransferTransaction() {
ECKey sourcePrivateKey = new BrainKey(BILTHON_7_BRAIN_KEY, 0).getPrivateKey();
PublicKey to1 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_5_BRAIN_KEY, 0).getPublicKey()));
PublicKey to2 = new PublicKey(ECKey.fromPublicOnly(new BrainKey(BILTHON_16_BRAIN_KEY, 0).... | graphenej | positive | 2,904 |
public Vector3 sub(Vector3 vec) {
x -= vec.x;
y -= vec.y;
z -= vec.z;
return this;
} | public Vector3 sub(Vector3 vec) {
<DeepExtract>
x -= vec.x;
y -= vec.y;
z -= vec.z;
return this;
</DeepExtract>
} | CoFHTweaks | positive | 2,905 |
public int getGLLightIdentifier() {
int retID = -1;
switch(this.lightNumber) {
case 0:
retID = GLLightingFunc.GL_LIGHT0;
break;
case 1:
retID = GLLightingFunc.GL_LIGHT1;
break;
case 2:
retID = GLLightingFunc.GL_LIGHT2;
break;
case 3:
retID = GLLightingFunc.GL_LIGHT3;
break;
case 4:
retID = GLLightingFunc.GL_LIGHT4;
bre... | public int getGLLightIdentifier() {
<DeepExtract>
int retID = -1;
switch(this.lightNumber) {
case 0:
retID = GLLightingFunc.GL_LIGHT0;
break;
case 1:
retID = GLLightingFunc.GL_LIGHT1;
break;
case 2:
retID = GLLightingFunc.GL_LIGHT2;
break;
case 3:
retID = GLLightingFunc.GL_LIGHT3;
break;
case 4:
retID = GLLightingFunc.... | jogl-utils | positive | 2,906 |
public synchronized void keyReleased(int j) {
int k = getGameAction(j);
int l;
if ((l = j - 48) >= 0 && l < 10)
m_LaZ[l] = false;
else if (k >= 0 && k < 7)
m_aeaZ[k] = false;
_xavV();
} | public synchronized void keyReleased(int j) {
<DeepExtract>
int k = getGameAction(j);
int l;
if ((l = j - 48) >= 0 && l < 10)
m_LaZ[l] = false;
else if (k >= 0 && k < 7)
m_aeaZ[k] = false;
_xavV();
</DeepExtract>
} | gravitydefied | positive | 2,907 |
public Criteria andMaxpriceEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "maxprice" + " cannot be null");
}
criteria.add(new Criterion("maxprice =", value));
return (Criteria) this;
} | public Criteria andMaxpriceEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "maxprice" + " cannot be null");
}
criteria.add(new Criterion("maxprice =", value));
</DeepExtract>
return (Criteria) this;
} | Whome | positive | 2,908 |
public void mouseDragged(MouseEvent ev) {
switch(new MouseEvt(Type.MOVE, new Point(ev.getX(), ev.getY())).type) {
case DOWN:
Optional<Entry> oe = doc.getByPoint(new MouseEvt(Type.MOVE, new Point(ev.getX(), ev.getY())).pt);
if (oe.isPresent()) {
System.out.println("classic dragging " + oe.get().id);
oDragging = Optional... | public void mouseDragged(MouseEvent ev) {
<DeepExtract>
switch(new MouseEvt(Type.MOVE, new Point(ev.getX(), ev.getY())).type) {
case DOWN:
Optional<Entry> oe = doc.getByPoint(new MouseEvt(Type.MOVE, new Point(ev.getX(), ev.getY())).pt);
if (oe.isPresent()) {
System.out.println("classic dragging " + oe.get().id);
oDragg... | sodium | positive | 2,909 |
public Criteria andParm2NotIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "parm2" + " cannot be null");
}
criteria.add(new Criterion("PARM2 not in", values));
return (Criteria) this;
} | public Criteria andParm2NotIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "parm2" + " cannot be null");
}
criteria.add(new Criterion("PARM2 not in", values));
</DeepExtract>
return (Criteria) this;
} | console | positive | 2,911 |
@Override
public void stateChanged(ChangeEvent e) {
String text = in.getText();
float fontsize = ((Number) size.getValue()).floatValue();
int style = Font.PLAIN;
if (italic.isSelected()) {
style |= Font.ITALIC;
}
if (bold.isSelected()) {
style |= Font.BOLD;
}
out.removeAll();
for (Font font : GraphicsEnvironment.getLoc... | @Override
public void stateChanged(ChangeEvent e) {
<DeepExtract>
String text = in.getText();
float fontsize = ((Number) size.getValue()).floatValue();
int style = Font.PLAIN;
if (italic.isSelected()) {
style |= Font.ITALIC;
}
if (bold.isSelected()) {
style |= Font.BOLD;
}
out.removeAll();
for (Font font : GraphicsEnvi... | MathOCR | positive | 2,913 |
public Criteria andIdBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id between", value1, value2));
return (Criteria) this;
} | public Criteria andIdBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | sihai-maven-ssm-alipay | positive | 2,914 |
public Criteria andGmtModifiedIsNotNull() {
if ("GMT_MODIFIED is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("GMT_MODIFIED is not null"));
return (Criteria) this;
} | public Criteria andGmtModifiedIsNotNull() {
<DeepExtract>
if ("GMT_MODIFIED is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("GMT_MODIFIED is not null"));
</DeepExtract>
return (Criteria) this;
} | communitycode | positive | 2,915 |
public static boolean createDefaultTable() {
String sql = "CREATE TABLE %s (" + "player VARCHAR(50), " + "data LONGTEXT)DEFAULT CHARSET=UTF8;";
sql = String.format(sql, tableName);
MySqlConnection connection = MySqlConnection.getConnection();
if (!connection.isValid()) {
RealSurvival.logger().severe(I18N.tr("log.severe... | public static boolean createDefaultTable() {
String sql = "CREATE TABLE %s (" + "player VARCHAR(50), " + "data LONGTEXT)DEFAULT CHARSET=UTF8;";
sql = String.format(sql, tableName);
<DeepExtract>
MySqlConnection connection = MySqlConnection.getConnection();
if (!connection.isValid()) {
RealSurvival.logger().severe(I18N.... | RealSurvival | positive | 2,916 |
@Test
public void findNearest2() throws Exception {
list = Arrays.asList("Mark", "Steve", "Mason", "Joan", "Jordan", "Greg", "Mark", "Garth", "Joan", "Daisy", "Garth", "Marcus");
expected = 3;
assertEquals(expected, NearestRepeated.findNearest(list));
} | @Test
public void findNearest2() throws Exception {
list = Arrays.asList("Mark", "Steve", "Mason", "Joan", "Jordan", "Greg", "Mark", "Garth", "Joan", "Daisy", "Garth", "Marcus");
expected = 3;
<DeepExtract>
assertEquals(expected, NearestRepeated.findNearest(list));
</DeepExtract>
} | Elements-of-programming-interviews | positive | 2,917 |
@Test
public void castPrimitiveIntegerExceptionWithLogging() {
PoijiOptions options = PoijiOptionsBuilder.settings().sheetName(sheetName).build();
String value = "not an int";
Integer expectedDefault = 0;
Integer testVal = (Integer) casting.castValue(int.class, value, options);
assertEquals(expectedDefault, testVal);
a... | @Test
public void castPrimitiveIntegerExceptionWithLogging() {
PoijiOptions options = PoijiOptionsBuilder.settings().sheetName(sheetName).build();
String value = "not an int";
Integer expectedDefault = 0;
Integer testVal = (Integer) casting.castValue(int.class, value, options);
assertEquals(expectedDefault, testVal);
<... | poiji | positive | 2,918 |
@Override
public void sendPing(byte[] payload) {
sendMessage(new TextMessage(new Ping(payload)));
} | @Override
public void sendPing(byte[] payload) {
<DeepExtract>
sendMessage(new TextMessage(new Ping(payload)));
</DeepExtract>
} | autobahn-java | positive | 2,919 |
public final void testIllegalElementName() throws Exception {
renderer.openDocument();
renderer.openTag(":svg", ImmutableList.<String>of());
renderer.openTag("svg:", ImmutableList.<String>of());
renderer.openTag("-1", ImmutableList.<String>of());
renderer.openTag("svg::svg", ImmutableList.<String>of());
renderer.openTa... | public final void testIllegalElementName() throws Exception {
renderer.openDocument();
renderer.openTag(":svg", ImmutableList.<String>of());
renderer.openTag("svg:", ImmutableList.<String>of());
renderer.openTag("-1", ImmutableList.<String>of());
renderer.openTag("svg::svg", ImmutableList.<String>of());
renderer.openTa... | java-html-sanitizer | positive | 2,920 |
private void closeImpl() {
TmcSwingUtilities.ensureEdt(new Runnable() {
@Override
public void run() {
TmcEventBus.getDefault().post(new InvokedEvent("spyware_unloaded"));
textInsertEventSource.close();
TmcEventBus.getDefault().unsubscribe(tmcEventBusSource);
ProjectActionCaptor.removeListener(projectActionSource);
}
})... | private void closeImpl() {
TmcSwingUtilities.ensureEdt(new Runnable() {
@Override
public void run() {
TmcEventBus.getDefault().post(new InvokedEvent("spyware_unloaded"));
textInsertEventSource.close();
TmcEventBus.getDefault().unsubscribe(tmcEventBusSource);
ProjectActionCaptor.removeListener(projectActionSource);
}
})... | tmc-netbeans | positive | 2,921 |
@Override
public <T> List<T> getExtractByInterClassOfMain(Class<T> interfaceClass) {
if (interfaceClass == null) {
return Collections.emptyList();
}
List<ExtractWrapper> extracts = new ArrayList<>();
Map<ExtractCoordinate, ExtractWrapper> extractCoordinateObjectMap = extractMap.get(MAIN_EXTRACT_KEY);
if (extractCoordin... | @Override
public <T> List<T> getExtractByInterClassOfMain(Class<T> interfaceClass) {
<DeepExtract>
if (interfaceClass == null) {
return Collections.emptyList();
}
List<ExtractWrapper> extracts = new ArrayList<>();
Map<ExtractCoordinate, ExtractWrapper> extractCoordinateObjectMap = extractMap.get(MAIN_EXTRACT_KEY);
if (... | springboot-plugin-framework-parent | positive | 2,922 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
Utils.themeInit(this);
setContentView(R.layout.activity_credits_show);
getActionBar().setDisplayHomeAsUpEnabled(true);
} | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
Utils.themeInit(this);
setContentView(R.layout.activity_credits_show);
<DeepExtract>
getActionBar().setDisplayHomeAsUpEnabled(true);
</DeepExtract>
} | ytdownloader-2 | positive | 2,923 |
@Test
public void testAllOf() {
MyAssertions.assertThat((s1, s2) -> allOf(s1, s2).apply(numberSchema(), intSchema()).toJson()).extractingKey("allOf").containsItemSatisfying(i -> MyAssertions.assertThatJson(i).containsEntry("type", "number")).containsItemSatisfying(i -> MyAssertions.assertThatJson(i).containsEntry("type... | @Test
public void testAllOf() {
<DeepExtract>
MyAssertions.assertThat((s1, s2) -> allOf(s1, s2).apply(numberSchema(), intSchema()).toJson()).extractingKey("allOf").containsItemSatisfying(i -> MyAssertions.assertThatJson(i).containsEntry("type", "number")).containsItemSatisfying(i -> MyAssertions.assertThatJson(i).conta... | vertx-json-schema | positive | 2,924 |
public proto.RoleProto.ListTestResp_1001003 getDefaultInstanceForType() {
return defaultInstance;
} | public proto.RoleProto.ListTestResp_1001003 getDefaultInstanceForType() {
<DeepExtract>
return defaultInstance;
</DeepExtract>
} | NettyProtobufWebsocket | positive | 2,926 |
private void generateTrunk() {
int originX = this.blockPositionX;
int originY = this.blockPositionY;
int originZ = this.blockPositionZ;
int xPreference = this.randGenerator.nextInt(this.slopeChance);
int zPreference = this.randGenerator.nextInt(this.slopeChance);
int xDirection = 1;
if (this.randGenerator.nextInt(100) ... | private void generateTrunk() {
int originX = this.blockPositionX;
int originY = this.blockPositionY;
int originZ = this.blockPositionZ;
int xPreference = this.randGenerator.nextInt(this.slopeChance);
int zPreference = this.randGenerator.nextInt(this.slopeChance);
int xDirection = 1;
if (this.randGenerator.nextInt(100) ... | FastAsyncVoxelSniper | positive | 2,928 |
private void display() {
assert isInitialized() : controlId;
assert !isEnabled() : controlId;
getElement().setVisible(true);
if (!isInitialized()) {
this.startEnabled = true;
return;
}
if (true && !isEnabled()) {
display();
} else if (!true && isEnabled()) {
hide();
}
} | private void display() {
assert isInitialized() : controlId;
assert !isEnabled() : controlId;
getElement().setVisible(true);
<DeepExtract>
if (!isInitialized()) {
this.startEnabled = true;
return;
}
if (true && !isEnabled()) {
display();
} else if (!true && isEnabled()) {
hide();
}
</DeepExtract>
} | jme3-utilities | positive | 2,929 |
@Override
public void onCreate() {
super.onCreate();
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(getApplicationContext()).defaultDisplayImageOptions(defaultOptions).bui... | @Override
public void onCreate() {
super.onCreate();
<DeepExtract>
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisc(true).build();
ImageLoaderConfiguration configuration = new ImageLoaderConfiguration.Builder(getApplicationContext()).defaultDisplayImageOptions(defau... | Douban-FM-sdk | positive | 2,931 |
@Test
public void shouldParseConfigWithMissingArtifactAndListOfValidatedArtifacts() {
initAppContext("/TestBomDependencyNotFoundFilterParser-missingArtifactWithListOfValidated.xml");
assertNumberOfBeansWithType(ExceptionFilter.class, 2);
List<BomDependencyNotFoundExceptionFilter> filters = getAllMatchingBeans(BomDepend... | @Test
public void shouldParseConfigWithMissingArtifactAndListOfValidatedArtifacts() {
initAppContext("/TestBomDependencyNotFoundFilterParser-missingArtifactWithListOfValidated.xml");
assertNumberOfBeansWithType(ExceptionFilter.class, 2);
List<BomDependencyNotFoundExceptionFilter> filters = getAllMatchingBeans(BomDepend... | redhat-repository-validator | positive | 2,932 |
private JSONWriter end(char mode, char c) throws JSONException {
if (this.mode != mode) {
throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject.");
}
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != mode) {
thr... | private JSONWriter end(char mode, char c) throws JSONException {
if (this.mode != mode) {
throw new JSONException(mode == 'a' ? "Misplaced endArray." : "Misplaced endObject.");
}
<DeepExtract>
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m ... | TTMS | positive | 2,933 |
public BySelector desc(Pattern contentDescription) {
if (contentDescription == null) {
throw new NullPointerException("contentDescription cannot be null");
}
return contentDescription;
if (mDesc != null) {
throw new IllegalStateException("Description selector is already defined");
}
mDesc = contentDescription;
return t... | public BySelector desc(Pattern contentDescription) {
<DeepExtract>
if (contentDescription == null) {
throw new NullPointerException("contentDescription cannot be null");
}
return contentDescription;
</DeepExtract>
if (mDesc != null) {
throw new IllegalStateException("Description selector is already defined");
}
mDesc =... | za-Farmer | positive | 2,935 |
public void run() {
} | public void run() {
<DeepExtract>
</DeepExtract>
} | SWFTools-Core | positive | 2,937 |
public Criteria andCollegeidLessThan(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "collegeid" + " cannot be null");
}
criteria.add(new Criterion("collegeID <", value));
return (Criteria) this;
} | public Criteria andCollegeidLessThan(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "collegeid" + " cannot be null");
}
criteria.add(new Criterion("collegeID <", value));
</DeepExtract>
return (Criteria) this;
} | Examination_System | positive | 2,939 |
public static void clear(Context context) {
SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.clear();
try {
if (sApplyMethod != null) {
sApplyMethod.invoke(editor);
return;
}
} catch (IllegalArgumentException e) {
} catch (IllegalA... | public static void clear(Context context) {
SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = sp.edit();
editor.clear();
<DeepExtract>
try {
if (sApplyMethod != null) {
sApplyMethod.invoke(editor);
return;
}
} catch (IllegalArgumentException e) {
} c... | shop-front-android | positive | 2,941 |
public boolean asBoolean(ExpressionContext context) throws ExpressionEvaluationException {
Object o;
try {
o = MVEL.executeExpression(compiledExpression, context.asMap());
} catch (Exception e) {
throw new ExpressionEvaluationException("Error evaluating exception on line: " + line + ", column: " + col + ", expression: ... | public boolean asBoolean(ExpressionContext context) throws ExpressionEvaluationException {
<DeepExtract>
Object o;
try {
o = MVEL.executeExpression(compiledExpression, context.asMap());
} catch (Exception e) {
throw new ExpressionEvaluationException("Error evaluating exception on line: " + line + ", column: " + col + "... | Cambridge | positive | 2,942 |
@Benchmark
public RTree<Object, Point> defaultRTreeInsertOneEntryIntoGreekDataEntriesMaxChildren128() {
if (precision == Precision.DOUBLE) {
return defaultTreeM128.add(new Object(), Geometries.point(Math.random() * 1000, Math.random() * 1000));
} else {
return defaultTreeM128.add(new Object(), Geometries.point((float) ... | @Benchmark
public RTree<Object, Point> defaultRTreeInsertOneEntryIntoGreekDataEntriesMaxChildren128() {
<DeepExtract>
if (precision == Precision.DOUBLE) {
return defaultTreeM128.add(new Object(), Geometries.point(Math.random() * 1000, Math.random() * 1000));
} else {
return defaultTreeM128.add(new Object(), Geometries.... | rtree | positive | 2,943 |
default PubSubSubscription listenForCheerEvents(OAuth2Credential credential, String channelId) {
PubSubRequest request = new PubSubRequest();
request.setType(PubSubType.LISTEN);
request.setNonce(CryptoUtils.generateNonce(30));
request.getData().put("auth_token", credential != null ? credential.getAccessToken() : "");
r... | default PubSubSubscription listenForCheerEvents(OAuth2Credential credential, String channelId) {
<DeepExtract>
PubSubRequest request = new PubSubRequest();
request.setType(PubSubType.LISTEN);
request.setNonce(CryptoUtils.generateNonce(30));
request.getData().put("auth_token", credential != null ? credential.getAccessTo... | twitch4j | positive | 2,944 |
public JSONWriter value(Object object) throws JSONException {
if (JSONObject.valueToString(object) == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
}
this.writer.write(JSONObject.valueToString(object));
... | public JSONWriter value(Object object) throws JSONException {
<DeepExtract>
if (JSONObject.valueToString(object) == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write(',');
}
this.writer.write(JSONObject.valueToStr... | Longan | positive | 2,945 |
@Override
public void run() {
if (mScanning) {
mScanning = false;
if (isEnable() && mBluetoothAdapter != null && mLeScanCallback != null) {
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}
} | @Override
public void run() {
<DeepExtract>
if (mScanning) {
mScanning = false;
if (isEnable() && mBluetoothAdapter != null && mLeScanCallback != null) {
mBluetoothAdapter.stopLeScan(mLeScanCallback);
}
}
</DeepExtract>
} | BaseLibrary | positive | 2,946 |
private void showToolbar() {
float headerTranslationY = ViewHelper.getTranslationY(mHeaderView);
if (headerTranslationY != 0) {
ViewPropertyAnimator.animate(mHeaderView).cancel();
ViewPropertyAnimator.animate(mHeaderView).translationY(0).setDuration(200).start();
}
int toolbarHeight = mToolbarView.getHeight();
mPagerAd... | private void showToolbar() {
float headerTranslationY = ViewHelper.getTranslationY(mHeaderView);
if (headerTranslationY != 0) {
ViewPropertyAnimator.animate(mHeaderView).cancel();
ViewPropertyAnimator.animate(mHeaderView).translationY(0).setDuration(200).start();
}
<DeepExtract>
int toolbarHeight = mToolbarView.getHeig... | Android-ObservableScrollView | positive | 2,947 |
public Boolean visit(final EndsWithFilter filter, final JsonNode object) throws ScimException {
Iterable<JsonNode> nodes = getCandidateNodes(filter.getAttributePath(), object);
for (JsonNode node : nodes) {
if (node.isTextual() && filter.getComparisonValue().isTextual()) {
AttributeDefinition attributeDefinition = getA... | public Boolean visit(final EndsWithFilter filter, final JsonNode object) throws ScimException {
<DeepExtract>
Iterable<JsonNode> nodes = getCandidateNodes(filter.getAttributePath(), object);
for (JsonNode node : nodes) {
if (node.isTextual() && filter.getComparisonValue().isTextual()) {
AttributeDefinition attributeDef... | scim2 | positive | 2,948 |
public void visitArg(@NotNull SpecArg o) {
visitElement(o);
} | public void visitArg(@NotNull SpecArg o) {
<DeepExtract>
visitElement(o);
</DeepExtract>
} | Intellij-Plugin | positive | 2,949 |
@ParameterizedTest
@MethodSource("fromDtoToModelTestCases")
@DisplayName("fromDtoToModel: when the given dto is not null then the equivalent model is returned")
public void fromDtoToModel_whenGivenDtoIsNotNull_thenEquivalentModelIsReturned(OrderDto dtoToConvert) {
Order equivalentModel = converter.fromDtoToModel(dtoToC... | @ParameterizedTest
@MethodSource("fromDtoToModelTestCases")
@DisplayName("fromDtoToModel: when the given dto is not null then the equivalent model is returned")
public void fromDtoToModel_whenGivenDtoIsNotNull_thenEquivalentModelIsReturned(OrderDto dtoToConvert) {
Order equivalentModel = converter.fromDtoToModel(dtoToC... | Spring5Microservices | positive | 2,950 |
private excepthandlerType astForExceptClause(Node exc, Node body) {
try {
assert (exc.dfaType == DFAType.except_clause);
} catch (PyExceptions e) {
throw new PyExceptions(ErrorType.AST_ERROR, "AST Error", exc);
}
try {
assert (body.dfaType == DFAType.suite);
} catch (PyExceptions e) {
throw new PyExceptions(ErrorType.A... | private excepthandlerType astForExceptClause(Node exc, Node body) {
try {
assert (exc.dfaType == DFAType.except_clause);
} catch (PyExceptions e) {
throw new PyExceptions(ErrorType.AST_ERROR, "AST Error", exc);
}
<DeepExtract>
try {
assert (body.dfaType == DFAType.suite);
} catch (PyExceptions e) {
throw new PyExceptio... | JPython | positive | 2,952 |
public Criteria andNameLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name like", value));
return (Criteria) this;
} | public Criteria andNameLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "name" + " cannot be null");
}
criteria.add(new Criterion("name like", value));
</DeepExtract>
return (Criteria) this;
} | Online_Study_System | positive | 2,953 |
@Override
public void onUIRefreshComplete() {
mReleasePos = getCurrentPosY();
if (isUnderTouch()) {
mReleasePercent = mCurrentDragPercent;
} else {
if (mReleasePercent <= 0) {
mReleasePercent = 1.0f * getCurrentPosY() / getOffsetToKeepHeaderWhileLoading();
}
mReleasePercent = mReleasePercent * getCurrentPosY() / mRelea... | @Override
public void onUIRefreshComplete() {
mReleasePos = getCurrentPosY();
<DeepExtract>
if (isUnderTouch()) {
mReleasePercent = mCurrentDragPercent;
} else {
if (mReleasePercent <= 0) {
mReleasePercent = 1.0f * getCurrentPosY() / getOffsetToKeepHeaderWhileLoading();
}
mReleasePercent = mReleasePercent * getCurrentP... | cygmodule | positive | 2,954 |
@Test
public void shouldBuildPythonFunctionWithDependenciesWithDocker() {
GenericContainer genericContainer = startAndGetContainer(greengrassITShared.getLifxDeploymentCommand(Optional.empty()));
waitForContainerToFinish(genericContainer);
System.out.println(genericContainer.getLogs());
MatcherAssert.assertThat(genericC... | @Test
public void shouldBuildPythonFunctionWithDependenciesWithDocker() {
<DeepExtract>
GenericContainer genericContainer = startAndGetContainer(greengrassITShared.getLifxDeploymentCommand(Optional.empty()));
waitForContainerToFinish(genericContainer);
System.out.println(genericContainer.getLogs());
MatcherAssert.asser... | aws-greengrass-provisioner | positive | 2,955 |
@Test(description = "Test for empty form submission")
public void emptyFormTest() {
firstNameField.clear();
lastNameField.clear();
emailField.clear();
userNameField.clear();
firstNameField.sendKeys("");
lastNameField.sendKeys("");
emailField.sendKeys("");
userNameField.sendKeys("");
addUserButton.click();
WebElement al... | @Test(description = "Test for empty form submission")
public void emptyFormTest() {
<DeepExtract>
firstNameField.clear();
lastNameField.clear();
emailField.clear();
userNameField.clear();
</DeepExtract>
firstNameField.sendKeys("");
lastNameField.sendKeys("");
emailField.sendKeys("");
userNameField.sendKeys("");
addUser... | product-iots | positive | 2,956 |
@Test
public void testParse_PHP() throws ParseException {
final DateFormat dateFormat = new CompositeDateFormat();
final double delta = date.getTime() - dateFormat.parse("Thu March 07 21:26:05 GMT-05:00 2013").getTime();
final String msg = "expected=" + date + " actual=" + dateFormat.parse("Thu March 07 21:26:05 GMT-05... | @Test
public void testParse_PHP() throws ParseException {
final DateFormat dateFormat = new CompositeDateFormat();
final double delta = date.getTime() - dateFormat.parse("Thu March 07 21:26:05 GMT-05:00 2013").getTime();
final String msg = "expected=" + date + " actual=" + dateFormat.parse("Thu March 07 21:26:05 GMT-05... | jesque | positive | 2,958 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.