id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
17,201 | return start(document.createElement(tag));
}
public B start(Element element) {
elements.push(new ElementInfo(element, true, level));
level++;
<BUG>return (B) this;
}</BUG>
public B end() {
assertCurrent();
if (level == 0) {
| return that();
|
17,202 | Element closingElement = elements.peek().element;
for (ElementInfo child : children) {
closingElement.appendChild(child.element);
}
level--;
<BUG>return (B) this;
}</BUG>
private String dumpElements() {
return elements.toString();
}
| return that();
|
17,203 | }
public B on(EventType type, EventListener listener) {
assertCurrent();
Element element = elements.peek().element;
type.register(element, listener);
<BUG>return (B) this;
}</BUG>
public B rememberAs(String id) {
assertCurrent();
references.put(id, elements.peek().element);
| public B attr(String name, String value) {
elements.peek().element.setAttribute(name, value);
return that();
|
17,204 | rest("/cart/").description("Personal Shopping Cart Service")
.produces(MediaType.APPLICATION_JSON_VALUE)
.options("/{cartId}")
.route().id("getCartOptionsRoute").end().endRest()
.options("/checkout/{cartId}")
<BUG>.route().id("checkoutCartOptionsRoute").end().endRest()
.options("/{cartId}/{itemId}/{quantity}")</BUG>
.route().id("cartAddDeleteOptionsRoute").end().endRest()
.post("/checkout/{cartId}").description("Finalize shopping cart and process payment")
.param().name("cartId").type(RestParamType.path).description("The ID of the cart to process").dataType("string").endParam()
| .options("/{cartId}/{tmpId}")
.route().id("cartSetOptionsRoute").end().endRest()
.options("/{cartId}/{itemId}/{quantity}")
|
17,205 | boolean ret = programFile(getProgrammer(), sketchName);
ctx.executeKey("upload.postcmd");
return ret;
}
public boolean performSerialReset(boolean dtr, boolean rts, int speed, int predelay, int delay, int postdelay) {
<BUG>ctx.bullet("Resetting board.");
</BUG>
try {
CommunicationPort port = ctx.getDevice();
if (port instanceof SerialCommunicationPort) {
| if (!Base.isQuiet()) ctx.bullet("Resetting board.");
|
17,206 | ArrayList<File>sketchObjects = compileSketch();
if(sketchObjects == null) {
error("Failed compiling sketch");
return false;
}
<BUG>bullet("Compiling core...");
setCompilingProgress(20);</BUG>
if(!compileCore()) {
error("Failed compiling core");
return false;
| if (!Base.isQuiet()) bullet("Compiling core...");
setCompilingProgress(20);
|
17,207 | if(!compileCore()) {
error("Failed compiling core");
return false;
}
setCompilingProgress(30);
<BUG>bullet("Compiling libraries...");
</BUG>
if(!compileLibraries()) {
error("Failed compiling libraries");
return false;
| if (!Base.isQuiet()) bullet("Compiling libraries...");
|
17,208 | if(!compileLibraries()) {
error("Failed compiling libraries");
return false;
}
setCompilingProgress(40);
<BUG>bullet("Linking sketch...");
if(!compileLink(sketchObjects)) {</BUG>
error("Failed linking sketch");
return false;
}
| if (!Base.isQuiet()) bullet("Linking sketch...");
if(!compileLink(sketchObjects)) {
|
17,209 | editor.updateOutputTree();
}
compileSize();
long endTime = System.currentTimeMillis();
double compileTime = (double)(endTime - startTime) / 1000d;
<BUG>bullet("Compilation took " + compileTime + " seconds");
</BUG>
ctx.executeKey("compile.postcmd");
return true;
}
| if (!Base.isQuiet()) bullet("Compilation took " + compileTime + " seconds");
|
17,210 | return true;
}
public boolean compileSize() {
PropertyFile props = ctx.getMerged();
if (props.get("compile.size") != null) {
<BUG>heading("Memory usage");
ctx.startBuffer();</BUG>
ctx.executeKey("compile.size");
String output = ctx.endBuffer();
String reg = props.get("compiler.size.regex", "^\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)");
| if (!Base.isQuiet()) heading("Memory usage");
ctx.startBuffer();
|
17,211 | ctx.set("size.data", dataSize + "");
ctx.set("size.rodata", rodataSize + "");
ctx.set("size.bss", bssSize + "");
ctx.set("size.flash", (textSize + dataSize + rodataSize) + "");
ctx.set("size.ram", (bssSize + dataSize) + "");
<BUG>bullet("Program size: " + (textSize + dataSize + rodataSize) + " bytes");
bullet("Memory size: " + (bssSize + dataSize) + " bytes");
</BUG>
}
| if (!Base.isQuiet()) bullet("Program size: " + (textSize + dataSize + rodataSize) + " bytes");
if (!Base.isQuiet()) bullet("Memory size: " + (bssSize + dataSize) + " bytes");
|
17,212 | for(File file : sources) {
File objectFile = new File(dest, file.getName() + "." + objExt);
objectPaths.add(objectFile);
if(objectFile.exists() && objectFile.lastModified() > file.lastModified()) {
if(Preferences.getBoolean("compiler.verbose_compile")) {
<BUG>bullet2("Skipping " + file.getAbsolutePath() + " as not modified.");
</BUG>
}
continue;
}
| if (!Base.isQuiet()) bullet2("Skipping " + file.getAbsolutePath() + " as not modified.");
|
17,213 | ctx.parsedMessage("{\\bullet}{\\error Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n");
}
} catch (Exception execpt) {
}
} else {
<BUG>ctx.error("Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":");
</BUG>
}
ctx.parsedMessage("{\\bullet2}{\\error " + m.group(3) + "}\n");
setLineComment(errorFile, errorLineNumber, m.group(3));
| [DELETED] |
17,214 | ctx.parsedMessage("{\\bullet}{\\warning Error at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n");
}
} catch (Exception execpt) {
}
} else {
<BUG>ctx.warning("Warning at line " + errorLineNumber + " in file " + errorFile.getName() + ":");
</BUG>
}
ctx.parsedMessage("{\\bullet2}{\\warning " + m.group(3) + "}\n");
setLineComment(errorFile, errorLineNumber, m.group(3));
| ctx.parsedMessage("{\\bullet}{\\warning Warning at line " + errorLineNumber + " in file " + errorFile.getName() + ":}\n");
|
17,215 | package org.uecide;
import java.io.*;
import java.lang.*;
import java.util.*;
import java.lang.reflect.*;
<BUG>import javax.script.*;
import org.uecide.builtin.BuiltinCommand;</BUG>
import org.uecide.varcmd.VariableCommand;
public class Context {
Board board = null;
| import java.util.regex.*;
import org.uecide.builtin.BuiltinCommand;
|
17,216 | cli.addParameter("force-join-files", "", Boolean.class, "Force joining INO and PDE files into single CPP file");
cli.addParameter("online", "", Boolean.class, "Force online mode");
cli.addParameter("offline", "", Boolean.class, "Force offline mode");
cli.addParameter("version", "", Boolean.class, "Display the UECIDE version number");
cli.addParameter("cli", "", Boolean.class, "Enter CLI mode");
<BUG>cli.addParameter("preferences", "", Boolean.class, "Display preferences dialog");
String[] argv = cli.process(args);</BUG>
headless = cli.isSet("headless");
boolean loadLastSketch = cli.isSet("last-sketch");
boolean doExit = false;
| cli.addParameter("quiet", "", Boolean.class, "Reduce the noise of output");
String[] argv = cli.process(args);
|
17,217 | package com.intellij.ide.actions;
import com.intellij.featureStatistics.FeatureUsageTracker;
import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
<BUG>import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.project.DumbAwareAction;</BUG>
import com.intellij.openapi.project.Project;
public class ShowRecentFilesAction extends DumbAwareAction {
@Override
| import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
import com.intellij.openapi.project.DumbAwareAction;
|
17,218 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
17,219 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
17,220 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
17,221 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
17,222 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
17,223 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
17,224 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
17,225 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
17,226 | import javax.sql.DataSource;
import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
<BUG>import java.lang.reflect.Proxy;
import java.sql.SQLException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
| import java.sql.Connection;
import java.sql.SQLException;
|
17,227 | import com.cloud.uservm.UserVm;
@Implementation(description="Detaches any ISO file (if any) currently attached to a virtual machine.", responseObject=UserVmResponse.class)
public class DetachIsoCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DetachIsoCmd.class.getName());
private static final String s_name = "detachisoresponse";
<BUG>@Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description=" The ID of the virtual machine")
private Long virtualMachineId;</BUG>
public Long getVirtualMachineId() {
return virtualMachineId;
}
| @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="The ID of the virtual machine")
private Long virtualMachineId;
|
17,228 | Account account);
ListResponse<TemplateResponse> createTemplateResponse2(VirtualMachineTemplate template, Long zoneId);
ListResponse<TemplateResponse> createIsoResponses(VirtualMachineTemplate template, Long zoneId);
ListResponse<NetworkGroupResponse> createNetworkGroupResponses(List<? extends NetworkGroupRules> networkGroups);
NetworkGroupResponse createNetworkGroupResponse(NetworkGroup group);
<BUG>ExtractResponse createExtractResponse(long uploadId, long id, long zoneId, long accountId, String mode);
TemplateResponse createTemplateResponse(VirtualMachineTemplate template, long destZoneId);
TemplateResponse createIsoResponse3(VirtualMachineTemplate iso, long destZoneId);
</BUG>
String toSerializedString(CreateCmdResponse response, String responseType);
| ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
TemplateResponse createTemplateResponse(VirtualMachineTemplate template, Long destZoneId);
TemplateResponse createIsoResponse3(VirtualMachineTemplate iso, Long destZoneId);
|
17,229 |
TemplateResponse createIsoResponse3(VirtualMachineTemplate iso, long destZoneId);
</BUG>
String toSerializedString(CreateCmdResponse response, String responseType);
AsyncJobResponse createAsyncJobResponse(AsyncJob job);
<BUG>TemplateResponse createTemplateResponse(VirtualMachineTemplate template, Long snapshotId, long volumeId);
</BUG>
EventResponse createEventResponse(Event event);
ListResponse<TemplateResponse> createIsoResponse(List<? extends VirtualMachineTemplate> isos, Long zoneId, boolean onlyReady, boolean isAdmin,
Account account);
| ListResponse<TemplateResponse> createTemplateResponse2(VirtualMachineTemplate template, Long zoneId);
ListResponse<TemplateResponse> createIsoResponses(VirtualMachineTemplate template, Long zoneId);
ListResponse<NetworkGroupResponse> createNetworkGroupResponses(List<? extends NetworkGroupRules> networkGroups);
NetworkGroupResponse createNetworkGroupResponse(NetworkGroup group);
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
TemplateResponse createTemplateResponse(VirtualMachineTemplate template, Long destZoneId);
TemplateResponse createIsoResponse3(VirtualMachineTemplate iso, Long destZoneId);
TemplateResponse createTemplateResponse(VirtualMachineTemplate template, Long snapshotId, Long volumeId);
|
17,230 | package nakadi;
<BUG>import java.io.IOException;
import java.util.concurrent.TimeUnit;</BUG>
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
| import java.util.Optional;
import java.util.concurrent.TimeUnit;
|
17,231 | return response;
} else {
return handleError(response);
}
}
<BUG>private <T> T handleError(Response response) {
return throwProblem(response.statusCode(),
jsonSupport.fromJson(response.responseBody().asString(), Problem.class));
}</BUG>
private <T> T throwProblem(int code, Problem problem) {
| String raw = response.responseBody().asString();
Problem problem = Optional.ofNullable(jsonSupport.fromJson(raw, Problem.class))
.orElse(Problem.noProblemo("no problem sent back from server", "", response.statusCode()));
problem);
|
17,232 | 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;
|
17,233 | 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());
|
17,234 | 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
|
17,235 | <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;
|
17,236 | 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] |
17,237 | <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;
|
17,238 | 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;
|
17,239 | 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;
|
17,240 | 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);
|
17,241 | 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 {
|
17,242 | 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(),
|
17,243 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
17,244 | }
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);
|
17,245 | 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] |
17,246 | <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;
|
17,247 | 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;
|
17,248 | 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()
|
17,249 | public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.GUILD)
.addParam(RequestParam.GUILD_BY_ID, "53790cd7ed505dab83dad144")
.createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<GuildReply>(GuildReply.class) {
@Override
public void callback(Throwable failCause, GuildReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<GuildReply>) (failCause, result) -> {
|
17,250 | public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.PLAYER)
.addParam(RequestParam.PLAYER_BY_UUID, ExampleUtil.UUIDList.HYPIXEL)
.createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<PlayerReply>(PlayerReply.class) {
@Override
public void callback(Throwable failCause, PlayerReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<PlayerReply>) (failCause, result) -> {
|
17,251 | public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.FIND_GUILD)
.addParam(RequestParam.GUILD_BY_PLAYER_UUID, ExampleUtil.UUIDList.HYPIXEL)
.createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<FindGuildReply>(FindGuildReply.class) {
@Override
public void callback(Throwable failCause, FindGuildReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<FindGuildReply>) (failCause, result) -> {
|
17,252 | public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.FRIENDS)
.addParam(RequestParam.FRIENDS_BY_UUID, ExampleUtil.UUIDList.HYPIXEL)
.createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<FriendsReply>(FriendsReply.class) {
@Override
public void callback(Throwable failCause, FriendsReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<FriendsReply>) (failCause, result) -> {
|
17,253 | import net.hypixel.api.util.Callback;
public class GetBoostersExample {
public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.BOOSTERS).createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<BoostersReply>(BoostersReply.class) {
@Override
public void callback(Throwable failCause, BoostersReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<BoostersReply>) (failCause, result) -> {
|
17,254 | import net.hypixel.api.util.Callback;
public class KeyInfoExample {
public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.KEY).createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<KeyReply>(KeyReply.class) {
@Override
public void callback(Throwable failCause, KeyReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<KeyReply>) (failCause, result) -> {
|
17,255 | public static void main(String[] args) {
HypixelAPI.getInstance().setApiKey(ExampleUtil.API_KEY);
Request request = RequestBuilder.newBuilder(RequestType.FIND_GUILD)
.addParam(RequestParam.GUILD_BY_PLAYER_UUID, ExampleUtil.UUIDList.HYPIXEL)
.createRequest();
<BUG>HypixelAPI.getInstance().getAsync(request, new Callback<FindGuildReply>(FindGuildReply.class) {
@Override
public void callback(Throwable failCause, FindGuildReply result) {</BUG>
if (failCause != null) {
| HypixelAPI.getInstance().getAsync(request, (Callback<FindGuildReply>) (failCause, result) -> {
|
17,256 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
17,257 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
17,258 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
17,259 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
17,260 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.format("Unable to delete %s", file));
}</BUG>
}
| twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
17,261 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.util.DataStoreUtils;
import org.mariotaku.twidere.util.ImagePreloader;</BUG>
import org.mariotaku.twidere.util.InternalTwitterContentUtils;
import org.mariotaku.twidere.util.JsonSerializer;
import org.mariotaku.twidere.util.NotificationManagerWrapper;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
17,262 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| DebugLog.w(LOGTAG, null, ignore);
|
17,263 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
17,264 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere.util.JsonSerializer;</BUG>
import org.mariotaku.twidere.util.Utils;
| import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
17,265 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Log.d(HotMobiLogger.LOGTAG, "getting cached location");
}</BUG>
final Location location = Utils.getCachedLocation(appContext);
| DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
17,266 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId);
</BUG>
return asyncTaskManager.add(task, true);
}
public int destroyUserListAsync(final UserKey accountKey, final String listId) {
| final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
17,267 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getException());
}</BUG>
}
| public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
17,268 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
17,269 | import com.continuuity.data.runtime.DataFabricModules;
import com.continuuity.internal.app.authorization.PassportAuthorizationFactory;
import com.continuuity.internal.app.deploy.SyncManagerFactory;
import com.continuuity.internal.app.store.MDSStoreFactory;
import com.continuuity.internal.pipeline.SynchronousPipelineFactory;
<BUG>import com.continuuity.metadata.thrift.MetadataService;
import com.continuuity.metrics.guice.MetricsClientRuntimeModule;</BUG>
import com.continuuity.performance.application.BenchmarkManagerFactory;
import com.continuuity.performance.application.BenchmarkStreamWriterFactory;
import com.continuuity.performance.application.DefaultBenchmarkManager;
| import com.continuuity.metrics.MetricsConstants;
import com.continuuity.metrics.guice.MetricsClientRuntimeModule;
|
17,270 | import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
<BUG>import java.util.Set;
public final class PerformanceTestRunner {</BUG>
private static final Logger LOG = LoggerFactory.getLogger(PerformanceTestRunner.class);
private static AppFabricService.Iface appFabricServer;
private static LocationFactory locationFactory;
| import java.util.concurrent.TimeUnit;
public final class PerformanceTestRunner {
|
17,271 | binder.bind(MetaDataStore.class).to(SerializingMetaDataStore.class);
binder.bind(StoreFactory.class).to(MDSStoreFactory.class);
binder.bind(AuthToken.class).toInstance(TestHelper.DUMMY_AUTH_TOKEN);
}
@Provides
<BUG>@Named(Constants.CFG_APP_FABRIC_SERVER_ADDRESS)
public InetAddress providesHostname(CConfiguration cConf) {</BUG>
return Networks.resolve(cConf.get(Constants.CFG_APP_FABRIC_SERVER_ADDRESS),
new InetSocketAddress("localhost", 0).getAddress());
}
| @SuppressWarnings(value = "unused")
public InetAddress providesHostname(CConfiguration cConf) {
|
17,272 | new InetSocketAddress("localhost", 0).getAddress());
}
}
);
} catch (Exception e) {
<BUG>e.printStackTrace();
}</BUG>
locationFactory = injector.getInstance(LocationFactory.class);
discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class);
}
| LOG.error("Failure during initial bind and injection : " + e.getMessage(), e);
Throwables.propagate(e);
|
17,273 | if (StringUtils.isNotEmpty(config.get("perf.report.interval"))) {
interval = Integer.valueOf(config.get("perf.report.interval"));
}
Context.report(metricList, tags, interval);
}
<BUG>}
}</BUG>
private void afterMethod() {
clearAppFabric();
}
| if (zkClientService != null) {
zkClientService.startAndWait();
|
17,274 | package com.continuuity.performance.runner;
<BUG>import com.continuuity.common.conf.CConfiguration;
import com.continuuity.metrics.MetricsConstants;
import com.continuuity.performance.application.BenchmarkRuntimeMetrics;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
import com.google.common.reflect.TypeToken;</BUG>
import com.google.gson.Gson;
| import com.continuuity.common.conf.Constants;
import com.continuuity.weave.discovery.Discoverable;
import com.google.common.collect.Iterables;
import com.google.common.reflect.TypeToken;
|
17,275 | String body = response.getResponseBody();
if (response.getStatusCode() != 200) {
throw new RuntimeException("Status code " + response.getStatusCode() + ":" + body);
}
return body;
<BUG>} catch (IOException e) {
throw Throwables.propagate(e);
} catch (InterruptedException e) {
throw Throwables.propagate(e);
} catch (ExecutionException e) {
throw Throwables.propagate(e);
} catch (TimeoutException e) {</BUG>
throw Throwables.propagate(e);
| } catch (Exception e) {
|
17,276 | package io.vertx.ext.stomp;
<BUG>import io.vertx.core.Handler;
import io.vertx.ext.stomp.utils.Headers;</BUG>
public class DefaultAckHandler implements Handler<ServerFrame> {
@Override
public void handle(ServerFrame serverFrame) {
| import io.vertx.ext.stomp.impl.Transaction;
import io.vertx.ext.stomp.impl.Transactions;
import io.vertx.ext.stomp.utils.Headers;
|
17,277 | connection.close();
return;
}
String txId = frame.getHeader(Frame.TRANSACTION);
if (txId != null) {
<BUG>Transaction transaction = connection.handler().getTransaction(connection, txId);
</BUG>
if (transaction == null) {
Frame errorFrame = Frames.createErrorFrame(
"No transaction",
| Transaction transaction = Transactions.INSTANCE.getTransaction(connection, txId);
|
17,278 | if (!transaction.addFrameToTransaction(frame)) {
Frame errorFrame = Frames.createErrorFrame("Frame not added to transaction",
Headers.create(Frame.ID, id, Frame.TRANSACTION, txId),
"Message delivery failed - the frame cannot be added to the transaction - the number of allowed thread " +
"may have been reached");
<BUG>connection.handler().unregisterTransactionsFromConnection(connection);
</BUG>
connection.write(errorFrame);
connection.close();
return;
| Transactions.INSTANCE.unregisterTransactionsFromConnection(connection);
|
17,279 | package io.vertx.ext.stomp;
<BUG>import io.vertx.core.Handler;
import io.vertx.ext.stomp.utils.Headers;</BUG>
public class DefaultBeginHandler implements Handler<ServerFrame> {
@Override
public void handle(ServerFrame serverFrame) {
| import io.vertx.ext.stomp.impl.Transactions;
import io.vertx.ext.stomp.utils.Headers;
|
17,280 | if (txId == null) {
Frame error = Frames.createErrorFrame("Missing transaction id", Headers.create(), "BEGIN frames " +
"must contain the 'transaction' header.");
connection.write(error).close();
return;
<BUG>}
Transaction transaction = Transaction.create(connection, txId);
if (!connection.handler().registerTransaction(transaction)) {</BUG>
Frame error = Frames.createErrorFrame("Already existing transaction",
Headers.create(Frame.TRANSACTION, txId),
| if (!Transactions.INSTANCE.registerTransaction(connection, txId)) {
|
17,281 | package io.vertx.ext.stomp;
<BUG>import io.vertx.core.Handler;
import io.vertx.ext.stomp.utils.Headers;</BUG>
public class DefaultAbortHandler implements Handler<ServerFrame> {
@Override
public void handle(ServerFrame sf) {
| import io.vertx.ext.stomp.impl.Transaction;
import io.vertx.ext.stomp.impl.Transactions;
import io.vertx.ext.stomp.utils.Headers;
|
17,282 | if (txId == null) {
Frame error = Frames.createErrorFrame("Missing transaction id", Headers.create(), "ABORT frames " +
"must contain the 'transaction' header.");
sf.connection().write(error).close();
return;
<BUG>}
Transaction transaction = sf.connection().handler().getTransaction(sf.connection(), txId);
if (transaction == null) {</BUG>
Frame error = Frames.createErrorFrame("Unknown transaction",
Headers.create(Frame.TRANSACTION, txId),
| if (! Transactions.INSTANCE.unregisterTransaction(sf.connection(), txId)) {
|
17,283 | sf.connection().close();
return;
}
String txId = sf.frame().getHeader(Frame.TRANSACTION);
if (txId != null) {
<BUG>Transaction transaction = sf.connection().handler().getTransaction(sf.connection(), txId);
</BUG>
if (transaction == null) {
Frame errorFrame = Frames.createErrorFrame(
"No transaction",
| Transaction transaction = Transactions.INSTANCE.getTransaction(sf.connection(), txId);
|
17,284 | if (!transaction.addFrameToTransaction(sf.frame())) {
Frame errorFrame = Frames.createErrorFrame("Frame not added to transaction",
Headers.create(Frame.DESTINATION, destination, Frame.TRANSACTION, txId),
"Message delivery failed - the frame cannot be added to the transaction - the number of allowed thread " +
"may have been reached");
<BUG>sf.connection().handler().unregisterTransactionsFromConnection(sf.connection());
</BUG>
sf.connection().write(errorFrame);
sf.connection().close();
return;
| Transactions.INSTANCE.unregisterTransactionsFromConnection(sf.connection());
|
17,285 | package io.vertx.ext.stomp;
<BUG>import io.vertx.core.Handler;
import io.vertx.ext.stomp.utils.Headers;</BUG>
import java.util.List;
public class DefaultNackHandler implements Handler<ServerFrame> {
@Override
| import io.vertx.ext.stomp.impl.Transaction;
import io.vertx.ext.stomp.impl.Transactions;
import io.vertx.ext.stomp.utils.Headers;
|
17,286 | connection.close();
return;
}
String txId = sf.frame().getHeader(Frame.TRANSACTION);
if (txId != null) {
<BUG>Transaction transaction = connection.handler().getTransaction(connection, txId);
</BUG>
if (transaction == null) {
Frame errorFrame = Frames.createErrorFrame(
"No transaction",
| Transaction transaction = Transactions.INSTANCE.getTransaction(connection, txId);
|
17,287 | if (!transaction.addFrameToTransaction(sf.frame())) {
Frame errorFrame = Frames.createErrorFrame("Frame not added to transaction",
Headers.create(Frame.ID, id, Frame.TRANSACTION, txId),
"Message delivery failed - the frame cannot be added to the transaction - the number of allowed thread " +
"may have been reached");
<BUG>connection.handler().unregisterTransactionsFromConnection(connection);
</BUG>
connection.write(errorFrame);
connection.close();
return;
| Transactions.INSTANCE.unregisterTransactionsFromConnection(connection);
|
17,288 | package io.vertx.ext.stomp;
<BUG>import io.vertx.core.Handler;
import io.vertx.ext.stomp.utils.Headers;</BUG>
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
| import io.vertx.ext.stomp.impl.Transaction;
import io.vertx.ext.stomp.impl.Transactions;
import io.vertx.ext.stomp.utils.Headers;
|
17,289 | "must contain the " +
"'transaction' header.");
connection.write(error).close();
return;
}
<BUG>Transaction transaction = connection.handler().getTransaction(connection, txId);
</BUG>
if (transaction == null) {
Frame error = Frames.createErrorFrame("Unknown transaction",
Headers.create(Frame.TRANSACTION, txId),
| Transaction transaction = Transactions.INSTANCE.getTransaction(connection, txId);
|
17,290 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class StopAnalyzerProvider extends AbstractAnalyzerProvider<StopAnalyzer> {
</BUG>
private final Set<String> stopWords;
private final StopAnalyzer stopAnalyzer;
@Inject public StopAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
| public class StopAnalyzerProvider extends AbstractIndexAnalyzerProvider<StopAnalyzer> {
|
17,291 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class StandardAnalyzerProvider extends AbstractAnalyzerProvider<StandardAnalyzer> {
</BUG>
private final Set<String> stopWords;
private final int maxTokenLength;
private final StandardAnalyzer standardAnalyzer;
| public class StandardAnalyzerProvider extends AbstractIndexAnalyzerProvider<StandardAnalyzer> {
|
17,292 | import org.elasticsearch.index.Index;
import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.settings.Settings;
<BUG>public class KeywordAnalyzerProvider extends AbstractAnalyzerProvider<KeywordAnalyzer> {
</BUG>
private final KeywordAnalyzer keywordAnalyzer;
@Inject public KeywordAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name);
| public class KeywordAnalyzerProvider extends AbstractIndexAnalyzerProvider<KeywordAnalyzer> {
|
17,293 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class CzechAnalyzerProvider extends AbstractAnalyzerProvider<CzechAnalyzer> {
</BUG>
private final Set<?> stopWords;
private final CzechAnalyzer analyzer;
@Inject public CzechAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
| public class CzechAnalyzerProvider extends AbstractIndexAnalyzerProvider<CzechAnalyzer> {
|
17,294 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class ArabicAnalyzerProvider extends AbstractAnalyzerProvider<ArabicAnalyzer> {
</BUG>
private final Set<String> stopWords;
private final ArabicAnalyzer arabicAnalyzer;
@Inject public ArabicAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
| public class ArabicAnalyzerProvider extends AbstractIndexAnalyzerProvider<ArabicAnalyzer> {
|
17,295 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class CjkAnalyzerProvider extends AbstractAnalyzerProvider<CJKAnalyzer> {
</BUG>
private final Set<?> stopWords;
private final CJKAnalyzer analyzer;
@Inject public CjkAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
| public class CjkAnalyzerProvider extends AbstractIndexAnalyzerProvider<CJKAnalyzer> {
|
17,296 | Class<? extends TokenFilterFactory> type = tokenFilterSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenFilterFactory");
if (type == null) {
throw new IllegalArgumentException("Token Filter [" + tokenFilterName + "] must have a type associated with it");
}
tokenFilterBinder.addBinding(tokenFilterName).toProvider(FactoryProvider.newFactory(TokenFilterFactoryFactory.class, type)).in(Scopes.SINGLETON);
<BUG>}
for (AnalysisBinderProcessor processor : processors) {
processor.processTokenFilters(tokenFilterBinder, tokenFiltersSettings);
</BUG>
}
| AnalysisBinderProcessor.TokenFiltersBindings tokenFiltersBindings = new AnalysisBinderProcessor.TokenFiltersBindings(tokenFilterBinder, tokenFiltersSettings);
processor.processTokenFilters(tokenFiltersBindings);
|
17,297 | Class<? extends TokenizerFactory> type = tokenizerSettings.getAsClass("type", null, "org.elasticsearch.index.analysis.", "TokenizerFactory");
if (type == null) {
throw new IllegalArgumentException("Tokenizer [" + tokenizerName + "] must have a type associated with it");
}
tokenizerBinder.addBinding(tokenizerName).toProvider(FactoryProvider.newFactory(TokenizerFactoryFactory.class, type)).in(Scopes.SINGLETON);
<BUG>}
for (AnalysisBinderProcessor processor : processors) {
processor.processTokenizers(tokenizerBinder, tokenizersSettings);
</BUG>
}
| AnalysisBinderProcessor.TokenizersBindings tokenizersBindings = new AnalysisBinderProcessor.TokenizersBindings(tokenizerBinder, tokenizersSettings);
processor.processTokenizers(tokenizersBindings);
|
17,298 | } else {
throw new IllegalArgumentException("Analyzer [" + analyzerName + "] must have a type associated with it or a tokenizer");
}
}
analyzerBinder.addBinding(analyzerName).toProvider(FactoryProvider.newFactory(AnalyzerProviderFactory.class, type)).in(Scopes.SINGLETON);
<BUG>}
for (AnalysisBinderProcessor processor : processors) {
processor.processAnalyzers(analyzerBinder, analyzersSettings);
</BUG>
}
| AnalysisBinderProcessor.AnalyzersBindings analyzersBindings = new AnalysisBinderProcessor.AnalyzersBindings(analyzerBinder, analyzersSettings, indicesAnalysisService);
processor.processAnalyzers(analyzersBindings);
|
17,299 | import org.elasticsearch.index.settings.IndexSettings;
import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
<BUG>public class ThaiAnalyzerProvider extends AbstractAnalyzerProvider<ThaiAnalyzer> {
</BUG>
private final ThaiAnalyzer analyzer;
@Inject public ThaiAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
super(index, indexSettings, name);
| public class ThaiAnalyzerProvider extends AbstractIndexAnalyzerProvider<ThaiAnalyzer> {
|
17,300 | import org.elasticsearch.util.inject.Inject;
import org.elasticsearch.util.inject.assistedinject.Assisted;
import org.elasticsearch.util.lucene.Lucene;
import org.elasticsearch.util.settings.Settings;
import java.util.Set;
<BUG>public class PersianAnalyzerProvider extends AbstractAnalyzerProvider<PersianAnalyzer> {
</BUG>
private final Set<?> stopWords;
private final PersianAnalyzer analyzer;
@Inject public PersianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
| public class PersianAnalyzerProvider extends AbstractIndexAnalyzerProvider<PersianAnalyzer> {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.