id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
43,301 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
43,302 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
43,303 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
43,304 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
43,305 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
43,306 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
43,307 | if(addingNode) map = new EnumMap<NOT_DROP_REASON, Integer>(NOT_DROP_REASON.class);
OpennetPeerNode[] peers = peersLRU.toArrayOrdered(new OpennetPeerNode[peersLRU.size()]);
for(int i=0;i<peers.length;i++) {
OpennetPeerNode pn = peers[i];
if(pn == null) continue;
<BUG>if(pn.isConnected() && pn.isUnroutableOlderVersion()) {
continue;</BUG>
}
NOT_DROP_REASON reason = pn.isDroppableWithReason(false);
if(map != null) {
| boolean tooOld = pn.isUnroutableOlderVersion();
if(pn.isConnected() && tooOld) {
|
43,308 | if(x == null)
map.put(reason, 1);
else
map.put(reason, x+1);
}
<BUG>if((reason != NOT_DROP_REASON.DROPPABLE) && !force) {
</BUG>
continue;
}
if(!pn.isConnected()) {
| if((reason != NOT_DROP_REASON.DROPPABLE) && ((!force) || tooOld)) {
|
43,309 | }
if(map != null) map.clear();
for(int i=0;i<peers.length;i++) {
OpennetPeerNode pn = peers[i];
if(pn == null) continue;
<BUG>if(pn.isConnected() && pn.isUnroutableOlderVersion()) {
continue;</BUG>
}
NOT_DROP_REASON reason = pn.isDroppableWithReason(false);
if(map != null) {
| [DELETED] |
43,310 | import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
<BUG>import java.util.ArrayList;
import java.util.Dictionary;</BUG>
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
| import java.util.Collections;
import java.util.Dictionary;
|
43,311 | 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.*;
|
43,312 | .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);
|
43,313 | </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) {
|
43,314 | 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)
|
43,315 | .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))
|
43,316 | .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))
|
43,317 | @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;
|
43,318 | 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;
}
|
43,319 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
43,320 | 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.*;
|
43,321 | .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))
|
43,322 | 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) -> {
|
43,323 | 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);
|
43,324 | 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);
|
43,325 | 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() + "\"");
|
43,326 | 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() + "\"");
|
43,327 | 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
|
43,328 | .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")
|
43,329 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
43,330 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
43,331 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
43,332 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
43,333 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
43,334 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
43,335 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
43,336 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
43,337 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
43,338 | AssetCategoryLocalServiceUtil.fetchAssetCategory(allCategoryId);
if (assetCategory == null) {
continue;
}
List<Long> categoryIds = new ArrayList<Long>();
<BUG>if (PropsValues.ASSET_CATEGORIES_SEARCH_HIERARCHICAL) {
categoryIds = AssetCategoryLocalServiceUtil.getSubcategoryIds(
allCategoryId);
</BUG>
}
| categoryIds.addAll(
allCategoryId));
|
43,339 | AssetCategoryLocalServiceUtil.fetchAssetCategory(anyCategoryId);
if (assetCategory == null) {
continue;
}
List<Long> categoryIds = new ArrayList<Long>();
<BUG>if (PropsValues.ASSET_CATEGORIES_SEARCH_HIERARCHICAL) {
categoryIds = AssetCategoryLocalServiceUtil.getSubcategoryIds(
anyCategoryId);
</BUG>
}
| categoryIds.addAll(
anyCategoryId));
|
43,340 | notAllCategoryId);
if (assetCategory == null) {
continue;
}
List<Long> categoryIds = new ArrayList<Long>();
<BUG>if (PropsValues.ASSET_CATEGORIES_SEARCH_HIERARCHICAL) {
categoryIds = AssetCategoryLocalServiceUtil.getSubcategoryIds(
notAllCategoryId);
</BUG>
}
| categoryIds.addAll(
notAllCategoryId));
|
43,341 | notAnyCategoryId);
if (assetCategory == null) {
continue;
}
List<Long> categoryIds = new ArrayList<Long>();
<BUG>if (PropsValues.ASSET_CATEGORIES_SEARCH_HIERARCHICAL) {
categoryIds = AssetCategoryLocalServiceUtil.getSubcategoryIds(
notAnyCategoryId);
</BUG>
}
| categoryIds.addAll(
notAnyCategoryId));
|
43,342 | import java.util.Map;
import java.util.Set;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
<BUG>import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;</BUG>
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityCondition;
| import org.ofbiz.base.util.collections.PagedList;
import org.ofbiz.entity.Delegator;
|
43,343 | import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
<BUG>import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;</BUG>
import org.ofbiz.entity.GenericEntity;
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
| import org.ofbiz.base.util.collections.PagedList;
import org.ofbiz.entity.Delegator;
|
43,344 | package org.ofbiz.widget.renderer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
<BUG>import java.util.NoSuchElementException;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.GenericEntityException;</BUG>
import org.ofbiz.entity.util.EntityListIterator;
| import org.apache.commons.collections4.MapUtils;
import org.ofbiz.base.util.UtilProperties;
import org.ofbiz.base.util.collections.PagedList;
import org.ofbiz.entity.GenericEntityException;
|
43,345 | if(context.containsKey("result")){
Map<String, Object> resultMap = UtilGenerics.checkMap(context.get("result"));
if(resultMap.containsKey("listSize")){
listSize = (int)resultMap.get("listSize");
}
<BUG>}
}</BUG>
if (modelForm.getPaginate(context)) {
viewIndex = getViewIndex(modelForm, context);
viewSize = getViewSize(modelForm, context);
| } else if (entryList instanceof PagedList) {
PagedList<?> pagedList = (PagedList<?>) entryList;
listSize = pagedList.getSize();
|
43,346 | import org.ofbiz.base.util.ObjectType;
import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilGenerics;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilProperties;
<BUG>import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.entity.Delegator;</BUG>
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.entity.condition.EntityComparisonOperator;
| import org.ofbiz.base.util.collections.PagedList;
import org.ofbiz.entity.Delegator;
|
43,347 | public static final String module = OrderLookupServices.class.getName();
public static Map<String, Object> findOrders(DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
Security security = dctx.getSecurity();
<BUG>GenericValue userLogin = (GenericValue) context.get("userLogin");
Integer viewIndex = (Integer) context.get("viewIndex");
if (viewIndex == null) viewIndex = 1;
Integer viewSize = (Integer) context.get("viewSize");
if (viewSize == null) viewSize = UtilProperties.getPropertyAsInteger("widget", "widget.form.defaultViewSize", 20);</BUG>
String showAll = (String) context.get("showAll");
| Integer viewIndex = Paginator.getViewIndex(context, "viewIndex", 1);
Integer viewSize = Paginator.getViewSize(context, "viewSize");
|
43,348 | if (Debug.verboseOn()) {
Debug.logInfo("Find order query: " + cond.toString(), module);
}
List<GenericValue> orderList = new LinkedList<GenericValue>();
int orderCount = 0;
<BUG>int lowIndex = (((viewIndex.intValue() - 1) * viewSize.intValue()) + 1);
int highIndex = viewIndex.intValue() * viewSize.intValue();
if (cond != null) {
EntityListIterator eli = null;
try {
eli = EntityQuery.use(delegator)
</BUG>
.select(fieldsToSelect)
| int lowIndex = 0;
int highIndex = 0;
PagedList<GenericValue> pagedOrderList = null;
pagedOrderList = EntityQuery.use(delegator)
|
43,349 | highIndex = orderCount;
}</BUG>
} catch (GenericEntityException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
<BUG>} finally {
if (eli != null) {
try {
eli.close();
} catch (GenericEntityException e) {
Debug.logWarning(e, e.getMessage(), module);
}
}</BUG>
}
| .select(fieldsToSelect)
.from(dve)
.where(cond)
.orderBy(orderBy)
.distinct() // set distinct on so we only get one row per order
.cursorScrollInsensitive()
.queryPagedList(viewIndex - 1, viewSize);
orderCount = pagedOrderList.getSize();
lowIndex = pagedOrderList.getStartIndex();
highIndex = pagedOrderList.getEndIndex();
orderList = pagedOrderList.getData();
|
43,350 | public ComponentImpl(BatchReport.Component component, @Nullable Iterable<Component> children) {
this.component = component;
this.type = convertType(component.getType());
this.children = children == null ? Collections.<Component>emptyList() : copyOf(filter(children, notNull()));
}
<BUG>private static Type convertType(Constants.ComponentType type) {
</BUG>
switch (type) {
case PROJECT:
return Type.PROJECT;
| public static Type convertType(Constants.ComponentType type) {
|
43,351 | 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 = "groovy.lang.GroovyObject";
private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object";
private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap();
private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG>
private final Supplier<CompilationUnit> unitSupplier;
| private Indexer indexer = new Indexer();
|
43,352 | 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);
symbols.add(symbol);
});
}
newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG>
});
| newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol);
if (classes.containsKey(variable.getType().getName())) {
newIndexer.addReference(classes.get(variable.getType().getName()),
GroovyLocations.createLocation(sourceUri, variable.getType()));
|
43,353 | }
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 = getQueryPattern(query);
| });
sourceUnit.getAST().getStatementBlock()
.visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(),
classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
|
43,354 | <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;
|
43,355 | 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(String query);</BUG>
}
| Map<Location, Set<Location>> getReferences();
Set<Location> findReferences(ReferenceParams params);
Optional<Location> gotoDefinition(URI uri, Position position);
Set<SymbolInformation> getFilteredSymbols(String query);
|
43,356 | .workspaceSymbolProvider(true)
.referencesProvider(true)
.completionProvider(new CompletionOptionsBuilder()
.resolveProvider(false)
.triggerCharacter(".")
<BUG>.build())
.build();</BUG>
InitializeResult result = new InitializeResultBuilder()
.capabilities(capabilities)
.build();
| .definitionProvider(true)
|
43,357 | 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;
import io.typefox.lsapi.SymbolInformation;
import io.typefox.lsapi.TextDocumentContentChangeEvent;
| import com.google.common.base.Optional;
import io.typefox.lsapi.Location;
import io.typefox.lsapi.Position;
import io.typefox.lsapi.PublishDiagnosticsParams;
|
43,358 | package jetbrains.mps.console.base.generator.template.main;
import jetbrains.mps.generator.runtime.Generated;
import jetbrains.mps.generator.template.BaseMappingRuleContext;
import jetbrains.mps.typesystem.inference.TypeChecker;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
<BUG>import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.jetbrains.mps.openapi.model.SNode;</BUG>
import jetbrains.mps.lang.typesystem.runtime.HUtil;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
| import jetbrains.mps.console.base.generator.util.CommandUtilChooserHelper;
import org.jetbrains.mps.openapi.model.SNode;
|
43,359 | }
public static boolean baseMappingRule_Condition_7600370246419375459(final BaseMappingRuleContext _context) {
return TypeChecker.getInstance().getSubtypingManager().isSubtype(TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xde1ad86d6e504a02L, 0xb306d4d17f64c375L, 0x6c8954f469a7c420L, 0x7417cca3eb1ff761L, "object"))), _quotation_createNode_x583g4_b0a0a1());
}
public static boolean baseMappingRule_Condition_7600370246421231722(final BaseMappingRuleContext _context) {
<BUG>SNode type = TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xde1ad86d6e504a02L, 0xb306d4d17f64c375L, 0x6c8954f469a7c420L, 0x7417cca3eb1ff761L, "object")));
return TypeChecker.getInstance().getSubtypingManager().isSubtype(type, _quotation_createNode_x583g4_b0a0a0b0c()) || TypeChecker.getInstance().getSubtypingManager().isSubtype(type, _quotation_createNode_x583g4_b0a0a0b0c_0()) || TypeChecker.getInstance().getSubtypingManager().isSubtype(type, _quotation_createNode_x583g4_b0a0a1a2()) || TypeChecker.getInstance().getSubtypingManager().isSubtype(type, _quotation_createNode_x583g4_b0a0b0c());</BUG>
}
public static boolean baseMappingRule_Condition_3856122757887589572(final BaseMappingRuleContext _context) {
| return CommandUtilChooserHelper.isSModelSequence(TypeChecker.getInstance().getTypeOf(SLinkOperations.getTarget(_context.getNode(), MetaAdapterFactory.getContainmentLink(0xde1ad86d6e504a02L, 0xb306d4d17f64c375L, 0x6c8954f469a7c420L, 0x7417cca3eb1ff761L, "object"))));
|
43,360 | quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
}
<BUG>private static SNode _quotation_createNode_x583g4_b0a0a0b0c_0() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
SNode quotedNode_2 = null;
| private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,361 | quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x798c0d67da9d2175L, "jetbrains.mps.lang.smodel.structure.SReferenceType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
}
<BUG>private static SNode _quotation_createNode_x583g4_b0a0a1a2() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
SNode quotedNode_2 = null;
| quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,362 | quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2d94c0cdL, "jetbrains.mps.lang.smodel.structure.SModelType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
}
<BUG>private static SNode _quotation_createNode_x583g4_b0a0b0c() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
SNode quotedNode_2 = null;
| quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,363 | quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, "jetbrains.mps.baseLanguage.structure.ClassifierType"), null, null, false);
quotedNode_2.setReference(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"), SReference.create(MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101de48bf9eL, 0x101de490babL, "classifier"), quotedNode_2, facade.createModelReference("8865b7a8-5271-43d3-884c-6fd1d9cfdd34/java:org.jetbrains.mps.openapi.module(MPS.OpenAPI/)"), facade.createNodeId("~SModule")));
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
<BUG>}
private static SNode _quotation_createNode_x583g4_b0a1a6() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
| quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,364 | SNode quotedNode_2 = null;
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
<BUG>}
private static SNode _quotation_createNode_x583g4_b0a2a6() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
| [DELETED] |
43,365 | SNode quotedNode_2 = null;
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x798c0d67da9d2175L, "jetbrains.mps.lang.smodel.structure.SReferenceType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
<BUG>}
private static SNode _quotation_createNode_x583g4_b0a3a6() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
| quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,366 | SNode quotedNode_2 = null;
quotedNode_1 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, "jetbrains.mps.baseLanguage.collections.structure.SequenceType"), null, null, false);
quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x10a2d94c0cdL, "jetbrains.mps.lang.smodel.structure.SModelType"), null, null, false);
quotedNode_1.addChild(MetaAdapterFactory.getContainmentLink(0x8388864671ce4f1cL, 0x9c53c54016f6ad4fL, 0x10c260e9444L, 0x10c260ee40eL, "elementType"), quotedNode_2);
return quotedNode_1;
<BUG>}
private static SNode _quotation_createNode_x583g4_b0a4a6() {
</BUG>
PersistenceFacade facade = PersistenceFacade.getInstance();
SNode quotedNode_1 = null;
| quotedNode_2 = SModelUtil_new.instantiateConceptDeclaration(MetaAdapterFactory.getConcept(0x7866978ea0f04cc7L, 0x81bc4d213d9375e1L, 0x108f968b3caL, "jetbrains.mps.lang.smodel.structure.SNodeType"), null, null, false);
private static SNode _quotation_createNode_x583g4_b0a2a6() {
|
43,367 | public void createBadArtifact2() {
new Artifact("org/foo.foo:bar:2.0");
}
@Test(expected = IllegalArgumentException.class)
public void createBadArtifact3() throws Exception {
<BUG>new Artifact("E:\\workspaceBranch\\iGrid\\rio\\lib\\rio-lib-5.0.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\rio-proxy-5.0.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\rio-api-5.0.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\serviceui-2.2.2.jar");
}</BUG>
@Test
public void createGoodArtifact() {
Artifact a = new Artifact("org.foo:bar:2.0");
| new Artifact("E:\\workspaceBranch\\iGrid\\rio\\lib\\rio-lib-5.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\rio-proxy-5.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\rio-api-5.1.jar;E:\\workspaceBranch\\iGrid\\rio\\lib-dl\\serviceui-2.2.2.jar");
|
43,368 | break;
}
}
}
} else {
<BUG>throw new RuntimeException("The resolver lib directory does not exist, tried using: "+resolverLibDir.getPath());
}</BUG>
}
if(logger.isDebugEnabled())
logger.debug("Resolver JAR file: {}", resolverJarFile);
| String message = String.format("The resolver lib directory does not exist, tried using: %s",
logger.error(message);
throw new RuntimeException(message);
|
43,369 | package org.rioproject.resolver;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
<BUG>import org.junit.Test;
import java.io.File;</BUG>
import java.util.List;
public class ResolverConfigurationTest {
@Before
| import org.rioproject.RioVersion;
import java.io.File;
|
43,370 | Assert.assertTrue(repositories.get(0).getUrl().equals("http://10.0.1.9:9010"));
}
@Test
public void testGetJar() throws Exception {
ResolverConfiguration resolverConfiguration = new ResolverConfiguration();
<BUG>String jarName = resolverConfiguration.getResolverJarName();
Assert.assertNotNull(jarName);
Assert.assertTrue(jarName.equals("resolver-aether"));
}</BUG>
@Test
| String jarName = resolverConfiguration.getResolverJar();
Assert.assertTrue(jarName.equals(String.format("%s/lib/resolver/resolver-aether-%s.jar",
System.getProperty("rio.home"),
RioVersion.VERSION)));
|
43,371 | package org.rioproject;
import org.rioproject.util.RioManifest;
import java.io.IOException;
import java.net.URL;
public final class RioVersion {
<BUG>public static final String VERSION = "5.0.1";
private RioVersion() {}</BUG>
public static String getBuildNumber() {
String build;
URL implUrl = RioVersion.class.getProtectionDomain().getCodeSource().getLocation();
| public static final String VERSION = "5.1";
private RioVersion() {}
|
43,372 | import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
<BUG>import java.util.regex.Pattern;
import org.neo4j.graphdb.Node;</BUG>
import org.neo4j.graphdb.index.IndexProvider;
import org.neo4j.helpers.Service;
import org.neo4j.index.impl.lucene.LuceneIndexProvider;
| import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
|
43,373 | import org.neo4j.shell.AppCommandParser;
import org.neo4j.shell.OptionDefinition;
import org.neo4j.shell.OptionValueType;
import org.neo4j.shell.Output;
import org.neo4j.shell.Session;
<BUG>import org.neo4j.shell.ShellException;
import org.neo4j.shell.kernel.apps.GraphDatabaseApp;</BUG>
@Service.Implementation( App.class )
public class IndexProviderShellApp extends GraphDatabaseApp
{
| import org.neo4j.shell.kernel.ReadOnlyGraphDatabaseProxy;
import org.neo4j.shell.kernel.apps.GraphDatabaseApp;
|
43,374 | boolean nullable = "YES".equalsIgnoreCase(nullableText);
return new ColumnDef(
rs.getString(1), rs.getString(2), rs.getString(3), rs.getString(4), rs.getString(5), rs.getLong(6), nullable);
}
}
<BUG>public enum IsInSonarQubeTablePredicate implements Predicate<ColumnDef> {
INSTANCE;
@Override
public boolean apply(@Nonnull ColumnDef input) {
return input.isInSonarQubeTable();</BUG>
}
| [DELETED] |
43,375 | package org.sonar.db.charset;
import java.sql.Connection;
import java.sql.SQLException;
<BUG>import java.util.List;
import java.util.Set;
import javax.annotation.CheckForNull;</BUG>
abstract class CharsetHandler {
protected static final String UTF8 = "utf8";
| [DELETED] |
43,376 | import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
<BUG>import java.util.logging.Logger;
import org.apache.commons.lang.StringUtils;</BUG>
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
| import eu.europeana.corelib.solr.entity.*;
import org.apache.commons.lang.StringUtils;
|
43,377 | import eu.europeana.corelib.definitions.jibx.*;
import eu.europeana.corelib.definitions.jibx.ResourceOrLiteralType.Resource;
import eu.europeana.corelib.definitions.model.ColorSpace;
import eu.europeana.corelib.definitions.model.Orientation;
import eu.europeana.corelib.solr.bean.impl.FullBeanImpl;
<BUG>import eu.europeana.corelib.solr.entity.AgentImpl;
import eu.europeana.corelib.solr.entity.AggregationImpl;
import eu.europeana.corelib.solr.entity.ConceptImpl;
import eu.europeana.corelib.solr.entity.LicenseImpl;
import eu.europeana.corelib.solr.entity.PlaceImpl;
import eu.europeana.corelib.solr.entity.ProvidedCHOImpl;
import eu.europeana.corelib.solr.entity.ProxyImpl;
import eu.europeana.corelib.solr.entity.TimespanImpl;</BUG>
import eu.europeana.corelib.utils.StringArrayUtils;
| [DELETED] |
43,378 | appendEuropeanaAggregation(rdf, fullBean);
appendAgents(rdf, fullBean.getAgents());
appendConcepts(rdf, fullBean.getConcepts());
appendPlaces(rdf, fullBean.getPlaces());
appendTimespans(rdf, fullBean.getTimespans());
<BUG>appendLicenses(rdf, fullBean.getLicenses());
IMarshallingContext marshallingContext;</BUG>
try {
if (bfact == null) {
bfact = BindingDirectory.getFactory(RDF.class);
| appendServices(rdf,fullBean.getServices());
IMarshallingContext marshallingContext;
|
43,379 | wr.getDctermsIsFormatOf());
SolrUtils.addFromMap(doc, EdmLabel.WR_DCTERMS_ISSUED,
wr.getDctermsIssued());
SolrUtils.addFromStringArray(doc, EdmLabel.WR_OWL_SAMEAS,
wr.getOwlSameAs());
<BUG>SolrUtils.addFromStringArray(doc,EdmLabel.WR_SVCS_HAS_SERVICE,wr.getSvcsHasService());
SolrUtils.addFromString(doc,EdmLabel.WR_EDM_PREVIEW,wr.getEdmPreview());</BUG>
}
private boolean contains(Map<String, List<String>> webResourceEdmRights,
List<String> licIds) {
| SolrUtils.addFromString(doc,EdmLabel.WR_WDRS_DESCRIBEDBY,wr.getWdrsDescribedBy());
SolrUtils.addFromString(doc,EdmLabel.WR_EDM_PREVIEW,wr.getEdmPreview());
|
43,380 | update = MongoUtils.updateMap(wrMongo, wr, "webResourceEdmRights", ops)
|| update;
update = MongoUtils.updateArray(wrMongo, wr, "owlSameAs", ops)
|| update;
update = MongoUtils.updateString(wrMongo,wr,"edmPreview",ops)||update;
<BUG>update = MongoUtils.updateString(wrMongo,wr,"svcsHasService",ops)||update;
if (update) {</BUG>
mongoServer.getDatastore().update(updateQuery, ops);
}
| update = MongoUtils.updateArray(wrMongo,wr,"svcsHasService",ops)||update;
update = MongoUtils.updateString(wrMongo,wr,"wdrsDescribedBy",ops)||update;
if (update) {
|
43,381 | SolrUtils.addFromMap(doc, EdmLabel.PROVIDER_AGGREGATION_EDM_RIGHTS,
aggr.getEdmRights());
}
SolrUtils.addFromMap(doc,
EdmLabel.PROVIDER_AGGREGATION_EDM_DATA_PROVIDER,
<BUG>aggr.getEdmDataProvider());
SolrUtils.addFromMap(doc, EdmLabel.PROVIDER_AGGREGATION_EDM_PROVIDER,</BUG>
aggr.getEdmProvider());
SolrUtils.addFromStringArray(doc,
EdmLabel.PROVIDER_AGGREGATION_ORE_AGGREGATES,
| EdmLabel.PROVIDER_AGGREGATION_EDM_INTERMEDIATE_PROVIDER,
aggr.getEdmIntermediateProvider());
SolrUtils.addFromMap(doc, EdmLabel.PROVIDER_AGGREGATION_EDM_PROVIDER,
|
43,382 | T obj) {
Map<String, List<String>> retMap = new HashMap<String, List<String>>();
if (obj != null) {
if (obj.getLang() != null
&& StringUtils.isNotBlank(obj.getLang().getLang())) {
<BUG>List<String> val = new ArrayList<String>();
val.add(obj.getString());
retMap.put(obj.getLang().getLang(), val);
} else {
List<String> val = new ArrayList<String>();
val.add(obj.getString());</BUG>
retMap.put("def", val);
| if(StringUtils.isNotBlank(obj.getString())) {
|
43,383 | } else {
List<String> val = new ArrayList<String>();
val.add(obj.getString());</BUG>
retMap.put("def", val);
}
<BUG>return retMap;
}</BUG>
return null;
}
public static Map<String, List<String>> createLiteralMapFromString(
| if(StringUtils.isNotBlank(obj.getString())) {
val.add(obj.getString());
return retMap.isEmpty()?null:retMap;
|
43,384 | && StringUtils.isNotBlank(obj.getLang().getLang())) {
List<String> val = retMap
.get((obj.getLang().getLang()));
if (val == null) {
val = new ArrayList<String>();
<BUG>}
val.add(obj.getString());
retMap.put(obj.getLang().getLang(), val);
} else {</BUG>
List<String> val = retMap.get("def");
| [DELETED] |
43,385 | retMap.put(obj.getLang().getLang(), val);
} else {</BUG>
List<String> val = retMap.get("def");
if (val == null) {
val = new ArrayList<String>();
<BUG>}
val.add(obj.getString());
retMap.put("def", val);
}</BUG>
}
| } else {
if(StringUtils.isNotBlank(StringUtils.trimToNull(obj.getString()))) {
|
43,386 | if (retMap.containsKey(lang)) {
val = retMap.get(lang);
} else {
val = new ArrayList<String>();
}
<BUG>val.add(StringUtils.trim(obj.getResource()
.getResource()));
retMap.put(lang, val);
} else {</BUG>
List<String> val = retMap.get("def");
| if(StringUtils.isNotBlank(StringUtils.trimToNull(obj.getResource()
.getResource()))) {
val.add(obj.getString());
|
43,387 | } else {</BUG>
List<String> val = retMap.get("def");
if (val == null) {
val = new ArrayList<String>();
}
<BUG>val.add(StringUtils.trim(obj.getResource()
.getResource()));
retMap.put("def", val);</BUG>
}
| if (retMap.containsKey(lang)) {
val = retMap.get(lang);
} else {
if(StringUtils.isNotBlank(StringUtils.trimToNull(obj.getResource()
.getResource()))) {
val.add(obj.getString());
retMap.put(lang, val);
} else {
|
43,388 | public boolean synchronizesVariablesWithBindings() {
return false;
}
public NSArray nodes() {
Object rootNode = treeModel().rootTreeNode();
<BUG>if (_nodes == null || rootNode == null || !rootNode.equals(_lastParent) || !AjaxUtils.booleanValueForBinding("cache", true, _keyAssociations, parent())) {
NSMutableArray nodes = new NSMutableArray();</BUG>
boolean showRoot = AjaxUtils.booleanValueForBinding("showRoot", true, _keyAssociations, parent());
_fillInOpenNodes(treeModel().rootTreeNode(), nodes, showRoot);
_nodes = nodes;
| boolean useCache = AjaxUtils.booleanValueForBinding("cache", true, _keyAssociations, parent());
if (_nodes == null || rootNode == null || !rootNode.equals(_lastRootNode) || !useCache) {
NSMutableArray nodes = new NSMutableArray();
|
43,389 | <BUG>package com.example.njones.myapplication;
import android.util.Log;
class Clock {</BUG>
private final static String TAG = "Clock";
public int thinkingTime;
| import android.graphics.Canvas;
import android.graphics.Paint;
import org.json.JSONException;
import org.json.JSONObject;
class Clock {
|
43,390 | private final static String TAG = "Clock";
public int thinkingTime;
public int periods;
public int periodTime;
public String system; // fischer, byo-yomi, etc.
<BUG>private Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);
Clock(String system) {</BUG>
this.system = system;
p.setARGB(255, 0, 0, 0);
p.setStrokeWidth(1);
| Clock() {
this("simple");
}
Clock(String system) {
|
43,391 | clock.getInt("periods");
clock.getInt("periodTime");
} catch (JSONException e) {
}
}
<BUG>public void draw(Canvas canvas, float x, float y) {
Log.w(TAG, "draw");
canvas.drawText(toString(), x, y, p);
</BUG>
}
| public void draw(Canvas canvas, String header, float x, float y) {
if (thinkingTime < 0)
return;
canvas.drawText(header + ": " + toString(), x, y, p);
|
43,392 | s.append(String.format("%d", seconds));
}
return s.toString();
}
public String toString() {
<BUG>if (system.equals("byo-yomi")) {
return String.format("%s + %dx%s", formatTime(thinkingTime), periods, formatTime(periodTime));</BUG>
} else {
return formatTime(thinkingTime);
}
| if (periods > 0) {
return String.format("%s + %dx%s", formatTime(thinkingTime), periods, formatTime(periodTime));
|
43,393 | import android.view.View;
import com.ogs.OGS;
import com.ogs.OGSGameConnection;
import org.json.JSONArray;
import org.json.JSONException;
<BUG>import org.json.JSONObject;
import io.socket.client.IO;</BUG>
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
public class BoardView extends View {
| import java.util.Timer;
import java.util.TimerTask;
import io.socket.client.IO;
|
43,394 | r.set(0, 0, background.getWidth(), background.getHeight());
r2.set(0, 0, canvas.getWidth(), canvas.getHeight());
canvas.drawBitmap(background, null, r2, null);
int dimension = Math.min(canvas.getWidth(), canvas.getHeight());
board.draw(canvas, dimension);
<BUG>clockWhite.draw(canvas, 0, dimension + 20);
clockBlack.draw(canvas, 100, dimension + 20);
</BUG>
}
| clockWhite.draw(canvas, "White Time", 0, dimension + 20);
clockBlack.draw(canvas, "Black Time", 0, dimension + 40);
|
43,395 | for (int j = 0; j < cols; j++) {
board[j][i] &= ~WHITE_TERRITORY;
board[j][i] &= ~BLACK_TERRITORY;
board[j][i] &= ~NEUTRAL_TERRITORY;
}
<BUG>}
traceBoard("before determine territory");</BUG>
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
if (board[j][i] == EMPTY) {
| public void markTerritory() {
Log.w("removal", "marking terrotiry");
unmarkTerritory();
traceBoard("before determine territory");
|
43,396 | result_ = variableAssignmentExpression(builder_, level_ + 1);
}
else if (root_ == VARIABLE_EXPRESSION) {
result_ = variableExpression(builder_, level_ + 1);
}
<BUG>else {
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_RECOVER_, null);
result_ = parse_root_(root_, builder_, level_);
exitErrorRecordingSection(builder_, level_, result_, true, _SECTION_RECOVER_, TOKEN_ADVANCER);
marker_.done(root_);</BUG>
}
| Marker marker_ = enter_section_(builder_, level_, _NONE_, null);
exit_section_(builder_, level_, marker_, root_, result_, true, TOKEN_ADVANCER);
|
43,397 | return builder_.getTreeBuilt();
}
protected boolean parse_root_(final IElementType root_, final PsiBuilder builder_, final int level_) {
return root(builder_, level_ + 1);
}
<BUG>private static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
</BUG>
create_token_set_(BINARY_EXPRESSION, CONDITIONAL_EXPRESSION, EXPRESSION, INDEXED_EXPRESSION,
LITERAL_EXPRESSION, METHOD_CALL_EXPRESSION, NEW_EXPRESSION, PARENTHESIZED_EXPRESSION,
REFERENCE_EXPRESSION, SEQUENCE_EXPRESSION, UNARY_EXPRESSION, VARIABLE_ASSIGNMENT_EXPRESSION,
| public static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
|
43,398 | create_token_set_(BINARY_EXPRESSION, CONDITIONAL_EXPRESSION, EXPRESSION, INDEXED_EXPRESSION,
LITERAL_EXPRESSION, METHOD_CALL_EXPRESSION, NEW_EXPRESSION, PARENTHESIZED_EXPRESSION,
REFERENCE_EXPRESSION, SEQUENCE_EXPRESSION, UNARY_EXPRESSION, VARIABLE_ASSIGNMENT_EXPRESSION,
VARIABLE_EXPRESSION),
};
<BUG>public static boolean type_extends_(IElementType child_, IElementType parent_) {
return type_extends_impl_(EXTENDS_SETS_, child_, parent_);
}</BUG>
static boolean arrayConstructorExpression(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "arrayConstructorExpression")) return false;
| [DELETED] |
43,399 | sequenceExpression(builder_, level_ + 1);
return true;
}
static boolean binaryOperations(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "binaryOperations")) return false;
<BUG>boolean result_ = false;
Marker marker_ = builder_.mark();
enterErrorRecordingSection(builder_, level_, _SECTION_GENERAL_, "<operator>");</BUG>
result_ = plusMinusOperations(builder_, level_ + 1);
if (!result_) result_ = divideMultiplyOperations(builder_, level_ + 1);
| Marker marker_ = enter_section_(builder_, level_, _NONE_, "<operator>");
|
43,400 | return result_;
}
static boolean bitwiseBooleanOperations(PsiBuilder builder_, int level_) {
if (!recursion_guard_(builder_, level_, "bitwiseBooleanOperations")) return false;
boolean result_ = false;
<BUG>Marker marker_ = builder_.mark();
result_ = consumeToken(builder_, OR);</BUG>
if (!result_) result_ = consumeToken(builder_, XOR);
if (!result_) result_ = consumeToken(builder_, AND);
if (!result_) result_ = consumeToken(builder_, BAND_KEYWORD);
| Marker marker_ = enter_section_(builder_);
result_ = consumeToken(builder_, OR);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.