output stringlengths 64 73.2k | input stringlengths 208 73.3k | instruction stringclasses 1
value |
|---|---|---|
#fixed code
@Test
public void redirectOnError() throws Exception {
// @checkstyle MethodBodyCommentsCheck (30 lines)
//final Take take = new TkApp(new PropsFarm(new FkFarm()));
//final String message = "Internal application error";
//MatcherAssert.assertThat(
// ... | #vulnerable code
@Test
public void redirectOnError() throws Exception {
final Take take = new TkApp(new PropsFarm(new FkFarm()));
final String message = "Internal application error";
MatcherAssert.assertThat(
"Could not redirect on error",
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void assignsAndResigns() throws Exception {
final Project project = new FkProject();
final Orders orders = new Orders(new PropsFarm(), project).bootstrap();
final String job = "gh:yegor256/0pdd#13";
new Wbs(project).bootstrap()... | #vulnerable code
@Test
public void assignsAndResigns() throws Exception {
final Project project = new FkProject();
final Orders orders = new Orders(new PropsFarm(), project).bootstrap();
final String job = "gh:yegor256/0pdd#13";
new Wbs(project).boots... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
@SuppressWarnings("unchecked")
public void showsThatUserAlreadyHasMentor() throws IOException {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String mentor = "yoda";
final String appli... | #vulnerable code
@Test
@SuppressWarnings("unchecked")
public void showsThatUserAlreadyHasMentor() throws IOException {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String mentor = "yoda";
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final Request req) throws IOException {
final JsonObject callback = TkViber.json(
new InputStreamReader(req.body(), StandardCharsets.UTF_8)
);
if (callback.isEmpty()) {
throw new HttpException(H... | #vulnerable code
@Override
public Response act(final Request req) throws IOException {
final JsonObject json = TkViber.json(
new InputStreamReader(req.body(), StandardCharsets.UTF_8)
);
if (json.isEmpty()) {
throw new RsForward(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void closesClaims() throws Exception {
final AtomicBoolean done = new AtomicBoolean();
final Project raw = new FkProject();
final Flush flush = new Flush(
raw,
Collections.singletonList((pkt, xml) -> done.set(tr... | #vulnerable code
@Test
public void closesClaims() throws Exception {
final AtomicBoolean done = new AtomicBoolean();
final Project raw = new FkProject();
final Spin spin = new Spin(
raw,
Collections.singletonList((pkt, xml) -> done.set... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void recordsChangesToClaims() throws Exception {
final Bucket bucket = new FkBucket(
Files.createTempDirectory("").toFile(),
"the-bucket"
);
final Farm farm = new SyncFarm(
new FtFarm(new PropsFarm(n... | #vulnerable code
@Test
public void recordsChangesToClaims() throws Exception {
final Bucket bucket = new FkBucket(
Files.createTempDirectory("").toFile(),
"the-bucket"
);
try (final FakeMongo mongo = new FakeMongo().start()) {
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rechargeIsRequiredIfCashBalanceIsLessThanLocked()
throws Exception {
final Project project = new FkProject();
final String job = "gh:test/test#1";
new Wbs(project).bootstrap().add(job);
final PropsFarm farm = new P... | #vulnerable code
@Test
public void rechargeIsRequiredIfCashBalanceIsLessThanLocked()
throws Exception {
final Project project = new FkProject();
final String job = "gh:test/test#1";
new Wbs(project).bootstrap().add(job);
final PropsFarm farm =... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersIndexPage() throws Exception {
final Farm farm = FkFarm.props();
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(new View(farm, "/").xml()),
XhtmlMatchers.hasXPaths("/page/alive")
);
} | #vulnerable code
@Test
public void rendersIndexPage() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(new View(farm, "/").xml()),
XhtmlMatchers.hasXPaths("/page/alive"... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
Logger.info(this, "Farm is ready to start");
final ShutdownFarm.Hook shutdown = new ShutdownFarm.Hook();
final ClaimGuts cgts = new ClaimGuts();
final TestLocks locks = ... | #vulnerable code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Path temp = Paths.get("./s3farm").normalize();
if (!temp.toFile().mkdir()) {
throw new IllegalStateException(
String.format(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public double take(final String login, final StringBuilder log)
throws IOException {
final int total = new Agenda(this.pmo, login).bootstrap().jobs().size();
final double rate;
final int max = new Options(this.pmo, login).bootstra... | #vulnerable code
@Override
public double take(final String login, final StringBuilder log)
throws IOException {
final int total = new Agenda(this.pmo, login).bootstrap().jobs().size();
final double rate;
final int max = new Options(this.pmo, login).bo... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public boolean pause(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
return !Boolean.parseBoolean(
new Xocument(item.path()).xpath(
String.format(
... | #vulnerable code
public boolean pause(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par("Project %s doesn't exist").say(pid)
);
}
try (final Item item = this.item())... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void modifiesProject() throws Exception {
final Item item = new FkItem();
final String pid = "34EA54SZZ";
try (final Catalog catalog = new Catalog(item)) {
catalog.bootstrap();
catalog.add("34EA54SW9");
... | #vulnerable code
@Test
public void modifiesProject() throws Exception {
final Item item = new FkItem();
final Catalog catalog = new Catalog(item);
catalog.bootstrap();
catalog.add("34EA54SW9", "2017/01/34EA54SW9/");
catalog.add("34EA54S87", "2... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void removesImpediment() throws Exception {
final Project project = new FkProject();
final PropsFarm farm = new PropsFarm();
final Impediments imp = new Impediments(farm, project).bootstrap();
final String job = "gh:test/test#2... | #vulnerable code
@Test
public void removesImpediment() throws Exception {
final Project project = new FkProject();
final PropsFarm farm = new PropsFarm();
final Impediments imp = new Impediments(farm, project).bootstrap();
final String job = "gh:test/... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void wallet(final String uid, final String bank,
final String wallet) throws IOException {
if (!bank.matches("paypal|btc|bch|eth|ltc")) {
throw new SoftException(
new Par(
"Bank name `%s` is invalid, we ac... | #vulnerable code
public void wallet(final String uid, final String bank,
final String wallet) throws IOException {
if (!bank.matches("paypal")) {
throw new SoftException(
new Par(
"Bank name `%s` is invalid,",
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(FkFarm.props());
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
new HmRs... | #vulnerable code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(new PropsFarm(new FkFarm()));
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = FkFarm.props();
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser.WithInit(
... | #vulnerable code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser.WithIni... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public boolean hasLink(final String pid, final String rel,
final String href) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
return !new Xocument(item.path()).nodes(
String.format(
... | #vulnerable code
public boolean hasLink(final String pid, final String rel,
final String href) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't chec... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public Cash fee(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
final Iterator<String> fees = new Xocument(item.path()).xpath(
String.format("/catalog/project[@id='%s']/fee/text()",... | #vulnerable code
public Cash fee(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get fee"
).say(pid)
);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void parsesJson() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Take take = new TkGithub(
farm, (frm, github, event) -> "nothing"
);
MatcherAssert.assertThat(
take.act(
... | #vulnerable code
@Test
public void parsesJson() throws Exception {
MatcherAssert.assertThat(
new TkGithub(
new PropsFarm(),
new Rebound.Fake("nothing")
).act(
new RqWithBody(
new RqFa... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersHtmlAwardsPageForFirefox() throws Exception {
final Farm farm = FkFarm.props();
final String user = "yegor256";
final int points = 1234;
new Awards(farm, user).bootstrap()
.add(new FkProject(), points, "... | #vulnerable code
@Test
public void rendersHtmlAwardsPageForFirefox() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String user = "yegor256";
final int points = 1234;
new Awards(farm, user).bootstrap()
.add(new FkP... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void retrievesProps() throws Exception {
MatcherAssert.assertThat(
new Props(FkFarm.props()).get("/props/testing"),
Matchers.equalTo("yes")
);
} | #vulnerable code
@Test
public void retrievesProps() throws Exception {
MatcherAssert.assertThat(
new Props(new PropsFarm(new FkFarm())).get("/props/testing"),
Matchers.equalTo("yes")
);
}
#location 3
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void givesBonus() throws Exception {
final Speed speed = new Speed(
new FkFarm(new FkProject()), "amihaiemil"
).bootstrap();
final String job = "gh:bonus/fast#1";
speed.add("TST100006", job, Duration.ofDays(1).toMin... | #vulnerable code
@Test
public void givesBonus() throws Exception {
final FkProject project = new FkProject();
final FkFarm farm = new FkFarm(project);
final Speed speed = new Speed(farm, "amihaiemil").bootstrap();
final String job = "gh:bonus/fast#1";... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void parsesJson() throws Exception {
MatcherAssert.assertThat(
new TkGithub(
new PropsFarm(),
new Rebound.Fake("nothing")
).act(
new RqWithBody(
new RqFake("PO... | #vulnerable code
@Test
public void parsesJson() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Take take = new TkGithub(
farm, (frm, github, event) -> "nothing"
);
MatcherAssert.assertThat(
take.act(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(uid, In... | #vulnerable code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(u... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void registerImpediment() throws Exception {
final Project project = new FkProject();
final Impediments imp = new Impediments(new PropsFarm(), project)
.bootstrap();
final String job = "gh:test/test#1";
new Wbs(proj... | #vulnerable code
@Test
public void registerImpediment() throws Exception {
final Project project = new FkProject();
final Impediments imp = new Impediments(new PropsFarm(), project)
.bootstrap();
final String job = "gh:test/test#1";
new Wb... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void setsSpeed() throws Exception {
final People people =
new People(new FkFarm(new FkProject())).bootstrap();
final String uid = "speed";
people.invite(uid, uid);
final double speed = 5.5;
people.speed(uid,... | #vulnerable code
@Test
public void setsSpeed() throws Exception {
final FkFarm farm = new FkFarm(new FkProject());
final People people = new People(farm).bootstrap();
final String uid = "speed";
people.invite(uid, uid);
final double speed = 5.... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public int reputation(final String uid) throws IOException {
this.checkExisting(uid);
try (final Item item = this.item()) {
return new NumberOf(
new Xocument(item.path()).xpath(
String.format(
... | #vulnerable code
public int reputation(final String uid) throws IOException {
if (!this.exists(uid)) {
throw new IllegalArgumentException(
new Par("Person @%s doesn't exist").say(uid)
);
}
try (final Item item = this.item()... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void estimatesJobs() throws Exception {
final Project project = new FkProject();
final PropsFarm farm = new PropsFarm();
new Ledger(farm, project).bootstrap().add(
new Ledger.Transaction(
new Cash.S("$500"),... | #vulnerable code
@Test
public void estimatesJobs() throws Exception {
final Project project = new FkProject();
final PropsFarm farm = new PropsFarm();
new Ledger(farm, project).bootstrap().add(
new Ledger.Transaction(
new Cash.S("$... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public String title(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
final Iterator<String> items = new Xocument(item.path())
.xpath(
String.format(
... | #vulnerable code
public String title(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get title"
).say(pid)
);... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptsRelease() throws Exception {
final int id = 1;
final String tag = "0.0.1";
final Farm farm = new PropsFarm();
final Github github = new MkGithub().relogin("test");
github.repos().create(new Repos.RepoCreate(... | #vulnerable code
@Test
public void acceptsRelease() throws Exception {
final int id = 1;
final String tag = "0.0.1";
MatcherAssert.assertThat(
new RbRelease().react(
new FkFarm(),
new MkGithub(),
Jso... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void recordsChangesToClaims() throws Exception {
final Bucket bucket = new FkBucket(
Files.createTempDirectory("").toFile(),
"the-bucket"
);
final Farm farm = new SyncFarm(
new FtFarm(new PropsFarm(n... | #vulnerable code
@Test
public void recordsChangesToClaims() throws Exception {
final Bucket bucket = new FkBucket(
Files.createTempDirectory("").toFile(),
"the-bucket"
);
try (final FakeMongo mongo = new FakeMongo().start()) {
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void reactsToMessage() throws Exception {
final Reaction reaction = Mockito.mock(Reaction.class);
final FkFarm farm = new FkFarm();
final VbBot bot = new VbBot();
final String callback = new TextOf(
TkViberTest.clas... | #vulnerable code
@Test
public void reactsToMessage() throws Exception {
final Reaction reaction = Mockito.mock(Reaction.class);
new TkViber(new FkFarm(), reaction).act(
new RqWithBody(
new RqFake("POST", "/"),
new TextOf(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(uid, In... | #vulnerable code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(u... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"Hey, we are in the testing mode!"
);
}
... | #vulnerable code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"Hey, we are in the testing mode!"
);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(uid, In... | #vulnerable code
@Test
public void rejectsIfAlreadyApplied() throws Exception {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
people.apply(uid, Instant.n... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersListOfClaims() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | #vulnerable code
@Test
public void rendersListOfClaims() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.format("... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void parsesJson() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Take take = new TkGithub(
farm, (frm, github, event) -> "nothing"
);
MatcherAssert.assertThat(
take.act(
... | #vulnerable code
@Test
public void parsesJson() throws Exception {
MatcherAssert.assertThat(
new TkGithub(
new PropsFarm(),
new Rebound.Fake("nothing")
).act(
new RqWithBody(
new RqFa... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersAgendaPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | #vulnerable code
@Test
public void rendersAgendaPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String uid = "yegor256";
final People people = new People(farm).bootstrap();
people.touch(uid);
people.invite(uid, "... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void jobs(final String uid, final int jobs)
throws IOException {
this.checkExisting(uid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives().xpath(
String.form... | #vulnerable code
public void jobs(final String uid, final int jobs)
throws IOException {
if (!this.exists(uid)) {
throw new IllegalArgumentException(
new Par("Person @%s doesn't exist").say(uid)
);
}
try (final Item... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqProject(this.farm, req, "PO");
final RqFormSmart form = new RqFormSmart(new RqGreedy(req));
final String email = form.single("email");
final... | #vulnerable code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqProject(this.farm, req, "PO");
final RqFormSmart form = new RqFormSmart(new RqGreedy(req));
final String email = form.single("email");
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public String pay(final String target, final Cash amount,
final String details) throws IOException {
final Props props = new Props(this.farm);
final AdaptivePaymentsService service = new AdaptivePaymentsService(
new SolidMap<S... | #vulnerable code
@Override
public String pay(final String target, final Cash amount,
final String details) throws IOException {
if (amount.compareTo(new Cash.S("$20")) < 0) {
throw new SoftException(
new Par(
"The amoun... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void removesOrder() throws Exception {
final Project project = new FkProject();
final Orders orders = new Orders(new PropsFarm(), project).bootstrap();
final String job = "gh:yegor256/0pdd#13";
new Wbs(project).bootstrap().add(... | #vulnerable code
@Test
public void removesOrder() throws Exception {
final Project project = new FkProject();
final Orders orders = new Orders(new PropsFarm(), project).bootstrap();
final String job = "gh:yegor256/0pdd#13";
new Wbs(project).bootstrap(... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser.WithInit(
... | #vulnerable code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersReport() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final String uid = "yegor256";
new ClaimOut()
.type("Order was given")
.param("login", uid)
.postTo(... | #vulnerable code
@Test
public void rendersReport() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final String uid = "yegor256";
new ClaimOut()
.type("Order was given")
.param("login", uid)
.p... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersProfilePageWithRateInFirefox() throws Exception {
final Farm farm = FkFarm.props();
final double rate = 99.99;
final People people = new People(farm).bootstrap();
people.rate(
"yegor256", new Cash.S(Stri... | #vulnerable code
@Test
public void rendersProfilePageWithRateInFirefox() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final double rate = 99.99;
final People people = new People(farm).bootstrap();
people.rate(
"yegor25... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final Request req) throws IOException {
final JsonObject callback = TkViber.json(
new TextOf(req.body()).asString()
);
if (callback.isEmpty()) {
throw new HttpException(HttpURLConnection.HTTP_BA... | #vulnerable code
@Override
public Response act(final Request req) throws IOException {
final JsonObject callback = TkViber.json(
new InputStreamReader(req.body(), StandardCharsets.UTF_8)
);
if (callback.isEmpty()) {
throw new HttpExcep... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
n... | #vulnerable code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.format("2017... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersXmlAwardsPage() throws Exception {
final Farm farm = FkFarm.props();
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
XhtmlMatchers.xhtml(
new View(farm, "/u/yegor256/awards").html()
... | #vulnerable code
@Test
public void rendersXmlAwardsPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
XhtmlMatchers.xhtml(
new View(farm, "/u/yegor256... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public double vote(final String login, final StringBuilder log)
throws IOException {
final int mine = this.jobs.value().get(login);
final int smaller = new Filtered<>(
speed -> speed < mine,
this.jobs.value().value... | #vulnerable code
@Override
public double vote(final String login, final StringBuilder log)
throws IOException {
final int jobs = new LengthOf(
new Agenda(this.pmo, login).jobs()
).intValue();
log.append(
new Par(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqProject(this.farm, req);
return new RsWithHeaders(
new RsWithType(
new RsWithBody(
this.getClass().getResour... | #vulnerable code
@Override
public Response act(final RqRegex req) throws IOException {
final String pid = req.matcher().group(1);
final Project pmo = new Pmo(this.farm);
final Catalog catalog = new Catalog(pmo).bootstrap();
if (!catalog.exists(pid)) {... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
@SuppressWarnings("unchecked")
public void showsThatUserAlreadyHasMentor() throws IOException {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String mentor = "yoda";
final... | #vulnerable code
@Test
@SuppressWarnings("unchecked")
public void showsThatUserAlreadyHasMentor() throws IOException {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String mentor = "yoda";
final String... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public Collection<String> links(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
return new SolidList<>(
new Mapped<>(
xml -> String.format(
... | #vulnerable code
public Collection<String> links(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get links"
).say(pid)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void pause(final String pid,
final boolean pause) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives().xpath(
String.f... | #vulnerable code
public void pause(final String pid,
final boolean pause) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par("Project %s doesn't exist, can't pause").say(pid)
);
}
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public String adviser(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
return new Xocument(item.path()).xpath(
String.format(
"/catalog/project[@id = '%s']/advise... | #vulnerable code
public String adviser(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get adviser"
).say(pid)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = FkFarm.props();
final String uid = "yegor";
new Awards(farm, uid).bootstrap().add(
new FkProject(), 1, "gh:test/test#1", "reason"
);
new Agenda(far... | #vulnerable code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String uid = "yegor";
new Awards(farm, uid).bootstrap().add(
new FkProject(), 1, "gh:test/test#1", "reason"
);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public double take(final String login, final StringBuilder log)
throws IOException {
final int total = new Agenda(this.pmo, login).bootstrap().jobs().size();
final double rate;
final int max = new Options(this.pmo, login).bootstra... | #vulnerable code
@Override
public double take(final String login, final StringBuilder log)
throws IOException {
final int total = new Agenda(this.pmo, login).bootstrap().jobs().size();
final double rate;
final int max = new Options(this.pmo, login).bo... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public double speed(final String uid) throws IOException {
this.checkExisting(uid);
try (final Item item = this.item()) {
return new NumberOf(
new Xocument(item.path()).xpath(
String.format(
... | #vulnerable code
public double speed(final String uid) throws IOException {
if (!this.exists(uid)) {
throw new IllegalArgumentException(
new Par("Person @%s doesn't exist").say(uid)
);
}
try (final Item item = this.item()) ... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public Collection<String> links(final String pid, final String rel)
throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
return new Xocument(item).xpath(
String.format(
"/catal... | #vulnerable code
public Collection<String> links(final String pid, final String rel)
throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get links"
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersProfilePageWithRateInFirefox() throws Exception {
final Farm farm = FkFarm.props();
final double rate = 99.99;
final People people = new People(farm).bootstrap();
people.rate(
"yegor256", new Cash.S(Stri... | #vulnerable code
@Test
public void rendersProfilePageWithRateInFirefox() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final double rate = 99.99;
final People people = new People(farm).bootstrap();
people.rate(
"yegor25... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersSingleArtifact() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | #vulnerable code
@Test
public void rendersSingleArtifact() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.format... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final Request request) throws IOException {
return new RsWithType(
new RsWithBody(
new BufferedInputStream(
new HeapDump(this.bucket.value(), "").load()
)
),
... | #vulnerable code
@Override
public Response act(final Request request) throws IOException {
return new RsWithType(
new RsWithBody(
new BufferedInputStream(
new HeapDump(new ExtBucket().value(), "").load()
)
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void registerImpediment() throws Exception {
final Project project = new FkProject();
final Impediments imp = new Impediments(new PropsFarm(), project)
.bootstrap();
final String job = "gh:test/test#1";
new Wbs(proj... | #vulnerable code
@Test
public void registerImpediment() throws Exception {
final Project project = new FkProject();
final Impediments imp = new Impediments(new PropsFarm(), project)
.bootstrap();
final String job = "gh:test/test#1";
new Wb... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public void exec(final Message input) throws Exception {
try (
final Footprint footprint = new Footprint(
this.farm, new SqsProject(this.farm, input)
)
) {
final XML xml = new XMLDocument(input.... | #vulnerable code
@Override
public void exec(final Message input) throws Exception {
final Footprint footprint = new Footprint(
this.farm, new SqsProject(this.farm, input)
);
final XML xml = new XMLDocument(input.getBody())
.nodes("/cla... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Loggable
@SuppressWarnings("PMD.AvoidCatchingThrowable")
public static void main(final String... args) throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"He... | #vulnerable code
@Loggable
@SuppressWarnings("PMD.AvoidCatchingThrowable")
public static void main(final String... args) throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqAnonProject(this.farm, req);
final Cash left = new Ledger(project).bootstrap().cash().add(
new Estimates(project).bootstrap().total().mul(-1L)
... | #vulnerable code
@Override
public Response act(final RqRegex req) throws IOException {
final String pid = req.matcher().group(1);
final Catalog catalog = new Catalog(this.farm).bootstrap();
if (!catalog.exists(pid)) {
throw new RsForward(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new... | #vulnerable code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new RqWith... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public int jobs(final String uid) throws IOException {
this.checkExisting(uid);
try (final Item item = this.item()) {
return new NumberOf(
new Xocument(item.path()).xpath(
String.format(
"... | #vulnerable code
public int jobs(final String uid) throws IOException {
if (!this.exists(uid)) {
throw new IllegalArgumentException(
new Par("Person @%s doesn't exist").say(uid)
);
}
try (final Item item = this.item()) {
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void redirectsWhenAccessingNonexistentUsersAgenda()
throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
new People(farm).bootstrap().touch("yegor256");
MatcherAssert.assertThat(
new RsPrint(
... | #vulnerable code
@Test
public void redirectsWhenAccessingNonexistentUsersAgenda()
throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
new People(farm).bootstrap().touch("yegor256");
MatcherAssert.assertThat(
new RsPrint(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void renderJoinPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
ne... | #vulnerable code
@Test
public void renderJoinPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void findsBasicNumbers() throws Exception {
MatcherAssert.assertThat(
new Policy(FkFarm.props()).get("1.min-rep", "???"),
Matchers.startsWith("??")
);
} | #vulnerable code
@Test
public void findsBasicNumbers() throws Exception {
MatcherAssert.assertThat(
new Policy(new PropsFarm(new FkFarm())).get("1.min-rep", "???"),
Matchers.startsWith("??")
);
}
#location 3
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersSingleArtifact() throws Exception {
final Farm farm = FkFarm.props();
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
new RqWi... | #vulnerable code
@Test
public void rendersSingleArtifact() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersListOfClaims() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | #vulnerable code
@Test
public void rendersListOfClaims() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
XhtmlMatchers.xhtml(
new RsPrint(
new TkApp(farm).act(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void dontRepostNotifyFailures() throws Exception {
final Project project = new FkProject();
new ClaimOut()
.type("Notify GitHub")
.token("github;test/test#1")
.postTo(project);
final XML claim = new ... | #vulnerable code
@Test
public void dontRepostNotifyFailures() throws Exception {
final Stakeholder stk = Mockito.mock(Stakeholder.class);
final Project project = new FkProject();
new ClaimOut()
.type("Notify GitHub")
.token("github;tes... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void respondsToMilestonedEvent() throws IOException {
final MkGithub github = new MkGithub();
final Repo repo = github.repos()
.create(new Repos.RepoCreate("test", false));
final Issue bug = repo
.issues().creat... | #vulnerable code
@Test
public void respondsToMilestonedEvent() throws IOException {
final MkGithub github = new MkGithub();
final Repo repo = github.repos()
.create(new Repos.RepoCreate("test", false));
final Issue bug = repo
.issues()... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void renderClaimXml() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final long cid = 42L;
final ClaimOut claim = new ClaimOut().type("test").cid(cid);
claim.postTo(farm.find("@id='C00000000'").it... | #vulnerable code
@Test
public void renderClaimXml() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.f... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new... | #vulnerable code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new RqWith... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"Hey, we are in the testing mode!"
);
}
... | #vulnerable code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"Hey, we are in the testing mode!"
);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(new PropsFarm(new FkFarm()));
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
... | #vulnerable code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(FkFarm.props());
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
ne... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void estimatesJobsWithDifferentCurrencies() throws Exception {
final Project project = new FkProject();
final Farm farm = new PropsFarm();
new Ledger(farm, project).bootstrap().add(
new Ledger.Transaction(
n... | #vulnerable code
@Test
public void estimatesJobsWithDifferentCurrencies() throws Exception {
final Project project = new FkProject();
final Farm farm = new PropsFarm();
new Ledger(farm, project).bootstrap().add(
new Ledger.Transaction(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
@Ignore
public void showsResumeIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
peop... | #vulnerable code
@Test
@Ignore
public void showsResumeIfAlreadyApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new RqWithUser(
... | #vulnerable code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void adviser(final String pid, final String adviser)
throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives().xpath(
Strin... | #vulnerable code
public void adviser(final String pid, final String adviser)
throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't get adviser"
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser.WithInit(
... | #vulnerable code
@Test
public void acceptRequestAndRedirectOnPost() throws Exception {
final Farm farm = FkFarm.props();
MatcherAssert.assertThat(
new TkApp(farm).act(
new RqWithBody(
new RqWithUser.WithInit(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
Logger.info(this, "Farm is ready to start");
final ShutdownFarm.Hook shutdown = new ShutdownFarm.Hook();
final ClaimGuts cgts = new ClaimGuts();
final TestLocks locks = ... | #vulnerable code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Path temp = Paths.get("./s3farm").normalize();
if (!temp.toFile().mkdir()) {
throw new IllegalStateException(
String.format(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void delete(final String pid) throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives().xpath(
String.format("/catalog/project[@id=... | #vulnerable code
public void delete(final String pid) throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par("Project %s doesn't exist, can't delete").say(pid)
);
}
try (final Item item = ... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Loggable
@SuppressWarnings("PMD.AvoidCatchingThrowable")
public static void main(final String... args) throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
"He... | #vulnerable code
@Loggable
@SuppressWarnings("PMD.AvoidCatchingThrowable")
public static void main(final String... args) throws IOException {
final Props props = new Props();
if (props.has("//testing")) {
throw new IllegalStateException(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = FkFarm.props();
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req = new RqWithUser(
... | #vulnerable code
@Test
public void acceptIfNeverApplied() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final People people = new People(farm).bootstrap();
final String uid = "yegor256";
people.touch(uid);
final Request req... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersProfilePageWithoutRateInFirefox() throws Exception {
final Farm farm = FkFarm.props();
final String uid = "yegor256";
MatcherAssert.assertThat(
new View(farm, String.format("/u/%s", uid)).html(),
Mat... | #vulnerable code
@Test
public void rendersProfilePageWithoutRateInFirefox() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String uid = "yegor256";
MatcherAssert.assertThat(
new View(farm, String.format("/u/%s", uid)).html... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void title(final String pid, final String title)
throws IOException {
this.checkExist(pid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives()
.xpath(String.fo... | #vulnerable code
public void title(final String pid, final String title)
throws IOException {
if (!this.exists(pid)) {
throw new IllegalArgumentException(
new Par(
"Project %s doesn't exist, can't change title"
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqProject(this.farm, req, "PO");
final RqFormSmart form = new RqFormSmart(new RqGreedy(req));
final String email = form.single("email");
final... | #vulnerable code
@Override
public Response act(final RqRegex req) throws IOException {
final Project project = new RqProject(this.farm, req, "PO");
final RqFormSmart form = new RqFormSmart(new RqGreedy(req));
final String email = form.single("email");
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
public void reputation(final String uid, final int rep)
throws IOException {
this.checkExisting(uid);
try (final Item item = this.item()) {
new Xocument(item.path()).modify(
new Directives().xpath(
String... | #vulnerable code
public void reputation(final String uid, final int rep)
throws IOException {
if (!this.exists(uid)) {
throw new IllegalArgumentException(
new Par("Person @%s doesn't exist").say(uid)
);
}
try (final... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void addsClaims() throws Exception {
final Farm farm = new PropsFarm();
final Project project = farm.find("@id='FOOTPRNTX'").iterator().next();
new ClaimOut().type("hello").postTo(project);
final XML xml = new Claims(project).i... | #vulnerable code
@Test
public void addsClaims() throws Exception {
final Farm farm = new PropsFarm();
final Project project = new Pmo(farm);
new ClaimOut().type("hello").postTo(project);
final XML xml = new Claims(project).iterate().iterator().next();... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Path temp = Paths.get("./s3farm").normalize();
if (!temp.toFile().mkdir()) {
throw new IllegalStateException(
String.format(
"Faile... | #vulnerable code
@SuppressWarnings("unchecked")
public void exec() throws IOException {
final Path temp = Paths.get("./s3farm").normalize();
if (!temp.toFile().mkdir()) {
throw new IllegalStateException(
String.format(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersReport() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final String uid = "yegor256";
new ClaimOut()
.type("Order was given")
.param("login", uid)
.postTo(... | #vulnerable code
@Test
public void rendersReport() throws Exception {
final Farm farm = new FtFarm(new PropsFarm(new FkFarm()));
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3DXF";
catalog.add(pid, String.fo... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void showsLinkToPolicyForUnknownUser() throws Exception {
final String flash =
// @checkstyle LineLength (1 line)
"@nvseenu is not invited to us yet, see <a href=\"www.zerocracy.com/policy.html#1\">§1</a>";
MatcherAsser... | #vulnerable code
@Test
public void showsLinkToPolicyForUnknownUser() throws Exception {
final String flash =
// @checkstyle LineLength (1 line)
"@nvseenu is not invited to us yet, see <a href=\"www.zerocracy.com/policy.html#1\">§1</a>";
Matche... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String uid = "yegor256";
new Awards(farm, uid).bootstrap().add(1, "gh:test/test#1", "reason");
new Agenda(farm, uid).bootstrap().add... | #vulnerable code
@Test
public void rendersHomePage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String uid = "yegor256";
final People people = new People(farm).bootstrap();
people.touch(uid);
people.invite(uid, "me... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersDebts() throws Exception {
final Farm farm = FkFarm.props();
final Debts debts = new Debts(farm).bootstrap();
final String uid = "yegor256";
final String first = "details 1";
final String second = "details 2... | #vulnerable code
@Test
public void rendersDebts() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Debts debts = new Debts(farm).bootstrap();
final String uid = "yegor256";
final String first = "details 1";
final String ... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersWithoutChromeNotice() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String get = new RsPrint(
new TkApp(farm).act(
new RqWithUser.WithInit(
farm,
... | #vulnerable code
@Test
public void rendersWithoutChromeNotice() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final String get = new RsPrint(
new TkApp(farm).act(
new RqWithUser(
farm,
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(FkFarm.props());
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
new HmRs... | #vulnerable code
@Test
public void rendersAllPossibleUrls() throws Exception {
final Take take = new TkApp(new PropsFarm(new FkFarm()));
MatcherAssert.assertThat(
this.url,
take.act(new RqFake("GET", this.url)),
Matchers.not(
... | Below is the vulnerable code, please generate the patch based on the following information. |
#fixed code
@Test
public void rendersProjectPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.format("2017/07... | #vulnerable code
@Test
public void rendersProjectPage() throws Exception {
final Farm farm = new PropsFarm(new FkFarm());
final Catalog catalog = new Catalog(new Pmo(farm)).bootstrap();
final String pid = "A1B2C3D4F";
catalog.add(pid, String.format("2... | Below is the vulnerable code, please generate the patch based on the following information. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.