conflict_resolution
stringlengths
27
16k
<<<<<<< import mchorse.blockbuster.common.ClientProxy; import mchorse.blockbuster.common.CommonProxy; import mchorse.blockbuster.utils.TextureLocation; ======= >>>>>>> import mchorse.blockbuster.utils.TextureLocation;
<<<<<<< ======= import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.util.BlockRenderLayer; >>>>>>> import net.minecraft.state.properties.BlockStateProperties; <<<<<<< //TODO super(name, material, BlockItemIE::new); ======= super(name, material, BlockItemIE::new, BlockStateProperties.WATERLOGGED); setNotNormalBlock(); setBlockLayer(BlockRenderLayer.CUTOUT); >>>>>>> //TODO super(name, material, BlockItemIE::new, BlockStateProperties.WATERLOGGED);
<<<<<<< ======= import blusunrize.immersiveengineering.common.util.shapes.CachedVoxelShapes; import com.google.common.collect.Lists; >>>>>>> import blusunrize.immersiveengineering.common.util.shapes.CachedVoxelShapes; import com.google.common.collect.Lists; <<<<<<< import net.minecraft.util.math.vector.Vector3d; ======= import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; >>>>>>> import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.vector.Vector3d; <<<<<<< ======= import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; >>>>>>> import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List;
<<<<<<< if (this.progress >= 10) { actor.world.destroyBlock(this.pos, true); } else { actor.world.sendBlockBreakProgress(actor.getEntityId(), this.pos, this.progress); } ======= actor.worldObj.sendBlockBreakProgress(actor.getEntityId(), this.pos, this.progress); >>>>>>> actor.world.sendBlockBreakProgress(actor.getEntityId(), this.pos, this.progress);
<<<<<<< super(name, Block.Properties.create(Material.IRON).hardnessAndResistance(3.0F, 15.0F).notSolid(), ======= super(name, Block.Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3.0F, 15.0F), >>>>>>> super(name, Block.Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3.0F, 15.0F).notSolid(),
<<<<<<< Properties.create(Material.IRON).hardnessAndResistance(3, 15).notSolid(), ======= Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3, 15), >>>>>>> Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3, 15).notSolid(),
<<<<<<< import net.minecraftforge.common.util.LazyOptional; ======= import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; >>>>>>> import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.common.util.LazyOptional; <<<<<<< private static World cachedClientWorld; private static GlobalWireNetwork cachedClientNet; ======= private static World lastServerWorld = null; private static GlobalWireNetwork lastServerNet = null; >>>>>>> private static World lastServerWorld = null; private static GlobalWireNetwork lastServerNet = null; private static World cachedClientWorld; private static GlobalWireNetwork cachedClientNet; <<<<<<< LazyOptional<GlobalWireNetwork> netOpt = w.getCapability(NetHandlerCapability.NET_CAPABILITY); if(!netOpt.isPresent()) { //TODO figure out whether this is a forge bug or not if(w.isRemote) { if(w!=cachedClientWorld) { cachedClientWorld = w; cachedClientNet = new GlobalWireNetwork(w); } return cachedClientNet; } throw new RuntimeException("No net handler found for dimension "+w.func_234922_V_().func_240901_a_()+", remote: "+w.isRemote); } return Objects.requireNonNull(netOpt.orElse(null)); ======= // This and onWorldUnload should only ever be called with non-remote worlds from the server thread, so this // does not need any synchronization if(!w.isRemote&&w==lastServerWorld) return lastServerNet; LazyOptional<GlobalWireNetwork> netOptional = w.getCapability(NetHandlerCapability.NET_CAPABILITY); if(!netOptional.isPresent()) throw new RuntimeException("No net handler found for dimension "+w.getDimension().getType().getRegistryName()+", remote: "+w.isRemote); GlobalWireNetwork ret = Objects.requireNonNull(netOptional.orElse(null)); if(!w.isRemote) { lastServerWorld = w; lastServerNet = ret; } return ret; } @SubscribeEvent public static void onWorldUnload(WorldEvent.Unload ev) { if(ev.getWorld()==lastServerWorld) { lastServerNet = null; lastServerWorld = null; } >>>>>>> // This and onWorldUnload should only ever be called with non-remote worlds from the server thread, so this // does not need any synchronization if(!w.isRemote&&w==lastServerWorld) return lastServerNet; LazyOptional<GlobalWireNetwork> netOptional = w.getCapability(NetHandlerCapability.NET_CAPABILITY); if(!netOptional.isPresent()) { if(w.isRemote) { if(w!=cachedClientWorld) { cachedClientWorld = w; cachedClientNet = new GlobalWireNetwork(w); } return cachedClientNet; } throw new RuntimeException("No net handler found for dimension "+w.func_234922_V_().func_240901_a_()+", remote: "+w.isRemote); } GlobalWireNetwork ret = Objects.requireNonNull(netOptional.orElse(null)); if(!w.isRemote) { lastServerWorld = w; lastServerNet = ret; } return ret; } @SubscribeEvent public static void onWorldUnload(WorldEvent.Unload ev) { if(ev.getWorld()==lastServerWorld) { lastServerNet = null; lastServerWorld = null; }
<<<<<<< if(mineral!=null) { MineralMix mix = ExcavatorHandler.mineralList.get(new ResourceLocation(mineral)); if(mix!=null) font.drawStringWithShadow(transform, I18n.format(mix.getTranslationKey()), scaledWidth/2-8, scaledHeight/2+8, 0xffffff); } ======= if(minerals!=null) for(int i = 0; i < minerals.size(); i++) { MineralMix mix = MineralMix.mineralList.get(new ResourceLocation(minerals.getString(i))); if(mix!=null) font.drawStringWithShadow(I18n.format(mix.getTranslationKey()), scaledWidth/2+8, scaledHeight/2+8+i*font.FONT_HEIGHT, 0xffffff); } >>>>>>> if(minerals!=null) for(int i = 0; i < minerals.size(); i++) { MineralMix mix = MineralMix.mineralList.get(new ResourceLocation(minerals.getString(i))); if(mix!=null) font.drawStringWithShadow(transform, I18n.format(mix.getTranslationKey()), scaledWidth/2+8, scaledHeight/2+8+i*font.FONT_HEIGHT, 0xffffff); }
<<<<<<< import net.minecraft.state.Property; ======= import net.minecraft.state.IProperty; import net.minecraft.state.properties.BlockStateProperties; >>>>>>> import net.minecraft.state.Property; import net.minecraft.state.properties.BlockStateProperties;
<<<<<<< static class MultiblockBlockAccess implements IBlockReader ======= public IMultiblock getMultiblock() { return this.multiblock; } static class MultiblockBlockAccess implements IEnviromentBlockReader >>>>>>> public IMultiblock getMultiblock() { return this.multiblock; } static class MultiblockBlockAccess implements IBlockReader
<<<<<<< /* * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source <<<<<<< import org.n52.sos.ds.hibernate.entities.FeatureOfInterest; ======= import org.n52.sos.ds.hibernate.dao.ProcedureDAO; import org.n52.sos.ds.hibernate.entities.feature.FeatureOfInterest; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import org.n52.sos.ds.hibernate.entities.feature.FeatureOfInterest; <<<<<<< ======= for (FeatureOfInterest featureOfInterest : featureOfInterestDAO.getPublishedFeatureOfInterest(getSession())) { String identifier = featureOfInterest.getIdentifier(); getCache().addPublishedFeatureOfInterest(identifier); Collection<String> parentFois = foisWithParents.get(identifier); if (!CollectionHelper.isEmpty(parentFois)) { getCache().addPublishedFeaturesOfInterest(parentFois); } } >>>>>>> for (FeatureOfInterest featureOfInterest : featureOfInterestDAO.getPublishedFeatureOfInterest(getSession())) { String identifier = featureOfInterest.getIdentifier(); getCache().addPublishedFeatureOfInterest(identifier); Collection<String> parentFois = foisWithParents.get(identifier); if (!CollectionHelper.isEmpty(parentFois)) { getCache().addPublishedFeaturesOfInterest(parentFois); } }
<<<<<<< ======= import blusunrize.immersiveengineering.api.Lib; import blusunrize.immersiveengineering.api.crafting.ClocheRenderFunction.ClocheRenderReference; >>>>>>> import blusunrize.immersiveengineering.api.Lib; import blusunrize.immersiveengineering.api.crafting.ClocheRenderFunction.ClocheRenderReference; <<<<<<< import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.TransformationMatrix; ======= >>>>>>> import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.TransformationMatrix; <<<<<<< ======= import net.minecraft.item.crafting.IRecipeType; import net.minecraft.item.crafting.Ingredient; >>>>>>> import net.minecraft.item.crafting.IRecipeType; import net.minecraft.item.crafting.Ingredient; <<<<<<< ======= import net.minecraftforge.fml.RegistryObject; >>>>>>> import net.minecraftforge.fml.RegistryObject; <<<<<<< import java.util.Collection; ======= >>>>>>> import java.util.Collection; <<<<<<< /* ========== CUSTOM RENDERING ========== */ public interface ClocheRenderFunction { float getScale(ItemStack seed, float growth); Collection<Pair<BlockState, TransformationMatrix>> getBlocks(ItemStack stack, float growth); } ======= === CUSTOM RENDERING ========== */ public interface ClocheRenderFunction { float getScale(ItemStack seed, float growth); Collection<Pair<BlockState, TRSRTransformation>> getBlocks(ItemStack stack, float growth); } ======= >>>>>>>
<<<<<<< public ActionResultType hammerUseSide(Direction side, PlayerEntity player, World w, BlockPos pos, BlockRayTraceResult hit) ======= public boolean hammerUseSide(Direction side, PlayerEntity player, Hand hand, World w, BlockPos pos, BlockRayTraceResult hit) >>>>>>> public ActionResultType hammerUseSide(Direction side, PlayerEntity player, Hand hand, World w, BlockPos pos, BlockRayTraceResult hit) <<<<<<< public ActionResultType screwdriverUseSide(Direction side, PlayerEntity player, World w, BlockPos pos, BlockRayTraceResult hit) ======= public boolean screwdriverUseSide(Direction side, PlayerEntity player, Hand hand, World w, BlockPos pos, BlockRayTraceResult hit) >>>>>>> public ActionResultType screwdriverUseSide(Direction side, PlayerEntity player, Hand hand, World w, BlockPos pos, BlockRayTraceResult hit) <<<<<<< ActionResultType teResult = ((IScrewdriverInteraction)tile).screwdriverUseSide(side, player, hit.getHitVec()); if(teResult!=ActionResultType.PASS) return teResult; ======= boolean b = ((IScrewdriverInteraction)tile).screwdriverUseSide(side, player, hand, hit.getHitVec()); if(b) return true; >>>>>>> ActionResultType teResult = ((IScrewdriverInteraction)tile).screwdriverUseSide(side, player, hand, hit.getHitVec()); if(teResult!=ActionResultType.PASS) return teResult;
<<<<<<< CrusherRecipeBuilder.builder(IETags.getTagsFor(EnumMetals.GOLD).dust, 2) .addInput(Items.NETHER_GOLD_ORE) .setEnergy(4200) .build(out, toRL("crusher/nether_gold")); ======= /* SAWMILL */ for(RecipeWoods wood : RecipeWoods.values()) { // Basic log if(wood.getLog()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 6)) .setEnergy(1600); // If there is an all-bark block if(wood.getWood()!=null) sawmillBuilder.addInput(wood.getLog(), wood.getWood()); else sawmillBuilder.addInput(wood.getLog()); if(wood.getStripped()!=null) { sawmillBuilder.addStripped(wood.getStripped()); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, true); } if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_log")); } // Already stripped log if(wood.getStripped()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 6)) .addInput(wood.getStripped()) .setEnergy(800); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/stripped_"+wood.getName()+"_log")); } // Door if(wood.getDoor()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 1)) .addInput(wood.getDoor()) .setEnergy(800); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_door")); } // Stairs if(wood.getStairs()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 1)) .addInput(wood.getStairs()) .setEnergy(1600); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_stairs")); } } SawmillRecipeBuilder.builder(new ItemStack(Items.OAK_PLANKS, 4)) .addInput(Items.BOOKSHELF) .addSecondary(IETags.sawdust, false) .addSecondary(new ItemStack(Items.BOOK, 3), false) .setEnergy(1600) .build(out, toRL("sawmill/bookshelf")); >>>>>>> CrusherRecipeBuilder.builder(IETags.getTagsFor(EnumMetals.GOLD).dust, 2) .addInput(Items.NETHER_GOLD_ORE) .setEnergy(4200) .build(out, toRL("crusher/nether_gold")); /* SAWMILL */ for(RecipeWoods wood : RecipeWoods.values()) { // Basic log if(wood.getLog()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 6)) .setEnergy(1600); // If there is an all-bark block if(wood.getWood()!=null) sawmillBuilder.addInput(wood.getLog(), wood.getWood()); else sawmillBuilder.addInput(wood.getLog()); if(wood.getStripped()!=null) { sawmillBuilder.addStripped(wood.getStripped()); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, true); } if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_log")); } // Already stripped log if(wood.getStripped()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 6)) .addInput(wood.getStripped()) .setEnergy(800); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/stripped_"+wood.getName()+"_log")); } // Door if(wood.getDoor()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 1)) .addInput(wood.getDoor()) .setEnergy(800); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_door")); } // Stairs if(wood.getStairs()!=null) { sawmillBuilder = SawmillRecipeBuilder.builder(new ItemStack(wood.getPlank(), 1)) .addInput(wood.getStairs()) .setEnergy(1600); if(wood.produceSawdust()) sawmillBuilder.addSecondary(IETags.sawdust, false); sawmillBuilder.build(out, toRL("sawmill/"+wood.getName()+"_stairs")); } } SawmillRecipeBuilder.builder(new ItemStack(Items.OAK_PLANKS, 4)) .addInput(Items.BOOKSHELF) .addSecondary(IETags.sawdust, false) .addSecondary(new ItemStack(Items.BOOK, 3), false) .setEnergy(1600) .build(out, toRL("sawmill/bookshelf"));
<<<<<<< public MetalMultiblockBlock(String name, Supplier<TileEntityType<?>> te, Property<?>... additionalProperties) ======= public MetalMultiblockBlock(String name, Supplier<TileEntityType<T>> te, IProperty<?>... additionalProperties) >>>>>>> public MetalMultiblockBlock(String name, Supplier<TileEntityType<T>> te, Property<?>... additionalProperties)
<<<<<<< Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3, 15).notSolid(), IEProperties.FACING_HORIZONTAL, IEProperties.MULTIBLOCKSLAVE); ======= Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3, 15), IEProperties.FACING_HORIZONTAL, IEProperties.MULTIBLOCKSLAVE, BlockStateProperties.WATERLOGGED); setNotNormalBlock(); >>>>>>> Properties.create(Material.IRON).sound(SoundType.METAL).hardnessAndResistance(3, 15).notSolid(), IEProperties.FACING_HORIZONTAL, IEProperties.MULTIBLOCKSLAVE, BlockStateProperties.WATERLOGGED);
<<<<<<< import net.minecraft.tags.ITag; ======= import net.minecraft.server.MinecraftServer; import net.minecraft.tags.Tag; >>>>>>> import net.minecraft.tags.ITag; import net.minecraft.server.MinecraftServer; <<<<<<< template = StaticTemplateManager.loadStaticTemplate(loc); List<Template.BlockInfo> blocks = template.blocks.get(0).func_237157_a_(); ======= template = StaticTemplateManager.loadStaticTemplate(loc, server); List<Template.BlockInfo> blocks = template.blocks.get(0); >>>>>>> template = StaticTemplateManager.loadStaticTemplate(loc, server); List<Template.BlockInfo> blocks = template.blocks.get(0).func_237157_a_();
<<<<<<< public boolean hammerUseSide(Direction side, PlayerEntity player, Vector3d hitVec) ======= public boolean hammerUseSide(Direction side, PlayerEntity player, Hand hand, Vec3d hitVec) >>>>>>> public boolean hammerUseSide(Direction side, PlayerEntity player, Hand hand, Vector3d hitVec)
<<<<<<< if (mc.world != null) { this.directorPanel.open(); this.modelPanel.open(); } ======= >>>>>>>
<<<<<<< import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.ResourceLocation; ======= import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.util.math.BlockPos; >>>>>>> import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; <<<<<<< IBakedModel model = drill.get(null); ======= BlockPos blockPos = tile.getPos(); IBakedModel model = DRILL.get(null); >>>>>>> IBakedModel model = DRILL.get(null);
<<<<<<< /* * BluSunrize * Copyright (c) 2017 * * This code is licensed under "Blu's License of Common Sense" * Details can be found in the license file in the root folder of this project */ package blusunrize.immersiveengineering.common.util.network; import blusunrize.immersiveengineering.ImmersiveEngineering; import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection; import blusunrize.immersiveengineering.common.entities.EntitySkylineHook; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class MessageSkyhookSync implements IMessage { private int entityID; private Connection connection; private double linePos; private double speed; public MessageSkyhookSync(EntitySkylineHook entity) { entityID = entity.getEntityId(); connection = entity.getConnection(); linePos = entity.linePos; speed = entity.horizontalSpeed; } public MessageSkyhookSync() { } @Override public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); linePos = buf.readDouble(); speed = buf.readDouble(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(entityID); ByteBufUtils.writeTag(buf, connection.writeToNBT()); buf.writeDouble(linePos); buf.writeDouble(speed); } public static class Handler implements IMessageHandler<MessageSkyhookSync, IMessage> { @Override public IMessage onMessage(MessageSkyhookSync message, MessageContext ctx) { Minecraft.getMinecraft().addScheduledTask(() -> { World world = ImmersiveEngineering.proxy.getClientWorld(); if(world!=null) { Entity ent = world.getEntityByID(message.entityID); if(ent instanceof EntitySkylineHook) { message.connection.getSubVertices(world); ((EntitySkylineHook)ent).setConnectionAndPos(message.connection, message.linePos, message.speed); } } }); return null; } } ======= /* * BluSunrize * Copyright (c) 2017 * * This code is licensed under "Blu's License of Common Sense" * Details can be found in the license file in the root folder of this project */ package blusunrize.immersiveengineering.common.util.network; import blusunrize.immersiveengineering.ImmersiveEngineering; import blusunrize.immersiveengineering.api.energy.wires.old.ImmersiveNetHandler; import blusunrize.immersiveengineering.common.entities.EntitySkylineHook; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class MessageSkyhookSync implements IMessage { int entityID; ImmersiveNetHandler.Connection connection; BlockPos target; Vec3d[] subPoints; int targetPoint; public MessageSkyhookSync(EntitySkylineHook entity) { entityID = entity.getEntityId(); connection = entity.connection; target = entity.target; subPoints = entity.subPoints; targetPoint = entity.targetPoint; } public MessageSkyhookSync() { } @Override public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = ImmersiveNetHandler.Connection.readFromNBT(tag); target = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt()); int l = buf.readInt(); subPoints = new Vec3d[l]; for(int i = 0; i < l; i++) subPoints[i] = new Vec3d(buf.readDouble(), buf.readDouble(), buf.readDouble()); targetPoint = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(entityID); ByteBufUtils.writeTag(buf, connection.writeToNBT()); buf.writeInt(target.getX()).writeInt(target.getY()).writeInt(target.getZ()); buf.writeInt(subPoints.length); for(Vec3d v : subPoints) { buf.writeDouble(v.x); buf.writeDouble(v.y); buf.writeDouble(v.z); } buf.writeInt(targetPoint); } public static class Handler implements IMessageHandler<MessageSkyhookSync, IMessage> { @Override public IMessage onMessage(MessageSkyhookSync message, MessageContext ctx) { Minecraft.getMinecraft().addScheduledTask(() -> { World world = ImmersiveEngineering.proxy.getClientWorld(); if(world!=null) { Entity ent = world.getEntityByID(message.entityID); if(ent instanceof EntitySkylineHook) { ((EntitySkylineHook)ent).connection = message.connection; ((EntitySkylineHook)ent).target = message.target; ((EntitySkylineHook)ent).subPoints = message.subPoints; ((EntitySkylineHook)ent).targetPoint = message.targetPoint; } } }); return null; } } >>>>>>> /* * BluSunrize * Copyright (c) 2017 * * This code is licensed under "Blu's License of Common Sense" * Details can be found in the license file in the root folder of this project */ package blusunrize.immersiveengineering.common.util.network; import blusunrize.immersiveengineering.ImmersiveEngineering; import blusunrize.immersiveengineering.api.energy.wires.old.ImmersiveNetHandler; import blusunrize.immersiveengineering.common.entities.EntitySkylineHook; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class MessageSkyhookSync implements IMessage { private int entityID; private ImmersiveNetHandler.Connection connection; private double linePos; private double speed; public MessageSkyhookSync(EntitySkylineHook entity) { entityID = entity.getEntityId(); connection = entity.getConnection(); linePos = entity.linePos; speed = entity.horizontalSpeed; } public MessageSkyhookSync() { } @Override public void fromBytes(ByteBuf buf) { entityID = buf.readInt(); NBTTagCompound tag = ByteBufUtils.readTag(buf); connection = Connection.readFromNBT(tag); linePos = buf.readDouble(); speed = buf.readDouble(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(entityID); ByteBufUtils.writeTag(buf, connection.writeToNBT()); buf.writeDouble(linePos); buf.writeDouble(speed); } public static class Handler implements IMessageHandler<MessageSkyhookSync, IMessage> { @Override public IMessage onMessage(MessageSkyhookSync message, MessageContext ctx) { Minecraft.getMinecraft().addScheduledTask(() -> { World world = ImmersiveEngineering.proxy.getClientWorld(); if(world!=null) { Entity ent = world.getEntityByID(message.entityID); if(ent instanceof EntitySkylineHook) { message.connection.getSubVertices(world); ((EntitySkylineHook)ent).setConnectionAndPos(message.connection, message.linePos, message.speed); } } }); return null; } }
<<<<<<< import blusunrize.immersiveengineering.common.config.IEServerConfig; ======= import blusunrize.immersiveengineering.common.util.CapabilityReference; >>>>>>> import blusunrize.immersiveengineering.common.config.IEServerConfig; import blusunrize.immersiveengineering.common.util.CapabilityReference; <<<<<<< int output = IEServerConfig.MACHINES.dieselGen_output.get(); int connected = 0; TileEntity[] receivers = new TileEntity[3]; for(int i = 0; i < 3; i++) { receivers[i] = getEnergyOutput(i==1?-1: i==2?1: 0); if(receivers[i]!=null) { if(EnergyHelper.insertFlux(receivers[i], Direction.DOWN, 4096, true) > 0) connected++; } } if(connected > 0&&tanks[0].getFluidAmount() >= fluidConsumed) ======= int output = IEConfig.MACHINES.dieselGen_output.get(); List<IEnergyStorage> presentOutputs = outputs.stream() .map(CapabilityReference::getNullable) .filter(Objects::nonNull) .collect(Collectors.toList()); if(!presentOutputs.isEmpty()&&tanks[0].getFluidAmount() >= fluidConsumed) >>>>>>> int output = IEServerConfig.MACHINES.dieselGen_output.get(); List<IEnergyStorage> presentOutputs = outputs.stream() .map(CapabilityReference::getNullable) .filter(Objects::nonNull) .collect(Collectors.toList()); if(!presentOutputs.isEmpty()&&tanks[0].getFluidAmount() >= fluidConsumed)
<<<<<<< ======= import blusunrize.immersiveengineering.common.IEConfig; import blusunrize.immersiveengineering.common.blocks.IEBaseTileEntity; >>>>>>> import blusunrize.immersiveengineering.common.blocks.IEBaseTileEntity; <<<<<<< import blusunrize.immersiveengineering.common.config.IEClientConfig; import blusunrize.immersiveengineering.common.config.IEServerConfig; ======= import blusunrize.immersiveengineering.common.entities.IEMinecartEntity; >>>>>>> import blusunrize.immersiveengineering.common.config.IEClientConfig; import blusunrize.immersiveengineering.common.config.IEServerConfig; import blusunrize.immersiveengineering.common.entities.IEMinecartEntity; <<<<<<< boolean drill = equipped.getItem() instanceof DrillItem; boolean buzzsaw = equipped.getItem() instanceof BuzzsawItem; IVertexBuilder builder = buffer.getBuffer(IERenderTypes.getGui(rl("textures/gui/hud_elements.png"))); float dx = scaledWidth-rightOffset-16; float dy = scaledHeight; transform.push(); transform.translate(dx, dy, 0); int w = 31; int h = 62; float uMin = 179/256f; float uMax = 210/256f; float vMin = 9/256f; float vMax = 71/256f; ClientUtils.drawTexturedRect(builder, transform, -24, -68, w, h, 1, 1, 1, 1, uMin, uMax, vMin, vMax); transform.translate(-23, -37, 0); LazyOptional<IFluidHandlerItem> handlerOpt = FluidUtil.getFluidHandler(equipped); handlerOpt.ifPresent(handler -> { int capacity = -1; if(handler.getTanks() > 0) capacity = handler.getTankCapacity(0); if(capacity > 0) { FluidStack fuel = handler.getFluidInTank(0); int amount = fuel.getAmount(); if(!drill&&player.isHandActive()&&player.getActiveHand()==hand) { int use = player.getItemInUseMaxCount(); amount -= use*IEServerConfig.TOOLS.chemthrower_consumption.get(); } float cap = (float)capacity; float angle = 83-(166*amount/cap); transform.push(); transform.rotate(new Quaternion(0, 0, angle, true)); ClientUtils.drawTexturedRect(builder, transform, 6, -2, 24, 4, 1, 1, 1, 1, 91/256f, 123/256f, 80/256f, 87/256f); transform.pop(); transform.translate(23, 37, 0); if(drill) { ClientUtils.drawTexturedRect(builder, transform, -54, -73, 66, 72, 1, 1, 1, 1, 108/256f, 174/256f, 4/256f, 76/256f); ItemStack head = ((DrillItem)equipped.getItem()).getHead(equipped); if(!head.isEmpty()) ClientUtils.renderItemWithOverlayIntoGUI(buffer, transform, head, -51, -45); } else if(buzzsaw) { ClientUtils.drawTexturedRect(builder, transform, -54, -73, 66, 72, 1, 1, 1, 1, 108/256f, 174/256f, 4/256f, 76/256f); ItemStack blade = ((BuzzsawItem)equipped.getItem()).getSawblade(equipped); if(!blade.isEmpty()) ClientUtils.renderItemWithOverlayIntoGUI(buffer, transform, blade, -51, -45); } else { ClientUtils.drawTexturedRect(builder, transform, -41, -73, 53, 72, 1, 1, 1, 1, 8/256f, 61/256f, 4/256f, 76/256f); boolean ignite = ChemthrowerItem.isIgniteEnable(equipped); ClientUtils.drawTexturedRect(builder, transform, -32, -43, 12, 12, 1, 1, 1, 1, 66/256f, 78/256f, (ignite?21: 9)/256f, (ignite?33: 21)/256f); ClientUtils.drawTexturedRect(builder, transform, -100, -20, 64, 16, 1, 1, 1, 1, 0/256f, 64/256f, 76/256f, 92/256f); if(!fuel.isEmpty()) { String name = ClientUtils.font().func_238417_a_(fuel.getDisplayName(), 50).getString().trim(); ClientUtils.font().renderString( name, -68-ClientUtils.font().getStringWidth(name)/2, -15, 0, false, transform.getLast().getMatrix(), buffer, false, 0, 0xf000f0 ); } } } }); transform.pop(); ======= ItemOverlayUtils.renderDrillOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); } else if(equipped.getItem() instanceof BuzzsawItem) { ItemOverlayUtils.renderBuzzsawOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); } else if(equipped.getItem() instanceof ChemthrowerItem) { ItemOverlayUtils.renderChemthrowerOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); >>>>>>> ItemOverlayUtils.renderDrillOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); } else if(equipped.getItem() instanceof BuzzsawItem) { ItemOverlayUtils.renderBuzzsawOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); } else if(equipped.getItem() instanceof ChemthrowerItem) { ItemOverlayUtils.renderChemthrowerOverlay(buffer, transform, scaledWidth, scaledHeight, player, hand, equipped); <<<<<<< if(text!=null&&text.length > 0) { FontRenderer font = ClientUtils.font(); int i = 0; IRenderTypeBuffer.Impl buffer = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer()); for(ITextComponent s : text) if(s!=null) font.func_238416_a_( LanguageMap.getInstance().func_241870_a(s), scaledWidth/2+8, scaledHeight/2+8+(i++)*font.FONT_HEIGHT, 0xffffffff, true, transform.getLast().getMatrix(), buffer, false, 0, 0xf000f0 ); buffer.finish(); } ======= BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight); >>>>>>> BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight); <<<<<<< if(frameEntity!=null) { ItemStack frameItem = frameEntity.getDisplayedItem(); if(frameItem.getItem()==Items.FILLED_MAP&&ItemNBTHelper.hasKey(frameItem, "Decorations", 9)) { World world = frameEntity.getEntityWorld(); MapData mapData = FilledMapItem.getMapData(frameItem, world); if(mapData!=null) { FontRenderer font = ClientUtils.font(); // Map center is usually only calculated serverside, so we gotta do it manually mapData.calculateMapCenter(world.getWorldInfo().getSpawnX(), world.getWorldInfo().getSpawnZ(), mapData.scale); int mapScale = 1<<mapData.scale; float mapRotation = (frameEntity.getRotation()%4)*1.5708f; // Player hit vector, relative to frame block pos Vector3d hitVec = mop.getHitVec().subtract(Vector3d.copy(frameEntity.getHangingPosition())); Direction frameDir = frameEntity.getHorizontalFacing(); double cursorH = 0; double cursorV = 0; // Get a 0-1 cursor coordinate; this could be ternary operator, but switchcase is easier to read switch(frameDir) { case DOWN: cursorH = hitVec.x; cursorV = 1-hitVec.z; break; case UP: cursorH = hitVec.x; cursorV = hitVec.z; break; case NORTH: cursorH = 1-hitVec.x; cursorV = 1-hitVec.y; break; case SOUTH: cursorH = hitVec.x; cursorV = 1-hitVec.y; break; case WEST: cursorH = hitVec.z; cursorV = 1-hitVec.y; break; case EAST: cursorH = 1-hitVec.z; cursorV = 1-hitVec.y; break; } // Multiply it to the number scale vanilla maps use cursorH *= 128; cursorV *= 128; ListNBT minerals = null; double lastDist = Double.MAX_VALUE; ListNBT nbttaglist = frameItem.getTag().getList("Decorations", 10); for(INBT inbt : nbttaglist) { CompoundNBT tagCompound = (CompoundNBT)inbt; String id = tagCompound.getString("id"); if(id.startsWith("ie:coresample_")&&tagCompound.contains("minerals")) { double sampleX = tagCompound.getDouble("x"); double sampleZ = tagCompound.getDouble("z"); // Map coordinates require some pretty funky maths. I tried to simplify this, // and ran into issues that made highlighting fail on certain markers. // This implementation works, so I just won't touch it again. float f = (float)(sampleX-(double)mapData.xCenter)/(float)mapScale; float f1 = (float)(sampleZ-(double)mapData.zCenter)/(float)mapScale; byte b0 = (byte)((int)((double)(f*2.0F)+0.5D)); byte b1 = (byte)((int)((double)(f1*2.0F)+0.5D)); // Make it a vector, rotate it around the map center Vector3d mapPos = new Vector3d(0, b1, b0); mapPos = mapPos.rotatePitch(mapRotation); // Turn it into a 0.0 to 128.0 offset double offsetH = (mapPos.z/2.0F+64.0F); double offsetV = (mapPos.y/2.0F+64.0F); // Get cursor distance double dH = cursorH-offsetH; double dV = cursorV-offsetV; double dist = dH*dH+dV*dV; if(dist < 10&&dist < lastDist) { lastDist = dist; minerals = tagCompound.getList("minerals", NBT.TAG_STRING); } } } if(minerals!=null) for(int i = 0; i < minerals.size(); i++) { MineralMix mix = MineralMix.mineralList.get(new ResourceLocation(minerals.getString(i))); if(mix!=null) font.drawStringWithShadow(transform, I18n.format(mix.getTranslationKey()), scaledWidth/2+8, scaledHeight/2+8+i*font.FONT_HEIGHT, 0xffffff); } } } } ======= >>>>>>>
<<<<<<< List<Entity> list = input.world.getEntitiesInAABBexcluding(input, input.getEntityBoundingBox().addCoord(look.xCoord * maxReach, look.yCoord * maxReach, look.zCoord * maxReach).expand(area, area, area), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate<Entity>() ======= List<Entity> list = input.worldObj.getEntitiesInAABBexcluding(input, input.getEntityBoundingBox().addCoord(look.xCoord * maxReach, look.yCoord * maxReach, look.zCoord * maxReach).expand(area, area, area), new Predicate<Entity>() >>>>>>> List<Entity> list = input.world.getEntitiesInAABBexcluding(input, input.getEntityBoundingBox().addCoord(look.xCoord * maxReach, look.yCoord * maxReach, look.zCoord * maxReach).expand(area, area, area), new Predicate<Entity>()
<<<<<<< Frame frame = actor.playback.record.frames.get(actor.playback.tick); ItemStack items = new ItemStack(this.itemData); ======= Frame frame = actor.playback.getCurrentFrame(); ItemStack items = ItemStack.loadItemStackFromNBT(this.itemData); >>>>>>> Frame frame = actor.playback.getCurrentFrame(); ItemStack items = new ItemStack(this.itemData);
<<<<<<< import blusunrize.immersiveengineering.api.ApiUtils; import blusunrize.immersiveengineering.api.utils.shapes.CachedShapesWithTransform; import blusunrize.immersiveengineering.client.ClientUtils; import blusunrize.immersiveengineering.client.models.IOBJModelCallback; ======= >>>>>>> import blusunrize.immersiveengineering.api.utils.shapes.CachedShapesWithTransform; <<<<<<< import blusunrize.immersiveengineering.common.util.Utils; import com.google.common.collect.ImmutableList; ======= >>>>>>> import com.google.common.collect.ImmutableList;
<<<<<<< import blusunrize.immersiveengineering.common.config.IEClientConfig; ======= import blusunrize.immersiveengineering.common.IEConfig; import blusunrize.immersiveengineering.common.util.IELogger; >>>>>>> import blusunrize.immersiveengineering.common.config.IEClientConfig; import blusunrize.immersiveengineering.common.util.IELogger; <<<<<<< if(IEClientConfig.enableVBOs.get()) ======= if(IEConfig.GENERAL.enableVBOs.get()&&!HAS_OPTIFINE.get()) >>>>>>> if(IEClientConfig.enableVBOs.get()&&!HAS_OPTIFINE.get())
<<<<<<< ======= import javax.annotation.Nonnull; import javax.vecmath.Matrix4f; >>>>>>> import javax.annotation.Nonnull; <<<<<<< if(entity!=null&&entity.isAlive()&&!(entity instanceof PlayerEntity&&entity.isSneaking())) { double distY = Math.abs(getTile().getPos().add(0, 1, 0).getY()+.5-entity.getPosY()); double treshold = .9; boolean contact = distY < treshold; ======= boolean outputBlocked = isOutputBlocked(); double distY = Math.abs(getTile().getPos().add(0, 1, 0).getY()+.5-entity.posY); double treshold = .9; boolean contact = distY < treshold; >>>>>>> boolean outputBlocked = isOutputBlocked(); double distY = Math.abs(getTile().getPos().add(0, 1, 0).getY()+.5-entity.getPosY()); double treshold = .9; boolean contact = distY < treshold; <<<<<<< ItemEntity item = (ItemEntity)entity; if(!contact) { if(item.age > item.lifespan-60*20) item.age = item.lifespan-60*20; } else ======= TileEntity inventoryTile; inventoryTile = getTile().getWorld().getTileEntity(getTile().getPos().add(0, 1, 0)); if(!getTile().getWorld().isRemote) >>>>>>> TileEntity inventoryTile; inventoryTile = getTile().getWorld().getTileEntity(getTile().getPos().add(0, 1, 0)); if(!getTile().getWorld().isRemote)
<<<<<<< hit.attackEntityFrom(IEDamageSources.causeWolfpackDamage(this, world.getPlayerByUuid(field_234609_b_)), IEServerConfig.TOOLS.bulletDamage_WolfpackPart.get().floatValue()); ======= Entity shooter = field_234609_b_!=null?world.getPlayerByUuid(field_234609_b_): null; hit.attackEntityFrom(IEDamageSources.causeWolfpackDamage(this, shooter), IEConfig.TOOLS.bulletDamage_WolfpackPart.get().floatValue()); >>>>>>> Entity shooter = field_234609_b_!=null?world.getPlayerByUuid(field_234609_b_): null; hit.attackEntityFrom(IEDamageSources.causeWolfpackDamage(this, shooter), IEServerConfig.TOOLS.bulletDamage_WolfpackPart.get().floatValue());
<<<<<<< ======= import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.FluidAttributes; >>>>>>> import net.minecraftforge.fluids.FluidAttributes;
<<<<<<< import net.minecraft.state.Property; ======= import net.minecraft.state.IProperty; import net.minecraft.state.properties.BlockStateProperties; >>>>>>> import net.minecraft.state.Property; import net.minecraft.state.properties.BlockStateProperties;
<<<<<<< import net.minecraft.util.ResourceLocation; ======= import net.minecraft.util.Direction.Axis; >>>>>>> <<<<<<< ======= import org.lwjgl.opengl.GL11; >>>>>>>
<<<<<<< ImmutableList.of(IEProperties.FACING_HORIZONTAL), (b, p) -> null); ======= ImmutableList.of(IEProperties.FACING_HORIZONTAL, BlockStateProperties.WATERLOGGED), ImmutableList.of(), (b, p) -> null); >>>>>>> ImmutableList.of(IEProperties.FACING_HORIZONTAL, BlockStateProperties.WATERLOGGED), (b, p) -> null);
<<<<<<< import net.minecraft.client.renderer.BlockRendererDispatcher; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.model.BakedQuad; ======= import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.Quaternion; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.Vector3f; >>>>>>> import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; <<<<<<< import net.minecraft.util.math.vector.Quaternion; import net.minecraft.util.math.vector.Vector3f; import net.minecraftforge.client.model.data.IModelData; ======= import net.minecraftforge.client.model.data.EmptyModelData; >>>>>>> import net.minecraft.util.math.vector.Quaternion; import net.minecraft.util.math.vector.Vector3f; import net.minecraftforge.client.model.data.EmptyModelData;
<<<<<<< import blusunrize.immersiveengineering.client.utils.IERenderTypes; import blusunrize.immersiveengineering.client.utils.TransformingVertexBuilder; ======= import blusunrize.immersiveengineering.api.tool.RailgunHandler.RailgunRenderColors; import blusunrize.immersiveengineering.api.tool.RailgunHandler.StandardRailgunProjectile; import blusunrize.immersiveengineering.client.ClientUtils; >>>>>>> import blusunrize.immersiveengineering.api.tool.RailgunHandler.RailgunRenderColors; import blusunrize.immersiveengineering.api.tool.RailgunHandler.StandardRailgunProjectile; import blusunrize.immersiveengineering.client.ClientUtils; import blusunrize.immersiveengineering.client.utils.IERenderTypes; import blusunrize.immersiveengineering.client.utils.TransformingVertexBuilder; <<<<<<< int colWidth = colourMap[0].length; for(int[] ints : colourMap) colWidth = Math.min(colWidth, ints.length); int colLength = colourMap.length; ======= int colWidth = colors.getGradientLength(); int colLength = colors.getRingCount(); >>>>>>> int colWidth = colors.getGradientLength(); int colLength = colors.getRingCount(); <<<<<<< matrixStackIn.translate(-length*.85f, 0, 0); TransformingVertexBuilder builder = new TransformingVertexBuilder( bufferIn.getBuffer(IERenderTypes.POSITION_COLOR_LIGHTMAP), matrixStackIn ); builder.setLight(light); int colR; int colG; int colB; ======= GlStateManager.translated(-length*.85f, 0, 0); worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); int[] rgb; >>>>>>> matrixStackIn.translate(-length*.85f, 0, 0); TransformingVertexBuilder builder = new TransformingVertexBuilder( bufferIn.getBuffer(IERenderTypes.POSITION_COLOR_LIGHTMAP), matrixStackIn ); builder.setLight(light); int[] rgb; <<<<<<< colR = (colourMap[0][i] >> 16)&255; colG = (colourMap[0][i] >> 8)&255; colB = colourMap[0][i]&255; builder.pos(0, height, -halfWidth+widthStep*i).color(colR, colG, colB, 255).endVertex(); builder.pos(0, 0, -halfWidth+widthStep*i).color(colR, colG, colB, 255).endVertex(); builder.pos(0, 0, -halfWidth+widthStep*(i+1)).color(colR, colG, colB, 255).endVertex(); builder.pos(0, height, -halfWidth+widthStep*(i+1)).color(colR, colG, colB, 255).endVertex(); colR = colourMap[colLength-1][i] >> 16&255; colG = colourMap[colLength-1][i] >> 8&255; colB = colourMap[colLength-1][i]&255; builder.pos(length, 0, -halfWidth+widthStep*i).color(colR, colG, colB, 255).endVertex(); builder.pos(length, height, -halfWidth+widthStep*i).color(colR, colG, colB, 255).endVertex(); builder.pos(length, height, -halfWidth+widthStep*(i+1)).color(colR, colG, colB, 255).endVertex(); builder.pos(length, 0, -halfWidth+widthStep*(i+1)).color(colR, colG, colB, 255).endVertex(); ======= rgb = colors.getFrontColor(i); worldrenderer.pos(0, height, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(0, 0, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(0, 0, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(0, height, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); rgb = colors.getBackColor(i); worldrenderer.pos(length, 0, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(length, height, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(length, height, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(length, 0, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); >>>>>>> rgb = colors.getFrontColor(i); builder.pos(0, height, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(0, 0, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(0, 0, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(0, height, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); rgb = colors.getBackColor(i); builder.pos(length, 0, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(length, height, -halfWidth+widthStep*i).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(length, height, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(length, 0, -halfWidth+widthStep*(i+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); <<<<<<< colR = colourMap[i][0] >> 16&255; colG = colourMap[i][0] >> 8&255; colB = colourMap[i][0]&255; builder.pos(lengthStep*i, 0, -halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), height, -halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth).color(colR, colG, colB, 255).endVertex(); colR = colourMap[i][colWidth-1] >> 16&255; colG = colourMap[i][colWidth-1] >> 8&255; colB = colourMap[i][colWidth-1]&255; builder.pos(lengthStep*i, height, halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, 0, halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), 0, halfWidth).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), height, halfWidth).color(colR, colG, colB, 255).endVertex(); ======= rgb = colors.getRingColor(i, 0); worldrenderer.pos(lengthStep*i, 0, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, height, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), height, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), 0, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); rgb = colors.getRingColor(i, colWidth-1); worldrenderer.pos(lengthStep*i, height, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, 0, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), 0, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), height, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); >>>>>>> rgb = colors.getRingColor(i, 0); builder.pos(lengthStep*i, 0, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), height, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); rgb = colors.getRingColor(i, colWidth-1); builder.pos(lengthStep*i, height, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, 0, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), 0, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), height, halfWidth).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); <<<<<<< colR = colourMap[i][j] >> 16&255; colG = colourMap[i][j] >> 8&255; colB = colourMap[i][j]&255; builder.pos(lengthStep*(i+1), height, -halfWidth+widthStep*j).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth+widthStep*j).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth+widthStep*(j+1)).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), height, -halfWidth+widthStep*(j+1)).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, 0, -halfWidth+widthStep*j).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*j).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*(j+1)).color(colR, colG, colB, 255).endVertex(); builder.pos(lengthStep*i, 0, -halfWidth+widthStep*(j+1)).color(colR, colG, colB, 255).endVertex(); ======= rgb = colors.getRingColor(i, j); worldrenderer.pos(lengthStep*(i+1), height, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, height, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, height, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), height, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, 0, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); worldrenderer.pos(lengthStep*i, 0, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); >>>>>>> rgb = colors.getRingColor(i, j); builder.pos(lengthStep*(i+1), height, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, height, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), height, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, 0, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*j).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*(i+1), 0, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex(); builder.pos(lengthStep*i, 0, -halfWidth+widthStep*(j+1)).color(rgb[0], rgb[1], rgb[2], 255).endVertex();
<<<<<<< import net.minecraftforge.client.gui.ForgeIngameGui; ======= import net.minecraftforge.common.util.Constants.NBT; >>>>>>> import net.minecraftforge.client.gui.ForgeIngameGui; import net.minecraftforge.common.util.Constants.NBT; <<<<<<< transform.push(); PlayerEntity player = ClientUtils.mc().player; int chunkX = (int)player.getPosX() >> 4<<4; int chunkZ = (int)player.getPosZ() >> 4<<4; int y = Math.min((int)player.getPosY()-2, 0); float h = (float)Math.max(32, player.getPosY()-y+4); float r = Lib.COLOUR_F_ImmersiveOrange[0]; float g = Lib.COLOUR_F_ImmersiveOrange[1]; float b = Lib.COLOUR_F_ImmersiveOrange[2]; transform.translate(chunkX, y+2, chunkZ); IVertexBuilder bufferBuilder = buffers.getBuffer(IERenderTypes.CHUNK_MARKER); Matrix4f mat = transform.getLast().getMatrix(); bufferBuilder.pos(mat, 0, 0, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, h, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 0, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, h, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 0, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, h, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, 0, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, h, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, 2, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 2, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, 2, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, 2, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 0, 2, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 2, 16).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 2, 0).color(r, g, b, .375f).endVertex(); bufferBuilder.pos(mat, 16, 2, 16).color(r, g, b, .375f).endVertex(); transform.pop(); ======= Tessellator tessellator = Tessellator.getInstance(); GlStateManager.disableTexture(); GlStateManager.enableBlend(); GlStateManager.disableCull(); GlStateManager.blendFuncSeparate(770, 771, 1, 0); GlStateManager.shadeModel(GL11.GL_SMOOTH); tessellator.getBuffer().setTranslation(-px, -py, -pz); FractalParticle part; while((part = FractalParticle.PARTICLE_FRACTAL_DEQUE.pollFirst())!=null) part.render(tessellator, tessellator.getBuffer(), partial); tessellator.getBuffer().setTranslation(0, 0, 0); GlStateManager.shadeModel(GL11.GL_FLAT); GlStateManager.enableCull(); GlStateManager.disableBlend(); GlStateManager.enableTexture(); >>>>>>> List<Pair<RenderType, List<Consumer<IVertexBuilder>>>> renders = new ArrayList<>(); for(FractalParticle p : FractalParticle.PARTICLE_FRACTAL_DEQUE) for(Entry<RenderType, Consumer<IVertexBuilder>> r : p.render(partial, transform)) { boolean added = false; for(Entry<RenderType, List<Consumer<IVertexBuilder>>> e : renders) if(e.getKey().equals(r.getKey())) { e.getValue().add(r.getValue()); added = true; break; } if(!added) renders.add(Pair.of(r.getKey(), new ArrayList<>(ImmutableList.of(r.getValue())))); } for(Entry<RenderType, List<Consumer<IVertexBuilder>>> entry : renders) { IVertexBuilder bb = buffers.getBuffer(entry.getKey()); for(Consumer<IVertexBuilder> render : entry.getValue()) render.accept(bb); } FractalParticle.PARTICLE_FRACTAL_DEQUE.clear();
<<<<<<< public MiscConnectorBlock(String name, Supplier<TileEntityType<?>> tileType, Property<?>... extraProperties) ======= public MiscConnectorBlock(String name, RegistryObject<TileEntityType<T>> tileType, IProperty<?>... extraProperties) >>>>>>> public MiscConnectorBlock(String name, RegistryObject<TileEntityType<T>> tileType, Property<?>... extraProperties) <<<<<<< public MiscConnectorBlock(String name, Supplier<TileEntityType<?>> tileType, List<Property<?>> extraProps, ======= public MiscConnectorBlock(String name, RegistryObject<TileEntityType<T>> tileType, List<IProperty<?>> extraProps, >>>>>>> public MiscConnectorBlock(String name, RegistryObject<TileEntityType<T>> tileType, List<Property<?>> extraProps,
<<<<<<< import net.minecraft.state.Property; ======= import net.minecraft.pathfinding.PathType; import net.minecraft.state.IProperty; >>>>>>> import net.minecraft.pathfinding.PathType; import net.minecraft.state.Property;
<<<<<<< private static final Multimap<RegistryKey<World>, MineralVein> MINERAL_VEIN_LIST = ArrayListMultimap.create(); private static final Map<Pair<RegistryKey<World>, ColumnPos>, MineralWorldInfo> MINERAL_INFO_CACHE = new HashMap<>(); ======= private static final Multimap<DimensionType, MineralVein> MINERAL_VEIN_LIST = ArrayListMultimap.create(); // Only access when synchronized on MINERAL_VEIN_LIST private static final Map<Pair<DimensionType, ColumnPos>, MineralWorldInfo> MINERAL_INFO_CACHE = new HashMap<>(); >>>>>>> private static final Multimap<RegistryKey<World>, MineralVein> MINERAL_VEIN_LIST = ArrayListMultimap.create(); // Only access when synchronized on MINERAL_VEIN_LIST private static final Map<Pair<RegistryKey<World>, ColumnPos>, MineralWorldInfo> MINERAL_INFO_CACHE = new HashMap<>(); <<<<<<< public static Multimap<RegistryKey<World>, MineralVein> getMineralVeinList() ======= // Always call "resetCache" after modifying the map returned here! public static Multimap<DimensionType, MineralVein> getMineralVeinList() >>>>>>> // Always call "resetCache" after modifying the map returned here! public static Multimap<RegistryKey<World>, MineralVein> getMineralVeinList() <<<<<<< RegistryKey<World> dimension = world.func_234923_W_(); Pair<RegistryKey<World>, ColumnPos> cacheKey = Pair.of(dimension, columnPos); MineralWorldInfo worldInfo = MINERAL_INFO_CACHE.get(cacheKey); if(worldInfo==null) ======= DimensionType dimension = world.getDimension().getType(); Pair<DimensionType, ColumnPos> cacheKey = Pair.of(dimension, columnPos); synchronized(MINERAL_VEIN_LIST) >>>>>>> RegistryKey<World> dimension = world.func_234923_W_(); Pair<RegistryKey<World>, ColumnPos> cacheKey = Pair.of(dimension, columnPos); synchronized(MINERAL_VEIN_LIST) <<<<<<< MINERAL_VEIN_LIST.put(world.func_234923_W_(), vein); ======= addVein(dimension, vein); >>>>>>> addVein(world.func_234923_W_(), vein);
<<<<<<< import com.mojang.serialization.Codec; ======= import com.google.common.collect.HashMultimap; import com.mojang.datafixers.Dynamic; >>>>>>> import com.google.common.collect.HashMultimap; import com.mojang.serialization.Codec; <<<<<<< import net.minecraft.util.RegistryKey; ======= import net.minecraft.util.ResourceLocation; import net.minecraft.util.SharedSeedRandom; >>>>>>> import net.minecraft.util.RegistryKey; import net.minecraft.util.SharedSeedRandom; <<<<<<< ======= import net.minecraft.world.chunk.IChunk; import net.minecraft.world.dimension.DimensionType; >>>>>>> import net.minecraft.world.chunk.IChunk; import net.minecraft.world.dimension.DimensionType;
<<<<<<< import blusunrize.immersiveengineering.api.utils.TagUtils; import net.minecraft.client.Minecraft; ======= import blusunrize.immersiveengineering.common.blocks.multiblocks.StaticTemplateManager; >>>>>>> import blusunrize.immersiveengineering.api.utils.TagUtils; import blusunrize.immersiveengineering.common.blocks.multiblocks.StaticTemplateManager; import net.minecraft.client.Minecraft; <<<<<<< import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; ======= import net.minecraft.server.MinecraftServer; >>>>>>> import net.minecraft.server.MinecraftServer; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; <<<<<<< ======= import net.minecraftforge.fml.common.thread.EffectiveSide; import net.minecraftforge.fml.network.PacketDistributor; import net.minecraftforge.fml.server.ServerLifecycleHooks; >>>>>>> import net.minecraftforge.fml.network.PacketDistributor; import net.minecraftforge.fml.server.ServerLifecycleHooks; <<<<<<< RecipeManager recipeManager = dataPackRegistries.func_240967_e_(); ======= MinecraftServer server = ServerLifecycleHooks.getCurrentServer(); RecipeManager recipeManager = server.getRecipeManager(); >>>>>>> MinecraftServer server = ServerLifecycleHooks.getCurrentServer(); RecipeManager recipeManager = dataPackRegistries.func_240967_e_();
<<<<<<< { if(w.isRemote) { if(w!=cachedClientWorld) { cachedClientWorld = w; cachedClientNet = new GlobalWireNetwork(w); } return cachedClientNet; } throw new RuntimeException("No net handler found for dimension "+w.func_234922_V_().func_240901_a_()+", remote: "+w.isRemote); } GlobalWireNetwork ret = Objects.requireNonNull(netOptional.orElse(null)); ======= throw new RuntimeException("No net handler found for dimension "+w.getDimension().getType().getRegistryName()+", remote: "+w.isRemote); GlobalWireNetwork ret = netOptional.orElseThrow(RuntimeException::new); >>>>>>> { if(w.isRemote) { if(w!=cachedClientWorld) { cachedClientWorld = w; cachedClientNet = new GlobalWireNetwork(w); } return cachedClientNet; } throw new RuntimeException("No net handler found for dimension "+w.func_234922_V_().func_240901_a_()+", remote: "+w.isRemote); } GlobalWireNetwork ret = netOptional.orElseThrow(RuntimeException::new); <<<<<<< Preconditions.checkNotNull(oldNet.getConnector(c.getEndB())); oldNet.removeConnection(c, world); ======= Preconditions.checkNotNull( oldNet.getConnector(c.getEndB()), "Removing connection %s from net %s, but does not have connector for %s", c, oldNet, c.getEndB() ); oldNet.removeConnection(c); >>>>>>> Preconditions.checkNotNull( oldNet.getConnector(c.getEndB()), "Removing connection %s from net %s, but does not have connector for %s", c, oldNet, c.getEndB() ); oldNet.removeConnection(c, world); <<<<<<< newNet.addConnector(pos, new IICProxy(world.func_234923_W_(), pos.getPosition())); ======= IImmersiveConnectable proxy = proxyProvider.create( pos.getPosition(), ImmutableList.of(), ImmutableList.of() ); newNet.addConnector(pos, proxy, this); >>>>>>> IImmersiveConnectable proxy = proxyProvider.create( pos.getPosition(), ImmutableList.of(), ImmutableList.of() ); newNet.addConnector(pos, proxy, this);
<<<<<<< this.entity = new EntityActor(Minecraft.getMinecraft().world); ======= this.entity = new EntityActor(Minecraft.getMinecraft().theWorld); this.entity.onGround = true; >>>>>>> this.entity = new EntityActor(Minecraft.getMinecraft().world); this.entity.onGround = true;
<<<<<<< import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; ======= import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; >>>>>>> import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.util.math.vector.Vector3d; import net.minecraft.util.math.vector.Vector3i; <<<<<<< Vector3d start = ((IImmersiveConnectable)teA).getConnectionOffset(conn, conn.getEndA()); Vector3d end = ((IImmersiveConnectable)teB).getConnectionOffset(conn, conn.getEndB()); Vector3i offsetEndInt = conn.getEndB().getPosition().subtract(conn.getEndA().getPosition()); Vector3d offsetEnd = new Vector3d(offsetEndInt.getX(), offsetEndInt.getY(), offsetEndInt.getZ()); raytraceAlongCatenaryRelative(conn, (p) -> { ======= Vec3d start = ((IImmersiveConnectable)teA).getConnectionOffset(conn, conn.getEndA()); Vec3d end = ((IImmersiveConnectable)teB).getConnectionOffset(conn, conn.getEndB()); WireUtils.raytraceAlongCatenaryRelative(conn, (p) -> { >>>>>>> Vector3d start = ((IImmersiveConnectable)teA).getConnectionOffset(conn, conn.getEndA()); Vector3d end = ((IImmersiveConnectable)teB).getConnectionOffset(conn, conn.getEndB()); Vector3i offsetEndInt = conn.getEndB().getPosition().subtract(conn.getEndA().getPosition()); Vector3d offsetEnd = new Vector3d(offsetEndInt.getX(), offsetEndInt.getY(), offsetEndInt.getZ()); WireUtils.raytraceAlongCatenaryRelative(conn, (p) -> { <<<<<<< if(preventsConnection(world, p.getLeft(), state, p.getMiddle(), p.getRight())) ======= if(WireUtils.preventsConnection(world, p.getLeft(), state, p.getMiddle(), p.getRight())) >>>>>>> if(WireUtils.preventsConnection(world, p.getLeft(), state, p.getMiddle(), p.getRight()))
<<<<<<< ======= import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.VertexBuffer; >>>>>>> <<<<<<< GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); ======= GlStateManager.enableBlend(); >>>>>>> GlStateManager.enableBlend(); <<<<<<< GlStateManager.disableBlend(); GlStateManager.enableTexture2D(); ======= GlStateManager.disableBlend(); >>>>>>> GlStateManager.disableBlend();
<<<<<<< ItemStack stack = player.getHeldItem(hand); if (world.isRemote) { return super.onItemRightClick(world, player, hand); } return new ActionResult<ItemStack>(this.shoot(stack.getTagCompound(), player, world) ? EnumActionResult.SUCCESS : EnumActionResult.FAIL, stack); ======= return new ActionResult<ItemStack>(this.shootIt(stack, player, world), stack); >>>>>>> ItemStack stack = player.getHeldItem(hand); return new ActionResult<ItemStack>(this.shootIt(stack, player, world), stack); <<<<<<< ItemStack stack = player.getHeldItem(hand); ======= return this.shootIt(stack, player, world); } public EnumActionResult shootIt(ItemStack stack, EntityPlayer player, World world) { >>>>>>> ItemStack stack = player.getHeldItem(hand); return this.shootIt(stack, player, world); } public EnumActionResult shootIt(ItemStack stack, EntityPlayer player, World world) { <<<<<<< world.spawnEntity(projectile); ======= Dispatcher.sendToTracked(player, new PacketGunShot(player.getEntityId())); >>>>>>> Dispatcher.sendToTracked(player, new PacketGunShot(player.getEntityId()));
<<<<<<< import blusunrize.immersiveengineering.api.utils.TagUtils; import blusunrize.immersiveengineering.common.EventHandler; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IGeneralMultiblock; ======= import blusunrize.immersiveengineering.api.crafting.IngredientWithSize; import blusunrize.immersiveengineering.api.utils.*; import blusunrize.immersiveengineering.api.wires.*; import blusunrize.immersiveengineering.api.wires.Connection.CatenaryData; import blusunrize.immersiveengineering.api.wires.utils.WireUtils; import blusunrize.immersiveengineering.api.wires.utils.WirecoilUtils; >>>>>>> import blusunrize.immersiveengineering.api.utils.SetRestrictedField; import blusunrize.immersiveengineering.api.utils.TagUtils; <<<<<<< ======= import it.unimi.dsi.fastutil.ints.Int2IntFunction; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.TransformationMatrix; import net.minecraft.client.renderer.model.BakedQuad; >>>>>>> <<<<<<< import java.util.Map; import java.util.TreeMap; ======= import javax.annotation.Nullable; import java.util.*; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; >>>>>>> import java.util.Map; import java.util.TreeMap; import java.util.function.Consumer; import java.util.function.Predicate; <<<<<<< ======= public static final SetRestrictedField<Consumer<TileEntity>> disableTicking = new SetRestrictedField<>(); @Deprecated public static boolean compareToOreName(ItemStack stack, ResourceLocation oreName) { return TagUtils.isInBlockOrItemTag(stack, oreName); } @Deprecated public static boolean stackMatchesObject(ItemStack stack, Object o) { return ItemUtils.stackMatchesObject(stack, o); } @Deprecated public static boolean stackMatchesObject(ItemStack stack, Object o, boolean checkNBT) { return ItemUtils.stackMatchesObject(stack, o, checkNBT); } @Deprecated public static ItemStack copyStackWithAmount(ItemStack stack, int amount) { return ItemUtils.copyStackWithAmount(stack, amount); } @Deprecated public static boolean stacksMatchIngredientList(List<Ingredient> list, NonNullList<ItemStack> stacks) { return IngredientUtils.stacksMatchIngredientList(list, stacks); } @Deprecated public static boolean stacksMatchIngredientWithSizeList(List<IngredientWithSize> list, NonNullList<ItemStack> stacks) { return IngredientUtils.stacksMatchIngredientWithSizeList(list, stacks); } @Deprecated public static Ingredient createIngredientFromList(List<ItemStack> list) { return IngredientUtils.createIngredientFromList(list); } @Deprecated public static ComparableItemStack createComparableItemStack(ItemStack stack, boolean copy) { return ComparableItemStack.create(stack, copy); } @Deprecated public static ComparableItemStack createComparableItemStack(ItemStack stack, boolean copy, boolean useNbt) { return ComparableItemStack.create(stack, copy, useNbt); } >>>>>>> public static final SetRestrictedField<Consumer<TileEntity>> disableTicking = new SetRestrictedField<>();
<<<<<<< protected abstract void replaceStructureBlock(BlockInfo info, World world, BlockPos actualPos, boolean mirrored, Direction clickDirection, Vector3i offsetFromMaster); ======= public BlockPos getMasterFromOriginOffset() { return masterFromOrigin; } protected abstract void replaceStructureBlock(BlockInfo info, World world, BlockPos actualPos, boolean mirrored, Direction clickDirection, Vec3i offsetFromMaster); >>>>>>> public BlockPos getMasterFromOriginOffset() { return masterFromOrigin; } protected abstract void replaceStructureBlock(BlockInfo info, World world, BlockPos actualPos, boolean mirrored, Direction clickDirection, Vector3i offsetFromMaster);
<<<<<<< int meta = stack.getMetadata(); return meta==HAMMER_META?ImmutableSet.of(Lib.TOOL_HAMMER): meta==CUTTER_META?ImmutableSet.of(Lib.TOOL_WIRECUTTER): new HashSet<String>(); ======= int meta = stack.getItemDamage(); return meta==HAMMER_META?ImmutableSet.of(TOOL_HAMMER): meta==CUTTER_META?ImmutableSet.of(Lib.TOOL_WIRECUTTER): new HashSet<String>(); >>>>>>> int meta = stack.getMetadata(); return meta==HAMMER_META?ImmutableSet.of(TOOL_HAMMER): meta==CUTTER_META?ImmutableSet.of(Lib.TOOL_WIRECUTTER): new HashSet<String>(); <<<<<<< ======= @Override public boolean canHarvestBlock(IBlockState state, ItemStack stack) { if (stack.getMetadata() == HAMMER_META) { if (state.getBlock() instanceof BlockIEBase) { if(((BlockIEBase) state.getBlock()).allowHammerHarvest(state)) return true; } else if (state.getBlock().isToolEffective(TOOL_HAMMER, state)) return true; } else if (stack.getMetadata() == CUTTER_META) { if (state.getBlock() instanceof BlockIEBase) { if(((BlockIEBase) state.getBlock()).allowWirecutterHarvest(state)) return true; } else if (state.getBlock().isToolEffective(TOOL_WIRECUTTER, state)) return true; } return super.canHarvestBlock(state, stack); } >>>>>>> @Override public boolean canHarvestBlock(IBlockState state, ItemStack stack) { if (stack.getMetadata() == HAMMER_META) { if (state.getBlock() instanceof BlockIEBase) { if(((BlockIEBase) state.getBlock()).allowHammerHarvest(state)) return true; } else if (state.getBlock().isToolEffective(TOOL_HAMMER, state)) return true; } else if (stack.getMetadata() == CUTTER_META) { if (state.getBlock() instanceof BlockIEBase) { if(((BlockIEBase) state.getBlock()).allowWirecutterHarvest(state)) return true; } else if (state.getBlock().isToolEffective(TOOL_WIRECUTTER, state)) return true; } return super.canHarvestBlock(state, stack); }
<<<<<<< default Vector3d getDirection(Entity entity) ======= default Vec3d getDirection(Entity entity, boolean outputBlocked) >>>>>>> default Vector3d getDirection(Entity entity, boolean outputBlocked) <<<<<<< if(conveyorDirection!=ConveyorDirection.HORIZONTAL) entity.func_230245_c_(false); if(getFacing()==Direction.WEST||getFacing()==Direction.EAST) ======= if(facing==Direction.WEST||facing==Direction.EAST) >>>>>>> if(facing==Direction.WEST||facing==Direction.EAST) <<<<<<< return new Vector3d(vX, vY, vZ); ======= if(conveyorDirection!=ConveyorDirection.HORIZONTAL) { // Attempt to fix entity to the highest point under it final Vec3d centerRelative = entity.getPositionVec() .subtract(new Vec3d(pos)) .subtract(0.5+vX, 0.5, 0.5+vZ); final double conveyorHeight = 2/16.; final double centerOffsetInDirection = centerRelative.dotProduct(new Vec3d(facing.getDirectionVec())); final double radius = entity.getSize(entity.getPose()).width/2; final double maxEntityPos = centerOffsetInDirection+radius; double maxCenterHeightUnderEntity = maxEntityPos+conveyorHeight; if(conveyorDirection==ConveyorDirection.DOWN) maxCenterHeightUnderEntity = -maxCenterHeightUnderEntity; if(conveyorDirection==ConveyorDirection.UP) { if(maxCenterHeightUnderEntity > centerRelative.y||!outputBlocked) vY = 0.17D*vBase; } else vY = Math.signum(maxCenterHeightUnderEntity-centerRelative.y)*0.07*vBase; entity.onGround = false; } return new Vec3d(vX, vY, vZ); >>>>>>> if(conveyorDirection!=ConveyorDirection.HORIZONTAL) { // Attempt to fix entity to the highest point under it final Vector3d centerRelative = entity.getPositionVec() .subtract(new Vector3d(pos.getX(), pos.getY(), pos.getZ())) .subtract(0.5+vX, 0.5, 0.5+vZ); final double conveyorHeight = 2/16.; final Vector3i directionVector = facing.getDirectionVec(); final double centerOffsetInDirection = centerRelative.dotProduct(new Vector3d(directionVector.getX(), directionVector.getY(), directionVector.getZ())); final double radius = entity.getSize(entity.getPose()).width/2; final double maxEntityPos = centerOffsetInDirection+radius; double maxCenterHeightUnderEntity = maxEntityPos+conveyorHeight; if(conveyorDirection==ConveyorDirection.DOWN) maxCenterHeightUnderEntity = -maxCenterHeightUnderEntity; if(conveyorDirection==ConveyorDirection.UP) { if(maxCenterHeightUnderEntity > centerRelative.y||!outputBlocked) vY = 0.17D*vBase; } else vY = Math.signum(maxCenterHeightUnderEntity-centerRelative.y)*0.07*vBase; entity.func_230245_c_(false); } return new Vector3d(vX, vY, vZ); <<<<<<< Vector3d vec = this.getDirection(entity); ======= boolean hasBeenHandled = !markEntityAsHandled(entity); final boolean outputBlocked = isOutputBlocked(); Vec3d vec = this.getDirection(entity, outputBlocked); >>>>>>> boolean hasBeenHandled = !markEntityAsHandled(entity); final boolean outputBlocked = isOutputBlocked(); Vector3d vec = this.getDirection(entity, outputBlocked);
<<<<<<< super("current_transformer", () -> EnergyMeterTileEntity.TYPE, DUMMY, FACING); ======= super("current_transformer", () -> EnergyMeterTileEntity.TYPE, DUMMY, FACING, BlockStateProperties.WATERLOGGED); setNotNormalBlock(); >>>>>>> super("current_transformer", () -> EnergyMeterTileEntity.TYPE, DUMMY, FACING, BlockStateProperties.WATERLOGGED);
<<<<<<< import com.mojang.blaze3d.matrix.MatrixStack; ======= import com.google.common.base.Preconditions; import com.mojang.blaze3d.systems.RenderSystem; >>>>>>> import com.google.common.base.Preconditions; import com.mojang.blaze3d.matrix.MatrixStack; <<<<<<< import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextProperties; ======= import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; >>>>>>> import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextProperties; <<<<<<< public ManualElementTable(ManualInstance manual, ITextComponent[][] table, boolean horizontalBars) ======= @Deprecated public ManualElementTable(ManualInstance manual, String[][] table, boolean horizontalBars) >>>>>>> @Deprecated public ManualElementTable(ManualInstance manual, ITextComponent[][] table, boolean horizontalBars) <<<<<<< if(table!=null) { bars = new int[1]; for(ITextComponent[] line : table) { if(line.length-1 > bars.length) { int[] newBars = new int[line.length-1]; System.arraycopy(bars, 0, newBars, 0, bars.length); bars = newBars; } for(int j = 0; j < line.length-1; j++) { int fl = manual.fontRenderer().func_238414_a_(line[j]); if(fl > bars[j]) bars[j] = fl; } } textOff = new int[bars.length]; int xx = x; for(int i = 0; i < bars.length; i++) { xx += bars[i]+8; textOff[i] = xx; } int yOff = 0; for(ITextComponent[] line : table) if(line!=null) for(int j = 0; j < line.length; j++) if(line[j]!=null) { int w = Math.max(10, 120-(j > 0?textOff[j-1]-x: 0)); int l = manual.fontRenderer().func_238425_b_(line[j], w).size(); if(j!=0) yOff += l*(manual.fontRenderer().FONT_HEIGHT+1); } height = yOff; } ======= recalculateLayout(); >>>>>>> recalculateLayout(); <<<<<<< List<ITextProperties> lines = manual.fontRenderer().func_238425_b_(line[j], w); for(int i = 0; i < lines.size(); i++) { ITextProperties l = lines.get(i); float yForLine = y+yOff+i*manual.fontRenderer().FONT_HEIGHT; manual.fontRenderer().func_238422_b_(transform, l, xx, yForLine, manual.getTextColour()); } if(lines.size() > height) height = lines.size(); ======= String lineText = line[j].getFormattedText(); manual.fontRenderer().drawSplitString(lineText, xx, y+yOff, w, manual.getTextColour()); int lines = manual.fontRenderer().listFormattedStringToWidth(lineText, w).size(); if(lines > height) height = lines; >>>>>>> String lineText = line[j].getFormattedText(); manual.fontRenderer().drawSplitString(lineText, xx, y+yOff, w, manual.getTextColour()); int lines = manual.fontRenderer().listFormattedStringToWidth(lineText, w).size(); if(lines > height) height = lines;
<<<<<<< EntityActor actor = (EntityActor) player.world.getEntityByID(message.id); ======= EntityLivingBase actor = (EntityLivingBase) player.worldObj.getEntityByID(message.id); RecordPlayer playback = EntityUtils.getRecordPlayer(actor); >>>>>>> EntityLivingBase actor = (EntityLivingBase) player.world.getEntityByID(message.id); RecordPlayer playback = EntityUtils.getRecordPlayer(actor);
<<<<<<< import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader; ======= >>>>>>> import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockReader;
<<<<<<< ITextComponent[] text = ((IBlockOverlayText)containedTile).getOverlayText(player, mop, false); if(text!=null&&text.length > 0) { FontRenderer font = ClientUtils.font(); int i = 0; IRenderTypeBuffer.Impl buffer = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer()); for(ITextComponent s : text) if(s!=null) font.func_238416_a_( s, scaledWidth/2+8, scaledHeight/2+8+(i++)*font.FONT_HEIGHT, 0xffffffff, true, transform.getLast().getMatrix(), buffer, false, 0, 0xf000f0 ); buffer.finish(); } ======= String[] text = ((IBlockOverlayText)containedTile).getOverlayText(player, mop, false); BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight); >>>>>>> ITextComponent[] text = ((IBlockOverlayText)containedTile).getOverlayText(player, mop, false); BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight); <<<<<<< ITextComponent[] text = overlayBlock.getOverlayText(ClientUtils.mc().player, mop, hammer); if(text!=null&&text.length > 0) { FontRenderer font = ClientUtils.font(); int i = 0; IRenderTypeBuffer.Impl buffer = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer()); for(ITextComponent s : text) if(s!=null) font.func_238416_a_( s, scaledWidth/2+8, scaledHeight/2+8+(i++)*font.FONT_HEIGHT, 0xffffffff, true, transform.getLast().getMatrix(), buffer, false, 0, 0xf000f0 ); buffer.finish(); } ======= String[] text = overlayBlock.getOverlayText(ClientUtils.mc().player, mop, hammer); BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight); >>>>>>> ITextComponent[] text = overlayBlock.getOverlayText(ClientUtils.mc().player, mop, hammer); BlockOverlayUtils.drawBlockOverlayText(transform, text, scaledWidth, scaledHeight);
<<<<<<< /** * add an int value in the current field * @param value */ abstract public void addInt(int value); /** * add a long value in the current field * @param value */ ======= abstract public void addInteger(int value); >>>>>>> /** * add an int value in the current field * @param value */ abstract public void addInteger(int value); /** * add a long value in the current field * @param value */
<<<<<<< ColumnChunkMetaData column = new ColumnChunkMetaData(new String[] {"foo"}, PrimitiveTypeName.BINARY, CompressionCodecName.GZIP); column.setFirstDataPageOffset(start); ======= ColumnChunkMetaData column = new ColumnChunkMetaData(new String[] {"foo"}, PrimitiveTypeName.BINARY, CompressionCodecName.GZIP, Arrays.asList(Encoding.PLAIN)); column.setFirstDataPage(start); >>>>>>> ColumnChunkMetaData column = new ColumnChunkMetaData(new String[] {"foo"}, PrimitiveTypeName.BINARY, CompressionCodecName.GZIP, Arrays.asList(Encoding.PLAIN)); column.setFirstDataPageOffset(start);
<<<<<<< import java.io.DataOutput; import java.io.IOException; ======= import java.math.BigInteger; >>>>>>> import java.io.DataOutput; import java.io.IOException; import java.math.BigInteger; <<<<<<< System.out.println(columns); System.out.println("========="); columns.flip(); RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, columns); ======= =="); columns.flip(); RecordReader<Group> recordReader = getRecordReader(columnIO, schema, columns); ======= columns.flush(); log(columns); log("========="); RecordReader<Group> recordReader = getRecordReader(columnIO, schema, memPageStore); >>>>>>> columns.flush(); log(columns); log("========="); RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, memPageStore); <<<<<<< RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, columns); ======= RecordReader<Group> recordReader = getRecordReader(columnIO2, schema2, memPageStore); >>>>>>> RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, memPageStore); <<<<<<< private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) { ======= private void log(Object o) { LOG.info(o); } private RecordReader<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, PageReadStore pageReadStore) { >>>>>>> private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, PageReadStore pageReadStore) { <<<<<<< ======= String[] expected = { "startMessage()", "startField(DocId, 0)", "addLong(10)", "endField(DocId, 0)", "startField(Links, 1)", "startGroup()", "startField(Forward, 1)", "addLong(20)", "addLong(40)", "addLong(60)", "endField(Forward, 1)", "endGroup()", "endField(Links, 1)", "startField(Name, 2)", "startGroup()", "startField(Language, 0)", "startGroup()", "startField(Code, 0)", "addBinary(en-us)", "endField(Code, 0)", "startField(Country, 1)", "addBinary(us)", "endField(Country, 1)", "endGroup()", "startGroup()", "startField(Code, 0)", "addBinary(en)", "endField(Code, 0)", "endGroup()", "endField(Language, 0)", "startField(Url, 1)", "addBinary(http://A)", "endField(Url, 1)", "endGroup()", "startGroup()", "startField(Url, 1)", "addBinary(http://B)", "endField(Url, 1)", "endGroup()", "startGroup()", "startField(Language, 0)", "startGroup()", "startField(Code, 0)", "addBinary(en-gb)", "endField(Code, 0)", "startField(Country, 1)", "addBinary(gb)", "endField(Country, 1)", "endGroup()", "endField(Language, 0)", "endGroup()", "endField(Name, 2)", "endMessage()" }; >>>>>>>
<<<<<<< System.out.println(message + (compiled ? " compiled" : "")); RecordMaterializer<Object> recordConsumer = new RecordMaterializer<Object>() { Object a; public void startMessage() { a = "startmessage";} public void startGroup() { a = "startgroup";} public void startField(String field, int index) { a = field;} public void endMessage() { a = "endmessage";} public void endGroup() { a = "endgroup";} public void endField(String field, int index) { a = field;} public void addString(String value) { a = value;} public void addInteger(int value) { a = "int";} public void addLong(long value) { a = "long";} public void addFloat(float value) { a = "float";} public void addDouble(double value) { a = "double";} public void addBoolean(boolean value) { a = "boolean";} public void addBinary(byte[] value) { a = value;} public Object getCurrentRecord() { return a; } ======= System.out.println(message); RecordMaterializer<Void> recordConsumer = new RecordMaterializer<Void>() { public void startMessage() {} public void startGroup() {} public void startField(String field, int index) {} public void endMessage() {} public void endGroup() {} public void endField(String field, int index) {} public void addInteger(int value) {} public void addLong(long value) {} public void addFloat(float value) {} public void addDouble(double value) {} public void addBoolean(boolean value) {} public void addBinary(byte[] value) {} public Void getCurrentRecord() { return null; } >>>>>>> System.out.println(message + (compiled ? " compiled" : "")); RecordMaterializer<Object> recordConsumer = new RecordMaterializer<Object>() { Object a; public void startMessage() { a = "startmessage";} public void startGroup() { a = "startgroup";} public void startField(String field, int index) { a = field;} public void endMessage() { a = "endmessage";} public void endGroup() { a = "endgroup";} public void endField(String field, int index) { a = field;} public void addInteger(int value) { a = "int";} public void addLong(long value) { a = "long";} public void addFloat(float value) { a = "float";} public void addDouble(double value) { a = "double";} public void addBoolean(boolean value) { a = "boolean";} public void addBinary(byte[] value) { a = value;} public Object getCurrentRecord() { return a; } <<<<<<< RecordReader<Object> recordReader = columnIO.getRecordReader(columns, recordConsumer); if (compiled) { recordReader = new RecordReaderCompiler().compile((RecordReaderImplementation<Object>)recordReader); } ======= RecordReader<Void> recordReader = columnIO.getRecordReader(memPageStore, recordConsumer); >>>>>>> RecordReader<Object> recordReader = columnIO.getRecordReader(memPageStore, recordConsumer); if (compiled) { recordReader = new RecordReaderCompiler().compile((RecordReaderImplementation<Object>)recordReader); }
<<<<<<< public boolean getBoolean() { ======= public long getLong() { throw new UnsupportedOperationException(); } @Override public boolean getBool() { >>>>>>> public boolean getBoolean() { throw new UnsupportedOperationException(); } public long getLong() {
<<<<<<< RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, columns); ======= RecordReader<Group> recordReader = getRecordReader(columnIO, schema, columns); >>>>>>> RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, columns); <<<<<<< RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, columns); ======= RecordReader<Group> recordReader = getRecordReader(columnIO2, schema2, columns); >>>>>>> RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, columns); <<<<<<< private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) { RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); return (RecordReaderImplementation<Group>)columnIO.getRecordReader(columns, recordConsumer); } private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReaderImplementation<?> recordReader) { ======= private RecordReader<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) { RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); return columnIO.getRecordReader(columns, recordConsumer); } private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReader<?> recordReader) { >>>>>>> private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) { RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); return (RecordReaderImplementation<Group>)columnIO.getRecordReader(columns, recordConsumer); } private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReaderImplementation<?> recordReader) { <<<<<<< ======= String[] expected = { "startMessage()", "startField(DocId, 0)", "addLong(10)", "endField(DocId, 0)", "startField(Links, 1)", "startGroup()", "startField(Forward, 1)", "addLong(20)", "addLong(40)", "addLong(60)", "endField(Forward, 1)", "endGroup()", "endField(Links, 1)", "startField(Name, 2)", "startGroup()", "startField(Language, 0)", "startGroup()", "startField(Code, 0)", "addString(en-us)", "endField(Code, 0)", "startField(Country, 1)", "addString(us)", "endField(Country, 1)", "endGroup()", "startGroup()", "startField(Code, 0)", "addString(en)", "endField(Code, 0)", "endGroup()", "endField(Language, 0)", "startField(Url, 1)", "addString(http://A)", "endField(Url, 1)", "endGroup()", "startGroup()", "startField(Url, 1)", "addString(http://B)", "endField(Url, 1)", "endGroup()", "startGroup()", "startField(Language, 0)", "startGroup()", "startField(Code, 0)", "addString(en-gb)", "endField(Code, 0)", "startField(Country, 1)", "addString(gb)", "endField(Country, 1)", "endGroup()", "endField(Language, 0)", "endGroup()", "endField(Name, 2)", "endMessage()" }; >>>>>>> <<<<<<< GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema); ======= GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema); >>>>>>> GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema)); GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema);
<<<<<<< MessageColumnIO columnIO = columnIOFactory.getColumnIO(requestedSchema); recordReader = columnIO.getRecordReader(columnsStore, readSupport.newRecordConsumer()); ======= long timeSpentReading = System.currentTimeMillis() - t0; totalTimeSpentReadingBytes += timeSpentReading; LOG.info("block read in memory in " + timeSpentReading + " ms"); MessageColumnIO columnIO = columnIOFactory.getColumnIO(requestedSchema, columnsStore); recordReader = columnIO.getRecordReader(); recordConsumer = readSupport.newRecordConsumer(destination); startedReadingCurrentBlockAt = System.currentTimeMillis(); currentBlockRecordCount = columnsData.getRecordCount(); >>>>>>> long timeSpentReading = System.currentTimeMillis() - t0; totalTimeSpentReadingBytes += timeSpentReading; LOG.info("block read in memory in " + timeSpentReading + " ms"); MessageColumnIO columnIO = columnIOFactory.getColumnIO(requestedSchema); recordReader = columnIO.getRecordReader(columnsStore, readSupport.newRecordConsumer()); startedReadingCurrentBlockAt = System.currentTimeMillis(); currentBlockRecordCount = columnsData.getRecordCount();
<<<<<<< import net.patchworkmc.patcher.annotation.AnnotationStorage; import net.patchworkmc.patcher.capabilityinject.CapabilityInjectRewriter; import net.patchworkmc.patcher.capabilityinject.initialization.RegisterCapabilityInjects; ======= >>>>>>> import net.patchworkmc.patcher.annotation.AnnotationStorage; import net.patchworkmc.patcher.capabilityinject.CapabilityInjectRewriter; import net.patchworkmc.patcher.capabilityinject.initialization.RegisterCapabilityInjects; <<<<<<< */ public PatchworkTransformer(BiConsumer<String, byte[]> outputConsumer, PatchworkRemapper remapper, AnnotationStorage annotationStorage) { ======= **/ public PatchworkTransformer(OutputConsumerPath outputConsumer, PatchworkRemapper remapper, ForgeModJar modJar) { >>>>>>> **/ public PatchworkTransformer(OutputConsumerPath outputConsumer, PatchworkRemapper remapper, ForgeModJar modJar) {
<<<<<<< EventHandlerScanner eventHandlerScanner = new EventHandlerScanner(objectHolderScanner, System.out::println, subscribeEvent -> { System.out.println(subscribeEvent); subscribeEvents.add(subscribeEvent); } ); ======= EventHandlerScanner eventHandlerScanner = new EventHandlerScanner( objectHolderScanner, System.out::println, System.out::println); >>>>>>> EventHandlerScanner eventHandlerScanner = new EventHandlerScanner(objectHolderScanner, System.out::println, subscribeEvent -> { System.out.println(subscribeEvent); subscribeEvents.add(subscribeEvent); } ); <<<<<<< generatedObjectHolderEntries.add(new AbstractMap.SimpleImmutableEntry<>(shimName, entry)); ======= // System.out.println(generated + " " + generated.getShimName()); generatedObjectHolderEntries.add( new AbstractMap.SimpleImmutableEntry<>(shimName, entry)); >>>>>>> generatedObjectHolderEntries.add( new AbstractMap.SimpleImmutableEntry<>(shimName, entry));
<<<<<<< import com.google.common.primitives.UnsignedLongs; ======= import com.google.common.base.Objects; >>>>>>> import com.google.common.primitives.UnsignedLongs; import com.google.common.base.Objects;
<<<<<<< ======= @Override public void onDeleteNotification(int id) { } >>>>>>> @Override public void onDeleteNotification(int id) { }
<<<<<<< import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.Appender; ======= import nodomain.freeyourgadget.gadgetbridge.database.ActivityDatabaseHandler; >>>>>>> <<<<<<< private static DBHandler lockHandler; ======= /** * Note: is null on Lollipop and Kitkat */ >>>>>>> private static DBHandler lockHandler; /** * Note: is null on Lollipop and Kitkat */ <<<<<<< public static void setupLogging(boolean enable) { try { if (fileLogger == null) { File dir = FileUtils.getExternalFilesDir(); // used by assets/logback.xml since the location cannot be statically determined System.setProperty("GB_LOGFILES_DIR", dir.getAbsolutePath()); rememberFileLogger(); } if (enable) { startFileLogger(); } else { stopFileLogger(); } getLogger().info("Gadgetbridge version: " + BuildConfig.VERSION_NAME); } catch (IOException ex) { Log.e("GBApplication", "External files dir not available, cannot log to file", ex); stopFileLogger(); } } private static void startFileLogger() { if (fileLogger != null && !fileLogger.isStarted()) { addFileLogger(fileLogger); fileLogger.start(); } } private static void stopFileLogger() { if (fileLogger != null && fileLogger.isStarted()) { fileLogger.stop(); removeFileLogger(fileLogger); } } private static void rememberFileLogger() { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); fileLogger = root.getAppender("FILE"); } private static void addFileLogger(Appender<ILoggingEvent> fileLogger) { try { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); if (!root.isAttached(fileLogger)) { root.addAppender(fileLogger); } } catch (Throwable ex) { Log.e("GBApplication", "Error adding logger FILE appender", ex); } } private static void removeFileLogger(Appender<ILoggingEvent> fileLogger) { try { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); if (root.isAttached(fileLogger)) { root.detachAppender(fileLogger); } } catch (Throwable ex) { Log.e("GBApplication", "Error removing logger FILE appender", ex); } } private static Logger getLogger() { return LoggerFactory.getLogger(GBApplication.class); } static void setupDatabase(Context context) { // DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "test-db", null); DBOpenHelper helper = new DBOpenHelper(context, "test-db", null); SQLiteDatabase db = helper.getWritableDatabase(); DaoMaster daoMaster = new DaoMaster(db); lockHandler = new LockHandler(daoMaster, helper); } ======= >>>>>>> static void setupDatabase(Context context) { // DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "test-db", null); DBOpenHelper helper = new DBOpenHelper(context, "test-db", null); SQLiteDatabase db = helper.getWritableDatabase(); DaoMaster daoMaster = new DaoMaster(db); lockHandler = new LockHandler(daoMaster, helper); }
<<<<<<< ======= import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; >>>>>>> import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.content.FileProvider; import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; import java.io.File; import java.io.IOException; <<<<<<< public static void viewFile(String path, String action, Context context) throws IOException { Intent intent = new Intent(action); File file = new File(path); Uri contentUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".screenshot_provider", file); intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setData(contentUri); context.startActivity(intent); ======= /** * As seen on stackoverflow https://stackoverflow.com/a/36714242/1207186 * Try to find the file path of a document uri * @param context the application context * @param uri the Uri for which the path should be resolved * @return the path corresponding to the Uri as a String * @throws IllegalArgumentException on any problem decoding the uri to a path */ public static @NonNull String getFilePath(@NonNull Context context, @NonNull Uri uri) throws IllegalArgumentException { try { String path = internalGetFilePath(context, uri); if (TextUtils.isEmpty(path)) { throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri); } return path; } catch (IllegalArgumentException ex) { throw ex; } catch (Exception ex) { throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri, ex); } } /** * As seen on stackoverflow https://stackoverflow.com/a/36714242/1207186 * Try to find the file path of a document uri * @param context the application context * @param uri the Uri for which the path should be resolved * @return the path corresponding to the Uri as a String * @throws URISyntaxException */ private static @Nullable String internalGetFilePath(@NonNull Context context, @NonNull Uri uri) throws URISyntaxException { String selection = null; String[] selectionArgs = null; // Uri is different in versions after KITKAT (Android 4.4), we need to if (Build.VERSION.SDK_INT >= 19 && DocumentsContract.isDocumentUri(context.getApplicationContext(), uri)) { if ("com.android.externalstorage.documents".equals(uri.getAuthority())) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); return Environment.getExternalStorageDirectory() + "/" + split[1]; } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) { final String id = DocumentsContract.getDocumentId(uri); if (!TextUtils.isEmpty(id)) { if (id.startsWith("raw:")) { return id.replaceFirst("raw:", ""); } uri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); } } else if ("com.android.providers.media.documents".equals(uri.getAuthority())) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); final String type = split[0]; if ("image".equals(type)) { uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; } else if ("video".equals(type)) { uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; } else if ("audio".equals(type)) { uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; } selection = "_id=?"; selectionArgs = new String[]{ split[1] }; } } if ("content".equalsIgnoreCase(uri.getScheme())) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = null; cursor = context.getContentResolver() .query(uri, projection, selection, selectionArgs, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); if (cursor.moveToFirst()) { return cursor.getString(column_index); } } else if ("file".equalsIgnoreCase(uri.getScheme())) { return uri.getPath(); } <<<<<<< /mnt/batch/tasks/workitems/adfv2-General_1/job-1/81c27353-e057-4d50-a9ed-03eb35bcb163/wd/.temp/athenacommon/85d0fdbe-05f7-459f-8efe-60b624b4debc.java return null; >>>>>>> master ======= throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri); >>>>>>> /** * As seen on stackoverflow https://stackoverflow.com/a/36714242/1207186 * Try to find the file path of a document uri * @param context the application context * @param uri the Uri for which the path should be resolved * @return the path corresponding to the Uri as a String * @throws IllegalArgumentException on any problem decoding the uri to a path */ public static @NonNull String getFilePath(@NonNull Context context, @NonNull Uri uri) throws IllegalArgumentException { try { String path = internalGetFilePath(context, uri); if (TextUtils.isEmpty(path)) { throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri); } return path; } catch (IllegalArgumentException ex) { throw ex; } catch (Exception ex) { throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri, ex); } } /** * As seen on stackoverflow https://stackoverflow.com/a/36714242/1207186 * Try to find the file path of a document uri * @param context the application context * @param uri the Uri for which the path should be resolved * @return the path corresponding to the Uri as a String * @throws URISyntaxException */ private static @Nullable String internalGetFilePath(@NonNull Context context, @NonNull Uri uri) throws URISyntaxException { String selection = null; String[] selectionArgs = null; // Uri is different in versions after KITKAT (Android 4.4), we need to if (Build.VERSION.SDK_INT >= 19 && DocumentsContract.isDocumentUri(context.getApplicationContext(), uri)) { if ("com.android.externalstorage.documents".equals(uri.getAuthority())) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); return Environment.getExternalStorageDirectory() + "/" + split[1]; } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) { final String id = DocumentsContract.getDocumentId(uri); if (!TextUtils.isEmpty(id)) { if (id.startsWith("raw:")) { return id.replaceFirst("raw:", ""); } uri = ContentUris.withAppendedId( Uri.parse("content://downloads/public_downloads"), Long.valueOf(id)); } } else if ("com.android.providers.media.documents".equals(uri.getAuthority())) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = docId.split(":"); final String type = split[0]; if ("image".equals(type)) { uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; } else if ("video".equals(type)) { uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; } else if ("audio".equals(type)) { uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; } selection = "_id=?"; selectionArgs = new String[]{ split[1] }; } } if ("content".equalsIgnoreCase(uri.getScheme())) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = null; cursor = context.getContentResolver() .query(uri, projection, selection, selectionArgs, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); if (cursor.moveToFirst()) { return cursor.getString(column_index); } } else if ("file".equalsIgnoreCase(uri.getScheme())) { return uri.getPath(); } throw new IllegalArgumentException("Unable to decode the given uri to a file path: " + uri); } public static void viewFile(String path, String action, Context context) throws IOException { Intent intent = new Intent(action); File file = new File(path); Uri contentUri = FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName() + ".screenshot_provider", file); intent.setFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION); intent.setData(contentUri); context.startActivity(intent);
<<<<<<< import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator; ======= import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator; >>>>>>> import nodomain.freeyourgadget.gadgetbridge.devices.xwatch.XWatchCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.zetime.ZeTimeCoordinator; <<<<<<< result.add(new ZeTimeCoordinator()); ======= result.add(new XWatchCoordinator()); >>>>>>> result.add(new XWatchCoordinator()); result.add(new ZeTimeCoordinator());
<<<<<<< /* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele Gobbetti, Matthieu Baerts ======= /* Copyright (C) 2019 Andreas Shimokawa, Matthieu Baerts, Taavi Eomäe >>>>>>> /* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele Gobbetti, Matthieu Baerts, Taavi Eomäe
<<<<<<< import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes; import nodomain.freeyourgadget.gadgetbridge.model.Weather; import ru.gelin.android.weather.notification.ParcelableWeather2; ======= >>>>>>> import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventSendBytes; import nodomain.freeyourgadget.gadgetbridge.model.Weather; import ru.gelin.android.weather.notification.ParcelableWeather2; <<<<<<< byte[] weatherMessage=encodeTimeStylePebbleWeather(); ByteBuffer buf = ByteBuffer.allocate(ackMessage.length + testMessage.length + weatherMessage.length); ======= //byte[] weatherMessage=encodeTimeStylePebbleWeather(); ByteBuffer buf = ByteBuffer.allocate(ackMessage.length + testMessage.length); >>>>>>> byte[] weatherMessage=encodeTimeStylePebbleWeather(); ByteBuffer buf = ByteBuffer.allocate(ackMessage.length + testMessage.length + weatherMessage.length);
<<<<<<< public static final String PREF_HYBRID_HR_SAVE_RAW_ACTIVITY_FILES = "save_raw_activity_files"; ======= public static final String PREF_LIFTWRIST_NOSHED = "activate_display_on_lift_wrist_noshed"; public static final String PREF_DISCONNECTNOTIF_NOSHED = "disconnect_notification_noshed"; public static final String PREF_POWER_MODE = "power_mode"; public static final String PREF_BUTTON_BP_CALIBRATE = "prefs_sensors_button_bp_calibration"; public static final String PREF_ALTITUDE_CALIBRATE = "pref_sensors_altitude"; public static final String PREF_LONGSIT_PERIOD = "pref_longsit_period"; public static final String PREF_LONGSIT_SWITCH = "pref_longsit_switch"; public static final String PREF_DO_NOT_DISTURB_NOAUTO = "do_not_disturb_no_auto"; >>>>>>> public static final String PREF_HYBRID_HR_SAVE_RAW_ACTIVITY_FILES = "save_raw_activity_files"; public static final String PREF_LIFTWRIST_NOSHED = "activate_display_on_lift_wrist_noshed"; public static final String PREF_DISCONNECTNOTIF_NOSHED = "disconnect_notification_noshed"; public static final String PREF_POWER_MODE = "power_mode"; public static final String PREF_BUTTON_BP_CALIBRATE = "prefs_sensors_button_bp_calibration"; public static final String PREF_ALTITUDE_CALIBRATE = "pref_sensors_altitude"; public static final String PREF_LONGSIT_PERIOD = "pref_longsit_period"; public static final String PREF_LONGSIT_SWITCH = "pref_longsit_switch"; public static final String PREF_DO_NOT_DISTURB_NOAUTO = "do_not_disturb_no_auto";
<<<<<<< import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.User; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; ======= import nodomain.freeyourgadget.gadgetbridge.util.Prefs; >>>>>>> import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.User; import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
<<<<<<< import nodomain.freeyourgadget.gadgetbridge.service.devices.zetime.ZeTimeDeviceSupport; ======= import nodomain.freeyourgadget.gadgetbridge.service.devices.xwatch.XWatchSupport; >>>>>>> import nodomain.freeyourgadget.gadgetbridge.service.devices.xwatch.XWatchSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.zetime.ZeTimeDeviceSupport; <<<<<<< case ZETIME: deviceSupport = new ServiceDeviceSupport(new ZeTimeDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); break; ======= case XWATCH: deviceSupport = new ServiceDeviceSupport(new XWatchSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); >>>>>>> case XWATCH: deviceSupport = new ServiceDeviceSupport(new XWatchSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); case ZETIME: deviceSupport = new ServiceDeviceSupport(new ZeTimeDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); break;
<<<<<<< } else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) { handleRealtimeSteps(characteristic.getValue()); ======= } else { LOG.info("Unhandled characteristic read: "+ characteristicUUID); logMessageContent(characteristic.getValue()); >>>>>>> } else if (MiBandService.UUID_CHARACTERISTIC_REALTIME_STEPS.equals(characteristicUUID)) { handleRealtimeSteps(characteristic.getValue()); } else { LOG.info("Unhandled characteristic read: "+ characteristicUUID); logMessageContent(characteristic.getValue());
<<<<<<< private final BroadcastReceiver mPebbleKitReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); LOG.info("Got action: " + action); UUID uuid; switch (action) { case PEBBLEKIT_ACTION_APP_START: case PEBBLEKIT_ACTION_APP_STOP: uuid = (UUID) intent.getSerializableExtra("uuid"); if (uuid != null) { write(mPebbleProtocol.encodeAppStart(uuid, action.equals(PEBBLEKIT_ACTION_APP_START))); } break; case PEBBLEKIT_ACTION_APP_SEND: int transaction_id = intent.getIntExtra("transaction_id", -1); uuid = (UUID) intent.getSerializableExtra("uuid"); String jsonString = intent.getStringExtra("msg_data"); LOG.info("json string: " + jsonString); try { JSONArray jsonArray = new JSONArray(jsonString); write(mPebbleProtocol.encodeApplicationMessageFromJSON(uuid, jsonArray)); sendAppMessageAck(transaction_id); } catch (JSONException e) { e.printStackTrace(); } break; case PEBBLEKIT_ACTION_APP_ACK: // we do not get a uuid and cannot map a transaction id to it, so we ack in PebbleProtocol early /* uuid = (UUID) intent.getSerializableExtra("uuid"); int transaction_id = intent.getIntExtra("transaction_id", -1); if (transaction_id >= 0 && transaction_id <= 255) { write(mPebbleProtocol.encodeApplicationMessageAck(uuid, (byte) transaction_id)); } else { LOG.warn("illegal transacktion id " + transaction_id); } */ break; } } }; private void sendAppMessageJS(GBDeviceEventAppMessage appMessage) { WebViewSingleton.getorInitWebView(getContext(), gbDevice, appMessage.appUUID); WebViewSingleton.appMessage(appMessage.message); } private void sendAppMessageIntent(GBDeviceEventAppMessage appMessage) { Intent intent = new Intent(); intent.setAction(PEBBLEKIT_ACTION_APP_RECEIVE); intent.putExtra("uuid", appMessage.appUUID); intent.putExtra("msg_data", appMessage.message); intent.putExtra("transaction_id", appMessage.id); LOG.info("broadcasting to uuid " + appMessage.appUUID + " transaction id: " + appMessage.id + " JSON: " + appMessage.message); getContext().sendBroadcast(intent); } ======= >>>>>>> private void sendAppMessageJS(GBDeviceEventAppMessage appMessage) { WebViewSingleton.getorInitWebView(getContext(), gbDevice, appMessage.appUUID); WebViewSingleton.appMessage(appMessage.message); }
<<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } /* endswitch */ ======= SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } >>>>>>> SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } <<<<<<< throw SQLError.createSQLException(Messages.getString("ResultSet.Invalid_value_for_getLong()_-____211") + val //$NON-NLS-1$ + Messages.getString("ResultSet.___in_column__212") + (columnIndexZeroBased + 1), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException( Messages.getString("ResultSet.Invalid_value_for_getLong()_-____211") + val + Messages.getString("ResultSet.___in_column__212") + (columnIndexZeroBased + 1), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException( Messages.getString("ResultSet.Invalid_value_for_getLong()_-____211") + val + Messages.getString("ResultSet.___in_column__212") + (columnIndexZeroBased + 1), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException <<<<<<< * @throws SQLFeatureNotSupportedException * DOCUMENT ME! ======= * @throws NotImplemented >>>>>>> * @throws SQLFeatureNotSupportedException
<<<<<<< if (useSessionStatus && !this.isClosed && !getUseLocalSessionState()) { ======= if (useSessionStatus && !this.isClosed && versionMeetsMinimum(5, 6, 5) && !getUseLocalSessionState() && getReadOnlyPropagatesToServer()) { >>>>>>> if (useSessionStatus && !this.isClosed && !getUseLocalSessionState() && getReadOnlyPropagatesToServer()) { <<<<<<< if (!getUseLocalSessionState() || (readOnlyFlag != this.readOnly)) { execSQL(null, "set session transaction " + (readOnlyFlag ? "read only" : "read write"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); ======= if (getReadOnlyPropagatesToServer() && versionMeetsMinimum(5, 6, 5)) { if (!getUseLocalSessionState() || (readOnlyFlag != this.readOnly)) { execSQL(null, "set session transaction " + (readOnlyFlag ? "read only" : "read write"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); } >>>>>>> if (getReadOnlyPropagatesToServer()) { if (!getUseLocalSessionState() || (readOnlyFlag != this.readOnly)) { execSQL(null, "set session transaction " + (readOnlyFlag ? "read only" : "read write"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); }
<<<<<<< @Override public String getProcessHost() throws Exception { return getActiveMySQLConnection().getProcessHost(); } ======= public boolean getReadOnlyPropagatesToServer() { return getActiveMySQLConnection().getReadOnlyPropagatesToServer(); } public void setReadOnlyPropagatesToServer(boolean flag) { getActiveMySQLConnection().setReadOnlyPropagatesToServer(flag); } >>>>>>> @Override public String getProcessHost() throws Exception { return getActiveMySQLConnection().getProcessHost(); } public boolean getReadOnlyPropagatesToServer() { return getActiveMySQLConnection().getReadOnlyPropagatesToServer(); } public void setReadOnlyPropagatesToServer(boolean flag) { getActiveMySQLConnection().setReadOnlyPropagatesToServer(flag); }
<<<<<<< fields[0] = new Field("", "GENERATED_KEY", Types.BIGINT, 20); fields[0].setUnsigned(); ======= fields[0] = new Field("", "GENERATED_KEY", MysqlType.BIGINT_UNSIGNED, 17); >>>>>>> fields[0] = new Field("", "GENERATED_KEY", MysqlType.BIGINT_UNSIGNED, 20); <<<<<<< fields[0] = new Field("", "GENERATED_KEY", Types.BIGINT, 20); fields[0].setUnsigned(); ======= fields[0] = new Field("", "GENERATED_KEY", MysqlType.BIGINT_UNSIGNED, 17); >>>>>>> fields[0] = new Field("", "GENERATED_KEY", MysqlType.BIGINT_UNSIGNED, 20); <<<<<<< setLargeMaxRows(max); ======= synchronized (checkClosed().getConnectionMutex()) { if ((max > MAX_ROWS) || (max < 0)) { throw SQLError.createSQLException(Messages.getString("Statement.15") + max + " > " + MAX_ROWS + ".", SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); } if (max == 0) { max = -1; } this.maxRows = max; } >>>>>>> setLargeMaxRows(max);
<<<<<<< import com.mysql.jdbc.exceptions.SQLError; ======= import com.mysql.jdbc.interceptors.ServerStatusDiffInterceptor; >>>>>>> import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.interceptors.ServerStatusDiffInterceptor;
<<<<<<< /** * DOCUMENT ME! * * @author Mark Matthews * @version $Id: StatementsTest.java 4494 2005-10-31 22:30:34 -0600 (Mon, 31 Oct * 2005) mmatthews $ */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws Exception * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws Exception * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< /** * DOCUMENT ME! * * @throws SQLException * DOCUMENT ME! */ ======= >>>>>>> <<<<<<< } catch (SQLFeatureNotSupportedException notImplEx) { ; ======= } catch (NotImplemented notImplEx) { >>>>>>> } catch (SQLFeatureNotSupportedException notImplEx) {
<<<<<<< import com.mysql.jdbc.exceptions.MysqlDataTruncation; import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.ha.LoadBalanceExceptionChecker; import com.mysql.jdbc.ha.RandomBalanceStrategy; import com.mysql.jdbc.ha.SequentialBalanceStrategy; ======= import com.mysql.jdbc.SQLError; import com.mysql.jdbc.StandardSocketFactory; import com.mysql.jdbc.StringUtils; import com.mysql.jdbc.TimeUtil; import com.mysql.jdbc.Util; import com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException; >>>>>>> import com.mysql.jdbc.exceptions.MysqlDataTruncation; import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.ha.LoadBalanceExceptionChecker; import com.mysql.jdbc.ha.RandomBalanceStrategy; import com.mysql.jdbc.ha.SequentialBalanceStrategy; <<<<<<< ((com.mysql.jdbc.JdbcConnection) failoverConnection).clearHasTriedMaster(); ======= >>>>>>> <<<<<<< assertTrue(((com.mysql.jdbc.JdbcConnection) failoverConnection).hasTriedMaster()); assertTrue(!newConnectionId.equals(originalConnectionId)); ======= assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); assertFalse(newConnectionId.equals(originalConnectionId)); >>>>>>> assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); assertFalse(newConnectionId.equals(originalConnectionId)); <<<<<<< ((com.mysql.jdbc.JdbcConnection) failoverConnection).setFailedOver(true); ======= ((com.mysql.jdbc.Connection) failoverConnection).setFailedOver(true); >>>>>>> ((com.mysql.jdbc.JdbcConnection) failoverConnection).setFailedOver(true); <<<<<<< ((com.mysql.jdbc.JdbcConnection) failoverConnection).setFailedOver(true); ======= ((com.mysql.jdbc.Connection) failoverConnection).setFailedOver(true); >>>>>>> ((com.mysql.jdbc.JdbcConnection) failoverConnection).setFailedOver(true); <<<<<<< //((com.mysql.jdbc.JdbcConnection) failoverConn).setPreferSlaveDuringFailover(false); ======= >>>>>>> <<<<<<< String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((JdbcConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e, false); ======= String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((MySQLConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e); >>>>>>> String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((JdbcConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e); <<<<<<< String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((JdbcConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e, false); ======= String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((MySQLConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e); >>>>>>> String msg = SQLError.createLinkFailureMessageBasedOnHeuristics((JdbcConnection) this.conn, System.currentTimeMillis() - 1000, System.currentTimeMillis() - 2000, e); <<<<<<< assertTrue(((com.mysql.jdbc.JdbcConnection) failoverConnection).isMasterConnection()); ======= assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); >>>>>>> assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); <<<<<<< assertTrue(!((com.mysql.jdbc.JdbcConnection) failoverConnection).isMasterConnection()); ======= assertEquals("/slave", UnreliableSocketFactory.getHostFromLastConnection()); >>>>>>> assertEquals("/slave", UnreliableSocketFactory.getHostFromLastConnection()); <<<<<<< assertTrue(((com.mysql.jdbc.JdbcConnection) failoverConnection).isMasterConnection()); ======= assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); >>>>>>> assertEquals("/master", UnreliableSocketFactory.getHostFromLastConnection()); <<<<<<< if (testSt != null) { testSt.close(); ======= try { String trustStorePath = "src/testsuite/ssl-test-certs/test-cert-store"; System.setProperty("javax.net.ssl.keyStore", trustStorePath); System.setProperty("javax.net.ssl.keyStorePassword", "password"); System.setProperty("javax.net.ssl.trustStore", trustStorePath); System.setProperty("javax.net.ssl.trustStorePassword", "password"); props.setProperty("useSSL", "true"); if (Util.getJVMVersion() < 8 && versionMeetsMinimum(5, 7, 6) && isCommunityEdition()) { props.setProperty("enabledSSLCipherSuites", SSL_CIPHERS_FOR_576); } testConn = getConnectionWithProps(props); assertTrue("SSL connection isn't actually established!", ((MySQLConnection) testConn).getIO().isSSLEstablished()); testSt = testConn.createStatement(); testRs = testSt.executeQuery("select USER(),CURRENT_USER()"); testRs.next(); assertEquals("wl5735user", testRs.getString(1).split("@")[0]); assertEquals("wl5735user", testRs.getString(2).split("@")[0]); } finally { if (testRs != null) { testRs.close(); } if (testSt != null) { testSt.close(); } if (testConn != null) { testConn.close(); } >>>>>>> if (testSt != null) { testSt.close(); <<<<<<< if (!pluginIsActive(this.stmt, "sha256_password")) { fail("sha256_password required to run this test"); } if (allowsRsa(this.stmt)) { fail("RSA encryption must be disabled on " + System.getProperty("com.mysql.jdbc.testsuite.url") + " to run this test"); } ======= if (versionMeetsMinimum(5, 6, 5)) { if (!pluginIsActive(this.stmt, "sha256_password")) { fail("sha256_password required to run this test"); } if (allowsRsa(this.stmt)) { fail("RSA encryption must be disabled on " + System.getProperty("com.mysql.jdbc.testsuite.url") + " to run this test"); } try { this.stmt.executeUpdate("SET @current_old_passwords = @@global.old_passwords"); this.stmt.executeUpdate("grant all on *.* to 'wl5602user'@'%' identified WITH sha256_password"); this.stmt.executeUpdate("grant all on *.* to 'wl5602nopassword'@'%' identified WITH sha256_password"); this.stmt.executeUpdate("SET GLOBAL old_passwords= 2"); this.stmt.executeUpdate("SET SESSION old_passwords= 2"); this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'wl5602user'@'%' IDENTIFIED BY 'pwd'" : "set password for 'wl5602user'@'%' = PASSWORD('pwd')"); this.stmt.executeUpdate("flush privileges"); final Properties propsNoRetrieval = new Properties(); propsNoRetrieval.setProperty("user", "wl5602user"); propsNoRetrieval.setProperty("password", "pwd"); final Properties propsNoRetrievalNoPassword = new Properties(); propsNoRetrievalNoPassword.setProperty("user", "wl5602nopassword"); propsNoRetrievalNoPassword.setProperty("password", ""); final Properties propsAllowRetrieval = new Properties(); propsAllowRetrieval.setProperty("user", "wl5602user"); propsAllowRetrieval.setProperty("password", "pwd"); propsAllowRetrieval.setProperty("allowPublicKeyRetrieval", "true"); final Properties propsAllowRetrievalNoPassword = new Properties(); propsAllowRetrievalNoPassword.setProperty("user", "wl5602nopassword"); propsAllowRetrievalNoPassword.setProperty("password", ""); propsAllowRetrievalNoPassword.setProperty("allowPublicKeyRetrieval", "true"); >>>>>>> if (!pluginIsActive(this.stmt, "sha256_password")) { fail("sha256_password required to run this test"); } if (allowsRsa(this.stmt)) { fail("RSA encryption must be disabled on " + System.getProperty("com.mysql.jdbc.testsuite.url") + " to run this test"); } <<<<<<< assertCurrentUser(null, propsNoRetrievalNoPassword, "wl5602nopassword", false); assertCurrentUser(null, propsAllowRetrievalNoPassword, "wl5602nopassword", false); ======= // 3. over SSL propsNoRetrieval.setProperty("useSSL", "true"); propsNoRetrievalNoPassword.setProperty("useSSL", "true"); propsAllowRetrieval.setProperty("useSSL", "true"); propsAllowRetrievalNoPassword.setProperty("useSSL", "true"); if (Util.getJVMVersion() < 8 && versionMeetsMinimum(5, 7, 6) && isCommunityEdition()) { propsNoRetrieval.setProperty("enabledSSLCipherSuites", SSL_CIPHERS_FOR_576); propsNoRetrievalNoPassword.setProperty("enabledSSLCipherSuites", SSL_CIPHERS_FOR_576); propsAllowRetrieval.setProperty("enabledSSLCipherSuites", SSL_CIPHERS_FOR_576); propsAllowRetrievalNoPassword.setProperty("enabledSSLCipherSuites", SSL_CIPHERS_FOR_576); } >>>>>>> assertCurrentUser(null, propsNoRetrievalNoPassword, "wl5602nopassword", false); assertCurrentUser(null, propsAllowRetrievalNoPassword, "wl5602nopassword", false); <<<<<<< this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change1'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change2'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate("ALTER USER 'must_change1'@'%' PASSWORD EXPIRE, 'must_change2'@'%' PASSWORD EXPIRE"); ======= this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change1'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change2'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'must_change1'@'%', 'must_change2'@'%' PASSWORD EXPIRE" : "ALTER USER 'must_change1'@'%' PASSWORD EXPIRE, 'must_change2'@'%' PASSWORD EXPIRE"); >>>>>>> this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change1'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate("grant all on `" + dbname + "`.* to 'must_change2'@'%' IDENTIFIED BY 'aha'"); this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'must_change1'@'%', 'must_change2'@'%' PASSWORD EXPIRE" : "ALTER USER 'must_change1'@'%' PASSWORD EXPIRE, 'must_change2'@'%' PASSWORD EXPIRE"); <<<<<<< ======= testSt = testConn.createStatement(); } testSt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER USER() IDENTIFIED BY 'newpwd'" : "SET PASSWORD = PASSWORD('newpwd')"); testConn.close(); >>>>>>> <<<<<<< } catch (SQLException e5) { if (e5.getErrorCode() == MysqlErrorNumbers.ER_MUST_CHANGE_PASSWORD_LOGIN) { ======= try { ((MySQLConnection) testConn).changeUser("must_change2", "aha"); testSt = testConn.createStatement(); testRs = testSt.executeQuery("SHOW VARIABLES LIKE 'disconnect_on_expired_password'"); fail("SQLException expected due to password expired"); } catch (SQLException e5) { if (e5.getErrorCode() == MysqlErrorNumbers.ER_MUST_CHANGE_PASSWORD_LOGIN) { testConn = getConnectionWithProps(props); testSt = testConn.createStatement(); } testSt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER USER() IDENTIFIED BY 'newpwd'" : "SET PASSWORD = PASSWORD('newpwd')"); testConn.close(); props.setProperty("user", "must_change2"); props.setProperty("password", "newpwd"); props.setProperty("disconnectOnExpiredPasswords", "true"); >>>>>>> } catch (SQLException e5) { if (e5.getErrorCode() == MysqlErrorNumbers.ER_MUST_CHANGE_PASSWORD_LOGIN) { <<<<<<< Connection con = null; this.stmt.executeUpdate("grant all on *.* to 'bug19354014user'@'%' identified WITH mysql_native_password"); this.stmt.executeUpdate("set password for 'bug19354014user'@'%' = PASSWORD('pwd')"); this.stmt.executeUpdate("flush privileges"); ======= if (versionMeetsMinimum(5, 5, 7)) { Connection con = null; this.stmt.executeUpdate("grant all on *.* to 'bug19354014user'@'%' identified WITH mysql_native_password"); this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'bug19354014user'@'%' IDENTIFIED BY 'pwd'" : "set password for 'bug19354014user'@'%' = PASSWORD('pwd')"); this.stmt.executeUpdate("flush privileges"); >>>>>>> Connection con = null; this.stmt.executeUpdate("grant all on *.* to 'bug19354014user'@'%' identified WITH mysql_native_password"); this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? "ALTER USER 'bug19354014user'@'%' IDENTIFIED BY 'pwd'" : "set password for 'bug19354014user'@'%' = PASSWORD('pwd')"); this.stmt.executeUpdate("flush privileges");
<<<<<<< props.setProperty(PropertyDefinitions.PNAME_loadBalanceStrategy, "random"); props.setProperty(PropertyDefinitions.PNAME_selfDestructOnPingMaxOperations, "5"); Connection conn2 = this.getUnreliableLoadBalancedConnection(new String[] { "first", "second" }, props); ======= props.setProperty("loadBalanceStrategy", "random"); props.setProperty("selfDestructOnPingMaxOperations", "5"); final Connection conn2 = this.getUnreliableLoadBalancedConnection(new String[] { "first", "second" }, props); >>>>>>> props.setProperty(PropertyDefinitions.PNAME_loadBalanceStrategy, "random"); props.setProperty(PropertyDefinitions.PNAME_selfDestructOnPingMaxOperations, "5"); final Connection conn2 = this.getUnreliableLoadBalancedConnection(new String[] { "first", "second" }, props);
<<<<<<< import com.mysql.jdbc.exceptions.MysqlDataTruncation; import com.mysql.jdbc.exceptions.PacketTooBigException; import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.interceptors.StatementInterceptorV2; ======= import com.mysql.jdbc.io.CompressedPacketSender; import com.mysql.jdbc.io.DebugBufferingPacketSender; import com.mysql.jdbc.io.PacketSender; import com.mysql.jdbc.io.PacketSentTimeHolder; import com.mysql.jdbc.io.SimplePacketSender; import com.mysql.jdbc.io.TracingPacketSender; import com.mysql.jdbc.io.TimeTrackingPacketSender; import com.mysql.jdbc.log.LogUtils; import com.mysql.jdbc.profiler.ProfilerEvent; import com.mysql.jdbc.profiler.ProfilerEventHandler; import com.mysql.jdbc.util.ReadAheadInputStream; >>>>>>> import com.mysql.jdbc.exceptions.MysqlDataTruncation; import com.mysql.jdbc.exceptions.PacketTooBigException; import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.interceptors.StatementInterceptorV2; <<<<<<< private MySQLConnection connection; private Deflater deflater = null; ======= protected BufferedOutputStream mysqlOutput = null; protected MySQLConnection connection; protected InputStream mysqlInput = null; >>>>>>> protected MySQLConnection connection; <<<<<<< // // Used to send large packets to the server versions 4+ // We use a SoftReference, so that we don't penalize intermittent use of this feature // private SoftReference<Buffer> splitBufRef; private SoftReference<Buffer> compressBufRef; ======= protected String host = null; >>>>>>> <<<<<<< ======= protected long lastPacketReceivedTimeMs = 0; >>>>>>> <<<<<<< ======= * @return Returns the last packet sent time in ms. */ protected long getLastPacketSentTimeMs() { return this.packetSentTimeHolder.getLastPacketSentTime(); } protected long getLastPacketReceivedTimeMs() { return this.lastPacketReceivedTimeMs; } /** >>>>>>> * @return Returns the last packet sent time in ms. */ @Override public long getLastPacketSentTimeMs() { return this.packetSentTimeHolder.getLastPacketSentTime(); } /** <<<<<<< for (PacketBuffer buffer : toServer) { last_sent = new Buffer(buffer.getBufLength() + HEADER_LENGTH); last_sent.writeBytesNoNull(buffer.getByteBuffer(), 0, toServer.get(0).getBufLength()); send(last_sent, last_sent.getPosition()); ======= for (Buffer buffer : toServer) { send(buffer, buffer.getBufLength()); >>>>>>> for (PacketBuffer buffer : toServer) { send(buffer, buffer.getBufLength()); <<<<<<< this.mysqlInput = new CompressedInputStream(this.connection, this.mysqlInput, ((JdbcConnectionPropertiesImpl) this.connection).traceProtocol); ======= this.mysqlInput = new CompressedInputStream(this.connection, this.mysqlInput); this.compressedPacketSender = new CompressedPacketSender(this.mysqlOutput); this.packetSender = this.compressedPacketSender; >>>>>>> this.mysqlInput = new CompressedInputStream(this.connection, this.mysqlInput, ((JdbcConnectionPropertiesImpl) this.connection).traceProtocol); this.compressedPacketSender = new CompressedPacketSender(this.mysqlOutput); this.packetSender = this.compressedPacketSender; <<<<<<< try { ExportControlled.transformSocketToSSLSocket(this); } catch (IOException ioEx) { throw SQLError.createCommunicationsException(this.getConnection(), this.getLastPacketSentTimeMs(), this.getLastPacketReceivedTimeMs(), ioEx, getExceptionInterceptor()); } ======= ExportControlled.transformSocketToSSLSocket(this); // output stream is replaced, build new packet sender this.packetSender = new SimplePacketSender(this.mysqlOutput); >>>>>>> try { ExportControlled.transformSocketToSSLSocket(this); } catch (IOException ioEx) { throw SQLError.createCommunicationsException(this.getConnection(), this.getLastPacketSentTimeMs(), this.getLastPacketReceivedTimeMs(), ioEx, getExceptionInterceptor()); } // output stream is replaced, build new packet sender this.packetSender = new SimplePacketSender(this.mysqlOutput);
<<<<<<< assertEquals(-1, logBuf.toString().indexOf("SHOW VARIABLES LIKE 'tx_isolation'")); ======= if (versionMeetsMinimum(4, 0, 3)) { assertEquals(-1, StandardLogger.getBuffer().toString().indexOf("SHOW VARIABLES LIKE 'tx_isolation'")); } >>>>>>> assertEquals(-1, StandardLogger.getBuffer().toString().indexOf("SHOW VARIABLES LIKE 'tx_isolation'"));
<<<<<<< import com.mysql.jdbc.exceptions.CommunicationsException; public class StandardLoadBalanceExceptionChecker implements LoadBalanceExceptionChecker { private List<String> sqlStateList; private List<Class<?>> sqlExClassList; public boolean shouldExceptionTriggerFailover(SQLException ex) { String sqlState = ex.getSQLState(); if (sqlState != null) { if (sqlState.startsWith("08")) { // connection error return true; } if(this.sqlStateList != null){ // check against SQLState list for(Iterator<String> i = sqlStateList.iterator(); i.hasNext(); ){ if(sqlState.startsWith(i.next().toString())){ return true; } } } } // always handle CommunicationException if(ex instanceof CommunicationsException){ return true; } if(this.sqlExClassList != null){ // check against configured class lists for(Iterator<Class<?>> i = sqlExClassList.iterator(); i.hasNext(); ){ if(i.next().isInstance(ex)){ return true; } } } // no matches return false; } public void destroy() { // TODO Auto-generated method stub } public void init(Connection conn, Properties props) throws SQLException { configureSQLStateList(props.getProperty("loadBalanceSQLStateFailover", null)); configureSQLExceptionSubclassList(props.getProperty("loadBalanceSQLExceptionSubclassFailover", null)); } private void configureSQLStateList(String sqlStates){ if(sqlStates == null || "".equals(sqlStates)){ return; } List<String> states = StringUtils.split(sqlStates, ",", true); List<String> newStates = new ArrayList<String>(); for (String state : states){ if(state.length() > 0){ newStates.add(state); } } if(newStates.size() > 0){ this.sqlStateList = newStates; } } private void configureSQLExceptionSubclassList(String sqlExClasses){ if(sqlExClasses == null || "".equals(sqlExClasses)){ return; } List<String> classes = StringUtils.split(sqlExClasses, ",", true); List<Class<?>> newClasses = new ArrayList<Class<?>>(); for (String exClass : classes) { try{ Class<?> c = Class.forName(exClass); newClasses.add(c); } catch (Exception e){ // ignore and don't check, class doesn't exist } } if(newClasses.size() > 0){ this.sqlExClassList = newClasses; } } ======= public class StandardLoadBalanceExceptionChecker implements LoadBalanceExceptionChecker { private List<String> sqlStateList; private List<Class<?>> sqlExClassList; public boolean shouldExceptionTriggerFailover(SQLException ex) { String sqlState = ex.getSQLState(); if (sqlState != null) { if (sqlState.startsWith("08")) { // connection error return true; } if (this.sqlStateList != null) { // check against SQLState list for (Iterator<String> i = this.sqlStateList.iterator(); i.hasNext();) { if (sqlState.startsWith(i.next().toString())) { return true; } } } } // always handle CommunicationException if (ex instanceof CommunicationsException) { return true; } if (this.sqlExClassList != null) { // check against configured class lists for (Iterator<Class<?>> i = this.sqlExClassList.iterator(); i.hasNext();) { if (i.next().isInstance(ex)) { return true; } } } // no matches return false; } public void destroy() { // TODO Auto-generated method stub } public void init(Connection conn, Properties props) throws SQLException { configureSQLStateList(props.getProperty("loadBalanceSQLStateFailover", null)); configureSQLExceptionSubclassList(props.getProperty("loadBalanceSQLExceptionSubclassFailover", null)); } private void configureSQLStateList(String sqlStates) { if (sqlStates == null || "".equals(sqlStates)) { return; } List<String> states = StringUtils.split(sqlStates, ",", true); List<String> newStates = new ArrayList<String>(); for (String state : states) { if (state.length() > 0) { newStates.add(state); } } if (newStates.size() > 0) { this.sqlStateList = newStates; } } private void configureSQLExceptionSubclassList(String sqlExClasses) { if (sqlExClasses == null || "".equals(sqlExClasses)) { return; } List<String> classes = StringUtils.split(sqlExClasses, ",", true); List<Class<?>> newClasses = new ArrayList<Class<?>>(); for (String exClass : classes) { try { Class<?> c = Class.forName(exClass); newClasses.add(c); } catch (Exception e) { // ignore and don't check, class doesn't exist } } if (newClasses.size() > 0) { this.sqlExClassList = newClasses; } } >>>>>>> import com.mysql.jdbc.exceptions.CommunicationsException; public class StandardLoadBalanceExceptionChecker implements LoadBalanceExceptionChecker { private List<String> sqlStateList; private List<Class<?>> sqlExClassList; public boolean shouldExceptionTriggerFailover(SQLException ex) { String sqlState = ex.getSQLState(); if (sqlState != null) { if (sqlState.startsWith("08")) { // connection error return true; } if (this.sqlStateList != null) { // check against SQLState list for (Iterator<String> i = this.sqlStateList.iterator(); i.hasNext();) { if (sqlState.startsWith(i.next().toString())) { return true; } } } } // always handle CommunicationException if (ex instanceof CommunicationsException) { return true; } if (this.sqlExClassList != null) { // check against configured class lists for (Iterator<Class<?>> i = this.sqlExClassList.iterator(); i.hasNext();) { if (i.next().isInstance(ex)) { return true; } } } // no matches return false; } public void destroy() { // TODO Auto-generated method stub } public void init(Connection conn, Properties props) throws SQLException { configureSQLStateList(props.getProperty("loadBalanceSQLStateFailover", null)); configureSQLExceptionSubclassList(props.getProperty("loadBalanceSQLExceptionSubclassFailover", null)); } private void configureSQLStateList(String sqlStates) { if (sqlStates == null || "".equals(sqlStates)) { return; } List<String> states = StringUtils.split(sqlStates, ",", true); List<String> newStates = new ArrayList<String>(); for (String state : states) { if (state.length() > 0) { newStates.add(state); } } if (newStates.size() > 0) { this.sqlStateList = newStates; } } private void configureSQLExceptionSubclassList(String sqlExClasses) { if (sqlExClasses == null || "".equals(sqlExClasses)) { return; } List<String> classes = StringUtils.split(sqlExClasses, ",", true); List<Class<?>> newClasses = new ArrayList<Class<?>>(); for (String exClass : classes) { try { Class<?> c = Class.forName(exClass); newClasses.add(c); } catch (Exception e) { // ignore and don't check, class doesn't exist } } if (newClasses.size() > 0) { this.sqlExClassList = newClasses; } }
<<<<<<< ((JdbcConnection) testConn).changeUser("bug18869381user1", "pwd1"); ======= ((MySQLConnection) testConn).changeUser("bug18869381user1", "LongLongLongLongLongLongLongLongLongLongLongLongPwd1"); >>>>>>> ((JdbcConnection) testConn).changeUser("bug18869381user1", "LongLongLongLongLongLongLongLongLongLongLongLongPwd1");
<<<<<<< import com.mysql.jdbc.interceptors.StatementInterceptorV2; ======= >>>>>>> <<<<<<< public boolean executeTopLevelOnly() { return true; } public void destroy() { } public ResultSetInternalMethods postProcess(String sql, com.mysql.jdbc.Statement interceptedStatement, ResultSetInternalMethods originalResultSet, com.mysql.jdbc.JdbcConnection connection, int warningCount, boolean noIndexUsed, boolean noGoodIndexUsed, SQLException statementException) throws SQLException { return null; } ======= >>>>>>>
<<<<<<< import com.mysql.cj.api.ExceptionInterceptor; ======= import com.mysql.cj.core.Messages; >>>>>>> import com.mysql.cj.api.ExceptionInterceptor; import com.mysql.cj.core.Messages; <<<<<<< throw SQLError.createSQLException("Not a valid escape sequence: " + token, exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.0", new Object[] { token }), conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.0", new Object[] { token }), exceptionInterceptor); <<<<<<< throw SQLError.createSQLException("Syntax error for DATE escape sequence '" + argument + "'", "42000", exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.1", new Object[] { argument }), SQLError.SQL_STATE_SYNTAX_ERROR, conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.1", new Object[] { argument }), SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); <<<<<<< throw SQLError.createSQLException("Syntax error while processing {fn convert (... , ...)} token, missing opening parenthesis in token '" + functionToken + "'.", SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.4", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.4", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); <<<<<<< throw SQLError.createSQLException("Syntax error while processing {fn convert (... , ...)} token, missing comma in token '" + functionToken + "'.", SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.5", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.5", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); <<<<<<< throw SQLError.createSQLException("Syntax error while processing {fn convert (... , ...)} token, missing closing parenthesis in token '" + functionToken + "'.", SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.6", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.6", new Object[] { functionToken }), SQLError.SQL_STATE_SYNTAX_ERROR, exceptionInterceptor); <<<<<<< throw SQLError.createSQLException("Unsupported conversion type '" + type.trim() + "' found while processing escape token.", SQLError.SQL_STATE_GENERAL_ERROR, exceptionInterceptor); ======= throw SQLError.createSQLException(Messages.getString("EscapeProcessor.7", new Object[] { type.trim() }), SQLError.SQL_STATE_GENERAL_ERROR, conn.getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("EscapeProcessor.7", new Object[] { type.trim() }), SQLError.SQL_STATE_GENERAL_ERROR, exceptionInterceptor);
<<<<<<< import java.lang.reflect.InvocationHandler; ======= import java.lang.reflect.Constructor; >>>>>>> <<<<<<< protected String closedReason = null; protected boolean closedExplicitly = false; protected boolean autoReconnect = false; public static final String BLACKLIST_TIMEOUT_PROPERTY_KEY = "loadBalanceBlacklistTimeout"; static { try { getLocalTimeMethod = System.class.getMethod("nanoTime", new Class[0]); } catch (SecurityException e) { // ignore } catch (NoSuchMethodException e) { // ignore } } // Lifted from C/J 5.1's JDBC-2.0 connection pool classes, let's merge this if/when this gets into 5.1 protected class ConnectionErrorFiringInvocationHandler implements InvocationHandler { Object invokeOn = null; public ConnectionErrorFiringInvocationHandler(Object toInvokeOn) { this.invokeOn = toInvokeOn; } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result = null; try { result = method.invoke(this.invokeOn, args); if (result != null) { result = proxyIfInterfaceIsJdbc(result, result.getClass()); } } catch (InvocationTargetException e) { dealWithInvocationException(e); } return result; } } protected MysqlJdbcConnection currentConn; protected List<String> hostList; ======= private long connectionGroupProxyID = 0; >>>>>>> private long connectionGroupProxyID = 0; <<<<<<< private Map<Class<?>, Boolean> jdbcInterfacesForProxyCache = new HashMap<Class<?>, Boolean>(); private MysqlJdbcConnection thisAsConnection = null; private int autoCommitSwapThreshold = 0; ======= private static Constructor<?> JDBC_4_LB_CONNECTION_CTOR; static { if (Util.isJdbc4()) { try { JDBC_4_LB_CONNECTION_CTOR = Class.forName("com.mysql.jdbc.JDBC4LoadBalancedMySQLConnection").getConstructor( new Class[] { LoadBalancingConnectionProxy.class }); } catch (SecurityException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } } >>>>>>> <<<<<<< this.localProps.remove(NonRegisteringDriver.NUM_HOSTS_PROPERTY_KEY); this.localProps.setProperty("useLocalSessionState", "true"); String strategy = this.localProps.getProperty("loadBalanceStrategy", "random"); String lbExceptionChecker = this.localProps.getProperty("loadBalanceExceptionChecker", StandardLoadBalanceExceptionChecker.class.getName()); ======= this.connectionsToHostsMap = new HashMap<ConnectionImpl, String>(numHosts); this.responseTimes = new long[numHosts]; >>>>>>> this.connectionsToHostsMap = new HashMap<ConnectionImpl, String>(numHosts); this.responseTimes = new long[numHosts]; <<<<<<< this.thisAsConnection = new LoadBalancedMySQLConnection(this); ======= >>>>>>> <<<<<<< synchronized void invalidateConnection(MysqlJdbcConnection conn) throws SQLException { try { if (!conn.isClosed()) { conn.close(); } } catch (SQLException e) { // we don't really want to throw this Exception } finally { // add host to the global blacklist, if enabled if (this.isGlobalBlacklistEnabled()) { this.addToGlobalBlacklist(this.connectionsToHostsMap.get(conn)); ======= @Override synchronized void invalidateConnection(MySQLConnection conn) throws SQLException { super.invalidateConnection(conn); >>>>>>> @Override synchronized void invalidateConnection(MysqlJdbcConnection conn) throws SQLException { super.invalidateConnection(conn); <<<<<<< * Picks the "best" connection to use for the next transaction based on the * BalanceStrategy in use. * * @throws SQLException */ public synchronized void pickNewConnection() throws SQLException { if (this.isClosed && this.closedExplicitly) { return; } if (this.currentConn == null) { // startup this.currentConn = this.balancer.pickConnection(this, Collections.unmodifiableList(this.hostList), Collections.unmodifiableMap(this.liveConnections), this.responseTimes.clone(), this.retriesAllDown); return; } if (this.currentConn.isClosed()) { invalidateCurrentConnection(); } int pingTimeout = this.currentConn.getLoadBalancePingTimeout(); boolean pingBeforeReturn = this.currentConn.getLoadBalanceValidateConnectionOnSwapServer(); for (int hostsTried = 0, hostsToTry = this.hostList.size(); hostsTried <= hostsToTry; hostsTried++) { ConnectionImpl newConn = null; try { newConn = this.balancer.pickConnection( this, Collections.unmodifiableList(this.hostList), Collections.unmodifiableMap(this.liveConnections), this.responseTimes.clone(), this.retriesAllDown); if (this.currentConn != null) { if (pingBeforeReturn) { if (pingTimeout == 0) { newConn.ping(); } else { newConn.pingInternal(true, pingTimeout); } } syncSessionState(this.currentConn, newConn); } this.currentConn = newConn; return; } catch (SQLException e) { if (shouldExceptionTriggerFailover(e) && newConn != null) { // connection error, close up shop on current connection invalidateConnection(newConn); } } } // no hosts available to swap connection to, close up. this.isClosed = true; this.closedReason = "Connection closed after inability to pick valid new connection during fail-over."; } /** * Recursively checks for interfaces on the given object to determine if it * implements a java.sql interface, and if so, proxies the instance so that * we can catch and fire SQL errors. * * @param toProxy * @param clazz */ Object proxyIfInterfaceIsJdbc(Object toProxy, Class<?> clazz) { if (isInterfaceJdbc(clazz)) { Class<?>[] interfacesToProxy = getAllInterfacesToProxy(clazz); return Proxy.newProxyInstance(toProxy.getClass().getClassLoader(), interfacesToProxy, createConnectionProxy(toProxy)); } return toProxy; } private Map<Class<?>, Class<?>[]> allInterfacesToProxy = new HashMap<Class<?>, Class<?>[]>(); private Class<?>[] getAllInterfacesToProxy(Class<?> clazz) { Class<?>[] interfacesToProxy = this.allInterfacesToProxy.get(clazz); if (interfacesToProxy != null) { return interfacesToProxy; } List<Class<?>> interfaces = new LinkedList<Class<?>>(); Class<?> superClass = clazz; while (!(superClass.equals(Object.class))) { Class<?>[] declared = superClass.getInterfaces(); for (int i = 0; i < declared.length; i++) { interfaces.add(declared[i]); } superClass = superClass.getSuperclass(); } interfacesToProxy = new Class[interfaces.size()]; interfaces.toArray(interfacesToProxy); this.allInterfacesToProxy.put(clazz, interfacesToProxy); return interfacesToProxy; } private boolean isInterfaceJdbc(Class<?> clazz) { if (this.jdbcInterfacesForProxyCache.containsKey(clazz)) { return (this.jdbcInterfacesForProxyCache.get(clazz)).booleanValue(); } for (Class<?> iface : clazz.getInterfaces()) { String packageName = null; try { packageName = iface.getPackage().getName(); } catch (Exception ex) { // we may experience a NPE from getPackage() returning null, or class-loading facilities; This happens when this class is instrumented to // implement runtime-generated interfaces continue; } if ("java.sql".equals(packageName) || "javax.sql".equals(packageName) || "com.mysql.jdbc".equals(packageName)) { this.jdbcInterfacesForProxyCache.put(clazz, true); return true; } if (isInterfaceJdbc(iface)) { this.jdbcInterfacesForProxyCache.put(clazz, true); return true; } } if (clazz.getSuperclass() != null && isInterfaceJdbc(clazz.getSuperclass())) { this.jdbcInterfacesForProxyCache.put(clazz, true); return true; } this.jdbcInterfacesForProxyCache.put(clazz, false); return false; } protected ConnectionErrorFiringInvocationHandler createConnectionProxy(Object toProxy) { return new ConnectionErrorFiringInvocationHandler(toProxy); } /** * Returns best-resolution representation of local time, using nanoTime() if * available, otherwise defaulting to currentTimeMillis(). ======= * Pings live connections. >>>>>>> * Pings live connections. <<<<<<< MysqlJdbcConnection c = this.currentConn; ======= MySQLConnection c = this.currentConnection; >>>>>>> MysqlJdbcConnection c = this.currentConnection; <<<<<<< protected void syncSessionState(JdbcConnection initial, JdbcConnection target) throws SQLException { if (initial == null || target == null) { return; } target.setAutoCommit(initial.getAutoCommit()); target.setCatalog(initial.getCatalog()); target.setTransactionIsolation(initial.getTransactionIsolation()); target.setReadOnly(initial.isReadOnly()); target.setSessionMaxRows(initial.getSessionMaxRows()); } ======= >>>>>>>
<<<<<<< this.fetchedRows = this.mysql.fetchRowsViaCursor(this.fetchedRows, this.statementIdOnServer, this.metadata, numRowsToFetch); ======= this.fetchedRows = this.mysql.getResultsHandler().fetchRowsViaCursor(this.fetchedRows, this.statementIdOnServer, this.metadata, numRowsToFetch, this.useBufferRowExplicit); >>>>>>> this.fetchedRows = this.mysql.getResultsHandler().fetchRowsViaCursor(this.fetchedRows, this.statementIdOnServer, this.metadata, numRowsToFetch);
<<<<<<< * * <p> ======= * >>>>>>> * <<<<<<< * </p> * * @author Mark Matthews * @version $Id: Statement.java 4624 2005-11-28 14:24:29 -0600 (Mon, 28 Nov * 2005) mmatthews $ * * @see java.sql.Statement * @see ResultSetInternalMethods ======= >>>>>>> <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.0"), //$NON-NLS-1$ SQLError.SQL_STATE_CONNECTION_NOT_OPEN, null); ======= throw SQLError.createSQLException(Messages.getString("Statement.0"), SQLError.SQL_STATE_CONNECTION_NOT_OPEN, null); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.0"), SQLError.SQL_STATE_CONNECTION_NOT_OPEN, null); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.49"), //$NON-NLS-1$ SQLError.SQL_STATE_CONNECTION_NOT_OPEN, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.49"), SQLError.SQL_STATE_CONNECTION_NOT_OPEN, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.49"), SQLError.SQL_STATE_CONNECTION_NOT_OPEN, getExceptionInterceptor()); <<<<<<< if (StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "INSERT") //$NON-NLS-1$ || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "UPDATE") //$NON-NLS-1$ || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DELETE") //$NON-NLS-1$ || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DROP") //$NON-NLS-1$ || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "CREATE") //$NON-NLS-1$ || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "ALTER") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "TRUNCATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "RENAME")) { //$NON-NLS-1$ throw SQLError.createSQLException(Messages.getString("Statement.57"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= if (StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "INSERT") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "UPDATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DELETE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DROP") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "CREATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "ALTER") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "TRUNCATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "RENAME")) { throw SQLError.createSQLException(Messages.getString("Statement.57"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> if (StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "INSERT") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "UPDATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DELETE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "DROP") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "CREATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "ALTER") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "TRUNCATE") || StringUtils.startsWithIgnoreCaseAndWs(noCommentSql, "RENAME")) { throw SQLError.createSQLException(Messages.getString("Statement.57"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.59"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.59"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.59"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.61"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.61"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.61"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.34") //$NON-NLS-1$ + Messages.getString("Statement.35"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.34") + Messages.getString("Statement.35"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.34") + Messages.getString("Statement.35"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.42") //$NON-NLS-1$ + Messages.getString("Statement.43"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.42") + Messages.getString("Statement.43"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.42") + Messages.getString("Statement.43"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< * DOCUMENT ME! * * @return DOCUMENT ME! * ======= >>>>>>> <<<<<<< while (this.results.next()) { ; // need to drain remaining rows to get to server status // which tells us whether more results actually exist or not ======= while (this.results.next()) { // need to drain remaining rows to get to server status which tells us whether more results actually exist or not >>>>>>> while (this.results.next()) { // need to drain remaining rows to get to server status which tells us whether more results actually exist or not <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.19"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.19"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.19"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< * DOCUMENT ME! * * @return DOCUMENT ME! ======= >>>>>>> <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.5"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.5"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.5"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.7"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.7"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.7"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.11"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.11"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.11"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.13", //$NON-NLS-1$ new Object[] { Long.valueOf(maxBuf) }), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.13", new Object[] { Long.valueOf(maxBuf) }), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.13", new Object[] { Long.valueOf(maxBuf) }), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< throw SQLError.createSQLException(Messages.getString("Statement.21"), //$NON-NLS-1$ SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); ======= throw SQLError.createSQLException(Messages.getString("Statement.21"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); >>>>>>> throw SQLError.createSQLException(Messages.getString("Statement.21"), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, getExceptionInterceptor()); <<<<<<< // This works for classes that aren't actually wrapping // anything return iface.cast(this); ======= // This works for classes that aren't actually wrapping anything return Util.cast(iface, this); >>>>>>> // This works for classes that aren't actually wrapping anything return iface.cast(this);
<<<<<<< import java.sql.Blob; import java.sql.CallableStatement; import java.sql.Clob; import java.sql.DatabaseMetaData; import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.SQLClientInfoException; ======= >>>>>>>
<<<<<<< private static final long serialVersionUID = 3256444690067896368L; private static final Object[] NO_ARGS_ARRAY = new Object[0]; private transient Method pingMethod; public MysqlConnectionTester() { try { pingMethod = com.mysql.jdbc.Connection.class .getMethod("ping", (Class[])null); } catch (Exception ex) { // punt, we have no way to recover, other than we now use 'SELECT 1' // for // handling the connection testing. } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#activeCheckConnection(java.sql.Connection) */ public int activeCheckConnection(Connection con) { try { if (pingMethod != null) { if (con instanceof com.mysql.jdbc.Connection) { // We've been passed an instance of a MySQL connection -- // no need for reflection ((com.mysql.jdbc.Connection) con).ping(); } else { // Assume the connection is a C3P0 proxy C3P0ProxyConnection castCon = (C3P0ProxyConnection) con; castCon.rawConnectionOperation(pingMethod, C3P0ProxyConnection.RAW_CONNECTION, NO_ARGS_ARRAY); } } else { Statement pingStatement = null; try { pingStatement = con.createStatement(); pingStatement.executeQuery("SELECT 1").close(); } finally { if (pingStatement != null) { pingStatement.close(); } } } return CONNECTION_IS_OKAY; } catch (Exception ex) { return CONNECTION_IS_INVALID; } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#statusOnException(java.sql.Connection, * java.lang.Throwable) */ public int statusOnException(Connection arg0, Throwable throwable) { if (throwable instanceof CommunicationsException) { return CONNECTION_IS_INVALID; } if (throwable instanceof SQLException) { String sqlState = ((SQLException) throwable).getSQLState(); if (sqlState != null && sqlState.startsWith("08")) { return CONNECTION_IS_INVALID; } return CONNECTION_IS_OKAY; } // Runtime/Unchecked? return CONNECTION_IS_INVALID; } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.QueryConnectionTester#activeCheckConnection(java.sql.Connection, * java.lang.String) */ public int activeCheckConnection(Connection arg0, String arg1) { return CONNECTION_IS_OKAY; } ======= private static final long serialVersionUID = 3256444690067896368L; private static final Object[] NO_ARGS_ARRAY = new Object[0]; private transient Method pingMethod; public MysqlConnectionTester() { try { this.pingMethod = com.mysql.jdbc.Connection.class.getMethod("ping", (Class[]) null); } catch (Exception ex) { // punt, we have no way to recover, other than we now use 'SELECT 1' // for // handling the connection testing. } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#activeCheckConnection(java.sql.Connection) */ public int activeCheckConnection(Connection con) { try { if (this.pingMethod != null) { if (con instanceof com.mysql.jdbc.Connection) { // We've been passed an instance of a MySQL connection -- // no need for reflection ((com.mysql.jdbc.Connection) con).ping(); } else { // Assume the connection is a C3P0 proxy C3P0ProxyConnection castCon = (C3P0ProxyConnection) con; castCon.rawConnectionOperation(this.pingMethod, C3P0ProxyConnection.RAW_CONNECTION, NO_ARGS_ARRAY); } } else { Statement pingStatement = null; try { pingStatement = con.createStatement(); pingStatement.executeQuery("SELECT 1").close(); } finally { if (pingStatement != null) { pingStatement.close(); } } } return CONNECTION_IS_OKAY; } catch (Exception ex) { return CONNECTION_IS_INVALID; } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#statusOnException(java.sql.Connection, * java.lang.Throwable) */ public int statusOnException(Connection arg0, Throwable throwable) { if (throwable instanceof CommunicationsException || "com.mysql.jdbc.exceptions.jdbc4.CommunicationsException".equals(throwable.getClass().getName())) { return CONNECTION_IS_INVALID; } if (throwable instanceof SQLException) { String sqlState = ((SQLException) throwable).getSQLState(); if (sqlState != null && sqlState.startsWith("08")) { return CONNECTION_IS_INVALID; } return CONNECTION_IS_OKAY; } // Runtime/Unchecked? return CONNECTION_IS_INVALID; } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.QueryConnectionTester#activeCheckConnection(java.sql.Connection, * java.lang.String) */ public int activeCheckConnection(Connection arg0, String arg1) { return CONNECTION_IS_OKAY; } >>>>>>> private static final long serialVersionUID = 3256444690067896368L; private static final Object[] NO_ARGS_ARRAY = new Object[0]; private transient Method pingMethod; public MysqlConnectionTester() { try { this.pingMethod = com.mysql.jdbc.Connection.class.getMethod("ping", (Class[]) null); } catch (Exception ex) { // punt, we have no way to recover, other than we now use 'SELECT 1' // for // handling the connection testing. } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#activeCheckConnection(java.sql.Connection) */ public int activeCheckConnection(Connection con) { try { if (this.pingMethod != null) { if (con instanceof com.mysql.jdbc.Connection) { // We've been passed an instance of a MySQL connection -- // no need for reflection ((com.mysql.jdbc.Connection) con).ping(); } else { // Assume the connection is a C3P0 proxy C3P0ProxyConnection castCon = (C3P0ProxyConnection) con; castCon.rawConnectionOperation(this.pingMethod, C3P0ProxyConnection.RAW_CONNECTION, NO_ARGS_ARRAY); } } else { Statement pingStatement = null; try { pingStatement = con.createStatement(); pingStatement.executeQuery("SELECT 1").close(); } finally { if (pingStatement != null) { pingStatement.close(); } } } return CONNECTION_IS_OKAY; } catch (Exception ex) { return CONNECTION_IS_INVALID; } } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.ConnectionTester#statusOnException(java.sql.Connection, * java.lang.Throwable) */ public int statusOnException(Connection arg0, Throwable throwable) { if (throwable instanceof CommunicationsException) { return CONNECTION_IS_INVALID; } if (throwable instanceof SQLException) { String sqlState = ((SQLException) throwable).getSQLState(); if (sqlState != null && sqlState.startsWith("08")) { return CONNECTION_IS_INVALID; } return CONNECTION_IS_OKAY; } // Runtime/Unchecked? return CONNECTION_IS_INVALID; } /* * (non-Javadoc) * * @see com.mchange.v2.c3p0.QueryConnectionTester#activeCheckConnection(java.sql.Connection, * java.lang.String) */ public int activeCheckConnection(Connection arg0, String arg1) { return CONNECTION_IS_OKAY; }
<<<<<<< import com.mysql.jdbc.exceptions.SQLError; import com.mysql.jdbc.interceptors.StatementInterceptorV2; ======= import com.mysql.jdbc.SQLError; import com.mysql.jdbc.StringUtils; import com.mysql.jdbc.Util; >>>>>>> import com.mysql.jdbc.exceptions.SQLError;
<<<<<<< if (getEncoding() == null) { // punt? setEncoding("ISO8859_1"); } ======= if (!getUseOldUTF8Behavior()) { if (dontCheckServerMatch || !characterSetNamesMatches("utf8") || (utf8mb4Supported && !characterSetNamesMatches("utf8mb4"))) { execSQL(null, "SET NAMES " + (useutf8mb4 ? "utf8mb4" : "utf8"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", useutf8mb4 ? "utf8mb4" : "utf8"); this.serverVariables.put("character_set_connection", useutf8mb4 ? "utf8mb4" : "utf8"); } } else { execSQL(null, "SET NAMES latin1", -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", "latin1"); this.serverVariables.put("character_set_connection", "latin1"); } >>>>>>> if (getEncoding() == null) { // punt? setEncoding("ISO8859_1"); } <<<<<<< if (!getUseOldUTF8Behavior()) { if (dontCheckServerMatch || !characterSetNamesMatches("utf8") || (!characterSetNamesMatches("utf8mb4"))) { execSQL(null, "SET NAMES " + (useutf8mb4 ? "utf8mb4" : "utf8"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); ======= if (dontCheckServerMatch || !characterSetNamesMatches(mysqlCharsetName)) { execSQL(null, "SET NAMES " + mysqlCharsetName, -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", mysqlCharsetName); this.serverVariables.put("character_set_connection", mysqlCharsetName); } >>>>>>> if (!getUseOldUTF8Behavior()) { if (dontCheckServerMatch || !characterSetNamesMatches("utf8") || (!characterSetNamesMatches("utf8mb4"))) { execSQL(null, "SET NAMES " + (useutf8mb4 ? "utf8mb4" : "utf8"), -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", useutf8mb4 ? "utf8mb4" : "utf8"); this.serverVariables.put("character_set_connection", useutf8mb4 ? "utf8mb4" : "utf8"); <<<<<<< ======= this.serverVariables.put("character_set_client", mysqlCharsetName); this.serverVariables.put("character_set_connection", mysqlCharsetName); } catch (SQLException ex) { if (ex.getErrorCode() != MysqlErrorNumbers.ER_MUST_CHANGE_PASSWORD || getDisconnectOnExpiredPasswords()) { throw ex; } >>>>>>> this.serverVariables.put("character_set_client", mysqlCharsetName); this.serverVariables.put("character_set_connection", mysqlCharsetName); <<<<<<< execSQL(null, "SET NAMES " + mysqlCharsetName, -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); ======= execSQL(null, "SET NAMES latin1", -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", "latin1"); this.serverVariables.put("character_set_connection", "latin1"); >>>>>>> execSQL(null, "SET NAMES " + mysqlCharsetName, -1, null, DEFAULT_RESULT_SET_TYPE, DEFAULT_RESULT_SET_CONCURRENCY, false, this.database, null, false); this.serverVariables.put("character_set_client", mysqlCharsetName); this.serverVariables.put("character_set_connection", mysqlCharsetName); <<<<<<< String query = versionComment + "SHOW VARIABLES"; query = versionComment + "SHOW VARIABLES WHERE Variable_name ='language' OR Variable_name = 'net_write_timeout'" + " OR Variable_name = 'interactive_timeout' OR Variable_name = 'wait_timeout' OR Variable_name = 'character_set_client'" + " OR Variable_name = 'character_set_connection' OR Variable_name = 'character_set' OR Variable_name = 'character_set_server'" + " OR Variable_name = 'tx_isolation' OR Variable_name = 'transaction_isolation' OR Variable_name = 'character_set_results'" + " OR Variable_name = 'timezone' OR Variable_name = 'time_zone' OR Variable_name = 'system_time_zone'" + " OR Variable_name = 'lower_case_table_names' OR Variable_name = 'max_allowed_packet' OR Variable_name = 'net_buffer_length'" + " OR Variable_name = 'sql_mode' OR Variable_name = 'query_cache_type' OR Variable_name = 'query_cache_size'" + " OR Variable_name = 'license' OR Variable_name = 'init_connect'"; ======= >>>>>>> <<<<<<< try { results = stmt.executeQuery(versionComment + "SELECT @@session.auto_increment_increment"); if (results.next()) { this.serverVariables.put("auto_increment_increment", results.getString(1)); } } catch (SQLException ex) { if (ex.getErrorCode() != MysqlErrorNumbers.ER_MUST_CHANGE_PASSWORD || getDisconnectOnExpiredPasswords()) { throw ex; } } ======= >>>>>>>
<<<<<<< StringBuffer sqlBuf = new StringBuffer("SELECT SPECIFIC_SCHEMA AS FUNCTION_CAT, " + "NULL AS `FUNCTION_SCHEM`, " + "SPECIFIC_NAME AS `FUNCTION_NAME`, " + "IFNULL(PARAMETER_NAME, '') AS `COLUMN_NAME`, " + "CASE WHEN PARAMETER_MODE = 'IN' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_IN) + " WHEN PARAMETER_MODE = 'OUT' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_OUT) + " WHEN PARAMETER_MODE = 'INOUT' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_INOUT) + " WHEN ORDINAL_POSITION = 0 THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_RETURN) + " ELSE " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_UNKNOWN) + " END AS `COLUMN_TYPE`, "); ======= StringBuffer sqlBuf = new StringBuffer("SELECT SPECIFIC_SCHEMA AS FUNCTION_CAT, NULL AS `FUNCTION_SCHEM`, SPECIFIC_NAME AS `FUNCTION_NAME`, " + "IFNULL(PARAMETER_NAME, '') AS `COLUMN_NAME`, CASE WHEN PARAMETER_MODE = 'IN' THEN " + getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_COLUMN_IN) + " WHEN PARAMETER_MODE = 'OUT' THEN " + getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_COLUMN_OUT) + " WHEN PARAMETER_MODE = 'INOUT' THEN " + getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_COLUMN_INOUT) + " WHEN ORDINAL_POSITION = 0 THEN " + getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_COLUMN_RETURN) + " ELSE " + getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_COLUMN_UNKNOWN) + " END AS `COLUMN_TYPE`, "); >>>>>>> StringBuffer sqlBuf = new StringBuffer("SELECT SPECIFIC_SCHEMA AS FUNCTION_CAT, NULL AS `FUNCTION_SCHEM`, SPECIFIC_NAME AS `FUNCTION_NAME`, " + "IFNULL(PARAMETER_NAME, '') AS `COLUMN_NAME`, CASE WHEN PARAMETER_MODE = 'IN' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_IN) + " WHEN PARAMETER_MODE = 'OUT' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_OUT) + " WHEN PARAMETER_MODE = 'INOUT' THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_INOUT) + " WHEN ORDINAL_POSITION = 0 THEN " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_RETURN) + " ELSE " + getFunctionConstant(FunctionConstant.FUNCTION_COLUMN_UNKNOWN) + " END AS `COLUMN_TYPE`, "); <<<<<<< sqlBuf.append(getFunctionConstant(FunctionConstant.FUNCTION_NULLABLE) + " AS `NULLABLE`, " + " NULL AS `REMARKS`, " + "CHARACTER_OCTET_LENGTH AS `CHAR_OCTET_LENGTH`, " + " ORDINAL_POSITION, " + "'YES' AS `IS_NULLABLE`, " + "SPECIFIC_NAME " ======= sqlBuf.append(getJDBC4FunctionConstant(JDBC4FunctionConstant.FUNCTION_NULLABLE) + " AS `NULLABLE`, NULL AS `REMARKS`, " + "CHARACTER_OCTET_LENGTH AS `CHAR_OCTET_LENGTH`, ORDINAL_POSITION, 'YES' AS `IS_NULLABLE`, SPECIFIC_NAME " >>>>>>> sqlBuf.append(getFunctionConstant(FunctionConstant.FUNCTION_NULLABLE) + " AS `NULLABLE`, NULL AS `REMARKS`, " + "CHARACTER_OCTET_LENGTH AS `CHAR_OCTET_LENGTH`, ORDINAL_POSITION, 'YES' AS `IS_NULLABLE`, SPECIFIC_NAME " <<<<<<< String sql = "SELECT ROUTINE_SCHEMA AS FUNCTION_CAT, NULL AS FUNCTION_SCHEM, " + "ROUTINE_NAME AS FUNCTION_NAME, ROUTINE_COMMENT AS REMARKS, " + getFunctionNoTableConstant() + " AS FUNCTION_TYPE, ROUTINE_NAME AS SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES " ======= String sql = "SELECT ROUTINE_SCHEMA AS FUNCTION_CAT, NULL AS FUNCTION_SCHEM, ROUTINE_NAME AS FUNCTION_NAME, ROUTINE_COMMENT AS REMARKS, " + getJDBC4FunctionNoTableConstant() + " AS FUNCTION_TYPE, ROUTINE_NAME AS SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES " >>>>>>> String sql = "SELECT ROUTINE_SCHEMA AS FUNCTION_CAT, NULL AS FUNCTION_SCHEM, ROUTINE_NAME AS FUNCTION_NAME, ROUTINE_COMMENT AS REMARKS, " + getFunctionNoTableConstant() + " AS FUNCTION_TYPE, ROUTINE_NAME AS SPECIFIC_NAME FROM INFORMATION_SCHEMA.ROUTINES "
<<<<<<< import com.mysql.cj.core.ServerVersion; import com.mysql.cj.core.util.StringUtils; ======= import com.mysql.jdbc.MySQLConnection; >>>>>>> import com.mysql.cj.core.ServerVersion; import com.mysql.cj.core.util.StringUtils; import com.mysql.cj.core.util.Util; import com.mysql.jdbc.MysqlJdbcConnection; <<<<<<< ======= import com.mysql.jdbc.ReplicationDriver; import com.mysql.jdbc.StringUtils; import com.mysql.jdbc.Util; >>>>>>> <<<<<<< return (((com.mysql.jdbc.JdbcConnection) this.conn).versionMeetsMinimum(major, minor, subminor)); ======= return (((com.mysql.jdbc.Connection) this.conn).versionMeetsMinimum(major, minor, subminor)); } /** * Checks whether the server we're connected to is a MySQL Community edition */ protected boolean isCommunityEdition() { return Util.isCommunityEdition(((MySQLConnection) this.conn).getServerVersion()); } /** * Checks whether the server we're connected to is an MySQL Enterprise edition */ protected boolean isEnterpriseEdition() { return Util.isEnterpriseEdition(((MySQLConnection) this.conn).getServerVersion()); } protected boolean isRunningOnJdk131() { return this.runningOnJdk131; >>>>>>> return (((com.mysql.jdbc.JdbcConnection) this.conn).versionMeetsMinimum(major, minor, subminor)); } /** * Checks whether the server we're connected to is a MySQL Community edition */ protected boolean isCommunityEdition() { return Util.isCommunityEdition(((MysqlJdbcConnection) this.conn).getServerVersion().toString()); } /** * Checks whether the server we're connected to is an MySQL Enterprise edition */ protected boolean isEnterpriseEdition() { return Util.isEnterpriseEdition(((MysqlJdbcConnection) this.conn).getServerVersion().toString());
<<<<<<< ======= * Tests fix for BUG#68307 - getFunctionColumns() returns incorrect "COLUMN_TYPE" information. This JDBC4 * feature required some changes in method getProcedureColumns(). * * @throws Exception * if the test fails. */ public void testBug68307() throws Exception { String[] testStepDescription = new String[] { "MySQL MetaData", "I__S MetaData" }; Connection connUseIS = getConnectionWithProps("useInformationSchema=true"); Connection[] testConnections = new Connection[] { this.conn, connUseIS }; createFunction("testBug68307_func", "(func_param_in INT) RETURNS INT DETERMINISTIC RETURN 1"); createProcedure("testBug68307_proc", "(IN proc_param_in INT, OUT proc_param_out INT, INOUT proc_param_inout INT) SELECT 1"); for (int i = 0; i < testStepDescription.length; i++) { DatabaseMetaData testDbMetaData = testConnections[i].getMetaData(); this.rs = testDbMetaData.getProcedureColumns(null, null, "testBug68307_%", "%"); while (this.rs.next()) { String message = testStepDescription[i] + ", procedure/function <" + this.rs.getString("PROCEDURE_NAME") + "." + this.rs.getString("COLUMN_NAME") + ">"; if (this.rs.getString("COLUMN_NAME") == null || this.rs.getString("COLUMN_NAME").length() == 0) { assertEquals(message, DatabaseMetaData.procedureColumnReturn, this.rs.getShort("COLUMN_TYPE")); } else if (this.rs.getString("COLUMN_NAME").endsWith("_in")) { assertEquals(message, DatabaseMetaData.procedureColumnIn, this.rs.getShort("COLUMN_TYPE")); } else if (this.rs.getString("COLUMN_NAME").endsWith("_inout")) { assertEquals(message, DatabaseMetaData.procedureColumnInOut, this.rs.getShort("COLUMN_TYPE")); } else if (this.rs.getString("COLUMN_NAME").endsWith("_out")) { assertEquals(message, DatabaseMetaData.procedureColumnOut, this.rs.getShort("COLUMN_TYPE")); } else { fail(testStepDescription[i] + ", column '" + this.rs.getString("FUNCTION_NAME") + "." + this.rs.getString("COLUMN_NAME") + "' not expected within test case."); } } this.rs.close(); } } /** * Tests fix for BUG#44451 - getTables does not return resultset with expected columns. * * @throws Exception * if the test fails. */ public void testBug44451() throws Exception { String methodName; List<String> expectedFields; String[] testStepDescription = new String[] { "MySQL MetaData", "I__S MetaData" }; Connection connUseIS = getConnectionWithProps("useInformationSchema=true"); Connection[] testConnections = new Connection[] { this.conn, connUseIS }; methodName = "getColumns()"; expectedFields = Arrays .asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE", "SCOPE_CATALOG", "SCOPE_SCHEMA", "SCOPE_TABLE", "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT", "IS_GENERATEDCOLUMN"); for (int i = 0; i < testStepDescription.length; i++) { DatabaseMetaData testDbMetaData = testConnections[i].getMetaData(); this.rs = testDbMetaData.getColumns(null, null, "%", "%"); checkReturnedColumnsForBug44451(testStepDescription[i], methodName, expectedFields, this.rs); this.rs.close(); } methodName = "getProcedureColumns()"; expectedFields = Arrays.asList("PROCEDURE_CAT", "PROCEDURE_SCHEM", "PROCEDURE_NAME", "COLUMN_NAME", "COLUMN_TYPE", "DATA_TYPE", "TYPE_NAME", "PRECISION", "LENGTH", "SCALE", "RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE", "SPECIFIC_NAME"); for (int i = 0; i < testStepDescription.length; i++) { DatabaseMetaData testDbMetaData = testConnections[i].getMetaData(); this.rs = testDbMetaData.getProcedureColumns(null, null, "%", "%"); checkReturnedColumnsForBug44451(testStepDescription[i], methodName, expectedFields, this.rs); this.rs.close(); } methodName = "getTables()"; expectedFields = Arrays.asList("TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE", "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "SELF_REFERENCING_COL_NAME", "REF_GENERATION"); for (int i = 0; i < testStepDescription.length; i++) { DatabaseMetaData testDbMetaData = testConnections[i].getMetaData(); this.rs = testDbMetaData.getTables(null, null, "%", null); checkReturnedColumnsForBug44451(testStepDescription[i], methodName, expectedFields, this.rs); this.rs.close(); } methodName = "getUDTs()"; expectedFields = Arrays.asList("TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME", "CLASS_NAME", "DATA_TYPE", "REMARKS", "BASE_TYPE"); for (int i = 0; i < testStepDescription.length; i++) { DatabaseMetaData testDbMetaData = testConnections[i].getMetaData(); this.rs = testDbMetaData.getUDTs(null, null, "%", null); checkReturnedColumnsForBug44451(testStepDescription[i], methodName, expectedFields, this.rs); this.rs.close(); } connUseIS.close(); } private void checkReturnedColumnsForBug44451(String stepDescription, String methodName, List<String> expectedFields, ResultSet resultSetToCheck) throws Exception { ResultSetMetaData rsMetaData = resultSetToCheck.getMetaData(); int numberOfColumns = rsMetaData.getColumnCount(); assertEquals(stepDescription + ", wrong column count in method '" + methodName + "'.", expectedFields.size(), numberOfColumns); for (int i = 0; i < numberOfColumns; i++) { int position = i + 1; assertEquals(stepDescription + ", wrong column at position '" + position + "' in method '" + methodName + "'.", expectedFields.get(i), rsMetaData.getColumnName(position)); } this.rs.close(); } /** >>>>>>> <<<<<<< final String mysqlKeywords = "ACCESSIBLE,ADD,ANALYZE,ASC,BEFORE,CASCADE,CHANGE,CONTINUE,DATABASE,DATABASES,DAY_HOUR,DAY_MICROSECOND,DAY_MINUTE,DAY_SECOND,DELAYED,DESC,DISTINCTROW,DIV,DUAL,ELSEIF,ENCLOSED,ESCAPED,EXIT,EXPLAIN,FLOAT4,FLOAT8,FORCE,FULLTEXT,HIGH_PRIORITY,HOUR_MICROSECOND,HOUR_MINUTE,HOUR_SECOND,IF,IGNORE,INDEX,INFILE,INT1,INT2,INT3,INT4,INT8,IO_AFTER_GTIDS,IO_BEFORE_GTIDS,ITERATE,KEY,KEYS,KILL,LEAVE,LIMIT,LINEAR,LINES,LOAD,LOCK,LONG,LONGBLOB,LONGTEXT,LOOP,LOW_PRIORITY,MASTER_BIND,MASTER_SSL_VERIFY_SERVER_CERT,MAXVALUE,MEDIUMBLOB,MEDIUMINT,MEDIUMTEXT,MIDDLEINT,MINUTE_MICROSECOND,MINUTE_SECOND,NONBLOCKING,NO_WRITE_TO_BINLOG,OPTIMIZE,OPTION,OPTIONALLY,OUTFILE,PURGE,READ,READ_WRITE,REGEXP,RENAME,REPEAT,REPLACE,REQUIRE,RESIGNAL,RESTRICT,RLIKE,SCHEMA,SCHEMAS,SECOND_MICROSECOND,SEPARATOR,SHOW,SIGNAL,SPATIAL,SQL_BIG_RESULT,SQL_CALC_FOUND_ROWS,SQL_SMALL_RESULT,SSL,STARTING,STRAIGHT_JOIN,TERMINATED,TINYBLOB,TINYINT,TINYTEXT,UNDO,UNLOCK,UNSIGNED,USAGE,USE,UTC_DATE,UTC_TIME,UTC_TIMESTAMP,VARBINARY,VARCHARACTER,WHILE,WRITE,XOR,YEAR_MONTH,ZEROFILL"; ======= if (Util.isJdbc4()) { // there is a specific JCDB4 test for this return; } final String mysqlKeywords = "ACCESSIBLE,ANALYZE,ASENSITIVE,BEFORE,BIGINT,BINARY,BLOB,CALL,CHANGE,CONDITION,DATABASE,DATABASES,DAY_HOUR,DAY_MICROSECOND,DAY_MINUTE," + "DAY_SECOND,DELAYED,DETERMINISTIC,DISTINCTROW,DIV,DUAL,EACH,ELSEIF,ENCLOSED,ESCAPED,EXIT,EXPLAIN,FLOAT4,FLOAT8,FORCE,FULLTEXT,HIGH_PRIORITY," + "HOUR_MICROSECOND,HOUR_MINUTE,HOUR_SECOND,IF,IGNORE,INDEX,INFILE,INOUT,INT1,INT2,INT3,INT4,INT8,IO_AFTER_GTIDS,IO_BEFORE_GTIDS,ITERATE,KEYS," + "KILL,LEAVE,LIMIT,LINEAR,LINES,LOAD,LOCALTIME,LOCALTIMESTAMP,LOCK,LONG,LONGBLOB,LONGTEXT,LOOP,LOW_PRIORITY,MASTER_BIND,MASTER_SSL_VERIFY_SERVER_CERT,MAXVALUE," + "MEDIUMBLOB,MEDIUMINT,MEDIUMTEXT,MIDDLEINT,MINUTE_MICROSECOND,MINUTE_SECOND,MOD,MODIFIES,NONBLOCKING,NO_WRITE_TO_BINLOG,OPTIMIZE,OPTIONALLY,OUT," + "OUTFILE,PARTITION,PURGE,RANGE,READS,READ_WRITE,REGEXP,RELEASE,RENAME,REPEAT,REPLACE,REQUIRE,RESIGNAL,RETURN,RLIKE,SCHEMAS,SECOND_MICROSECOND,SENSITIVE,SEPARATOR," + "SHOW,SIGNAL,SPATIAL,SPECIFIC,SQLEXCEPTION,SQLWARNING,SQL_BIG_RESULT,SQL_CALC_FOUND_ROWS,SQL_SMALL_RESULT,SSL,STARTING,STRAIGHT_JOIN,TERMINATED,TINYBLOB,TINYINT,TINYTEXT,TRIGGER," + "UNDO,UNLOCK,UNSIGNED,USE,UTC_DATE,UTC_TIME,UTC_TIMESTAMP,VARBINARY,VARCHARACTER,WHILE,XOR,YEAR_MONTH,ZEROFILL"; >>>>>>> final String mysqlKeywords = "ACCESSIBLE,ADD,ANALYZE,ASC,BEFORE,CASCADE,CHANGE,CONTINUE,DATABASE,DATABASES,DAY_HOUR,DAY_MICROSECOND,DAY_MINUTE," + "DAY_SECOND,DELAYED,DESC,DISTINCTROW,DIV,DUAL,ELSEIF,ENCLOSED,ESCAPED,EXIT,EXPLAIN,FLOAT4,FLOAT8,FORCE,FULLTEXT,HIGH_PRIORITY," + "HOUR_MICROSECOND,HOUR_MINUTE,HOUR_SECOND,IF,IGNORE,INDEX,INFILE,INT1,INT2,INT3,INT4,INT8,IO_AFTER_GTIDS,IO_BEFORE_GTIDS,ITERATE,KEY,KEYS," + "KILL,LEAVE,LIMIT,LINEAR,LINES,LOAD,LOCK,LONG,LONGBLOB,LONGTEXT,LOOP,LOW_PRIORITY,MASTER_BIND,MASTER_SSL_VERIFY_SERVER_CERT,MAXVALUE," + "MEDIUMBLOB,MEDIUMINT,MEDIUMTEXT,MIDDLEINT,MINUTE_MICROSECOND,MINUTE_SECOND,NONBLOCKING,NO_WRITE_TO_BINLOG,OPTIMIZE,OPTION,OPTIONALLY," + "OUTFILE,PURGE,READ,READ_WRITE,REGEXP,RENAME,REPEAT,REPLACE,REQUIRE,RESIGNAL,RESTRICT,RLIKE,SCHEMA,SCHEMAS,SECOND_MICROSECOND,SEPARATOR," + "SHOW,SIGNAL,SPATIAL,SQL_BIG_RESULT,SQL_CALC_FOUND_ROWS,SQL_SMALL_RESULT,SSL,STARTING,STRAIGHT_JOIN,TERMINATED,TINYBLOB,TINYINT,TINYTEXT," + "UNDO,UNLOCK,UNSIGNED,USAGE,USE,UTC_DATE,UTC_TIME,UTC_TIMESTAMP,VARBINARY,VARCHARACTER,WHILE,WRITE,XOR,YEAR_MONTH,ZEROFILL";