id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
23,701 | import jfixture.publicinterface.InstanceType;
public class ArrayGenerator implements InstanceGenerator {
@Override
public <T> boolean AppliesTo(InstanceType<T> clazz) {
return clazz.isArray();
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> type, Fixture fixture) {
InstanceType<?> componentType = type.getArray... | @SuppressWarnings("unchecked")
|
23,702 | || typeToken.isRawTypeAssignableFrom(Integer.class)
|| typeToken.isRawTypeAssignableFrom(short.class)
|| typeToken.isRawTypeAssignableFrom(Short.class)
|| typeToken.isRawTypeAssignableFrom(long.class)
|| typeToken.isRawTypeAssignableFrom(Long.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, F... | @SuppressWarnings("unchecked")
@Override
|
23,703 | public class DateGenerator implements InstanceGenerator {
Calendar calendar = Calendar.getInstance();
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isRawTypeAssignableFrom(Date.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) {
calendar.... | @SuppressWarnings("unchecked")
|
23,704 | public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isRawTypeAssignableFrom(double.class)
|| typeToken.isRawTypeAssignableFrom(Double.class)
|| typeToken.isRawTypeAssignableFrom(float.class)
|| typeToken.isRawTypeAssignableFrom(Float.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T... | @SuppressWarnings("unchecked")
@Override
|
23,705 | import jfixture.publicinterface.InstanceType;
public class PlainObjectGenerator implements InstanceGenerator {
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isRawTypeAssignableFrom(Object.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) ... | @SuppressWarnings("unchecked")
|
23,706 | package jfixture.publicinterface;
<BUG>import com.google.common.reflect.TypeToken;
public class ObjectCreationException extends RuntimeException {</BUG>
public ObjectCreationException(InstanceType<?> instanceType) {
super("Cannot create an instance of " + instanceType);
}
| @SuppressWarnings("serial")
public class ObjectCreationException extends RuntimeException {
|
23,707 | private Boolean currentValue = false;
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isAssignableFrom(boolean.class)
|| typeToken.isAssignableFrom(Boolean.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) {
currentValue = !currentValue;
re... | @SuppressWarnings("unchecked")
|
23,708 | public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isRawTypeAssignableFrom(byte.class)
|| typeToken.isRawTypeAssignableFrom(Byte.class)
|| typeToken.isRawTypeAssignableFrom(char.class)
|| typeToken.isRawTypeAssignableFrom(Character.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T>... | @SuppressWarnings("unchecked")
@Override
|
23,709 | import jfixture.publicinterface.InstanceType;
public class BigDecimalGenerator implements InstanceGenerator {
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isAssignableFrom(BigDecimal.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) {
re... | @SuppressWarnings("unchecked")
|
23,710 | package jfixture.publicinterface.generators;
import java.util.UUID;
import jfixture.publicinterface.Fixture;
import jfixture.publicinterface.InstanceType;
<BUG>public class StringGenerator implements InstanceGenerator {
public <T> T next(InstanceType<T> clazz, Fixture fixture) {</BUG>
return (T)UUID.randomUUID().toStri... | @SuppressWarnings("unchecked")
public <T> T next(InstanceType<T> clazz, Fixture fixture) {
|
23,711 | import jfixture.publicinterface.generators.DoubleGenerator;
import jfixture.publicinterface.generators.EnumGenerator;</BUG>
import jfixture.publicinterface.generators.GeneratorsFactory;
import jfixture.publicinterface.generators.GeneratorsPipeline;
import jfixture.publicinterface.generators.InstanceGenerator;
<BUG>impo... | package jfixture.publicinterface;
|
23,712 | import jfixture.publicinterface.generators.DoubleGenerator;
import jfixture.publicinterface.generators.EnumGenerator;
import jfixture.publicinterface.generators.InstanceGenerator;
import jfixture.publicinterface.generators.IntGenerator;
import jfixture.publicinterface.generators.PlainObjectGenerator;
<BUG>import jfixtu... | import jfixture.publicinterface.generators.implementationdetails.InMemoryEnumCache;
public class GeneratorsFactory {
|
23,713 | public class CalendarGenerator implements InstanceGenerator {
int secondsToAdd = 0;
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isRawTypeAssignableFrom(Calendar.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) {
Calendar calendar = new... | @SuppressWarnings("unchecked")
|
23,714 | import jfixture.publicinterface.InstanceType;
public class BigIntGenerator implements InstanceGenerator {
@Override
public <T> boolean AppliesTo(InstanceType<T> typeToken) {
return typeToken.isAssignableFrom(BigInteger.class);
<BUG>}
@Override</BUG>
public <T> T next(InstanceType<T> typeToken, Fixture fixture) {
return... | @SuppressWarnings("unchecked")
|
23,715 | package com.googlecode.cqengine.query.simple;
import com.googlecode.cqengine.IndexedCollection;
import com.googlecode.cqengine.attribute.Attribute;
import com.googlecode.cqengine.attribute.SimpleAttribute;
import com.googlecode.cqengine.query.Query;
<BUG>import com.googlecode.cqengine.query.option.QueryOptions;
import ... | import com.googlecode.cqengine.resultset.ResultSet;
import static com.googlecode.cqengine.query.QueryFactory.*;
|
23,716 | @Override
public String toString() {
return "desc";
}
};
<BUG>public static final SortOrder DEFAULT = DESC;
private static final SortOrder PROTOTYPE = DEFAULT;
</BUG>
@Override
public SortOrder readFrom(StreamInput in) throws IOException {
| return "asc";
},
DESC {
private static final SortOrder PROTOTYPE = ASC;
|
23,717 | GeoDistance geoDistance = GeoDistance.DEFAULT;
boolean reverse = false;
MultiValueMode sortMode = null;
NestedInnerQueryParseSupport nestedHelper = null;
final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0);
<BUG>boolean coerce = false;
boolean ... | boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE;
boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED;
XContentParser.Token token;
|
23,718 | String currentName = parser.currentName();
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
currentName = parser.currentName();
} else if (token == XContentParser.Token.START_ARRAY) {
<BUG>parseGeoPoints(parser, geoPoints);
</BUG>
fieldName = curr... | GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
|
23,719 | package org.elasticsearch.search.sort;
<BUG>import org.elasticsearch.script.Script;
public class SortBuilders {</BUG>
public static ScoreSortBuilder scoreSort() {
return new ScoreSortBuilder();
}
| import org.elasticsearch.common.geo.GeoPoint;
import java.util.Arrays;
public class SortBuilders {
|
23,720 | public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) {
this.ignoreMalformed = ignoreMalformed;
return this;
}</BUG>
@Override
<BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject("_geo_distance");
if (geohashes.size() == 0 && points.si... | if (coerce == false) {
}
}
public boolean ignoreMalformed() {
return this.ignoreMalformed;
}
builder.startObject(NAME);
|
23,721 | 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 CommandDel... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
23,722 | .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... | String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
23,723 | </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 exis... |
23,724 | 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[... | Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
23,725 | .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... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,726 | .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... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,727 | @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 stat... | private static FoxGuardMain instanceField;
|
23,728 | 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;
}
|
23,729 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
23,730 | 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 Comm... | import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
23,731 | .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... | return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
23,732 | 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 ... | 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) -> {
|
23,733 | 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 {
fg... | 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(n... |
23,734 | 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 {
fgOb... | Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
23,735 | 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(... | Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
23,736 | 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("l... | 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() + "\"");
|
23,737 | 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
|
23,738 | .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))
.co... | return Stream.of("region", "worldregion", "handler", "controller")
|
23,739 | public Collection<ExpandDrill> get_drills(ArtEngine p_art_engine, boolean p_attach_smd)
{
if ( p_art_engine.get_net_no() == net_no) return drill_list;
net_no = p_art_engine.get_net_no();
drill_list.clear();
<BUG>AwtreeShapeSearch search_tree = p_art_engine.art_search_tree;
Collection<AwtreeEntry> overlaps = new LinkedL... | Collection<AwtreeEntry> overlaps = search_tree.find_overlap_tree_entries(page_shape, -1);
|
23,740 | p_start_piece.set_search_tree_entries(this, start_piece_leaf_arr );
p_end_piece.set_search_tree_entries(this, end_piece_leaf_arr );
}
public final TreeSet<AwtreeObject> find_overlap_objects(ShapeConvex p_shape, int p_layer, NetNosList p_ignore_net_nos)
{
<BUG>TreeSet<AwtreeObject> risul_obstacles = new TreeSet<AwtreeOb... | Collection<AwtreeEntry> tree_entries = find_overlap_tree_entries(p_shape, p_layer, p_ignore_net_nos);
|
23,741 | if (add_item)
{
AwtreeEntry new_entry = new AwtreeEntry(curr_object, shape_index);
p_risul_tree.add(new_entry);
}
<BUG>}
}
public final void find_overlap_tree_entries_with_clearance(ShapeTile p_shape, int p_layer, NetNosList p_ignore_net_nos, int p_cl_type, Collection<AwtreeEntry> p_result)
{
if (p_shape == null) retur... | return p_risul_tree;
public final Collection<AwtreeEntry> find_overlap_tree_entries_with_clearance(
if (p_result == null) p_result = new LinkedList<AwtreeEntry>();
if (p_shape == null) return p_result;
|
23,742 | PlaSegmentInt curr_segment = polyline.segment_get(index + 1);
if (p_clip_shape != null)
{
if ( ! p_clip_shape.intersects(curr_segment.bounding_box())) continue;
}
<BUG>ShapeTile curr_shape = get_tree_shape(default_tree, index);
LinkedList<AwtreeEntry> over_tree_entries = new LinkedList<AwtreeEntry>();
default_tree.calc... | Collection<AwtreeEntry> over_tree_entries = default_tree.find_overlap_tree_entries(curr_shape, get_layer());
|
23,743 | ArrayList<PlaLineInt> intersecting_lines = found_line_segment.intersection(curr_segment);
LinkedList<BrdTracep> split_pieces = new LinkedList<BrdTracep>();
boolean found_trace_split = split_tracep_other (found_trace, split_pieces, intersecting_lines, overlap_tentry);
if (found_trace_split)
{
<BUG>default_tree.calc_over... | over_tree_entries = default_tree.find_overlap_tree_entries(curr_shape, get_layer());
over_tree_iter = over_tree_entries.iterator();
|
23,744 | package er.directtoweb;
import com.webobjects.appserver.WOContext;
<BUG>import com.webobjects.directtoweb.D2WQueryToOneRelationship;
public class ERD2WQueryToOneRelationship extends D2WQueryToOneRelationship {
public ERD2WQueryToOneRelationship(WOContext context) {</BUG>
super(context);
}
| import com.webobjects.eocontrol.*;
import com.webobjects.eoaccess.*;
import er.extensions.*;
static final ERXLogger log = ERXLogger.getLogger(ERD2WQueryToOneRelationship.class);
public ERD2WQueryToOneRelationship(WOContext context) {
|
23,745 | System.out.println( "Press return to start the checker..." );
System.in.read();
}
Config tuningConfiguration = buildTuningConfiguration( configuration );
StoreAccess storeAccess = createStoreAccess( configuration.get( DataGenerator.store_dir ), tuningConfiguration );
<BUG>configuration.get( checker_version ).run(
new T... | JsonReportWriter reportWriter = new JsonReportWriter( configuration, tuningConfiguration );
TimingProgress progressMonitor = new TimingProgress( new TimeLogger( reportWriter ), progress );
configuration.get( checker_version ).run( progressMonitor, storeAccess, tuningConfiguration );
|
23,746 | this.feedbackSessionName = feedbackSessionName;
this.feedbackQuestionId = feedbackQuestionId;
this.giverEmail = giverEmail;
this.feedbackResponseId = feedbackResponseId;
this.createdAt = createdAt;
<BUG>this.commentText = commentText == null ? null : new Text(Sanitizer.sanitizeForRichText(commentText.getValue()));
this... | this.commentText = Sanitizer.sanitizeForRichText(commentText);
this.giverSection = giverSection;
|
23,747 | public String getJsonString() {
return JsonUtils.toJson(this, FeedbackResponseCommentAttributes.class);
}
@Override
public void sanitizeForSaving() {
<BUG>this.commentText = Sanitizer.sanitizeTextField(this.commentText);
if (commentText != null) {
this.commentText = new Text(Sanitizer.sanitizeForRichText(commentText.g... | [DELETED] |
23,748 | public FeedbackQuestionAttributes(FeedbackQuestion fq) {
this.feedbackQuestionId = fq.getId();
this.feedbackSessionName = fq.getFeedbackSessionName();
this.courseId = fq.getCourseId();
this.creatorEmail = fq.getCreatorEmail();
<BUG>this.questionMetaData = fq.getQuestionMetaData();
this.questionDescription = fq.getQuest... | this.questionDescription = Sanitizer.sanitizeForRichText(fq.getQuestionDescription());
|
23,749 | showResponsesTo.removeAll(optionsToRemove);
showGiverNameTo.removeAll(optionsToRemove);
showRecipientNameTo.removeAll(optionsToRemove);
}
@Override
<BUG>public void sanitizeForSaving() {
this.questionDescription = this.questionDescription == null
? null
: new Text(Sanitizer.sanitizeForRichText(this.questionDescription.... | this.questionDescription = Sanitizer.sanitizeForRichText(this.questionDescription);
|
23,750 | Set<String> recipients, Date createdAt, Text commentText) {
this.courseId = courseId;
this.giverEmail = giverEmail;
this.recipientType = recipientType == null ? CommentParticipantType.PERSON : recipientType;
this.recipients = recipients;
<BUG>this.commentText = commentText == null ? null : new Text(Sanitizer.sanitizeFo... | this.commentText = Sanitizer.sanitizeForRichText(commentText);
this.createdAt = createdAt;
|
23,751 | this.showCommentTo = comment.getShowCommentTo();
this.showGiverNameTo = comment.getShowGiverNameTo();
this.showRecipientNameTo = comment.getShowRecipientNameTo();
this.recipients = comment.getRecipients();
this.createdAt = comment.getCreatedAt();
<BUG>this.commentText = comment.getCommentText() == null
? null
: new Tex... | this.commentText = Sanitizer.sanitizeForRichText(comment.getCommentText());
|
23,752 | return Const.SystemParams.COURSE_BACKUP_LOG_MSG + courseId;
}
@Override
public void sanitizeForSaving() {
this.courseId = this.courseId.trim();
<BUG>this.commentText = Sanitizer.sanitizeTextField(this.commentText);
</BUG>
this.courseId = Sanitizer.sanitizeForHtml(courseId);
this.giverEmail = Sanitizer.sanitizeForHtml(g... | this.commentText = Sanitizer.sanitizeForRichText(commentText);
|
23,753 | HashSet<String> sanitizedRecipients = new HashSet<String>();
for (String recipientId : recipients) {
sanitizedRecipients.add(Sanitizer.sanitizeForHtml(recipientId));
}
recipients = sanitizedRecipients;
<BUG>}
if (commentText != null) {
this.commentText = new Text(Sanitizer.sanitizeForRichText(commentText.getValue()));<... | [DELETED] |
23,754 | boolean isPublishedEmailEnabled, Set<String> instructorList,
Set<String> studentList) {
this.feedbackSessionName = feedbackSessionName;
this.courseId = courseId;
this.creatorEmail = creatorId;
<BUG>this.instructions = instructions == null ? null : new Text(Sanitizer.sanitizeForRichText(instructions.getValue()));
this.c... | this.instructions = Sanitizer.sanitizeForRichText(instructions);
this.createdTime = createdTime;
|
23,755 | public boolean isCreator(String instructorEmail) {
return creatorEmail.equals(instructorEmail);
}
@Override
public void sanitizeForSaving() {
<BUG>if (instructions != null) {
this.instructions = new Text(Sanitizer.sanitizeForRichText(instructions.getValue()));
}</BUG>
}
@Override
| this.instructions = Sanitizer.sanitizeForRichText(instructions);
|
23,756 | this.feedbackQuestionId = feedbackQuestionId;
this.giverEmail = giverEmail;
this.feedbackResponseId = feedbackResponseId;
this.sendingState = sendingState;
this.createdAt = createdAt;
<BUG>this.commentText = commentText == null ? null : new Text(Sanitizer.sanitizeForRichText(commentText.getValue()));
this.giverSection ... | this.commentText = Sanitizer.sanitizeForRichText(commentText);
this.giverSection = giverSection;
|
23,757 | package teammates.test.cases.common;
import java.util.ArrayList;
import java.util.List;
<BUG>import org.testng.annotations.Test;
import teammates.common.util.Sanitizer;</BUG>
import teammates.test.cases.BaseTestCase;
public class SanitizerTest extends BaseTestCase {
@Test
| import com.google.appengine.api.datastore.Text;
import teammates.common.util.Sanitizer;
|
23,758 | this.sendingState = sendingState;
this.showCommentTo = showCommentTo;
this.showGiverNameTo = showGiverNameTo;
this.showRecipientNameTo = showRecipientNameTo;
this.createdAt = date;
<BUG>this.commentText = comment == null ? null : new Text(Sanitizer.sanitizeForRichText(comment.getValue()));
this.lastEditorEmail = lastEd... | this.commentText = Sanitizer.sanitizeForRichText(comment);
this.lastEditorEmail = lastEditorEmail == null ? giverEmail : lastEditorEmail;
|
23,759 | import org.jitsi.impl.neomedia.device.*;
import org.jitsi.service.resources.*;
import org.osgi.framework.*;
public class AudioDeviceConfigurationListener
extends AbstractDeviceConfigurationListener
<BUG>{
public AudioDeviceConfigurationListener(</BUG>
ConfigurationForm configurationForm)
{
super(configurationForm);
| private CaptureDeviceInfo captureDevice = null;
private CaptureDeviceInfo playbackDevice = null;
private CaptureDeviceInfo notificationDevice = null;
public AudioDeviceConfigurationListener(
|
23,760 | ResourceManagementService resources
= NeomediaActivator.getResources();
notificationService.fireNotification(
popUpEvent,
title,
<BUG>device.getName()
+ "\r\n"
</BUG>
+ resources.getI18NString(
"impl.media.configform"
| body
+ "\r\n\r\n"
|
23,761 | 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 ... | [DELETED] |
23,762 | 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 st... | [DELETED] |
23,763 | 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 SELEC... | [DELETED] |
23,764 | 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 sta... | [DELETED] |
23,765 | 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, ... | [DELETED] |
23,766 | + "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 stat... | [DELETED] |
23,767 | import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.stream.Collectors;
import javax.ejb.EJB;</BUG>
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
| import javax.annotation.PostConstruct;
import javax.ejb.EJB;
|
23,768 | import org.hawkular.alerts.api.model.trigger.Trigger;
import org.hawkular.alerts.api.services.ActionsService;
import org.hawkular.alerts.api.services.AlertsCriteria;
import org.hawkular.alerts.api.services.AlertsService;
import org.hawkular.alerts.api.services.DefinitionsService;
<BUG>import org.hawkular.alerts.api.ser... | import org.hawkular.alerts.api.services.PropertiesService;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
|
23,769 | import com.datastax.driver.core.Session;
import com.google.common.util.concurrent.Futures;
@Local(AlertsService.class)
@Stateless
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
<BUG>public class CassAlertsServiceImpl implements AlertsService {
private final MsgLogger msgLog = MsgLogger.LOGGER;
pr... | private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size";
private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE";
private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200";
private int criteriaNoQuerySize;
|
23,770 | log.debug("Adding " + alerts.size() + " alerts");
}
PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT);
PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER);
PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement... | [DELETED] |
23,771 | futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(),
a.getAlertId(),
a.getTriggerId())));
futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(),
a.getAlertId(), a.getCtime())));
<BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(),
a.getAlertId(),
a.getStatu... | [DELETED] |
23,772 | for (Row row : rsAlerts) {
String payload = row.getString("payload");
Alert alert = JsonUtil.fromJson(payload, Alert.class, thin);
alerts.add(alert);
}
<BUG>}
} catch (Exception e) {
msgLog.errorDatabaseException(e.getMessage());
throw e;
}
return preparePage(alerts, pager);</BUG>
}
| [DELETED] |
23,773 | for (Alert a : alertsToDelete) {
String id = a.getAlertId();
List<ResultSetFuture> futures = new ArrayList<>();
futures.add(session.executeAsync(deleteAlert.bind(tenantId, id)));
futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id)));
<BUG>futures.add(session.executeAsync(deleteAlertSeveri... | [DELETED] |
23,774 | private Alert updateAlertStatus(Alert alert) throws Exception {
if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) {
throw new IllegalArgumentException("AlertId must be not null");
}
try {
<BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session,
CassStatement.DELETE_ALERT_STAT... | [DELETED] |
23,775 | PreparedStatement insertAlertLifecycle = CassStatement.get(session,
CassStatement.INSERT_ALERT_LIFECYCLE);
PreparedStatement updateAlert = CassStatement.get(session,
CassStatement.UPDATE_ALERT);
List<ResultSetFuture> futures = new ArrayList<>();
<BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.ge... | [DELETED] |
23,776 | String category = null;
Collection<String> categories = null;
String triggerId = null;
Collection<String> triggerIds = null;
Map<String, String> tags = null;
<BUG>boolean thin = false;
public EventsCriteria() {</BUG>
super();
}
public Long getStartTime() {
| Integer criteriaNoQuerySize = null;
public EventsCriteria() {
|
23,777 | }
@Override
public String toString() {
return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId
+ ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId="
<BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + ... | public void addTag(String name, String value) {
if (null == tags) {
tags = new HashMap<>();
|
23,778 | import java.util.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
<BUG>import java.util.concurrent.atomic.AtomicInteger;
import static org.apache.felix.resolver.Util.getSymbolicName;</BUG>
import... | import java.util.regex.Pattern;
import static org.apache.felix.resolver.Util.getSymbolicName;
|
23,779 | import org.apache.felix.utils.version.VersionRange;
public class DeploymentAgent implements ManagedService {
private static final String FABRIC_ZOOKEEPER_PID = "fabric.zookeeper.id";
private static final String SNAPSHOT = "SNAPSHOT";
private static final String BLUEPRINT_PREFIX = "blueprint:";
<BUG>private static final... | private static final Pattern SNAPSHOT_PATTERN = Pattern.compile(".*-SNAPSHOT((\\.\\w{3})?|\\$.*|\\?.*|\\#.*|\\&.*)");
private static final Logger LOGGER = LoggerFactory.getLogger(DeploymentAgent.class);
|
23,780 | public abstract class SIPCommFrame
extends JFrame
implements Observer
{
private static final Logger logger = Logger.getLogger(SIPCommFrame.class);
<BUG>private static final String SIP_COMMUNICATOR_LOGO =
"service.gui.SIP_COMMUNICATOR_LOGO";
private final ActionMap amap;
private final InputMap imap;
private KeybindingS... | private static final String SIP_COMMUNICATOR_LOGO
= "service.gui.SIP_COMMUNICATOR_LOGO";
private ActionMap amap;
private InputMap imap;
private boolean isSaveSizeAndLocation = true;
public SIPCommFrame()
|
23,781 | import org.codehaus.groovy.control.CompilationUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class GroovyTreeParser implements TreeParser {
private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class);
<BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groo... | private Indexer indexer = new Indexer();
|
23,782 | if (scriptClass != null) {
sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach(
variable -> {
SymbolInformation symbol =
getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable);
<BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol);
s... | newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol);
if (classes.containsKey(variable.getType().getName())) {
newIndexer.addReference(classes.get(variable.getType().getName()),
GroovyLocations.createLocation(sourceUri, variable.getType()));
|
23,783 | }
if (typeReferences.containsKey(foundSymbol.getName())) {
foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG>
}
<BUG>return foundReferences;
}</BUG>
@Override
public Set<SymbolInformation> getFilteredSymbols(String query) {
checkNotNull(query, "query must not be null");
Pattern pattern = getQueryP... | });
sourceUnit.getAST().getStatementBlock()
.visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(),
classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
|
23,784 | <BUG>package com.palantir.ls.server.api;
import io.typefox.lsapi.ReferenceParams;</BUG>
import io.typefox.lsapi.SymbolInformation;
import java.net.URI;
import java.util.Map;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.ReferenceParams;
|
23,785 | import java.util.Map;
import java.util.Set;
public interface TreeParser {
void parseAllSymbols();
Map<URI, Set<SymbolInformation>> getFileSymbols();
<BUG>Map<String, Set<SymbolInformation>> getTypeReferences();
Set<SymbolInformation> findReferences(ReferenceParams params);
Set<SymbolInformation> getFilteredSymbols(St... | Map<Location, Set<Location>> getReferences();
Set<Location> findReferences(ReferenceParams params);
Optional<Location> gotoDefinition(URI uri, Position position);
Set<SymbolInformation> getFilteredSymbols(String query);
|
23,786 | .workspaceSymbolProvider(true)
.referencesProvider(true)
.completionProvider(new CompletionOptionsBuilder()
.resolveProvider(false)
.triggerCharacter(".")
<BUG>.build())
.build();</BUG>
InitializeResult result = new InitializeResultBuilder()
.capabilities(capabilities)
.build();
| .definitionProvider(true)
|
23,787 | package com.palantir.ls.server;
import com.palantir.ls.server.api.CompilerWrapper;
import com.palantir.ls.server.api.TreeParser;
import com.palantir.ls.server.api.WorkspaceCompiler;
<BUG>import io.typefox.lsapi.FileEvent;
import io.typefox.lsapi.PublishDiagnosticsParams;</BUG>
import io.typefox.lsapi.ReferenceParams;
i... | import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.PublishDiagnosticsParams;
|
23,788 | public static InputStream toInputStream(ByteBuffer buffer) {
return buffer.asInputStream();
}
@Converter
public static ObjectInput toObjectInput(ByteBuffer buffer) throws IOException {
<BUG>return IOConverter.toObjectInput(toInputStream(buffer));
}</BUG>
@Converter
public static ByteBuffer toByteBuffer(byte[] bytes) {
... | InputStream is = toInputStream(buffer);
return new ObjectInputStream(is);
|
23,789 | package org.apache.camel.component.mina;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
<BUG>import org.apache.camel.CamelContext;
import org.apache.camel.NoTypeConversionAvailableException;</BUG>
import org.apache.mina.common.ByteBuffer;
impor... | import org.apache.camel.TypeConverter;
import org.apache.camel.NoTypeConversionAvailableException;
|
23,790 | import de.vanita5.twittnuker.receiver.NotificationReceiver;
import de.vanita5.twittnuker.service.LengthyOperationsService;
import de.vanita5.twittnuker.util.ActivityTracker;
import de.vanita5.twittnuker.util.AsyncTwitterWrapper;
import de.vanita5.twittnuker.util.DataStoreFunctionsKt;
<BUG>import de.vanita5.twittnuker.u... | import de.vanita5.twittnuker.util.DebugLog;
import de.vanita5.twittnuker.util.ImagePreloader;
|
23,791 | 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);
|
23,792 | @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.getExcepti... | public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
23,793 | 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);
|
23,794 | 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.form... | if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
23,795 | 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, S... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
23,796 | 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.for... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
23,797 | import de.vanita5.twittnuker.annotation.CustomTabType;
import de.vanita5.twittnuker.library.MicroBlog;
import de.vanita5.twittnuker.library.MicroBlogException;
import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus;
import de.vanita5.twittnuker.library.twitter.model.Status;
<BUG>import de.vanita5.twittnuker... | import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
23,798 | 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());
|
23,799 | import java.util.List;
import java.util.Map.Entry;
import javax.inject.Singleton;
import okhttp3.Dns;
@Singleton
<BUG>public class TwidereDns implements Constants, Dns {
</BUG>
private static final String RESOLVER_LOGTAG = "TwittnukerDns";
private final SharedPreferences mHostMapping;
private final SharedPreferencesWra... | public class TwidereDns implements Dns, Constants {
|
23,800 | 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);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.