id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
14,201 | this.configuration = configuration;
}
@Override
public Boolean call() throws Exception {
boolean result = true;
<BUG>List<Service> services = kubernetesClient.getServices(session.getNamespace()).getItems();
</BUG>
if (services.isEmpty()) {
result = false;
session.getLogger().warn("No services are available yet, waiting...");
| List<Service> services = kubernetesClient.services().inNamespace(session.getNamespace()).list().getItems();
|
14,202 | package io.fabric8.arquillian.kubernetes;
<BUG>import io.fabric8.kubernetes.api.KubernetesClient;
</BUG>
import io.fabric8.utils.Strings;
import org.jboss.arquillian.core.api.InstanceProducer;
import org.jboss.arquillian.core.api.annotation.ApplicationScoped;
| import io.fabric8.kubernetes.client.DefaultKubernetesClient;
import io.fabric8.kubernetes.client.KubernetesClient;
|
14,203 | public class ClientCreator {
@Inject
@ApplicationScoped
private InstanceProducer<KubernetesClient> kubernetesProducer;
public void createClient(@Observes Configuration config) {
<BUG>KubernetesClient client;
String masterUrl = config.getMasterUrl();
if (Strings.isNotBlank(masterUrl)) {
client = new KubernetesClient(masterUrl);
} else {
client = new KubernetesClient();
}
kubernetesProducer.set(client);</BUG>
}
| if (!Strings.isNullOrBlank(config.getMasterUrl())) {
kubernetesProducer.set(new DefaultKubernetesClient(new DefaultKubernetesClient.ConfigBuilder().masterUrl(config.getMasterUrl()).build()));
|
14,204 | import org.jboss.arquillian.core.api.Instance;</BUG>
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider;
import java.lang.annotation.Annotation;
<BUG>import java.util.ArrayList;
import java.util.List;</BUG>
public class PodListResourceProvider implements ResourceProvider {
@Inject
private Instance<KubernetesClient> clientInstance;
| package io.fabric8.arquillian.kubernetes.enricher;
import io.fabric8.arquillian.kubernetes.Session;
import io.fabric8.kubernetes.api.model.PodList;
import io.fabric8.kubernetes.client.KubernetesClient;
import org.jboss.arquillian.core.api.Instance;
|
14,205 | package io.fabric8.arquillian.kubernetes;
import io.fabric8.kubernetes.api.Controller;
<BUG>import io.fabric8.kubernetes.api.KubernetesClient;
import org.jboss.arquillian.core.api.InstanceProducer;</BUG>
import org.jboss.arquillian.core.api.annotation.ApplicationScoped;
import org.jboss.arquillian.core.api.annotation.Inject;
| import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.OpenShiftClient;
import org.jboss.arquillian.core.api.InstanceProducer;
|
14,206 | package io.fabric8.arquillian.kubernetes;
<BUG>import io.fabric8.kubernetes.api.KubernetesClient;
</BUG>
import io.fabric8.utils.MultiException;
import static io.fabric8.arquillian.utils.Util.cleanupSession;
public class ShutdownHook extends Thread {
| import io.fabric8.kubernetes.client.KubernetesClient;
|
14,207 | package io.fabric8.arquillian.kubernetes.enricher;
import io.fabric8.arquillian.kubernetes.Session;
<BUG>import io.fabric8.kubernetes.api.KubernetesClient;
</BUG>
import io.fabric8.kubernetes.jolokia.JolokiaClients;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
| import io.fabric8.kubernetes.client.KubernetesClient;
|
14,208 | import org.jboss.arquillian.core.api.Instance;</BUG>
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider;
import java.lang.annotation.Annotation;
<BUG>import java.util.ArrayList;
import java.util.List;</BUG>
public class ReplicationControllerListResourceProvider implements ResourceProvider {
@Inject
private Instance<KubernetesClient> clientInstance;
| package io.fabric8.arquillian.kubernetes.enricher;
import io.fabric8.arquillian.kubernetes.Session;
import io.fabric8.kubernetes.api.model.ReplicationControllerList;
import io.fabric8.kubernetes.client.KubernetesClient;
import org.jboss.arquillian.core.api.Instance;
|
14,209 | 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.*;
|
14,210 | .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);
|
14,211 | </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) {
|
14,212 | 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)
|
14,213 | .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))
|
14,214 | .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))
|
14,215 | @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;
|
14,216 | 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;
}
|
14,217 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
14,218 | 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.*;
|
14,219 | .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))
|
14,220 | 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) -> {
|
14,221 | 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);
|
14,222 | 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);
|
14,223 | 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() + "\"");
|
14,224 | 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() + "\"");
|
14,225 | 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
|
14,226 | .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")
|
14,227 | }
}
break;
}
case Union: {
<BUG>RegExUnion u = (RegExUnion) r;
HashSet<SuccinctRegExMatch> firstMatches, secondMatches;
firstMatches = computeSuccinctly(u.getFirst());
secondMatches = computeSuccinctly(u.getSecond());
results = regexUnion(firstMatches, secondMatches);</BUG>
break;
| @Override protected HashSet<SuccinctRegExMatch> computeSuccinctly(RegEx r) {
HashSet<SuccinctRegExMatch> results = new HashSet<>();
switch (r.getRegExType()) {
case Blank: {
|
14,228 | default: {
throw new RuntimeException("Invalid node in succinct regex parse tree.");
}
}
return results;
<BUG>}
private HashSet<SuccinctRegExMatch> regexUnion(HashSet<SuccinctRegExMatch> first,
HashSet<SuccinctRegExMatch> second) {
HashSet<SuccinctRegExMatch> unionResults = new HashSet<>();
unionResults.addAll(first);
unionResults.addAll(second);
return unionResults;</BUG>
}
| [DELETED] |
14,229 | switch (p.getPrimitiveType()) {
case MGRAM: {
String mgram = p.getPrimitiveStr();
Range range = succinctFile.continueBwdSearch(mgram.toCharArray(), rightMatch);
if (!range.empty()) {
<BUG>concatResults
.add(new SuccinctRegExMatch(range, rightMatch.getLength() + mgram.length()));
</BUG>
}
break;
| concatResults.add(new SuccinctRegExMatch(range, rightMatch.getLength() + mgram.length()));
|
14,230 | }
break;
}
case Union: {
RegExUnion u = (RegExUnion) r;
<BUG>HashSet<SuccinctRegExMatch> firstResults, secondResults;
firstResults = regexConcat(u.getFirst(), rightMatch);
secondResults = regexConcat(u.getSecond(), rightMatch);
concatResults = regexUnion(firstResults, secondResults);</BUG>
break;
| switch (r.getRegExType()) {
case Blank: {
|
14,231 | HashSet<SuccinctRegExMatch> internalResults = computeSeedToRepeat(r);
if (internalResults.isEmpty()) {
return repeatResults;
}
repeatResults.addAll(internalResults);
<BUG>for (SuccinctRegExMatch internalMatch : internalResults) {
HashSet<SuccinctRegExMatch> moreRepeats = regexRepeatOneOrMore(r, internalMatch);
repeatResults = regexUnion(repeatResults, moreRepeats);</BUG>
}
return repeatResults;
| [DELETED] |
14,232 | HashSet<SuccinctRegExMatch> concatResults = regexConcat(r, rightMatch);
if (concatResults.isEmpty()) {
return repeatResults;
}
repeatResults.addAll(concatResults);
<BUG>for (SuccinctRegExMatch concatMatch : concatResults) {
HashSet<SuccinctRegExMatch> moreRepeats = regexRepeatOneOrMore(r, concatMatch);
repeatResults = regexUnion(repeatResults, moreRepeats);</BUG>
}
return repeatResults;
| [DELETED] |
14,233 | if (min == 0) {
repeatResults.addAll(internalResults);
}
if (max > 0) {
for (SuccinctRegExMatch internalMatch : internalResults) {
<BUG>repeatResults = regexUnion(repeatResults, regexRepeatMinToMax(r, internalMatch, min, max));
</BUG>
}
}
return repeatResults;
| repeatResults.addAll(regexRepeatMinToMax(r, internalMatch, min, max));
|
14,234 | if (min == 0) {
repeatResults.addAll(concatResults);
}
if (max > 0) {
for (SuccinctRegExMatch concatMatch : concatResults) {
<BUG>repeatResults = regexUnion(repeatResults, regexRepeatMinToMax(r, concatMatch, min, max));
</BUG>
}
}
return repeatResults;
| repeatResults.addAll(internalResults);
for (SuccinctRegExMatch internalMatch : internalResults) {
repeatResults.addAll(regexRepeatMinToMax(r, internalMatch, min, max));
|
14,235 | }
}
break;
}
case Union: {
<BUG>RegExUnion u = (RegExUnion) r;
HashSet<SuccinctRegExMatch> firstMatches, secondMatches;
firstMatches = computeSuccinctly(u.getFirst());
secondMatches = computeSuccinctly(u.getSecond());
results = regexUnion(firstMatches, secondMatches);</BUG>
break;
| @Override protected HashSet<SuccinctRegExMatch> computeSuccinctly(RegEx r) {
HashSet<SuccinctRegExMatch> results = new HashSet<>();
switch (r.getRegExType()) {
case Blank: {
|
14,236 | default: {
throw new RuntimeException("Invalid node in succinct regex parse tree.");
}
}
return results;
<BUG>}
private HashSet<SuccinctRegExMatch> regexUnion(HashSet<SuccinctRegExMatch> first,
HashSet<SuccinctRegExMatch> second) {
HashSet<SuccinctRegExMatch> unionResults = new HashSet<>();
unionResults.addAll(first);
unionResults.addAll(second);
return unionResults;</BUG>
}
| [DELETED] |
14,237 | case MGRAM: {
String mgram = p.getPrimitiveStr();
Range range =
succinctFile.continueFwdSearch(mgram.toCharArray(), leftMatch, leftMatch.getLength());
if (!range.empty()) {
<BUG>concatResults
.add(new SuccinctRegExMatch(range, leftMatch.getLength() + mgram.length()));
}</BUG>
break;
}
| SuccinctRegExMatch m =
new SuccinctRegExMatch(range, leftMatch.getLength() + mgram.length());
concatResults.add(m);
|
14,238 | continue;
}
Range range = succinctFile
.continueFwdSearch(String.valueOf(c).toCharArray(), leftMatch, leftMatch.getLength());
if (!range.empty()) {
<BUG>concatResults.add(new SuccinctRegExMatch(range, leftMatch.getLength() + 1));
}</BUG>
}
break;
| SuccinctRegExMatch m = new SuccinctRegExMatch(range, leftMatch.getLength() + 1);
concatResults.add(m);
|
14,239 | char[] charRange = p.getPrimitiveStr().toCharArray();
for (char c : charRange) {
Range range = succinctFile
.continueFwdSearch(String.valueOf(c).toCharArray(), leftMatch, leftMatch.getLength());
if (!range.empty()) {
<BUG>concatResults.add(new SuccinctRegExMatch(range, leftMatch.getLength() + 1));
}</BUG>
}
break;
| SuccinctRegExMatch m = new SuccinctRegExMatch(range, leftMatch.getLength() + 1);
concatResults.add(m);
|
14,240 | HashSet<SuccinctRegExMatch> internalResults = computeSuccinctly(r);
if (internalResults.isEmpty()) {
return repeatResults;
}
repeatResults.addAll(internalResults);
<BUG>for (SuccinctRegExMatch internalMatch: internalResults) {
HashSet<SuccinctRegExMatch> longer = regexRepeatOneOrMore(r, internalMatch);
repeatResults = regexUnion(repeatResults, longer);</BUG>
}
return repeatResults;
| [DELETED] |
14,241 | if (concatResults.isEmpty()) {
return repeatResults;
}
repeatResults.addAll(concatResults);
for (SuccinctRegExMatch concatMatch : concatResults) {
<BUG>repeatResults = regexUnion(repeatResults, regexRepeatOneOrMore(r, concatMatch));
</BUG>
}
return repeatResults;
}
| repeatResults.addAll(regexRepeatOneOrMore(r, concatMatch));
|
14,242 | if (min == 0) {
repeatResults.addAll(internalResults);
}
if (max > 0) {
for (SuccinctRegExMatch internalMatch: internalResults) {
<BUG>repeatResults = regexUnion(repeatResults, regexRepeatMinToMax(r, internalMatch, min, max));
</BUG>
}
}
return repeatResults;
| repeatResults.addAll(regexRepeatMinToMax(r, internalMatch, min, max));
|
14,243 | if (min == 0) {
repeatResults.addAll(concatResults);
}
if (max > 0) {
for (SuccinctRegExMatch concatMatch: concatResults) {
<BUG>repeatResults = regexUnion(repeatResults, regexRepeatMinToMax(r, concatMatch, min, max));
</BUG>
}
}
return repeatResults;
| repeatResults.addAll(internalResults);
for (SuccinctRegExMatch internalMatch: internalResults) {
repeatResults.addAll(regexRepeatMinToMax(r, internalMatch, min, max));
|
14,244 | public long end() {
return offset + length;
}
public boolean before(RegExMatch r) {
return end() <= r.getOffset();
<BUG>}
@Override</BUG>
public String toString() {
return "(" + offset + ", " + length + ")";
}
| public boolean contains(RegExMatch r) {
return r.begin() >= begin() && r.end() <= end();
@Override
|
14,245 | import edu.berkeley.cs.succinct.SuccinctFile;
import edu.berkeley.cs.succinct.regex.RegExMatch;
import edu.berkeley.cs.succinct.regex.SuccinctRegExMatch;
import edu.berkeley.cs.succinct.regex.parser.RegEx;
import edu.berkeley.cs.succinct.regex.parser.RegExWildcard;
<BUG>import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.TreeSet;</BUG>
public abstract class SuccinctRegExExecutor extends RegExExecutor {
| import java.util.*;
|
14,246 | decode(reader);
}
public void decode(XMLEventReader reader) throws XMLStreamException {
XMLHelper.readStartElement(reader, CONTENT_AUTHENTICATOR_ELEMENT);
if (XMLHelper.peekStartElement(reader, TIMESTAMP_ELEMENT)) {
<BUG>XMLHelper.readStartElement(reader, TIMESTAMP_ELEMENT);
String strTimestamp = reader.getElementText();</BUG>
_timestamp = Timestamp.valueOf(strTimestamp);
if (null == _timestamp) {
| String strTimestamp = XMLHelper.readElementText(reader, TIMESTAMP_ELEMENT);
|
14,247 | XMLEventReader reader = XMLHelper.beginDecoding(iStream);
decode(reader);
}
public void decode(XMLEventReader reader) throws XMLStreamException {
XMLHelper.readStartElement(reader, PUBLISHER_ID_ELEMENT);
<BUG>XMLHelper.readStartElement(reader, PUBLISHER_TYPE_ELEMENT);
String strType = reader.getElementText();</BUG>
_publisherType = nameToType(strType);
if (null == _publisherType) {
| String strType = XMLHelper.readElementText(reader, PUBLISHER_TYPE_ELEMENT);
|
14,248 | String strType = reader.getElementText();</BUG>
_publisherType = nameToType(strType);
if (null == _publisherType) {
throw new XMLStreamException("Cannot parse publisher type: " + strType);
}
<BUG>XMLHelper.readEndElement(reader);
XMLHelper.readStartElement(reader, PUBLISHER_ID_ID_ELEMENT);
String strID = reader.getElementText();</BUG>
try {
| XMLEventReader reader = XMLHelper.beginDecoding(iStream);
decode(reader);
public void decode(XMLEventReader reader) throws XMLStreamException {
XMLHelper.readStartElement(reader, PUBLISHER_ID_ELEMENT);
String strType = XMLHelper.readElementText(reader, PUBLISHER_TYPE_ELEMENT);
String strID = XMLHelper.readElementText(reader, PUBLISHER_ID_ID_ELEMENT);
|
14,249 | XMLEventReader reader = XMLHelper.beginDecoding(iStream);
decode(reader);
}
public void decode(XMLEventReader reader) throws XMLStreamException {
XMLHelper.readStartElement(reader, KEY_LOCATOR_ELEMENT);
<BUG>XMLHelper.readStartElement(reader, KEY_LOCATOR_TYPE_ELEMENT);
String strType = reader.getElementText();</BUG>
_type = nameToType(strType);
if (null == _type) {
| String strType = XMLHelper.readElementText(reader, KEY_LOCATOR_TYPE_ELEMENT);
|
14,250 | XMLEventReader reader = factory.createXMLEventReader(iStream);
return reader;
}
public static XMLStreamWriter beginEncoding(OutputStream oStream) throws XMLStreamException {
XMLOutputFactory factory = XMLOutputFactory.newInstance();
<BUG>try {
factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE ,
Boolean.TRUE);
} catch (IllegalArgumentException e) {
Library.logger().warning("XMLHelper: XMLOutputFactory is not namespace aware.");
}</BUG>
XMLStreamWriter writer = factory.createXMLStreamWriter(oStream);
| [DELETED] |
14,251 | public static void readEndDocument(XMLEventReader reader) throws XMLStreamException {
XMLEvent event = reader.nextEvent();
if (!event.isEndDocument()) {
throw new XMLStreamException("Expected end document, got: " + event.toString());
}
<BUG>}
public static void readStartElement(XMLEventReader reader, String startTag) throws XMLStreamException {
XMLEvent event = reader.nextTag();
if (!event.isStartElement() || (!startTag.equals(event.asStartElement().getName()))) {
</BUG>
throw new XMLStreamException("Expected start element: " + startTag + " got: " + event.toString());
| [DELETED] |
14,252 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
14,253 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
14,254 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
14,255 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
14,256 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART_AGE));
|
14,257 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
14,258 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
14,259 | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
<BUG>import brooklyn.entity.Entity;
import brooklyn.entity.basic.Entities;
import brooklyn.entity.basic.EntityInternal;
import brooklyn.entity.rebind.RebindEntityTest.MyApplication;
import brooklyn.entity.rebind.RebindEntityTest.MyApplicationImpl;</BUG>
import brooklyn.entity.rebind.RebindEntityTest.MyEntity;
| import brooklyn.entity.basic.ApplicationBuilder;
import brooklyn.entity.proxying.EntitySpecs;
|
14,260 | public class CheckpointEntityTest {
private static final Logger LOG = LoggerFactory.getLogger(CheckpointEntityTest.class);
private ClassLoader classLoader = getClass().getClassLoader();
private ManagementContext managementContext;
private File mementoDir;
<BUG>private MyApplication origApp;
</BUG>
private MyEntity origE;
@BeforeMethod
public void setUp() throws Exception {
| private TestApplication origApp;
|
14,261 | </BUG>
private MyEntity origE;
@BeforeMethod
public void setUp() throws Exception {
mementoDir = Files.createTempDir();
<BUG>managementContext = RebindTestUtils.newPersistingManagementContext(mementoDir, classLoader, 1);
origApp = new MyApplicationImpl();
origE = new MyEntityImpl(MutableMap.of("myconfig", "myval"), origApp);
Entities.startManagement(origApp, managementContext);</BUG>
}
| public class CheckpointEntityTest {
private static final Logger LOG = LoggerFactory.getLogger(CheckpointEntityTest.class);
private ClassLoader classLoader = getClass().getClassLoader();
private ManagementContext managementContext;
private File mementoDir;
private TestApplication origApp;
origApp = ApplicationBuilder.newManagedApp(EntitySpecs.spec(TestApplication.class), managementContext);
origE = origApp.createAndManageChild(EntitySpecs.spec(MyEntity.class).configure("myconfig", "myval"));
|
14,262 | public void tearDown() throws Exception {
if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
}
@Test
public void testAutoCheckpointsOnManageApp() throws Exception {
<BUG>MyApplication newApp = rebind();
</BUG>
MyEntity newE = (MyEntity) Iterables.find(newApp.getChildren(), Predicates.instanceOf(MyEntity.class));
assertEquals(newApp.getId(), origApp.getId());
assertEquals(ImmutableList.copyOf(newApp.getChildren()), ImmutableList.of(newE));
| TestApplication newApp = rebind();
|
14,263 | assertEquals(newE.getId(), origE.getId());
assertEquals(newE.getConfig(MyEntity.MY_CONFIG), "myval");
}
@Test
public void testAutoCheckpointsOnManageDynamicEntity() throws Exception {
<BUG>final MyEntity origE2 = new MyEntityImpl(MutableMap.of("myconfig", "myval2"), origApp);
Entities.manage(origE2);
MyApplication newApp = rebind();
</BUG>
MyEntity newE2 = (MyEntity) Iterables.find(newApp.getChildren(), new Predicate<Entity>() {
| final MyEntity origE2 = origApp.createAndManageChild(EntitySpecs.spec(MyEntity.class).configure("myconfig", "myval2"));
TestApplication newApp = rebind();
|
14,264 | assertEquals(newE2.getConfig(MyEntity.MY_CONFIG), "myval2");
}
@Test
public void testAutoCheckpointsOnUnmanageEntity() throws Exception {
Entities.unmanage(origE);
<BUG>MyApplication newApp = rebind();
</BUG>
assertEquals(ImmutableList.copyOf(newApp.getChildren()), Collections.emptyList());
assertNull(((EntityInternal)newApp).getManagementContext().getEntityManager().getEntity(origE.getId()));
}
| TestApplication newApp = rebind();
|
14,265 | import java.io.File;
import java.util.Collection;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
<BUG>import brooklyn.entity.Entity;
import brooklyn.entity.basic.DynamicGroup;
import brooklyn.entity.basic.DynamicGroupImpl;
import brooklyn.entity.basic.Entities;
import brooklyn.entity.rebind.RebindEntityTest.MyEntity;
import brooklyn.entity.rebind.RebindEntityTest.MyEntityImpl;</BUG>
import brooklyn.management.ManagementContext;
| import brooklyn.entity.basic.ApplicationBuilder;
import brooklyn.entity.proxying.EntitySpecs;
|
14,266 | public void tearDown() throws Exception {
if (mementoDir != null) RebindTestUtils.deleteMementoDir(mementoDir);
}
@Test
public void testRestoresDynamicGroup() throws Exception {
<BUG>MyEntity origE = new MyEntityImpl(origApp);
DynamicGroup origG = new DynamicGroupImpl(origApp, Predicates.instanceOf(MyEntity.class));
Entities.startManagement(origApp, managementContext);
TestApplication newApp = rebind();</BUG>
final DynamicGroup newG = (DynamicGroup) Iterables.find(newApp.getChildren(), Predicates.instanceOf(DynamicGroup.class));
| MyEntity origE = origApp.createAndManageChild(EntitySpecs.spec(MyEntity.class));
DynamicGroup origG = origApp.createAndManageChild(EntitySpecs.spec(DynamicGroup.class)
.configure(DynamicGroup.ENTITY_FILTER, Predicates.instanceOf(MyEntity.class)));
TestApplication newApp = rebind();
|
14,267 | oldStairway;
previousLocation = centerLocation;
if (!"Wooden Building".equals(centerLocationTerrain.getName()) &&
!"Stone Building".equals(centerLocationTerrain.getName()) &&
!(centerLocationTerrain.getLOSCategory() == Terrain.LOSCategories.FACTORY)) {
<BUG>if (isMultihexBuilding()) {
final Location l = new Location(</BUG>
centerLocation.getName() + " Cellar ",
-1,
centerLocation.getLOSPoint(),
| Terrain cellarterrain;
cellarterrain = map.getTerrain("Cellar");
final Location l = new Location(
|
14,268 | -1,
centerLocation.getLOSPoint(),
centerLocation.getLOSPoint(),
null,
this,
<BUG>centerLocationTerrain
);</BUG>
previousLocation.setDownLocation(l);
l.setUpLocation(previousLocation);
previousLocation = l;
| cellarterrain
|
14,269 | }
}
previousLocation = centerLocation;
if (!"Wooden Building".equals(centerLocationTerrain.getName()) &&
!"Stone Building".equals(centerLocationTerrain.getName()) &&
<BUG>!centerLocationTerrain.getName().contains("Roofless")) {
if (isMultihexBuilding()) {
int level = 0;</BUG>
while (previousLocation.getUpLocation() != null) {
| !centerLocationTerrain.isRoofless()) {
Terrain roofterrain;
roofterrain = map.getTerrain("Rooftop");
int level = 0;
|
14,270 | level + 1,
centerLocation.getLOSPoint(),
centerLocation.getLOSPoint(),
null,
this,
<BUG>centerLocationTerrain
);</BUG>
previousLocation.setUpLocation(l);
l.setDownLocation(previousLocation);
previousLocation = l;
| roofterrain
|
14,271 | " </lucene>" +
" </index>" +
"</collection>";
@Test
public void store() {
<BUG>ExecutorService executor = Executors.newFixedThreadPool(10);
</BUG>
for (int i = 0; i < 10; i++) {
final String name = "thread" + i;
final Runnable run = () -> {
| final ExecutorService executor = Executors.newFixedThreadPool(10);
|
14,272 | }
executor.shutdown();
boolean terminated = false;
try {
terminated = executor.awaitTermination(60 * 60, TimeUnit.SECONDS);
<BUG>} catch (InterruptedException e) {
</BUG>
}
assertTrue(terminated);
}
| };
executor.submit(run);
} catch (final InterruptedException e) {
|
14,273 | for (int i = 0; i < 5; i++) {
final String name = "thread" + i;
Runnable run = () -> {
try {
xupdateDocs(name);
<BUG>} catch (XMLDBException | IOException e) {
</BUG>
e.printStackTrace();
fail(e.getMessage());
}
| } catch (final XMLDBException | IOException e) {
|
14,274 | import org.exist.storage.txn.Txn;
import org.exist.util.Configuration;
import org.exist.util.DatabaseConfigurationException;
import org.exist.util.FileUtils;
import org.exist.xmldb.XmldbURI;
<BUG>import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;</BUG>
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
| import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
|
14,275 | public void sendNotificationScheduled(Bundle bundle) {
Class intentClass = getMainActivityClass();
if (intentClass == null) {
return;
}
<BUG>if (bundle.getString("message") == null) {
return;
}
if (!bundle.containsKey("sendAt")) {
return;
}
long sendAt = Long.parseLong(bundle.getString("sendAt"));</BUG>
long currentTime = System.currentTimeMillis();
| [DELETED] |
14,276 | private static AppFabricService.Iface server;
private static LocationFactory lf;
private static StoreFactory sFactory;
private static CConfiguration configuration;
@BeforeClass
<BUG>public static void before() throws Exception {
configuration = CConfiguration.create();
configuration.set(Constants.CFG_APP_FABRIC_OUTPUT_DIR, "/tmp/app");
configuration.set(Constants.CFG_APP_FABRIC_TEMP_DIR, "/tmp/temp");
final Injector injector = Guice.createInjector(new DataFabricModules().getInMemoryModules(),
new BigMamaModule(configuration));</BUG>
server = injector.getInstance(AppFabricService.Iface.class);
| final Injector injector = TestHelper.getInjector();
|
14,277 | Preconditions.checkState(!anyRunning(new Predicate<Id.Program>() {
@Override
public boolean apply(Id.Program programId) {
return programId.getApplication().equals(appId);
}
<BUG>}, Type.values()), "There are program still running for application " + appId.getId());
store.removeApplication(appId);
Location appArchive = getApplicationLocation(appId);
appArchive.delete();</BUG>
MetricsFrontendServiceImpl mfs = new MetricsFrontendServiceImpl(configuration);
| Location appArchive = store.getApplicationArchiveLocation(appId);
appArchive.delete();
|
14,278 | manifest.getMainAttributes().put(ManifestFields.MANIFEST_VERSION, "1.0");
manifest.getMainAttributes().put(ManifestFields.MAIN_CLASS, klass.getName());
return manifest;
}
public static Manager<Location, ApplicationWithPrograms> getLocalManager(CConfiguration configuration) {
<BUG>LocationFactory lf = new LocalLocationFactory();
PipelineFactory pf = new SynchronousPipelineFactory();
final Injector injector = Guice.createInjector(new BigMamaModule(configuration),
new DataFabricModules().getInMemoryModules());</BUG>
ManagerFactory factory = injector.getInstance(ManagerFactory.class);
| new DataFabricModules().getInMemoryModules());
|
14,279 | public static void deployApplication(Class<? extends Application> application) throws Exception {
deployApplication(application, "app-" + System.currentTimeMillis()/1000 + ".jar");
}
public static void deployApplication(Class<? extends Application> application, String fileName) throws Exception {
AppFabricService.Iface server;
<BUG>final Injector injector = Guice.createInjector(new DataFabricModules().getInMemoryModules(),
new BigMamaModule(configuration));</BUG>
server = injector.getInstance(AppFabricService.Iface.class);
LocationFactory lf = injector.getInstance(LocationFactory.class);
Location deployedJar = lf.create(
| [DELETED] |
14,280 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
14,281 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
14,282 | 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);
|
14,283 | 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(
|
14,284 | 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 {
|
14,285 | 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;
|
14,286 | 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) {
|
14,287 | 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;
|
14,288 | Integer datasetId;
String datasetUrn;
String capacityName;
String capacityType;
String capacityUnit;
<BUG>String capacityLow;
String capacityHigh;
</BUG>
Long modifiedTime;
| Long capacityLow;
Long capacityHigh;
|
14,289 | import com.fasterxml.jackson.databind.ObjectMapper;
public class DatasetFieldPathRecord {
String fieldPath;
String role;
public DatasetFieldPathRecord() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
14,290 | new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE);
public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_DEPLOYMENT_BY_URN =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_DEPLOYMENT_BY_URN =
"DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_CAPACITY_BY_DATASET_ID =
| public static final String DELETE_DATASET_DEPLOYMENT_BY_DATASET_ID =
"DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id=?";
|
14,291 | </BUG>
public static final String GET_DATASET_CAPACITY_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CAPACITY_BY_URN =
"SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_CAPACITY_BY_URN =
"DELETE FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_TAG_BY_DATASET_ID =
| new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE);
public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_DEPLOYMENT_BY_URN =
"SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String DELETE_DATASET_DEPLOYMENT_BY_DATASET_ID =
"DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id=?";
public static final String DELETE_DATASET_CAPACITY_BY_DATASET_ID =
"DELETE FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_id=?";
|
14,292 | "SELECT * FROM " + DATASET_CASE_SENSITIVE_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String GET_DATASET_REFERENCE_BY_DATASET_ID =
"SELECT * FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_REFERENCE_BY_URN =
"SELECT * FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_REFERENCE_BY_URN =
"DELETE FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_PARTITION_BY_DATASET_ID =
| public static final String DELETE_DATASET_REFERENCE_BY_DATASET_ID =
"DELETE FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id=?";
|
14,293 | "SELECT * FROM " + DATASET_SECURITY_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String GET_DATASET_OWNER_BY_DATASET_ID =
"SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id = :dataset_id ORDER BY sort_id";
public static final String GET_DATASET_OWNER_BY_URN =
"SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn = :dataset_urn ORDER BY sort_id";
<BUG>public static final String DELETE_DATASET_OWNER_BY_URN =
"DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_USER_BY_USER_ID = "SELECT * FROM " + EXTERNAL_USER_TABLE + " WHERE user_id = :user_id";
| public static final String DELETE_DATASET_OWNER_BY_DATASET_ID =
"DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id=?";
|
14,294 | "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_CONSTRAINT_BY_URN =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_INDEX_BY_DATASET_ID =
| public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
|
14,295 | </BUG>
public static final String GET_DATASET_INDEX_BY_DATASET_ID =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_INDEX_BY_URN =
"SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn = :dataset_urn";
<BUG>public static final String DELETE_DATASET_INDEX_BY_URN =
"DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn=?";
</BUG>
public static final String GET_DATASET_SCHEMA_BY_DATASET_ID =
| "SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id";
public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id";
public static final String GET_DATASET_CONSTRAINT_BY_URN =
"SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn";
public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID =
"DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
public static final String DELETE_DATASET_INDEX_BY_DATASET_ID =
"DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id=?";
|
14,296 | DatasetSecurityRecord record = om.convertValue(security, DatasetSecurityRecord.class);
record.setDatasetId(datasetId);
record.setDatasetUrn(urn);
record.setModifiedTime(System.currentTimeMillis() / 1000);
try {
<BUG>Map<String, Object> result = getDatasetSecurityByDatasetId(datasetId);
</BUG>
String[] columns = record.getDbColumnNames();
Object[] columnValues = record.getAllValuesToString();
String[] conditions = {"dataset_id"};
| DatasetSecurityRecord result = getDatasetSecurityByDatasetId(datasetId);
|
14,297 | "confidential_flags", "is_recursive", "partitioned", "indexed", "namespace", "default_comment_id", "comment_ids"};
}
@Override
public List<Object> fillAllFields() {
return null;
<BUG>}
public String[] getFieldDetailColumns() {</BUG>
return new String[]{"dataset_id", "sort_id", "parent_sort_id", "parent_path", "field_name", "fields_layout_id",
"field_label", "data_type", "data_size", "data_precision", "data_fraction", "is_nullable", "is_indexed",
"is_partitioned", "is_recursive", "confidential_flags", "default_value", "namespace", "default_comment_id",
| @JsonIgnore
public String[] getFieldDetailColumns() {
|
14,298 | partitioned != null && partitioned ? "Y" : "N", isRecursive != null && isRecursive ? "Y" : "N",
confidentialFlags, defaultValue, namespace, defaultCommentId, commentIds};
}
public DatasetFieldSchemaRecord() {
}
<BUG>@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this.getFieldValueMap());
} catch (Exception ex) {
return null;
}
}</BUG>
public Integer getDatasetId() {
| [DELETED] |
14,299 | String fieldPath;
String descend;
Integer prefixLength;
String filter;
public DatasetFieldIndexRecord() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
14,300 | String actorUrn;
String type;
Long time;
String note;
public DatasetChangeAuditStamp() {
<BUG>}
@Override
public String toString() {
try {
return new ObjectMapper().writeValueAsString(this);
} catch (JsonProcessingException ex) {
return null;
}</BUG>
}
| [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.