id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
40,301 | package com.jetbrains.python.testing.attest;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.*;
import com.intellij.execution.runners.ExecutionEnvironment;
<BUG>import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.util.InvalidDataException;</BUG>
import com.intellij.openapi.util.WriteExternalException;
import com.jetbrains.python.PyBundle;
import com.jetbrains.python.sdk.PythonSdkType;
| import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.InvalidDataException;
|
40,302 | package com.jetbrains.python.testing.nosetest;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.configurations.*;
import com.intellij.execution.runners.ExecutionEnvironment;
<BUG>import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.util.InvalidDataException;</BUG>
import com.intellij.openapi.util.JDOMExternalizerUtil;
import com.intellij.openapi.util.WriteExternalException;
import com.jetbrains.python.PyBundle;
| import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.InvalidDataException;
|
40,303 | myParams = pattern;
}
@Override
public void checkConfiguration() throws RuntimeConfigurationException {
super.checkConfiguration();
<BUG>if (!VFSTestFrameworkListener.getInstance().isNoseTestInstalled(PythonSdkType.findSdkByPath(getInterpreterPath())))
throw new RuntimeConfigurationWarning(PyBundle.message("runcfg.testing.no.test.framework", "nosetest"));</BUG>
}
public boolean useParam() {
return useParam;
| Sdk sdkPath = PythonSdkType.findSdkByPath(getInterpreterPath());
if (sdkPath != null && !VFSTestFrameworkListener.getInstance().isNoseTestInstalled(sdkPath))
throw new RuntimeConfigurationWarning(PyBundle.message("runcfg.testing.no.test.framework", "nosetest"));
|
40,304 | public NotDocSet(DocSet set, int max) {
super(max);
this.set = set;
}
@Override public boolean isCacheable() {
<BUG>return set.isCacheable();
}</BUG>
@Override public boolean get(int doc) throws IOException {
return !set.get(doc);
}
| return false;
|
40,305 | else
description+="\n\rIt also looks dead.";
final MOB newMOB=CMClass.getMOB("GenUndead");
newMOB.setName(race+((mob==null)?" poltergeist":" ghost"));
newMOB.setDescription(description);
<BUG>newMOB.setDisplayText(L("@x1 is here",newMOB.Name()));
newMOB.basePhyStats().setLevel(getUndeadLevel(mob,level,body.phyStats().level()));</BUG>
newMOB.baseCharStats().setStat(CharStats.STAT_GENDER,body.charStats().getStat(CharStats.STAT_GENDER));
newMOB.baseCharStats().setMyRace(CMClass.getRace("Spirit"));
newMOB.baseCharStats().setBodyPartsFromStringAfterRace(body.charStats().getBodyPartsAsString());
| if(mob == null)
newMOB.basePhyStats().setLevel(body.phyStats().level());
newMOB.basePhyStats().setLevel(getUndeadLevel(mob,level,body.phyStats().level()));
|
40,306 | else
description+="\n\rIt also looks dead.";
final MOB newMOB=CMClass.getMOB("GenUndead");
newMOB.setName(L("@x1 skeleton",race));
newMOB.setDescription(description);
<BUG>newMOB.setDisplayText(L("@x1 skeleton is here",race));
newMOB.basePhyStats().setLevel(getUndeadLevel(mob,level,body.phyStats().level()));</BUG>
newMOB.baseCharStats().setStat(CharStats.STAT_GENDER,body.charStats().getStat(CharStats.STAT_GENDER));
newMOB.baseCharStats().setMyRace(CMClass.getRace("Skeleton"));
newMOB.baseCharStats().setBodyPartsFromStringAfterRace(body.charStats().getBodyPartsAsString());
| if(mob == null)
newMOB.basePhyStats().setLevel(body.phyStats().level());
newMOB.basePhyStats().setLevel(getUndeadLevel(mob,level,body.phyStats().level()));
|
40,307 | newMOB.baseState().setMovement(CMLib.leveler().getLevelMove(newMOB));
newMOB.basePhyStats().setArmor(CMLib.leveler().getLevelMOBArmor(newMOB));
newMOB.addNonUninvokableEffect(CMClass.getAbility("Prop_ModExperience"));
newMOB.baseState().setMana(0);
final Behavior B=CMClass.getBehavior("Aggressive");
<BUG>if(B!=null)
{</BUG>
B.setParms("+NAMES \"-"+mob.Name()+"\" -LEVEL +>"+newMOB.basePhyStats().level());
newMOB.addBehavior(B);
}
| if((mob!=null)&&(B!=null))
{
|
40,308 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
40,309 | import java.net.URI;
import java.util.Calendar;
import java.util.Date;
import java.util.Formatter;
import java.util.List;
<BUG>import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;</BUG>
import org.suigeneris.jrcs.rcs.Version;
import org.xwiki.rest.Relations;
| [DELETED] |
40,310 | if (home != null) {
space.setHome(home.getPrefixedFullName());
space.setXwikiRelativeUrl(home.getURL("view"));
space.setXwikiAbsoluteUrl(home.getExternalURL("view"));
}
<BUG>String pagesUri = UriBuilder.fromUri(baseUri).path(PagesResource.class).build(wikiName, spaceName).toString();
</BUG>
Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
| String pagesUri = uri(baseUri, PagesResource.class, wikiName, spaceName);
|
40,311 | Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
<BUG>String homeUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(wikiName, spaceName, home.getName())
.toString();</BUG>
Link homeLink = objectFactory.createLink();
| String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
|
40,312 | .toString();</BUG>
Link homeLink = objectFactory.createLink();
homeLink.setHref(homeUri);
homeLink.setRel(Relations.HOME);
space.getLinks().add(homeLink);
<BUG>}
String searchUri =
UriBuilder.fromUri(baseUri).path(SpaceSearchResource.class).build(wikiName, spaceName).toString();</BUG>
Link searchLink = objectFactory.createLink();
searchLink.setHref(searchUri);
| Link pagesLink = objectFactory.createLink();
pagesLink.setHref(pagesUri);
pagesLink.setRel(Relations.PAGES);
space.getLinks().add(pagesLink);
if (home != null) {
String homeUri = uri(baseUri, PageResource.class, wikiName, spaceName, home.getName());
String searchUri = uri(baseUri, SpaceSearchResource.class, wikiName, spaceName);
|
40,313 | if (!languages.isEmpty()) {
if (!doc.getDefaultLanguage().equals("")) {
translations.setDefault(doc.getDefaultLanguage());
Translation translation = objectFactory.createTranslation();
translation.setLanguage(doc.getDefaultLanguage());
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
40,314 | }
}
for (String language : languages) {
Translation translation = objectFactory.createTranslation();
translation.setLanguage(language);
<BUG>String pageTranslationUri =
UriBuilder.fromUri(baseUri).path(PageTranslationResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();</BUG>
Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
| uri(baseUri, PageTranslationResource.class, doc.getWiki(), doc.getSpace(), doc.getName(), language);
|
40,315 | Link pageTranslationLink = objectFactory.createLink();
pageTranslationLink.setHref(pageTranslationUri);
pageTranslationLink.setRel(Relations.PAGE);
translation.getLinks().add(pageTranslationLink);
String historyUri =
<BUG>UriBuilder.fromUri(baseUri).path(PageTranslationHistoryResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), language).toString();
Link historyLink = objectFactory.createLink();</BUG>
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
| uri(baseUri, PageTranslationHistoryResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
language);
Link historyLink = objectFactory.createLink();
|
40,316 | pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
<BUG>}
String spaceUri =
UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
| String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
|
40,317 | UriBuilder.fromUri(baseUri).path(SpaceResource.class).build(doc.getWiki(), doc.getSpace()).toString();</BUG>
Link spaceLink = objectFactory.createLink();
spaceLink.setHref(spaceUri);
spaceLink.setRel(Relations.SPACE);
pageSummary.getLinks().add(spaceLink);
<BUG>if (parent != null) {
String parentUri =
UriBuilder.fromUri(baseUri).path(PageResource.class)
.build(parent.getWiki(), parent.getSpace(), parent.getName()).toString();</BUG>
Link parentLink = objectFactory.createLink();
| pageSummary.setParent(doc.getParent());
if (parent != null && !parent.isNew()) {
pageSummary.setParentId(parent.getPrefixedFullName());
} else {
pageSummary.setParentId("");
}
String spaceUri = uri(baseUri, SpaceResource.class, doc.getWiki(), doc.getSpace());
String parentUri = uri(baseUri, PageResource.class, parent.getWiki(), parent.getSpace(), parent.getName());
|
40,318 | Link historyLink = objectFactory.createLink();
historyLink.setHref(historyUri);
historyLink.setRel(Relations.HISTORY);
pageSummary.getLinks().add(historyLink);
if (!doc.getChildren().isEmpty()) {
<BUG>String pageChildrenUri =
UriBuilder.fromUri(baseUri).path(PageChildrenResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link pageChildrenLink = objectFactory.createLink();
pageChildrenLink.setHref(pageChildrenUri);
| uri(baseUri, PageChildrenResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
40,319 | objectsLink.setRel(Relations.OBJECTS);
pageSummary.getLinks().add(objectsLink);
}
com.xpn.xwiki.api.Object tagsObject = doc.getObject("XWiki.TagClass", 0);
if (tagsObject != null) {
<BUG>if (tagsObject.getProperty("tags") != null) {
String tagsUri =
UriBuilder.fromUri(baseUri).path(PageTagsResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName()).toString();</BUG>
Link tagsLink = objectFactory.createLink();
| String tagsUri = uri(baseUri, PageTagsResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
40,320 | tagsLink.setHref(tagsUri);
tagsLink.setRel(Relations.TAGS);
pageSummary.getLinks().add(tagsLink);
}
}
<BUG>String syntaxesUri = UriBuilder.fromUri(baseUri).path(SyntaxesResource.class).build().toString();
Link syntaxesLink = objectFactory.createLink();</BUG>
syntaxesLink.setHref(syntaxesUri);
syntaxesLink.setRel(Relations.SYNTAXES);
pageSummary.getLinks().add(syntaxesLink);
| String syntaxesUri = uri(baseUri, SyntaxesResource.class);
Link syntaxesLink = objectFactory.createLink();
|
40,321 | }
return historySummary;
}
private static void fillAttachment(Attachment attachment, ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Document doc = xwikiAttachment.getDocument();
attachment.setId(String.format("%s@%s", doc.getPrefixedFullName(), xwikiAttachment.getFilename()));
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
40,322 | Calendar calendar = Calendar.getInstance();
calendar.setTime(xwikiAttachment.getDate());
attachment.setDate(calendar);
attachment.setXwikiRelativeUrl(xwikiRelativeUrl);
attachment.setXwikiAbsoluteUrl(xwikiAbsoluteUrl);
<BUG>String pageUri =
UriBuilder.fromUri(baseUri).path(PageResource.class).build(doc.getWiki(), doc.getSpace(), doc.getName())
.toString();</BUG>
Link pageLink = objectFactory.createLink();
| String pageUri = uri(baseUri, PageResource.class, doc.getWiki(), doc.getSpace(), doc.getName());
|
40,323 | }
return attachmentUri;
}</BUG>
public static Attachment createAttachment(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = objectFactory.createAttachment();
fillAttachment(attachment, objectFactory, baseUri, xwikiAttachment, xwikiRelativeUrl, xwikiAbsoluteUrl,
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
40,324 | attachmentLink.setRel(Relations.ATTACHMENT_DATA);
attachment.getLinks().add(attachmentLink);
return attachment;
}
public static Attachment createAttachmentAtVersion(ObjectFactory objectFactory, URI baseUri,
<BUG>com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl,
XWiki xwikiApi, Boolean withPrettyNames)
{</BUG>
Attachment attachment = new Attachment();
| com.xpn.xwiki.api.Attachment xwikiAttachment, String xwikiRelativeUrl, String xwikiAbsoluteUrl, XWiki xwikiApi,
{
|
40,325 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>propertiesUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertiesResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
}
| fillObjectSummary(objectSummary, objectFactory, baseUri, doc, xwikiObject, xwikiApi, withPrettyNames);
Link objectLink = getObjectLink(objectFactory, baseUri, doc, xwikiObject, useVersion, Relations.OBJECT);
objectSummary.getLinks().add(objectLink);
String propertiesUri;
if (useVersion) {
uri(baseUri, ObjectPropertiesAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
40,326 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(), xwikiObject.getNumber(), propertyClass.getName())
.toString();</BUG>
} else {
<BUG>propertyUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectPropertyResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber(), propertyClass.getName()).toString();</BUG>
}
| propertiesUri =
uri(baseUri, ObjectPropertiesResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
40,327 | .build(doc.getWiki(), doc.getSpace(), doc.getName(), doc.getVersion(),
xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
} else {
<BUG>objectUri =
UriBuilder
.fromUri(baseUri)
.path(ObjectResource.class)
.build(doc.getWiki(), doc.getSpace(), doc.getName(), xwikiObject.getClassName(),
xwikiObject.getNumber()).toString();</BUG>
}
| private static Link getObjectLink(ObjectFactory objectFactory, URI baseUri, Document doc, BaseObject xwikiObject,
boolean useVersion, String relation)
String objectUri;
if (useVersion) {
uri(baseUri, ObjectAtPageVersionResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
doc.getVersion(), xwikiObject.getClassName(), xwikiObject.getNumber());
uri(baseUri, ObjectResource.class, doc.getWiki(), doc.getSpace(), doc.getName(),
xwikiObject.getClassName(), xwikiObject.getNumber());
|
40,328 | Link propertyLink = objectFactory.createLink();
propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
<BUG>}
String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG>
Link classLink = objectFactory.createLink();
classLink.setHref(classUri);
| String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
|
40,329 | String classUri =
UriBuilder.fromUri(baseUri).path(ClassResource.class).build(wikiName, xwikiClass.getName()).toString();</BUG>
Link classLink = objectFactory.createLink();
classLink.setHref(classUri);
classLink.setRel(Relations.SELF);
<BUG>clazz.getLinks().add(classLink);
String propertiesUri =
UriBuilder.fromUri(baseUri).path(ClassPropertiesResource.class).build(wikiName, xwikiClass.getName())
.toString();</BUG>
Link propertyLink = objectFactory.createLink();
| propertyLink.setHref(propertyUri);
propertyLink.setRel(Relations.SELF);
property.getLinks().add(propertyLink);
clazz.getProperties().add(property);
}
String classUri = uri(baseUri, ClassResource.class, wikiName, xwikiClass.getName());
String propertiesUri = uri(baseUri, ClassPropertiesResource.class, wikiName, xwikiClass.getName());
|
40,330 | <BUG>package org.xwiki.rest.internal;
import org.apache.commons.lang3.StringUtils;</BUG>
import org.xwiki.component.manager.ComponentManager;
import org.xwiki.context.Execution;
import org.xwiki.model.reference.EntityReferenceSerializer;
| import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.lang3.StringUtils;
|
40,331 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
40,332 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale());
</BUG>
NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression);
dow.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) {
| import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
40,333 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
| integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
40,334 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
40,335 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.Collections;
import java.util.List;
import java.util.Set;</BUG>
class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
| [DELETED] |
40,336 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
40,337 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.List;</BUG>
class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
| package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
40,338 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
this.year = year;</BUG>
this.month = month;
}
| Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
40,339 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){
return source.mapTo(weekday, target);
| public static final WeekDay JAVA8 = new WeekDay(1, false);
|
40,340 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.getValues().get(0);
| ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
40,341 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
40,342 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
40,343 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
40,344 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(date);
| [DELETED] |
40,345 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
40,346 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;</BUG>
class EveryFieldValueGenerator extends FieldValueGenerator {
| package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
40,347 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
40,348 | keywordDescriptionMap.put ("Tabu search (TS)" , Pair.of ("An example where a heuristic using a tabu search approach is used" , "ts"));
keywordDescriptionMap.put ("TCP" , Pair.of ("An example where the Transmission Control Protocol (TCP) is involved" , "tcp"));
keywordDescriptionMap.put ("Topology assignment (TA)" , Pair.of ("An example where the links and/or nodes in the network, are algorithm outputs." , "ta"));
keywordDescriptionMap.put ("Transmission power optimization" , Pair.of ("An example where the links are wireless links, and its transmission power is optimized." , "transmissionPower"));
keywordDescriptionMap.put ("Wireless" , Pair.of ("An example focused on the design of a wireless network" , "wireless"));
<BUG>keywordDescriptionMap.put ("WDM" , Pair.of ("An example where Wavelength Division Multiplexing (WDM) technology is used" , "wdm"));
}</BUG>
static
{
initializeKeywordDescriptionMap();
| keywordDescriptionMap.put ("NFV" , Pair.of ("An example in the context of Network Function Virtualizatin (NFV)" , "nfv"));
}
|
40,349 | Map<String,List<String>> algorithmToKeywordsMap = new HashMap<String,List<String>> ();
Map<String,String> algorithmToFirstSentence = new HashMap<String,String> ();
for (int i = 0; i < classes.length; i++)
{
final ClassDoc javaClass = classes [i];
<BUG>final String className = javaClass.qualifiedName();
final String firstSentenceThisClass = javaClass.firstSentenceTags() [0].text ();
</BUG>
algorithmToFirstSentence.put (className , firstSentenceThisClass);
algorithmToKeywordsMap.put (className , new LinkedList<String> ());
| final Tag [] firstSentenceTags = javaClass.firstSentenceTags();
if (firstSentenceTags.length == 0) System.out.println("A class without first sentence!!: " + className);
final String firstSentenceThisClass = (firstSentenceTags.length == 0)? "" : javaClass.firstSentenceTags() [0].text ();
|
40,350 | if (!keywordsToAlgorithmsMap.containsKey(keywordName)) keywordsToAlgorithmsMap.put (keywordName , new LinkedList<String> ());
keywordsToAlgorithmsMap.get(keywordName).add (className);
algorithmToKeywordsMap.get (className).add (keywordName);
}
}
<BUG>System.out.println ("keywordsToAlgorithmsMap: " + keywordsToAlgorithmsMap);
System.out.println ("algorithmToKeywordsMap: " + algorithmToKeywordsMap);
System.out.println ("keywords: " + keywordsToAlgorithmsMap.keySet());</BUG>
String htmlFile = createHtml(keywordsToAlgorithmsMap , algorithmToKeywordsMap , algorithmToFirstSentence , outputFolder);
try
| [DELETED] |
40,351 | import java.util.List;
import java.util.Map;
import com.net2plan.interfaces.networkDesign.IAlgorithm;
import com.net2plan.interfaces.networkDesign.IReport;
import com.net2plan.interfaces.simulation.IEventGenerator;
<BUG>import com.net2plan.interfaces.simulation.IEventProcessor;
import com.net2plan.utils.StringUtils;</BUG>
import com.net2plan.utils.Triple;
import com.sun.javadoc.Tag;
import com.sun.tools.doclets.Taglet;
| import com.net2plan.utils.Pair;
import com.net2plan.utils.StringUtils;
|
40,352 | private static void writeContents(ClassDoc[] classes, String tagName , String outputFolder)
{
for (int i = 0; i < classes.length; i++)
{
final ClassDoc javaClass = classes [i];
<BUG>final String className = javaClass.qualifiedName();
final String firstSentenceThisClass = javaClass.firstSentenceTags() [0].text ();
</BUG>
algorithmToFirstSentence.put (className , firstSentenceThisClass);
algorithmToSectionsMap.put (className , new LinkedList<String> ());
| final Tag [] firstSentenceTags = javaClass.firstSentenceTags();
if (firstSentenceTags.length == 0) System.out.println("Create book sections: a class without first sentence class: " + className);
final String firstSentenceThisClass = (firstSentenceTags.length == 0)? "" : javaClass.firstSentenceTags() [0].text ();
|
40,353 | package com.net2plan.documentation;
import java.io.File;
<BUG>import java.util.Map;
import com.net2plan.interfaces.networkDesign.IAlgorithm;</BUG>
import com.net2plan.utils.StringUtils;
import com.net2plan.utils.Triple;
import com.sun.javadoc.Tag;
| import cern.colt.matrix.tdouble.*;
import com.net2plan.interfaces.networkDesign.IAlgorithm;
|
40,354 | package com.webcohesion.enunciate.modules.jackson.api.impl;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.webcohesion.enunciate.api.datatype.*;
<BUG>import com.webcohesion.enunciate.facets.FacetFilter;
import com.webcohesion.enunciate.modules.jackson.model.Member;</BUG>
import com.webcohesion.enunciate.modules.jackson.model.ObjectTypeDefinition;
import com.webcohesion.enunciate.modules.jackson.model.TypeDefinition;
import com.webcohesion.enunciate.modules.jackson.model.types.JsonClassType;
| import com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror;
import com.webcohesion.enunciate.modules.jackson.model.Member;
|
40,355 | return supertypes;
}
@Override
public List<DataTypeReference> getSubtypes() {
ArrayList<DataTypeReference> subtypes = new ArrayList<DataTypeReference>();
<BUG>String myClassName = this.typeDefinition.getQualifiedName().toString();
for (TypeDefinition td : this.typeDefinition.getContext().getTypeDefinitions()) {
if (td instanceof ObjectTypeDefinition) {
TypeMirror superclass = td.getSuperclass();
if (superclass instanceof DeclaredType && (((TypeElement) ((DeclaredType) superclass).asElement()).getQualifiedName().toString().equals(myClassName))) {</BUG>
subtypes.add(new DataTypeReferenceImpl(JsonTypeFactory.getJsonType(td.asType(), this.typeDefinition.getContext())));
| if (td instanceof ObjectTypeDefinition && !td.getQualifiedName().contentEquals(this.typeDefinition.getQualifiedName()) && ((DecoratedTypeMirror)td.asType()).isInstanceOf(this.typeDefinition)) {
|
40,356 | package com.webcohesion.enunciate.modules.jaxb.api.impl;
import com.webcohesion.enunciate.api.datatype.*;
import com.webcohesion.enunciate.api.datatype.Value;
<BUG>import com.webcohesion.enunciate.facets.FacetFilter;
import com.webcohesion.enunciate.modules.jaxb.model.*;</BUG>
import com.webcohesion.enunciate.modules.jaxb.model.types.XmlClassType;
import com.webcohesion.enunciate.modules.jaxb.model.types.XmlType;
import com.webcohesion.enunciate.modules.jaxb.model.types.XmlTypeFactory;
| import com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror;
import com.webcohesion.enunciate.modules.jaxb.model.*;
|
40,357 | package com.webcohesion.enunciate.modules.jackson1.api.impl;
import com.webcohesion.enunciate.api.datatype.*;
<BUG>import com.webcohesion.enunciate.facets.FacetFilter;
import com.webcohesion.enunciate.modules.jackson1.model.Member;</BUG>
import com.webcohesion.enunciate.modules.jackson1.model.ObjectTypeDefinition;
import com.webcohesion.enunciate.modules.jackson1.model.TypeDefinition;
import com.webcohesion.enunciate.modules.jackson1.model.types.JsonClassType;
| import com.webcohesion.enunciate.javac.decorations.type.DecoratedTypeMirror;
import com.webcohesion.enunciate.modules.jackson1.model.Member;
|
40,358 | return supertypes;
}
@Override
public List<DataTypeReference> getSubtypes() {
ArrayList<DataTypeReference> subtypes = new ArrayList<DataTypeReference>();
<BUG>String myClassName = this.typeDefinition.getQualifiedName().toString();
for (TypeDefinition td : this.typeDefinition.getContext().getTypeDefinitions()) {
if (td instanceof ObjectTypeDefinition) {
TypeMirror superclass = td.getSuperclass();
if (superclass instanceof DeclaredType && (((TypeElement) ((DeclaredType) superclass).asElement()).getQualifiedName().toString().equals(myClassName))) {</BUG>
subtypes.add(new DataTypeReferenceImpl(JsonTypeFactory.getJsonType(td.asType(), this.typeDefinition.getContext())));
| if (td instanceof ObjectTypeDefinition && !td.getQualifiedName().contentEquals(this.typeDefinition.getQualifiedName()) && ((DecoratedTypeMirror)td.asType()).isInstanceOf(this.typeDefinition)) {
|
40,359 | EditorCell_Collection result = jetbrains.mps.nodeEditor.cells.EditorCell_Collection.createIndent2(editorContext, node);
result.setBig(true);
result.getStyle().putAll(StyleRegistry.getInstance().getStyle("LINE_COMMENT"), 1);
result.addEditorCell(createCommentConstantCell(editorContext, node, true));
result.addEditorCell(mainCell);
<BUG>result.addEditorCell(createCommentConstantCell(editorContext, node, false));
return result;</BUG>
}
private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) {
EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
| result.setCellId("main_comment_collection");
return result;
|
40,360 | }
private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) {
EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
StyleImpl style = new StyleImpl();
style.set(left ? StyleAttributes.PUNCTUATION_RIGHT : StyleAttributes.PUNCTUATION_LEFT, 0, true);
<BUG>cell.getStyle().putAll(style, 0);
return cell;</BUG>
}
@Override
public EditorCell createInspectedCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node) {
| cell.setCellId(left ? "left_comment_constant" : "right_comment_constant");
return cell;
|
40,361 | import org.jetbrains.annotations.NotNull;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.openapi.editor.selection.Selection;
import jetbrains.mps.openapi.editor.selection.SingularSelection;
<BUG>import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG>
import org.jetbrains.mps.util.Condition;
import jetbrains.mps.editor.runtime.selection.SelectionUtil;
import jetbrains.mps.openapi.editor.selection.SelectionManager;
| import jetbrains.mps.openapi.editor.cells.EditorCell_Label;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
|
40,362 | import jetbrains.mps.editor.runtime.cells.AbstractCellAction;
import org.jetbrains.mps.openapi.model.SNode;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
<BUG>import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG>
import org.jetbrains.mps.util.Condition;
import jetbrains.mps.editor.runtime.selection.SelectionUtil;
import jetbrains.mps.openapi.editor.selection.SelectionManager;
| import jetbrains.mps.openapi.editor.cells.EditorCell_Label;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
|
40,363 | import piuk.blockchain.android.util.ViewUtils;
import piuk.blockchain.android.util.annotations.Thunk;
import static piuk.blockchain.android.ui.settings.SettingsFragment.EXTRA_SHOW_ADD_EMAIL_DIALOG;
public class MainActivity extends BaseAuthActivity implements BalanceFragment.Communicator,
MainViewModel.DataListener,
<BUG>SendFragment.OnBalanceFragmentInteractionListener {
private static final String TAG = MainActivity.class.getSimpleName();</BUG>
private static final String SUPPORT_URI = "http://support.blockchain.com/";
private static final int REQUEST_BACKUP = 2225;
| SendFragment.OnSendFragmentInteractionListener,
ReceiveFragment.OnReceiveFragmentInteractionListener {
private static final String TAG = MainActivity.class.getSimpleName();
|
40,364 | package piuk.blockchain.android.ui.customviews;
import android.app.Activity;
<BUG>import android.content.Context;
import android.util.AttributeSet;</BUG>
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
| import android.annotation.TargetApi;
import android.os.Build;
import android.util.AttributeSet;
|
40,365 | private static final int SCAN_PRIVX = 2008;
private static final int COOL_DOWN_MILLIS = 2 * 1000;
@Thunk ActivitySendBinding binding;
@Thunk SendViewModel viewModel;
@Thunk AlertDialog transactionSuccessDialog;
<BUG>private OnBalanceFragmentInteractionListener listener;
</BUG>
private CustomKeypad customKeypad;
private TextWatcher btcTextWatcher;
private TextWatcher fiatTextWatcher;
| private OnSendFragmentInteractionListener listener;
|
40,366 | public void onResume() {
super.onResume();
IntentFilter filter = new IntentFilter(BalanceFragment.ACTION_INTENT);
LocalBroadcastManager.getInstance(getActivity()).registerReceiver(receiver, filter);
if (listener != null) {
<BUG>listener.onBalanceFragmentStart();
</BUG>
}
}
@Override
| listener.onSendFragmentStart();
|
40,367 | </BUG>
}
@Override
public void onKeypadOpen() {
<BUG>((MainActivity) getActivity()).getBottomNavigationView().setExpanded(false, true);
</BUG>
}
private void setCustomKeypad() {
customKeypad = binding.keyboard;
customKeypad.setCallback(this);
| private void closeKeypad() {
customKeypad.setNumpadVisibility(View.GONE);
public void onKeypadClose() {
((MainActivity) getActivity()).getBottomNavigationView().restoreBottomNavigation();
((MainActivity) getActivity()).getBottomNavigationView().hideBottomNavigation();
|
40,368 |
listener = (OnBalanceFragmentInteractionListener) context;
</BUG>
} else {
<BUG>throw new RuntimeException(context + " must implement OnBalanceFragmentInteractionListener");
</BUG>
}
}
@Override
public void onDetach() {
| viewModel.destroy();
public void onAttach(Context context) {
super.onAttach(context);
if (context instanceof OnSendFragmentInteractionListener) {
listener = (OnSendFragmentInteractionListener) context;
throw new RuntimeException(context + " must implement OnSendFragmentInteractionListener");
|
40,369 | @Override
public void onDetach() {
super.onDetach();
listener = null;
}
<BUG>public interface OnBalanceFragmentInteractionListener {
void onBalanceFragmentClose();
void onBalanceFragmentStart();
</BUG>
}
| public void onDestroy() {
super.onDestroy();
viewModel.destroy();
|
40,370 | private static final int COOL_DOWN_MILLIS = 2 * 1000;
@Thunk ReceiveViewModel viewModel;
@Thunk ActivityReceiveBinding binding;
private CustomKeypad customKeypad;
private BottomSheetDialog bottomSheetDialog;
<BUG>private AddressAdapter addressAdapter;
@Thunk boolean textChangeAllowed = true;</BUG>
private boolean showInfoButton = false;
private String uri;
private long backPressed;
| private OnReceiveFragmentInteractionListener listener;
@Thunk boolean textChangeAllowed = true;
|
40,371 | import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.Logger;
import org.jitsi.util.*;
<BUG>import org.json.*;
</BUG>
public class ServerStoredContactListXivoImpl
extends ServerStoredContactList
implements Runnable
| import org.json.simple.*;
|
40,372 | logger.error("Error login authorization!");
return;
}
else if (classField.equals("login_pass_ok"))
{
<BUG>if(!sendCapas(incomingObject.getJSONArray("capalist")))
</BUG>
logger.error("Error send capas!");
return;
}
| if(!sendCapas((JSONArray)incomingObject.get("capalist")))
|
40,373 | if(connection == null || username == null)
return false;
JSONObject obj = new JSONObject();
try
{
<BUG>obj.accumulate("class","login_id");
obj.accumulate("company", "Jitsi");
</BUG>
String os = "x11";
| obj.put("class","login_id");
obj.put("company", "Jitsi");
|
40,374 | String os = "x11";
if(OSUtils.IS_WINDOWS)
os = "win";
else if(OSUtils.IS_MAC)
os = "mac";
<BUG>obj.accumulate("ident", username + "@" + os);
obj.accumulate("userid", username);
obj.accumulate("version", "9999");
obj.accumulate("xivoversion", "1.1");
</BUG>
return send(obj);
| obj.put("ident", username + "@" + os);
obj.put("userid", username);
obj.put("version", "9999");
obj.put("xivoversion", "1.1");
|
40,375 | catch (Exception e)
{
logger.error("Error login", e);
return false;
}
<BUG>}
private boolean authorize(String sessionId, String password)</BUG>
{
if(connection == null || sessionId == null || password == null)
return false;
| @SuppressWarnings("unchecked")
private boolean authorize(String sessionId, String password)
|
40,376 | if(connection == null || sessionId == null || password == null)
return false;
JSONObject obj = new JSONObject();
try
{
<BUG>obj.accumulate("class","login_pass");
obj.accumulate("hashedpassword",
</BUG>
Sha1Crypto.encode(sessionId + ":" + password));
| obj.put("class","login_pass");
obj.put("hashedpassword",
|
40,377 | if(connection == null || astid == null || xivoUserId == null)
return false;
JSONObject obj = new JSONObject();
try
{
<BUG>obj.accumulate("class","featuresget");
obj.accumulate("userid", astid + "/" + xivoUserId);
</BUG>
return send(obj);
| obj.put("class","featuresget");
obj.put("userid", astid + "/" + xivoUserId);
|
40,378 | catch (Exception e)
{
logger.error("Error send features get command", e);
return false;
}
<BUG>}
private boolean getPhoneList()</BUG>
{
JSONObject obj = new JSONObject();
try
| @SuppressWarnings("unchecked")
private boolean getPhoneList()
|
40,379 | parentGroup.setPersistent(true);
getRootGroup().addSubgroup(parentGroup);
fireGroupEvent(parentGroup,
ServerStoredGroupEvent.GROUP_CREATED_EVENT);
}
<BUG>String number = phone.getString("number");
</BUG>
Address address =
sipProvider.parseAddressString(number);
ContactSipImpl contact =
| String number = (String)phone.get("number");
|
40,380 | parentOperationSet.resolveContactID(address.toString());
if(contact == null)
{
contact = new ContactSipImpl(address, sipProvider);
contact.setDisplayName(
<BUG>phone.getString("firstname") + " "
+ phone.getString("lastname"));
contact.setResolved(true);</BUG>
parentGroup.addContact(contact);
fireContactAdded(parentGroup, contact);
| phone.get("firstname") + " "
+ phone.get("lastname"));
contact.setResolved(true);
|
40,381 | package org.jboss.as.model;
import org.jboss.as.services.path.AbsolutePathService;
import org.jboss.as.services.path.RelativePathService;
import org.jboss.msc.service.BatchBuilder;
<BUG>import org.jboss.msc.service.ServiceBuilder;
public class ServerPathAdd extends AbstractServerModelUpdate<Void> {</BUG>
private static final long serialVersionUID = -7255447870952892481L;
private final PathElementUpdate update;
public ServerPathAdd(PathElementUpdate update) {
| import org.jboss.msc.service.ServiceTarget;
public class ServerPathAdd extends AbstractServerModelUpdate<Void> {
|
40,382 | package org.jboss.as.model;
import java.util.concurrent.TimeUnit;
import org.jboss.as.deployment.scanner.DeploymentScannerService;
import org.jboss.msc.service.BatchBuilder;
<BUG>import org.jboss.msc.service.ServiceBuilder;
public class ServerDeploymentRepositoryAdd extends AbstractServerModelUpdate<Void> {</BUG>
private static final long serialVersionUID = -1611269698053636197L;
private static final String DEFAULT_NAME = "default";
private final String path;
| import org.jboss.msc.service.ServiceTarget;
public class ServerDeploymentRepositoryAdd extends AbstractServerModelUpdate<Void> {
|
40,383 | import java.util.Map;
import java.util.concurrent.ThreadFactory;
import org.jboss.msc.inject.Injector;
import org.jboss.msc.service.BatchBuilder;
import org.jboss.msc.service.ServiceBuilder;
<BUG>import org.jboss.msc.service.ServiceName;
public abstract class AbstractExecutorAdd extends AbstractThreadsSubsystemUpdate<Void> {</BUG>
private static final long serialVersionUID = 3661832034337989182L;
private final String name;
private final ScaledCount maxThreads;
| import org.jboss.msc.service.ServiceTarget;
public abstract class AbstractExecutorAdd extends AbstractThreadsSubsystemUpdate<Void> {
|
40,384 | import org.jboss.as.services.path.AbsolutePathService;
import org.jboss.as.services.path.RelativePathService;
import org.jboss.msc.service.BatchBuilder;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.Service;
<BUG>import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.StartContext;</BUG>
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.msc.service.ServiceController.Mode;
| import org.jboss.msc.service.ServiceTarget;
import org.jboss.msc.service.StartContext;
|
40,385 | private final InjectedValue<String> pathValue = new InjectedValue<String>();
private final InjectedValue<DeploymentScannerFactory> scannerFactory = new InjectedValue<DeploymentScannerFactory>();
public static ServiceName getServiceName(String repositoryName) {
return DeploymentScanner.BASE_SERVICE_NAME.append(repositoryName);
}
<BUG>public static ServiceBuilder<DeploymentScanner> addService(final BatchBuilder batchBuilder,
final String name, final String relativeTo, final String path, final int scanInterval, TimeUnit unit, final boolean scanEnabled) {</BUG>
final DeploymentScannerService service = new DeploymentScannerService(scanInterval, unit, scanEnabled);
final ServiceName serviceName = getServiceName(name);
final ServiceName pathService = serviceName.append("path");
| public static void addService(final ServiceTarget batchBuilder,
final String name, final String relativeTo, final String path, final int scanInterval, TimeUnit unit, final boolean scanEnabled) {
|
40,386 | if(relativeTo != null) {
RelativePathService.addService(pathService, path, relativeTo, batchBuilder);
} else {
AbsolutePathService.addService(pathService, path, batchBuilder);
}
<BUG>return batchBuilder.addService(serviceName, service)
.addDependency(pathService, String.class, service.pathValue)</BUG>
.addDependency(DeploymentScannerFactory.SERVICE_NAME, DeploymentScannerFactory.class, service.scannerFactory)
.setInitialMode(Mode.ACTIVE);
}
| .addDependency(pathService, String.class, service.pathValue)
|
40,387 | import org.jboss.logging.Logger;
import org.jboss.msc.service.BatchBuilder;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.ServiceController;
<BUG>import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.StartContext;</BUG>
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
| import org.jboss.msc.service.ServiceTarget;
import org.jboss.msc.service.StartContext;
|
40,388 | import java.net.InetAddress;
import org.jboss.as.model.socket.SocketBindingAdd;
import org.jboss.msc.service.BatchBuilder;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.Service;
<BUG>import org.jboss.msc.service.ServiceController.Mode;
import org.jboss.msc.service.StartContext;</BUG>
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
| import org.jboss.msc.service.ServiceTarget;
import org.jboss.msc.service.StartContext;
|
40,389 | import org.jboss.as.model.UpdateFailedException;
import org.jboss.as.model.UpdateResultHandler;
import org.jboss.as.services.net.SocketBinding;
import org.jboss.as.services.net.SocketBindingService;
import org.jboss.msc.service.BatchBuilder;
<BUG>import org.jboss.msc.service.ServiceBuilder;
public class SocketBindingAdd extends AbstractSocketBindingUpdate {</BUG>
private static final long serialVersionUID = -4940876367809265620L;
private final String name;
private final String interfaceName;
| import org.jboss.msc.service.ServiceTarget;
public class SocketBindingAdd extends AbstractSocketBindingUpdate {
|
40,390 | import org.jboss.as.model.ServerModel;
import org.jboss.as.standalone.client.api.deployment.ServerDeploymentManager;
import org.jboss.msc.service.BatchBuilder;
import org.jboss.msc.service.ServiceBuilder;
import org.jboss.msc.service.Service;
<BUG>import org.jboss.msc.service.ServiceController.Mode;
import org.jboss.msc.service.StartContext;</BUG>
import org.jboss.msc.service.StartException;
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
| import org.jboss.msc.service.ServiceTarget;
import org.jboss.msc.service.StartContext;
|
40,391 | package org.jboss.as.jmx;
import org.jboss.as.model.AbstractSubsystemUpdate;
import org.jboss.as.model.UpdateContext;
import org.jboss.as.model.UpdateFailedException;
import org.jboss.as.model.UpdateResultHandler;
<BUG>import org.jboss.msc.service.BatchBuilder;
public class JMXConnectorAdd extends AbstractSubsystemUpdate<JmxSubsystemElement, Void> {</BUG>
private static final long serialVersionUID = -1898250436998656765L;
private String serverBinding;
private String registryBinding;
| import org.jboss.msc.service.ServiceTarget;
public class JMXConnectorAdd extends AbstractSubsystemUpdate<JmxSubsystemElement, Void> {
|
40,392 | throw new IllegalArgumentException("null registry binding");
}
this.serverBinding = serverBinding;
this.registryBinding = registryBinding;
}
<BUG>protected <P> void applyUpdate(UpdateContext updateContext, UpdateResultHandler<? super Void, P> resultHandler, P param) {
final BatchBuilder builder = updateContext.getBatchBuilder();
JMXConnectorService.addService(builder, serverBinding, registryBinding)
.addListener(new UpdateResultHandler.ServiceStartListener<P>(resultHandler, param));
}</BUG>
public AbstractSubsystemUpdate<JmxSubsystemElement, ?> getCompensatingUpdate(JmxSubsystemElement original) {
| final ServiceTarget target = updateContext.getBatchBuilder().subTarget();
target.addListener(new UpdateResultHandler.ServiceStartListener<P>(resultHandler, param));
JMXConnectorService.addService(target, serverBinding, registryBinding);
|
40,393 | import org.jitsi.impl.neomedia.device.*;
import org.jitsi.service.resources.*;
import org.osgi.framework.*;
public class AudioDeviceConfigurationListener
extends AbstractDeviceConfigurationListener
<BUG>{
public AudioDeviceConfigurationListener(</BUG>
ConfigurationForm configurationForm)
{
super(configurationForm);
| private CaptureDeviceInfo captureDevice = null;
private CaptureDeviceInfo playbackDevice = null;
private CaptureDeviceInfo notificationDevice = null;
public AudioDeviceConfigurationListener(
|
40,394 | ResourceManagementService resources
= NeomediaActivator.getResources();
notificationService.fireNotification(
popUpEvent,
title,
<BUG>device.getName()
+ "\r\n"
</BUG>
+ resources.getI18NString(
"impl.media.configform"
| body
+ "\r\n\r\n"
|
40,395 | package com.gopivotal.test;
<BUG>import java.lang.management.ManagementFactory;
import java.util.Arrays;
import java.util.List;</BUG>
public class JavaMain {
| import java.lang.management.RuntimeMXBean;
import java.util.HashMap;
import java.util.Map;
|
40,396 | if (System.getenv().get("FAIL_INIT") != null) {
throw new RuntimeException("$FAIL_INIT caused initialisation to fail");
}
}
public static void main(String[] args) throws InterruptedException {
<BUG>List<String> inputArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
System.out.println("JVM arguments: " + inputArguments);
if (args != null) {
System.out.println("main method arguments: " + Arrays.asList(args));
}
System.out.println();</BUG>
if (System.getenv().get("FAIL_OOM") != null) {
| [DELETED] |
40,397 | package controllers;
import play.api.modules.spring.Spring;
import play.*;
import play.mvc.*;
import views.html.*;
<BUG>import util.Probe;
public class Application extends Controller {</BUG>
static {
if (System.getenv().get("FAIL_INIT") != null) {
throw new RuntimeException("$FAIL_INIT caused initialisation to fail");
| import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.HashMap;
import java.util.Map;
public class Application extends Controller {
|
40,398 | public static Result index() {
if (System.getenv().get("FAIL_OOM") != null) {
oom();
}
Probe probe = Spring.getBeanOfType(Probe.class);
<BUG>return ok(index.render("Input arguments: " + probe.getInputArguments()));
}</BUG>
private static void oom() {
while (true) {
int i = 1;
| RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
Map<String, Object> data = new HashMap<String, Object>();
data.put("Input Arguments", runtimeMxBean.getInputArguments());
data.put("Class Path", runtimeMxBean.getClassPath());
return ok(index.render(data.toString()));
|
40,399 | package com.gopivotal.test;
<BUG>import java.lang.management.ManagementFactory;
import java.util.List;
</BUG>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
| import java.lang.management.RuntimeMXBean;
import java.util.HashMap;
import java.util.Map;
|
40,400 | @ResponseBody
String root() {
if (System.getenv().get("FAIL_OOM") != null) {
oom();
}
<BUG>List<String> inputArguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
return "Input arguments: " + inputArguments;
}</BUG>
private static void oom() {
while (true) {
| RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean();
Map<String, Object> data = new HashMap<String, Object>();
data.put("Input Arguments", runtimeMxBean.getInputArguments());
data.put("Class Path", runtimeMxBean.getClassPath());
return data.toString();
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.