id int64 1 60k | buggy stringlengths 34 37.5k | fixed stringlengths 6 37.4k |
|---|---|---|
59,901 | metaCategory.set(FGUtil.getCategory(fgObject));
<BUG>metaType.set(fgObject.getUniqueTypeString());
metaEnabled.set(fgObject.isEnabled());</BUG>
}
} else {
<BUG>logger.info("Region \"" + name + "\" is already up to date. Skipping...");
</BUG>
}
mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgOb... | metaCategory.set(FGUtil.getCategory(fgObject));
metaType.set(fgObject.getUniqueTypeString());
metaOwner.set(owner);
metaEnabled.set(fgObject.isEnabled());
}
} else {
logger.info("Region " + logName + " is already up to date. Skipping...");
}
mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.ge... |
59,902 | mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgObject.getUniqueTypeString());
enabledMap.put(name, fgObject.isEnabled());</BUG>
defaultModifiedMap.put(fgObject, false);
} else {
<BUG>logger.info("Region " + fgObject.getName() + " does not need saving. Skipping...");
</BUG>
}
if (fgObject.save... | mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.getUniqueTypeString());
ownerMap.put(name, owner);
enabledMap.put(name, fgObject.isEnabled());
defaultModifiedMap.put(fgObject, false);
} else {
logger.info("Region " + logName + " does not need saving. Skipping...");
}
if (fgObject.saveLinks()... |
59,903 | constructDirectory(singleDir);
try {
fgObject.save(singleDir);
} catch (Exception e) {
<BUG>logger.error("There was an error while saving world region \"" + name + "\" in world \"" + world.getName() + "\"!", e);
</BUG>
}
<BUG>logger.info("Saving metadata for world region \"" + name + "\"");
</BUG>
try (DB metaDB = DBMa... | constructDirectory(singleDir);
try {
fgObject.save(singleDir);
} catch (Exception e) {
logger.error("There was an error while saving world region " + logName + " in world " + world.getName() + "!", e);
}
logger.info("Saving metadata for world region " + logName);
try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metad... |
59,904 | metaCategory.set(FGUtil.getCategory(fgObject));
<BUG>metaType.set(fgObject.getUniqueTypeString());
metaEnabled.set(fgObject.isEnabled());</BUG>
}
} else {
<BUG>logger.info("Region \"" + name + "\" is already up to date. Skipping...");
</BUG>
}
mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgOb... | metaCategory.set(FGUtil.getCategory(fgObject));
metaType.set(fgObject.getUniqueTypeString());
metaOwner.set(owner);
metaEnabled.set(fgObject.isEnabled());
}
} else {
logger.info("Region " + logName + " is already up to date. Skipping...");
}
mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.ge... |
59,905 | mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgObject.getUniqueTypeString());
enabledMap.put(name, fgObject.isEnabled());</BUG>
defaultModifiedMap.put(fgObject, false);
} else {
<BUG>logger.info("World region " + fgObject.getName() + " does not need saving. Skipping...");
</BUG>
}
if (fgObjec... | mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.getUniqueTypeString());
ownerMap.put(name, owner);
enabledMap.put(name, fgObject.isEnabled());
defaultModifiedMap.put(fgObject, false);
} else {
logger.info("World region " + logName + " does not need saving. Skipping...");
}
if (fgObject.saveL... |
59,906 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fg... | String name = fgObject.getName();
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()) {
Pa... |
59,907 | constructDirectory(singleDir);
try {
fgObject.save(singleDir);
} catch (Exception e) {
<BUG>logger.error("There was an error while saving region \"" + name + "\"!", e);
</BUG>
}
<BUG>logger.info("Saving metadata for region \"" + name + "\"");
</BUG>
try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").no... | constructDirectory(singleDir);
try {
fgObject.save(singleDir);
} catch (Exception e) {
logger.error("There was an error while saving region " + logName + "!", e);
}
logger.info("Saving metadata for region " + logName);
try (DB metaDB = DBMaker.fileDB(singleDir.resolve("metadata.foxdb").normalize().toString()).make()) {... |
59,908 | metaCategory.set(FGUtil.getCategory(fgObject));
<BUG>metaType.set(fgObject.getUniqueTypeString());
metaEnabled.set(fgObject.isEnabled());</BUG>
}
} else {
<BUG>logger.info("Region \"" + name + "\" is already up to date. Skipping...");
</BUG>
}
mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgOb... | metaCategory.set(FGUtil.getCategory(fgObject));
metaType.set(fgObject.getUniqueTypeString());
metaOwner.set(owner);
metaEnabled.set(fgObject.isEnabled());
}
} else {
logger.info("Region " + logName + " is already up to date. Skipping...");
}
mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.ge... |
59,909 | mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgObject.getUniqueTypeString());
enabledMap.put(name, fgObject.isEnabled());</BUG>
defaultModifiedMap.put(fgObject, false);
} else {
<BUG>logger.info("Region " + fgObject.getName() + " does not need saving. Skipping...");
</BUG>
}
if (fgObject.save... | mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.getUniqueTypeString());
ownerMap.put(name, owner);
enabledMap.put(name, fgObject.isEnabled());
defaultModifiedMap.put(fgObject, false);
} else {
logger.info("Region " + logName + " does not need saving. Skipping...");
}
if (fgObject.saveLinks()... |
59,910 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgOb... | if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
constructDirectory(singleDir);
try {
fgObject.save(sing... |
59,911 | </BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
} catch (Exception e) {
<BUG>logger.error("There was an error while saving world region \"" + name + "\" in world \"" + world.getName() + "\"!", e);
</BUG>
}
<BUG>logger.info("Saving metadata for world region \"" + name + "\"");
</BUG>
try (DB metaDB... | if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
constructDirectory(singleDir);
try {
fgObject.save(sing... |
59,912 | metaCategory.set(FGUtil.getCategory(fgObject));
<BUG>metaType.set(fgObject.getUniqueTypeString());
metaEnabled.set(fgObject.isEnabled());</BUG>
}
} else {
<BUG>logger.info("Region \"" + name + "\" is already up to date. Skipping...");
}</BUG>
mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgObj... | metaCategory.set(FGUtil.getCategory(fgObject));
metaType.set(fgObject.getUniqueTypeString());
metaOwner.set(owner);
metaEnabled.set(fgObject.isEnabled());
}
} else {
logger.info("Region " + name + " is already up to date. Skipping...");
}
mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.getUn... |
59,913 | mainMap.put(name, FGUtil.getCategory(fgObject));
<BUG>typeMap.put(name, fgObject.getUniqueTypeString());
enabledMap.put(name, fgObject.isEnabled());</BUG>
defaultModifiedMap.put(fgObject, false);
} else {
<BUG>logger.info("World region " + fgObject.getName() + " does not need saving. Skipping...");
</BUG>
}
if (fgObjec... | mainMap.put(name, FGUtil.getCategory(fgObject));
typeMap.put(name, fgObject.getUniqueTypeString());
ownerMap.put(name, owner);
enabledMap.put(name, fgObject.isEnabled());
defaultModifiedMap.put(fgObject, false);
} else {
logger.info("World region " + logName + " does not need saving. Skipping...");
}
if (fgObject.saveL... |
59,914 | 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(... | 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(... |
59,915 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("l... | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("l... |
59,916 | 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;
| StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
return builder.toString();
}
public enum Type {
REGION, WREGION, HANDLER
}
private final class LoadEntry {
public final String na... |
59,917 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class Comm... | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases... |
59,918 | import net.foxdenstudio.sponge.foxguard.plugin.handler.GlobalHandler;
import net.foxdenstudio.sponge.foxguard.plugin.handler.IHandler;
import net.foxdenstudio.sponge.foxguard.plugin.object.IFGObject;
import net.foxdenstudio.sponge.foxguard.plugin.object.IGlobal;
import net.foxdenstudio.sponge.foxguard.plugin.region.IRe... | import net.foxdenstudio.sponge.foxguard.plugin.handler.GlobalHandler;
import net.foxdenstudio.sponge.foxguard.plugin.handler.IHandler;
import net.foxdenstudio.sponge.foxguard.plugin.object.IFGObject;
import net.foxdenstudio.sponge.foxguard.plugin.object.IGlobal;
import net.foxdenstudio.sponge.foxguard.plugin.region.IRe... |
59,919 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDel... | import 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;
import java.util.Optional;
import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
pu... |
59,920 | .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... | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
String regionName = parse.args[1];
IRegion region = FGManager.getIns... |
59,921 | </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);
isWorldRegion = true;
}
if (region == null)
th... |
59,922 | 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[... | 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!"));
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(par... |
59,923 | .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... | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
.map(args -> parse.current.prefix + args)
.collect(GuavaColl... |
59,924 | .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... | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
.map(args -> parse.current.prefix + args)
.collect(GuavaColl... |
59,925 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.co... | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
return Stream.of("region", "worldregion", "handler", "controller")
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmu... |
59,926 | .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... | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
.map(args -> parse.current.prefix + args)
.collect(GuavaColl... |
59,927 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private stat... | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
public final class FoxGuardMain {
private static FoxGuardMain instanceField;
public final Cause pluginCause = Cause.builder().named... |
59,928 | 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;
| private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
return instanceField;
}
public static Cause getCause() {
return instance().pluginCause;
}
@Listener
public void construc... |
59,929 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
public EconomyService getEconomyService() {
return economyService;
|
59,930 | public class UserControllerTest
{
private static final Logger LOGGER = Logger.getLogger( UserControllerTest.class.getName() );
Properties properties = new Properties();
InputStream input = null;
<BUG>private String neo4jServerPort = System.getProperty( "neo4j.server.port" );
private String neo4jRemoteShellPort = System... | public class UserControllerTest
{
private static final Logger LOGGER = Logger.getLogger( UserControllerTest.class.getName() );
Properties properties = new Properties();
InputStream input = null;
private String dbmsConnectorHttpPort = System.getProperty( "dbms.connector.http.port" );
private String dbmsConnectorBoltPort... |
59,931 | @org.springframework.context.annotation.Configuration
@EnableNeo4jRepositories( basePackages = {"org.neo4j.extensions.spring.repository"} )
@EnableTransactionManagement
public class AppGraphConfig extends Neo4jConfiguration
{
<BUG>@Value( "${neo4j.graph.db}" )
private String graphDb;
@Value( "${spring.data.neo4j.url}" ... | @org.springframework.context.annotation.Configuration
@EnableNeo4jRepositories( basePackages = {"org.neo4j.extensions.spring.repository"} )
@EnableTransactionManagement
public class AppGraphConfig extends Neo4jConfiguration
{
@Value( "${dbms.connector.http.port}" )
private Integer dbmsConnectorHttpPort;
@Value( "${dbms... |
59,932 | @Bean
public Configuration getConfiguration()
{
if ( StringUtils.isEmpty( url ) )
{
<BUG>url = "http://localhost:" + port;
</BUG>
}
Configuration config = new Configuration();
config.driverConfiguration().setDriverClassName( HttpDriver.class.getName() )
| @Bean
public Configuration getConfiguration()
{
if ( StringUtils.isEmpty( url ) )
{
url = "http://localhost:" + dbmsConnectorHttpPort;
}
Configuration config = new Configuration();
config.driverConfiguration().setDriverClassName( HttpDriver.class.getName() )
|
59,933 | import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import grails.web.servlet.mvc.GrailsHttpSession;
import grails.web.servlet.mvc.GrailsParameterMap;
import grails.core.GrailsApplication;
<BUG>import grails.core.GrailsControllerClass;
import org.grails.core.io.support.GrailsFac... | import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import grails.web.servlet.mvc.GrailsHttpSession;
import grails.web.servlet.mvc.GrailsParameterMap;
import grails.core.GrailsApplication;
import grails.core.GrailsControllerClass;
import org.grails.core.artefact.ControllerArtefa... |
59,934 | }
@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... | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh",... |
59,935 | 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, s... | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
... |
59,936 | 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... | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
.process(() -> 9999L);
Task<Stri... |
59,937 | 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 +... | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " ca... |
59,938 | 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.e... | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
serialize(task);
Task<String> des = deserialize();
context.evaluate(des... |
59,939 | 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(() ... | 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) {
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
if (n < 2) {
return fib
.process(() -> n);
|
59,940 | }
@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 {
| }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
}
@Test
public void shouldParseFlags() throws Exception {
|
59,941 | 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 {
| assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
}
@Test
public void shouldParseCustomTypes() throws Exception {
|
59,942 | 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
| assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
}
public enum CustomEnum {
BAR
|
59,943 | package com.hazelcast.config;
import java.util.ArrayList;
import java.util.List;
public class JoinMembers {
<BUG>public int connectionTimeoutSeconds = 5;
public boolean enabled = false;
public List<String> lsMembers = new ArrayList<String>();
public String requiredMember = null;
</BUG>
public void add(final String m... | package com.hazelcast.config;
import java.util.ArrayList;
import java.util.List;
public class JoinMembers {
private int connectionTimeoutSeconds = 5;
private boolean enabled = false;
private List<String> lsMembers = new ArrayList<String>();
private String requiredMember = null;
public void add(final String member) {
|
59,944 | final Join join = config.getJoin();
for (int a = 0; a < atts.getLength(); a++) {
final org.w3c.dom.Node att = atts.item(a);
final String value = getTextContent(att).trim();
if (att.getNodeName().equals("enabled")) {
<BUG>join.getJoinMembers().enabled = checkTrue(value);
</BUG>
} else if (att.getNodeName().equals("conn-... | final Join join = config.getJoin();
for (int a = 0; a < atts.getLength(); a++) {
final org.w3c.dom.Node att = atts.item(a);
final String value = getTextContent(att).trim();
if (att.getNodeName().equals("enabled")) {
join.getMulticastConfig().setEnabled(checkTrue(value));
|
59,945 | members:
for (int i = 0; i < nodelist.getLength(); i++) {
final org.w3c.dom.Node n = nodelist.item(i);
final String value = getTextContent(n).trim();
if (n.getNodeName().equalsIgnoreCase("required-member")) {
<BUG>join.getJoinMembers().requiredMember = value;
</BUG>
} else if (n.getNodeName().equalsIgnoreCase("hostname... | members:
for (int i = 0; i < nodelist.getLength(); i++) {
final org.w3c.dom.Node n = nodelist.item(i);
final String value = getTextContent(n).trim();
if (n.getNodeName().equalsIgnoreCase("required-member")) {
join.getJoinMembers().setRequiredMember(value);
} else if (n.getNodeName().equalsIgnoreCase("hostname")) {
join... |
59,946 | ClusterManager.get().sendJoinRequest(masterAddress);
}
private void joinViaPossibleMembers() {
final Config config = Config.get();
try {
<BUG>final List<Address> lsPossibleAddresses = getPossibleMembers(config.getJoin().getJoinMembers().lsMembers);
</BUG>
lsPossibleAddresses.remove(address);
for (final Address adrs : l... | ClusterManager.get().sendJoinRequest(masterAddress);
}
private void joinViaPossibleMembers() {
final Config config = Config.get();
try {
final List<Address> lsPossibleAddresses = getPossibleMembers(config.getJoin().getJoinMembers().getLsMembers());
lsPossibleAddresses.remove(address);
for (final Address adrs : lsPossib... |
59,947 | TreeSet::addAll);
Transaction modeshapeTx = repositoryEnvironment.getTransactions().currentTransaction();
assert modeshapeTx != null;
String txId = modeshapeTx.id();
Set<String> lockedKeysForTx = LOCKED_KEYS_BY_TX_ID.computeIfAbsent(txId, id -> new LinkedHashSet<>());
<BUG>if (keysToLock.removeAll(lockedKeysForTx)) {
i... | TreeSet::addAll);
Transaction modeshapeTx = repositoryEnvironment.getTransactions().currentTransaction();
assert modeshapeTx != null;
String txId = modeshapeTx.id();
Set<String> lockedKeysForTx = LOCKED_KEYS_BY_TX_ID.computeIfAbsent(txId, id -> new LinkedHashSet<>());
if (lockedKeysForTx.containsAll(changedNodesKeys)) ... |
59,948 | int threadCount = 150;
IntStream.range(0, threadCount).parallel().forEach(this::insertAndQueryNodes);
}
@Test
@FixFor( "MODE-2607" )
<BUG>public void shouldBeAbleToUpdateParentNodeWithOneSessionAndRemoveChildNodeWithAnotherSession() throws Exception {
final String parentPath = "/parent";</BUG>
final String childPath = ... | int threadCount = 150;
IntStream.range(0, threadCount).parallel().forEach(this::insertAndQueryNodes);
}
@Test
@FixFor( "MODE-2607" )
public void shouldUpdateParentAndRemoveChildWithDifferentTransactions1() throws Exception {
final String parentPath = "/parent";
final String childPath = "/parent/child";
startTransaction... |
59,949 | package org.modeshape.jcr.cache.document;
import java.util.ArrayList;
import java.util.Collections;
<BUG>import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
<BUG>import java.util.stream.Stream;
import javax.transaction.RollbackException;</BUG>
import javax.transaction.Status;
| package org.modeshape.jcr.cache.document;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.transaction.RollbackException;
import javax.transaction.Status;
|
59,950 | public void changed( ChangeSet changes ) {
sharedWorkspaceCache.changed(changes);
changedWithinTransaction(changes);
}
public void changedWithinTransaction( final ChangeSet changes ) {
<BUG>txWorkspaceCaches.workspaceCachesFor(txn).forEach(cache -> cache.internalChangedWithinTransaction(changes));
}</BUG>
@Override
pub... | public void changed( ChangeSet changes ) {
sharedWorkspaceCache.changed(changes);
changedWithinTransaction(changes);
}
public void changedWithinTransaction( final ChangeSet changes ) {
txWorkspaceCaches.dispatchChangesForTransaction(txn, changes);
}
@Override
public void clear() {
txWorkspaceCaches.clearAllCachesForTra... |
59,951 | return BASE_UNITS[index].multiply(factor);
}
try {
return parseUnit(name);
} catch (ParserException e) {
<BUG>throw (ParseException) new LocalizedParseException(errorLocale,
Errors.Keys.UnknownUnit_1, new Object[] {name}, element.offset).initCause(e);
}</BUG>
}
final void parseParameters(final Element element, final Pa... | return BASE_UNITS[index].multiply(factor);
}
try {
return parseUnit(name);
} catch (ParserException e) {
throw new LocalizedParseException(errorLocale, Errors.Keys.UnknownUnit_1,
new Object[] {name}, element.offset).initCause(e);
}
}
final void parseParameters(final Element element, final ParameterValueGroup parameters... |
59,952 | parameter.setValue(param.pullString("stringValue"));
}
param.close(ignoredElements);
}
} catch (ParameterNotFoundException e) {
<BUG>throw (ParseException) new LocalizedParseException(errorLocale, Errors.Keys.UnexpectedParameter_1,
new String[] {e.getParameterName()}, param.offset).initCause(e);</BUG>
} catch (InvalidP... | parameter.setValue(param.pullString("stringValue"));
}
param.close(ignoredElements);
}
} catch (ParameterNotFoundException e) {
throw new LocalizedParseException(errorLocale, Errors.Keys.UnexpectedParameter_1,
new String[] {e.getParameterName()}, param.offset).initCause(e);
} catch (InvalidParameterValueException e) {
... |
59,953 | import org.opengis.util.FactoryException;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreReferencingException;
import org.apache.sis.storage.UnsupportedStorageException;
<BUG>import org.apache.sis.storage.StorageConnector;
import org.apa... | import org.opengis.util.FactoryException;
import org.apache.sis.storage.DataStore;
import org.apache.sis.storage.DataStoreException;
import org.apache.sis.storage.DataStoreReferencingException;
import org.apache.sis.storage.UnsupportedStorageException;
import org.apache.sis.storage.StorageConnector;
import org.apache.s... |
59,954 | super(provider, connector);
name = connector.getStorageName();
source = connector.getStorageAs(Reader.class);
connector.closeAllExcept(source);
if (source == null) {
<BUG>throw new UnsupportedStorageException(super.getLocale(), true, "Landsat", connector.getStorage());
}</BUG>
}
@Override
public synchronized Metadata g... | super(provider, connector);
name = connector.getStorageName();
source = connector.getStorageAs(Reader.class);
connector.closeAllExcept(source);
if (source == null) {
throw new UnsupportedStorageException(super.getLocale(), "Landsat",
connector.getStorage(), connector.getOption(OptionKey.OPEN_OPTIONS));
}
}
@Override
pu... |
59,955 | try {
synchronized (Angle.class) {
angle = getAngleFormat().parseObject(text);
}
} catch (ParseException exception) {
<BUG>NumberFormatException e = new NumberFormatException(exception.getMessage());
e.initCause(exception);
throw e;</BUG>
}
| try {
synchronized (Angle.class) {
angle = getAngleFormat().parseObject(text);
}
} catch (ParseException exception) {
throw (NumberFormatException) new NumberFormatException(exception.getMessage()).initCause(exception);
}
|
59,956 | protected final Object readResolve() throws InvalidObjectException {
final Class<?> type = getClass();
try {
return type.cast(type.getField(getName()).get(null));
} catch (Exception cause) { // Many exceptions, including unchecked ones.
<BUG>InvalidObjectException e = new InvalidObjectEx... | protected final Object readResolve() throws InvalidObjectException {
final Class<?> type = getClass();
try {
return type.cast(type.getField(getName()).get(null));
} catch (Exception cause) { // Many exceptions, including unchecked ones.
throw (InvalidObjectException) new InvalidObjectExc... |
59,957 | if (verify != null) try {
if (Math.abs(verify.getConverterToAny(unit).convert(1) - 1) > Numerics.COMPARISON_THRESHOLD) {
warning(parent, element, Errors.formatInternational(Errors.Keys.UnexpectedScaleFactorForUnit_2, verify, factor), null);
}
} catch (IncommensurableException e) {
<BUG>throw (ParseException) new Locali... | if (verify != null) try {
if (Math.abs(verify.getConverterToAny(unit).convert(1) - 1) > Numerics.COMPARISON_THRESHOLD) {
warning(parent, element, Errors.formatInternational(Errors.Keys.UnexpectedScaleFactorForUnit_2, verify, factor), null);
}
} catch (IncommensurableException e) {
throw new LocalizedParseException(erro... |
59,958 | } catch (IOException exception) {
record.setLevel (Level.WARNING);
record.setMessage(exception.getMessage()); // For administrator, use system locale.
record.setThrown (exception);
Logging.log(IndexedResourceBundle.class, methodName, record);
<BUG>final MissingResourceException error = new MissingResource... | } catch (IOException exception) {
record.setLevel (Level.WARNING);
record.setMessage(exception.getMessage()); // For administrator, use system locale.
record.setThrown (exception);
Logging.log(IndexedResourceBundle.class, methodName, record);
throw (MissingResourceException) new MissingResourceException(
... |
59,959 | @Override
public Date parse(final String text) throws ParseException {
try {
return toDate(format.parse(text));
} catch (DateTimeException | ArithmeticException e) {
<BUG>ParseException p = new ParseException(e.getLocalizedMessage(), getErrorIndex(e, null));
p.initCause(e);
throw p;</BUG>
}
| @Override
public final Calendar getCalendar() {
if (calendar == null) {
calendar = Calendar.getInstance(getTimeZone(), format.getLocale());
|
59,960 | public Object parseObject(String source) throws ParseException {
source = CharSequences.trimWhitespaces(source);
try {
return valueOf(source);
} catch (NumberFormatException cause) {
<BUG>ParseException e = new LocalizedParseException(null, type, source, null);
e.initCause(cause);
throw e;</BUG>
}
| public Object parseObject(String source) throws ParseException {
source = CharSequences.trimWhitespaces(source);
try {
return valueOf(source);
} catch (NumberFormatException cause) {
throw new LocalizedParseException(null, type, source, null).initCause(cause);
|
59,961 |
private static short key(final Object[] arguments) {
</BUG>
final short key;
<BUG>switch (arguments.length) {
</BUG>
case 1: key = Errors.Keys.UnexpectedEndOfString_1; break;
case 2: key = Errors.Keys.UnparsableStringForClass_2; break;
case 3: key = Errors.Keys.UnparsableStringForClass_3; break;
default: throw new ... | if (erroneous.length() == 0) {
return new Object[] {type, text};
}
return new Object[] {type, text, erroneous};
}
@Workaround(library="JDK", version="1.8")
private static short key(final Object[] parameters) {
final short key;
switch (parameters.length) {
case 1: key = Errors.Keys.UnexpectedEndOfString_1; break;
cas... |
59,962 | final String classname = classe.getSimpleName();
final URL resources = classe.getResource(toResourceName(toBundleName(classname, locale), EXTENSION));
try {
return (ResourceBundle) classe.getDeclaredConstructor(URL.class).newInstance(resources);
} catch (NoSuchMethodException | InvocationTargetException e) {
<BUG>Insta... | final String classname = classe.getSimpleName();
final URL resources = classe.getResource(toResourceName(toBundleName(classname, locale), EXTENSION));
try {
return (ResourceBundle) classe.getDeclaredConstructor(URL.class).newInstance(resources);
} catch (NoSuchMethodException | InvocationTargetException e) {
throw (Ins... |
59,963 | private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
try {
key = getKeyConstants().getKeyValue(in.readUTF());
} catch (ReflectiveOperationException cause) {
<BUG>InvalidObjectException e = new InvalidObjectException(cause.toString());
e.initCause(caus... | private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
try {
key = getKeyConstants().getKeyValue(in.readUTF());
} catch (ReflectiveOperationException cause) {
throw (InvalidObjectException) new InvalidObjectException(cause.toString()).initCause(cause);
|
59,964 | import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.greenaddress.greenapi.GAException;
<BUG>import com.greenaddress.greenapi.Network;
impor... | import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.greenaddress.greenapi.GAException;
import com.greenaddress.greenapi.Network;
import com... |
59,965 | if (txSize == null)
txSize = tx.getMessageSize();
final long requiredFeeDelta = txSize + tx.getInputs().size() * 4;
final List<TransactionInput> oldInputs = new ArrayList<>(tx.getInputs());
tx.clearInputs();
<BUG>for (int i = 0; i < txItem.eps.size(); ++i) {
final Map<String, Object> ep = (Map) txItem.eps.get(i);
if ((... | if (txSize == null)
txSize = tx.getMessageSize();
final long requiredFeeDelta = txSize + tx.getInputs().size() * 4;
final List<TransactionInput> oldInputs = new ArrayList<>(tx.getInputs());
tx.clearInputs();
for (final JSONMap ep : txItem.eps) {
if (ep.getBool("is_credit"))
continue;
final TransactionInput oldInput = o... |
59,966 | final TransactionInput newInput = new TransactionInput(
Network.NETWORK,
null,
oldInput.getScriptBytes(),
oldInput.getOutpoint(),
<BUG>Coin.valueOf(Long.valueOf((String) ep.get("value")))
);</BUG>
newInput.setSequenceNumber(0);
tx.addInput(newInput);
}
| final TransactionInput newInput = new TransactionInput(
Network.NETWORK,
null,
oldInput.getScriptBytes(),
oldInput.getOutpoint(),
ep.getCoin("value")
);
newInput.setSequenceNumber(0);
tx.addInput(newInput);
}
|
59,967 | new CB.Toast<ArrayList>(TransactionActivity.this) {
@Override
public void onSuccess(final ArrayList result) {
Coin remaining = finalRemaining;
final List<ListenableFuture<byte[]>> scripts = new ArrayList<>();
<BUG>final List<Map<String, Object>> moreInputs = new ArrayList<>();
for (final Object utxo_ : result) {
final... | new CB.Toast<ArrayList>(TransactionActivity.this) {
@Override
public void onSuccess(final ArrayList result) {
Coin remaining = finalRemaining;
final List<ListenableFuture<byte[]>> scripts = new ArrayList<>();
final List<JSONMap> moreInputs = new ArrayList<>();
for (final Object o : result) {
final JSONMap utxo = new JS... |
59,968 | oldInput.getValue().longValue()
));
}
int i = 0;
if (moreInputs != null) {
<BUG>for (final Map<String, Object> ep : moreInputs) {
</BUG>
ptx.mPrevOutputs.add(new Output(
<BUG>(Integer) ep.get("subaccount"),
(Integer) ep.get("pointer"),
1,</BUG>
TransactionItem.P2SH_FORTIFIED_OUT,
| oldInput.getValue().longValue()
));
}
int i = 0;
if (moreInputs != null) {
for (final JSONMap ep : moreInputs) {
ptx.mPrevOutputs.add(new Output(
ep.getInt("subaccount"),
ep.getInt("pointer"),
1,
TransactionItem.P2SH_FORTIFIED_OUT,
|
59,969 | public PeerGroup getSPVPeerGroup() { return mSPV.getPeerGroup(); }
public int getSPVHeight() { return mSPV.getSPVHeight(); }
public int getSPVBlocksRemaining() { return mSPV.getSPVBlocksRemaining(); }
public Coin getSPVVerifiedBalance(final int subAccount) {
final Coin balance = mSPV.getVerifiedBalance(subAccount);
<BU... | public PeerGroup getSPVPeerGroup() { return mSPV.getPeerGroup(); }
public int getSPVHeight() { return mSPV.getSPVHeight(); }
public int getSPVBlocksRemaining() { return mSPV.getSPVBlocksRemaining(); }
public Coin getSPVVerifiedBalance(final int subAccount) {
final Coin balance = mSPV.getVerifiedBalance(subAccount);
ret... |
59,970 | private void setAccountTitle(final int subAccount) {
String suffix = "";
if (mService.showBalanceInTitle()) {
Coin balance = mService.getCoinBalance(subAccount);
if (balance == null)
<BUG>balance = Coin.valueOf(0);
</BUG>
suffix = formatValuePostfix(balance);
} else if (mService.haveSubaccounts()) {
final Map<String, ?... | private void setAccountTitle(final int subAccount) {
String suffix = "";
if (mService.showBalanceInTitle()) {
Coin balance = mService.getCoinBalance(subAccount);
if (balance == null)
balance = Coin.ZERO;
suffix = formatValuePostfix(balance);
} else if (mService.haveSubaccounts()) {
final Map<String, ?> m = mService.fin... |
59,971 | package org.opennms.netmgt.collectd;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Iterator;
<BUG>import java.util.List;
import org.opennms.netmgt.mock.OpenNMSTestCase;</BUG>
import org.opennms.netmgt.utils.BarrierSignaler;
import org.opennms.protocols.snmp.SnmpCounter32;
import org.opennms.... | package org.opennms.netmgt.collectd;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.TreeMap;
import org.opennms.netmgt.mock.OpenNMSTestCase;
import org.opennms.netmgt.utils.BarrierSignaler;
import org.opennms.protocols.snmp.SnmpCounter32;
impo... |
59,972 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class ... | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
i... |
59,973 | package org.jboss.as.patching;
import org.jboss.as.controller.AttributeDefinition;
<BUG>import org.jboss.as.controller.SimpleAttributeDefinition;</BUG>
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.dmr.ModelType;
<BUG>class Constants {
</BUG>
static final AttributeDefinition PATCH_ID... | package org.jboss.as.patching;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.SimpleAttributeDefinitionBuilder;
import org.jboss.dmr.ModelType;
public class Constants {
|
59,974 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
impor... | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;
import org.jboss.logging.annotations.Cause;
... |
59,975 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| package org.jboss.as.patching.runner;
import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.Pat... |
59,976 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MIS... | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
ADDED_MODULE("added-module"),
APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
CUMULATIVE("cumulative"),
... |
59,977 | writer.writeEndElement();
final Patch.PatchType type = patch.getPatchType();
<BUG>final List<String> appliesTo = patch.getAppliesTo();</BUG>
if(type == Patch.PatchType.ONE_OFF) {
<BUG>writer.writeEmptyElement(Element.ONE_OFF.name);
</BUG>
} else {
<BUG>writer.writeEmptyElement(Element.CUMULATIVE.name);
</BUG>
writer.wr... | writer.writeEndElement();
writer.writeStartElement(Element.DESCRIPTION.name);
writer.writeCharacters(patch.getDescription());
writer.writeEndElement();
final Patch.PatchType type = patch.getPatchType();
if(type == Patch.PatchType.ONE_OFF) {
writer.writeStartElement(Element.ONE_OFF.name);
} else {
writer.writeStartEleme... |
59,978 | } else {
<BUG>writer.writeEmptyElement(Element.CUMULATIVE.name);
</BUG>
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
}
<BUG>writer.writeAttribute(Attribute.APPLIES_TO_VERSION.name, appliesTo);
final List<ContentModification> bundlesAdd = new ArrayList<ContentModification>();</B... | } else {
writer.writeStartElement(Element.CUMULATIVE.name);
writer.writeAttribute(Attribute.RESULTING_VERSION.name, patch.getResultingVersion());
}
writeAppliesToVersions(writer, patch.getAppliesTo());
writer.writeEndElement(); // </one-off> or </cumulative>
final List<ContentModification> bundlesAdd = new ArrayList<C... |
59,979 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VE... | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
|
59,980 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHex... | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
writer.writeAttribute(Attribute.PATH.name, path.toString());
if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
}
if(type != Modifi... |
59,981 | protected CompilationResult compilationResult = null;
protected boolean isSolution = false;
protected int lastGenAnalyzed = 0;
protected Date bornDate = new Date();
protected List<CtClass> modifiedClasses = new ArrayList<CtClass>();
<BUG>ProgramVariantValidationResult validationResult = null;
public ProgramVariant(){</... | protected CompilationResult compilationResult = null;
protected boolean isSolution = false;
protected int lastGenAnalyzed = 0;
protected Date bornDate = new Date();
protected List<CtClass> modifiedClasses = new ArrayList<CtClass>();
VariantValidationResult validationResult = null;
public ProgramVariant(){
modificationP... |
59,982 | return modifiedClasses;
}
public void setModifiedClasses(List<CtClass> resultedClasses) {
this.modifiedClasses = resultedClasses;
}
<BUG>public ProgramVariantValidationResult getValidationResult() {
return validationResult;</BUG>
}
<BUG>public void setValidationResult(ProgramVariantValidationResult validationResult) {
... | return modifiedClasses;
}
public void setModifiedClasses(List<CtClass> resultedClasses) {
this.modifiedClasses = resultedClasses;
}
public VariantValidationResult getValidationResult() {
return validationResult;
}
public void setValidationResult(VariantValidationResult validationResult) {
this.validationResult = valida... |
59,983 | ConfigurationProperties.setProperty("forceExecuteRegression", Boolean.TRUE.toString());
boolean validInstance = validateInstance(originalVariant);
if (validInstance) {
throw new IllegalStateException("The application under repair has not failling test cases");
}
<BUG>double fitness = originalVariant.getFitness();
log.d... | ConfigurationProperties.setProperty("forceExecuteRegression", Boolean.TRUE.toString());
boolean validInstance = validateInstance(originalVariant);
if (validInstance) {
throw new IllegalStateException("The application under repair has not failling test cases");
}
double fitness = this.fitnessFunction.calculateFitnessVal... |
59,984 | package fr.inria.astor.core.validation.validators;
<BUG>import fr.inria.astor.core.entities.ProgramVariantValidationResult;
</BUG>
public class EvoSuiteValidationResult extends CompoundValidationResult {
<BUG>public ProgramVariantValidationResult getFailingTestValidation() {
</BUG>
return this.validations.get("failing"... | package fr.inria.astor.core.validation.validators;
import fr.inria.astor.core.entities.TestCaseVariantValidationResult;
public class EvoSuiteValidationResult extends CompoundValidationResult {
public TestCaseVariantValidationResult getFailingTestValidation() {
return this.validations.get("failing");
|
59,985 | public class EvoSuiteValidationResult extends CompoundValidationResult {
<BUG>public ProgramVariantValidationResult getFailingTestValidation() {
</BUG>
return this.validations.get("failing");
}
<BUG>public void setFailingTestValidation(ProgramVariantValidationResult evoValidation) {
</BUG>
this.addValidation("failing",... | public class EvoSuiteValidationResult extends CompoundValidationResult {
public TestCaseVariantValidationResult getFailingTestValidation() {
return this.validations.get("failing");
|
59,986 | +((this.getManualTestValidation() != null)?"\nmanual_regression: "+(getManualTestValidation()):"")
+((getEvoValidation() != null)?"\nevo_regression: "+ (getEvoValidation()):"")
;
}
@Override
<BUG>public boolean wasSuccessful() {
return (getValidation("failing") == null || getValidation("failing").wasSuccessful())
</BU... | +((this.getManualTestValidation() != null)?"\nmanual_regression: "+(getManualTestValidation()):"")
+((getEvoValidation() != null)?"\nevo_regression: "+ (getEvoValidation()):"")
;
|
59,987 | import org.apache.log4j.Logger;
import com.martiansoftware.jsap.JSAPException;
import fr.inria.astor.core.entities.OperatorInstance;
import fr.inria.astor.core.entities.ModificationPoint;
import fr.inria.astor.core.entities.ProgramVariant;
<BUG>import fr.inria.astor.core.entities.ProgramVariantValidationResult;
import ... | import org.apache.log4j.Logger;
import com.martiansoftware.jsap.JSAPException;
import fr.inria.astor.core.entities.OperatorInstance;
import fr.inria.astor.core.entities.ModificationPoint;
import fr.inria.astor.core.entities.ProgramVariant;
import fr.inria.astor.core.entities.VariantValidationResult;
import fr.inria.ast... |
59,988 | protected MutationSupporter mutatorSupporter = null;
protected ProjectRepairFacade projectFacade = null;
protected Date dateInitEvolution = new Date();
protected FaultLocalizationStrategy faultLocalization = null;
protected int generationsExecuted = 0;
<BUG>protected SolutionVariantSortCriterion patchSortCriterion = nu... | protected MutationSupporter mutatorSupporter = null;
protected ProjectRepairFacade projectFacade = null;
protected Date dateInitEvolution = new Date();
protected FaultLocalizationStrategy faultLocalization = null;
protected int generationsExecuted = 0;
protected SolutionVariantSortCriterion patchSortCriterion = null;
p... |
59,989 | protected abstract void applyPreviousMutationOperationToSpoonElement(OperatorInstance operation)
throws IllegalAccessException;
protected abstract void applyNewMutationOperationToSpoonElement(OperatorInstance operation)
throws IllegalAccessException;
protected boolean validateInstance(ProgramVariant variant) {
<BUG>Pro... | protected abstract void applyPreviousMutationOperationToSpoonElement(OperatorInstance operation)
throws IllegalAccessException;
protected abstract void applyNewMutationOperationToSpoonElement(OperatorInstance operation)
throws IllegalAccessException;
protected boolean validateInstance(ProgramVariant variant) {
VariantV... |
59,990 | package fr.inria.astor.core.validation.validators;
import java.util.HashMap;
import java.util.Map;
<BUG>import fr.inria.astor.core.entities.ProgramVariantValidationResult;
public class CompoundValidationResult extends ProgramVariantValidationResult {
protected Map<String,ProgramVariantValidationResult> validations = ... | package fr.inria.astor.core.validation.validators;
import java.util.HashMap;
import java.util.Map;
import fr.inria.astor.core.entities.TestCaseVariantValidationResult;
public class CompoundValidationResult implements TestCaseVariantValidationResult {
protected Map<String,TestCaseVariantValidationResult> validations = n... |
59,991 |
protected Map<String,ProgramVariantValidationResult> validations = new HashMap<>();
</BUG>
public CompoundValidationResult() {
}
<BUG>public void addValidation(String mode, ProgramVariantValidationResult p){
</BUG>
this.validations.put(mode, p);
}
<BUG>public ProgramVariantValidationResult getValidation(String mode){
... | package fr.inria.astor.core.validation.validators;
import java.util.HashMap;
import java.util.Map;
import fr.inria.astor.core.entities.TestCaseVariantValidationResult;
public class CompoundValidationResult implements TestCaseVariantValidationResult {
protected Map<String,TestCaseVariantValidationResult> validations = n... |
59,992 | public void setRegressionExecuted(boolean regressionExecuted) {
}
@Override
public int getPassingTestCases() {
int count = 0;
<BUG>for (ProgramVariantValidationResult pv : this.validations.values()) {
</BUG>
count+= pv.getPassingTestCases();
}
return count;
| public void setRegressionExecuted(boolean regressionExecuted) {
}
@Override
public int getPassingTestCases() {
int count = 0;
for (TestCaseVariantValidationResult pv : this.validations.values()) {
count+= pv.getPassingTestCases();
}
return count;
|
59,993 | solutionVariant.getOperations().put(generationsExecuted, Arrays.asList(pointOperation));
applyNewMutationOperationToSpoonElement(pointOperation);
boolean solution = processCreatedVariant(solutionVariant, generationsExecuted);
if (solution) {
this.solutions.add(solutionVariant);
<BUG>if (ConfigurationProperties.getPrope... | solutionVariant.getOperations().put(generationsExecuted, Arrays.asList(pointOperation));
applyNewMutationOperationToSpoonElement(pointOperation);
boolean solution = processCreatedVariant(solutionVariant, generationsExecuted);
if (solution) {
this.solutions.add(solutionVariant);
if (ConfigurationProperties.getPropertyBo... |
59,994 | BufferedImage image = document.getValue();
if (image != null) {
paintBorder(g, ic);
Dimension size = ic.getCanvasSize();
Graphics igc = g.create(2, 2, size.width, size.height);
<BUG>if (ic.isTransparencyChessboardVisible()) {
paintChessboard(igc, ic);</BUG>
}
paintImage(igc, ic);
if (ic.isGridVisible()) {
| BufferedImage image = document.getValue();
if (image != null) {
paintBorder(g, ic);
Dimension size = ic.getCanvasSize();
Graphics igc = g.create(2, 2, size.width, size.height);
if (ic.isTransparencyChessboardVisible() && image.getTransparency() != Transparency.OPAQUE) {
paintChessboard(igc, ic);
}
paintImage(igc, ic);
... |
59,995 | }
igc.dispose();
}
}
}
<BUG>private void paintBorder(Graphics g, ImageComponent ic) {
</BUG>
Dimension size = ic.getSize();
g.setColor(ic.getTransparencyChessboardBlackColor());
g.drawRect(0, 0, size.width - 1, size.height - 1);
| }
paintImage(igc, ic);
if (ic.isGridVisible()) {
paintGrid(igc, ic);
}
igc.dispose();
}
}
}
private static void paintBorder(Graphics g, ImageComponent ic) {
Dimension size = ic.getSize();
g.setColor(ic.getTransparencyChessboardBlackColor());
g.drawRect(0, 0, size.width - 1, size.height - 1);
|
59,996 | g.drawRect(0, 0, size.width - 1, size.height - 1);
}
private void paintChessboard(Graphics g, ImageComponent ic) {
Dimension size = ic.getCanvasSize();
int cellSize = ic.getTransparencyChessboardCellSize();
<BUG>int patternSize = 2 * cellSize;
BufferedImage pattern = UIUtil.createImage(patternSize, patternSize, Buffere... | g.drawRect(0, 0, size.width - 1, size.height - 1);
}
private void paintChessboard(Graphics g, ImageComponent ic) {
Dimension size = ic.getCanvasSize();
int cellSize = ic.getTransparencyChessboardCellSize();
int patternSize = 2 * cellSize;
if (pattern == null) {
pattern = UIUtil.createImage(patternSize, patternSize, Buf... |
59,997 | g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
g.drawImage(document.getRenderer(), 0, 0, size.width, size.height, ic);
</BUG>
g2d.setRenderingHints(oldHints);
}
<BUG>private void paintGrid(Graphics g, ImageComponent ic) {
</BUG>
Dimension size = ic.getCanvas... | g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
} else {
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
}
g.drawIma... |
59,998 | import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.List;
public class ImageComponent extends JComponent {
@NonNls
<BUG>private static final String TRANSPARENCY_CHESSBOARD_CELL_SIZE_PROP = "TransparencyChessboard.cellSize";
</BUG>
@NonNls
<BUG>private static final String TRANSPARENCY_CHESSBOARD_WHI... | import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.List;
public class ImageComponent extends JComponent {
|
59,999 | @NonNls
<BUG>private static final String TRANSPARENCY_CHESSBOARD_WHITE_COLOR_PROP = "TransparencyChessboard.whiteColor";
</BUG>
@NonNls
<BUG>private static final String TRANSPARENCY_CHESSBOARD_BLACK_COLOR_PROP = "TransparencyChessboard.blackColor";
</BUG>
@NonNls
private static final String TRANSPARENCY_CHESSBOARD_VISI... | @NonNls
public static final String TRANSPARENCY_CHESSBOARD_CELL_SIZE_PROP = "TransparencyChessboard.cellSize";
@NonNls
public static final String TRANSPARENCY_CHESSBOARD_WHITE_COLOR_PROP = "TransparencyChessboard.whiteColor";
@NonNls
public static final String TRANSPARENCY_CHESSBOARD_BLACK_COLOR_PROP = "TransparencyChe... |
60,000 | package org.intellij.plugins.intelliLang.pattern;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemsHolder;
<BUG>import com.intellij.ide.DataManager;
import com.intell... | package org.intellij.plugins.intelliLang.pattern;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.LocalQuickFix;
import com.intellij.codeInspection.ProblemDescriptor;
import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.ide.DataManager;
import com.intellij.op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.