id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
45,401 | .configure("address", hostHere.trim())
.configureIfNotNull(LocalLocationManager.CREATE_UNMANAGED, config.get(LocalLocationManager.CREATE_UNMANAGED));
if (JavaGroovyEquivalents.groovyTruth(userHere)) {
locationSpec.configure("user", userHere.trim());
}
<BUG>SshMachineLocation machine = managementContext.getLocationManager().createLocation(locationSpec);
machines.add(machine);</BUG>
}
config.putStringKey("machines", machines);
return config;
| machines.add(machine);
|
45,402 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
45,403 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
45,404 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
45,405 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
45,406 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
45,407 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
45,408 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
45,409 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
45,410 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
45,411 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
45,412 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
45,413 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
45,414 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
45,415 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
45,416 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
45,417 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
45,418 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
45,419 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
45,420 | 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;
|
45,421 | 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());
|
45,422 | 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
|
45,423 | <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;
|
45,424 | 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] |
45,425 | <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;
|
45,426 | 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;
|
45,427 | 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;
|
45,428 | 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);
|
45,429 | 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 {
|
45,430 | 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(),
|
45,431 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
45,432 | }
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);
|
45,433 | 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] |
45,434 | <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;
|
45,435 | 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;
|
45,436 | 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()
|
45,437 | package org.xerial.snappy;
import java.io.IOException;
public class BitShuffleNative
{
<BUG>public native boolean supportBitSuffle();</BUG>
public native int bitShuffle(Object input, int inputOffset, int typeSize, int byteLength, Object output, int outputOffset)
throws IOException;
public native int bitUnShuffle(Object input, int inputOffset, int typeSize, int byteLength, Object output, int outputOffset)
throws IOException;
}
| [DELETED] |
45,438 | ScheduledExecutorService animationTimer = null;
ScheduledFuture animationFuture = null;
StackPane pane = new StackPane();
Tooltip memoryWatchTooltip = new Tooltip();
private void memoryViewClicked(MouseEvent e) {
<BUG>if (cheatEngine != null) {
double x = e.getX();</BUG>
double y = e.getY();
int col = (int) (x / MEMORY_BOX_TOTAL_SIZE);
int row = (int) (y / MEMORY_BOX_TOTAL_SIZE);
| Watch currentWatch = (Watch) memoryWatchTooltip.getGraphic();
if (currentWatch != null) {
currentWatch.disconnect();
}
double x = e.getX();
|
45,439 | int row = (int) (y / MEMORY_BOX_TOTAL_SIZE);
int addr = cheatEngine.getStartAddress() + row * memoryViewColumns + col;
Watch watch = new Watch(addr);
memoryWatchTooltip.setStyle("-fx-background-color:NAVY");
memoryWatchTooltip.onHidingProperty().addListener((prop, oldVal, newVal) -> {
<BUG>Watch currentWatch = (Watch) memoryWatchTooltip.getGraphic();
if (currentWatch != null) {
currentWatch.disconnect();
}</BUG>
watch.disconnect();
| [DELETED] |
45,440 | addrLabel.setMinWidth(GRAPH_WIDTH);
addrLabel.setFont(new Font(Font.getDefault().getFamily(), 14));
addrLabel.setTextFill(Color.WHITE);
graph = new Canvas(GRAPH_WIDTH, GRAPH_HEIGHT);
getChildren().add(addrLabel);
<BUG>getChildren().add(graph);
}</BUG>
public void redraw() {
int val = cheatEngine.getMemoryCell(address).value.get() & 0x0ff;
if (samples.size() >= GRAPH_WIDTH) {
| CheckBox hold = new CheckBox("Hold");
hold.selectedProperty().addListener((prop, oldVal, newVal) -> this.hold(newVal));
getChildren().add(hold);
}
|
45,441 |
import com.intellij.psi.PsiElement;</BUG>
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
<BUG>import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrTopLevelDefintion;</BUG>
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMembersDeclaration;
import org.jetbrains.plugins.groovy.lang.psi.api.toplevel.GrTopStatement;
import org.jetbrains.plugins.groovy.lang.psi.api.types.GrWildcardTypeArgument;
public interface GrTypeDefinition extends GrTopStatement, NavigationItem, PsiClass, GrTopLevelDefintion {
| package org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef;
import com.intellij.navigation.NavigationItem;
import com.intellij.psi.*;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrTopLevelDefintion;
|
45,442 | import org.jetbrains.plugins.groovy.lang.psi.api.types.GrWildcardTypeArgument;
public interface GrTypeDefinition extends GrTopStatement, NavigationItem, PsiClass, GrTopLevelDefintion {
String DEFAULT_BASE_CLASS_NAME = "groovy.lang.GroovyObjectSupport";
public GrTypeDefinition[] EMPTY_ARRAY = new GrTypeDefinition[0];
public GrTypeDefinitionBody getBody();
<BUG>@NotNull
public GrMembersDeclaration[] getMemberDeclarations();</BUG>
@Nullable
public String getQualifiedName();
GrWildcardTypeArgument[] getTypeParametersGroovy();
| GrMethod[] getMethods();
GrField[] getFields();
public GrMembersDeclaration[] getMemberDeclarations();
|
45,443 | @Nullable
public String getQualifiedName();
GrWildcardTypeArgument[] getTypeParametersGroovy();
@NotNull
PsiElement getNameIdentifierGroovy();
<BUG>@NotNull
GrField[] getFields();</BUG>
@Nullable
GrExtendsClause getExtendsClause();
@Nullable
| [DELETED] |
45,444 | String prefix = packageDefinition.getPackageName();
prefix = prefix.replace(".", PREFIX_SEPARATOR);
prefix += PREFIX_SEPARATOR;
return prefix;
}
<BUG>private String createJavaSourceFile(VirtualFile outputRootDirectory, GroovyFileBase file, String typeDefinitionName, GrTypeDefinition typeDefinition, GrPackageDefinition packageDefinition) {
</BUG>
String prefix = "";
if (packageDefinition != null) {
prefix = getJavaClassPackage(packageDefinition);
| private String createJavaSourceFile(VirtualFile outputRootDirectory, GroovyFileBase file, String typeDefinitionName, PsiClass groovyClass, GrPackageDefinition packageDefinition) {
|
45,445 | String prefix = "";
if (packageDefinition != null) {
prefix = getJavaClassPackage(packageDefinition);
}
StringBuffer text = new StringBuffer();
<BUG>writeTypeDefinition(text, typeDefinitionName, typeDefinition, packageDefinition);
</BUG>
VirtualFile virtualFile = file.getVirtualFile();
assert virtualFile != null;
String fileShortName = typeDefinitionName + "." + "java";
| writeTypeDefinition(text, typeDefinitionName, groovyClass, packageDefinition);
|
45,446 | text.append(" ");
if (isScript) {
text.append("extends ");
text.append("groovy.lang.Script ");
} else {
<BUG>final PsiClassType[] extendsClassesTypes = typeDefinition.getExtendsListTypes();
</BUG>
if (extendsClassesTypes.length > 0) {
text.append("extends ");
text.append(computeTypeText(extendsClassesTypes[0]));
| text.append(typeDefinitionName);
final PsiClassType[] extendsClassesTypes = groovyClass.getExtendsListTypes();
|
45,447 | i++;
}
}
}
text.append("{");
<BUG>boolean wasRunMethodPresent = false;
List<String> gettersNames = new ArrayList<String>();
List<String> settersNames = new ArrayList<String>();
List<Pair<String, MethodSignature>> methods = new ArrayList<Pair<String, MethodSignature>>();
for (GrMembersDeclaration declaration : membersDeclarations) {
if (declaration instanceof GrMethod) {
final GrMethod method = (GrMethod) declaration;</BUG>
if (method instanceof GrConstructor) {
| Set<MethodSignature> methodSignatures = new HashSet<MethodSignature>();
PsiMethod[] methods = groovyClass.getMethods();
for (PsiMethod method : methods) {
|
45,448 | if (declaration instanceof GrMethod) {
final GrMethod method = (GrMethod) declaration;</BUG>
if (method instanceof GrConstructor) {
writeConstructor(text, (GrConstructor) method);
continue;
<BUG>}
Pair<String, MethodSignature> methodNameSignature = new Pair<String, MethodSignature>(method.getName(), method.getSignature(PsiSubstitutor.EMPTY));
if (!methods.contains(methodNameSignature)) {
methods.add(methodNameSignature);
writeMethod(text, method);
}
getDefinedGetters(gettersNames, method);
getDefinedSetters(settersNames, method);</BUG>
wasRunMethodPresent = wasRunMethod(method);
| i++;
text.append("{");
boolean wasRunMethodPresent = false;
Set<MethodSignature> methodSignatures = new HashSet<MethodSignature>();
PsiMethod[] methods = groovyClass.getMethods();
for (PsiMethod method : methods) {
|
45,449 | for (GrMembersDeclaration decl : membersDeclarations) {
if (decl instanceof GrVariableDeclaration) {
final GrVariable[] variables = ((GrVariableDeclaration) decl).getVariables();
for (GrVariable variable : variables) {
if (variable instanceof GrField && ((GrField) variable).isProperty()) {
<BUG>if (!gettersNames.contains(variable.getName())) {
writeMethod(text, ((GrField) variable).getGetter());
}
if (!settersNames.contains(variable.getName())) {
writeMethod(text, ((GrField) variable).getSetter());
}
}</BUG>
}
| PsiMethod getter = ((GrField) variable).getGetter();
if (getter != null) writeMethod(text, getter);
PsiMethod setter = ((GrField) variable).getSetter();
if (setter != null) writeMethod(text, setter);
|
45,450 | final String nameBySetter = PsiUtil.getPropertyNameBySetter(method);
if (!nameBySetter.equals(method.getName())) {
settersNames.add(nameBySetter);
}
}
<BUG>private boolean wasRunMethod(GrMethod method) {
</BUG>
boolean runMethodPresent = false;
if ("run".equals(method.getName())) {
PsiType returnType = method.getReturnType();
| private boolean wasRunMethod(PsiMethod method) {
|
45,451 | public boolean isVarArgs() {
return false;
}
@NotNull
public MethodSignature getSignature(@NotNull PsiSubstitutor substitutor) {
<BUG>return MethodSignatureBackedByPsiMethod.create(this, PsiSubstitutor.EMPTY);
}</BUG>
@Nullable
public PsiIdentifier getNameIdentifier() {
return myProperty.getNameIdentifier();
| return MethodSignatureBackedByPsiMethod.create(this, substitutor);
|
45,452 | if (ontologyMappings.get(key).equals(name)){
return ontologyMappings.get(key);
}
}
}
<BUG>return olsClient.getOntology(name);
}</BUG>
public String getOntologyNamespaceFromId(String uri){
if (ontologyMappings.containsKey(uri)){
| Ontology ontology = olsClient.getOntology(name);
ontologyMappings.put(ontology.getId(), ontology);
return ontology;
|
45,453 | public String getOntologyNamespaceFromId(String uri){
if (ontologyMappings.containsKey(uri)){
return ontologyMappings.get(uri).getNamespace();
}
Ontology ontology = olsClient.getOntologyFromId(URI.create(uri));
<BUG>if (ontology != null){
return ontology.getConfig().getNamespace();</BUG>
}
return null;
}
| ontologyMappings.put(ontology.getId(), ontology);
return ontology.getConfig().getNamespace();
|
45,454 | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
<BUG>import java.util.HashSet;
import java.util.LinkedList;</BUG>
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
| import java.util.Iterator;
import java.util.LinkedList;
|
45,455 | childService.getConfigDependencies() != null ?
childService.getConfigDependencies() :
parentService.getConfigDependencies() != null ?
parentService.getConfigDependencies() :
Collections.<String>emptyList());
<BUG>mergedServiceInfo.setConfigTypes(
childService.getConfigTypes() != null ?
childService.getConfigTypes() :
parentService.getConfigTypes() != null ?
parentService.getConfigTypes() :
Collections.<String, Map<String, Map<String, String>>>emptyMap());</BUG>
mergedServiceInfo.setExcludedConfigTypes(
| [DELETED] |
45,456 | serviceInfoMap.put(service.getName(), service);
} else {
ServiceInfo newServiceInfo = mergeServices(existingService, service);
serviceInfoMap.put(service.getName(), newServiceInfo);
}
<BUG>ServiceInfo serviceInfo = serviceInfoMap.get(service.getName());
if(serviceInfo.getCommandScript() != null) {</BUG>
actionMetadata.addServiceCheckAction(serviceInfo.getName());
}
}
| [DELETED] |
45,457 | LOG.error(txt);
throw new XPathException(JMS025, txt);
}
try {
connection.start();
<BUG>LOG.info(String.format("JMS connection is started. ClientId=%s", connection.getClientID()));
</BUG>
state = STATE.STARTED;
} catch (final JMSException ex) {
LOG.error(ex.getMessage(), ex);
| LOG.info("JMS connection is started. ClientId={}", connection.getClientID());
|
45,458 | final String messageSelector = jmsConfig.getMessageSelector();
final String subscriberName = jmsConfig.getSubscriberName();
final boolean isDurable = jmsConfig.isDurable(); // TRUE if not set, special case for Durable topic
final boolean isNoLocal = jmsConfig.isNoLocal();
if (destination instanceof Topic && isDurable) {
<BUG>messageConsumer = session.createDurableSubscriber((Topic) destination, subscriberName, messageSelector, isNoLocal);
} else {
messageConsumer = session.createConsumer(destination, messageSelector, isNoLocal);
}</BUG>
messageListener.setSession(session);
| LOG.info("Created durable subscriber for {}", jmsConfig.getDestination());
LOG.info("Created non-durable subscriber for {}", jmsConfig.getDestination());
}
|
45,459 | } else {
messageConsumer = session.createConsumer(destination, messageSelector, isNoLocal);
}</BUG>
messageListener.setSession(session);
messageConsumer.setMessageListener(messageListener);
<BUG>if (LOG.isDebugEnabled()) {
LOG.debug(String.format("JMS connection is initialized: %s=%s %s",
Constants.CLIENT_ID, connection.getClientID(), jmsConfig.toString()));
} else {
LOG.info(String.format("JMS connection is initialized: %s=%s",
Constants.CLIENT_ID, connection.getClientID()));</BUG>
}
| LOG.info("Created non-durable subscriber for {}", jmsConfig.getDestination());
LOG.debug("JMS connection is initialized: {}={} {}", Constants.CLIENT_ID, connection.getClientID(), jmsConfig.toString());
LOG.info("JMS connection is initialized: {}={}", Constants.CLIENT_ID, connection.getClientID());
|
45,460 | state = STATE.STOPPED;
} catch (final Throwable t) {
state = STATE.ERROR;
closeAllSilently(initialContext, connection, session);
LOG.error(t.getMessage(), t);
<BUG>LOG.debug("" + jmsConfig.toString());
</BUG>
messageListener.getReport().addReceiverError(t);
throw new XPathException(JMS000, t.getMessage());
}
| LOG.debug("{}", jmsConfig.toString());
|
45,461 | LOG.error(txt);
throw new XPathException(JMS025, txt);
}
try {
connection.stop();
<BUG>LOG.info(String.format("JMS connection is stopped. ClientId=%s", connection.getClientID()));
</BUG>
state = STATE.STOPPED;
} catch (final JMSException ex) {
LOG.error(ex.getMessage(), ex);
| LOG.info("JMS connection is stopped. ClientId={}", connection.getClientID());
|
45,462 | import me.henrytao.smoothappbarlayoutdemo.fragment.GsdEnterAlwaysFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.GsdExitUntilCollapsedFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.GsdNestedScrollViewParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.GsdParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.GsdSwipeRefreshLayoutFragment;
<BUG>import me.henrytao.smoothappbarlayoutdemo.fragment.GsdViewPagerFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothAvatarFragment;</BUG>
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothDefaultFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothEnterAlwaysCollapsedFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothEnterAlwaysCollapsedParallaxFragment;
| import me.henrytao.smoothappbarlayoutdemo.fragment.GsdViewPagerParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothAvatarFragment;
|
45,463 | import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothExitUntilCollapsedFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothNestedScrollViewParallax2Fragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothNestedScrollViewParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothSwipeRefreshLayoutFragment;
<BUG>import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothViewPagerFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothViewPagerRunnableFragment;</BUG>
public class FeatureActivity extends AppCompatActivity {
private static final String FEATURE = "FEATURE";
private static final String TITLE = "TITLE";
| import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothViewPagerParallaxFragment;
import me.henrytao.smoothappbarlayoutdemo.fragment.SmoothViewPagerRunnableFragment;
|
45,464 | "SMOOTH_NESTED_SCROLL_VIEW_PARALLAX"),
GSD_NESTED_SCROLL_VIEW_PARALLAX_2("GSD_NESTED_SCROLL_VIEW_PARALLAX_2"), SMOOTH_NESTED_SCROLL_VIEW_PARALLAX_2(
"SMOOTH_NESTED_SCROLL_VIEW_PARALLAX_2"),
GSD_SWIPE_REFRESH_LAYOUT("GSD_SWIPE_REFRESH_LAYOUT"), SMOOTH_SWIPE_REFRESH_LAYOUT("SMOOTH_SWIPE_REFRESH_LAYOUT"),
GSD_VIEW_PAGER("GSD_VIEW_PAGER"), SMOOTH_VIEW_PAGER("SMOOTH_VIEW_PAGER"),
<BUG>GSD_VIEW_PAGER_RUNNABLE("GSD_VIEW_PAGER_RUNNABLE"), SMOOTH_VIEW_PAGER_RUNNABLE("SMOOTH_VIEW_PAGER_RUNNABLE");
private String mName;</BUG>
Feature(String name) {
mName = name;
| GSD_VIEW_PAGER_RUNNABLE("GSD_VIEW_PAGER_RUNNABLE"), SMOOTH_VIEW_PAGER_RUNNABLE("SMOOTH_VIEW_PAGER_RUNNABLE"),
GSD_VIEW_PAGER_PARALLAX("GSD_VIEW_PAGER_PARALLAX"), SMOOTH_VIEW_PAGER_PARALLAX("SMOOTH_VIEW_PAGER_PARALLAX");
private String mName;
|
45,465 | features.add(new Feature(Constants.Feature.GSD_SWIPE_REFRESH_LAYOUT, "SwipeRefreshLayout"));
features.add(new Feature(Constants.Feature.SMOOTH_SWIPE_REFRESH_LAYOUT, "Smooth SwipeRefreshLayout"));
features.add(new Feature(Constants.Feature.GSD_VIEW_PAGER, "ViewPager"));
features.add(new Feature(Constants.Feature.SMOOTH_VIEW_PAGER, "Smooth ViewPager"));
features.add(new Feature(Constants.Feature.GSD_VIEW_PAGER_RUNNABLE, ""));
<BUG>features.add(new Feature(Constants.Feature.SMOOTH_VIEW_PAGER_RUNNABLE, "Smooth ViewPager Runnable"));
return features;</BUG>
}
public static class Feature {
private Constants.Feature mKey;
| features.add(new Feature(Constants.Feature.GSD_VIEW_PAGER_PARALLAX, "ViewPager Parallax"));
features.add(new Feature(Constants.Feature.SMOOTH_VIEW_PAGER_PARALLAX, "Smooth ViewPager Parallax"));
return features;
|
45,466 | public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ViewPagerRunnableAdapter adapter = new ViewPagerRunnableAdapter(getChildFragmentManager());
adapter.addFragment(DummyRecyclerViewFragment.newInstance("Cat", 100, R.layout.item_action_bar_tab_layout_spacing), "Cat");
adapter.addFragment(DummyRecyclerViewFragment.newInstance("Dog", 100, R.layout.item_action_bar_tab_layout_spacing), "Dog");
<BUG>adapter.addFragment(DummyRecyclerViewFragment.newInstance("Mouse", 100, R.layout.item_action_bar_tab_layout_spacing), "Mouse");
adapter.addFragment(DummyRecyclerViewFragment.newInstance("Bird", 100, R.layout.item_action_bar_tab_layout_spacing), "Bird");
adapter.addFragment(DummyRecyclerViewFragment.newInstance("Chicken", 5, R.layout.item_action_bar_tab_layout_spacing), "Chicken");
if (adapter instanceof PagerAdapter) {</BUG>
vViewPager.setAdapter(adapter);
| adapter.addFragment(DummyNestedScrollViewFragment.newInstance(getString(R.string.text_long),
R.layout.item_action_bar_tab_layout_spacing), "Duck");
adapter.addFragment(DummyNestedScrollViewFragment.newInstance(getString(R.string.text_short),
R.layout.item_action_bar_tab_layout_spacing), "Tiger");
if (adapter instanceof PagerAdapter) {
|
45,467 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
45,468 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
45,469 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
45,470 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
45,471 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
|
45,472 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
45,473 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
45,474 | package org.jetbrains.plugins.groovy.refactoring.inline;
import com.intellij.lang.refactoring.InlineHandler;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
<BUG>import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileEditor.FileEditorManager;</BUG>
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.WindowManager;
import com.intellij.psi.*;
| import com.intellij.openapi.editor.CaretModel;
import com.intellij.openapi.fileEditor.FileEditorManager;
|
45,475 | return new ArrayList<String>();
}
public void inlineReference(PsiReference reference, PsiElement referenced) {
PsiElement element = reference.getElement();
assert element instanceof GrExpression && element.getParent() instanceof GrCallExpression;
<BUG>GrCallExpression call = (GrCallExpression) element.getParent();
PsiElement position = inlineReferenceImpl(call, myMethod, isOnExpressionOrReturnPlace(call), GroovyInlineMethodUtil.isTailMethodCall(call));
if (position != null && position instanceof GrExpression) {
Project project = referenced.getProject();</BUG>
FileEditorManager manager = FileEditorManager.getInstance(project);
| SmartPsiElementPointer<GrExpression> pointer =
if (pointer != null && pointer.getElement() != null) {
Project project = referenced.getProject();
|
45,476 | if (!(statements.length > 0 && statement == statements[statements.length - 1] && hasTailExpr)) {
owner.addStatementBefore(statement, anchor);
}
}
if (replaceCall && !isTailMethodCall) {
<BUG>return replaced;
} else {</BUG>
GrStatement stmt;
if (isTailMethodCall && enclosingExpr.getParent() instanceof GrReturnStatement) {
stmt = ((GrReturnStatement) enclosingExpr.getParent());
| assert replaced != null;
SmartPsiElementPointer<GrExpression> pointer = SmartPointerManager.getInstance(replaced.getProject()).createSmartPsiElementPointer(replaced);
reformatOwner(owner);
return pointer;
} else {
|
45,477 | stmt = ((GrReturnStatement) enclosingExpr.getParent());
} else {
stmt = enclosingExpr;
}
stmt.removeStatement();
<BUG>return owner;
}</BUG>
} catch (IncorrectOperationException e) {
LOG.error(e);
}
| reformatOwner(owner);
return null;
|
45,478 | RedisConnection<K, V> conn = super.connect(codec);
conn.auth(password);
return conn;</BUG>
}
@Override
<BUG>public <K, V> RedisAsyncConnection<K, V> connectAsync(RedisCodec<K, V> codec) {
RedisAsyncConnection<K, V> conn = super.connectAsync(codec);
conn.auth(password);
return conn;</BUG>
}
| public AuthenticatingRedisClient(String host, int port, String password) {
super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build());
public AuthenticatingRedisClient(String host, String password) {
super(null, RedisURI.builder().withHost(host).withPassword(password).build());
public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) {
return super.connect(codec);
|
45,479 | RedisAsyncConnection<K, V> conn = super.connectAsync(codec);
conn.auth(password);
return conn;</BUG>
}
@Override
<BUG>public <K, V> RedisPubSubConnection<K, V> connectPubSub(RedisCodec<K, V> codec) {
RedisPubSubConnection<K, V> conn = super.connectPubSub(codec);
conn.auth(password);
return conn;</BUG>
}
| public AuthenticatingRedisClient(String host, int port, String password) {
super(null, RedisURI.builder().withHost(host).withPort(port).withPassword(password).build());
public AuthenticatingRedisClient(String host, String password) {
super(null, RedisURI.builder().withHost(host).withPassword(password).build());
public <K, V> StatefulRedisConnection<K, V> connect(RedisCodec<K, V> codec) {
return super.connect(codec);
|
45,480 | this.client = RedisClient.create(clientResources, getRedisURI());
} else {
this.client = RedisClient.create(getRedisURI());
}
client.setDefaultTimeout(timeout, TimeUnit.MILLISECONDS);
<BUG>this.internalPool = new GenericObjectPool<RedisAsyncConnection>(new LettuceFactory(client, dbIndex), poolConfig);
}</BUG>
private RedisURI getRedisURI() {
RedisURI redisUri = isRedisSentinelAware()
| this.internalPool = new GenericObjectPool<StatefulConnection<byte[], byte[]>>(new LettuceFactory(client, dbIndex),
|
45,481 | return internalPool.borrowObject();
} catch (Exception e) {
throw new PoolException("Could not get a resource from the pool", e);
}
}
<BUG>public void returnBrokenResource(final RedisAsyncConnection<byte[], byte[]> resource) {
</BUG>
try {
internalPool.invalidateObject(resource);
} catch (Exception e) {
| public void returnBrokenResource(final StatefulConnection<byte[], byte[]> resource) {
|
45,482 | internalPool.invalidateObject(resource);
} catch (Exception e) {
throw new PoolException("Could not invalidate the broken resource", e);
}
}
<BUG>public void returnResource(final RedisAsyncConnection<byte[], byte[]> resource) {
</BUG>
try {
internalPool.returnObject(resource);
} catch (Exception e) {
| public void returnResource(final StatefulConnection<byte[], byte[]> resource) {
|
45,483 | super();
this.client = client;
this.dbIndex = dbIndex;
}
@Override
<BUG>public void activateObject(PooledObject<RedisAsyncConnection> pooledObject) throws Exception {
pooledObject.getObject().select(dbIndex);
}
public void destroyObject(final PooledObject<RedisAsyncConnection> obj) throws Exception {
</BUG>
try {
| public void activateObject(PooledObject<StatefulConnection<byte[], byte[]>> pooledObject) throws Exception {
if (pooledObject.getObject() instanceof StatefulRedisConnection) {
((StatefulRedisConnection) pooledObject.getObject()).sync().select(dbIndex);
public void destroyObject(final PooledObject<StatefulConnection<byte[], byte[]>> obj) throws Exception {
|
45,484 | import android.support.annotation.Nullable;
import android.text.TextUtils;
import java.util.Locale;
import java.util.Collections;
import java.util.Map;
<BUG>import java.util.Observable;
public class Client extends Observable {
</BUG>
private static final boolean BLOCKING = true;
private static final String SHARED_PREF_KEY = "com.bugsnag.android";
| import java.util.Observer;
public class Client extends Observable implements Observer {
|
45,485 | if(value != null) {
tab.put(key, value);
} else {
tab.remove(key);
}
<BUG>if (notify && Bugsnag.client != null) {
Bugsnag.getClient().notifyBugsnagObservers(NotifyType.META);
}</BUG>
}
public void clearTab(String tabName) {
| [DELETED] |
45,486 | Bugsnag.getClient().notifyBugsnagObservers(NotifyType.META);
}</BUG>
}
public void clearTab(String tabName) {
store.remove(tabName);
<BUG>if (Bugsnag.client != null) {
Bugsnag.getClient().notifyBugsnagObservers(NotifyType.META);
}</BUG>
}
Map<String, Object> getTab(String tabName) {
| if(value != null) {
tab.put(key, value);
} else {
tab.remove(key);
|
45,487 | import android.support.annotation.NonNull;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
<BUG>public class Configuration {
static final String DEFAULT_ENDPOINT = "https://notify.bugsnag.com";</BUG>
private final String apiKey;
private String buildUUID;
private String appVersion;
| import java.util.Observable;
import java.util.Observer;
public class Configuration extends Observable implements Observer {
static final String DEFAULT_ENDPOINT = "https://notify.bugsnag.com";
|
45,488 | public String getAppVersion() {
return appVersion;
}
public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
<BUG>notifyObservers(NotifyType.APP);
</BUG>
}
public String getContext() {
return context;
| notifyBugsnagObservers(NotifyType.APP);
|
45,489 | public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
<BUG>notifyObservers(NotifyType.CONTEXT);
</BUG>
}
public String getEndpoint() {
return endpoint;
| notifyBugsnagObservers(NotifyType.CONTEXT);
|
45,490 | public String getBuildUUID() {
return buildUUID;
}
public void setBuildUUID(String buildUUID) {
this.buildUUID = buildUUID;
<BUG>notifyObservers(NotifyType.APP);
</BUG>
}
public String[] getFilters() {
return filters;
| notifyBugsnagObservers(NotifyType.APP);
|
45,491 | public String[] getNotifyReleaseStages() {
return notifyReleaseStages;
}
public void setNotifyReleaseStages(String[] notifyReleaseStages) {
this.notifyReleaseStages = notifyReleaseStages;
<BUG>notifyObservers(NotifyType.RELEASE_STAGES);
</BUG>
}
public String[] getProjectPackages() {
return projectPackages;
| notifyBugsnagObservers(NotifyType.RELEASE_STAGES);
|
45,492 | public String getReleaseStage() {
return releaseStage;
}
public void setReleaseStage(String releaseStage) {
this.releaseStage = releaseStage;
<BUG>notifyObservers(NotifyType.APP);
</BUG>
}
public boolean getSendThreads() {
return sendThreads;
| notifyBugsnagObservers(NotifyType.APP);
|
45,493 | this.enableExceptionHandler = enableExceptionHandler;
}
protected MetaData getMetaData() {
return metaData;
}
<BUG>protected void setMetaData(MetaData metaData) {
this.metaData = metaData;
notifyObservers(NotifyType.META);
</BUG>
}
| this.metaData.deleteObserver(this);
this.metaData.addObserver(this);
notifyBugsnagObservers(NotifyType.META);
|
45,494 | }
}
}
return false;
}
<BUG>private void notifyObservers(NotifyType type) {
if (Bugsnag.client != null) {
Bugsnag.getClient().notifyBugsnagObservers(type);
}</BUG>
}
| public void setSendThreads(boolean sendThreads) {
this.sendThreads = sendThreads;
|
45,495 | public static final String DELETE_ACTION_HISTORY_RESULT;
public static final String DELETE_ACTION_PLUGIN;
public static final String DELETE_ALERT;
public static final String DELETE_ALERT_CTIME;
public static final String DELETE_ALERT_LIFECYCLE;
<BUG>public static final String DELETE_ALERT_SEVERITY;
public static final String DELETE_ALERT_STATUS;</BUG>
public static final String DELETE_ALERT_TRIGGER;
public static final String DELETE_CONDITIONS;
public static final String DELETE_CONDITIONS_MODE;
| [DELETED] |
45,496 | public static final String INSERT_ACTION_PLUGIN;
public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES;
public static final String INSERT_ALERT;
public static final String INSERT_ALERT_CTIME;
public static final String INSERT_ALERT_LIFECYCLE;
<BUG>public static final String INSERT_ALERT_SEVERITY;
public static final String INSERT_ALERT_STATUS;</BUG>
public static final String INSERT_ALERT_TRIGGER;
public static final String INSERT_CONDITION_AVAILABILITY;
public static final String INSERT_CONDITION_COMPARE;
| [DELETED] |
45,497 | public static final String SELECT_ALERT_CTIME_START;
public static final String SELECT_ALERT_CTIME_START_END;
public static final String SELECT_ALERT_LIFECYCLE_END;
public static final String SELECT_ALERT_LIFECYCLE_START;
public static final String SELECT_ALERT_LIFECYCLE_START_END;
<BUG>public static final String SELECT_ALERT_STATUS;
public static final String SELECT_ALERT_SEVERITY;</BUG>
public static final String SELECT_ALERT_TRIGGER;
public static final String SELECT_ALERTS_BY_TENANT;
public static final String SELECT_CONDITION_ID;
| [DELETED] |
45,498 | DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? ";
DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes "
+ "WHERE tenantId = ? AND ctime = ? AND alertId = ? ";
DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? ";
<BUG>DELETE_ALERT_SEVERITY = "DELETE FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? AND alertId = ? ";
DELETE_ALERT_STATUS = "DELETE FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? AND alertId = ? ";</BUG>
DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
| [DELETED] |
45,499 | INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) ";
INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes "
+ "(tenantId, alertId, ctime) VALUES (?, ?, ?) ";
INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle "
+ "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) ";
<BUG>INSERT_ALERT_SEVERITY = "INSERT INTO " + keyspace + ".alerts_severities "
+ "(tenantId, alertId, severity) VALUES (?, ?, ?) ";
INSERT_ALERT_STATUS = "INSERT INTO " + keyspace + ".alerts_statuses "
+ "(tenantId, alertId, status) VALUES (?, ?, ?) ";</BUG>
INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
| [DELETED] |
45,500 | + "WHERE tenantId = ? AND status = ? AND stime <= ? ";
SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? ";
SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? ";
<BUG>SELECT_ALERT_SEVERITY = "SELECT alertId FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? ";
SELECT_ALERT_STATUS = "SELECT alertId FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? ";</BUG>
SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
| [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.