conflict_resolution
stringlengths
27
16k
<<<<<<< import buildcraft.transport.plug.FacadeStateManager.FacadeBlockStateInfo; import buildcraft.transport.plug.FacadeStateManager.FullFacadeInstance; import buildcraft.transport.tile.TileFilteredBuffer; import buildcraft.transport.tile.TilePipeHolder; ======= >>>>>>> import buildcraft.transport.plug.FacadeStateManager.FacadeBlockStateInfo; import buildcraft.transport.plug.FacadeStateManager.FullFacadeInstance; import buildcraft.transport.tile.TileFilteredBuffer; import buildcraft.transport.tile.TilePipeHolder; <<<<<<< FullFacadeInstance inst = FullFacadeInstance.createSingle(state, false); tabFacades.setItem(BCTransportItems.PLUG_FACADE.createItemStack(inst)); ======= FacadeInstance inst = FacadeInstance.createSingle(state, false); tabFacades.setItem(BCTransportItems.plugFacade.createItemStack(inst)); >>>>>>> FacadeInstance inst = FacadeInstance.createSingle(state, false); tabFacades.setItem(BCTransportItems.PLUG_FACADE.createItemStack(inst));
<<<<<<< import java.util.Collections; import java.util.LinkedList; import java.util.List; import net.minecraft.util.ResourceLocation; import buildcraft.api.core.render.ISprite; import buildcraft.api.filler.FillerManager; import buildcraft.api.filler.IFillerPattern; import buildcraft.api.statements.IStatementContainer; import buildcraft.lib.client.sprite.SpriteAtlas; ======= import net.minecraft.util.ResourceLocation; import buildcraft.lib.gui.GuiBC8; >>>>>>> import java.util.Collections; import java.util.LinkedList; import java.util.List; import net.minecraft.util.ResourceLocation; import buildcraft.api.core.render.ISprite; import buildcraft.api.filler.FillerManager; import buildcraft.api.filler.IFillerPattern; import buildcraft.api.statements.IStatementContainer; <<<<<<< import buildcraft.lib.gui.pos.GuiRectangle; import buildcraft.lib.gui.statement.GuiStatementSelector; import buildcraft.lib.misc.GuiUtil; import buildcraft.builders.container.ContainerFiller; import buildcraft.core.builders.patterns.PatternNone; ======= import buildcraft.builders.container.ContainerFiller; >>>>>>> import buildcraft.lib.gui.pos.GuiRectangle; import buildcraft.lib.gui.statement.GuiStatementSelector; import buildcraft.lib.misc.GuiUtil; import buildcraft.builders.container.ContainerFiller; import buildcraft.core.builders.patterns.PatternNone; <<<<<<< IFillerPattern patternNone = null; for (IFillerPattern pattern : FillerManager.registry.getPatterns()) { if (pattern instanceof PatternNone && patternNone == null) { patternNone = pattern; continue; } possible.add(new FillerWrapper(pattern)); } Collections.sort(possible); if (patternNone != null) { possible.add(0, new FillerWrapper(patternNone)); } } @Override protected boolean shouldAddHelpLedger() { return false; ======= ledgersRight.ledgers.add(new LedgerCounters(ledgersRight, container.tile)); >>>>>>> IFillerPattern patternNone = null; for (IFillerPattern pattern : FillerManager.registry.getPatterns()) { if (pattern instanceof PatternNone && patternNone == null) { patternNone = pattern; continue; } possible.add(new FillerWrapper(pattern)); } Collections.sort(possible); if (patternNone != null) { possible.add(0, new FillerWrapper(patternNone)); } } @Override protected boolean shouldAddHelpLedger() { return false;
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public BlockConstructionMarker() {} ======= public BlockConstructionMarker() { } >>>>>>> public BlockConstructionMarker() {} <<<<<<< @Override public void breakBlock(World world, BlockPos pos, IBlockState state) { Utils.preDestroyBlock(world, pos); TileConstructionMarker marker = (TileConstructionMarker) world.getTileEntity(pos); if (marker != null && marker.itemBlueprint != null && !world.isRemote) { float f1 = 0.7F; double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D; EntityItem itemToDrop = new EntityItem(world, pos.getX() + d, pos.getY() + d1, pos.getZ() + d2, marker.itemBlueprint); itemToDrop.setDefaultPickupDelay(); world.spawnEntityInWorld(itemToDrop); } super.breakBlock(world, pos, state); } ======= @Override public void breakBlock(World world, int x, int y, int z, Block block, int par6) { Utils.preDestroyBlock(world, x, y, z); dropMarkerIfPresent(world, x, y, z, true); super.breakBlock(world, x, y, z, block, par6); } private boolean dropMarkerIfPresent(World world, int x, int y, int z, boolean onBreak) { TileConstructionMarker marker = (TileConstructionMarker) world.getTileEntity(x, y, z); if (marker != null && marker.itemBlueprint != null && !world.isRemote) { BlockUtils.dropItem((WorldServer) world, x, y, z, 6000, marker.itemBlueprint); marker.itemBlueprint = null; if (!onBreak) { marker.bluePrintBuilder = null; marker.bptContext = null; marker.sendNetworkUpdate(); } return true; } return false; } >>>>>>> @Override public void breakBlock(World world, BlockPos pos, IBlockState state) { Utils.preDestroyBlock(world, pos); dropMarkerIfPresent(world, pos, true); super.breakBlock(world, pos, state); } private boolean dropMarkerIfPresent(World world, BlockPos pos, boolean onBreak) { TileConstructionMarker marker = (TileConstructionMarker) world.getTileEntity(pos); if (marker != null && marker.itemBlueprint != null && !world.isRemote) { BlockUtils.dropItem((WorldServer) world, pos, 6000, marker.itemBlueprint); marker.itemBlueprint = null; if (!onBreak) { marker.bluePrintBuilder = null; marker.bptContext = null; marker.sendNetworkUpdate(); } return true; } return false; } <<<<<<< @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing face, float hitX, float hitY, float hitZ) { if (super.onBlockActivated(world, pos, state, entityplayer, face, hitX, hitY, hitZ)) { return true; } ======= @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { if (super.onBlockActivated(world, x, y, z, entityplayer, par6, par7, par8, par9)) { return true; } >>>>>>> @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing face, float hitX, float hitY, float hitZ) { if (super.onBlockActivated(world, pos, state, entityplayer, face, hitX, hitY, hitZ)) { return true; } <<<<<<< return true; } } else if (equipped instanceof ItemConstructionMarker) { if (ItemConstructionMarker.linkStarted(entityplayer.getCurrentEquippedItem())) { ItemConstructionMarker.link(entityplayer.getCurrentEquippedItem(), world, pos); return true; } } ======= return true; } } else if (equipped instanceof ItemConstructionMarker) { if (ItemConstructionMarker.linkStarted(entityplayer.getCurrentEquippedItem())) { ItemConstructionMarker.link(entityplayer.getCurrentEquippedItem(), world, x, y, z); return true; } } else if ((equipped == null || equipped instanceof IToolWrench) && entityplayer.isSneaking()) { return dropMarkerIfPresent(world, x, y, z, false); } >>>>>>> return true; } } else if (equipped instanceof ItemConstructionMarker) { if (ItemConstructionMarker.linkStarted(entityplayer.getCurrentEquippedItem())) { ItemConstructionMarker.link(entityplayer.getCurrentEquippedItem(), world, pos); return true; } } else if ((equipped == null || equipped instanceof IToolWrench) && entityplayer.isSneaking()) { return dropMarkerIfPresent(world, pos, false); }
<<<<<<< public static final BCRegistry INSTANCE = new BCRegistry(); private Configuration regCfg; private BCRegistry() { } public boolean isEnabled(String category, String name) { return regCfg.get(category, name, true).getBoolean(); } public void setRegistryConfig(File f) { regCfg = new Configuration(f); } public boolean registerBlock(Block block, boolean forced) { return registerBlock(block, ItemBlockBuildCraft.class, forced); } public boolean registerBlock(Block block, Class<? extends ItemBlock> item, boolean forced) { String name = block.getUnlocalizedName().replace("tile.", ""); if (forced || regCfg.get("blocks", name, true).getBoolean()) { GameRegistry.registerBlock(block, item, name); return true; } return false; } public boolean registerItem(Item item, boolean forced) { String name = item.getUnlocalizedName().replace("item.", ""); if (forced || regCfg.get("items", name, true).getBoolean()) { GameRegistry.registerItem(item, name); return true; } return false; } @SuppressWarnings({ "rawtypes", "unchecked" }) public void registerTileEntity(Class clas, String... ident) { GameRegistry.registerTileEntityWithAlternatives(CompatHooks.INSTANCE.getTile(clas), ident[0], ident); } public void addCraftingRecipe(ItemStack result, Object... recipe) { for (Object o : recipe) { if (o == null) { return; } if (o instanceof Block && !Utils.isRegistered((Block) o)) { return; } if (o instanceof Item && !Utils.isRegistered((Item) o)) { return; } if (o instanceof ItemStack && !Utils.isRegistered((ItemStack) o)) { return; } } GameRegistry.addRecipe(new ShapedOreRecipe(result, recipe)); } public void addShapelessRecipe(ItemStack result, Object... recipe) { for (Object o : recipe) { if (o instanceof Block && Block.getIdFromBlock((Block) o) < 0) { return; } if (o instanceof Item && Item.getIdFromItem((Item) o) < 0) { return; } if (o instanceof ItemStack && ((ItemStack) o).getItem() == null) { return; } } GameRegistry.addRecipe(new ShapelessOreRecipe(result, recipe)); } public void save() { regCfg.save(); } ======= public static final BCRegistry INSTANCE = new BCRegistry(); private Configuration regCfg; private BCRegistry() { } public boolean isEnabled(String category, String name) { return regCfg.get(category, name, true).getBoolean(); } public void setRegistryConfig(File f) { regCfg = new Configuration(f); } public boolean registerBlock(Block block, boolean forced) { return registerBlock(block, ItemBlockBuildCraft.class, forced); } public boolean registerBlock(Block block, Class<? extends ItemBlock> item, boolean forced) { String name = block.getUnlocalizedName().replace("tile.", ""); if (forced || regCfg.get("blocks", name, true).getBoolean()) { GameRegistry.registerBlock(block, item, name); return true; } return false; } public boolean registerItem(Item item, boolean forced) { String name = item.getUnlocalizedName().replace("item.", ""); if (forced || regCfg.get("items", name, true).getBoolean()) { GameRegistry.registerItem(item, name); return true; } return false; } private boolean isInvalidRecipeElement(Object o) { if (o == null) { return true; } if (o instanceof Block && !Utils.isRegistered((Block) o)) { return true; } if (o instanceof Item && !Utils.isRegistered((Item) o)) { return true; } if (o instanceof ItemStack && !Utils.isRegistered((ItemStack) o)) { return true; } return false; } @SuppressWarnings({"rawtypes", "unchecked"}) public void registerTileEntity(Class clas, String ident) { GameRegistry.registerTileEntity(CompatHooks.INSTANCE.getTile(clas), ident); } public void addCraftingRecipe(ItemStack result, Object... recipe) { if (isInvalidRecipeElement(result)) { return; } for (Object o : recipe) { if (isInvalidRecipeElement(o)) { return; } } GameRegistry.addRecipe(new ShapedOreRecipe(result, recipe)); } public void addShapelessRecipe(ItemStack result, Object... recipe) { if (isInvalidRecipeElement(result)) { return; } for (Object o : recipe) { if (isInvalidRecipeElement(o)) { return; } } GameRegistry.addRecipe(new ShapelessOreRecipe(result, recipe)); } public void save() { regCfg.save(); } >>>>>>> public static final BCRegistry INSTANCE = new BCRegistry(); private Configuration regCfg; private BCRegistry() { } public boolean isEnabled(String category, String name) { return regCfg.get(category, name, true).getBoolean(); } public void setRegistryConfig(File f) { regCfg = new Configuration(f); } public boolean registerBlock(Block block, boolean forced) { return registerBlock(block, ItemBlockBuildCraft.class, forced); } public boolean registerBlock(Block block, Class<? extends ItemBlock> item, boolean forced) { String name = block.getUnlocalizedName().replace("tile.", ""); if (forced || regCfg.get("blocks", name, true).getBoolean()) { GameRegistry.registerBlock(block, item, name); return true; } return false; } public boolean registerItem(Item item, boolean forced) { String name = item.getUnlocalizedName().replace("item.", ""); if (forced || regCfg.get("items", name, true).getBoolean()) { GameRegistry.registerItem(item, name); return true; } return false; } @SuppressWarnings({ "rawtypes", "unchecked" }) public void registerTileEntity(Class clas, String... ident) { GameRegistry.registerTileEntityWithAlternatives(CompatHooks.INSTANCE.getTile(clas), ident[0], ident); } private boolean isInvalidRecipeElement(Object o) { if (o == null) { return true; } if (o instanceof Block && !Utils.isRegistered((Block) o)) { return true; } if (o instanceof Item && !Utils.isRegistered((Item) o)) { return true; } if (o instanceof ItemStack && !Utils.isRegistered((ItemStack) o)) { return true; } return false; } public void addCraftingRecipe(ItemStack result, Object... recipe) { if (isInvalidRecipeElement(result)) { return; } for (Object o : recipe) { if (isInvalidRecipeElement(o)) { return; } } GameRegistry.addRecipe(new ShapedOreRecipe(result, recipe)); } public void addShapelessRecipe(ItemStack result, Object... recipe) { if (isInvalidRecipeElement(result)) { return; } for (Object o : recipe) { if (isInvalidRecipeElement(o)) { return; } } GameRegistry.addRecipe(new ShapelessOreRecipe(result, recipe)); } public void save() { regCfg.save(); }
<<<<<<< /* * Copyright (c) 2017 SpaceToad and the BuildCraft team ======= /* * Copyright (c) 2016 SpaceToad and the BuildCraft team * >>>>>>> /* * Copyright (c) 2017 SpaceToad and the BuildCraft team <<<<<<< ======= public static void preInit() { EnumSpring.OIL.liquidBlock = BCEnergyFluids.crudeOil[0].getBlock().getDefaultState(); EnumSpring.OIL.tileConstructor = TileSpringOil::new; TileBC_Neptune.registerTile(TileSpringOil.class, "tile.spring.oil"); if (BCCoreBlocks.engine != null) { TileBC_Neptune.registerTile(TileEngineStone_BC8.class, "tile.engine.stone"); BCCoreBlocks.engine.registerEngine(EnumEngineType.STONE, TileEngineStone_BC8::new); >>>>>>>
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public static int PATH_ITERATIONS = 1000; private static HashMap<Integer, HashSet<BlockPos>> reservations = new HashMap<Integer, HashSet<BlockPos>>(); private World world; private BlockPos start; private List<PathFinding> pathFinders; private IBlockFilter pathFound; private IZone zone; private float maxDistance; private Iterator<BlockPos> blockIter; private double maxDistanceToEnd; public PathFindingSearch(World iWorld, BlockPos iStart, Iterator<BlockPos> iBlockIter, IBlockFilter iPathFound, double iMaxDistanceToEnd, float iMaxDistance, IZone iZone) { world = iWorld; start = iStart; pathFound = iPathFound; maxDistance = iMaxDistance; maxDistanceToEnd = iMaxDistanceToEnd; zone = iZone; blockIter = iBlockIter; pathFinders = new LinkedList<PathFinding>(); } @Override public void iterate() { if (pathFinders.size() < 5 && blockIter.hasNext()) { iterateSearch(PATH_ITERATIONS * 10); } iteratePathFind(PATH_ITERATIONS); } private void iterateSearch(int itNumber) { for (int i = 0; i < itNumber; ++i) { if (!blockIter.hasNext()) { return; } BlockPos delta = blockIter.next(); BlockPos block = new BlockPos(start.getX() + delta.getX(), ((start.getY() + delta.getY()) > 0) ? start.getY() + delta.getY() : 0, start .getZ() + delta.getZ()); if (isLoadedChunk(block.getX(), block.getZ())) { if (isTarget(block)) { pathFinders.add(new PathFinding(world, start, block, maxDistanceToEnd, maxDistance)); } } if (pathFinders.size() >= 5) { return; } } } private boolean isTarget(BlockPos block) { if (zone != null && !zone.contains(Utils.convert(block))) { return false; } if (!pathFound.matches(world, block)) { return false; } synchronized (reservations) { if (reservations.containsKey(world.provider.getDimensionId())) { HashSet<BlockPos> dimReservations = reservations.get(world.provider.getDimensionId()); if (dimReservations.contains(block)) { return false; } } } if (!BuildCraftAPI.isSoftBlock(world, block.west()) && !BuildCraftAPI.isSoftBlock(world, block.east()) && !BuildCraftAPI.isSoftBlock(world, block.north()) && !BuildCraftAPI.isSoftBlock(world, block.south()) && !BuildCraftAPI.isSoftBlock(world, block.down()) && !BuildCraftAPI.isSoftBlock(world, block.up())) { return false; } return true; } private boolean isLoadedChunk(int x, int z) { return world.getChunkProvider().chunkExists(x >> 4, z >> 4); } public void iteratePathFind(int itNumber) { for (PathFinding pathFinding : new ArrayList<PathFinding>(pathFinders)) { pathFinding.iterate(itNumber / pathFinders.size()); if (pathFinding.isDone()) { LinkedList<BlockPos> path = pathFinding.getResult(); if (path != null && path.size() > 0) { if (reserve(path.getLast())) { return; } } pathFinders.remove(pathFinding); } } } @Override public boolean isDone() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return true; } } return !blockIter.hasNext(); } public LinkedList<BlockPos> getResult() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.getResult(); } } return new LinkedList<BlockPos>(); } public BlockPos getResultTarget() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.end(); } } return null; } private boolean reserve(BlockPos block) { synchronized (reservations) { if (!reservations.containsKey(world.provider.getDimensionId())) { reservations.put(world.provider.getDimensionId(), new HashSet<BlockPos>()); } HashSet<BlockPos> dimReservations = reservations.get(world.provider.getDimensionId()); if (dimReservations.contains(block)) { return false; } dimReservations.add(block); return true; } } public void unreserve(BlockPos block) { synchronized (reservations) { if (reservations.containsKey(world.provider.getDimensionId())) { reservations.get(world.provider.getDimensionId()).remove(block); } } } ======= public static final int PATH_ITERATIONS = 1000; private static final HashMap<Integer, HashSet<BlockIndex>> reservations = new HashMap<Integer, HashSet<BlockIndex>>(); private World world; private BlockIndex start; private List<PathFinding> pathFinders; private IBlockFilter pathFound; private IZone zone; private float maxDistance; private Iterator<BlockIndex> blockIter; private double maxDistanceToEnd; public PathFindingSearch(World iWorld, BlockIndex iStart, Iterator<BlockIndex> iBlockIter, IBlockFilter iPathFound, double iMaxDistanceToEnd, float iMaxDistance, IZone iZone) { world = iWorld; start = iStart; pathFound = iPathFound; maxDistance = iMaxDistance; maxDistanceToEnd = iMaxDistanceToEnd; zone = iZone; blockIter = iBlockIter; pathFinders = new LinkedList<PathFinding>(); } @Override public void iterate() { if (pathFinders.size() < 5 && blockIter.hasNext()) { iterateSearch(PATH_ITERATIONS * 10); } iteratePathFind(PATH_ITERATIONS); } private void iterateSearch(int itNumber) { for (int i = 0; i < itNumber; ++i) { if (!blockIter.hasNext()) { return; } BlockIndex delta = blockIter.next(); BlockIndex block = new BlockIndex(start.x + delta.x, ((start.y + delta.y) > 0) ? start.y + delta.y : 0, start.z + delta.z); if (isLoadedChunk(block.x, block.z)) { if (isTarget(block)) { pathFinders.add(new PathFinding(world, start, block, maxDistanceToEnd, maxDistance)); } } if (pathFinders.size() >= 5) { return; } } } private boolean isTarget(BlockIndex block) { if (zone != null && !zone.contains(block.x, block.y, block.z)) { return false; } if (!pathFound.matches(world, block.x, block.y, block.z)) { return false; } synchronized (reservations) { if (reservations.containsKey(world.provider.dimensionId)) { HashSet<BlockIndex> dimReservations = reservations .get(world.provider.dimensionId); if (dimReservations.contains(block)) { return false; } } } if (!BuildCraftAPI.isSoftBlock(world, block.x - 1, block.y, block.z) && !BuildCraftAPI.isSoftBlock(world, block.x + 1, block.y, block.z) && !BuildCraftAPI.isSoftBlock(world, block.x, block.y, block.z - 1) && !BuildCraftAPI.isSoftBlock(world, block.x, block.y, block.z + 1) && !BuildCraftAPI.isSoftBlock(world, block.x, block.y - 1, block.z) && !BuildCraftAPI.isSoftBlock(world, block.x, block.y + 1, block.z)) { return false; } return true; } private boolean isLoadedChunk(int x, int z) { return world.getChunkProvider().chunkExists(x >> 4, z >> 4); } public void iteratePathFind(int itNumber) { for (PathFinding pathFinding : new ArrayList<PathFinding>(pathFinders)) { pathFinding.iterate(itNumber / pathFinders.size()); if (pathFinding.isDone()) { LinkedList<BlockIndex> path = pathFinding.getResult(); if (path != null && path.size() > 0) { if (reserve(pathFinding.end())) { return; } } pathFinders.remove(pathFinding); } } } @Override public boolean isDone() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return true; } } return !blockIter.hasNext(); } public LinkedList<BlockIndex> getResult() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.getResult(); } } return new LinkedList<BlockIndex>(); } public BlockIndex getResultTarget() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.end(); } } return null; } private boolean reserve(BlockIndex block) { synchronized (reservations) { if (!reservations.containsKey(world.provider.dimensionId)) { reservations.put(world.provider.dimensionId, new HashSet<BlockIndex>()); } HashSet<BlockIndex> dimReservations = reservations .get(world.provider.dimensionId); if (dimReservations.contains(block)) { return false; } dimReservations.add(block); return true; } } public void unreserve(BlockIndex block) { synchronized (reservations) { if (reservations.containsKey(world.provider.dimensionId)) { reservations.get(world.provider.dimensionId).remove(block); } } } >>>>>>> public static final int PATH_ITERATIONS = 1000; private static final HashMap<Integer, HashSet<BlockPos>> reservations = new HashMap<Integer, HashSet<BlockPos>>(); private World world; private BlockPos start; private List<PathFinding> pathFinders; private IBlockFilter pathFound; private IZone zone; private float maxDistance; private Iterator<BlockPos> blockIter; private double maxDistanceToEnd; public PathFindingSearch(World iWorld, BlockPos iStart, Iterator<BlockPos> iBlockIter, IBlockFilter iPathFound, double iMaxDistanceToEnd, float iMaxDistance, IZone iZone) { world = iWorld; start = iStart; pathFound = iPathFound; maxDistance = iMaxDistance; maxDistanceToEnd = iMaxDistanceToEnd; zone = iZone; blockIter = iBlockIter; pathFinders = new LinkedList<PathFinding>(); } @Override public void iterate() { if (pathFinders.size() < 5 && blockIter.hasNext()) { iterateSearch(PATH_ITERATIONS * 10); } iteratePathFind(PATH_ITERATIONS); } private void iterateSearch(int itNumber) { for (int i = 0; i < itNumber; ++i) { if (!blockIter.hasNext()) { return; } BlockPos delta = blockIter.next(); BlockPos block = new BlockPos(start.getX() + delta.getX(), ((start.getY() + delta.getY()) > 0) ? start.getY() + delta.getY() : 0, start .getZ() + delta.getZ()); if (isLoadedChunk(block.getX(), block.getZ())) { if (isTarget(block)) { pathFinders.add(new PathFinding(world, start, block, maxDistanceToEnd, maxDistance)); } } if (pathFinders.size() >= 5) { return; } } } private boolean isTarget(BlockPos block) { if (zone != null && !zone.contains(Utils.convert(block))) { return false; } if (!pathFound.matches(world, block)) { return false; } synchronized (reservations) { if (reservations.containsKey(world.provider.getDimensionId())) { HashSet<BlockPos> dimReservations = reservations.get(world.provider.getDimensionId()); if (dimReservations.contains(block)) { return false; } } } if (!BuildCraftAPI.isSoftBlock(world, block.west()) && !BuildCraftAPI.isSoftBlock(world, block.east()) && !BuildCraftAPI.isSoftBlock(world, block.north()) && !BuildCraftAPI.isSoftBlock(world, block.south()) && !BuildCraftAPI.isSoftBlock(world, block.down()) && !BuildCraftAPI.isSoftBlock(world, block.up())) { return false; } return true; } private boolean isLoadedChunk(int x, int z) { return world.getChunkProvider().chunkExists(x >> 4, z >> 4); } public void iteratePathFind(int itNumber) { for (PathFinding pathFinding : new ArrayList<PathFinding>(pathFinders)) { pathFinding.iterate(itNumber / pathFinders.size()); if (pathFinding.isDone()) { LinkedList<BlockPos> path = pathFinding.getResult(); if (path != null && path.size() > 0) { if (reserve(pathFinding.end())) { return; } } pathFinders.remove(pathFinding); } } } @Override public boolean isDone() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return true; } } return !blockIter.hasNext(); } public LinkedList<BlockPos> getResult() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.getResult(); } } return new LinkedList<BlockPos>(); } public BlockPos getResultTarget() { for (PathFinding pathFinding : pathFinders) { if (pathFinding.isDone()) { return pathFinding.end(); } } return null; } private boolean reserve(BlockPos block) { synchronized (reservations) { if (!reservations.containsKey(world.provider.getDimensionId())) { reservations.put(world.provider.getDimensionId(), new HashSet<BlockPos>()); } HashSet<BlockPos> dimReservations = reservations.get(world.provider.getDimensionId()); if (dimReservations.contains(block)) { return false; } dimReservations.add(block); return true; } } public void unreserve(BlockPos block) { synchronized (reservations) { if (reservations.containsKey(world.provider.getDimensionId())) { reservations.get(world.provider.getDimensionId()).remove(block); } } }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */
<<<<<<< import buildcraft.api.core.IAreaProvider; import buildcraft.api.core.INetworkLoadable_BC8; import buildcraft.api.power.IEngine; import buildcraft.api.tiles.ITileAreaProvider; import buildcraft.api.transport.IInjectable; import buildcraft.api.transport.IPipeTile; import buildcraft.core.*; import buildcraft.core.internal.IDropControlInventory; import buildcraft.core.lib.block.TileBuildCraft; import buildcraft.core.lib.inventory.ITransactor; import buildcraft.core.lib.inventory.InvUtils; import buildcraft.core.lib.inventory.Transactor; import com.google.common.collect.AbstractIterator; ======= import java.util.*; import javax.vecmath.Matrix3d; import javax.vecmath.Vector3f; >>>>>>> import buildcraft.api.core.IAreaProvider; import buildcraft.api.power.IEngine; import buildcraft.api.tiles.ITileAreaProvider; import buildcraft.api.transport.IInjectable; import buildcraft.api.transport.IPipeTile; import buildcraft.core.*; import buildcraft.core.internal.IDropControlInventory; import buildcraft.core.lib.block.TileBuildCraft; import buildcraft.core.lib.inventory.ITransactor; import buildcraft.core.lib.inventory.InvUtils; import buildcraft.core.lib.inventory.Transactor; import buildcraft.lib.misc.data.AxisOrder; import buildcraft.lib.misc.data.BoxIterable; <<<<<<< import io.netty.buffer.ByteBuf; ======= >>>>>>> <<<<<<< import javax.vecmath.Matrix3d; import javax.vecmath.Vector3f; import java.util.*; ======= import buildcraft.api.core.IAreaProvider; import buildcraft.api.power.IEngine; import buildcraft.api.tiles.ITileAreaProvider; import buildcraft.api.transport.IInjectable; import buildcraft.api.transport.IPipeTile; import buildcraft.core.*; import buildcraft.core.internal.IDropControlInventory; import buildcraft.core.lib.block.TileBuildCraft; import buildcraft.core.lib.inventory.ITransactor; import buildcraft.core.lib.inventory.InvUtils; import buildcraft.core.lib.inventory.Transactor; import buildcraft.lib.misc.VecUtil; import buildcraft.lib.misc.data.AxisOrder; import buildcraft.lib.misc.data.BoxIterable; >>>>>>> import javax.vecmath.Matrix3d; import javax.vecmath.Vector3f; import java.util.*; <<<<<<< public enum EnumAxisOrder { XYZ(0, 1, 2), XZY(0, 2, 1), YXZ(1, 0, 2), YZX(1, 2, 0), ZXY(2, 0, 1), ZYX(2, 1, 0); public final Axis first, second, third; public final AxisOrder defaultOrder; private EnumAxisOrder(int a, int b, int c) { this.first = Axis.values()[a]; this.second = Axis.values()[b]; this.third = Axis.values()[c]; this.defaultOrder = new AxisOrder(this, true, true, true); } } public static class AxisOrder implements INetworkLoadable_BC8<AxisOrder> { public final EnumFacing first, second, third; public AxisOrder() { first = second = third = null; } private AxisOrder(EnumFacing first, EnumFacing second, EnumFacing third) { this.first = first; this.second = second; this.third = third; } /** Creates an axis order that will scan axis in the order given, going in the directions specified by * positiveFirst, positiveSecond and positiveThird. If all are true then it will start at the smallest one and * end up at the biggest one. */ public AxisOrder(EnumAxisOrder order, boolean positiveFirst, boolean positiveSecond, boolean positiveThird) { this.first = getFacing(order.first, positiveFirst ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE); this.second = getFacing(order.second, positiveSecond ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE); this.third = getFacing(order.third, positiveThird ? AxisDirection.POSITIVE : AxisDirection.NEGATIVE); } @Override public String toString() { return first + ", " + second + ", " + third; } public AxisOrder invertFirst() { return new AxisOrder(first.getOpposite(), second, third); } public AxisOrder invertSecond() { return new AxisOrder(first, second.getOpposite(), third); } public AxisOrder invertThird() { return new AxisOrder(first, second, third.getOpposite()); } @Override public AxisOrder readFromByteBuf(ByteBuf buf) { return new AxisOrder(EnumFacing.values()[buf.readInt()], EnumFacing.values()[buf.readInt()], EnumFacing.values()[buf.readInt()]); } @Override public void writeToByteBuf(ByteBuf buf) { buf.writeInt(first.ordinal()); buf.writeInt(second.ordinal()); buf.writeInt(third.ordinal()); } public AxisOrder readFromNBT(NBTTagCompound tag) { if(tag == null) { return null; } return new AxisOrder(EnumFacing.values()[tag.getInteger("first")], EnumFacing.values()[tag.getInteger("second")], EnumFacing.values()[tag.getInteger("third")]); } public NBTTagCompound writeToNBT() { NBTTagCompound tag = new NBTTagCompound(); tag.setInteger("first", first.ordinal()); tag.setInteger("second", second.ordinal()); tag.setInteger("third", third.ordinal()); return tag; } } public static class BoxIterable implements Iterable<BlockPos> { private final BlockPos min, max; private final AxisOrder order; public BoxIterable(BlockPos min, BlockPos max, AxisOrder order) { this.min = min; this.max = max; this.order = order; } @Override public BoxIterator iterator() { return new BoxIterator(min, max, order); } } public static class BoxIterator extends AbstractIterator<BlockPos> { private final BlockPos min, max; private final AxisOrder order; private BlockPos lastReturned; public BoxIterator(BlockPos min, BlockPos max, AxisOrder order) { this.min = min; this.max = max; this.order = order; } /** Skips directly to this position. This can skip backwards or forwards, it doesn't matter. Skipping to null * will reset this iterator if it has not finished. */ public void skipTo(BlockPos pos) { lastReturned = pos; } @Override protected BlockPos computeNext() { if (lastReturned == null) { lastReturned = getStart(); return lastReturned; } else { BlockPos nValue = lastReturned; if (shouldIncrement(lastReturned, order.first)) { nValue = increment(nValue, order.first); } else if (shouldIncrement(lastReturned, order.second)) { nValue = replace(nValue, order.first); nValue = increment(nValue, order.second); } else if (shouldIncrement(lastReturned, order.third)) { nValue = replace(nValue, order.first); nValue = replace(nValue, order.second); nValue = increment(nValue, order.third); } else { return endOfData(); } lastReturned = nValue; return lastReturned; } } private BlockPos getStart() { BlockPos pos = BlockPos.ORIGIN; pos = replace(pos, order.first); pos = replace(pos, order.second); return replace(pos, order.third); } private BlockPos replace(BlockPos toReplace, EnumFacing facing) { BlockPos with = facing.getAxisDirection() == AxisDirection.POSITIVE ? min : max; return Utils.withValue(toReplace, facing.getAxis(), Utils.getValue(with, facing.getAxis())); } private static BlockPos increment(BlockPos pos, EnumFacing facing) { int diff = facing.getAxisDirection().getOffset(); int value = Utils.getValue(pos, facing.getAxis()) + diff; return Utils.withValue(pos, facing.getAxis(), value); } private boolean shouldIncrement(BlockPos lastReturned, EnumFacing facing) { int lstReturned = Utils.getValue(lastReturned, facing.getAxis()); BlockPos goingTo = facing.getAxisDirection() == AxisDirection.POSITIVE ? max : min; int to = Utils.getValue(goingTo, facing.getAxis()); if (facing.getAxisDirection() == AxisDirection.POSITIVE) return lstReturned < to; return lstReturned > to; } } ======= >>>>>>>
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; ======= import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; >>>>>>> import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; <<<<<<< public static final ResourceLocation BUTTON_TEXTURES = new ResourceLocation("buildcraftcore:textures/gui/buttons.png"); protected final IButtonTextureSet texture; private ToolTip toolTip; public GuiBetterButton(int id, int x, int y, String label) { this(id, x, y, 200, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, String label) { this(id, x, y, width, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, IButtonTextureSet texture, String label) { super(id, x, y, width, texture.getHeight(), label); this.texture = texture; } public int getWidth() { return width; } public int getHeight() { return texture.getHeight(); } public int getTextColor(boolean mouseOver) { if (!enabled) { return 0xffa0a0a0; } else if (mouseOver) { return 0xffffa0; } else { return 0xe0e0e0; } } public boolean isMouseOverButton(int mouseX, int mouseY) { return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + getHeight(); } protected void bindButtonTextures(Minecraft minecraft) { minecraft.renderEngine.bindTexture(BUTTON_TEXTURES); } @Override public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (!visible) { return; } FontRenderer fontrenderer = minecraft.fontRendererObj; bindButtonTextures(minecraft); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xOffset = texture.getX(); int yOffset = texture.getY(); int h = texture.getHeight(); int w = texture.getWidth(); boolean mouseOver = isMouseOverButton(mouseX, mouseY); int hoverState = getHoverState(mouseOver); drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h); drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h, width / 2, h); mouseDragged(minecraft, mouseX, mouseY); drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2, getTextColor(mouseOver)); } @Override public ToolTip getToolTip() { return toolTip; } public void setToolTip(ToolTip tips) { this.toolTip = tips; } @Override public boolean isToolTipVisible() { return visible; } @Override public boolean isMouseOver(int mouseX, int mouseY) { return isMouseOverButton(mouseX, mouseY); } ======= protected final IButtonTextureSet texture; private ToolTip toolTip; public GuiBetterButton(int id, int x, int y, String label) { this(id, x, y, 200, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, String label) { this(id, x, y, width, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, IButtonTextureSet texture, String label) { super(id, x, y, width, texture.getHeight(), label); this.texture = texture; } public int getWidth() { return width; } public int getHeight() { return texture.getHeight(); } public int getTextColor(boolean mouseOver) { if (!enabled) { return 0xffa0a0a0; } else if (mouseOver) { return 0xffffa0; } else { return 0xe0e0e0; } } public boolean isMouseOverButton(int mouseX, int mouseY) { return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + getHeight(); } protected void bindButtonTextures(Minecraft minecraft) { minecraft.renderEngine.bindTexture(texture.getTexture()); } @Override public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (!visible) { return; } FontRenderer fontrenderer = minecraft.fontRenderer; bindButtonTextures(minecraft); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xOffset = texture.getX(); int yOffset = texture.getY(); int h = texture.getHeight(); int w = texture.getWidth(); boolean mouseOver = isMouseOverButton(mouseX, mouseY); int hoverState = getHoverState(mouseOver); drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h); drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h, width / 2, h); mouseDragged(minecraft, mouseX, mouseY); drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2, getTextColor(mouseOver)); } @Override public ToolTip getToolTip() { return toolTip; } public GuiBetterButton setToolTip(ToolTip tips) { this.toolTip = tips; return this; } @Override public boolean isToolTipVisible() { return visible; } @Override public boolean isMouseOver(int mouseX, int mouseY) { return isMouseOverButton(mouseX, mouseY); } >>>>>>> protected final IButtonTextureSet texture; private ToolTip toolTip; public GuiBetterButton(int id, int x, int y, String label) { this(id, x, y, 200, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, String label) { this(id, x, y, width, StandardButtonTextureSets.LARGE_BUTTON, label); } public GuiBetterButton(int id, int x, int y, int width, IButtonTextureSet texture, String label) { super(id, x, y, width, texture.getHeight(), label); this.texture = texture; } public int getWidth() { return width; } public int getHeight() { return texture.getHeight(); } public int getTextColor(boolean mouseOver) { if (!enabled) { return 0xffa0a0a0; } else if (mouseOver) { return 0xffffa0; } else { return 0xe0e0e0; } } public boolean isMouseOverButton(int mouseX, int mouseY) { return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + getHeight(); } protected void bindButtonTextures(Minecraft minecraft) { minecraft.renderEngine.bindTexture(texture.getTexture()); } @Override public void drawButton(Minecraft minecraft, int mouseX, int mouseY) { if (!visible) { return; } FontRenderer fontrenderer = minecraft.fontRendererObj; bindButtonTextures(minecraft); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int xOffset = texture.getX(); int yOffset = texture.getY(); int h = texture.getHeight(); int w = texture.getWidth(); boolean mouseOver = isMouseOverButton(mouseX, mouseY); int hoverState = getHoverState(mouseOver); drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h); drawTexturedModalRect(xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h, width / 2, h); mouseDragged(minecraft, mouseX, mouseY); drawCenteredString(fontrenderer, displayString, xPosition + width / 2, yPosition + (h - 8) / 2, getTextColor(mouseOver)); } @Override public ToolTip getToolTip() { return toolTip; } public GuiBetterButton setToolTip(ToolTip tips) { this.toolTip = tips; return this; } @Override public boolean isToolTipVisible() { return visible; } @Override public boolean isMouseOver(int mouseX, int mouseY) { return isMouseOverButton(mouseX, mouseY); }
<<<<<<< import net.minecraft.client.renderer.GLAllocation; ======= import net.minecraft.block.BlockLiquid; >>>>>>> import net.minecraft.block.BlockLiquid; import net.minecraft.client.renderer.GLAllocation; <<<<<<< ======= import net.minecraft.network.Packet; import net.minecraft.stats.Achievement; >>>>>>> import net.minecraft.stats.Achievement; <<<<<<< ======= import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.AchievementPage; >>>>>>> import net.minecraftforge.common.AchievementPage; <<<<<<< ======= import buildcraft.core.utils.BCLog; import buildcraft.core.utils.CraftingHandler; import buildcraft.core.recipes.AssemblyRecipeManager; import buildcraft.core.recipes.IntegrationRecipeManager; >>>>>>> <<<<<<< if (block instanceof BlockFluidBase || block instanceof IFluidBlock || block instanceof IPlantable) { ======= if (block instanceof BlockFluidBase || block instanceof BlockLiquid || block instanceof IPlantable) { >>>>>>> if (block instanceof BlockFluidBase || block instanceof BlockLiquid || block instanceof IPlantable) { <<<<<<< public static float diffX, diffY, diffZ; static FloatBuffer modelviewF; static FloatBuffer projectionF; static IntBuffer viewport; static FloatBuffer pos = ByteBuffer.allocateDirect(3 * 4).asFloatBuffer(); @SubscribeEvent @SideOnly(Side.CLIENT) public void renderLast (RenderWorldLastEvent evt) { /** * Note (SpaceToad): Why on earth this thing eventually worked out is a * mystery to me. In particular, all the examples I got computed y in * a different way. Anyone with further OpenGL understanding would be * welcome to explain. * * Anyway, the purpose of this code is to store the block position * pointed by the mouse at each frame, relative to the entity that has * the camera. * * It got heavily inspire from the two following sources: * http://nehe.gamedev.net/article/using_gluunproject/16013/ * #ActiveRenderInfo.updateRenderInfo. * * See EntityUrbanist#rayTraceMouse for a usage example. */ if (modelviewF == null) { modelviewF = GLAllocation.createDirectFloatBuffer(16); projectionF = GLAllocation.createDirectFloatBuffer(16); viewport = GLAllocation.createDirectIntBuffer(16); } GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelviewF); GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projectionF); GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); float f = (viewport.get(0) + viewport.get(2)) / 2; float f1 = (viewport.get(1) + viewport.get(3)) / 2; float x = Mouse.getX(); float y = Mouse.getY(); // TODO: Minecraft seems to instist to have this winZ re-created at // each frame - looks like a memory leak to me but I couldn't use a // static variable instead, as for the rest. FloatBuffer winZ = GLAllocation.createDirectFloatBuffer(1); GL11.glReadPixels((int) x, (int) y, 1, 1, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, winZ); GLU.gluUnProject(x, y, winZ.get(), modelviewF, projectionF, viewport, pos); diffX = pos.get(0); diffY = pos.get(1); diffZ = pos.get(2); } ======= @EventHandler public void load(FMLInitializationEvent event) { woodenGearAchievement = new Achievement("achievement.woodenGear", "woodenGearAchievement", 0, 0,woodenGearItem, null).registerStat(); stoneGearAchievement = new Achievement("achievement.stoneGear", "stoneGearAchievement", 2, 0, stoneGearItem, woodenGearAchievement).registerStat(); ironGearAchievement = new Achievement("achievement.ironGear", "ironGearAchievement", 4, 0, ironGearItem, stoneGearAchievement).registerStat(); goldGearAchievement = new Achievement("achievement.goldGear", "goldGearAchievement", 6, 0, goldGearItem, ironGearAchievement).registerStat(); diamondGearAchievement = new Achievement("achievement.diamondGear", "diamondGearAchievement", 8, 0, diamondGearItem, goldGearAchievement).registerStat(); wrenchAchievement = new Achievement("achievement.wrench", "wrenchAchievement", 3, 2, wrenchItem, stoneGearAchievement).registerStat(); aLotOfCraftingAchievement = new Achievement("achievement.aLotOfCrafting", "aLotOfCraftingAchievement", 1, 2, BuildCraftFactory.autoWorkbenchBlock, woodenGearAchievement).registerStat(); straightDownAchievement = new Achievement("achievement.straightDown", "straightDownAchievement", 5, 2, BuildCraftFactory.miningWellBlock, ironGearAchievement).registerStat(); chunkDestroyerAchievement = new Achievement("achievement.chunkDestroyer", "chunkDestroyerAchievement", 9, 2, BuildCraftFactory.quarryBlock, diamondGearAchievement).registerStat(); fasterFillingAchievement = new Achievement("achievement.fasterFilling", "fasterFillingAchievement", 7, 2, BuildCraftBuilders.fillerBlock, goldGearAchievement).registerStat(); timeForSomeLogicAchievement = new Achievement("achievement.timeForSomeLogic", "timeForSomeLogicAchievement", 9, -2, BuildCraftSilicon.assemblyTableBlock, diamondGearAchievement).registerStat(); refineAndRedefineAchievement = new Achievement("achievement.refineAndRedefine", "refineAndRedefineAchievement", 10, 0, BuildCraftFactory.refineryBlock, diamondGearAchievement).registerStat(); tinglyLaserAchievement = new Achievement("achievement.tinglyLaser", "tinglyLaserAchievement", 11, -2, BuildCraftSilicon.laserBlock ,timeForSomeLogicAchievement).registerStat(); BuildcraftAchievements = new AchievementPage("Buildcraft", woodenGearAchievement, stoneGearAchievement, ironGearAchievement, goldGearAchievement, diamondGearAchievement, wrenchAchievement, aLotOfCraftingAchievement, straightDownAchievement, chunkDestroyerAchievement, fasterFillingAchievement, timeForSomeLogicAchievement, refineAndRedefineAchievement, tinglyLaserAchievement); AchievementPage.registerAchievementPage(BuildcraftAchievements); } >>>>>>> public static float diffX, diffY, diffZ; static FloatBuffer modelviewF; static FloatBuffer projectionF; static IntBuffer viewport; static FloatBuffer pos = ByteBuffer.allocateDirect(3 * 4).asFloatBuffer(); @SubscribeEvent @SideOnly(Side.CLIENT) public void renderLast (RenderWorldLastEvent evt) { /** * Note (SpaceToad): Why on earth this thing eventually worked out is a * mystery to me. In particular, all the examples I got computed y in * a different way. Anyone with further OpenGL understanding would be * welcome to explain. * * Anyway, the purpose of this code is to store the block position * pointed by the mouse at each frame, relative to the entity that has * the camera. * * It got heavily inspire from the two following sources: * http://nehe.gamedev.net/article/using_gluunproject/16013/ * #ActiveRenderInfo.updateRenderInfo. * * See EntityUrbanist#rayTraceMouse for a usage example. */ if (modelviewF == null) { modelviewF = GLAllocation.createDirectFloatBuffer(16); projectionF = GLAllocation.createDirectFloatBuffer(16); viewport = GLAllocation.createDirectIntBuffer(16); } GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelviewF); GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projectionF); GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); float f = (viewport.get(0) + viewport.get(2)) / 2; float f1 = (viewport.get(1) + viewport.get(3)) / 2; float x = Mouse.getX(); float y = Mouse.getY(); // TODO: Minecraft seems to instist to have this winZ re-created at // each frame - looks like a memory leak to me but I couldn't use a // static variable instead, as for the rest. FloatBuffer winZ = GLAllocation.createDirectFloatBuffer(1); GL11.glReadPixels((int) x, (int) y, 1, 1, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, winZ); GLU.gluUnProject(x, y, winZ.get(), modelviewF, projectionF, viewport, pos); diffX = pos.get(0); diffY = pos.get(1); diffZ = pos.get(2); } @EventHandler public void load(FMLInitializationEvent event) { woodenGearAchievement = new Achievement("achievement.woodenGear", "woodenGearAchievement", 0, 0,woodenGearItem, null).registerStat(); stoneGearAchievement = new Achievement("achievement.stoneGear", "stoneGearAchievement", 2, 0, stoneGearItem, woodenGearAchievement).registerStat(); ironGearAchievement = new Achievement("achievement.ironGear", "ironGearAchievement", 4, 0, ironGearItem, stoneGearAchievement).registerStat(); goldGearAchievement = new Achievement("achievement.goldGear", "goldGearAchievement", 6, 0, goldGearItem, ironGearAchievement).registerStat(); diamondGearAchievement = new Achievement("achievement.diamondGear", "diamondGearAchievement", 8, 0, diamondGearItem, goldGearAchievement).registerStat(); wrenchAchievement = new Achievement("achievement.wrench", "wrenchAchievement", 3, 2, wrenchItem, stoneGearAchievement).registerStat(); aLotOfCraftingAchievement = new Achievement("achievement.aLotOfCrafting", "aLotOfCraftingAchievement", 1, 2, BuildCraftFactory.autoWorkbenchBlock, woodenGearAchievement).registerStat(); straightDownAchievement = new Achievement("achievement.straightDown", "straightDownAchievement", 5, 2, BuildCraftFactory.miningWellBlock, ironGearAchievement).registerStat(); chunkDestroyerAchievement = new Achievement("achievement.chunkDestroyer", "chunkDestroyerAchievement", 9, 2, BuildCraftFactory.quarryBlock, diamondGearAchievement).registerStat(); fasterFillingAchievement = new Achievement("achievement.fasterFilling", "fasterFillingAchievement", 7, 2, BuildCraftBuilders.fillerBlock, goldGearAchievement).registerStat(); timeForSomeLogicAchievement = new Achievement("achievement.timeForSomeLogic", "timeForSomeLogicAchievement", 9, -2, BuildCraftSilicon.assemblyTableBlock, diamondGearAchievement).registerStat(); refineAndRedefineAchievement = new Achievement("achievement.refineAndRedefine", "refineAndRedefineAchievement", 10, 0, BuildCraftFactory.refineryBlock, diamondGearAchievement).registerStat(); tinglyLaserAchievement = new Achievement("achievement.tinglyLaser", "tinglyLaserAchievement", 11, -2, BuildCraftSilicon.laserBlock ,timeForSomeLogicAchievement).registerStat(); BuildcraftAchievements = new AchievementPage("Buildcraft", woodenGearAchievement, stoneGearAchievement, ironGearAchievement, goldGearAchievement, diamondGearAchievement, wrenchAchievement, aLotOfCraftingAchievement, straightDownAchievement, chunkDestroyerAchievement, fasterFillingAchievement, timeForSomeLogicAchievement, refineAndRedefineAchievement, tinglyLaserAchievement); AchievementPage.registerAchievementPage(BuildcraftAchievements); }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftsilicon:textures/gui/packager.png"); private TilePackager bench; public GuiPackager(EntityPlayer player, TilePackager tile) { super(new ContainerPackager(player, tile), tile, TEXTURE); this.bench = tile; xSize = 176; ySize = 197; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); } @Override protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (bench.isPatternSlotSet(y * 3 + x)) { drawTexturedModalRect(guiLeft + 29 + x * 18, guiTop + 16 + y * 18, xSize, 0, 18, 18); } } } /* if (bench.progress > 0) { int progress = bench.getProgressScaled(23); drawTexturedModalRect(guiLeft + 89, * guiTop + 45, 176, 0, progress + 1, 12); } */ } ======= public static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftsilicon:textures/gui/packager.png"); private TilePackager bench; public GuiPackager(InventoryPlayer inventoryplayer, TilePackager tile) { super(new ContainerPackager(inventoryplayer, tile), tile, TEXTURE); this.bench = tile; xSize = 176; ySize = 197; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); } @Override protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (bench.isPatternSlotSet(y * 3 + x)) { drawTexturedModalRect(guiLeft + 29 + x * 18, guiTop + 16 + y * 18, xSize, 0, 18, 18); } } } } >>>>>>> public static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftsilicon:textures/gui/packager.png"); private TilePackager bench; public GuiPackager(EntityPlayer player, TilePackager tile) { super(new ContainerPackager(player, tile), tile, TEXTURE); this.bench = tile; xSize = 176; ySize = 197; } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); } @Override protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { if (bench.isPatternSlotSet(y * 3 + x)) { drawTexturedModalRect(guiLeft + 29 + x * 18, guiTop + 16 + y * 18, xSize, 0, 18, 18); } } } }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public ItemBlueprint() { super(BCCreativeTab.get("main")); } @Override public String getName(ItemStack stack) { return NBTUtils.getItemData(stack).getString("name"); } @Override public boolean setName(ItemStack stack, String name) { NBTUtils.getItemData(stack).setString("name", name); return true; } @Override @SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (world.isRemote) { BlueprintBase bpt = loadBlueprint(stack); if (bpt != null) { openGui(bpt); } } return stack; } @SideOnly(Side.CLIENT) protected abstract void openGui(BlueprintBase bpt); @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { if (NBTUtils.getItemData(stack).hasKey("name")) { String name = NBTUtils.getItemData(stack).getString("name"); if ("".equals(name)) { list.add(String.format(StringUtils.localize("item.blueprint.unnamed"))); } else { list.add(String.format(name)); } list.add(String.format(StringUtils.localize("item.blueprint.author") + " " + NBTUtils.getItemData(stack).getString("author"))); } else { list.add(StringUtils.localize("item.blueprint.blank")); } if (NBTUtils.getItemData(stack).hasKey("permission")) { BuildingPermission p = BuildingPermission.values()[NBTUtils.getItemData(stack).getByte("permission")]; if (p == BuildingPermission.CREATIVE_ONLY) { list.add(String.format(StringUtils.localize("item.blueprint.creative_only"))); } else if (p == BuildingPermission.NONE) { list.add(String.format(StringUtils.localize("item.blueprint.no_build"))); } } if (NBTUtils.getItemData(stack).hasKey("isComplete")) { boolean isComplete = NBTUtils.getItemData(stack).getBoolean("isComplete"); if (!isComplete) { list.add(String.format(StringUtils.localize("item.blueprint.incomplete"))); } } } @Override public int getItemStackLimit(ItemStack stack) { return NBTUtils.getItemData(stack).hasKey("name") ? 1 : 16; } public static LibraryId getId(ItemStack stack) { NBTTagCompound nbt = NBTUtils.getItemData(stack); if (nbt == null) { return null; } LibraryId id = new LibraryId(); id.read(nbt); if (BuildCraftBuilders.serverDB.exists(id)) { return id; } else { return null; } } public static BlueprintBase loadBlueprint(ItemStack stack) { if (stack == null || stack.getItem() == null || !(stack.getItem() instanceof IBlueprintItem)) { return null; } LibraryId id = getId(stack); if (id == null) { return null; } NBTTagCompound nbt = BuildCraftBuilders.serverDB.load(id); BlueprintBase base; if (((IBlueprintItem) stack.getItem()).getType(stack) == EnumBlueprintType.TEMPLATE) { base = new Template(); } else { base = new Blueprint(); } base.readFromNBT(nbt); base.id = id; return base; } @Override public void registerModels() { ModelHelper.registerItemModel(this, 0, "buildcraftbuilders:", textureName + "_clean"); ModelHelper.registerItemModel(this, 1, "buildcraftbuilders:", textureName + "_used"); } ======= public ItemBlueprint() { super(BCCreativeTab.get("main")); } @Override public String getName(ItemStack stack) { return NBTUtils.getItemData(stack).getString("name"); } @Override public boolean setName(ItemStack stack, String name) { NBTUtils.getItemData(stack).setString("name", name); return true; } @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean advanced) { if (NBTUtils.getItemData(stack).hasKey("name")) { String name = NBTUtils.getItemData(stack).getString("name"); if ("".equals(name)) { list.add(StringUtils.localize("item.blueprint.unnamed")); } else { list.add(name); } list.add(StringUtils.localize("item.blueprint.author") + " " + NBTUtils.getItemData(stack).getString("author")); } else { list.add(StringUtils.localize("item.blueprint.blank")); } if (NBTUtils.getItemData(stack).hasKey("permission")) { BuildingPermission p = BuildingPermission.values()[NBTUtils.getItemData(stack).getByte("permission")]; if (p == BuildingPermission.CREATIVE_ONLY) { list.add(StringUtils.localize("item.blueprint.creative_only")); } else if (p == BuildingPermission.NONE) { list.add(StringUtils.localize("item.blueprint.no_build")); } } if (NBTUtils.getItemData(stack).hasKey("isComplete")) { boolean isComplete = NBTUtils.getItemData(stack).getBoolean("isComplete"); if (!isComplete) { list.add(StringUtils.localize("item.blueprint.incomplete")); } } } @Override public int getItemStackLimit(ItemStack stack) { return NBTUtils.getItemData(stack).hasKey("name") ? 1 : 16; } public abstract String getIconType(); @Override public String[] getIconNames() { return new String[]{getIconType() + "/clean", getIconType() + "/used"}; } @Override public IIcon getIconIndex(ItemStack stack) { if (!NBTUtils.getItemData(stack).hasKey("name")) { itemIcon = icons[0]; } else { itemIcon = icons[1]; } return itemIcon; } public static boolean isContentReadable(ItemStack stack) { return getId(stack) != null; } public static LibraryId getId(ItemStack stack) { NBTTagCompound nbt = NBTUtils.getItemData(stack); if (nbt == null) { return null; } LibraryId id = new LibraryId(); id.read(nbt); if (BuildCraftBuilders.serverDB.exists(id)) { return id; } else { return null; } } public static BlueprintBase loadBlueprint(ItemStack stack) { if (stack == null || stack.getItem() == null || !(stack.getItem() instanceof IBlueprintItem)) { return null; } LibraryId id = getId(stack); if (id == null) { return null; } NBTTagCompound nbt = BuildCraftBuilders.serverDB.load(id); BlueprintBase base; if (((IBlueprintItem) stack.getItem()).getType(stack) == IBlueprintItem.Type.TEMPLATE) { base = new Template(); } else { base = new Blueprint(); } base.readFromNBT(nbt); base.id = id; return base; } >>>>>>> public ItemBlueprint() { super(BCCreativeTab.get("main")); } @Override public String getName(ItemStack stack) { return NBTUtils.getItemData(stack).getString("name"); } @Override public boolean setName(ItemStack stack, String name) { NBTUtils.getItemData(stack).setString("name", name); return true; } @Override @SideOnly(Side.CLIENT) public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (world.isRemote) { BlueprintBase bpt = loadBlueprint(stack); if (bpt != null) { openGui(bpt); } } return stack; } @SideOnly(Side.CLIENT) protected abstract void openGui(BlueprintBase bpt); @Override public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean advanced) { if (NBTUtils.getItemData(stack).hasKey("name")) { String name = NBTUtils.getItemData(stack).getString("name"); if ("".equals(name)) { list.add(StringUtils.localize("item.blueprint.unnamed")); } else { list.add(name); } list.add(StringUtils.localize("item.blueprint.author") + " " + NBTUtils.getItemData(stack).getString("author")); } else { list.add(StringUtils.localize("item.blueprint.blank")); } if (NBTUtils.getItemData(stack).hasKey("permission")) { BuildingPermission p = BuildingPermission.values()[NBTUtils.getItemData(stack).getByte("permission")]; if (p == BuildingPermission.CREATIVE_ONLY) { list.add(StringUtils.localize("item.blueprint.creative_only")); } else if (p == BuildingPermission.NONE) { list.add(StringUtils.localize("item.blueprint.no_build")); } } if (NBTUtils.getItemData(stack).hasKey("isComplete")) { boolean isComplete = NBTUtils.getItemData(stack).getBoolean("isComplete"); if (!isComplete) { list.add(StringUtils.localize("item.blueprint.incomplete")); } } } @Override public int getItemStackLimit(ItemStack stack) { return NBTUtils.getItemData(stack).hasKey("name") ? 1 : 16; } public static boolean isContentReadable(ItemStack stack) { return getId(stack) != null; } public static LibraryId getId(ItemStack stack) { NBTTagCompound nbt = NBTUtils.getItemData(stack); if (nbt == null) { return null; } LibraryId id = new LibraryId(); id.read(nbt); if (BuildCraftBuilders.serverDB.exists(id)) { return id; } else { return null; } } public static BlueprintBase loadBlueprint(ItemStack stack) { if (stack == null || stack.getItem() == null || !(stack.getItem() instanceof IBlueprintItem)) { return null; } LibraryId id = getId(stack); if (id == null) { return null; } NBTTagCompound nbt = BuildCraftBuilders.serverDB.load(id); BlueprintBase base; if (((IBlueprintItem) stack.getItem()).getType(stack) == EnumBlueprintType.TEMPLATE) { base = new Template(); } else { base = new Blueprint(); } base.readFromNBT(nbt); base.id = id; return base; } @Override public void registerModels() { ModelHelper.registerItemModel(this, 0, "buildcraftbuilders:", textureName + "_clean"); ModelHelper.registerItemModel(this, 1, "buildcraftbuilders:", textureName + "_used"); }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public ActionStationProvideFluids() { super("buildcraft:station.provide_fluids"); setBuildCraftLocation("robotics", "triggers/action_station_provide_fluids"); } @Override public String getDescription() { return StringUtils.localize("gate.action.station.povide_fluids"); } // @Override // public void registerIcons(TextureAtlasSpriteRegister iconRegister) { // icon = iconRegister.registerIcon("buildcraftrobotics:triggers/action_station_provide_fluids"); // } @Override public int maxParameters() { return 3; } @Override public IStatementParameter createParameter(int index) { return new StatementParameterItemStack(); } @Override public void actionActivate(IStatementContainer source, IStatementParameter[] parameters) { } ======= public ActionStationProvideFluids() { super("buildcraft:station.provide_fluids"); } @Override public String getDescription() { return StringUtils.localize("gate.action.station.povide_fluids"); } @Override public void registerIcons(IIconRegister iconRegister) { icon = iconRegister.registerIcon("buildcraftrobotics:triggers/action_station_provide_fluids"); } @Override public int maxParameters() { return 3; } @Override public IStatementParameter createParameter(int index) { return new StatementParameterItemStack(); } @Override public void actionActivate(IStatementContainer source, IStatementParameter[] parameters) { } >>>>>>> public ActionStationProvideFluids() { super("buildcraft:station.provide_fluids"); setBuildCraftLocation("robotics", "triggers/action_station_provide_fluids"); } @Override public String getDescription() { return StringUtils.localize("gate.action.station.povide_fluids"); } @Override public int maxParameters() { return 3; } @Override public IStatementParameter createParameter(int index) { return new StatementParameterItemStack(); } @Override public void actionActivate(IStatementContainer source, IStatementParameter[] parameters) {}
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< ======= import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; >>>>>>> <<<<<<< import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; ======= >>>>>>> import net.minecraft.util.EnumFacing; <<<<<<< ======= import net.minecraftforge.common.util.ForgeDirection; >>>>>>>
<<<<<<< import buildcraft.transport.item.ItemPluggableFacade; ======= import buildcraft.transport.plug.FacadeBlockStateInfo; import buildcraft.transport.plug.FacadeInstance; >>>>>>> import buildcraft.transport.item.ItemPluggableFacade; import buildcraft.transport.plug.FacadeBlockStateInfo; import buildcraft.transport.plug.FacadeInstance; <<<<<<< ItemStack stack = BCTransportItems.PLUG_FACADE.createItemStack(FullFacadeInstance.createSingle(info, isHollow)); ======= ItemStack stack = BCTransportItems.plugFacade.createItemStack(FacadeInstance.createSingle(info, isHollow)); >>>>>>> ItemStack stack = BCTransportItems.PLUG_FACADE.createItemStack(FullFacadeInstance.createSingle(info, isHollow));
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< public class BlockRequester extends BlockBuildCraft { public BlockRequester() { super(Material.iron, FACING_PROP); } ======= public class BlockRequester extends BlockBuildCraft implements IComparatorInventory { public BlockRequester() { super(Material.iron); setRotatable(true); } >>>>>>> public class BlockRequester extends BlockBuildCraft implements IComparatorInventory { public BlockRequester() { super(Material.iron, FACING_PROP); } <<<<<<< @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing face, float hitX, float hitY, float hitZ) { if (super.onBlockActivated(world, pos, state, entityplayer, face, hitX, hitY, hitZ)) { return true; } ======= @Override public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { if (super.onBlockActivated(world, i, j, k, entityplayer, par6, par7, par8, par9)) { return true; } >>>>>>> @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumFacing face, float hitX, float hitY, float hitZ) { if (super.onBlockActivated(world, pos, state, entityplayer, face, hitX, hitY, hitZ)) { return true; } <<<<<<< return true; } ======= return true; } @Override public boolean doesSlotCountComparator(TileEntity tile, int slot, ItemStack stack) { return ((TileRequester) tile).getRequestTemplate(slot) != null; } >>>>>>> return true; } @Override public boolean doesSlotCountComparator(TileEntity tile, int slot, ItemStack stack) { return ((TileRequester) tile).getRequestTemplate(slot) != null; }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing.Axis; ======= import net.minecraftforge.common.util.ForgeDirection; >>>>>>> import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing.Axis; <<<<<<< @Override public void rotateLeft(IBuilderContext context) { int o = tileNBT.getInteger("orientation"); EnumFacing old = EnumFacing.VALUES[o]; EnumFacing newFacing = old; if (old.getAxis() != Axis.Y) { newFacing = old.rotateY(); } o = newFacing.ordinal(); tileNBT.setInteger("orientation", o); } @Override public void initializeFromObjectAt(IBuilderContext context, BlockPos pos) { super.initializeFromObjectAt(context, pos); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); tileNBT.setInteger("orientation", engine.orientation.ordinal()); tileNBT.removeTag("progress"); tileNBT.removeTag("energy"); tileNBT.removeTag("heat"); tileNBT.removeTag("tankFuel"); tileNBT.removeTag("tankCoolant"); } @Override public void placeInWorld(IBuilderContext context, BlockPos pos, LinkedList<ItemStack> stacks) { super.placeInWorld(context, pos, stacks); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); engine.orientation = EnumFacing.VALUES[tileNBT.getInteger("orientation")]; engine.sendNetworkUpdate(); } @Override public void postProcessing(IBuilderContext context, BlockPos pos) { TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); if (engine != null) { engine.orientation = EnumFacing.VALUES[tileNBT.getInteger("orientation")]; engine.sendNetworkUpdate(); context.world().markBlockForUpdate(pos); context.world().notifyNeighborsOfStateChange(pos, context.world().getBlockState(pos).getBlock()); } } @Override public BuildingStage getBuildStage() { return BuildingStage.STANDALONE; } ======= @Override public void rotateLeft(IBuilderContext context) { int o = tileNBT.getInteger("orientation"); o = ForgeDirection.values()[o].getRotation(ForgeDirection.UP).ordinal(); tileNBT.setInteger("orientation", o); } @Override public void initializeFromObjectAt(IBuilderContext context, int x, int y, int z) { super.initializeFromObjectAt(context, x, y, z); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(x, y, z); tileNBT.setInteger("orientation", engine.orientation.ordinal()); tileNBT.removeTag("progress"); tileNBT.removeTag("energy"); tileNBT.removeTag("heat"); tileNBT.removeTag("tankFuel"); tileNBT.removeTag("tankCoolant"); } @Override public void placeInWorld(IBuilderContext context, int x, int y, int z, LinkedList<ItemStack> stacks) { super.placeInWorld(context, x, y, z, stacks); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(x, y, z); engine.orientation = ForgeDirection.getOrientation(tileNBT.getInteger("orientation")); engine.sendNetworkUpdate(); } @Override public void postProcessing(IBuilderContext context, int x, int y, int z) { TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(x, y, z); if (engine != null) { engine.orientation = ForgeDirection.getOrientation(tileNBT.getInteger("orientation")); engine.sendNetworkUpdate(); context.world().markBlockForUpdate(x, y, z); context.world().notifyBlocksOfNeighborChange(x, y, z, block); } } @Override public BuildingStage getBuildStage() { return BuildingStage.STANDALONE; } >>>>>>> @Override public void rotateLeft(IBuilderContext context) { int o = tileNBT.getInteger("orientation"); EnumFacing old = EnumFacing.VALUES[o]; EnumFacing newFacing = old; if (old.getAxis() != Axis.Y) { newFacing = old.rotateY(); } o = newFacing.ordinal(); tileNBT.setInteger("orientation", o); } @Override public void initializeFromObjectAt(IBuilderContext context, BlockPos pos) { super.initializeFromObjectAt(context, pos); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); tileNBT.setInteger("orientation", engine.orientation.ordinal()); tileNBT.removeTag("progress"); tileNBT.removeTag("energy"); tileNBT.removeTag("heat"); tileNBT.removeTag("tankFuel"); tileNBT.removeTag("tankCoolant"); } @Override public void placeInWorld(IBuilderContext context, BlockPos pos, LinkedList<ItemStack> stacks) { super.placeInWorld(context, pos, stacks); TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); engine.orientation = EnumFacing.VALUES[tileNBT.getInteger("orientation")]; engine.sendNetworkUpdate(); } @Override public void postProcessing(IBuilderContext context, BlockPos pos) { TileEngineBase engine = (TileEngineBase) context.world().getTileEntity(pos); if (engine != null) { engine.orientation = EnumFacing.VALUES[tileNBT.getInteger("orientation")]; engine.sendNetworkUpdate(); context.world().markBlockForUpdate(pos); context.world().notifyNeighborsOfStateChange(pos, context.world().getBlockState(pos).getBlock()); } } @Override public BuildingStage getBuildStage() { return BuildingStage.STANDALONE; }
<<<<<<< /** Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public License 1.0, or MMPL. Please check the contents * of the license located in http://www.mod-buildcraft.com/MMPL-1.0.txt */ ======= /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ >>>>>>> /** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * <p/> * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ <<<<<<< private static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftfactory:textures/gui/refinery_filter.png"); private final ContainerRefinery container; public GuiRefinery(EntityPlayer player, TileRefinery refinery) { super(new ContainerRefinery(player, refinery), refinery, TEXTURE); xSize = 175; ySize = 207; this.container = (ContainerRefinery) this.inventorySlots; this.slots.add(new FluidSlot(this, 38, 54)); this.slots.add(new FluidSlot(this, 126, 54)); this.slots.add(new FluidSlot(this, 82, 54)); } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String title = StringUtils.localize("tile.refineryBlock.name"); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString("->", 63, 59, 0x404040); fontRendererObj.drawString("<-", 106, 59, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); drawTooltipForSlotAt(par1, par2); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); updateSlots(); drawBackgroundSlots(); } @Override protected void mouseClicked(int x, int y, int mouse) throws IOException { super.mouseClicked(x, y, mouse); int position = getSlotIndexAtLocation(x, y); if (position >= 0 && position < 2) { if (mouse == 0) { if (!isShiftKeyDown()) { FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(mc.thePlayer.inventory.getItemStack()); if (liquid == null) { return; } container.setFilter(position, liquid.getFluid()); container.refinery.tankManager.get(position).colorRenderCache = liquid.getFluid().getColor(liquid); } else { container.setFilter(position, null); container.refinery.tankManager.get(position).colorRenderCache = 0xFFFFFF; } } else { TileRefinery ref = (TileRefinery) this.tile; if (position == 0) { container.setFilter(position, ref.tanks[0].getFluidType()); } else if (position == 1) { container.setFilter(position, ref.tanks[1].getFluidType()); } } } } private void updateSlots() { Fluid filter0 = container.getFilter(0); Fluid filter1 = container.getFilter(1); ((FluidSlot) slots.get(0)).fluid = filter0; ((FluidSlot) slots.get(0)).colorRenderCache = container.refinery.tanks[0].colorRenderCache; ((FluidSlot) slots.get(1)).fluid = filter1; ((FluidSlot) slots.get(1)).colorRenderCache = container.refinery.tanks[1].colorRenderCache; CraftingResult<FluidStack> crafting = container.refinery.craftingResult; if (crafting != null) { ((FluidSlot) slots.get(2)).fluid = crafting.crafted.getFluid(); ((FluidSlot) slots.get(2)).colorRenderCache = crafting.crafted.getFluid().getColor(crafting.crafted); } else { ((FluidSlot) slots.get(2)).fluid = null; } } ======= private static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftfactory:textures/gui/refinery_filter.png"); private final ContainerRefinery container; public GuiRefinery(InventoryPlayer inventory, TileRefinery refinery) { super(new ContainerRefinery(inventory, refinery), null, TEXTURE); xSize = 175; ySize = 207; this.container = (ContainerRefinery) this.inventorySlots; this.slots.add(new FluidSlot(this, 38, 54)); this.slots.add(new FluidSlot(this, 126, 54)); this.slots.add(new FluidSlot(this, 82, 54)); } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String title = StringUtils.localize("tile.refineryBlock.name"); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString("->", 63, 59, 0x404040); fontRendererObj.drawString("<-", 106, 59, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); drawTooltipForSlotAt(par1, par2); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); updateSlots(); drawBackgroundSlots(x, y); } @Override protected void mouseClicked(int i, int j, int k) { super.mouseClicked(i, j, k); int position = getSlotIndexAtLocation(i, j); if (position >= 0 && position < 2) { if (k == 0) { if (!isShiftKeyDown()) { FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(mc.thePlayer.inventory.getItemStack()); if (liquid == null) { return; } container.setFilter(position, liquid.getFluid()); container.refinery.tankManager.get(position).colorRenderCache = liquid.getFluid().getColor(liquid); } else { container.setFilter(position, null); container.refinery.tankManager.get(position).colorRenderCache = 0xFFFFFF; } } else { if (position == 0) { container.setFilter(position, container.refinery.tanks[0].getFluidType()); } else if (position == 1) { container.setFilter(position, container.refinery.tanks[1].getFluidType()); } } } } private void updateSlots() { Fluid filter0 = container.getFilter(0); Fluid filter1 = container.getFilter(1); ((FluidSlot) slots.get(0)).fluid = filter0; ((FluidSlot) slots.get(0)).colorRenderCache = container.refinery.tanks[0].colorRenderCache; ((FluidSlot) slots.get(1)).fluid = filter1; ((FluidSlot) slots.get(1)).colorRenderCache = container.refinery.tanks[1].colorRenderCache; CraftingResult<FluidStack> crafting = container.refinery.craftingResult; if (crafting != null) { ((FluidSlot) slots.get(2)).fluid = crafting.crafted.getFluid(); ((FluidSlot) slots.get(2)).colorRenderCache = crafting.crafted.getFluid().getColor(crafting.crafted); } else { ((FluidSlot) slots.get(2)).fluid = null; } } >>>>>>> private static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftfactory:textures/gui/refinery_filter.png"); private final ContainerRefinery container; public GuiRefinery(EntityPlayer player, TileRefinery refinery) { super(new ContainerRefinery(player, refinery), refinery, TEXTURE); xSize = 175; ySize = 207; this.container = (ContainerRefinery) this.inventorySlots; this.slots.add(new FluidSlot(this, 38, 54)); this.slots.add(new FluidSlot(this, 126, 54)); this.slots.add(new FluidSlot(this, 82, 54)); } @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { String title = StringUtils.localize("tile.refineryBlock.name"); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString("->", 63, 59, 0x404040); fontRendererObj.drawString("<-", 106, 59, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); drawTooltipForSlotAt(par1, par2); } @Override protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(TEXTURE); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); updateSlots(); drawBackgroundSlots(x, y); } @Override protected void mouseClicked(int x, int y, int mouse) throws IOException { super.mouseClicked(x, y, mouse); int position = getSlotIndexAtLocation(x, y); if (position >= 0 && position < 2) { if (mouse == 0) { if (!isShiftKeyDown()) { FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(mc.thePlayer.inventory.getItemStack()); if (liquid == null) { return; } container.setFilter(position, liquid.getFluid()); container.refinery.tankManager.get(position).colorRenderCache = liquid.getFluid().getColor(liquid); } else { container.setFilter(position, null); container.refinery.tankManager.get(position).colorRenderCache = 0xFFFFFF; } } else { if (position == 0) { container.setFilter(position, container.refinery.tanks[0].getFluidType()); } else if (position == 1) { container.setFilter(position, container.refinery.tanks[1].getFluidType()); } } } } private void updateSlots() { Fluid filter0 = container.getFilter(0); Fluid filter1 = container.getFilter(1); ((FluidSlot) slots.get(0)).fluid = filter0; ((FluidSlot) slots.get(0)).colorRenderCache = container.refinery.tanks[0].colorRenderCache; ((FluidSlot) slots.get(1)).fluid = filter1; ((FluidSlot) slots.get(1)).colorRenderCache = container.refinery.tanks[1].colorRenderCache; CraftingResult<FluidStack> crafting = container.refinery.craftingResult; if (crafting != null) { ((FluidSlot) slots.get(2)).fluid = crafting.crafted.getFluid(); ((FluidSlot) slots.get(2)).colorRenderCache = crafting.crafted.getFluid().getColor(crafting.crafted); } else { ((FluidSlot) slots.get(2)).fluid = null; } }
<<<<<<< import lombok.EqualsAndHashCode; import lombok.ToString; ======= import de.dytanic.cloudnet.common.collection.Iterables; >>>>>>> import lombok.EqualsAndHashCode; import lombok.ToString; import de.dytanic.cloudnet.common.collection.Iterables;
<<<<<<< import java.util.Base64; ======= import java.util.ArrayList; >>>>>>> import java.util.Base64; import java.util.ArrayList; <<<<<<< public void proxySendPluginMessage(ICloudPlayer cloudPlayer, String tag, byte[] data) { Preconditions.checkNotNull(cloudPlayer); this.proxySendPluginMessage(cloudPlayer.getUniqueId(), tag, data); } @Override public void proxySendPluginMessage(UUID uniqueId, String tag, byte[] data) { Preconditions.checkNotNull(uniqueId); Preconditions.checkNotNull(tag); Preconditions.checkNotNull(data); CloudNetDriver.getInstance().getMessenger().sendChannelMessage( BridgeConstants.BRIDGE_CUSTOM_MESSAGING_CHANNEL_PLAYER_API_CHANNEL_NAME, "send_plugin_message_to_proxy_player", new JsonDocument() .append("uniqueId", uniqueId) .append("tag", tag) .append("data", Base64.getEncoder().encodeToString(data)) ); } @Override public void proxyKickPlayer(ICloudPlayer cloudPlayer, String kickMessage) { Validate.checkNotNull(cloudPlayer); ======= public void proxyKickPlayer(@NotNull ICloudPlayer cloudPlayer, @NotNull String kickMessage) { Preconditions.checkNotNull(cloudPlayer); >>>>>>> public void proxySendPluginMessage(@NotNull ICloudPlayer cloudPlayer, @NotNull String tag, @NotNull byte[] data) { Preconditions.checkNotNull(cloudPlayer); this.proxySendPluginMessage(cloudPlayer.getUniqueId(), tag, data); } @Override public void proxySendPluginMessage(@NotNull UUID uniqueId, @NotNull String tag, @NotNull byte[] data) { Preconditions.checkNotNull(uniqueId); Preconditions.checkNotNull(tag); Preconditions.checkNotNull(data); CloudNetDriver.getInstance().getMessenger().sendChannelMessage( BridgeConstants.BRIDGE_CUSTOM_MESSAGING_CHANNEL_PLAYER_API_CHANNEL_NAME, "send_plugin_message_to_proxy_player", new JsonDocument() .append("uniqueId", uniqueId) .append("tag", tag) .append("data", Base64.getEncoder().encodeToString(data)) ); } @Override public void proxyKickPlayer(@NotNull ICloudPlayer cloudPlayer, @NotNull String kickMessage) { Preconditions.checkNotNull(cloudPlayer);
<<<<<<< /** * Adds a new user to the database. * * @param permissionUser the user to be added */ ======= @NotNull >>>>>>> /** * Adds a new user to the database. * * @param permissionUser the user to be added */ @NotNull <<<<<<< /** * Updates an already existing user in the database. * * @param permissionUser the user to be updated */ ======= @NotNull >>>>>>> /** * Updates an already existing user in the database. * * @param permissionUser the user to be updated */ @NotNull <<<<<<< /** * Deletes all users in the database matching the given name. * This method is case-sensitive. * * @param name the name of the users to be deleted */ ======= @NotNull >>>>>>> /** * Deletes all users in the database matching the given name. * This method is case-sensitive. * * @param name the name of the users to be deleted */ @NotNull <<<<<<< /** * Deletes one user with the uniqueId of the given user. * * @param permissionUser the user to be deleted */ ======= @NotNull >>>>>>> /** * Deletes one user with the uniqueId of the given user. * * @param permissionUser the user to be deleted */ @NotNull <<<<<<< /** * Checks if a user with the given uniqueId is stored in the database. * * @param uniqueId the uniqueId of the user * @return {@code true} if there is a user with that uniqueId, {@code false} otherwise */ ======= @NotNull >>>>>>> /** * Checks if a user with the given uniqueId is stored in the database. * * @param uniqueId the uniqueId of the user * @return {@code true} if there is a user with that uniqueId, {@code false} otherwise */ @NotNull <<<<<<< /** * Checks if at least one user with the given name is stored in the database. * This method is case-sensitive. * * @param name the name of the user * @return {@code true} if there is a user with that name, {@code false} otherwise */ ======= @NotNull >>>>>>> /** * Checks if at least one user with the given name is stored in the database. * This method is case-sensitive. * * @param name the name of the user * @return {@code true} if there is a user with that name, {@code false} otherwise */ @NotNull <<<<<<< /** * Gets a user with the given uniqueId out of the database. * * @param uniqueId the uniqueId of the user * @return the {@link IPermissionUser} from the database or {@code null} if there is no user with that uniqueId stored */ ======= @NotNull >>>>>>> /** * Gets a user with the given uniqueId out of the database. * * @param uniqueId the uniqueId of the user * @return the {@link IPermissionUser} from the database or {@code null} if there is no user with that uniqueId stored */ @NotNull <<<<<<< /** * Gets a list of all users with the given name out of the database. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * * @param name the name of the users * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ ======= @NotNull >>>>>>> /** * Gets a list of all users with the given name out of the database. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * * @param name the name of the users * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ @NotNull <<<<<<< /** * Gets a list of all users stored in the database. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * <p> * This method shouldn't be used when there are many users stored in the database, because that takes a lot of memory. * * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ ======= @NotNull >>>>>>> /** * Gets a list of all users stored in the database. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * <p> * This method shouldn't be used when there are many users stored in the database, because that takes a lot of memory. * * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ @NotNull <<<<<<< /** * Clears all users stored in the database and inserts the given list. * * @param users the new {@link IPermissionUser}s to be stored in the database */ ======= @NotNull >>>>>>> /** * Clears all users stored in the database and inserts the given list. * * @param users the new {@link IPermissionUser}s to be stored in the database */ @NotNull <<<<<<< /** * Gets a list of all users stored in the database with the given group. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * <p> * This method shouldn't be used when there are many users with that group stored in the database, because that takes a lot of memory. * * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ ======= @NotNull >>>>>>> /** * Gets a list of all users stored in the database with the given group. * This can only return null when the connection to the database (or when it is executed in a * Wrapper instance the connection to the cloud) times out. * <p> * This method shouldn't be used when there are many users with that group stored in the database, because that takes a lot of memory. * * @return a list of all {@link IPermissionUser}s stored in the database or an empty list if there is no user with that name stored. */ @NotNull <<<<<<< /** * Adds a new permission group to the list of groups. If a group with that name already exists, * it will be deleted and created again. * * @param permissionGroup the {@link IPermissionGroup} to be added */ ======= @NotNull >>>>>>> /** * Adds a new permission group to the list of groups. If a group with that name already exists, * it will be deleted and created again. * * @param permissionGroup the {@link IPermissionGroup} to be added */ @NotNull <<<<<<< /** * Updates a permission group in the list of groups. If a group with that name doesn't exist, * it will be created. * * @param permissionGroup the {@link IPermissionGroup} to be updated */ ======= @NotNull >>>>>>> /** * Updates a permission group in the list of groups. If a group with that name doesn't exist, * it will be created. * * @param permissionGroup the {@link IPermissionGroup} to be updated */ @NotNull <<<<<<< /** * Deletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens. * * @param name the case-sensitive name of the group */ ======= @NotNull >>>>>>> /** * Deletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens. * * @param name the case-sensitive name of the group */ @NotNull <<<<<<< /** * Deletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens. * * @param permissionGroup the {@link IPermissionGroup} to be deleted */ ======= @NotNull >>>>>>> /** * Deletes a group by its name out of the list of groups. If a group with that name doesn't exist, nothing happens. * * @param permissionGroup the {@link IPermissionGroup} to be deleted */ @NotNull <<<<<<< /** * Checks if a specific group exists. * * @param group the case-sensitive name of the group * @return {@code true} if the group exists, {@code false} otherwise */ ITask<Boolean> containsGroupAsync(@NotNull String group); /** * Gets a specific group by its name. * * @param name the case-sensitive name of the group * @return the {@link IPermissionUser} if it exists, {@code null} otherwise */ ======= @NotNull ITask<Boolean> containsGroupAsync(@NotNull String name); @NotNull >>>>>>> /** * Checks if a specific group exists. * * @param group the case-sensitive name of the group * @return {@code true} if the group exists, {@code false} otherwise */ @NotNull ITask<Boolean> containsGroupAsync(@NotNull String group); /** * Gets a specific group by its name. * * @param name the case-sensitive name of the group * @return the {@link IPermissionUser} if it exists, {@code null} otherwise */ @NotNull <<<<<<< /** * Gets the list of all groups in the Cloud. * * @return a list of {@link IPermissionGroup}s registered in the cloud or an empty list if there is no group registered */ ======= @NotNull >>>>>>> /** * Gets the list of all groups in the Cloud. * * @return a list of {@link IPermissionGroup}s registered in the cloud or an empty list if there is no group registered */ @NotNull <<<<<<< /** * Clears all groups in the Cloud and sets given groups. * * @param groups the new groups */ ======= @NotNull >>>>>>> /** * Clears all groups in the Cloud and sets given groups. * * @param groups the new groups */ @NotNull
<<<<<<< ======= import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.lang.reflect.Field; import java.net.URI; import java.net.URISyntaxException; >>>>>>> import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; <<<<<<< NetworkModuleService.validateURI(serverURI); ======= MqttConnectionOptions.validateURI(serverURI); >>>>>>> NetworkModuleService.validateURI(serverURI); <<<<<<< NetworkModule netModule = NetworkModuleService.createInstance(address, options, mqttSession.getClientId()); ======= NetworkModule netModule; SocketFactory factory = options.getSocketFactory(); MqttConnectionOptions.UriType serverURIType = MqttConnectionOptions.validateURI(address); URI uri; try { uri = new URI(address); // If the returned uri contains no host and the address contains underscores, // then it's likely that Java did not parse the URI if (uri.getHost() == null && address.contains("_")) { try { final Field hostField = URI.class.getDeclaredField("host"); hostField.setAccessible(true); // Get everything after the scheme:// String shortAddress = address.substring(uri.getScheme().length() + 3); hostField.set(uri, getHostName(shortAddress)); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw ExceptionHelper.createMqttException(e.getCause()); } } } catch (URISyntaxException e) { throw new IllegalArgumentException("Malformed URI: " + address + ", " + e.getMessage()); } String host = uri.getHost(); int port = uri.getPort(); // -1 if not defined switch (serverURIType) { case TCP: if (port == -1) { port = 1883; } if (factory == null) { factory = SocketFactory.getDefault(); } else if (factory instanceof SSLSocketFactory) { throw ExceptionHelper.createMqttException(MqttClientException.REASON_CODE_SOCKET_FACTORY_MISMATCH); } netModule = new TCPNetworkModule(factory, host, port, this.mqttSession.getClientId()); ((TCPNetworkModule) netModule).setConnectTimeout(options.getConnectionTimeout()); break; case SSL: if (port == -1) { port = 8883; } SSLSocketFactoryFactory factoryFactory = null; if (factory == null) { // try { factoryFactory = new SSLSocketFactoryFactory(); Properties sslClientProps = options.getSSLProperties(); if (null != sslClientProps) factoryFactory.initialize(sslClientProps, null); factory = factoryFactory.createSocketFactory(null); // } // catch (MqttDirectException ex) { // throw ExceptionHelper.createMqttException(ex.getCause()); // } } else if ((factory instanceof SSLSocketFactory) == false) { throw ExceptionHelper.createMqttException(MqttClientException.REASON_CODE_SOCKET_FACTORY_MISMATCH); } // Create the network module... netModule = new SSLNetworkModule((SSLSocketFactory) factory, host, port, this.mqttSession.getClientId()); ((SSLNetworkModule) netModule).setSSLhandshakeTimeout(options.getConnectionTimeout()); ((SSLNetworkModule) netModule).setSSLHostnameVerifier(options.getSSLHostnameVerifier()); ((SSLNetworkModule) netModule) .setHttpsHostnameVerificationEnabled(options.isHttpsHostnameVerificationEnabled()); // Ciphers suites need to be set, if they are available if (factoryFactory != null) { String[] enabledCiphers = factoryFactory.getEnabledCipherSuites(null); if (enabledCiphers != null) { ((SSLNetworkModule) netModule).setEnabledCiphers(enabledCiphers); } } break; case WS: if (port == -1) { port = 80; } if (factory == null) { factory = SocketFactory.getDefault(); } else if (factory instanceof SSLSocketFactory) { throw ExceptionHelper.createMqttException(MqttClientException.REASON_CODE_SOCKET_FACTORY_MISMATCH); } netModule = new WebSocketNetworkModule(factory, address, host, port, this.mqttSession.getClientId()); ((WebSocketNetworkModule) netModule).setConnectTimeout(options.getConnectionTimeout()); break; case WSS: if (port == -1) { port = 443; } SSLSocketFactoryFactory wSSFactoryFactory = null; if (factory == null) { wSSFactoryFactory = new SSLSocketFactoryFactory(); Properties sslClientProps = options.getSSLProperties(); if (null != sslClientProps) wSSFactoryFactory.initialize(sslClientProps, null); factory = wSSFactoryFactory.createSocketFactory(null); } else if ((factory instanceof SSLSocketFactory) == false) { throw ExceptionHelper.createMqttException(MqttClientException.REASON_CODE_SOCKET_FACTORY_MISMATCH); } // Create the network module... netModule = new WebSocketSecureNetworkModule((SSLSocketFactory) factory, address, host, port, this.mqttSession.getClientId()); ((WebSocketSecureNetworkModule) netModule).setSSLhandshakeTimeout(options.getConnectionTimeout()); // Ciphers suites need to be set, if they are available if (wSSFactoryFactory != null) { String[] enabledCiphers = wSSFactoryFactory.getEnabledCipherSuites(null); if (enabledCiphers != null) { ((SSLNetworkModule) netModule).setEnabledCiphers(enabledCiphers); } } break; default: // This shouldn't happen, as long as validateURI() has been called. log.fine(CLASS_NAME, methodName, "119", new Object[] { address }); netModule = null; } >>>>>>> NetworkModule netModule = NetworkModuleService.createInstance(address, options, mqttSession.getClientId());
<<<<<<< private String autoDetectPath; private SourceFileResolver sourceFileResolver; ======= >>>>>>> private SourceFileResolver sourceFileResolver;
<<<<<<< ======= public void closeAllWindows() { LinkedList<Integer> list = new LinkedList<Integer>(windows.asStack()); boolean canCloseAll = services.getExec().getActionList().contains("Close all pages"); if (canCloseAll) { services.getExec().action("Close all pages"); } else { while (!list.isEmpty()) { closeWindow(list.removeFirst()); } } // BAD HACK! DELAYING CLOSE-WINDOW try { Thread.sleep(OperaIntervals.WINDOW_CLOSE_SLEEP.getMs()); } catch (InterruptedException e) { // ignore } } >>>>>>>
<<<<<<< public String waitForQuickMenuShown(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_SHOWN); if (item != null) { return item.quickMenuInfo.getMenuId().getMenuName(); } return ""; } public String waitForQuickMenuClosed(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_CLOSED); if (item != null) { return item.quickMenuId.getMenuName(); } return ""; } public String waitForQuickMenuItemPressed(String menuItemText, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuItemText, ResponseType.QUICK_MENU_ITEM_PRESSED); if (item != null) { return item.quickMenuItemID.getMenuText(); } return ""; } public String waitForSelftestDone(long timeout) { ResultItem item = waitAndParseResult(timeout, 0, null, ResponseType.SELFTEST_DONE); if (item != null) { return item.selftestResults; } return null; } ======= public void setProfile(String profile){ this.profile = profile; } >>>>>>> public String waitForQuickMenuShown(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_SHOWN); if (item != null) { return item.quickMenuInfo.getMenuId().getMenuName(); } return ""; } public String waitForQuickMenuClosed(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_CLOSED); if (item != null) { return item.quickMenuId.getMenuName(); } return ""; } public String waitForQuickMenuItemPressed(String menuItemText, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuItemText, ResponseType.QUICK_MENU_ITEM_PRESSED); if (item != null) { return item.quickMenuItemID.getMenuText(); } return ""; } public String waitForSelftestDone(long timeout) { ResultItem item = waitAndParseResult(timeout, 0, null, ResponseType.SELFTEST_DONE); if (item != null) { return item.selftestResults; } return null; } public void setProfile(String profile){ this.profile = profile; }
<<<<<<< /** * The implementation of WebDriver for Opera. * * @author Deniz Turkoglu, Stuart Knightley * */ ======= /** * Opera's webdriver implementation * See CREDITS and LICENSE * */ >>>>>>> /** * Opera's webdriver implementation * See CREDITS and LICENSE * * @author Deniz Turkoglu, Stuart Knightley * */
<<<<<<< private StringBuilder selftestOutput; ======= private String profile; >>>>>>> private StringBuilder selftestOutput; private String profile; <<<<<<< ======= public void setProfile(String profile){ this.profile = profile; } >>>>>>> public void setProfile(String profile){ this.profile = profile; }
<<<<<<< synchronized (this) { synchronized (result) { if (result != WaitResult.WAITING) return; } if (!connected) throw new CommunicationException("Waiting aborted - not connected!"); wait(timeout); } ======= if (!connected) throw new CommunicationException("Waiting aborted - not connected!"); lock.wait(timeout); >>>>>>> if (!connected) throw new CommunicationException("Waiting aborted - not connected!"); lock.wait(timeout); <<<<<<< void onXMLResponse(String response) { logger.info("Got XML response for " + xmlResponse); synchronized (result) { if (response.contains(xmlResponse)) { this.result = WaitResult.XMLRESPONSE; this.xmlResponse = response; } else { this.result = WaitResult.EXCEPTION; exception = new WebDriverException("Protocol error: Tag mismatch!"); } } wakeup(); } ======= >>>>>>> <<<<<<< logger.info("Got disconnected for " + tag); synchronized (result) { this.result = WaitResult.DISCONNECTED; } wakeup(); ======= System.out.println("Got disconnected for " + tag); this.result = WaitResult.DISCONNECTED; lock.notifyAll(); >>>>>>> logger.info("Got disconnected for " + tag); this.result = WaitResult.DISCONNECTED; lock.notifyAll();
<<<<<<< @SuppressWarnings("unused") private void operaAction(String using, String... params) { ======= /** * Performs a special action, such as setting an Opera preference. * @param using The action to perform. For a list of actions call * {@link #getOperaActionList()} at run time * @param params Parameters to pass to the action call */ public void operaAction(String using, String... params) { >>>>>>> /** * Performs a special action, such as setting an Opera preference. * @param using The action to perform. For a list of actions call * {@link #getOperaActionList()} at run time * @param params Parameters to pass to the action call */ @SuppressWarnings("unused") public void operaAction(String using, String... params) { <<<<<<< ======= /** * @deprecated This should not be used! */ @Deprecated public boolean isConnected() { return services.isConnected(); } /** * Presses and releases the given key. If the key is "enter" then OperaDriver * waits for the page to finish loading. * @param key A string containing the key to press. This can be a single * character (e.g. "a") or a special key (e.g. "left"), and is matched * case insensitively. For a list of keys see {@link OperaKeys}. */ >>>>>>> /** * Presses and releases the given key. If the key is "enter" then OperaDriver * waits for the page to finish loading. * @param key A string containing the key to press. This can be a single * character (e.g. "a") or a special key (e.g. "left"), and is matched * case insensitively. For a list of keys see {@link OperaKeys}. */ <<<<<<< /** * Returns the version number of driver * replaced with the version during build * */ public String getVersion() { return "{VERSION}"; ======= public void binaryStopped(int code) { services.onBinaryStopped(code); } /** * Cache of OperaDriver version. */ private static String operaDriverVersion = null; /** * Gets the OperaDriver version. Once the version number has been * loaded from an external flat file, it will be cached and returned * from cache on future calls. * * @return OperaDriver version number as a String * @throws IOException if the version file cannot be found */ public String getOperaDriverVersion() throws IOException { if (operaDriverVersion == null) { InputStream stream = OperaDriver.class.getResourceAsStream("/com/opera/core/systems/VERSION"); StringBuilder stringBuilder = new StringBuilder(); Scanner scanner = new Scanner(stream); try { while (scanner.hasNext()) { stringBuilder.append(scanner.nextLine()); } operaDriverVersion = stringBuilder.toString(); } catch (Exception e) { throw new FatalException("Could not load the version information:" + e.getMessage()); } finally { scanner.close(); } } return operaDriverVersion; >>>>>>> /** * Returns the version number of driver. * Replaced with the version during build * */ public String getVersion() { return "{VERSION}";
<<<<<<< if(settings != null) { this.settings = settings; // The runner will be setup based on if there is an // Opera binary passed in or not if (this.settings.getOperaBinaryLocation() != null) { // If there is an Opera binary passed in then launch Opera this.operaRunner = new OperaLauncherRunner(this.settings); } } init(); } ======= if (settings != null) { this.settings = settings; // The runner will be setup based on if there is an // Opera binary passed in or not if (this.settings.getOperaBinaryLocation() != null) { // If there is an Opera binary passed in then launch Opera this.operaRunner = new OperaLauncherRunner(this.settings); } } init(); } /** * Make a new settings object, automatically finding the Opera and launcher * binaries. * @return A new settings object that is correctly set up. */ private static OperaDriverSettings makeSettings() { OperaDriverSettings settings = new OperaDriverSettings(); settings.setRunOperaLauncherFromOperaDriver(true); OperaPaths paths = new OperaPaths(); settings.setOperaBinaryLocation(paths.operaPath()); settings.setOperaLauncherBinary(paths.launcherPath()); settings.setOperaBinaryArguments(""); return settings; } >>>>>>> if(settings != null) { this.settings = settings; // The runner will be setup based on if there is an // Opera binary passed in or not if (this.settings.getOperaBinaryLocation() != null) { // If there is an Opera binary passed in then launch Opera this.operaRunner = new OperaLauncherRunner(this.settings); } } init(); } /** * Make a new settings object, automatically finding the Opera and launcher * binaries. * @return A new settings object that is correctly set up. */ private static OperaDriverSettings makeSettings() { OperaDriverSettings settings = new OperaDriverSettings(); settings.setRunOperaLauncherFromOperaDriver(true); OperaPaths paths = new OperaPaths(); settings.setOperaBinaryLocation(paths.operaPath()); settings.setOperaLauncherBinary(paths.launcherPath()); settings.setOperaBinaryArguments(""); return settings; }
<<<<<<< ======= // profile name private String profile = ""; // Generated getters and setters: >>>>>>> // profile name private String profile = "";
<<<<<<< void addCommitPropertyCondition(SelectQuery query, String propertyName, String propertyValue) { query.append(" AND EXISTS (" + "SELECT * FROM " + COMMIT_PROPERTY_TABLE_NAME + " WHERE " + COMMIT_PROPERTY_COMMIT_FK + " = " + COMMIT_PK + " AND " + COMMIT_PROPERTY_NAME + " = :propertyName_" + propertyName + " AND " + COMMIT_PROPERTY_VALUE + " = :propertyValue_" + propertyName + ")") .withArgument("propertyName_" + propertyName, propertyName) .withArgument("propertyValue_" + propertyName, propertyValue); } ======= void addAuthorCondition(SelectQuery query, String author) { query.append(" AND " + COMMIT_AUTHOR + " = :author") .withArgument("author", author); } >>>>>>> void addAuthorCondition(SelectQuery query, String author) { query.append(" AND " + COMMIT_AUTHOR + " = :author") .withArgument("author", author); } void addCommitPropertyCondition(SelectQuery query, String propertyName, String propertyValue) { query.append(" AND EXISTS (" + "SELECT * FROM " + COMMIT_PROPERTY_TABLE_NAME + " WHERE " + COMMIT_PROPERTY_COMMIT_FK + " = " + COMMIT_PK + " AND " + COMMIT_PROPERTY_NAME + " = :propertyName_" + propertyName + " AND " + COMMIT_PROPERTY_VALUE + " = :propertyValue_" + propertyName + ")") .withArgument("propertyName_" + propertyName, propertyName) .withArgument("propertyValue_" + propertyName, propertyValue); }
<<<<<<< import com.opera.core.systems.scope.services.ICookieManager; ======= import com.opera.core.systems.scope.protos.PrefsProtos.Pref; import com.opera.core.systems.scope.protos.PrefsProtos.GetPrefArg.Mode; >>>>>>> import com.opera.core.systems.scope.services.ICookieManager; import com.opera.core.systems.scope.protos.PrefsProtos.Pref; import com.opera.core.systems.scope.protos.PrefsProtos.GetPrefArg.Mode; <<<<<<< this.createScopeServices(); this.services.init(); this.debugger = services.getDebugger(); this.windowManager = services.getWindowManager(); this.exec = services.getExec(); this.actionHandler = new PbActionHandler(services); this.cookieManager = services.getCookieManager(); //cookieManager.updateCookieSettings(); ======= createScopeServices(); services.init(); debugger = services.getDebugger(); windowManager = services.getWindowManager(); exec = services.getExec(); actionHandler = new PbActionHandler(services); prefs = services.getPrefs(); >>>>>>> this.createScopeServices(); this.services.init(); this.debugger = services.getDebugger(); this.windowManager = services.getWindowManager(); this.exec = services.getExec(); this.actionHandler = new PbActionHandler(services); this.cookieManager = services.getCookieManager(); //cookieManager.updateCookieSettings(); prefs = services.getPrefs(); <<<<<<< versions.put("core", "1.0"); versions.put("cookie-manager", "1.0"); ======= versions.put("core", "1.0"); versions.put("prefs", "1.0"); >>>>>>> versions.put("core", "1.0"); versions.put("cookie-manager", "1.0"); versions.put("prefs", "1.0"); <<<<<<< protected IEcmaScriptDebugger getScriptDebugger() { return debugger; } protected IOperaExec getExecService() { return exec; } protected IWindowManager getWindowManager() { return windowManager; } protected ScopeServices getScopeServices() { return services; } ======= public String getPref(String section, String key) { return services.getPrefs().getPref(section, key, Mode.CURRENT); } public String getDefaultPref(String section, String key) { return services.getPrefs().getPref(section, key, Mode.DEFAULT); } public List<Pref> listPrefs(boolean sort, String section) { return services.getPrefs().listPrefs(sort, section); } public void setPref(String section, String key, String value) { services.getPrefs().setPrefs(section, key, value); } >>>>>>> protected IEcmaScriptDebugger getScriptDebugger() { return debugger; } protected IOperaExec getExecService() { return exec; } protected IWindowManager getWindowManager() { return windowManager; } protected ScopeServices getScopeServices() { return services; } public String getPref(String section, String key) { return services.getPrefs().getPref(section, key, Mode.CURRENT); } public String getDefaultPref(String section, String key) { return services.getPrefs().getPref(section, key, Mode.DEFAULT); } public List<Pref> listPrefs(boolean sort, String section) { return services.getPrefs().listPrefs(sort, section); } public void setPref(String section, String key, String value) { services.getPrefs().setPrefs(section, key, value); }
<<<<<<< EVENT_QUICK_MENU_SHOWN, /* Quick menu shown */ EVENT_QUICK_MENU_CLOSED, /* Quick menu was closed */ EVENT_QUICK_MENU_ITEM_PRESSED /* Quick menu item was pressed */ ======= EVENT_SELFTEST_DONE >>>>>>> EVENT_QUICK_MENU_SHOWN, /* Quick menu shown */ EVENT_QUICK_MENU_CLOSED, /* Quick menu was closed */ EVENT_QUICK_MENU_ITEM_PRESSED, /* Quick menu item was pressed */ EVENT_SELFTEST_DONE <<<<<<< case EVENT_QUICK_MENU_SHOWN: case EVENT_QUICK_MENU_CLOSED: case EVENT_QUICK_MENU_ITEM_PRESSED: ======= case EVENT_SELFTEST_DONE: >>>>>>> case EVENT_QUICK_MENU_SHOWN: case EVENT_QUICK_MENU_CLOSED: case EVENT_QUICK_MENU_ITEM_PRESSED: case EVENT_SELFTEST_DONE: <<<<<<< HANDSHAKE, RESPONSE, WINDOW_LOADED, REQUEST_FIRED, OPERA_IDLE, DESKTOP_WINDOW_SHOWN, DESKTOP_WINDOW_UPDATED, DESKTOP_WINDOW_ACTIVATED, DESKTOP_WINDOW_CLOSED, DESKTOP_WINDOW_LOADED, QUICK_MENU_SHOWN, QUICK_MENU_CLOSED, QUICK_MENU_ITEM_PRESSED; ======= HANDSHAKE, RESPONSE, WINDOW_LOADED, REQUEST_FIRED, OPERA_IDLE, DESKTOP_WINDOW_SHOWN, DESKTOP_WINDOW_UPDATED, DESKTOP_WINDOW_ACTIVATED, DESKTOP_WINDOW_CLOSED, DESKTOP_WINDOW_LOADED, SELFTEST_DONE; >>>>>>> HANDSHAKE, RESPONSE, WINDOW_LOADED, REQUEST_FIRED, OPERA_IDLE, DESKTOP_WINDOW_SHOWN, DESKTOP_WINDOW_UPDATED, DESKTOP_WINDOW_ACTIVATED, DESKTOP_WINDOW_CLOSED, DESKTOP_WINDOW_LOADED, QUICK_MENU_SHOWN, QUICK_MENU_CLOSED, QUICK_MENU_ITEM_PRESSED, SELFTEST_DONE; <<<<<<< public String waitForQuickMenuShown(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_SHOWN); if (item != null) { return item.quickMenuInfo.getMenuId().getMenuName(); } return ""; } public String waitForQuickMenuClosed(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_CLOSED); if (item != null) { return item.quickMenuId.getMenuName(); } return ""; } public String waitForQuickMenuItemPressed(String menuItemText, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuItemText, ResponseType.QUICK_MENU_ITEM_PRESSED); if (item != null) { return item.quickMenuItemID.getMenuText(); } return ""; } ======= public String waitForSelftestDone(long timeout) { ResultItem item = waitAndParseResult(timeout, 0, null, ResponseType.SELFTEST_DONE); if (item != null) { return item.selftestResults; } return null; } >>>>>>> public String waitForQuickMenuShown(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_SHOWN); if (item != null) { return item.quickMenuInfo.getMenuId().getMenuName(); } return ""; } public String waitForQuickMenuClosed(String menuName, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuName, ResponseType.QUICK_MENU_CLOSED); if (item != null) { return item.quickMenuId.getMenuName(); } return ""; } public String waitForQuickMenuItemPressed(String menuItemText, long timeout) { ResultItem item = waitAndParseResult(timeout, 0, menuItemText, ResponseType.QUICK_MENU_ITEM_PRESSED); if (item != null) { return item.quickMenuItemID.getMenuText(); } return ""; } public String waitForSelftestDone(long timeout) { ResultItem item = waitAndParseResult(timeout, 0, null, ResponseType.SELFTEST_DONE); if (item != null) { return item.selftestResults; } return null; }
<<<<<<< private static final String SNAPSHOTS = "jv_snapshots"; private static final String COMMIT_ID = "commitMetadata.id"; private static final String COMMIT_DATE = "commitMetadata.commitDate"; private static final String COMMIT_PROPERTIES = "commitMetadata.properties"; private static final String GLOBAL_ID_KEY = "globalId_key"; private static final String GLOBAL_ID_ENTITY = "globalId.entity"; private static final String GLOBAL_ID_OWNER_ID_ENTITY = "globalId.ownerId.entity"; private static final String GLOBAL_ID_FRAGMENT = "globalId.fragment"; private static final String GLOBAL_ID_VALUE_OBJECT = "globalId.valueObject"; private static final String SNAPSHOT_VERSION = "version"; private static final String CHANGED_PROPERTIES = "changedProperties"; private static final String OBJECT_ID = "_id"; ======= public static final String SNAPSHOTS = "jv_snapshots"; public static final String COMMIT_ID = "commitMetadata.id"; public static final String COMMIT_DATE = "commitMetadata.commitDate"; public static final String COMMIT_AUTHOR = "commitMetadata.author"; public static final String GLOBAL_ID_KEY = "globalId_key"; public static final String GLOBAL_ID_ENTITY = "globalId.entity"; public static final String GLOBAL_ID_OWNER_ID_ENTITY = "globalId.ownerId.entity"; public static final String GLOBAL_ID_FRAGMENT = "globalId.fragment"; public static final String GLOBAL_ID_VALUE_OBJECT = "globalId.valueObject"; public static final String SNAPSHOT_VERSION = "version"; public static final String CHANGED_PROPERTIES = "changedProperties"; public static final String OBJECT_ID = "_id"; >>>>>>> private static final String SNAPSHOTS = "jv_snapshots"; private static final String COMMIT_ID = "commitMetadata.id"; private static final String COMMIT_DATE = "commitMetadata.commitDate"; private static final String COMMIT_AUTHOR = "commitMetadata.author"; private static final String COMMIT_PROPERTIES = "commitMetadata.properties"; private static final String GLOBAL_ID_KEY = "globalId_key"; private static final String GLOBAL_ID_ENTITY = "globalId.entity"; private static final String GLOBAL_ID_OWNER_ID_ENTITY = "globalId.ownerId.entity"; private static final String GLOBAL_ID_FRAGMENT = "globalId.fragment"; private static final String GLOBAL_ID_VALUE_OBJECT = "globalId.valueObject"; private static final String SNAPSHOT_VERSION = "version"; private static final String CHANGED_PROPERTIES = "changedProperties"; private static final String OBJECT_ID = "_id"; <<<<<<< if (!params.commitProperties().isEmpty()) { query = addCommitPropertiesFilter(query, params.commitProperties()); } ======= if (params.author().isPresent()) { query = addAuthorFilter(query, params.author().get()); } >>>>>>> if (params.author().isPresent()) { query = addAuthorFilter(query, params.author().get()); } if (!params.commitProperties().isEmpty()) { query = addCommitPropertiesFilter(query, params.commitProperties()); } <<<<<<< private Bson addCommitPropertiesFilter(Bson query, Map<String, String> commitProperties) { List<Bson> propertyFilters = new ArrayList(); for (Map.Entry<String, String> commitProperty : commitProperties.entrySet()) { BasicDBObject propertyFilter = new BasicDBObject(COMMIT_PROPERTIES, new BasicDBObject("$elemMatch", new BasicDBObject("key", commitProperty.getKey()).append( "value", commitProperty.getValue()))); propertyFilters.add(propertyFilter); } return Filters.and(query, Filters.and(propertyFilters.toArray(new Bson[]{}))); } ======= private Bson addAuthorFilter(Bson query, String author) { return Filters.and(query, new BasicDBObject(COMMIT_AUTHOR, author)); } >>>>>>> private Bson addCommitPropertiesFilter(Bson query, Map<String, String> commitProperties) { List<Bson> propertyFilters = new ArrayList<>(); for (Map.Entry<String, String> commitProperty : commitProperties.entrySet()) { BasicDBObject propertyFilter = new BasicDBObject(COMMIT_PROPERTIES, new BasicDBObject("$elemMatch", new BasicDBObject("key", commitProperty.getKey()).append( "value", commitProperty.getValue()))); propertyFilters.add(propertyFilter); } return Filters.and(query, Filters.and(propertyFilters.toArray(new Bson[]{}))); } private Bson addAuthorFilter(Bson query, String author) { return Filters.and(query, new BasicDBObject(COMMIT_AUTHOR, author)); }
<<<<<<< public Animator setStateWithAnimation(State toState, boolean animated, boolean hasOverlaySearchBar, HashMap<View, Integer> layerViews) { ======= public Animator setStateWithAnimation(State toState, int toPage, boolean animated, HashMap<View, Integer> layerViews) { >>>>>>> public Animator setStateWithAnimation(State toState, boolean animated, HashMap<View, Integer> layerViews) { <<<<<<< toState, animated, hasOverlaySearchBar, layerViews); ======= toState, toPage, animated, layerViews); >>>>>>> toState, animated, layerViews);
<<<<<<< import com.android.launcher3.util.Themes; ======= import com.android.launcher3.graphics.IconPalette; >>>>>>> import com.android.launcher3.util.Themes; import com.android.launcher3.graphics.IconPalette;
<<<<<<< mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false); mFolders.put(folderInfo.id, folderInfo); ======= mWorkspace.getCurrentScreen(), cellInfo.cellX, cellInfo.cellY, false); sFolders.put(folderInfo.id, folderInfo); >>>>>>> mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false); sFolders.put(folderInfo.id, folderInfo);
<<<<<<< mStateTransitionAnimation.startAnimationToWorkspace(mState, Workspace.State.NORMAL, animated, onCompleteRunnable); // Show the search bar (only animate if we were showing the drop target bar in spring // loaded mode) if (mSearchDropTargetBar != null) { mSearchDropTargetBar.showSearchBar(animated && wasInSpringLoadedMode); } ======= mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.NORMAL, snapToPage, animated, onCompleteRunnable); >>>>>>> mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.NORMAL, animated, onCompleteRunnable); <<<<<<< mStateTransitionAnimation.startAnimationToWorkspace(mState, Workspace.State.OVERVIEW, animated, null /* onCompleteRunnable */); ======= mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.OVERVIEW, WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null /* onCompleteRunnable */); >>>>>>> mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.OVERVIEW, animated, null /* onCompleteRunnable */); <<<<<<< public Animator startWorkspaceStateChangeAnimation(Workspace.State toState, boolean animated, boolean hasOverlaySearchBar, HashMap<View, Integer> layerViews) { ======= public Animator startWorkspaceStateChangeAnimation(Workspace.State toState, int toPage, boolean animated, HashMap<View, Integer> layerViews) { >>>>>>> public Animator startWorkspaceStateChangeAnimation(Workspace.State toState, boolean animated, HashMap<View, Integer> layerViews) { <<<<<<< Animator anim = mWorkspace.setStateWithAnimation( toState, animated, hasOverlaySearchBar, layerViews); ======= Animator anim = mWorkspace.setStateWithAnimation(toState, toPage, animated, layerViews); >>>>>>> Animator anim = mWorkspace.setStateWithAnimation(toState, animated, layerViews); <<<<<<< mStateTransitionAnimation.startAnimationToWorkspace(mState, Workspace.State.SPRING_LOADED, true /* animated */, null /* onCompleteRunnable */); ======= mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.SPRING_LOADED, WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, true /* animated */, null /* onCompleteRunnable */); >>>>>>> mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.SPRING_LOADED, true /* animated */, null /* onCompleteRunnable */);
<<<<<<< ObjectAnimator oa = LauncherAnimUtils.ofViewAlphaAndScale( mFolderIconImageView, 0, 1.5f, 1.5f); if (Utilities.isLmpOrAbove()) { ======= ObjectAnimator oa = LauncherAnimUtils.ofPropertyValuesHolder(mFolderIconImageView, alpha, scaleX, scaleY); if (Utilities.ATLEAST_LOLLIPOP) { >>>>>>> ObjectAnimator oa = LauncherAnimUtils.ofViewAlphaAndScale( mFolderIconImageView, 0, 1.5f, 1.5f); if (Utilities.ATLEAST_LOLLIPOP) {
<<<<<<< private Map<String, String> commitProperties = new HashMap<>(); ======= private String author; >>>>>>> private String author; private Map<String, String> commitProperties = new HashMap<>(); <<<<<<< .commitProperties(commitProperties) ======= .author(author) >>>>>>> .author(author) .commitProperties(commitProperties)
<<<<<<< // ComponentName componentName = itemInfo.getTargetComponent(); // boolean enable = factory.packCalendars.containsKey(componentName) || factory.packComponents.containsKey(componentName); // mPrefPack.setEnabled(enable); // mPrefPack.setChecked(enable && CustomIconProvider.isEnabledForApp(context, mComponentName)); // if (enable) { // PackageManager pm = context.getPackageManager(); // try { // mPrefPack.setSummary(pm.getPackageInfo(factory.iconPack, 0).applicationInfo.loadLabel(pm)); // } catch (PackageManager.NameNotFoundException e) { // e.printStackTrace(); // } // } ======= ComponentName componentName = itemInfo.getTargetComponent(); boolean enable = factory.packCalendars.containsKey(componentName) || factory.packComponents.containsKey(componentName); mPrefPack.setEnabled(enable); mPrefPack.setChecked(enable && CustomIconProvider.isEnabledForApp(context, mKey)); if (enable) { PackageManager pm = context.getPackageManager(); try { mPrefPack.setSummary(pm.getPackageInfo(factory.iconPack, 0).applicationInfo.loadLabel(pm)); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } } >>>>>>> // ComponentName componentName = itemInfo.getTargetComponent(); // boolean enable = factory.packCalendars.containsKey(componentName) || factory.packComponents.containsKey(componentName); // mPrefPack.setEnabled(enable); // mPrefPack.setChecked(enable && CustomIconProvider.isEnabledForApp(context, mKey)); // if (enable) { // PackageManager pm = context.getPackageManager(); // try { // mPrefPack.setSummary(pm.getPackageInfo(factory.iconPack, 0).applicationInfo.loadLabel(pm)); // } catch (PackageManager.NameNotFoundException e) { // e.printStackTrace(); // } // } <<<<<<< // case PREF_PACK: // CustomIconProvider.setAppState(launcher, mComponentName, enabled); // CustomIconUtils.reloadIcons(launcher, mPackageName); // break; ======= case PREF_PACK: CustomIconProvider.setAppState(launcher, mKey, enabled); CustomIconUtils.reloadIconByKey(launcher, mKey); break; >>>>>>> // case PREF_PACK: // CustomIconProvider.setAppState(launcher, mKey, enabled); // CustomIconUtils.reloadIconByKey(launcher, mKey); // break;
<<<<<<< PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() { @Override public float getMaterialRevealViewFinalAlpha(View revealView) { return 0.3f; } }; ======= >>>>>>> <<<<<<< playCommonTransitionAnimations(fromWorkspaceState, toWorkspaceState, fromView, toView, overlaySearchBarView, animated, initialized, animation, revealDuration, layerViews); ======= // Create the workspace animation. // NOTE: this call apparently also sets the state for the workspace if !animated Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, -1, animated, layerViews); // Animate the search bar startWorkspaceSearchBarAnimation( toWorkspaceState, animated ? revealDuration : 0, animation); Animator updateTransitionStepAnim = dispatchOnLauncherTransitionStepAnim(fromView, toView); >>>>>>> playCommonTransitionAnimations(toWorkspaceState, fromView, toView, animated, initialized, animation, revealDuration, layerViews); <<<<<<< mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); ======= toWorkspacePage, mLauncher.getAllAppsButton(), appsView, animated, onCompleteRunnable, cb); >>>>>>> mLauncher.getAllAppsButton(), appsView, animated, onCompleteRunnable, cb); <<<<<<< mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); ======= mCurrentAnimation = startAnimationToWorkspaceFromOverlay( fromWorkspaceState, toWorkspaceState, toWorkspacePage, mLauncher.getWidgetsButton(), widgetsView, animated, onCompleteRunnable, cb); >>>>>>> mCurrentAnimation = startAnimationToWorkspaceFromOverlay( fromWorkspaceState, toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, animated, onCompleteRunnable, cb); <<<<<<< private AnimatorSet startAnimationToWorkspaceFromOverlay(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, ======= private AnimatorSet startAnimationToWorkspaceFromOverlay( final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final View buttonView, final BaseContainerView fromView, final boolean animated, final Runnable onCompleteRunnable, >>>>>>> private AnimatorSet startAnimationToWorkspaceFromOverlay( final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final View buttonView, final BaseContainerView fromView, final boolean animated, final Runnable onCompleteRunnable,
<<<<<<< import org.javers.core.diff.DiffFactory; import org.javers.model.mapping.BeanBasedPropertyScanner; import org.javers.model.mapping.EntityManager; import org.javers.model.mapping.FieldBasedPropertyScanner; import org.javers.model.mapping.PropertyScanner; ======= import org.javers.model.mapping.*; >>>>>>> import org.javers.core.diff.DiffFactory; import org.javers.model.mapping.BeanBasedPropertyScanner; import org.javers.model.mapping.EntityManager; import org.javers.model.mapping.FieldBasedPropertyScanner; import org.javers.model.mapping.PropertyScanner; <<<<<<< ======= import static org.fest.assertions.api.Assertions.assertThat; >>>>>>> import static org.fest.assertions.api.Assertions.assertThat;
<<<<<<< import com.android.launcher3.util.PackageManagerHelper; ======= import com.android.launcher3.util.PackageUserKey; >>>>>>> import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.PackageUserKey;
<<<<<<< mPendingAddInfo.minSpanX = mPendingAddInfo.minSpanY = -1; ======= mPendingAddInfo.minSpanX = mPendingAddInfo.minSpanY = 1; mPendingAddInfo.dropPos = null; >>>>>>> mPendingAddInfo.minSpanX = mPendingAddInfo.minSpanY = 1;
<<<<<<< import com.android.launcher3.config.ProviderConfig; ======= import com.android.launcher3.util.IconNormalizer; >>>>>>> import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.util.IconNormalizer;
<<<<<<< import org.javers.core.json.typeadapter.AtomicTypeAdapter; import org.javers.core.json.typeadapter.ChangeTypeAdapter; import org.javers.core.json.typeadapter.LocalDateTimeTypeAdapter; import org.javers.core.json.typeadapter.LocalDateTypeAdapter; ======= import org.javers.core.json.typeadapter.*; >>>>>>> import org.javers.core.json.typeadapter.*; import org.javers.core.json.typeadapter.AtomicTypeAdapter; import org.javers.core.json.typeadapter.ChangeTypeAdapter; import org.javers.core.json.typeadapter.LocalDateTimeTypeAdapter; import org.javers.core.json.typeadapter.LocalDateTypeAdapter; <<<<<<< private static final JsonTypeAdapter[] BUILT_IN_ADAPTERS = new JsonTypeAdapter[] { new LocalDateTimeTypeAdapter(), new LocalDateTypeAdapter() }; private boolean typeSafeValues = false; private final JsonConverter jsonConverter; /** * choose between new JsonConverterBuilder() or static jsonConverter() */ public JsonConverterBuilder() { jsonConverter = new JsonConverter(); jsonConverter.registerJsonTypeAdapters(Arrays.asList(BUILT_IN_ADAPTERS)); registerChangeTypeAdapter(); } public static JsonConverterBuilder jsonConverter() { return new JsonConverterBuilder(); } /** * When switched to true, all {@link org.javers.core.diff.changetype.Atomic}s are serialized type safely as a pair, fo example: * <pre> * { * "typeAlias": "LocalDate" * "value": "2001-01-01" * } * </pre> * TypeAlias is defaulted to value.class.simpleName. * <p/> * * Useful when serializing polymorfic collections like List or List&lt;Object&gt; * * @param typeSafeValues default false */ public JsonConverterBuilder typeSafeValues(boolean typeSafeValues){ this.typeSafeValues = typeSafeValues; return this; } /** * @see JsonConverter#registerNativeGsonTypeAdapter(Type, TypeAdapter) */ public JsonConverterBuilder registerNativeTypeAdapter(Type targetType, TypeAdapter nativeAdapter) { Validate.argumentsAreNotNull(targetType, nativeAdapter); jsonConverter.registerNativeGsonTypeAdapter(targetType, nativeAdapter); return this; } /** * @see JsonSerializer */ public JsonConverterBuilder registerNativeGsonSerializer(Type targetType, JsonSerializer<?> jsonSerializer){ Validate.argumentsAreNotNull(targetType, jsonSerializer); jsonConverter.registerNativeGsonSerializer(targetType, jsonSerializer); return this; } /** * @see JsonDeserializer */ public JsonConverterBuilder registerNativeGsonDeserializer(Type targetType, JsonDeserializer<?> jsonDeserializer){ Validate.argumentsAreNotNull(targetType, jsonDeserializer); jsonConverter.registerNativeGsonDeserializer(targetType, jsonDeserializer); return this; } public JsonConverterBuilder registerJsonTypeAdapter(JsonTypeAdapter adapter){ Validate.argumentIsNotNull(adapter); jsonConverter.registerJsonTypeAdapter(adapter); return this; } public JsonConverterBuilder registerJsonTypeAdapters(Collection<JsonTypeAdapter> adapters){ Validate.argumentIsNotNull(adapters); jsonConverter.registerJsonTypeAdapters(adapters); return this; } public JsonConverter build() { jsonConverter.registerJsonTypeAdapter(new AtomicTypeAdapter(typeSafeValues)); jsonConverter.initialize(); return jsonConverter; } private void registerChangeTypeAdapter() { ChangeTypeAdapter changeTypeAdapter = new ChangeTypeAdapter(); for (Type targetType : ChangeTypeAdapter.SUPPORTED) { jsonConverter.registerJsonTypeAdapter(targetType, changeTypeAdapter); } } ======= private static final JsonTypeAdapter[] BUILT_IN_ADAPTERS = new JsonTypeAdapter[]{ new LocalDateTimeTypeAdapter(), new LocalDateTypeAdapter(), new MapChangeTypeAdapter(), new NewObjectTypeAdapter(), new ObjectRemovedTypeAdapter(), new ReferenceChangeTypeAdapter(), new ValueChangeTypeAdapter() }; private boolean typeSafeValues = false; private final JsonConverter jsonConverter; /** * choose between new JsonConverterBuilder() or static jsonConverter() */ public JsonConverterBuilder() { jsonConverter = new JsonConverter(); jsonConverter.registerJsonTypeAdapters(Arrays.asList(BUILT_IN_ADAPTERS)); } public static JsonConverterBuilder jsonConverter() { return new JsonConverterBuilder(); } /** * When switched to true, all {@link org.javers.core.diff.changetype.Value}s are serialized type safely as a pair, fo example: * <pre> * { * "typeAlias": "LocalDate" * "value": "2001-01-01" * } * </pre> * TypeAlias is defaulted to value.class.simpleName. * <p/> * <p/> * Useful when serializing polymorfic collections like List or List&lt;Object&gt; * * @param typeSafeValues default false */ public JsonConverterBuilder typeSafeValues(boolean typeSafeValues) { this.typeSafeValues = typeSafeValues; return this; } /** * @see JsonConverter#registerNativeGsonTypeAdapter(Type, TypeAdapter) */ public JsonConverterBuilder registerNativeTypeAdapter(Type targetType, TypeAdapter nativeAdapter) { Validate.argumentsAreNotNull(targetType, nativeAdapter); jsonConverter.registerNativeGsonTypeAdapter(targetType, nativeAdapter); return this; } /** * @see JsonSerializer */ public JsonConverterBuilder registerNativeGsonSerializer(Type targetType, JsonSerializer<?> jsonSerializer) { Validate.argumentsAreNotNull(targetType, jsonSerializer); jsonConverter.registerNativeGsonSerializer(targetType, jsonSerializer); return this; } /** * @see JsonDeserializer */ public JsonConverterBuilder registerNativeGsonDeserializer(Type targetType, JsonDeserializer<?> jsonDeserializer) { Validate.argumentsAreNotNull(targetType, jsonDeserializer); jsonConverter.registerNativeGsonDeserializer(targetType, jsonDeserializer); return this; } public JsonConverterBuilder registerJsonTypeAdapter(JsonTypeAdapter adapter) { Validate.argumentIsNotNull(adapter); jsonConverter.registerJsonTypeAdapter(adapter); return this; } public JsonConverterBuilder registerJsonTypeAdapters(Collection<JsonTypeAdapter> adapters) { Validate.argumentIsNotNull(adapters); jsonConverter.registerJsonTypeAdapters(adapters); return this; } public JsonConverter build() { jsonConverter.registerJsonTypeAdapter(new ValueTypeAdapter(typeSafeValues)); jsonConverter.initialize(); return jsonConverter; } >>>>>>> private static final JsonTypeAdapter[] BUILT_IN_ADAPTERS = new JsonTypeAdapter[]{ new LocalDateTimeTypeAdapter(), new LocalDateTypeAdapter(), new MapChangeTypeAdapter(), new NewObjectTypeAdapter(), new ObjectRemovedTypeAdapter(), new ReferenceChangeTypeAdapter(), new ValueChangeTypeAdapter() }; private boolean typeSafeValues = false; private final JsonConverter jsonConverter; /** * choose between new JsonConverterBuilder() or static jsonConverter() */ public JsonConverterBuilder() { jsonConverter = new JsonConverter(); jsonConverter.registerJsonTypeAdapters(Arrays.asList(BUILT_IN_ADAPTERS)); } /** * When switched to true, all {@link org.javers.core.diff.changetype.Atomic}s are serialized type safely as a pair, fo example: * <pre> * { * "typeAlias": "LocalDate" * "value": "2001-01-01" * } * </pre> * TypeAlias is defaulted to value.class.simpleName. * <p/> * * Useful when serializing polymorfic collections like List or List&lt;Object&gt; * * @param typeSafeValues default false */ public JsonConverterBuilder typeSafeValues(boolean typeSafeValues){ this.typeSafeValues = typeSafeValues; return this; } public static JsonConverterBuilder jsonConverter() { return new JsonConverterBuilder(); } /** * @see JsonConverter#registerNativeGsonTypeAdapter(Type, TypeAdapter) */ public JsonConverterBuilder registerNativeTypeAdapter(Type targetType, TypeAdapter nativeAdapter) { Validate.argumentsAreNotNull(targetType, nativeAdapter); jsonConverter.registerNativeGsonTypeAdapter(targetType, nativeAdapter); return this; } /** * @see JsonConverter#registerNativeGsonTypeAdapter(Type, TypeAdapter) */ public JsonConverterBuilder registerNativeTypeAdapter(Type targetType, TypeAdapter nativeAdapter) { Validate.argumentsAreNotNull(targetType, nativeAdapter); jsonConverter.registerNativeGsonTypeAdapter(targetType, nativeAdapter); return this; } /** * @see JsonSerializer */ public JsonConverterBuilder registerNativeGsonSerializer(Type targetType, JsonSerializer<?> jsonSerializer) { Validate.argumentsAreNotNull(targetType, jsonSerializer); jsonConverter.registerNativeGsonSerializer(targetType, jsonSerializer); return this; } /** * @see JsonDeserializer */ public JsonConverterBuilder registerNativeGsonDeserializer(Type targetType, JsonDeserializer<?> jsonDeserializer) { Validate.argumentsAreNotNull(targetType, jsonDeserializer); jsonConverter.registerNativeGsonDeserializer(targetType, jsonDeserializer); return this; } public JsonConverterBuilder registerJsonTypeAdapter(JsonTypeAdapter adapter) { Validate.argumentIsNotNull(adapter); jsonConverter.registerJsonTypeAdapter(adapter); return this; } public JsonConverterBuilder registerJsonTypeAdapters(Collection<JsonTypeAdapter> adapters) { Validate.argumentIsNotNull(adapters); jsonConverter.registerJsonTypeAdapters(adapters); return this; } jsonConverter.registerJsonTypeAdapter(new AtomicTypeAdapter(typeSafeValues)); public JsonConverter build() { jsonConverter.registerJsonTypeAdapter(new ValueTypeAdapter(typeSafeValues)); jsonConverter.initialize(); return jsonConverter; }
<<<<<<< // Always a break point at first character return prevType == Character.UNASSIGNED; ======= return false; } } public static class StringMatcher { private static final char MAX_UNICODE = '\uFFFF'; private final Collator mCollator; StringMatcher() { // On android N and above, Collator uses ICU implementation which has a much better // support for non-latin locales. mCollator = Collator.getInstance(); mCollator.setStrength(Collator.PRIMARY); mCollator.setDecomposition(Collator.CANONICAL_DECOMPOSITION); } /** * Returns true if {@param query} is a prefix of {@param target} */ public boolean matches(String query, String target) { switch (mCollator.compare(query, target)) { case 0: return true; case -1: // The target string can contain a modifier which would make it larger than // the query string (even though the length is same). If the query becomes // larger after appending a unicode character, it was originally a prefix of // the target string and hence should match. return mCollator.compare(query + MAX_UNICODE, target) > -1; default: return false; } } public static StringMatcher getInstance() { return new StringMatcher(); >>>>>>> // Always a break point at first character return prevType == Character.UNASSIGNED; } } public static class StringMatcher { private static final char MAX_UNICODE = '\uFFFF'; private final Collator mCollator; StringMatcher() { // On android N and above, Collator uses ICU implementation which has a much better // support for non-latin locales. mCollator = Collator.getInstance(); mCollator.setStrength(Collator.PRIMARY); mCollator.setDecomposition(Collator.CANONICAL_DECOMPOSITION); } /** * Returns true if {@param query} is a prefix of {@param target} */ public boolean matches(String query, String target) { switch (mCollator.compare(query, target)) { case 0: return true; case -1: // The target string can contain a modifier which would make it larger than // the query string (even though the length is same). If the query becomes // larger after appending a unicode character, it was originally a prefix of // the target string and hence should match. return mCollator.compare(query + MAX_UNICODE, target) > -1; default: return false; } } public static StringMatcher getInstance() { return new StringMatcher();
<<<<<<< private DragInfo mDragInfo = null; private final SparseArray<AccessibilityAction> mActions = new SparseArray<>(); ======= private final SparseArray<AccessibilityAction> mActions = new SparseArray<AccessibilityAction>(); >>>>>>> private final SparseArray<AccessibilityAction> mActions = new SparseArray<>();
<<<<<<< import com.google.android.libraries.launcherclient.GoogleNow; import com.hdeva.launcher.LeanSettings; ======= import com.google.android.libraries.gsa.launcherclient.LauncherClient; >>>>>>> import com.hdeva.launcher.LeanSettings; import com.google.android.libraries.gsa.launcherclient.LauncherClient; <<<<<<< isDark = LeanSettings.isDark(this, isDark); int flags = Utilities.getDevicePrefs(this).getInt("pref_persistent_flags", 0); ======= int flags = Utilities.getDevicePrefs(this).getInt(NexusLauncherOverlay.PREF_PERSIST_FLAGS, 0); >>>>>>> isDark = LeanSettings.isDark(this, isDark); int flags = Utilities.getDevicePrefs(this).getInt(NexusLauncherOverlay.PREF_PERSIST_FLAGS, 0); <<<<<<< if (LeanSettings.shouldUseBlackColors(this)) { setTheme(R.style.GoogleSearchLauncherThemeBlack); } else { setTheme(R.style.GoogleSearchLauncherThemeDark); } } else if (useGoogleInOrientation && supportsDarkText && Utilities.ATLEAST_NOUGAT) { ======= setTheme(R.style.GoogleSearchLauncherThemeDark); } else if (useGoogleInOrientation && supportsDarkText) { >>>>>>> if (LeanSettings.shouldUseBlackColors(this)) { setTheme(R.style.GoogleSearchLauncherThemeBlack); } else { setTheme(R.style.GoogleSearchLauncherThemeDark); } } else if (useGoogleInOrientation && supportsDarkText) {
<<<<<<< final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, animated, overlaySearchBarView != null /* hasOverlaySearchBar */, layerViews); ======= Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, -1, animated, layerViews); >>>>>>> Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, animated, layerViews); <<<<<<< private void startAnimationToWorkspaceFromAllApps(final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= private void startAnimationToWorkspaceFromAllApps(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> private void startAnimationToWorkspaceFromAllApps(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); ======= mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, toWorkspacePage, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); >>>>>>> mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); <<<<<<< private void startAnimationToWorkspaceFromWidgets(final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= private void startAnimationToWorkspaceFromWidgets(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> private void startAnimationToWorkspaceFromWidgets(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } ======= mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, toWorkspacePage, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } >>>>>>> mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } <<<<<<< private void startAnimationToWorkspaceFromOverlay(final Workspace.State toWorkspaceState, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { ======= private AnimatorSet startAnimationToWorkspaceFromOverlay(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet(); >>>>>>> private AnimatorSet startAnimationToWorkspaceFromOverlay(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet(); <<<<<<< animated, overlaySearchBarView != null /* hasOverlaySearchBar */, layerViews); ======= toWorkspacePage, animated, layerViews); >>>>>>> animated, layerViews);
<<<<<<< } else if (subCommand.equals("invite")) { if (args.length > 1) { String invitedName = args[1]; if (invitedName.equals(player.getName())) { player.sendMessage(ChatColor.RED + "You can not invite yourself"); return true; } // check that player is in a clan if (BitQuest.REDIS.exists("clan:" + player.getUniqueId().toString())) { String clan = BitQuest.REDIS.get("clan:" + player.getUniqueId().toString()); // check if user is in the uuid database if (BitQuest.REDIS.exists("uuid:" + invitedName)) { // check if player already belongs to a clan String uuid = BitQuest.REDIS.get("uuid:" + invitedName); if (!BitQuest.REDIS.exists("clan:" + uuid)) { // check if player is already invited to the clan if (!BitQuest.REDIS.sismember("invitations:" + clan, uuid)) { BitQuest.REDIS.sadd("invitations:" + clan, uuid); player.sendMessage(ChatColor.GREEN + "You invited " + invitedName + " to the " + clan + " clan."); if (Bukkit.getPlayerExact(invitedName) != null) { Player invitedplayer = Bukkit.getPlayerExact(invitedName); invitedplayer.sendMessage(ChatColor.GREEN + player.getName() + " invited you to the " + clan + " clan"); invitedplayer.sendMessage(ChatColor.GREEN + player.getName() + " to join, enter: /clan join " + clan ); } return true; } else { player.sendMessage(ChatColor.RED + "Player " + invitedName + " is already invited to the clan and must accept the invitation"); return true; } ======= } else { player.sendMessage( ChatColor.RED + "You already belong to the clan " + BitQuest.REDIS.get("clan:" + player.getUniqueId().toString())); return true; } } else { player.sendMessage(ChatColor.RED + "Error: clan name must have 16 characters max"); return true; } } else { player.sendMessage( ChatColor.RED + "Your clan name must only contain letters and numbers"); return true; } >>>>>>> } else if (subCommand.equals("invite")) { if (args.length > 1) { String invitedName = args[1]; if (invitedName.equals(player.getName())) { player.sendMessage(ChatColor.RED + "You can not invite yourself"); return true; } // check that player is in a clan if (BitQuest.REDIS.exists("clan:" + player.getUniqueId().toString())) { String clan = BitQuest.REDIS.get("clan:" + player.getUniqueId().toString()); // check if user is in the uuid database if (BitQuest.REDIS.exists("uuid:" + invitedName)) { // check if player already belongs to a clan String uuid = BitQuest.REDIS.get("uuid:" + invitedName); if (!BitQuest.REDIS.exists("clan:" + uuid)) { // check if player is already invited to the clan if (!BitQuest.REDIS.sismember("invitations:" + clan, uuid)) { BitQuest.REDIS.sadd("invitations:" + clan, uuid); player.sendMessage(ChatColor.GREEN + "You invited " + invitedName + " to the " + clan + " clan."); if (Bukkit.getPlayerExact(invitedName) != null) { Player invitedplayer = Bukkit.getPlayerExact(invitedName); invitedplayer.sendMessage(ChatColor.GREEN + player.getName() + " invited you to the " + clan + " clan"); invitedplayer.sendMessage(ChatColor.GREEN + player.getName() + " to join, enter: /clan join " + clan ); } return true; } else { player.sendMessage(ChatColor.RED + "Player " + invitedName + " is already invited to the clan and must accept the invitation"); return true; } <<<<<<< removeEmptyClan(clan); return true; } else { player.sendMessage(ChatColor.RED + "You don't belong to a clan."); return true; } } else { player.sendMessage(ChatColor.RED + "Usage: /clan <new|invite|kick|join|leave>"); return true; } ======= removeEmptyClan(clan); return true; >>>>>>> removeEmptyClan(clan); return true; } else { player.sendMessage(ChatColor.RED + "You don't belong to a clan."); return true; } } else { player.sendMessage(ChatColor.RED + "Usage: /clan <new|invite|kick|join|leave>"); return true; } <<<<<<< ======= } } else { player.sendMessage(ChatColor.RED + "Usage: /clan <new|invite|kick|join|leave>"); return true; >>>>>>>
<<<<<<< String message = messageUnescaped.replace("%", ""); // escape any % signs to prevent a breakdown in chat script String playerName = sender.getName(); if (BitQuest.REDIS.get("clan:" + sender.getUniqueId().toString()) != null) { String clan = BitQuest.REDIS.get("clan:" + sender.getUniqueId().toString()); playerName = ChatColor.GOLD + "[" + clan + "] " + ChatColor.YELLOW + playerName; } ======= >>>>>>> String playerName = sender.getName(); if (BitQuest.REDIS.get("clan:" + sender.getUniqueId().toString()) != null) { String clan = BitQuest.REDIS.get("clan:" + sender.getUniqueId().toString()); playerName = ChatColor.GOLD + "[" + clan + "] " + ChatColor.YELLOW + playerName; } <<<<<<< event.setFormat(ChatColor.BLUE.toString() + sender.getLevel() + " " + playerName + " " + ChatColor.WHITE + event.getMessage()); ======= event.setFormat(ChatColor.BLUE.toString() + sender.getLevel() + " " + ChatColor.YELLOW + sender.getName() + " " + ChatColor.WHITE + "%2$s"); >>>>>>> event.setFormat(ChatColor.BLUE.toString() + sender.getLevel() + " " + playerName + " " + ChatColor.WHITE + "%2$s"); <<<<<<< event.setFormat(ChatColor.BLUE + ChatColor.BOLD.toString() + "Local> " + playerName + " " + ChatColor.WHITE + message); ======= event.setFormat(ChatColor.BLUE + ChatColor.BOLD.toString() + "Local> " + ChatColor.YELLOW + sender.getName() + " " + ChatColor.WHITE + "%2$s"); >>>>>>> event.setFormat(ChatColor.BLUE + ChatColor.BOLD.toString() + "Local> " + playerName + " " + ChatColor.WHITE + "%2$s");
<<<<<<< player.sendMessage(ChatColor.BLUE + " " + ChatColor.UNDERLINE + "http://bitquest.co/wiki.html"); player.sendMessage(""); BitQuest.REDIS.zincrby("player:login",1,player.getUniqueId().toString()); ======= player.sendMessage(ChatColor.DARK_BLUE + " " + ChatColor.UNDERLINE + "http://bitquest.co/wiki.html"); >>>>>>> player.sendMessage(ChatColor.DARK_BLUE + " " + ChatColor.UNDERLINE + "http://bitquest.co/wiki.html"); player.sendMessage(""); BitQuest.REDIS.zincrby("player:login",1,player.getUniqueId().toString());
<<<<<<< if (SLACK_BOT_AUTH_TOKEN != null) { slackBotSession = SlackSessionFactory.createWebSocketSlackSession(SLACK_BOT_AUTH_TOKEN); try { slackBotSession.connect(); } catch (IOException e) { System.out.println("Slack bot connection failed with error: " + e.getMessage()); } } // Removes all entities on server restart. This is a workaround for when large numbers of entities grash the server. With the release of Minecraft 1.11 and "max entity cramming" this will be unnecesary. // removeAllEntities(); killAllVillagers(); createScheduledTimers(); ======= >>>>>>> if (SLACK_BOT_AUTH_TOKEN != null) { slackBotSession = SlackSessionFactory.createWebSocketSlackSession(SLACK_BOT_AUTH_TOKEN); try { slackBotSession.connect(); } catch (IOException e) { System.out.println("Slack bot connection failed with error: " + e.getMessage()); } } // Removes all entities on server restart. This is a workaround for when large numbers of entities grash the server. With the release of Minecraft 1.11 and "max entity cramming" this will be unnecesary. // removeAllEntities(); killAllVillagers(); createScheduledTimers(); <<<<<<< if (cmd.getName().equalsIgnoreCase("report")) { if (slackBotSession != null && slackBotSession.isConnected()) { if (args.length >= 2) { String badPlayer = args[0]; String message = args[1]; for (int i = 2; i < args.length; i++) { message += " "; message += args[i]; } if (REDIS.exists("uuid:" + badPlayer)) { String uuid = REDIS.get("uuid:" + badPlayer); String slackMessage = "Player " + player.getName() + " reports " + badPlayer + " (" + uuid + ") because: " + message; SlackChannel channel = slackBotSession.findChannelByName(SLACK_BOT_REPORTS_CHANNEL); if (channel != null) { slackBotSession.sendMessage(channel, slackMessage); String playerMessage = ChatColor.GREEN + "The report has been send to a moderator. Thanks for making " + ChatColor.GOLD + ChatColor.BOLD +"Bit" + ChatColor.GRAY + ChatColor.BOLD + "Quest" + ChatColor.RESET + ChatColor.GREEN + " a better place."; player.sendMessage(playerMessage); return true; } else { player.sendMessage(ChatColor.RED + "There was a problem sending the report. Please try again later."); return true; } } else { player.sendMessage(ChatColor.RED + "Player " + badPlayer + " does not play on this server."); return true; } } else { player.sendMessage(ChatColor.RED + "Usage: /report <player> <reason>"); return true; } } else { player.sendMessage(ChatColor.RED + "The /report command is not active."); return true; } } ======= /*********************************************************** /upgradewallet attempts to transfer funds from old (BQ2.0) wallet to the new HD (BQ2.1) wallet via BlockCypher's microtransaction endpoint ***********************************************************/ if(cmd.getName().equalsIgnoreCase("upgradewallet")) { String fail_message="Cannot make transaction at this moment. Please try again later..."; player.sendMessage(ChatColor.YELLOW+"Searching for lost wallet..."); if(REDIS.exists("address"+player.getUniqueId().toString())&&REDIS.exists("private"+player.getUniqueId().toString())) { Wallet old_wallet=new Wallet( REDIS.get("address"+player.getUniqueId().toString()), REDIS.get("private"+player.getUniqueId().toString())); player.sendMessage(ChatColor.YELLOW+"Found wallet "+wallet.address+"! looking for bits..."); try { JSONObject balance=wallet.get_blockcypher_balance(); int confirmed_balance=((Number)balance.get("confirmed_balance")).intValue(); player.sendMessage(ChatColor.YELLOW+"Confirmed balance in lost wallet is "+confirmed_balance); if(confirmed_balance>0) { int transaction_balance=Math.min(7000000,confirmed_balance); try { User user=new User(player); player.sendMessage(ChatColor.YELLOW+"Sending "+confirmed_balance/100+" bits to "+user.wallet.address); if(old_wallet.blockcypher_microtransaction(transaction_balance,user.wallet.address)==true) { player.sendMessage(ChatColor.RED+fail_message); return true; } else { player.sendMessage(ChatColor.GREEN+"Transaction successful."); return true; } } catch (ParseException e) { player.sendMessage(ChatColor.RED+"Error loading new wallet."); e.printStackTrace(); return true; } } else { player.sendMessage(ChatColor.RED+"Not enough balance for recovery. If you think this is an error e-mail [email protected]"); >>>>>>> if (cmd.getName().equalsIgnoreCase("report")) { if (slackBotSession != null && slackBotSession.isConnected()) { if (args.length >= 2) { String badPlayer = args[0]; String message = args[1]; for (int i = 2; i < args.length; i++) { message += " "; message += args[i]; } if (REDIS.exists("uuid:" + badPlayer)) { String uuid = REDIS.get("uuid:" + badPlayer); String slackMessage = "Player " + player.getName() + " reports " + badPlayer + " (" + uuid + ") because: " + message; SlackChannel channel = slackBotSession.findChannelByName(SLACK_BOT_REPORTS_CHANNEL); if (channel != null) { slackBotSession.sendMessage(channel, slackMessage); String playerMessage = ChatColor.GREEN + "The report has been send to a moderator. Thanks for making " + ChatColor.GOLD + ChatColor.BOLD +"Bit" + ChatColor.GRAY + ChatColor.BOLD + "Quest" + ChatColor.RESET + ChatColor.GREEN + " a better place."; player.sendMessage(playerMessage); return true; } else { player.sendMessage(ChatColor.RED + "There was a problem sending the report. Please try again later."); return true; } } else { player.sendMessage(ChatColor.RED + "Player " + badPlayer + " does not play on this server."); return true; } } else { player.sendMessage(ChatColor.RED + "Usage: /report <player> <reason>"); return true; } } else { player.sendMessage(ChatColor.RED + "The /report command is not active."); return true; } } /*********************************************************** /upgradewallet attempts to transfer funds from old (BQ2.0) wallet to the new HD (BQ2.1) wallet via BlockCypher's microtransaction endpoint ***********************************************************/ if(cmd.getName().equalsIgnoreCase("upgradewallet")) { String fail_message="Cannot make transaction at this moment. Please try again later..."; player.sendMessage(ChatColor.YELLOW+"Searching for lost wallet..."); if(REDIS.exists("address"+player.getUniqueId().toString())&&REDIS.exists("private"+player.getUniqueId().toString())) { Wallet old_wallet=new Wallet( REDIS.get("address"+player.getUniqueId().toString()), REDIS.get("private"+player.getUniqueId().toString())); player.sendMessage(ChatColor.YELLOW+"Found wallet "+wallet.address+"! looking for bits..."); try { JSONObject balance=wallet.get_blockcypher_balance(); int confirmed_balance=((Number)balance.get("confirmed_balance")).intValue(); player.sendMessage(ChatColor.YELLOW+"Confirmed balance in lost wallet is "+confirmed_balance); if(confirmed_balance>0) { int transaction_balance=Math.min(7000000,confirmed_balance); try { User user=new User(player); player.sendMessage(ChatColor.YELLOW+"Sending "+confirmed_balance/100+" bits to "+user.wallet.address); if(old_wallet.blockcypher_microtransaction(transaction_balance,user.wallet.address)==true) { player.sendMessage(ChatColor.RED+fail_message); return true; } else { player.sendMessage(ChatColor.GREEN+"Transaction successful."); return true; } } catch (ParseException e) { player.sendMessage(ChatColor.RED+"Error loading new wallet."); e.printStackTrace(); return true; } } else { player.sendMessage(ChatColor.RED+"Not enough balance for recovery. If you think this is an error e-mail [email protected]");
<<<<<<< Map<String, String> data = new HashMap<String, String>(); data.put("message", "Hello, World!"); ======= Map<String, String> data = new MiniMap<>(1); data.put("message", "Hello, world"); >>>>>>> Map<String, String> data = new MiniMap<>(1); data.put("message", "Hello, World!");
<<<<<<< import hellowicket.plaintext.HelloTextReference; ======= import hellowicket.dbupdates.HelloDbUpdatesReference; >>>>>>> import hellowicket.plaintext.HelloTextReference; import hellowicket.dbupdates.HelloDbUpdatesReference; <<<<<<< mountResource("/plaintext", new HelloTextReference()); ======= mountResource("/updates", new HelloDbUpdatesReference()); >>>>>>> mountResource("/updates", new HelloDbUpdatesReference()); mountResource("/plaintext", new HelloTextReference());
<<<<<<< private String user_agent; private boolean use_custom_user_agent; ======= private boolean autoreload; private int time_autoreload; >>>>>>> private String user_agent; private boolean use_custom_user_agent; private boolean autoreload; private int time_autoreload; <<<<<<< user_agent = null; use_custom_user_agent = false; ======= autoreload = false; time_autoreload = 60; >>>>>>> user_agent = null; use_custom_user_agent = false; autoreload = false; time_autoreload = 60; <<<<<<< this.user_agent = other.user_agent; this.use_custom_user_agent = other.use_custom_user_agent; ======= this.autoreload = other.autoreload; this.time_autoreload = other.time_autoreload; >>>>>>> this.user_agent = other.user_agent; this.use_custom_user_agent = other.use_custom_user_agent; this.autoreload = other.autoreload; this.time_autoreload = other.time_autoreload; <<<<<<< public void onSwitchUserAgentChanged(CompoundButton mSwitch, boolean isChecked) { EditText txt = mSwitch.getRootView().findViewById(R.id.textUserAgent); Switch switchDesktopVersion = mSwitch.getRootView().findViewById(R.id.switchDesktopSite); if (isChecked) { switchDesktopVersion.setChecked(false); switchDesktopVersion.setEnabled(false); txt.setEnabled(true); } else { txt.setEnabled(false); switchDesktopVersion.setEnabled(true); } } ======= public void onSwitchAutoreloadChanged(CompoundButton mSwitch, boolean isChecked) { EditText text = mSwitch.getRootView().findViewById(R.id.textReloadInterval); if (isChecked) { text.setEnabled(true); } else text.setEnabled(false); } >>>>>>> public void onSwitchUserAgentChanged(CompoundButton mSwitch, boolean isChecked) { EditText txt = mSwitch.getRootView().findViewById(R.id.textUserAgent); Switch switchDesktopVersion = mSwitch.getRootView().findViewById(R.id.switchDesktopSite); if (isChecked) { switchDesktopVersion.setChecked(false); switchDesktopVersion.setEnabled(false); txt.setEnabled(true); } else { txt.setEnabled(false); switchDesktopVersion.setEnabled(true); } } public void onSwitchAutoreloadChanged(CompoundButton mSwitch, boolean isChecked) { EditText text = mSwitch.getRootView().findViewById(R.id.textReloadInterval); if (isChecked) { text.setEnabled(true); } else text.setEnabled(false); }
<<<<<<< // url pattern for uploading files associated with ODKTables tables public static final String TABLE_FILE_UPLOAD_SERVLET_ADDR = "tableFileUpload"; // url pattern for downloading files associated with odktables tables public static final String TABLE_FILE_DOWNLOAD_SERVLET_ADDR = "tableFileDownload"; // url pattern for uploading a table from a CSV file public static final String UPLOAD_TABLE_FROM_CSV_SERVLET_ADDR = "uploadTableFromCSV"; ======= public static final String SERVICE_ACCOUNT_PRIVATE_KEY_UPLOAD_ADDR = "ssl/oauth2-service-account"; >>>>>>> public static final String SERVICE_ACCOUNT_PRIVATE_KEY_UPLOAD_ADDR = "ssl/oauth2-service-account"; // url pattern for uploading files associated with ODKTables tables public static final String TABLE_FILE_UPLOAD_SERVLET_ADDR = "tableFileUpload"; // url pattern for downloading files associated with odktables tables public static final String TABLE_FILE_DOWNLOAD_SERVLET_ADDR = "tableFileDownload"; // url pattern for uploading a table from a CSV file public static final String UPLOAD_TABLE_FROM_CSV_SERVLET_ADDR = "uploadTableFromCSV";
<<<<<<< private Spinner layoutMapSpinner = null; private Spinner spinnerConnectionType; ======= >>>>>>> private Spinner spinnerConnectionType;
<<<<<<< if(jpushBridge == null) { jpushBridge = new JPushBridge(); } ISQUIT = false; return jpushBridge; ======= if(null == jpushBridge) jpushBridge = new JPushBridge() ; ISQUIT = false ; return jpushBridge ; >>>>>>> if(jpushBridge == null) { jpushBridge = new JPushBridge(); } ISQUIT = false; return jpushBridge; <<<<<<< JPushInterface.setDebugMode(enable); } public void initJPush(String gameObject, String func) { gameObjectName = gameObject; funcName = func; JPushInterface.init(getActivity()); UnityPlayer.UnitySendMessage(gameObjectName, funcName, "initJPush:" + gameObject + "---" + func); } public void stopJPush(String gameObject, String func) { JPushInterface.stopPush(getActivity()); UnityPlayer.UnitySendMessage(gameObject, func, "stopJPush"); } public void resumeJPush(String gameObject, String func) { JPushInterface.resumePush(getActivity()); UnityPlayer.UnitySendMessage(gameObject, func, "resumeJPush"); } public void setTags(String gameObject, String func, String unity_tags) { ======= JPushInterface.setDebugMode(enable) ; } public void initJPush(String gameObject , String func) { gameObjectName = gameObject ; funcName = func ; JPushInterface.init(getActivity()) ; UnityPlayer.UnitySendMessage(gameObjectName ,funcName , "initJPush:" + gameObject + "---" + func ); } public void stopJPush(String gameObject , String func) { JPushInterface.stopPush(getActivity()) ; UnityPlayer.UnitySendMessage(gameObject ,func , "stopJPush" ); } public void resumeJPush(String gameObject , String func) { JPushInterface.resumePush(getActivity()) ; UnityPlayer.UnitySendMessage(gameObject ,func , "resumeJPush" ); } public void setTags(String gameObject , String func ,String unity_tags ) { >>>>>>> JPushInterface.setDebugMode(enable); } public void initJPush(String gameObject, String func) { gameObjectName = gameObject; funcName = func; JPushInterface.init(getActivity()); UnityPlayer.UnitySendMessage(gameObjectName, funcName, "initJPush:" + gameObject + "---" + func); } public void stopJPush(String gameObject, String func) { JPushInterface.stopPush(getActivity()); UnityPlayer.UnitySendMessage(gameObject, func, "stopJPush"); } public void resumeJPush(String gameObject, String func) { JPushInterface.resumePush(getActivity()); UnityPlayer.UnitySendMessage(gameObject, func, "resumeJPush"); } public void setTags(String gameObject, String func, String unity_tags) { <<<<<<< ======= >>>>>>> JPushInterface.setDebugMode(enable) ; <<<<<<< public void setAlias(String gameObject, String func, String unity_alias) { ======= public void setAlias(String gameObject , String func , String unity_alias) { >>>>>>> public void setAlias(String gameObject, String func, String unity_alias) { <<<<<<< ======= >>>>>>> <<<<<<< public void clearLocalNotification(String gameObject, String func) { JPushInterface.clearLocalNotification(getActivity); UnityPlayer.UnitySendMessage(gameObject, func, "clearLocalNotification"); } ======= >>>>>>> public void clearLocalNotification(String gameObject, String func) { JPushInterface.clearLocalNotification(getActivity); UnityPlayer.UnitySendMessage(gameObject, func, "clearLocalNotification"); } <<<<<<< ======= >>>>>>>
<<<<<<< import java.io.InputStream; import java.io.PrintWriter; import java.io.StringWriter; import java.util.*; ======= import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; >>>>>>> import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; <<<<<<< // log.error("parse error", e); throw e; ======= log.error("parse error", e); >>>>>>> log.error("parse error", e); throw e; <<<<<<< // log.error("parse error", e); throw e; ======= log.error("parse error", e); >>>>>>> log.error("parse error", e); throw e; <<<<<<< try { Entry<String, Object> request = it2.next(); // 2.请求方式,类似为 get,post,delete,put 这样 requestType = request.getKey(); if ("parameters".equals(requestType)) { continue; } Map<String, Object> content = (Map<String, Object>) request.getValue(); // 4. 大标题(类说明) String title = String.valueOf(((List) content.get("tags")).get(0)); // 5.小标题 (方法说明) String tag = String.valueOf(content.get("operationId")); // 6.接口描述 Object descObj = content.get("description"); String description = descObj == null ? "" : descObj.toString(); // 7. 请求体 List<LinkedHashMap> parameters = (ArrayList) content.get("parameters"); if (!CollectionUtils.isEmpty(parameters)) { if (commonParameters != null) { parameters.addAll(commonParameters); } } else { if (commonParameters != null) { parameters = commonParameters; } } // 8.返回体 Map<String, Object> responses = (LinkedHashMap) content.get("responses"); // 9.请求参数格式,类似于 multipart/form-data List<String> requestParamsFormates = getRequestParamsFormate(content); String requestForm = StringUtils.join(requestParamsFormates, ","); // 取出来状态是200时的返回值 Map<String, Object> obj = (Map<String, Object>) responses.get("200"); Map<String, Object> requestBody = (Map<String, Object>) content.get("requestBody"); // 10.返回参数格式,类似于 application/json List<String> responseParamsFormates = getResponseParamsFormate(obj); String responseForm = StringUtils.join(responseParamsFormates, ","); //封装Table Table table = new Table(); table.setTitle(title); table.setUrl(url); table.setTag(tag); table.setDescription(description); table.setRequestForm(requestForm); table.setResponseForm(responseForm); table.setRequestType(requestType); table.setRequestList(processRequestList(parameters, requestBody, definitinMap)); table.setResponseList(processResponseCodeList(responses, definitinMap)); if (obj != null && obj.get("content") != null) { table.setModelAttr(processResponseModelAttrs(obj, definitinMap)); } //示例 table.setRequestParam(processRequestParam(table.getRequestList())); table.setResponseParam(processResponseParam1(obj, definitinMap)); result.add(table); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); throw new JsonProcessingException(url + "接口格式不正确: " + requestType + "请求 " + e.getMessage()) {}; } ======= Entry<String, Object> request = it2.next(); // 2.请求方式,类似为 get,post,delete,put 这样 String requestType = request.getKey(); if ("parameters".equals(requestType)) { continue; } Map<String, Object> content = (Map<String, Object>) request.getValue(); // 4. 大标题(类说明) String title = String.valueOf(((List) content.get("tags")).get(0)); // 5.小标题 (方法说明) String tag = String.valueOf(content.get("operationId")); // 6.接口描述 Object descObj = content.get("description"); String description = descObj == null ? "" : descObj.toString(); // 7. 请求体 List<LinkedHashMap> parameters = (ArrayList) content.get("parameters"); if (!CollectionUtils.isEmpty(parameters)) { if (commonParameters != null) { parameters.addAll(commonParameters); } } else { if (commonParameters != null) { parameters = commonParameters; } } // 8.返回体 Map<String, Object> responses = (LinkedHashMap) content.get("responses"); // 9.请求参数格式,类似于 multipart/form-data List<String> requestParamsFormates = getRequestParamsFormate(content); String requestForm = StringUtils.join(requestParamsFormates, ","); // 取出来状态是200时的返回值 Map<String, Object> obj = (Map<String, Object>) responses.get("200"); Map<String, Object> requestBody = (Map<String, Object>) content.get("requestBody"); // 10.返回参数格式,类似于 application/json List<String> responseParamsFormates = getResponseParamsFormate(obj); String responseForm = StringUtils.join(responseParamsFormates, ","); //封装Table Table table = new Table(); table.setTitle(title); table.setUrl(url); table.setTag(tag); table.setDescription(description); table.setRequestForm(requestForm); table.setResponseForm(responseForm); table.setRequestType(requestType); table.setRequestList(processRequestList(parameters, requestBody, definitinMap)); table.setResponseList(processResponseCodeList(responses, definitinMap)); if (obj != null && obj.get("content") != null) { table.setModelAttr(processResponseModelAttrs(obj, definitinMap)); } //示例 table.setRequestParam(processRequestParam(table.getRequestList())); table.setResponseParam(processResponseParam1(obj, definitinMap)); result.add(table); >>>>>>> try { Entry<String, Object> request = it2.next(); // 2.请求方式,类似为 get,post,delete,put 这样 requestType = request.getKey(); if ("parameters".equals(requestType)) { continue; } Map<String, Object> content = (Map<String, Object>) request.getValue(); // 4. 大标题(类说明) String title = String.valueOf(((List) content.get("tags")).get(0)); // 5.小标题 (方法说明) String tag = String.valueOf(content.get("operationId")); // 6.接口描述 Object descObj = content.get("description"); String description = descObj == null ? "" : descObj.toString(); // 7. 请求体 List<LinkedHashMap> parameters = (ArrayList) content.get("parameters"); if (!CollectionUtils.isEmpty(parameters)) { if (commonParameters != null) { parameters.addAll(commonParameters); } } else { if (commonParameters != null) { parameters = commonParameters; } } // 8.返回体 Map<String, Object> responses = (LinkedHashMap) content.get("responses"); // 9.请求参数格式,类似于 multipart/form-data List<String> requestParamsFormates = getRequestParamsFormate(content); String requestForm = StringUtils.join(requestParamsFormates, ","); // 取出来状态是200时的返回值 Map<String, Object> obj = (Map<String, Object>) responses.get("200"); Map<String, Object> requestBody = (Map<String, Object>) content.get("requestBody"); // 10.返回参数格式,类似于 application/json List<String> responseParamsFormates = getResponseParamsFormate(obj); String responseForm = StringUtils.join(responseParamsFormates, ","); //封装Table Table table = new Table(); table.setTitle(title); table.setUrl(url); table.setTag(tag); table.setDescription(description); table.setRequestForm(requestForm); table.setResponseForm(responseForm); table.setRequestType(requestType); table.setRequestList(processRequestList(parameters, requestBody, definitinMap)); table.setResponseList(processResponseCodeList(responses, definitinMap)); if (obj != null && obj.get("content") != null) { table.setModelAttr(processResponseModelAttrs(obj, definitinMap)); } //示例 table.setRequestParam(processRequestParam(table.getRequestList())); table.setResponseParam(processResponseParam1(obj, definitinMap)); result.add(table); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); throw new JsonProcessingException(url + "接口格式不正确: " + requestType + "请求 " + e.getMessage()) {}; } <<<<<<< request.setType(schema == null ? " " : schema.get("type").toString()); ======= // request.setType(schema == null ? " " : schema.get("type").toString()); >>>>>>> request.setType(schema == null ? " " : schema.get("type").toString()); <<<<<<< private List<Response> processResponseCodeList(Map<String, Object> responses, Map<String, ModelAttr> definitinMap ) throws JsonProcessingException { ======= private List<Response> processResponseCodeList(Map<String, Object> responses, Map<String, ModelAttr> definitinMap) { >>>>>>> private List<Response> processResponseCodeList(Map<String, Object> responses, Map<String, ModelAttr> definitinMap ) throws JsonProcessingException {
<<<<<<< // 处理方案二: 新增: 同一路由下所有请求方式单独为一个表格 /*private Map<String, Object> getResultFromString(List<Table> result, String jsonStr) throws IOException { // convert JSON string to Map Map<String, Object> map = JsonUtils.readValue(jsonStr, HashMap.class); //解析model Map<String, ModelAttr> definitinMap = parseDefinitions(map); //解析paths Map<String, Map<String, Object>> paths = (Map<String, Map<String, Object>>) map.get("paths"); //获取全局请求参数格式作为默认请求参数格式 List<String> defaultConsumes = (List) map.get("consumes"); //获取全局响应参数格式作为默认响应参数格式 List<String> defaultProduces = (List) map.get("produces"); if (paths != null) { Iterator<Entry<String, Map<String, Object>>> it = paths.entrySet().iterator(); while (it.hasNext()) { Entry<String, Map<String, Object>> path = it.next(); // 0. 获取该路由下所有请求方式的公共参数 Map<String, Object> methods = (Map<String, Object>) path.getValue(); List<LinkedHashMap> commonParameters = (ArrayList) methods.get("parameters"); Iterator<Entry<String, Object>> it2 = path.getValue().entrySet().iterator(); // 1.请求路径 String url = path.getKey(); while (it2.hasNext()) { Entry<String, Object> request = it2.next(); // 2.请求方式,类似为 get,post,delete,put 这样 String requestType = request.getKey(); if ("parameters".equals(requestType)) { continue; } Map<String, Object> content = (Map<String, Object>) request.getValue(); // 4. 大标题(类说明) String title = String.valueOf(((List) content.get("tags")).get(0)); // 5.小标题 (方法说明) String tag = String.valueOf(content.get("operationId")); // 6.接口描述 String description = String.valueOf(content.get("description")); // 7.请求参数格式,类似于 multipart/form-data String requestForm = ""; List<String> consumes = (List) content.get("consumes"); if (consumes != null && consumes.size() > 0) { requestForm = StringUtils.join(consumes, ","); } else { requestForm = StringUtils.join(defaultConsumes, ","); } // 8.返回参数格式,类似于 application/json String responseForm = ""; List<String> produces = (List) content.get("produces"); if (produces != null && produces.size() > 0) { responseForm = StringUtils.join(produces, ","); } else { responseForm = StringUtils.join(defaultProduces, ","); } // 9. 请求体 List<LinkedHashMap> parameters = (ArrayList) content.get("parameters"); if (!CollectionUtils.isEmpty(parameters)) { if (commonParameters != null) { parameters.addAll(commonParameters); } } else { if (commonParameters != null) { parameters = commonParameters; } } // 10.返回体 Map<String, Object> responses = (LinkedHashMap) content.get("responses"); //封装Table Table table = new Table(); table.setTitle(title); table.setUrl(url); table.setTag(tag); table.setDescription(description); table.setRequestForm(requestForm); table.setResponseForm(responseForm); table.setRequestType(requestType); table.setRequestList(processRequestList(parameters, definitinMap)); table.setResponseList(processResponseCodeList(responses)); // 取出来状态是200时的返回值 Map<String, Object> obj = (Map<String, Object>) responses.get("200"); if (obj != null && obj.get("schema") != null) { table.setModelAttr(processResponseModelAttrs(obj, definitinMap)); } //示例 table.setRequestParam(processRequestParam(table.getRequestList())); table.setResponseParam(processResponseParam(obj, definitinMap)); result.add(table); } } } return map; }*/ /** * 处理请求参数列表 * * @param parameters * @param definitinMap * @return */ private List<Request> processRequestList(List<LinkedHashMap> parameters, Map<String, ModelAttr> definitinMap) { List<Request> requestList = new ArrayList<>(); ======= /** * 处理请求参数列表 * * @param parameters * @return */ private List<Request> processRequestList(List<LinkedHashMap> parameters) { List<Request> requestList = new ArrayList<>(); >>>>>>> // 处理方案二: 新增: 同一路由下所有请求方式单独为一个表格 /*private Map<String, Object> getResultFromString(List<Table> result, String jsonStr) throws IOException { // convert JSON string to Map Map<String, Object> map = JsonUtils.readValue(jsonStr, HashMap.class); //解析model Map<String, ModelAttr> definitinMap = parseDefinitions(map); //解析paths Map<String, Map<String, Object>> paths = (Map<String, Map<String, Object>>) map.get("paths"); //获取全局请求参数格式作为默认请求参数格式 List<String> defaultConsumes = (List) map.get("consumes"); //获取全局响应参数格式作为默认响应参数格式 List<String> defaultProduces = (List) map.get("produces"); if (paths != null) { Iterator<Entry<String, Map<String, Object>>> it = paths.entrySet().iterator(); while (it.hasNext()) { Entry<String, Map<String, Object>> path = it.next(); // 0. 获取该路由下所有请求方式的公共参数 Map<String, Object> methods = (Map<String, Object>) path.getValue(); List<LinkedHashMap> commonParameters = (ArrayList) methods.get("parameters"); Iterator<Entry<String, Object>> it2 = path.getValue().entrySet().iterator(); // 1.请求路径 String url = path.getKey(); while (it2.hasNext()) { Entry<String, Object> request = it2.next(); // 2.请求方式,类似为 get,post,delete,put 这样 String requestType = request.getKey(); if ("parameters".equals(requestType)) { continue; } Map<String, Object> content = (Map<String, Object>) request.getValue(); // 4. 大标题(类说明) String title = String.valueOf(((List) content.get("tags")).get(0)); // 5.小标题 (方法说明) String tag = String.valueOf(content.get("operationId")); // 6.接口描述 String description = String.valueOf(content.get("description")); // 7.请求参数格式,类似于 multipart/form-data String requestForm = ""; List<String> consumes = (List) content.get("consumes"); if (consumes != null && consumes.size() > 0) { requestForm = StringUtils.join(consumes, ","); } else { requestForm = StringUtils.join(defaultConsumes, ","); } // 8.返回参数格式,类似于 application/json String responseForm = ""; List<String> produces = (List) content.get("produces"); if (produces != null && produces.size() > 0) { responseForm = StringUtils.join(produces, ","); } else { responseForm = StringUtils.join(defaultProduces, ","); } // 9. 请求体 List<LinkedHashMap> parameters = (ArrayList) content.get("parameters"); if (!CollectionUtils.isEmpty(parameters)) { if (commonParameters != null) { parameters.addAll(commonParameters); } } else { if (commonParameters != null) { parameters = commonParameters; } } // 10.返回体 Map<String, Object> responses = (LinkedHashMap) content.get("responses"); //封装Table Table table = new Table(); table.setTitle(title); table.setUrl(url); table.setTag(tag); table.setDescription(description); table.setRequestForm(requestForm); table.setResponseForm(responseForm); table.setRequestType(requestType); table.setRequestList(processRequestList(parameters, definitinMap)); table.setResponseList(processResponseCodeList(responses)); // 取出来状态是200时的返回值 Map<String, Object> obj = (Map<String, Object>) responses.get("200"); if (obj != null && obj.get("schema") != null) { table.setModelAttr(processResponseModelAttrs(obj, definitinMap)); } //示例 table.setRequestParam(processRequestParam(table.getRequestList())); table.setResponseParam(processResponseParam(obj, definitinMap)); result.add(table); } } } return map; }*/ /** * 处理请求参数列表 * * @param parameters * @param definitinMap * @return */ private List<Request> processRequestList(List<LinkedHashMap> parameters, Map<String, ModelAttr> definitinMap) { List<Request> requestList = new ArrayList<>(); <<<<<<< ======= request.setParamType(ref == null ? "{}" : ref.toString()); } else { request.setType(param.get("type") == null ? "Object" : UpperStringFirst(param.get("type").toString())); request.setParamType(String.valueOf(in)); >>>>>>> <<<<<<< } /** * 处理返回码列表 * * @param responses 全部状态码返回对象 * @return */ private List<Response> processResponseCodeList(Map<String, Object> responses) { List<Response> responseList = new ArrayList<>(); Iterator<Map.Entry<String, Object>> resIt = responses.entrySet().iterator(); while (resIt.hasNext()) { Map.Entry<String, Object> entry = resIt.next(); ======= } public static String UpperStringFirst(String str) { if (org.springframework.util.StringUtils.isEmpty(str)) { return str; } else { return str.substring(0, 1).toUpperCase() + str.substring(1); } } /** * 处理返回码列表 * * @param responses * @return */ private List<Response> processResponseCodeList(Map<String, Object> responses) { List<Response> responseList = new ArrayList<>(); Iterator<Map.Entry<String, Object>> it3 = responses.entrySet().iterator(); while (it3.hasNext()) { >>>>>>> } /** * 处理返回码列表 * * @param responses 全部状态码返回对象 * @return */ private List<Response> processResponseCodeList(Map<String, Object> responses) { List<Response> responseList = new ArrayList<>(); Iterator<Map.Entry<String, Object>> resIt = responses.entrySet().iterator(); while (resIt.hasNext()) { Map.Entry<String, Object> entry = resIt.next(); <<<<<<< private Map<String, ModelAttr> parseDefinitions(Map<String, Object> map) { Map<String, Map<String, Object>> definitions = (Map<String, Map<String, Object>>) map.get("definitions"); Map<String, ModelAttr> definitinMap = new HashMap<>(256); if (definitions != null) { Iterator<String> modelNameIt = definitions.keySet().iterator(); while (modelNameIt.hasNext()) { String modeName = modelNameIt.next(); getAndPutModelAttr(definitions, definitinMap, modeName); } ======= private Map<String, Object> parseDefinitions(Map<String, Object> map) { Map<String, Map<String, Object>> definitions = (Map<String, Map<String, Object>>) map.get("definitions"); Map<String, Object> definitinMap = new HashMap<String, Object>(); if (definitions != null) { Iterator<String> modelNameIt = definitions.keySet().iterator(); String modeName = null; Entry<String, Object> pEntry = null; ResponseModelAttr modeAttr = null; Map<String, Object> attrInfoMap = null; while (modelNameIt.hasNext()) { modeName = modelNameIt.next(); Map<String, Object> modeProperties = (Map<String, Object>) definitions.get(modeName).get("properties"); //当参数获取为空时跳过 List<ResponseModelAttr> attrList = new ArrayList<>(); Map<String, Object> mode = new HashMap<>(); if (modeProperties == null) { mode.put("title", definitions.get(modeName).get("title")); mode.put("description", definitions.get(modeName).get("description")); mode.put("properties", attrList); definitinMap.put("#/definitions/" + modeName, mode); continue; } Iterator<Entry<String, Object>> pIt = modeProperties.entrySet().iterator(); //解析属性 while (pIt.hasNext()) { pEntry = pIt.next(); modeAttr = new ResponseModelAttr(); modeAttr.setValue(pEntry.getKey()); attrInfoMap = (Map<String, Object>) pEntry.getValue(); modeAttr.setName((String) attrInfoMap.get("description")); modeAttr.setType((String) attrInfoMap.get("type")); if (attrInfoMap.get("format") != null) { modeAttr.setType(modeAttr.getType() + "(" + (String) attrInfoMap.get("format") + ")"); } attrList.add(modeAttr); } mode.put("title", definitions.get(modeName).get("title")); mode.put("description", definitions.get(modeName).get("description")); mode.put("properties", attrList); definitinMap.put("#/definitions/" + modeName, mode); } >>>>>>> private Map<String, ModelAttr> parseDefinitions(Map<String, Object> map) { Map<String, Map<String, Object>> definitions = (Map<String, Map<String, Object>>) map.get("definitions"); Map<String, ModelAttr> definitinMap = new HashMap<>(256); if (definitions != null) { Iterator<String> modelNameIt = definitions.keySet().iterator(); while (modelNameIt.hasNext()) { String modeName = modelNameIt.next(); getAndPutModelAttr(definitions, definitinMap, modeName); }
<<<<<<< ======= private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400; private static final StatusHandler DEFAULT_STATUS_HANDLER = new StatusHandler(STATUS_CODE_ERROR, DefaultResponseSpec::createResponseException); >>>>>>> private static final IntPredicate STATUS_CODE_ERROR = value -> value >= 400; <<<<<<< Assert.notNull(statusPredicate, "StatusPredicate must not be null"); Assert.notNull(exceptionFunction, "Function must not be null"); ======= if (this.statusHandlers.size() == 1 && this.statusHandlers.get(0) == DEFAULT_STATUS_HANDLER) { this.statusHandlers.clear(); } this.statusHandlers.add(new StatusHandler(statusCodePredicate, (clientResponse, request) -> exceptionFunction.apply(clientResponse))); >>>>>>> Assert.notNull(statusCodePredicate, "StatusCodePredicate must not be null"); Assert.notNull(exceptionFunction, "Function must not be null"); <<<<<<< public StatusHandler(Predicate<HttpStatus> predicate, Function<ClientResponse, Mono<? extends Throwable>> exceptionFunction) { ======= public StatusHandler(IntPredicate predicate, BiFunction<ClientResponse, HttpRequest, Mono<? extends Throwable>> exceptionFunction) { >>>>>>> public StatusHandler(IntPredicate predicate, Function<ClientResponse, Mono<? extends Throwable>> exceptionFunction) {
<<<<<<< private final NettyDataBufferFactory bufferFactory; private final HttpHeaders headers; private final AtomicBoolean rejectSubscribers = new AtomicBoolean(); ======= @Nullable private final Connection connection; >>>>>>> private final NettyDataBufferFactory bufferFactory; private final Connection connection; private final HttpHeaders headers;
<<<<<<< public void registerBean(Class<?> annotatedClass, @Nullable String name) { doRegisterBean(annotatedClass, name, null, null, null); ======= public <T> void registerBean(Class<T> beanClass, String name, @Nullable Supplier<T> instanceSupplier) { doRegisterBean(beanClass, instanceSupplier, name, null); >>>>>>> public void registerBean(Class<?> beanClass, @Nullable String name) { doRegisterBean(beanClass, name, null, null, null); <<<<<<< public void registerBean(Class<?> annotatedClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(annotatedClass, null, qualifiers, null, null); ======= public void registerBean(Class<?> beanClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(beanClass, null, null, qualifiers); >>>>>>> public void registerBean(Class<?> beanClass, Class<? extends Annotation>... qualifiers) { doRegisterBean(beanClass, null, qualifiers, null, null); <<<<<<< private <T> void doRegisterBean(Class<T> annotatedClass, @Nullable String name, @Nullable Class<? extends Annotation>[] qualifiers, @Nullable Supplier<T> supplier, @Nullable BeanDefinitionCustomizer[] customizers) { ======= <T> void doRegisterBean(Class<T> beanClass, @Nullable Supplier<T> instanceSupplier, @Nullable String name, @Nullable Class<? extends Annotation>[] qualifiers, BeanDefinitionCustomizer... definitionCustomizers) { >>>>>>> private <T> void doRegisterBean(Class<T> beanClass, @Nullable String name, @Nullable Class<? extends Annotation>[] qualifiers, @Nullable Supplier<T> supplier, @Nullable BeanDefinitionCustomizer[] customizers) {
<<<<<<< ======= import io.netty.buffer.ByteBufAllocator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; >>>>>>> import io.netty.buffer.ByteBufAllocator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; <<<<<<< ======= import org.springframework.lang.Nullable; >>>>>>> <<<<<<< ======= private static final Log logger = LogFactory.getLog(ReactorClientHttpResponse.class); private final NettyDataBufferFactory bufferFactory; >>>>>>> private static final Log logger = LogFactory.getLog(ReactorClientHttpResponse.class); <<<<<<< this.connection = connection; MultiValueMap<String, String> adapter = new NettyHeadersAdapter(response.responseHeaders()); this.headers = HttpHeaders.readOnlyHttpHeaders(adapter); ======= this.logPrefix = (logger.isDebugEnabled() ? "[" + connection.channel().id().asShortText() + "] " : ""); } /** * Constructor with inputs extracted from a {@link Connection}. * @deprecated as of 5.2.8 */ @Deprecated public ReactorClientHttpResponse(HttpClientResponse response, NettyInbound inbound, ByteBufAllocator alloc) { this.response = response; this.inbound = inbound; this.bufferFactory = new NettyDataBufferFactory(alloc); this.logPrefix = ""; >>>>>>> this.logPrefix = (logger.isDebugEnabled() ? "[" + connection.channel().id().asShortText() + "] " : ""); } /** * Constructor with inputs extracted from a {@link Connection}. * @deprecated as of 5.2.8 */ @Deprecated public ReactorClientHttpResponse(HttpClientResponse response, NettyInbound inbound, ByteBufAllocator alloc) { this.response = response; MultiValueMap<String, String> adapter = new NettyHeadersAdapter(response.responseHeaders()); this.headers = HttpHeaders.readOnlyHttpHeaders(adapter); this.inbound = inbound; this.bufferFactory = new NettyDataBufferFactory(alloc); this.logPrefix = ""; <<<<<<< /** * For use by {@link ReactorClientHttpConnector}. */ Connection getConnection() { return this.connection; ======= private boolean mayHaveBody(HttpMethod method) { int code = this.getRawStatusCode(); return !((code >= 100 && code < 200) || code == 204 || code == 205 || method.equals(HttpMethod.HEAD) || getHeaders().getContentLength() == 0); >>>>>>> private boolean mayHaveBody(HttpMethod method) { int code = this.getRawStatusCode(); return !((code >= 100 && code < 200) || code == 204 || code == 205 || method.equals(HttpMethod.HEAD) || getHeaders().getContentLength() == 0);
<<<<<<< import org.n52.svalbard.encode.Encoder; import org.n52.svalbard.encode.EncoderRepository; import org.n52.svalbard.encode.ObservationEncoder; ======= >>>>>>>
<<<<<<< TransactionTemplate tt = new TransactionTemplate(tm); boolean condition3 = !TransactionSynchronizationManager.hasResource(dsToUse); assertThat(condition3).as("Hasn't thread connection").isTrue(); boolean condition2 = !TransactionSynchronizationManager.isSynchronizationActive(); assertThat(condition2).as("Synchronization not active").isTrue(); ======= TransactionTemplate tt = new TransactionTemplate(tm); assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse)); assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive()); >>>>>>> TransactionTemplate tt = new TransactionTemplate(tm); boolean condition3 = !TransactionSynchronizationManager.hasResource(dsToUse); assertThat(condition3).as("Hasn't thread connection").isTrue(); boolean condition2 = !TransactionSynchronizationManager.isSynchronizationActive(); assertThat(condition2).as("Synchronization not active").isTrue(); <<<<<<< assertThat(((ConnectionProxy) dsProxy.getConnection()).getTargetConnection()).isEqualTo(con); ======= Connection tCon = dsProxy.getConnection(); tCon.getWarnings(); tCon.clearWarnings(); assertEquals(con, ((ConnectionProxy) dsProxy.getConnection()).getTargetConnection()); >>>>>>> Connection tCon = dsProxy.getConnection(); tCon.getWarnings(); tCon.clearWarnings(); assertThat(((ConnectionProxy) dsProxy.getConnection()).getTargetConnection()).isEqualTo(con);
<<<<<<< * Check if the given type represents a "simple" property: * a primitive, a String or other CharSequence, a Number, a Date, * a Temporal, a URI, a URL, a Locale, a Class, or a corresponding array. ======= * Check if the given type represents a "simple" property: a simple value * type or an array of simple value types. * <p>See {@link #isSimpleValueType(Class)} for the definition of <em>simple * value type</em>. >>>>>>> * Check if the given type represents a "simple" property: a simple value * type or an array of simple value types. * <p>See {@link #isSimpleValueType(Class)} for the definition of <em>simple * value type</em>. <<<<<<< * Check if the given type represents a "simple" value type: * a primitive, an enum, a String or other CharSequence, a Number, a Date, * a Temporal, a URI, a URL, a Locale or a Class. * @param clazz the type to check ======= * Check if the given type represents a "simple" value type: a primitive or * primitive wrapper, an enum, a String or other CharSequence, a Number, a * Date, a URI, a URL, a Locale, or a Class. * <p>{@code Void} and {@code void} are not considered simple value types. * @param type the type to check >>>>>>> * Check if the given type represents a "simple" value type: a primitive or * primitive wrapper, an enum, a String or other CharSequence, a Number, a * Date, a Temporal, a URI, a URL, a Locale, or a Class. * <p>{@code Void} and {@code void} are not considered simple value types. * @param type the type to check <<<<<<< public static boolean isSimpleValueType(Class<?> clazz) { return (ClassUtils.isPrimitiveOrWrapper(clazz) || Enum.class.isAssignableFrom(clazz) || CharSequence.class.isAssignableFrom(clazz) || Number.class.isAssignableFrom(clazz) || Date.class.isAssignableFrom(clazz) || Temporal.class.isAssignableFrom(clazz) || URI.class == clazz || URL.class == clazz || Locale.class == clazz || Class.class == clazz); ======= public static boolean isSimpleValueType(Class<?> type) { return (type != void.class && type != Void.class && (ClassUtils.isPrimitiveOrWrapper(type) || Enum.class.isAssignableFrom(type) || CharSequence.class.isAssignableFrom(type) || Number.class.isAssignableFrom(type) || Date.class.isAssignableFrom(type) || URI.class == type || URL.class == type || Locale.class == type || Class.class == type)); >>>>>>> public static boolean isSimpleValueType(Class<?> type) { return (type != void.class && type != Void.class && (ClassUtils.isPrimitiveOrWrapper(type) || Enum.class.isAssignableFrom(type) || CharSequence.class.isAssignableFrom(type) || Number.class.isAssignableFrom(type) || Date.class.isAssignableFrom(type) || Temporal.class.isAssignableFrom(type) || URI.class == type || URL.class == type || Locale.class == type || Class.class == type));
<<<<<<< import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import static org.assertj.core.api.Assertions.assertThat; ======= import static org.hamcrest.core.Is.*; import static org.hamcrest.core.StringContains.*; import static org.junit.Assert.*; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; <<<<<<< assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Size of Password must be between 8 and 128"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); ======= assertNotNull(error); assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Size of Password must be between 8 and 128")); assertTrue(error.contains(ConstraintViolation.class)); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("password")); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString()), is(error.toString())); >>>>>>> assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Size of Password must be between 8 and 128"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString())).isEqualTo(error.toString()); <<<<<<< assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Password must be same value as Password(Confirm)"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); ======= assertNotNull(error); assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Password must be same value as Password(Confirm)")); assertTrue(error.contains(ConstraintViolation.class)); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("password")); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString()), is(error.toString())); >>>>>>> assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Password must be same value as Password(Confirm)"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString())).isEqualTo(error.toString());
<<<<<<< import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import static org.assertj.core.api.Assertions.assertThat; ======= import static org.hamcrest.core.Is.*; import static org.hamcrest.core.StringContains.*; import static org.junit.Assert.*; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; <<<<<<< assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Size of Password must be between 8 and 128"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); ======= assertNotNull(error); assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Size of Password must be between 8 and 128")); assertTrue(error.contains(ConstraintViolation.class)); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("password")); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString()), is(error.toString())); >>>>>>> assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Size of Password must be between 8 and 128"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString())).isEqualTo(error.toString()); <<<<<<< assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Password must be same value as Password(Confirm)"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); ======= assertNotNull(error); assertThat(messageSource.getMessage(error, Locale.ENGLISH), is("Password must be same value as Password(Confirm)")); assertTrue(error.contains(ConstraintViolation.class)); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString(), is("password")); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString()), is(error.toString())); >>>>>>> assertThat(error).isNotNull(); assertThat(messageSource.getMessage(error, Locale.ENGLISH)).isEqualTo("Password must be same value as Password(Confirm)"); assertThat(error.contains(ConstraintViolation.class)).isTrue(); assertThat(error.unwrap(ConstraintViolation.class).getPropertyPath().toString()).isEqualTo("password"); assertThat(SerializationTestUtils.serializeAndDeserialize(error.toString())).isEqualTo(error.toString());
<<<<<<< public boolean equals(@Nullable Object other) { return (this == other || (other instanceof GenericBeanDefinition && super.equals(other))); ======= public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof GenericBeanDefinition)) { return false; } GenericBeanDefinition that = (GenericBeanDefinition) other; return (ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other)); >>>>>>> public boolean equals(@Nullable Object other) { if (this == other) { return true; } if (!(other instanceof GenericBeanDefinition)) { return false; } GenericBeanDefinition that = (GenericBeanDefinition) other; return (ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other));
<<<<<<< * @author Sebastien Deleuze ======= * @author Sam Brannen >>>>>>> * @author Sebastien Deleuze * @author Sam Brannen
<<<<<<< ======= private DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); @Rule public ExpectedException thrown = ExpectedException.none(); >>>>>>> private DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); <<<<<<< DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); MutablePropertyValues pvs = new MutablePropertyValues(); pvs.add("ag", "foobar"); RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); bd.setPropertyValues(pvs); lbf.registerBeanDefinition("tb", bd); assertThatExceptionOfType(BeanCreationException.class).as("invalid property").isThrownBy(() -> lbf.getBean("tb")) .withCauseInstanceOf(NotWritablePropertyException.class) .satisfies(ex -> { NotWritablePropertyException cause = (NotWritablePropertyException) ex.getCause(); assertThat(cause.getPossibleMatches()).hasSize(1); assertThat(cause.getPossibleMatches()[0]).isEqualTo("age"); }); ======= try { MutablePropertyValues pvs = new MutablePropertyValues(); pvs.add("ag", "foobar"); RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); bd.setPropertyValues(pvs); lbf.registerBeanDefinition("tb", bd); lbf.getBean("tb"); fail("Should throw exception on invalid property"); } catch (BeanCreationException ex) { assertTrue(ex.getCause() instanceof NotWritablePropertyException); NotWritablePropertyException cause = (NotWritablePropertyException) ex.getCause(); // expected assertEquals(1, cause.getPossibleMatches().length); assertEquals("age", cause.getPossibleMatches()[0]); } >>>>>>> MutablePropertyValues pvs = new MutablePropertyValues(); pvs.add("ag", "foobar"); RootBeanDefinition bd = new RootBeanDefinition(TestBean.class); bd.setPropertyValues(pvs); lbf.registerBeanDefinition("tb", bd); assertThatExceptionOfType(BeanCreationException.class).as("invalid property").isThrownBy(() -> lbf.getBean("tb")) .withCauseInstanceOf(NotWritablePropertyException.class) .satisfies(ex -> { NotWritablePropertyException cause = (NotWritablePropertyException) ex.getCause(); assertThat(cause.getPossibleMatches()).hasSize(1); assertThat(cause.getPossibleMatches()[0]).isEqualTo("age"); }); <<<<<<< given(beanExpressionResolver.evaluate(eq("#{foo}"), any(BeanExpressionContext.class))) .willReturn("classpath:/org/springframework/beans/factory/xml/util.properties"); bf.setBeanExpressionResolver(beanExpressionResolver); ======= when(beanExpressionResolver.evaluate(eq("#{foo}"), ArgumentMatchers.any(BeanExpressionContext.class))) .thenReturn("classpath:/org/springframework/beans/factory/xml/util.properties"); lbf.setBeanExpressionResolver(beanExpressionResolver); >>>>>>> given(beanExpressionResolver.evaluate(eq("#{foo}"), any(BeanExpressionContext.class))) .willReturn("classpath:/org/springframework/beans/factory/xml/util.properties"); lbf.setBeanExpressionResolver(beanExpressionResolver); <<<<<<< bf.registerBeanDefinition("myProperties", rbd); Properties properties = (Properties) bf.getBean("myProperties"); assertThat(properties.getProperty("foo")).isEqualTo("bar"); ======= lbf.registerBeanDefinition("myProperties", rbd); Properties properties = (Properties) lbf.getBean("myProperties"); assertEquals("bar", properties.getProperty("foo")); >>>>>>> lbf.registerBeanDefinition("myProperties", rbd); Properties properties = (Properties) lbf.getBean("myProperties"); assertThat(properties.getProperty("foo")).isEqualTo("bar"); <<<<<<< DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(TestBean.class)); ======= lbf.getBean(TestBean.class); >>>>>>> DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(TestBean.class)); <<<<<<< DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(ConstructorDependency.class)); assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(ConstructorDependency.class, 42)); ======= try { lbf.getBean(ConstructorDependency.class); fail("Should have thrown NoSuchBeanDefinitionException"); } catch (NoSuchBeanDefinitionException ex) { // expected } try { lbf.getBean(ConstructorDependency.class, 42); fail("Should have thrown NoSuchBeanDefinitionException"); } catch (NoSuchBeanDefinitionException ex) { // expected } >>>>>>> assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(ConstructorDependency.class)); assertThatExceptionOfType(NoSuchBeanDefinitionException.class).isThrownBy(() -> lbf.getBean(ConstructorDependency.class, 42)); <<<<<<< DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); assertThatExceptionOfType(UnsatisfiedDependencyException.class).isThrownBy(() -> lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true)); ======= try { lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true); fail("Should have thrown UnsatisfiedDependencyException"); } catch (UnsatisfiedDependencyException ex) { // expected } >>>>>>> assertThatExceptionOfType(UnsatisfiedDependencyException.class).isThrownBy(() -> lbf.autowire(DependenciesBean.class, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true)); <<<<<<< DefaultListableBeanFactory lbf = new DefaultListableBeanFactory(); assertThatIllegalArgumentException().isThrownBy(() -> lbf.autowireBeanProperties(new TestBean(), AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false)); ======= try { lbf.autowireBeanProperties(new TestBean(), AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException expected) { } >>>>>>> assertThatIllegalArgumentException().isThrownBy(() -> lbf.autowireBeanProperties(new TestBean(), AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR, false)); <<<<<<< assertThat(bf.containsBean("abs")).isEqualTo(true); assertThat(bf.containsBean("bogus")).isEqualTo(false); ======= assertThat(lbf.containsBean("abs"), equalTo(true)); assertThat(lbf.containsBean("bogus"), equalTo(false)); >>>>>>> assertThat(lbf.containsBean("abs")).isEqualTo(true); assertThat(lbf.containsBean("bogus")).isEqualTo(false); <<<<<<< bf.registerBeanDefinition("optionalBean", bd); assertThat((Optional<?>) bf.getBean(Optional.class)).isEqualTo(Optional.of("CONTENT")); ======= lbf.registerBeanDefinition("optionalBean", bd); assertEquals(Optional.of("CONTENT"), lbf.getBean(Optional.class)); >>>>>>> lbf.registerBeanDefinition("optionalBean", bd); assertThat((Optional<?>) lbf.getBean(Optional.class)).isEqualTo(Optional.of("CONTENT")); <<<<<<< bf.registerBeanDefinition("optionalBean", bd); assertThat((Optional<?>) bf.getBean(Optional.class)).isSameAs(Optional.empty()); ======= lbf.registerBeanDefinition("optionalBean", bd); assertSame(Optional.empty(), lbf.getBean(Optional.class)); >>>>>>> lbf.registerBeanDefinition("optionalBean", bd); assertThat((Optional<?>) lbf.getBean(Optional.class)).isSameAs(Optional.empty()); <<<<<<< bf.registerBeanDefinition("holderBean", bd); NonPublicEnumHolder holder = (NonPublicEnumHolder) bf.getBean("holderBean"); assertThat(holder.getNonPublicEnum()).isEqualTo(NonPublicEnum.VALUE_1); ======= lbf.registerBeanDefinition("holderBean", bd); NonPublicEnumHolder holder = (NonPublicEnumHolder) lbf.getBean("holderBean"); assertEquals(NonPublicEnum.VALUE_1, holder.getNonPublicEnum()); >>>>>>> lbf.registerBeanDefinition("holderBean", bd); NonPublicEnumHolder holder = (NonPublicEnumHolder) lbf.getBean("holderBean"); assertThat(holder.getNonPublicEnum()).isEqualTo(NonPublicEnum.VALUE_1);
<<<<<<< ======= import java.net.URI; import java.net.URL; import java.time.DayOfWeek; import java.util.ArrayList; import java.util.Date; >>>>>>> import java.net.URI; import java.net.URL; import java.time.DayOfWeek; import java.util.Date; <<<<<<< import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; ======= import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; <<<<<<< * @author Sebastien Deleuze ======= * @author Sam Brannen >>>>>>> * @author Sebastien Deleuze * @author Sam Brannen <<<<<<< private static class BeanWithNullableTypes { ======= @SuppressWarnings("unused") private static class BeanWithSingleNonDefaultConstructor { >>>>>>> private static class BeanWithNullableTypes {
<<<<<<< import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; ======= import org.simpleframework.xml.Element; import org.simpleframework.xml.ElementList; import org.simpleframework.xml.Root; >>>>>>> import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; <<<<<<< this.rows = new ArrayList<RowResource>(); ======= this.entries = new ArrayList<RowResource>(); this.resumeParameter = null; >>>>>>> this.rows = new ArrayList<RowResource>(); this.resumeParameter = null; <<<<<<< public RowResourceList(ArrayList<RowResource> rows, String refetchCursor, String backCursor, String resumeCursor, boolean hasMore, boolean hasPrior) { if ( rows == null ) { this.rows = new ArrayList<RowResource>(); ======= public RowResourceList(ArrayList<RowResource> entries, String resumeParameter) { this.resumeParameter = resumeParameter; if ( entries == null ) { this.entries = new ArrayList<RowResource>(); >>>>>>> public RowResourceList(ArrayList<RowResource> rows, String refetchCursor, String backCursor, String resumeCursor, boolean hasMore, boolean hasPrior) { if ( rows == null ) { this.rows = new ArrayList<RowResource>(); <<<<<<< public boolean isHasPriorResults() { return hasPriorResults; ======= public String getResumeParameter() { return resumeParameter; } public void setResumeParameter(String resumeParameter) { this.resumeParameter = resumeParameter; } public ArrayList<RowResource> getEntries() { return entries; >>>>>>> public boolean isHasPriorResults() { return hasPriorResults; <<<<<<< result = prime * result + ((rows == null) ? 0 : rows.hashCode()); result = prime * result + ((webSafeRefetchCursor == null) ? 0 : webSafeRefetchCursor.hashCode()); result = prime * result + ((webSafeBackwardCursor == null) ? 0 : webSafeBackwardCursor.hashCode()); result = prime * result + ((webSafeResumeCursor == null) ? 0 : webSafeResumeCursor.hashCode()); result = prime * result + (hasMoreResults ? 0 : 1); result = prime * result + (hasPriorResults ? 0 : 1); ======= result = prime * result + ((resumeParameter == null) ? 0 : resumeParameter.hashCode()); result = prime * result + ((entries == null) ? 0 : entries.hashCode()); >>>>>>> result = prime * result + ((rows == null) ? 0 : rows.hashCode()); result = prime * result + ((webSafeRefetchCursor == null) ? 0 : webSafeRefetchCursor.hashCode()); result = prime * result + ((webSafeBackwardCursor == null) ? 0 : webSafeBackwardCursor.hashCode()); result = prime * result + ((webSafeResumeCursor == null) ? 0 : webSafeResumeCursor.hashCode()); result = prime * result + (hasMoreResults ? 0 : 1); result = prime * result + (hasPriorResults ? 0 : 1); <<<<<<< return (rows == null ? other.rows == null : (rows.size() == other.rows.size() && rows.containsAll(other.rows))) && (webSafeRefetchCursor == null ? other.webSafeRefetchCursor == null : (webSafeRefetchCursor.equals(other.webSafeRefetchCursor))) && (webSafeBackwardCursor == null ? other.webSafeBackwardCursor == null : (webSafeBackwardCursor.equals(other.webSafeBackwardCursor))) && (webSafeResumeCursor == null ? other.webSafeResumeCursor == null : (webSafeResumeCursor.equals(other.webSafeResumeCursor))) && (hasMoreResults == other.hasMoreResults) && (hasPriorResults == other.hasPriorResults); ======= return ((resumeParameter == null) ? other.resumeParameter == null : (resumeParameter .equals(other.resumeParameter))) && ((entries == null ? other.entries == null : (entries.size() == other.entries.size() && entries.containsAll(other.entries) && other.entries.containsAll(entries)))); >>>>>>> return (rows == null ? other.rows == null : (rows.size() == other.rows.size() && rows.containsAll(other.rows))) && (webSafeRefetchCursor == null ? other.webSafeRefetchCursor == null : (webSafeRefetchCursor.equals(other.webSafeRefetchCursor))) && (webSafeBackwardCursor == null ? other.webSafeBackwardCursor == null : (webSafeBackwardCursor.equals(other.webSafeBackwardCursor))) && (webSafeResumeCursor == null ? other.webSafeResumeCursor == null : (webSafeResumeCursor.equals(other.webSafeResumeCursor))) && (hasMoreResults == other.hasMoreResults) && (hasPriorResults == other.hasPriorResults);
<<<<<<< List<String[]> profileArrays = new ArrayList<>(); AnnotationDescriptor<ActiveProfiles> descriptor = findAnnotationDescriptor(testClass, ActiveProfiles.class); ======= Set<String> activeProfiles = new TreeSet<>(); Class<ActiveProfiles> annotationType = ActiveProfiles.class; AnnotationDescriptor<ActiveProfiles> descriptor = MetaAnnotationUtils.findAnnotationDescriptor(testClass, annotationType); >>>>>>> Set<String> activeProfiles = new TreeSet<>(); AnnotationDescriptor<ActiveProfiles> descriptor = findAnnotationDescriptor(testClass, ActiveProfiles.class); <<<<<<< // Reverse the list so that we can traverse "down" the hierarchy. Collections.reverse(profileArrays); Set<String> activeProfiles = new LinkedHashSet<>(); for (String[] profiles : profileArrays) { for (String profile : profiles) { if (StringUtils.hasText(profile)) { activeProfiles.add(profile.trim()); } } } ======= >>>>>>>
<<<<<<< public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_FULL = new MetricColumnFamily("metrics_preaggregated_full", new TimeValue(1, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_5M = new MetricColumnFamily("metrics_preaggregated_5m", new TimeValue(2, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_20M = new MetricColumnFamily("metrics_preaggregated_20m", new TimeValue(3, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_60M = new MetricColumnFamily("metrics_preaggregated_60m", new TimeValue(31, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_240M = new MetricColumnFamily("metrics_preaggregated_240m", new TimeValue(60, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_1440M = new MetricColumnFamily("metrics_preaggregated_1440m", new TimeValue(365, TimeUnit.DAYS)); protected static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED = new ColumnFamily<Locator, Long>("metrics_preaggregated", LocatorSerializer.get(), LongSerializer.get()); public static final ColumnFamily<Locator, String> CF_METRIC_METADATA = new ColumnFamily<Locator, String>("metrics_metadata", ======= public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED = new ColumnFamily<Locator, Long>("metrics_preaggregated", LocatorSerializer.get(), LongSerializer.get()); // todo: use the static constructor for all the CFs. public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_FULL = new MetricColumnFamily("metrics_preaggregated_full", new TimeValue(1, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_5M = new MetricColumnFamily("metrics_preaggregated_5m", new TimeValue(2, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_20M = new MetricColumnFamily("metrics_preaggregated_20m", new TimeValue(3, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_60M = new MetricColumnFamily("metrics_preaggregated_60m", new TimeValue(31, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_240M = new MetricColumnFamily("metrics_preaggregated_240m", new TimeValue(60, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_1440M = new MetricColumnFamily("metrics_preaggregated_1440m", new TimeValue(365, TimeUnit.DAYS)); public static final ColumnFamily<Locator, String> CF_METRIC_METADATA = new ColumnFamily<Locator, String>("metrics_metadata", >>>>>>> public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_FULL = new MetricColumnFamily("metrics_preaggregated_full", new TimeValue(1, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_5M = new MetricColumnFamily("metrics_preaggregated_5m", new TimeValue(2, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_20M = new MetricColumnFamily("metrics_preaggregated_20m", new TimeValue(3, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_60M = new MetricColumnFamily("metrics_preaggregated_60m", new TimeValue(31, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_240M = new MetricColumnFamily("metrics_preaggregated_240m", new TimeValue(60, TimeUnit.DAYS)); public static final ColumnFamily<Locator, Long> CF_METRICS_PREAGGREGATED_1440M = new MetricColumnFamily("metrics_preaggregated_1440m", new TimeValue(365, TimeUnit.DAYS)); public static final ColumnFamily<Locator, String> CF_METRIC_METADATA = new ColumnFamily<Locator, String>("metrics_metadata",
<<<<<<< import org.n52.sos.ogc.gml.CodeWithAuthority; import org.n52.sos.ogc.gml.time.Time; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.gml.time.TimePeriod; import org.n52.sos.ogc.om.NamedValue; import org.n52.sos.ogc.om.OmObservation; import org.n52.sos.ogc.om.SingleObservationValue; import org.n52.sos.ogc.om.StreamingValue; import org.n52.sos.ogc.om.TimeValuePair; import org.n52.sos.ogc.om.values.QuantityValue; import org.n52.sos.ogc.om.values.UnknownValue; import org.n52.sos.ogc.om.values.Value; import org.n52.sos.ogc.ows.OWSConstants.AdditionalRequestParams; ======= >>>>>>> <<<<<<< import org.n52.sos.ogc.sos.Sos2Constants; import org.n52.sos.ogc.swe.SweDataArray; ======= >>>>>>>
<<<<<<< import com.codahale.metrics.Timer; ======= import com.netflix.astyanax.model.ColumnFamily; import com.rackspacecloud.blueflood.cache.MetadataCache; >>>>>>> import com.codahale.metrics.Timer; import com.netflix.astyanax.model.ColumnFamily; import com.rackspacecloud.blueflood.cache.MetadataCache; <<<<<<< private static final Timer calcTimer = Metrics.timer(RollupRunnable.class, "Read And Calculate Rollup"); private static final Timer writeTimer = Metrics.timer(RollupRunnable.class, "Write Rollup"); ======= private static final Timer calcTimer = Metrics.newTimer(RollupRunnable.class, "Read And Calculate Rollup", TimeUnit.MILLISECONDS, TimeUnit.SECONDS); private static final Timer writeTimer = Metrics.newTimer(RollupRunnable.class, "Write Rollup", TimeUnit.MILLISECONDS, TimeUnit.SECONDS); private static final MetadataCache rollupTypeCache = MetadataCache.createLoadingCacheInstance( new TimeValue(48, TimeUnit.HOURS), // todo: need a good default expiration here. Configuration.getInstance().getIntegerProperty(CoreConfig.MAX_ROLLUP_THREADS)); >>>>>>> private static final Timer calcTimer = Metrics.timer(RollupRunnable.class, "Read And Calculate Rollup"); private static final Timer writeTimer = Metrics.timer(RollupRunnable.class, "Write Rollup"); private static final MetadataCache rollupTypeCache = MetadataCache.createLoadingCacheInstance( new TimeValue(48, TimeUnit.HOURS), // todo: need a good default expiration here. Configuration.getInstance().getIntegerProperty(CoreConfig.MAX_ROLLUP_THREADS)); <<<<<<< Timer.Context timerContext = rollupContext.getExecuteTimer().time(); ======= if (log.isDebugEnabled()) { log.debug("Executing rollup from {} for {} {}", new Object[] { rollupContext.getSourceGranularity().shortName(), rollupContext.getRange().toString(), rollupContext.getLocator()}); } // start timing this action. TimerContext timerContext = rollupContext.getExecuteTimer().time(); >>>>>>> if (log.isDebugEnabled()) { log.debug("Executing rollup from {} for {} {}", new Object[] { rollupContext.getSourceGranularity().shortName(), rollupContext.getRange().toString(), rollupContext.getLocator()}); } // start timing this action. Timer.Context timerContext = rollupContext.getExecuteTimer().time(); <<<<<<< Timer.Context writerollupContext = writeTimer.time(); ======= // now save the new rollup. TimerContext writerollupContext = writeTimer.time(); >>>>>>> // now save the new rollup. Timer.Context writerollupContext = writeTimer.time();
<<<<<<< ======= import com.rackspacecloud.blueflood.types.SetRollup; >>>>>>> import com.rackspacecloud.blueflood.types.SetRollup; <<<<<<< private static final Class[] SERIALIZABLE_TYPES = new Class[] { BasicRollup.class, SimpleNumber.class, Object.class, Integer.class, Long.class, // not yet... //TimerRollup.class, //HistogramRollup.class, //CounterRollup.class, }; ======= private static final Class[] SERIALIZABLE_TYPES = new Class[] { BasicRollup.class, SimpleNumber.class, Object.class, Integer.class, Long.class, TimerRollup.class, //HistogramRollup.class, // not implemented yet. CounterRollup.class, SetRollup.class, GaugeRollup.class }; >>>>>>> private static final Class[] SERIALIZABLE_TYPES = new Class[] { BasicRollup.class, SimpleNumber.class, Object.class, Integer.class, Long.class, TimerRollup.class, //HistogramRollup.class, // todo: not implemented yet. CounterRollup.class, SetRollup.class, GaugeRollup.class }; <<<<<<< AbstractSerializer ser = NumericSerializer.serializerFor(SimpleNumber.class); ======= ColumnFamily<Locator, Long> CF_metrics_full = AstyanaxIO.getColumnFamilyMapper().get(Granularity.FULL); AbstractSerializer ser = NumericSerializer.serializerFor(SimpleNumber.class); >>>>>>> AbstractSerializer ser = NumericSerializer.serializerFor(SimpleNumber.class);
<<<<<<< Map<Long, BasicRollup> rollups = new HashMap<Long, BasicRollup>(); ArrayList<SingleRollupWriteContext> writeContexts = new ArrayList<SingleRollupWriteContext>(); ColumnFamily<Locator, Long> destinationCF = AstyanaxIO.getColumnFamilyMapper().get(gran.coarser()); ======= Map<Long, Rollup> rollups = new HashMap<Long, Rollup>(); >>>>>>> ArrayList<SingleRollupWriteContext> writeContexts = new ArrayList<SingleRollupWriteContext>(); ColumnFamily<Locator, Long> destinationCF = AstyanaxIO.getColumnFamilyMapper().get(gran.coarser()); <<<<<<< ArrayList<SingleRollupWriteContext> writes = new ArrayList<SingleRollupWriteContext>(); ======= Map<Long, Rollup> rollups = new HashMap<Long, Rollup>(); >>>>>>> ArrayList<SingleRollupWriteContext> writes = new ArrayList<SingleRollupWriteContext>();
<<<<<<< router.get("/v2.0/:tenantId/events/get_data", new HttpEventsQueryHandler((EventsIO) ModuleLoader.getInstance(EventsIO.class, CoreConfig.EVENTS_MODULES))); ======= router.get("/v2.0/:tenantId/events/getEvents", new HttpEventsQueryHandler(EventModuleLoader.getInstance())); >>>>>>> router.get("/v2.0/:tenantId/events/getEvents", new HttpEventsQueryHandler((EventsIO) ModuleLoader.getInstance(EventsIO.class, CoreConfig.EVENTS_MODULES)));
<<<<<<< resetPage(position); if (position > 0) { resetPage(position - 1); } ======= >>>>>>> resetPage(position); if (position > 0) { resetPage(position - 1); } <<<<<<< private List<View> getChildren(int position) { View selectedView = (((AbstractSlidePagerAdapter) getAdapter()).getCurrentView(position)); ======= public List<View> getChildren(int position) { View selectedView = (((SlidePagerAdapter) getAdapter()).getCurrentView(position)); >>>>>>> private List<View> getChildren(int position) { View selectedView = (((AbstractSlidePagerAdapter) getAdapter()).getCurrentView(position)); <<<<<<< ======= /** * Sets the {@link #mAttributes} that are passed on to the {@link ProgressView} and {@link android.transition.Slide} * @param attributeSet */ >>>>>>> /** * Sets the {@link #mAttributes} that are passed on to the {@link ProgressView} and {@link android.transition.Slide} * @param attributeSet */
<<<<<<< loadStyledAttributes(mAttributes, mProgressAttr); ======= mCircularBar.setStartLineEnabled(false); mProgressText.setTypeface(TypefaceTextView.getFont(context, TypefaceType.ROBOTO_LIGHT.getAssetFileName())); loadStyledAttributes(null, null); >>>>>>> mCircularBar.setStartLineEnabled(false); mProgressText.setTypeface(TypefaceTextView.getFont(context, TypefaceType.ROBOTO_LIGHT.getAssetFileName())); loadStyledAttributes(mAttributes, mProgressAttr); <<<<<<< if (getCircularBar().getProgress() >= 99.95f) { showCheckMark(true); if (mShowStreaks && mSiblings != null && mSiblings.size() > 0) { //Previous exists if (getIntTag() - 1 >= 0) { ProgressView previousDay = mSiblings.get(index - 1); //Previous is complete if (previousDay.getCircularBar().getProgress() >= 99.95f) { showStreak(true, ProgressView.STREAK.LEFT_STREAK); } } //Next exists if (index + 1 < mSiblings.size()) { ProgressView nextDay = mSiblings.get(index + 1); //Next is complete if (nextDay.getCircularBar().getProgress() >= 99.95f) { showStreak(true, ProgressView.STREAK.RIGHT_STREAK); } } } //Set Color mCircularBar.setCircleFillColor(mCompletedFillColor); mCircularBar.setClockwiseReachedArcColor(mCompletedColor); } else { //Set Color mCircularBar.setCircleFillColor(mFillColor); mCircularBar.setClockwiseReachedArcColor(mReachColor); } ======= animateStreaks(); >>>>>>> if (getCircularBar().getProgress() >= 99.95f) { showCheckMark(true); if (mShowStreaks && mSiblings != null && mSiblings.size() > 0) { //Previous exists if (getIntTag() - 1 >= 0) { ProgressView previousDay = mSiblings.get(index - 1); //Previous is complete if (previousDay.getCircularBar().getProgress() >= 99.95f) { showStreak(true, ProgressView.STREAK.LEFT_STREAK); } } //Next exists if (index + 1 < mSiblings.size()) { ProgressView nextDay = mSiblings.get(index + 1); //Next is complete if (nextDay.getCircularBar().getProgress() >= 99.95f) { showStreak(true, ProgressView.STREAK.RIGHT_STREAK); } } } //Set Color mCircularBar.setCircleFillColor(mCompletedFillColor); mCircularBar.setClockwiseReachedArcColor(mCompletedColor); } else { //Set Color mCircularBar.setCircleFillColor(mFillColor); mCircularBar.setClockwiseReachedArcColor(mReachColor); } animateStreaks(); <<<<<<< private void setProgressText() { if (mShowProgressText) { getProgressTextView().setText(mProgressStrings[getIntTag()]); getProgressTextView().setTextColor(mNotCompletedReachColor); } else { getProgressTextView().setVisibility(View.GONE); } ======= public void setProgressText(String text) { getProgressTextView().setText(text); getProgressTextView().setTextColor(mNotCompletedReachColor); >>>>>>> private void setProgressText(String text) { if (mShowProgressText) { getProgressTextView().setText(text); getProgressTextView().setTextColor(mNotCompletedReachColor); } else { getProgressTextView().setVisibility(View.GONE); }
<<<<<<< public static ComponentVersion createComponentVersion(Component component, String name, Connection connection, SettingData... settings) { ComponentVersionData data = new ComponentVersionData(); data.setComponentId(component.getId()); data.setCreateBy("Test"); data.setCreateTime(new Date()); data.setId(name); data.setName(name); data.setLastModifyBy("Test"); data.setLastModifyTime(new Date()); // TODO: allow passing in of a model data.setInputModelVersiondId(null); data.setOutputModelVersionId(null); ComponentVersion componentVersion = new ComponentVersion(component, connection, null, null, data, settings); return componentVersion; } ======= public static ComponentVersion createComponentVersion(Component component, Connection connection, SettingData... settings) { ComponentVersionData data = new ComponentVersionData(); data.setComponentId(component.getId()); data.setCreateBy("Test"); data.setCreateTime(new Date()); data.setId("Test"); data.setLastModifyBy("Test"); data.setLastModifyTime(new Date()); //TODO: allow passing in of a model data.setInputModelVersiondId(null); data.setOutputModelVersionId(null); ComponentVersion componentVersion = new ComponentVersion(component, connection, data, settings); return componentVersion; } >>>>>>> public static ComponentVersion createComponentVersion(Component component, Connection connection, SettingData... settings) { ComponentVersionData data = new ComponentVersionData(); data.setComponentId(component.getId()); data.setCreateBy("Test"); data.setCreateTime(new Date()); data.setId("Test"); data.setLastModifyBy("Test"); data.setLastModifyTime(new Date()); // TODO: allow passing in of a model data.setInputModelVersiondId(null); data.setOutputModelVersionId(null); ComponentVersion componentVersion = new ComponentVersion(component, connection, null, null, data, settings); return componentVersion; }
<<<<<<< import org.jumpmind.symmetric.is.core.model.AgentDeploymentSummary; import org.jumpmind.symmetric.is.core.model.AgentSummary; ======= >>>>>>> import org.jumpmind.symmetric.is.core.model.AgentDeploymentSummary; <<<<<<< @Override public List<AgentSummary> findUndeployedAgentsFor(String flowId) { ISqlTemplate template = databasePlatform.getSqlTemplate(); return template .query(String .format("select a.name as name, a.host as host, f.name as folder_name, a.id as id from " + "%1$s_agent a inner join " + "%1$s_folder f on f.id=a.folder_id " + "where a.id not in (select agent_id from %1$s_agent_deployment where flow_id = ?)", tablePrefix), new ISqlRowMapper<AgentSummary>() { @Override public AgentSummary mapRow(Row row) { AgentSummary summary = new AgentSummary(); summary.setName(row.getString("name")); summary.setId(row.getString("id")); summary.setFolderName(row.getString("folder_name")); summary.setHost(row.getString("host")); return summary; } }, flowId); } public List<AgentDeploymentSummary> findAgentDeploymentSummary(String agentId) { ISqlTemplate template = databasePlatform.getSqlTemplate(); return template.query(String.format( "select p.name as project_name, v.version_label, '%2$s' as type, " + "d.id, d.name, d.start_type, d.log_level, d.start_expression, d.status " + "from %1$s_agent_deployment d " + "inner join %1$s_flow f on f.id = d.flow_id " + "inner join %1$s_project_version v on v.id = f.project_version_id " + "inner join %1$s_project p on p.id = v.project_id " + "where d.agent_id = ? " + "union " + "select distinct p.name, v.version_label, '%3$s', " + "r.id, r.name, null, null, null, null " + "from %1$s_agent_deployment d " + "inner join %1$s_flow f on f.id = d.flow_id " + "inner join %1$s_project_version v on v.id = f.project_version_id " + "inner join %1$s_project p on p.id = v.project_id " + "inner join %1$s_flow_step s on s.flow_id = f.id " + "inner join %1$s_component c on c.id = s.component_id " + "inner join %1$s_resource r on r.id = c.resource_id " + "where d.agent_id = ?", tablePrefix, AgentDeploymentSummary.TYPE_FLOW, AgentDeploymentSummary.TYPE_RESOURCE), new ISqlRowMapper<AgentDeploymentSummary>() { public AgentDeploymentSummary mapRow(Row row) { AgentDeploymentSummary summary = new AgentDeploymentSummary(); summary.setProjectName(row.getString("project_name") + " (" + row.getString("version_label") + ")"); summary.setType(row.getString("type")); summary.setName(row.getString("name")); summary.setId(row.getString("id")); summary.setStatus(row.getString("status")); summary.setStartType(row.getString("start_type")); summary.setLogLevel(row.getString("log_level")); summary.setStartExpression(row.getString("start_expression")); return summary; } }, agentId, agentId); } ======= >>>>>>> public List<AgentDeploymentSummary> findAgentDeploymentSummary(String agentId) { ISqlTemplate template = databasePlatform.getSqlTemplate(); return template.query(String.format( "select p.name as project_name, v.version_label, '%2$s' as type, " + "d.id, d.name, d.start_type, d.log_level, d.start_expression, d.status " + "from %1$s_agent_deployment d " + "inner join %1$s_flow f on f.id = d.flow_id " + "inner join %1$s_project_version v on v.id = f.project_version_id " + "inner join %1$s_project p on p.id = v.project_id " + "where d.agent_id = ? " + "union " + "select distinct p.name, v.version_label, '%3$s', " + "r.id, r.name, null, null, null, null " + "from %1$s_agent_deployment d " + "inner join %1$s_flow f on f.id = d.flow_id " + "inner join %1$s_project_version v on v.id = f.project_version_id " + "inner join %1$s_project p on p.id = v.project_id " + "inner join %1$s_flow_step s on s.flow_id = f.id " + "inner join %1$s_component c on c.id = s.component_id " + "inner join %1$s_resource r on r.id = c.resource_id " + "where d.agent_id = ?", tablePrefix, AgentDeploymentSummary.TYPE_FLOW, AgentDeploymentSummary.TYPE_RESOURCE), new ISqlRowMapper<AgentDeploymentSummary>() { public AgentDeploymentSummary mapRow(Row row) { AgentDeploymentSummary summary = new AgentDeploymentSummary(); summary.setProjectName(row.getString("project_name") + " (" + row.getString("version_label") + ")"); summary.setType(row.getString("type")); summary.setName(row.getString("name")); summary.setId(row.getString("id")); summary.setStatus(row.getString("status")); summary.setStartType(row.getString("start_type")); summary.setLogLevel(row.getString("log_level")); summary.setStartExpression(row.getString("start_expression")); return summary; } }, agentId, agentId); }
<<<<<<< import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; ======= >>>>>>> import java.io.InputStream; import java.io.OutputStream; <<<<<<< import org.jumpmind.metl.core.plugin.IPluginManager; ======= import org.jumpmind.metl.core.persist.IImportExportService; >>>>>>> import org.jumpmind.metl.core.persist.IImportExportService; import org.jumpmind.metl.core.plugin.IPluginManager; <<<<<<< getLogger().info("Installing Metl samples"); new SqlScript(new InputStreamReader(getClass().getResourceAsStream("/metl-samples.sql")), platform.getSqlTemplate(), true, ";", null).execute(); ======= IImportExportService importExportService = ctx.getBean(IImportExportService.class); LoggerFactory.getLogger(getClass()).info("Installing Metl samples"); importExportService.importConfiguration(IOUtils.toString(getClass().getResourceAsStream("/metl-samples.json"))); >>>>>>> IImportExportService importExportService = ctx.getBean(IImportExportService.class); LoggerFactory.getLogger(getClass()).info("Installing Metl samples"); importExportService.importConfiguration(IOUtils.toString(getClass().getResourceAsStream("/metl-samples.json")));
<<<<<<< ======= public void setKeywords(String keywords) { this.keywords = keywords; } public String getKeywords() { return keywords; } >>>>>>> public void setKeywords(String keywords) { this.keywords = keywords; } public String getKeywords() { return keywords; }
<<<<<<< import org.jumpmind.metl.core.runtime.Message; import org.jumpmind.metl.core.runtime.MessageManipulationStrategy; ======= import org.jumpmind.metl.core.runtime.EntityData; >>>>>>> import org.jumpmind.metl.core.runtime.EntityData; import org.jumpmind.metl.core.runtime.Message;
<<<<<<< public static final FontAwesome RUN = FontAwesome.PLAY; ======= public static final FontAwesome COMPONENT = FontAwesome.PUZZLE_PIECE; >>>>>>> public static final FontAwesome RUN = FontAwesome.PLAY; public static final FontAwesome COMPONENT = FontAwesome.PUZZLE_PIECE;
<<<<<<< import org.jumpmind.metl.ui.common.AppConstants; import org.jumpmind.metl.ui.views.ComponentXmlDefinitionPlusUIFactory; import org.jumpmind.metl.ui.views.IComponentDefinitionPlusUIFactory; ======= import org.jumpmind.metl.ui.persist.AuditableConfigurationService; import org.jumpmind.metl.ui.views.IUIFactory; import org.jumpmind.metl.ui.views.UIXMLFactory; >>>>>>> import org.jumpmind.metl.ui.persist.AuditableConfigurationService; import org.jumpmind.metl.ui.views.ComponentXmlDefinitionPlusUIFactory; import org.jumpmind.metl.ui.views.IComponentDefinitionPlusUIFactory; <<<<<<< ======= IComponentDefinitionFactory componentDefinitionFactory; >>>>>>> IComponentDefinitionFactory componentDefinitionFactory; <<<<<<< ======= ISecurityService securityService; >>>>>>> ISecurityService securityService; <<<<<<< IPluginManager pluginManager; IComponentDefinitionPlusUIFactory componentDefinitionPlusUIFactory; ======= IUIFactory uiFactory; DataSource configDataSource; DataSource executionDataSource; >>>>>>> IPluginManager pluginManager; IComponentDefinitionPlusUIFactory componentDefinitionPlusUIFactory; DataSource configDataSource; DataSource executionDataSource; <<<<<<< return new Docket(DocumentationType.SWAGGER_2).pathMapping("/api").produces(contentTypes()).consumes(contentTypes()) .apiInfo(new ApiInfo("Metl API", "This is the REST API for Metl", null, null, null, null, null)); ======= return new Docket(DocumentationType.SWAGGER_2).pathMapping("/api").produces(contentTypes()) .consumes(contentTypes()).apiInfo(new ApiInfo("Metl API", "This is the REST API for Metl", null, null, null, null, null)); >>>>>>> return new Docket(DocumentationType.SWAGGER_2).pathMapping("/api").produces(contentTypes()) .consumes(contentTypes()).apiInfo(new ApiInfo("Metl API", "This is the REST API for Metl", null, null, null, null, null)); <<<<<<< properties.put(DB_POOL_CONNECTION_PROPERTIES, env.getProperty(DB_POOL_CONNECTION_PROPERTIES)); log.info( "About to initialize the configuration datasource using the following driver:" + " '{}' and the following url: '{}' and the following user: '{}'", new Object[] { properties.get(DB_POOL_DRIVER), properties.get(DB_POOL_URL), properties.get(DB_POOL_USER) }); DataSource configDataSource = BasicDataSourceFactory.create(properties, SecurityServiceFactory.create()); ======= properties.put(DB_POOL_CONNECTION_PROPERTIES, env.getProperty(DB_POOL_CONNECTION_PROPERTIES)); log.info( "About to initialize the configuration datasource using the following driver:" + " '{}' and the following url: '{}' and the following user: '{}'", new Object[] { properties.get(DB_POOL_DRIVER), properties.get(DB_POOL_URL), properties.get(DB_POOL_USER) }); configDataSource = BasicDataSourceFactory.create(properties, SecurityServiceFactory.create()); } >>>>>>> properties.put(DB_POOL_CONNECTION_PROPERTIES, env.getProperty(DB_POOL_CONNECTION_PROPERTIES)); log.info( "About to initialize the configuration datasource using the following driver:" + " '{}' and the following url: '{}' and the following user: '{}'", new Object[] { properties.get(DB_POOL_DRIVER), properties.get(DB_POOL_URL), properties.get(DB_POOL_USER) }); configDataSource = BasicDataSourceFactory.create(properties, SecurityServiceFactory.create()); } <<<<<<< if (databasePlatform == null) { databasePlatform = JdbcDatabasePlatformFactory.createNewPlatformInstance(configDataSource(), new SqlTemplateSettings(), true, false); ======= if (configDatabasePlatform == null) { configDatabasePlatform = JdbcDatabasePlatformFactory.createNewPlatformInstance( configDataSource(), new SqlTemplateSettings(), true, false); >>>>>>> if (configDatabasePlatform == null) { configDatabasePlatform = JdbcDatabasePlatformFactory.createNewPlatformInstance( configDataSource(), new SqlTemplateSettings(), true, false); <<<<<<< return new ConfigDatabaseUpgrader("/schema.xml", configDatabasePlatform(), true, tablePrefix()); ======= return new ConfigDatabaseUpgrader("/schema.xml", configDatabasePlatform(), true, tablePrefix()); } @Bean @Scope(value = "singleton") public ConfigDatabaseUpgrader executionDatabaseUpgrader() { return new ConfigDatabaseUpgrader("/schema-exec.xml", executionDatabasePlatform(), true, tablePrefix()); >>>>>>> return new ConfigDatabaseUpgrader("/schema.xml", configDatabasePlatform(), true, tablePrefix()); } @Bean @Scope(value = "singleton") public ConfigDatabaseUpgrader executionDatabaseUpgrader() { return new ConfigDatabaseUpgrader("/schema-exec.xml", executionDatabasePlatform(), true, tablePrefix()); <<<<<<< configurationService = new ConfigurationSqlService(configDatabasePlatform(), persistenceManager(), tablePrefix()); ======= configurationService = new AuditableConfigurationService(securityService(), componentDefinitionFactory(), configDatabasePlatform(), persistenceManager(), tablePrefix()); >>>>>>> configurationService = new AuditableConfigurationService(securityService(), componentDefinitionPlusUIFactory(), configDatabasePlatform(), persistenceManager(), tablePrefix()); <<<<<<< importExportService = new ImportExportService(configDatabasePlatform(), persistenceManager(), tablePrefix(), configurationService); ======= importExportService = new ImportExportService(configDatabasePlatform(), persistenceManager(), tablePrefix(), configurationService(), securityService()); >>>>>>> importExportService = new ImportExportService(configDatabasePlatform(), persistenceManager(), tablePrefix(), configurationService(), securityService()); <<<<<<< executionService = new ExecutionSqlService(configDatabasePlatform(), persistenceManager(), tablePrefix(), env); ======= executionService = new ExecutionSqlService(executionDatabasePlatform(), executionPersistenceManager(), tablePrefix(), env); >>>>>>> executionService = new ExecutionSqlService(executionDatabasePlatform(), executionPersistenceManager(), tablePrefix(), env); <<<<<<< IAgentManager agentManager = new AgentManager(configurationService(), executionService(), componentRuntimeFactory(), componentDefinitionPlusUIFactory(), resourceFactory(), httpRequestMappingRegistry()); ======= IAgentManager agentManager = new AgentManager(configurationService(), executionService(), componentRuntimeFactory(), componentDefinitionFactory(), resourceFactory(), httpRequestMappingRegistry()); >>>>>>> IAgentManager agentManager = new AgentManager(configurationService(), executionService(), componentRuntimeFactory(), componentDefinitionPlusUIFactory(), resourceFactory(), httpRequestMappingRegistry()); <<<<<<< ======= @Bean @Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES) public ISecurityService securityService() { if (securityService == null) { try { securityService = (ISecurityService) Class .forName(System.getProperty(SecurityConstants.CLASS_NAME_SECURITY_SERVICE, SecurityService.class.getName())) .newInstance(); securityService.setConfigDir(configDir()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } return securityService; } >>>>>>> @Bean @Scope(value = "singleton", proxyMode = ScopedProxyMode.INTERFACES) public ISecurityService securityService() { if (securityService == null) { try { securityService = (ISecurityService) Class .forName(System.getProperty(SecurityConstants.CLASS_NAME_SECURITY_SERVICE, SecurityService.class.getName())) .newInstance(); securityService.setConfigDir(configDir()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } return securityService; }
<<<<<<< @Override public ExternServSummary transform() { return new ExternServSummary(fsc.getCreatorUriUser(), fsc.getOperationalStatus().toString(), fsc.getEstablishmentDateTime(), fsc.getExternalServiceOption().getDescriptionOfOption(), fsc.getExternalServiceType().getServiceName(), getDescriptiveTargetString()); } public void persist() throws ODKEntityPersistException { ======= public void persist(CallingContext cc) throws ODKEntityPersistException { >>>>>>> @Override public ExternServSummary transform() { return new ExternServSummary(fsc.getCreatorUriUser(), fsc.getOperationalStatus().toString(), fsc.getEstablishmentDateTime(), fsc.getExternalServiceOption().getDescriptionOfOption(), fsc.getExternalServiceType().getServiceName(), getDescriptiveTargetString()); } public void persist(CallingContext cc) throws ODKEntityPersistException {
<<<<<<< @Override synchronized public IComponentRuntime create(String projectVersionId, String id) { ======= synchronized public IComponentRuntime create(String id, ComponentContext context, int threadNumber) { >>>>>>> @Override synchronized public IComponentRuntime create(String projectVersionId, String id, ComponentContext context, int threadNumber) { <<<<<<< IComponentRuntime component = (IComponentRuntime) Class.forName(definition.getClassName().trim(), true, definition.getClassLoader()).newInstance(); component.create(definition); ======= IComponentRuntime component = (IComponentRuntime) Class.forName(definition.getClassName().trim()).newInstance(); component.create(definition, context, threadNumber); >>>>>>> IComponentRuntime component = (IComponentRuntime) Class.forName(definition.getClassName().trim(), true, definition.getClassLoader()).newInstance(); component.create(definition, context, threadNumber);
<<<<<<< import org.jumpmind.metl.core.runtime.MessageManipulationStrategy; ======= import org.jumpmind.metl.core.runtime.ShutdownMessage; >>>>>>> <<<<<<< getInputMessage().setPayload(new ArrayList<EntityData>()); ((RdbmsReader) spy).unitOfWork = AbstractComponentRuntime.UNIT_OF_WORK_INPUT_MESSAGE; ======= inputMessage.setPayload(new ArrayList<EntityData>()); >>>>>>> getInputMessage().setPayload(new ArrayList<EntityData>()); <<<<<<< getInputMessage().setPayload(new ArrayList<EntityData>()); ((RdbmsReader) spy).unitOfWork = AbstractComponentRuntime.UNIT_OF_WORK_FLOW; setUnitOfWorkLastMessage(true); ======= inputMessage.setPayload(new ArrayList<EntityData>()); unitOfWorkLastMessage = true; >>>>>>> getInputMessage().setPayload(new ArrayList<EntityData>()); setUnitOfWorkLastMessage(true);
<<<<<<< ======= /** * URLs for various other parts of the API */ /** * Get this same TableResource. */ @Element(required = true) >>>>>>> /** * URLs for various other parts of the API */ /** * Get this same TableResource. */ <<<<<<< ======= /** * Get the TableDefinition for this tableId */ @Element(required = true) >>>>>>> /** * Get the TableDefinition for this tableId */ <<<<<<< ======= /** * Path prefix for data row interactions */ @Element(required = true) >>>>>>> /** * Path prefix for data row interactions */ <<<<<<< ======= /** * Path prefix for data row attachment interactions */ @Element(required = true) >>>>>>> /** * Path prefix for data row attachment interactions */ <<<<<<< ======= /** * Path prefix for differencing (changes-since) service. */ @Element(required = true) >>>>>>> /** * Path prefix for differencing (changes-since) service. */ <<<<<<< ======= /** * Path prefix for permissions / access-control service. */ @Element(required = true) >>>>>>> /** * Path prefix for permissions / access-control service. */
<<<<<<< boolean ignoreNamespace = true; boolean useParameterReplacement = true; ======= >>>>>>> boolean ignoreNamespace = true; boolean useParameterReplacement = true; <<<<<<< TypedProperties properties = getComponent().toTypedProperties(getSettingDefinitions(false)); ignoreNamespace = properties.is(IGNORE_NAMESPACE); useParameterReplacement = properties.is(PARAMETER_REPLACEMENT); ======= super.start(); >>>>>>> super.start(); TypedProperties properties = getComponent().toTypedProperties(getSettingDefinitions(false)); ignoreNamespace = properties.is(IGNORE_NAMESPACE); useParameterReplacement = properties.is(PARAMETER_REPLACEMENT);
<<<<<<< import org.jumpmind.symmetric.is.ui.views.manage.ExecutionLogPanel; ======= import org.jumpmind.symmetric.is.ui.init.BackgroundRefresherService; import org.jumpmind.symmetric.ui.common.ConfirmDialog; import org.jumpmind.symmetric.ui.common.ConfirmDialog.IConfirmListener; >>>>>>> import org.jumpmind.symmetric.is.ui.views.manage.ExecutionLogPanel; import org.jumpmind.symmetric.is.ui.init.BackgroundRefresherService; import org.jumpmind.symmetric.ui.common.ConfirmDialog; import org.jumpmind.symmetric.ui.common.ConfirmDialog.IConfirmListener; <<<<<<< newModel.setDescription("Add Model"); run = leftMenuBar.addItem("", Icons.RUN, new Command() { @Override public void menuSelected(MenuItem selectedItem) { openExecution(); } }); run.setDescription("Run on local agent"); } @Override protected boolean isDeleteButtonEnabled(Object selected) { boolean deleteButtonEnabled = super.isDeleteButtonEnabled(selected); return deleteButtonEnabled; ======= >>>>>>> newModel.setDescription("Add Model"); run = leftMenuBar.addItem("", Icons.RUN, new Command() { @Override public void menuSelected(MenuItem selectedItem) { openExecution(); } }); run.setDescription("Run on local agent");