id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
17,701 | 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)
|
17,702 | .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))
|
17,703 | .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))
|
17,704 | @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;
|
17,705 | 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;
}
|
17,706 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
17,707 | 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.*;
|
17,708 | .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))
|
17,709 | 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) -> {
|
17,710 | 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);
|
17,711 | 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);
|
17,712 | 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() + "\"");
|
17,713 | 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() + "\"");
|
17,714 | 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
|
17,715 | .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")
|
17,716 | 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 PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
17,717 | 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;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
17,718 | 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"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
17,719 | 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_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
17,720 | 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, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
17,721 | 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>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
17,722 | import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import java.util.List;
public class BlockMetalWall extends BlockWall {
<BUG>public static final String[] field_150092_a = new String[]{"iron", "gold", "rusty"};
public BlockMetalWall(Block block) {</BUG>
super(block);
}
@SideOnly(Side.CLIENT)
| public static final String[] field_150092_a = new String[]{"iron", "gold"};
public BlockMetalWall(Block block) {
|
17,723 | super(block);
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int p_149691_1_, int p_149691_2_) {
<BUG>return p_149691_2_ == 2 ? VanillaModule.rustyIronBlock.getBlockTextureFromSide(p_149691_1_) : p_149691_2_ == 1 ? Blocks.gold_block.getBlockTextureFromSide(p_149691_1_) : Blocks.iron_block.getBlockTextureFromSide(p_149691_1_);
}</BUG>
public int getRenderType() {
return 32;
}
| return p_149691_2_ == 1 ? Blocks.gold_block.getBlockTextureFromSide(p_149691_1_) : Blocks.iron_block.getBlockTextureFromSide(p_149691_1_);
|
17,724 | chocolate = MilitaryBaseDecor.INSTANCE.getManager().newItem("chocolate", new ItemChocolate(0, 0F, false).setPotionEffect(20, 60, 1, 1F).setTextureName(MilitaryBaseDecor.DOMAIN + "chocolate").setUnlocalizedName("chocolate").setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB));
}
ammunitionBox = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockAmmunitionBox.class, ItemBlockWorldWar2.class);
corrugatedGalvanisedIronBlock = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockCorrugatedGalvanisedIron.class, ItemBlockCorrugatedGalvanisedIron.class);
oliveDrabTexturedBlock = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockOliveDrabTexturedBlock.class, ItemBlockWorldWar2.class);
<BUG>MilitaryBaseDecor.CREATIVE_TAB.itemStack = new ItemStack(chocolate);
</BUG>
}
@Override
public void postInit() {
| MilitaryBaseDecor.CREATIVE_TAB.itemStack = new ItemStack(ammunitionBox);
|
17,725 | import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import java.util.List;
public class ItemBag extends Item {
<BUG>public ItemBag() {
this.setUnlocalizedName("Bag");
this.setTextureName(MilitaryBaseDecor.PREFIX + "bag");</BUG>
}
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
| this.setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB);
|
17,726 | public void preInit() {
limecrete = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockLimecrete.class, ItemBlockGunpowderEra.class);
ropeFence = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockRopeFence.class, ItemBlockGunpowderEra.class);
tangledRope = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockTangledRope.class, ItemBlockGunpowderEra.class);
picketFence = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockPicketFence.class, ItemBlockGunpowderEra.class);
<BUG>rope = MilitaryBaseDecor.INSTANCE.getManager().newItem(ItemRope.class);
MilitaryBaseDecor.CREATIVE_TAB.itemStack = new ItemStack(ropeFence);</BUG>
}
@Override
public void init() {
| rope = MilitaryBaseDecor.INSTANCE.getManager().newItem("rope", new ItemRope()).setUnlocalizedName("rope").setTextureName(MilitaryBaseDecor.PREFIX + "rope");
MilitaryBaseDecor.CREATIVE_TAB.itemStack = new ItemStack(ropeFence);
|
17,727 | import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import java.util.List;
public class ItemBundledWire extends Item {
<BUG>public ItemBundledWire() {
}</BUG>
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
list.add(EnumChatFormatting.BLUE + "Vanilla Module");
}
| this.setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB);
|
17,728 | import net.minecraft.util.IIcon;
public class TileSimpleCamo extends TileEnt implements IPacketReceiver {
ItemStack stack = null;
boolean locked = false;
public TileSimpleCamo() {
<BUG>super("tileCamo", Material.rock);
</BUG>
this.itemBlock = ItemBlockCamo.class;
this.setTextureName(MilitaryBaseDecor.PREFIX + "camo_simple");
}
| super("camo_simple", Material.rock);
|
17,729 | basicConcrete = MilitaryBaseDecor.INSTANCE.getManager().newBlock("concrete_basic", new BlockColored(Material.rock).setHardness(15).setResistance(150).setStepSound(Block.soundTypeStone).setBlockName("basic_concrete").setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB), ItemBlockVanilla.class);
for (int i = 0; i < 16; i++) {
concreteStairs[i] = MilitaryBaseDecor.INSTANCE.getManager().newBlock("concrete_basic_stairs_" + i, new BlockColoredStairs(basicConcrete, i).setResistance(150).setHardness(15).setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB).setStepSound(Block.soundTypeStone), ItemBlockVanilla.class);
}
concreteWall = MilitaryBaseDecor.INSTANCE.getManager().newBlock("concrete_wall", new BlockWallPrefab(basicConcrete).setResistance(150).setHardness(15).setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB).setStepSound(Block.soundTypeStone), ItemBlockVanilla.class);
<BUG>simpleCamoBlock = MilitaryBaseDecor.INSTANCE.getManager().newBlock(TileSimpleCamo.class);
wiredFence = MilitaryBaseDecor.INSTANCE.getManager().newBlock("wired_fence", new BlockWiredFence("militarybasedecor:wired_fence", "militarybasedecor:wired_fence_top", Material.iron, true).setBlockUnbreakable().setBlockName("wired_fence"), ItemBlockVanilla.class);</BUG>
sandBag = MilitaryBaseDecor.INSTANCE.getManager().newBlock(BlockBasicSandBag.class, ItemBlockVanilla.class);
metalFence = MilitaryBaseDecor.INSTANCE.getManager().newBlock("metal_fence", new BlockFence("iron_block", Material.iron).setBlockTextureName("iron_block").setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB).setStepSound(Block.soundTypeMetal), ItemBlockVanilla.class);
metalWall = MilitaryBaseDecor.INSTANCE.getManager().newBlock("metal_wall", new BlockMetalWall(reinforcedMetal).setHardness(5.0F).setResistance(10.0F).setStepSound(Block.soundTypeMetal).setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB), ItemBlockVanilla.class);
| simpleCamoBlock = MilitaryBaseDecor.INSTANCE.getManager().newBlock("camo_simple", new TileSimpleCamo()).setBlockName("camo_simple").setBlockTextureName(MilitaryBaseDecor.PREFIX + "camo_simple");
wiredFence = MilitaryBaseDecor.INSTANCE.getManager().newBlock("wired_fence", new BlockWiredFence("militarybasedecor:wired_fence", "militarybasedecor:wired_fence_top", Material.iron, true).setBlockUnbreakable().setBlockName("wired_fence"), ItemBlockVanilla.class);
|
17,730 | import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import java.util.List;
public class ItemBagCement extends Item {
public ItemBagCement() {
<BUG>this.setUnlocalizedName("bagCement");
this.setTextureName(MilitaryBaseDecor.PREFIX + "bag_cement");
this.setMaxStackSize(1);</BUG>
this.setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB);
}
| [DELETED] |
17,731 | public static Block meshedFloorPanel;
public static Block glassFloorPanel;
public static Block reinforcedGlassPanel;
@Override
public void preInit() {
<BUG>meshedFloorPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock(TileMeshedFloorPanel.class);
glassFloorPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock(TileGlassFloorPanel.class);
reinforcedGlassPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock(TileReinforcedGlassFloorPanel.class);
}</BUG>
@Override
| meshedFloorPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock("meshed_floor_panel", new TileMeshedFloorPanel()).setBlockName("meshed_floor_panel");
glassFloorPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock("glass_floor_panel", new TileGlassFloorPanel()).setBlockName("glass_floor_panel");
reinforcedGlassPanel = MilitaryBaseDecor.INSTANCE.getManager().newBlock("reinforced_glass_floor_panel", new TileReinforcedGlassFloorPanel()).setBlockName("reinforced_glass_floor_panel");
}
|
17,732 | import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import java.util.List;
public class ItemRope extends Item {
public ItemRope() {
<BUG>this.setUnlocalizedName("rope");
this.setTextureName(MilitaryBaseDecor.PREFIX + "rope");</BUG>
this.setCreativeTab(MilitaryBaseDecor.CREATIVE_TAB);
}
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
| [DELETED] |
17,733 | package com.builtbroken.militarybasedecor.vanilla.content.item.tool;
import com.builtbroken.militarybasedecor.MilitaryBaseDecor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
<BUG>import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemWireCutters extends Item {</BUG>
public ItemWireCutters() {
this.setMaxStackSize(1);
| import net.minecraft.util.EnumChatFormatting;
import java.util.List;
public class ItemWireCutters extends Item {
|
17,734 | }
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
CREATIVE_TAB = new ModCreativeTab("MilitaryBaseDecor");
<BUG>CREATIVE_TAB.itemSorter = new ModCreativeTab.NameSorter(); // Temporary Solution to an nullexception error on creativetab rendering. TODO Rearrange the creative tab sorting system.
</BUG>
getManager().setTab(CREATIVE_TAB);
VANILLA_ENABLED = getConfig().getBoolean("Enable Vanilla Module", "Modules", true, "Enables/Disables the Vanilla module.");
GUNPOWDER_ERA_ENABLED = getConfig().getBoolean("Enable Civil War Module", "Modules", true, "Enables/Disables the Civil War module.");
| CREATIVE_TAB.itemSorter = new ModCreativeTab.NameSorter(); // Temporary Solution to an nullpointerexception error on creativetab rendering. TODO Rearrange the creative tab sorting system.
|
17,735 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,736 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug(levelName + " Servlet Accessed");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss3", locale);
try
|
17,737 | log.debug("After Filtering - " + searchTerm);
String htmlOutput = new String();
if(FindXSS.search(searchTerm))
{
Encoder encoder = ESAPI.encoder();
<BUG>htmlOutput = "<h2 class='title'>Well Done</h2>" +
"<p>You successfully executed the JavaScript alert command!<br />" +
"The result key for this challenge is <a>" +
encoder.encodeForHTML(</BUG>
Hash.generateUserSolution(
| htmlOutput = "<h2 class='title'>" + bundle.getString("result.wellDone") + "</h2>" +
"<p>" + bundle.getString("result.youDidIt") + "<br />" +
bundle.getString("result.resultKey") + " <a>" +
encoder.encodeForHTML(
|
17,738 | )
) +
"</a>";
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Search Results</h2>" +
"<p>Sorry but there were no results found that related to " +
searchTerm +</BUG>
"</p>";
log.debug("Outputting HTML");
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.searchResults") + "</h2>" +
"<p>" + bundle.getString("response.noResults") + " " +
searchTerm +
|
17,739 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,740 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug("Cross-Site Scripting Challenge Five Servlet");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss5", locale);
try
|
17,741 | log.debug("After WhiteListing - " + searchTerm);
boolean xssDetected = FindXSS.search(userPost);
if(xssDetected)
{
Encoder encoder = ESAPI.encoder();
<BUG>htmlOutput = "<h2 class='title'>Well Done</h2>" +
"<p>You successfully executed the JavaScript alert command!<br />" +
"The result key for this challenge is <a>" +
encoder.encodeForHTML(</BUG>
Hash.generateUserSolution(
| htmlOutput = "<h2 class='title'>" + bundle.getString("result.wellDone") + "</h2>" +
"<p>" + bundle.getString("result.youDidIt") + "<br />" +
bundle.getString("result.resultKey") + " <a>" +
encoder.encodeForHTML(
|
17,742 | (String)ses.getAttribute("userName")
)
) + "</a>";
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Your New Post!</h2>" +
"<p>You just posted the following link;</p> " +
userPost +</BUG>
"</p>";
out.write(htmlOutput);
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.yourPost") + "</h2>" +
"<p>" + bundle.getString("response.linkPosted") + "</p> " +
userPost +
|
17,743 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,744 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug("Cross-Site Scripting Challenge Four Servlet");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss4", locale);
try
|
17,745 | userPost = "<a href=\"" + searchTerm + "\" alt=\"" + searchTerm + "\">" + searchTerm + "</a>";
log.debug("After Encoding - " + searchTerm);
if(FindXSS.search(userPost))
{
Encoder encoder = ESAPI.encoder();
<BUG>htmlOutput = "<h2 class='title'>Well Done</h2>" +
"<p>You successfully executed the JavaScript alert command!<br />" +
"The result key for this challenge is <a>" +
encoder.encodeForHTML(</BUG>
Hash.generateUserSolution(
| htmlOutput = "<h2 class='title'>" + bundle.getString("result.wellDone") + "</h2>" +
"<p>" + bundle.getString("result.youDidIt") + "<br />" +
bundle.getString("result.resultKey") + " <a>" +
encoder.encodeForHTML(
|
17,746 | )
) + "</a>";
}
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Your New Post!</h2>" +
"<p>You just posted the following link;</p> " +
userPost +</BUG>
"</p>";
out.write(htmlOutput);
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.yourPost") + "</h2>" +
"<p>" + bundle.getString("response.linkPosted") + "</p> " +
userPost +
|
17,747 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,748 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug(levelHash + " Servlet Accessed");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss2", locale);
try
|
17,749 | ) +
"</a>";
log.debug(levelName + " completed");
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Search Results</h2>" +
"<p>Sorry but there were no results found that related to " +
searchTerm +</BUG>
"</p>";
log.debug("Outputting HTML");
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.searchResults") + "</h2>" +
"<p>" + bundle.getString("response.noResults") + " " +
searchTerm +
|
17,750 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,751 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug(levelName + " Servlet Accessed");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss1", locale);
try
|
17,752 | log.debug("After Filtering - " + searchTerm);
String htmlOutput = new String();
if(FindXSS.search(searchTerm))
{
Encoder encoder = ESAPI.encoder();
<BUG>htmlOutput = "<h2 class='title'>Well Done</h2>" +
"<p>You successfully executed the JavaScript alert command!<br />" +
"The result key for this challenge is <a>" +
encoder.encodeForHTML(</BUG>
Hash.generateUserSolution(
| htmlOutput = "<h2 class='title'>" + bundle.getString("result.wellDone") + "</h2>" +
"<p>" + bundle.getString("result.youDidIt") + "<br />" +
bundle.getString("result.resultKey") + " <a>" +
encoder.encodeForHTML(
|
17,753 | )
) +
"</a>";
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Search Results</h2>" +
"<p>Sorry but there were no results found that related to " +
searchTerm +</BUG>
"</p>";
log.debug("Outputting HTML");
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.searchResults") + "</h2>" +
"<p>" + bundle.getString("response.noResults") + " " +
searchTerm +
|
17,754 | package servlets.module.challenge;
import java.io.IOException;
<BUG>import java.io.PrintWriter;
import javax.servlet.ServletException;</BUG>
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
| import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
|
17,755 | throws ServletException, IOException
{
ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));
log.debug(levelName + " Servlet");
PrintWriter out = response.getWriter();
<BUG>out.print(getServletInfo());
try</BUG>
{
HttpSession ses = request.getSession(true);
if(Validate.validateSession(ses))
| Locale locale = new Locale(Validate.validateLanguage(request.getSession()));
ResourceBundle errors = ResourceBundle.getBundle("i18n.servlets.errors", locale);
ResourceBundle bundle = ResourceBundle.getBundle("i18n.servlets.challenges.xss6", locale);
try
|
17,756 | log.debug("After Sanitising - " + searchTerm);
boolean xssDetected = FindXSS.search(userPost);
if(xssDetected)
{
Encoder encoder = ESAPI.encoder();
<BUG>htmlOutput = "<h2 class='title'>Well Done</h2>" +
"<p>You successfully executed the JavaScript alert command!<br />" +
"The result key for this challenge is <a>" +
encoder.encodeForHTML(</BUG>
Hash.generateUserSolution(
| htmlOutput = "<h2 class='title'>" + bundle.getString("result.wellDone") + "</h2>" +
"<p>" + bundle.getString("result.youDidIt") + "<br />" +
bundle.getString("result.resultKey") + " <a>" +
encoder.encodeForHTML(
|
17,757 | (String)ses.getAttribute("userName")
)
) + "</a>";
}
log.debug("Adding searchTerm to Html: " + searchTerm);
<BUG>htmlOutput += "<h2 class='title'>Your New Post!</h2>" +
"<p>You just posted the following link;</p> " +
userPost +</BUG>
"</p>";
out.write(htmlOutput);
| htmlOutput += "<h2 class='title'>" + bundle.getString("response.yourPost") + "</h2>" +
"<p>" + bundle.getString("response.linkPosted") + "</p> " +
userPost +
|
17,758 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
17,759 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
17,760 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
17,761 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
17,762 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
17,763 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
17,764 | </BUG>
try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
System.out.println();
System.out.println(">>> Compute broadcast example started.");
<BUG>ignite.compute().broadcast((IgniteRunnable)() -> System.out.println("Hello World")).get();
ignite.compute().run((IgniteRunnable)() -> System.out.println("Hello World")).get();
int length = ignite.compute().call((IgniteCallable<Integer>)"Hello World"::length).get();
</BUG>
System.out.println();
| package org.apache.ignite.examples;
import org.apache.ignite.*;
import org.apache.ignite.lang.*;
public class ComputeExample {
public static void main(String[] args) throws IgniteException {
ignite.compute().broadcast((IgniteRunnable) () -> System.out.println("Hello World"));
ignite.compute().run((IgniteRunnable) () -> System.out.println("Hello World"));
int length = ignite.compute().call((IgniteCallable<Integer>) "Hello World"::length);
|
17,765 | package org.apache.ignite.examples;
<BUG>import org.apache.ignite.*;
public final class MessagingExample {</BUG>
private static final int MESSAGES_NUM = 10;
private enum TOPIC { ORDERED, UNORDERED }
public static void main(String[] args) throws Exception {
| import org.apache.ignite.cluster.*;
import java.util.concurrent.*;
public final class MessagingExample {
|
17,766 | public final class MessagingExample {</BUG>
private static final int MESSAGES_NUM = 10;
private enum TOPIC { ORDERED, UNORDERED }
public static void main(String[] args) throws Exception {
try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
<BUG>if (ignite.nodes().size() < 2) {
System.out.println();</BUG>
System.out.println(">>> Please start at least 2 cluster nodes to run example.");
System.out.println();
return;
| package org.apache.ignite.examples;
import org.apache.ignite.*;
import org.apache.ignite.cluster.*;
import java.util.concurrent.*;
public final class MessagingExample {
if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2)) {
|
17,767 | for (int i = 0; i < MESSAGES_NUM; i++)
rmtPrj.message().send(TOPIC.UNORDERED, Integer.toString(i));
</BUG>
System.out.println(">>> Finished sending unordered messages.");
for (int i = 0; i < MESSAGES_NUM; i++)
<BUG>rmtPrj.message().sendOrdered(TOPIC.ORDERED, Integer.toString(i), 0);
</BUG>
System.out.println(">>> Finished sending ordered messages.");
System.out.println(">>> Check output on all nodes for message printouts.");
System.out.println(">>> Will wait for messages acknowledgements from all remote nodes.");
| ignite.message(rmtPrj).send(TOPIC.UNORDERED, Integer.toString(i));
ignite.message(rmtPrj).sendOrdered(TOPIC.ORDERED, Integer.toString(i), 0);
|
17,768 | prj.message().remoteListen(TOPIC.ORDERED, (nodeId, msg) -> {
</BUG>
System.out.println("Received ordered message [msg=" + msg + ", fromNodeId=" + nodeId + ']');
try {
<BUG>prj.ignite().forNodeId(nodeId).message().send(TOPIC.ORDERED, msg);
</BUG>
}
catch (IgniteException e) {
e.printStackTrace();
}
| orderedLatch.await();
unorderedLatch.await();
System.out.println(">>> Messaging example finished.");
private static void startListening(final Ignite ignite, IgniteMessaging imsg) throws IgniteException {
imsg.remoteListen(TOPIC.ORDERED, (nodeId, msg) -> {
ignite.message(ignite.cluster().forNodeId(nodeId)).send(TOPIC.ORDERED, msg);
|
17,769 | </BUG>
orderedLatch.countDown();
return orderedLatch.getCount() > 0;
});
<BUG>grp.message().localListen(TOPIC.UNORDERED, (nodeId, msg) -> {
</BUG>
unorderedLatch.countDown();
return unorderedLatch.getCount() > 0;
});
}
| private static void localListen(
IgniteMessaging imsg,
final CountDownLatch orderedLatch,
final CountDownLatch unorderedLatch
) {
imsg.localListen(TOPIC.ORDERED, (nodeId, msg) -> {
imsg.localListen(TOPIC.UNORDERED, (nodeId, msg) -> {
|
17,770 | "2015/3/10,Red Falcons,Blue Bonnets,28,17\n" +
"2014/8/12,Green Berets,Red Falcons,23,8\n";
@Test
public void testPartitionedCounting() throws Exception {
ApplicationManager appManager = deployApplication(SportResults.class);
<BUG>ServiceManager serviceManager = appManager.getServiceManager("UploadService");
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
URL url = serviceManager.getServiceURL();
| ServiceManager serviceManager = appManager.getServiceManager("UploadService").start();
|
17,771 | serviceManager.waitForStatus(true);
URL url = serviceManager.getServiceURL();
uploadResults(url, "fantasy", 2014, FANTASY_2014);
uploadResults(url, "fantasy", 2015, FANTASY_2015);
uploadResults(url, "critters", 2014, CRITTERS_2014);
<BUG>MapReduceManager mrManager = appManager.getMapReduceManager("ScoreCounter");
mrManager.start(ImmutableMap.of("league", "fantasy"));
mrManager.waitForFinish(5, TimeUnit.MINUTES); // should be much faster, though</BUG>
DataSetManager<PartitionedFileSet> dataSetManager = getDataset("totals");
PartitionedFileSet totals = dataSetManager.get();
| MapReduceManager mrManager =
appManager.getMapReduceManager("ScoreCounter").start(ImmutableMap.of("league", "fantasy"));
mrManager.waitForFinish(5, TimeUnit.MINUTES); // should be much faster, though
|
17,772 | public class PurchaseAppTest extends TestBase {
private static final Gson GSON = new Gson();
@Test
public void test() throws Exception {
ApplicationManager appManager = deployApplication(PurchaseApp.class);
<BUG>FlowManager flowManager = appManager.getFlowManager("PurchaseFlow");
flowManager.start();</BUG>
StreamManager streamManager = getStreamManager("purchaseStream");
streamManager.send("bob bought 3 apples for $30");
| FlowManager flowManager = appManager.getFlowManager("PurchaseFlow").start();
|
17,773 | UserProfile profileFromPurchaseHistory = history.getUserProfile();
Assert.assertEquals(profileFromPurchaseHistory.getFirstName(), "joe");
Assert.assertEquals(profileFromPurchaseHistory.getLastName(), "bernard");
}
private ServiceManager getUserProfileServiceManager(ApplicationManager appManager) throws InterruptedException {
<BUG>ServiceManager userProfileServiceManager = appManager.getServiceManager(UserProfileServiceHandler.SERVICE_NAME);
userProfileServiceManager.start();
userProfileServiceManager.waitForStatus(true);</BUG>
return userProfileServiceManager;
}
| [DELETED] |
17,774 | import java.util.concurrent.TimeUnit;
public class UserProfilesTest extends TestBase {
@Test
public void testUserProfiles() throws Exception {
ApplicationManager applicationManager = deployApplication(UserProfiles.class);
<BUG>FlowManager flowManager = applicationManager.getFlowManager("ActivityFlow");
flowManager.start();
ServiceManager serviceManager = applicationManager.getServiceManager("UserProfileService");
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
| FlowManager flowManager = applicationManager.getFlowManager("ActivityFlow").start();
ServiceManager serviceManager = applicationManager.getServiceManager("UserProfileService").start();
|
17,775 | ServiceManager serviceManager = appManager.getServiceManager(SparkPageRankApp.RANKS_SERVICE_NAME);
serviceManager.start();</BUG>
transformServiceManager.waitForStatus(true);
<BUG>SparkManager sparkManager = appManager.getSparkManager("SparkPageRankProgram");
sparkManager.start();</BUG>
sparkManager.waitForFinish(60, TimeUnit.SECONDS);
serviceManager.waitForStatus(true);
String response = requestService(new URL(serviceManager.getServiceURL(15, TimeUnit.SECONDS),
| ApplicationManager appManager = deployApplication(SparkPageRankApp.class);
StreamManager streamManager = getStreamManager("backlinkURLStream");
streamManager.send(URL_PAIR12);
streamManager.send(URL_PAIR13);
streamManager.send(URL_PAIR21);
streamManager.send(URL_PAIR31);
ServiceManager transformServiceManager =
appManager.getServiceManager(SparkPageRankApp.GOOGLE_TYPE_PR_SERVICE_NAME).start();
ServiceManager serviceManager = appManager.getServiceManager(SparkPageRankApp.RANKS_SERVICE_NAME).start();
SparkManager sparkManager = appManager.getSparkManager("SparkPageRankProgram").start();
|
17,776 | streamManager.send("hello world");
streamManager.send("a wonderful world");
streamManager.send("the world says hello");
RuntimeMetrics metrics = RuntimeStats.getFlowletMetrics("WordCount", "WordCounter", "associator");
metrics.waitForProcessed(3, 5, TimeUnit.SECONDS);
<BUG>ServiceManager serviceManager = appManager.getServiceManager(RetrieveCounts.SERVICE_NAME);
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
String response = requestService(new URL(serviceManager.getServiceURL(15, TimeUnit.SECONDS), "stats"));
| ServiceManager serviceManager = appManager.getServiceManager(RetrieveCounts.SERVICE_NAME).start();
|
17,777 | import java.util.concurrent.TimeUnit;
public class HelloWorldTest extends TestBase {
@Test
public void test() throws Exception {
ApplicationManager appManager = deployApplication(HelloWorld.class);
<BUG>FlowManager flowManager = appManager.getFlowManager("WhoFlow");
flowManager.start();</BUG>
Assert.assertTrue(flowManager.isRunning());
StreamManager streamManager = getStreamManager("who");
| FlowManager flowManager = appManager.getFlowManager("WhoFlow").start();
|
17,778 | metrics.waitForProcessed(5, 5, TimeUnit.SECONDS);
} finally {
flowManager.stop();
Assert.assertFalse(flowManager.isRunning());
}
<BUG>ServiceManager serviceManager = appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME);
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
URL url = new URL(serviceManager.getServiceURL(15, TimeUnit.SECONDS), "greet");
| ServiceManager serviceManager = appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME).start();
|
17,779 | @Test
public void testSparkWithService() throws Exception {
ApplicationManager applicationManager = deployApplication(TestSparkServiceIntegrationApp.class);
startService(applicationManager);
SparkManager sparkManager = applicationManager.getSparkManager(
<BUG>TestSparkServiceIntegrationApp.SparkServiceProgram.class.getSimpleName());
sparkManager.start();</BUG>
sparkManager.waitForFinish(120, TimeUnit.SECONDS);
DataSetManager<KeyValueTable> datasetManager = applicationManager.getDataSet("result");
| TestSparkServiceIntegrationApp.SparkServiceProgram.class.getSimpleName()).start();
|
17,780 | public class MapReduceServiceIntegrationTestRun extends TestFrameworkTestBase {
@Test
public void test() throws Exception {
ApplicationManager applicationManager = deployApplication(TestMapReduceServiceIntegrationApp.class);
ServiceManager serviceManager =
<BUG>applicationManager.getServiceManager(TestMapReduceServiceIntegrationApp.SERVICE_NAME);
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
DataSetManager<MyKeyValueTableDefinition.KeyValueTable> inDataSet =
| applicationManager.getServiceManager(TestMapReduceServiceIntegrationApp.SERVICE_NAME).start();
|
17,781 | serviceManager.waitForStatus(true);
DataSetManager<MyKeyValueTableDefinition.KeyValueTable> inDataSet =
applicationManager.getDataSet(TestMapReduceServiceIntegrationApp.INPUT_DATASET);
inDataSet.get().write("key1", "Two words");
inDataSet.get().write("key2", "Plus three words");
<BUG>inDataSet.flush();
MapReduceManager mrManager = applicationManager.getMapReduceManager(TestMapReduceServiceIntegrationApp.MR_NAME);
mrManager.start();</BUG>
mrManager.waitForFinish(180, TimeUnit.SECONDS);
| MapReduceManager mrManager =
applicationManager.getMapReduceManager(TestMapReduceServiceIntegrationApp.MR_NAME).start();
|
17,782 | TransactionSystemClient txSystemClient,
StreamWriterFactory streamWriterFactory,
DiscoveryServiceClient discoveryServiceClient,
TemporaryFolder tempFolder,
AppFabricClient appFabricClient,
<BUG>@Assisted("application") Id.Application application,
</BUG>
@Assisted Location deployedJar) {
super(application);
this.streamWriterFactory = streamWriterFactory;
| @Assisted("applicationId") Id.Application application,
|
17,783 | ApplicationManager applicationManager = deployApplication(TestSparkStreamIntegrationApp.class);
StreamManager streamManager = getStreamManager("testStream");
for (int i = 0; i < 50; i++) {
streamManager.send(String.valueOf(i));
}
<BUG>SparkManager sparkManager = applicationManager.getSparkManager("SparkStreamProgram");
sparkManager.start();</BUG>
sparkManager.waitForFinish(120, TimeUnit.SECONDS);
DataSetManager<KeyValueTable> datasetManager = applicationManager.getDataSet("result");
| SparkManager sparkManager = applicationManager.getSparkManager("SparkStreamProgram").start();
|
17,784 | @Category(XSlowTests.class)
public class SparkMetricsIntegrationTestRun extends TestFrameworkTestBase {
public static final String METRICS_KEY = "system.driver.BlockManager.memory.remainingMem_MB";
@Test
public void testSparkMetrics() throws Exception {
<BUG>ApplicationManager applicationManager = deployApplication(TestSparkMetricsIntegrationApp.class);
SparkManager sparkManager = applicationManager.getSparkManager(TestSparkMetricsIntegrationApp.APP_SPARK_NAME);
sparkManager.start();</BUG>
sparkManager.waitForFinish(120, TimeUnit.SECONDS);
| SparkManager sparkManager =
applicationManager.getSparkManager(TestSparkMetricsIntegrationApp.APP_SPARK_NAME).start();
|
17,785 | @Test
public void testWordCountOnFileSet() throws Exception {
ApplicationManager applicationManager = deployApplication(FileSetExample.class);
final String line1 = "a b a";
final String line2 = "b a b";
<BUG>ServiceManager serviceManager = applicationManager.getServiceManager("FileSetService");
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
URL serviceURL = serviceManager.getServiceURL();
| ServiceManager serviceManager = applicationManager.getServiceManager("FileSetService").start();
|
17,786 | FileSetArguments.setInputPaths(inputArgs, "nn.1");
Map<String, String> outputArgs = Maps.newHashMap();
FileSetArguments.setOutputPath(outputArgs, "out.1");
runtimeArguments.putAll(RuntimeArguments.addScope(Scope.DATASET, "lines", inputArgs));
runtimeArguments.putAll(RuntimeArguments.addScope(Scope.DATASET, "counts", outputArgs));
<BUG>MapReduceManager mapReduceManager = applicationManager.getMapReduceManager("WordCount");
mapReduceManager.start(runtimeArguments);</BUG>
mapReduceManager.waitForFinish(5, TimeUnit.MINUTES);
Map<String, Integer> counts = Maps.newHashMap();
| MapReduceManager mapReduceManager = applicationManager.getMapReduceManager("WordCount").start(runtimeArguments);
|
17,787 | FileSetArguments.setInputPath(inputArgs, "nn.1");
FileSetArguments.addInputPath(inputArgs, "nn.2");
FileSetArguments.setOutputPath(outputArgs, "out.2");
runtimeArguments.putAll(RuntimeArguments.addScope(Scope.DATASET, "lines", inputArgs));
runtimeArguments.putAll(RuntimeArguments.addScope(Scope.DATASET, "counts", outputArgs));
<BUG>mapReduceManager = applicationManager.getMapReduceManager("WordCount");
mapReduceManager.start(runtimeArguments);</BUG>
mapReduceManager.waitForFinish(5, TimeUnit.MINUTES);
DataSetManager<FileSet> countsManager = getDataset("counts");
| mapReduceManager = applicationManager.getMapReduceManager("WordCount").start(runtimeArguments);
|
17,788 | import java.util.concurrent.TimeUnit;
public class SparkKMeansAppTest extends TestBase {
@Test
public void test() throws Exception {
ApplicationManager appManager = deployApplication(SparkKMeansApp.class);
<BUG>FlowManager flowManager = appManager.getFlowManager("PointsFlow");
flowManager.start();</BUG>
StreamManager streamManager = getStreamManager("pointsStream");
streamManager.send("10.6 519.2 110.3");
| FlowManager flowManager = appManager.getFlowManager("PointsFlow").start();
|
17,789 |
sparkManager.start();</BUG>
sparkManager.waitForFinish(60, TimeUnit.SECONDS);
flowManager.stop();
<BUG>ServiceManager serviceManager = appManager.getServiceManager(SparkKMeansApp.CentersService.SERVICE_NAME);
serviceManager.start();</BUG>
serviceManager.waitForStatus(true);
String response = requestService(new URL(serviceManager.getServiceURL(15, TimeUnit.SECONDS), "centers/1"));
String[] coordinates = response.split(",");
| streamManager.send("10.6 519.6 109.9");
streamManager.send("10.6 517.9 108.9");
streamManager.send("10.7 518 109.2");
RuntimeMetrics metrics = RuntimeStats.getFlowletMetrics("SparkKMeans", "PointsFlow", "reader");
metrics.waitForProcessed(3, 5, TimeUnit.SECONDS);
SparkManager sparkManager = appManager.getSparkManager("SparkKMeansProgram").start();
ServiceManager serviceManager = appManager.getServiceManager(SparkKMeansApp.CentersService.SERVICE_NAME).start();
|
17,790 | ApplicationManager applicationManager = deployApplication(appClass);
StreamManager streamManager = getStreamManager(streamWriter);
for (int i = 0; i < 50; i++) {
streamManager.send(String.valueOf(i));
}
<BUG>MapReduceManager mapReduceManager = applicationManager.getMapReduceManager(mapReduceName);
mapReduceManager.start();</BUG>
mapReduceManager.waitForFinish(timeout, TimeUnit.SECONDS);
DataSetManager<KeyValueTable> datasetManager = applicationManager.getDataSet("results");
| MapReduceManager mapReduceManager = applicationManager.getMapReduceManager(mapReduceName).start();
|
17,791 | streamManager.send(createEvent(schema, "AAPL", 5, 300.0f));
streamManager.send(createEvent(schema, "AAPL", 3, 298.34f));
streamManager.send(createEvent(schema, "AAPL", 50, 305.23f));
streamManager.send(createEvent(schema, "AAPL", 1000, 284.13f));
float aaplTotal = 5 * 300.0f + 3 * 298.34f + 50 * 305.23f + 1000 * 284.13f;
<BUG>MapReduceManager mrManager = applicationManager.getMapReduceManager("BodyTracker");
mrManager.start();</BUG>
mrManager.waitForFinish(180, TimeUnit.SECONDS);
KeyValueTable pricesDS = (KeyValueTable) getDataset("prices").get();
| MapReduceManager mrManager = applicationManager.getMapReduceManager("BodyTracker").start();
|
17,792 | StreamManager streamManager = getStreamManager("events");
streamManager.send("15");
streamManager.send("16");
streamManager.send("17");
final long startTime = System.currentTimeMillis();
<BUG>MapReduceManager mapReduceManager = appManager.getMapReduceManager("StreamConversionMapReduce");
mapReduceManager.start(RuntimeArguments.NO_ARGUMENTS);
mapReduceManager.waitForFinish(5, TimeUnit.MINUTES);</BUG>
long partitionTime = assertWithRetry(new Callable<Long>() {
@Override
| MapReduceManager mapReduceManager =
appManager.getMapReduceManager("StreamConversionMapReduce").start(RuntimeArguments.NO_ARGUMENTS);
mapReduceManager.waitForFinish(5, TimeUnit.MINUTES);
|
17,793 | 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 PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
17,794 | 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;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
17,795 | 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"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
17,796 | 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_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
17,797 | 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, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
17,798 | 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>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
17,799 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
| import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
17,800 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.