Some code formatting.

This commit is contained in:
MobiusDev
2016-03-19 08:47:52 +00:00
parent 9a9a5dd414
commit 345b88ad95
106 changed files with 308 additions and 308 deletions
+2 -2
View File
@@ -3004,7 +3004,7 @@ public final class Config
* Loads flood protector configurations.
* @param properties the properties object containing the actual values of the flood protector configs
*/
private static void loadFloodProtectorConfigs(final PropertiesParser properties)
private static void loadFloodProtectorConfigs(PropertiesParser properties)
{
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", 4);
loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", 42);
@@ -3031,7 +3031,7 @@ public final class Config
* @param configString flood protector configuration string that determines for which flood protector configuration should be read
* @param defaultInterval default flood protector interval
*/
private static void loadFloodProtectorConfig(final PropertiesParser properties, final FloodProtectorConfig config, final String configString, final int defaultInterval)
private static void loadFloodProtectorConfig(PropertiesParser properties, FloodProtectorConfig config, String configString, int defaultInterval)
{
config.FLOOD_PROTECTION_INTERVAL = properties.getInt(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval);
config.LOG_FLOODING = properties.getBoolean(StringUtil.concat("FloodProtector", configString, "LogFlooding"), false);
@@ -22,5 +22,5 @@ package com.l2jmobius.commons.mmocore;
*/
public interface IClientFactory<T extends MMOClient<?>>
{
public T create(final MMOConnection<T> con);
public T create(MMOConnection<T> con);
}
@@ -26,7 +26,7 @@ public abstract class MMOClient<T extends MMOConnection<?>>
{
private final T _con;
public MMOClient(final T con)
public MMOClient(T con)
{
_con = con;
}
@@ -36,9 +36,9 @@ public abstract class MMOClient<T extends MMOConnection<?>>
return _con;
}
public abstract boolean decrypt(final ByteBuffer buf, final int size);
public abstract boolean decrypt(ByteBuffer buf, int size);
public abstract boolean encrypt(final ByteBuffer buf, final int size);
public abstract boolean encrypt(ByteBuffer buf, int size);
protected abstract void onDisconnection();
@@ -58,7 +58,7 @@ public class MMOConnection<T extends MMOClient<?>>
private T _client;
public MMOConnection(final SelectorThread<T> selectorThread, final Socket socket, final SelectionKey key, boolean tcpNoDelay)
public MMOConnection(SelectorThread<T> selectorThread, Socket socket, SelectionKey key, boolean tcpNoDelay)
{
_selectorThread = selectorThread;
_socket = socket;
@@ -80,7 +80,7 @@ public class MMOConnection<T extends MMOClient<?>>
}
}
final void setClient(final T client)
final void setClient(T client)
{
_client = client;
}
@@ -90,7 +90,7 @@ public class MMOConnection<T extends MMOClient<?>>
return _client;
}
public final void sendPacket(final SendablePacket<T> sp)
public final void sendPacket(SendablePacket<T> sp)
{
sp._client = _client;
@@ -137,17 +137,17 @@ public class MMOConnection<T extends MMOClient<?>>
_socket.close();
}
final int read(final ByteBuffer buf) throws IOException
final int read(ByteBuffer buf) throws IOException
{
return _readableByteChannel.read(buf);
}
final int write(final ByteBuffer buf) throws IOException
final int write(ByteBuffer buf) throws IOException
{
return _writableByteChannel.write(buf);
}
final void createWriteBuffer(final ByteBuffer buf)
final void createWriteBuffer(ByteBuffer buf)
{
if (_primaryWriteBuffer == null)
{
@@ -186,7 +186,7 @@ public class MMOConnection<T extends MMOClient<?>>
return _primaryWriteBuffer != null;
}
final void movePendingWriteBufferTo(final ByteBuffer dest)
final void movePendingWriteBufferTo(ByteBuffer dest)
{
_primaryWriteBuffer.flip();
dest.put(_primaryWriteBuffer);
@@ -195,7 +195,7 @@ public class MMOConnection<T extends MMOClient<?>>
_secondaryWriteBuffer = null;
}
final void setReadBuffer(final ByteBuffer buf)
final void setReadBuffer(ByteBuffer buf)
{
_readBuffer = buf;
}
@@ -220,7 +220,7 @@ public class MMOConnection<T extends MMOClient<?>>
*/
@SuppressWarnings("unchecked")
public final void close(final SendablePacket<T> sp)
public final void close(SendablePacket<T> sp)
{
close(new SendablePacket[]
{
@@ -228,7 +228,7 @@ public class MMOConnection<T extends MMOClient<?>>
});
}
public final void close(final SendablePacket<T>[] closeList)
public final void close(SendablePacket<T>[] closeList)
{
if (_pendingClose)
{
@@ -33,7 +33,7 @@ public final class NioNetStackList<E>
clear();
}
public final void addLast(final E elem)
public final void addLast(E elem)
{
final NioNetStackNode newEndNode = _buf.removeFirst();
_end._value = elem;
@@ -78,7 +78,7 @@ public final class NioNetStackList<E>
_start._next = _end;
}
final void addLast(final NioNetStackNode node)
final void addLast(NioNetStackNode node)
{
node._next = null;
node._value = null;
@@ -29,7 +29,7 @@ public final class NioNetStringBuffer
private int _len;
public NioNetStringBuffer(final int size)
public NioNetStringBuffer(int size)
{
_buf = new char[size];
_size = size;
@@ -41,7 +41,7 @@ public final class NioNetStringBuffer
_len = 0;
}
public final void append(final char c)
public final void append(char c)
{
if (_len < _size)
{
@@ -40,7 +40,7 @@ public abstract class ReceivablePacket<T extends MMOClient<?>>extends AbstractPa
* Reads as many bytes as the length of the array.
* @param dst : the byte array which will be filled with the data.
*/
protected final void readB(final byte[] dst)
protected final void readB(byte[] dst)
{
_buf.get(dst);
}
@@ -52,7 +52,7 @@ public abstract class ReceivablePacket<T extends MMOClient<?>>extends AbstractPa
* @param offset : starts to fill the byte array from the given offset.
* @param len : the given length of bytes to be read.
*/
protected final void readB(final byte[] dst, final int offset, final int len)
protected final void readB(byte[] dst, int offset, int len)
{
_buf.get(dst, offset, len);
}
@@ -67,7 +67,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
private boolean _shutdown;
public SelectorThread(final SelectorConfig sc, final IMMOExecutor<T> executor, final IPacketHandler<T> packetHandler, final IClientFactory<T> clientFactory, final IAcceptFilter acceptFilter) throws IOException
public SelectorThread(SelectorConfig sc, IMMOExecutor<T> executor, IPacketHandler<T> packetHandler, IClientFactory<T> clientFactory, IAcceptFilter acceptFilter) throws IOException
{
super.setName("SelectorThread-" + super.getId());
@@ -234,7 +234,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
closeSelectorThread();
}
private final void finishConnection(final SelectionKey key, final MMOConnection<T> con)
private final void finishConnection(SelectionKey key, MMOConnection<T> con)
{
try
{
@@ -254,7 +254,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final void acceptConnection(final SelectionKey key, MMOConnection<T> con)
private final void acceptConnection(SelectionKey key, MMOConnection<T> con)
{
final ServerSocketChannel ssc = (ServerSocketChannel) key.channel();
SocketChannel sc;
@@ -283,7 +283,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final void readPacket(final SelectionKey key, final MMOConnection<T> con)
private final void readPacket(SelectionKey key, MMOConnection<T> con)
{
if (!con.isClosed())
{
@@ -363,7 +363,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final boolean tryReadPacket(final SelectionKey key, final T client, final ByteBuffer buf, final MMOConnection<T> con)
private final boolean tryReadPacket(SelectionKey key, T client, ByteBuffer buf, MMOConnection<T> con)
{
switch (buf.remaining())
{
@@ -445,13 +445,13 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final void allocateReadBuffer(final MMOConnection<T> con)
private final void allocateReadBuffer(MMOConnection<T> con)
{
con.setReadBuffer(getPooledBuffer().put(READ_BUFFER));
READ_BUFFER.clear();
}
private final void parseClientPacket(final int pos, final ByteBuffer buf, final int dataSize, final T client)
private final void parseClientPacket(int pos, ByteBuffer buf, int dataSize, T client)
{
final boolean ret = client.decrypt(buf, dataSize);
@@ -480,7 +480,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final void writeClosePacket(final MMOConnection<T> con)
private final void writeClosePacket(MMOConnection<T> con)
{
SendablePacket<T> sp;
synchronized (con.getSendQueue())
@@ -510,7 +510,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
protected final void writePacket(final SelectionKey key, final MMOConnection<T> con)
protected final void writePacket(SelectionKey key, MMOConnection<T> con)
{
if (!prepareWriteBuffer(con))
{
@@ -561,7 +561,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final boolean prepareWriteBuffer(final MMOConnection<T> con)
private final boolean prepareWriteBuffer(MMOConnection<T> con)
{
boolean hasPending = false;
DIRECT_WRITE_BUFFER.clear();
@@ -619,7 +619,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
return hasPending;
}
private final void putPacketIntoWriteBuffer(final T client, final SendablePacket<T> sp)
private final void putPacketIntoWriteBuffer(T client, SendablePacket<T> sp)
{
WRITE_BUFFER.clear();
@@ -651,7 +651,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
WRITE_BUFFER.position(dataPos + dataSize);
}
final void closeConnection(final MMOConnection<T> con)
final void closeConnection(MMOConnection<T> con)
{
synchronized (_pendingClose)
{
@@ -659,7 +659,7 @@ public final class SelectorThread<T extends MMOClient<?>>extends Thread
}
}
private final void closeConnectionImpl(final SelectionKey key, final MMOConnection<T> con)
private final void closeConnectionImpl(SelectionKey key, MMOConnection<T> con)
{
try
{
@@ -22,17 +22,17 @@ package com.l2jmobius.commons.mmocore;
*/
public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPacket<T>
{
protected final void putInt(final int value)
protected final void putInt(int value)
{
_buf.putInt(value);
}
protected final void putDouble(final double value)
protected final void putDouble(double value)
{
_buf.putDouble(value);
}
protected final void putFloat(final float value)
protected final void putFloat(float value)
{
_buf.putFloat(value);
}
@@ -42,7 +42,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer (00)
* @param data
*/
protected final void writeC(final boolean data)
protected final void writeC(boolean data)
{
_buf.put((byte) (data ? 0x01 : 0x00));
}
@@ -52,7 +52,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer (00)
* @param data
*/
protected final void writeC(final int data)
protected final void writeC(int data)
{
_buf.put((byte) data);
}
@@ -62,7 +62,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 64bit double precision float (00 00 00 00 00 00 00 00)
* @param value
*/
protected final void writeF(final double value)
protected final void writeF(double value)
{
_buf.putDouble(value);
}
@@ -72,7 +72,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 16bit integer (00 00)
* @param value
*/
protected final void writeH(final int value)
protected final void writeH(int value)
{
_buf.putShort((short) value);
}
@@ -82,7 +82,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 32bit integer (00 00 00 00)
* @param value
*/
protected final void writeD(final int value)
protected final void writeD(int value)
{
_buf.putInt(value);
}
@@ -92,7 +92,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 32bit integer (00 00 00 00)
* @param value
*/
protected final void writeD(final boolean value)
protected final void writeD(boolean value)
{
_buf.putInt(value ? 0x01 : 0x00);
}
@@ -102,7 +102,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 64bit integer (00 00 00 00 00 00 00 00)
* @param value
*/
protected final void writeQ(final long value)
protected final void writeQ(long value)
{
_buf.putLong(value);
}
@@ -112,7 +112,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* 8bit integer array (00 ...)
* @param data
*/
protected final void writeB(final byte[] data)
protected final void writeB(byte[] data)
{
_buf.put(data);
}
@@ -121,7 +121,7 @@ public abstract class SendablePacket<T extends MMOClient<?>>extends AbstractPack
* Write <B>String</B> to the buffer.
* @param text
*/
protected final void writeS(final String text)
protected final void writeS(String text)
{
if (text != null)
{
@@ -101,7 +101,7 @@ public final class GameTimeController extends Thread
* Add a L2Character to movingObjects of GameTimeController.
* @param cha The L2Character to add to movingObjects of GameTimeController
*/
public final void registerMovingObject(final L2Character cha)
public final void registerMovingObject(L2Character cha)
{
if (cha == null)
{
@@ -74,7 +74,7 @@ public class ThreadPoolManager
{
private final Runnable _r;
public RunnableWrapper(final Runnable r)
public RunnableWrapper(Runnable r)
{
_r = r;
}
@@ -352,7 +352,7 @@ public class ClanTable
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanDestroy(leaderMember, clan));
}
public void scheduleRemoveClan(final int clanId)
public void scheduleRemoveClan(int clanId)
{
ThreadPoolManager.getInstance().scheduleGeneral(() ->
{
@@ -69,7 +69,7 @@ public final class PlayerXpPercentLostData implements IXmlReader
}
}
public double getXpPercent(final int level)
public double getXpPercent(int level)
{
if (level > _maxlevel)
{
@@ -338,7 +338,7 @@ public final class BotReportTable
* @param bot (L2PcInstance to be punished)
* @param rcd (RepotedCharData linked to this bot)
*/
private void handleReport(L2PcInstance bot, final ReportedCharData rcd)
private void handleReport(L2PcInstance bot, ReportedCharData rcd)
{
// Report count punishment
punishBot(bot, _punishments.get(rcd.getReportCount()));
@@ -596,7 +596,7 @@ public final class BotReportTable
final Skill _punish;
final int _systemMessageId;
PunishHolder(final Skill sk, final int sysMsg)
PunishHolder(Skill sk, int sysMsg)
{
_punish = sk;
_systemMessageId = sysMsg;
@@ -197,7 +197,7 @@ public class MerchantPriceConfigTable implements InstanceListManager
private Castle _castle;
private final int _zoneId;
public MerchantPriceConfig(final int id, final String name, final int baseTax, final int castleId, final int zoneId)
public MerchantPriceConfig(int id, String name, int baseTax, int castleId, int zoneId)
{
_id = id;
_name = name;
@@ -90,7 +90,7 @@ public class DocumentEngine
return doc.getSkills();
}
public void loadAllSkills(final Map<Integer, Skill> allSkills)
public void loadAllSkills(Map<Integer, Skill> allSkills)
{
int count = 0;
for (File file : _skillFiles)
@@ -124,7 +124,7 @@ public final class ItemAuctionManager
}
}
public final ItemAuctionInstance getManagerInstance(final int instanceId)
public final ItemAuctionInstance getManagerInstance(int instanceId)
{
return _managerInstances.get(instanceId);
}
@@ -134,7 +134,7 @@ public final class ItemAuctionManager
return _auctionIds.getAndIncrement();
}
public static final void deleteAuction(final int auctionId)
public static final void deleteAuction(int auctionId)
{
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
@@ -30,7 +30,7 @@ public final class PcCafePointsManager
{
}
public void givePcCafePoint(final L2PcInstance player, final long exp)
public void givePcCafePoint(L2PcInstance player, long exp)
{
if (!Config.PC_BANG_ENABLED)
{
@@ -254,7 +254,7 @@ public final class WalkingManager implements IXmlReader
* @param npc NPC to move
* @param routeName name of route to move by
*/
public void startMoving(final L2Npc npc, final String routeName)
public void startMoving(L2Npc npc, String routeName)
{
if (_routes.containsKey(routeName) && (npc != null) && !npc.isDead()) // check, if these route and NPC present
{
@@ -355,7 +355,7 @@ public final class WalkingManager implements IXmlReader
* Resumes previously stopped moving
* @param npc NPC to resume
*/
public void resumeMoving(final L2Npc npc)
public void resumeMoving(L2Npc npc)
{
final WalkInfo walk = _activeRoutes.get(npc.getObjectId());
if (walk != null)
@@ -414,7 +414,7 @@ public final class WalkingManager implements IXmlReader
* Manage "node arriving"-related tasks: schedule move to next node; send ON_NODE_ARRIVED event to Quest script
* @param npc NPC to manage
*/
public void onArrived(final L2Npc npc)
public void onArrived(L2Npc npc)
{
if (_activeRoutes.containsKey(npc.getObjectId()))
{
@@ -114,7 +114,7 @@ public abstract class AbstractPlayerGroup
* Broadcast a packet to every member of this group.
* @param packet the packet to broadcast
*/
public void broadcastPacket(final L2GameServerPacket packet)
public void broadcastPacket(L2GameServerPacket packet)
{
forEachMember(m ->
{
@@ -144,7 +144,7 @@ public abstract class AbstractPlayerGroup
broadcastPacket(SystemMessage.sendString(text));
}
public void broadcastCreatureSay(final CreatureSay msg, final L2PcInstance broadcaster)
public void broadcastCreatureSay(CreatureSay msg, L2PcInstance broadcaster)
{
forEachMember(m ->
{
@@ -25,7 +25,7 @@ public class ClanInfo
private final int _total;
private final int _online;
public ClanInfo(final L2Clan clan)
public ClanInfo(L2Clan clan)
{
_clan = clan;
_total = clan.getMembersCount();
@@ -122,7 +122,7 @@ public final class L2WorldRegion
return false;
}
public boolean checkEffectRangeInsidePeaceZone(Skill skill, final int x, final int y, final int z)
public boolean checkEffectRangeInsidePeaceZone(Skill skill, int x, int y, int z)
{
final int range = skill.getEffectRange();
final int up = y + range;
@@ -926,7 +926,7 @@ public class L2Attackable extends L2Npc
* @param target The L2Character whose hate level must be returned
* @return the hate level of the L2Attackable against this L2Character contained in _aggroList.
*/
public int getHating(final L2Character target)
public int getHating(L2Character target)
{
if (_aggroList.isEmpty() || (target == null))
{
@@ -462,7 +462,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param zone
* @param state
*/
public final void setInsideZone(ZoneId zone, final boolean state)
public final void setInsideZone(ZoneId zone, boolean state)
{
synchronized (_zones)
{
@@ -5309,7 +5309,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param weapon
* @return the Reuse Time of Attack (used for bow delay)
*/
public int calculateReuseTime(final L2Weapon weapon)
public int calculateReuseTime(L2Weapon weapon)
{
if (isTransformed())
{
@@ -6655,7 +6655,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
return;
}
L2Object target = getTarget();
final L2Object target = getTarget();
if ((target != null) && target.isNpc())
{
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), id), (L2Npc) target);
@@ -6896,7 +6896,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
* @param target
* @param isDot
*/
public void notifyAttackAvoid(final L2Character target, final boolean isDot)
public void notifyAttackAvoid(L2Character target, boolean isDot)
{
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureAttackAvoid(this, target, isDot), target);
}
@@ -1549,7 +1549,7 @@ public class L2Npc extends L2Character
* @param paramName the parameter name to check
* @return given AI parameter value
*/
public int getAIValue(final String paramName)
public int getAIValue(String paramName)
{
return hasAIValue(paramName) ? NpcPersonalAIData.getInstance().getAIValue(getSpawn().getName(), paramName) : -1;
}
@@ -1558,7 +1558,7 @@ public class L2Npc extends L2Character
* @param paramName the parameter name to check
* @return {@code true} if given parameter is set for NPC, {@code false} otherwise
*/
public boolean hasAIValue(final String paramName)
public boolean hasAIValue(String paramName)
{
return (getSpawn() != null) && (getSpawn().getName() != null) && NpcPersonalAIData.getInstance().hasAIValue(getSpawn().getName(), paramName);
}
@@ -4370,7 +4370,7 @@ public final class L2PcInstance extends L2Playable
public final void broadcastPacket(SocialAction sa)
{
L2Object target = getTarget();
final L2Object target = getTarget();
if ((target != null) && target.isNpc())
{
EventDispatcher.getInstance().notifyEventAsync(new OnNpcSocialActionSee((L2Npc) target, getActingPlayer(), sa.getId()), (L2Npc) target);
@@ -14410,7 +14410,7 @@ public final class L2PcInstance extends L2Playable
return _pcBangPoints;
}
public void setPcBangPoints(final int count)
public void setPcBangPoints(int count)
{
if (count < 200000)
{
@@ -23,13 +23,13 @@ import java.util.ArrayList;
*/
public abstract class Builder
{
public abstract String toString(final Object param);
public abstract String toString(Object param);
public abstract String toString(final Object... params);
public abstract String toString(Object... params);
public abstract int getIndex();
public static final Builder newBuilder(final String text)
public static final Builder newBuilder(String text)
{
final ArrayList<Builder> builders = new ArrayList<>();
@@ -23,13 +23,13 @@ final class BuilderContainer extends Builder
{
private final Builder[] _builders;
BuilderContainer(final Builder[] builders)
BuilderContainer(Builder[] builders)
{
_builders = builders;
}
@Override
public final String toString(final Object param)
public final String toString(Object param)
{
return toString(new Object[]
{
@@ -38,7 +38,7 @@ final class BuilderContainer extends Builder
}
@Override
public final String toString(final Object... params)
public final String toString(Object... params)
{
final int buildersLength = _builders.length;
final int paramsLength = params.length;
@@ -23,7 +23,7 @@ final class BuilderObject extends Builder
{
private final int _index;
BuilderObject(final int id)
BuilderObject(int id)
{
if ((id < 1) || (id > 9))
{
@@ -33,13 +33,13 @@ final class BuilderObject extends Builder
}
@Override
public final String toString(final Object param)
public final String toString(Object param)
{
return param == null ? "null" : param.toString();
}
@Override
public final String toString(final Object... params)
public final String toString(Object... params)
{
if ((params == null) || (params.length == 0))
{
@@ -23,19 +23,19 @@ final class BuilderText extends Builder
{
private final String _text;
BuilderText(final String text)
BuilderText(String text)
{
_text = text;
}
@Override
public final String toString(final Object param)
public final String toString(Object param)
{
return toString();
}
@Override
public final String toString(final Object... params)
public final String toString(Object... params)
{
return toString();
}
@@ -24,12 +24,12 @@ final class FastStringBuilder
private final char[] _array;
private int _len;
public FastStringBuilder(final int capacity)
public FastStringBuilder(int capacity)
{
_array = new char[capacity];
}
public final void append(final String text)
public final void append(String text)
{
text.getChars(0, text.length(), _array, _len);
_len += text.length();
@@ -68,7 +68,7 @@ public enum CommissionTreeType
CommissionItemType.MAGIC_ORNAMENT,
CommissionItemType.DYES,
CommissionItemType.OTHER_ITEM);
private final int _clientId;
private final Set<CommissionItemType> _commissionItemTypes;
@@ -31,7 +31,7 @@ public interface IAmountMultiplierStrategy
public static final IAmountMultiplierStrategy SPOIL = DEFAULT_STRATEGY(Config.RATE_CORPSE_DROP_AMOUNT_MULTIPLIER);
public static final IAmountMultiplierStrategy STATIC = (item, victim) -> 1;
public static IAmountMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
public static IAmountMultiplierStrategy DEFAULT_STRATEGY(double defaultMultiplier)
{
return (item, victim) ->
{
@@ -46,7 +46,7 @@ public interface IChanceMultiplierStrategy
return (Config.L2JMOD_CHAMPION_ENABLE && (victim != null) && victim.isChampion()) ? (Config.RATE_QUEST_DROP * championmult) : Config.RATE_QUEST_DROP;
};
public static IChanceMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
public static IChanceMultiplierStrategy DEFAULT_STRATEGY(double defaultMultiplier)
{
return (item, victim) ->
{
@@ -76,7 +76,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
public ScheduledFuture<?> _siegeTask;
public boolean _missionAccomplished = false;
public ClanHallSiegeEngine(String name, String descr, final int hallId)
public ClanHallSiegeEngine(String name, String descr, int hallId)
{
super(-1, name, descr);
_log = Logger.getLogger(getClass().getName());
@@ -448,7 +448,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
return Config.CHS_FAME_FREQUENCY;
}
public final void broadcastNpcSay(final L2Npc npc, final ChatType type, final NpcStringId messageId)
public final void broadcastNpcSay(L2Npc npc, ChatType type, NpcStringId messageId)
{
final NpcSay npcSay = new NpcSay(npc.getObjectId(), type, npc.getId(), messageId);
final int sourceRegion = MapRegionManager.getInstance().getMapRegionLocId(npc);
@@ -144,7 +144,7 @@ public final class SiegableHall extends ClanHall
}
}
public final void setSiege(final ClanHallSiegeEngine siegable)
public final void setSiege(ClanHallSiegeEngine siegable)
{
_siege = siegable;
_siegeZone.setSiegeInstance(siegable);
@@ -175,7 +175,7 @@ public final class SiegableHall extends ClanHall
_nextSiege.setTimeInMillis(date);
}
public final void setNextSiegeDate(final Calendar c)
public final void setNextSiegeDate(Calendar c)
{
_nextSiege = c;
}
@@ -193,7 +193,7 @@ public final class SiegableHall extends ClanHall
updateDb();
}
public final void addAttacker(final L2Clan clan)
public final void addAttacker(L2Clan clan)
{
if (getSiege() != null)
{
@@ -201,7 +201,7 @@ public final class SiegableHall extends ClanHall
}
}
public final void removeAttacker(final L2Clan clan)
public final void removeAttacker(L2Clan clan)
{
if (getSiege() != null)
{
@@ -2680,7 +2680,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player 'cause of limits
* @return the counts of each items given to each player
*/
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, Function<Integer, Long> limit, boolean playSound, boolean smartDrop)
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, Function<Integer, Long> limit, boolean playSound, boolean smartDrop)
{
GroupedGeneralDropItem toDrop;
if (smartDrop)
@@ -2723,7 +2723,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player
* @return the counts of each items given to each player
*/
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, Map<Integer, Long> limit, boolean playSound, boolean smartDrop)
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, Map<Integer, Long> limit, boolean playSound, boolean smartDrop)
{
return distributeItems(players, items, killer, victim, Util.mapToFunction(limit), playSound, smartDrop);
}
@@ -2739,7 +2739,7 @@ public abstract class AbstractScript implements INamable
* @param smartDrop true if to not calculate a drop, which can't be given to any player
* @return the counts of each items given to each player
*/
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, final GroupedGeneralDropItem items, L2Character killer, L2Character victim, long limit, boolean playSound, boolean smartDrop)
protected static Map<L2PcInstance, Map<Integer, Long>> distributeItems(Collection<L2PcInstance> players, GroupedGeneralDropItem items, L2Character killer, L2Character victim, long limit, boolean playSound, boolean smartDrop)
{
return distributeItems(players, items, killer, victim, t -> limit, playSound, smartDrop);
}
@@ -3058,7 +3058,7 @@ public abstract class AbstractScript implements INamable
* @param includeCommandChannel if {@code true}, {@link #actionForEachPlayer(L2PcInstance, L2Npc, boolean)} will be called with the player's command channel members
* @see #actionForEachPlayer(L2PcInstance, L2Npc, boolean)
*/
public final void executeForEachPlayer(L2PcInstance player, final L2Npc npc, final boolean isSummon, boolean includeParty, boolean includeCommandChannel)
public final void executeForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon, boolean includeParty, boolean includeCommandChannel)
{
if ((includeParty || includeCommandChannel) && player.isInParty())
{
@@ -36,7 +36,7 @@ public class MinionHolder implements IIdentifiable
* @param respawnTime the respawn time
* @param weightPoint the weight point
*/
public MinionHolder(final int id, final int count, final long respawnTime, final int weightPoint)
public MinionHolder(int id, int count, long respawnTime, int weightPoint)
{
_id = id;
_count = count;
@@ -40,7 +40,7 @@ public final class AuctionDateGenerator
private int _hour_of_day;
private int _minute_of_hour;
public AuctionDateGenerator(final StatsSet config) throws IllegalArgumentException
public AuctionDateGenerator(StatsSet config) throws IllegalArgumentException
{
_calendar = Calendar.getInstance();
_interval = config.getInt(FIELD_INTERVAL, -1);
@@ -55,7 +55,7 @@ public final class AuctionDateGenerator
checkMinuteOfHour(0);
}
public synchronized final long nextDate(final long date)
public synchronized final long nextDate(long date)
{
_calendar.setTimeInMillis(date);
_calendar.set(Calendar.MILLISECOND, 0);
@@ -72,7 +72,7 @@ public final class AuctionDateGenerator
return calcDestTime(_calendar.getTimeInMillis(), date, TimeUnit.MILLISECONDS.convert(_interval, TimeUnit.DAYS));
}
private final long calcDestTime(long time, final long date, final long add)
private final long calcDestTime(long time, long date, long add)
{
if (time < date)
{
@@ -85,7 +85,7 @@ public final class AuctionDateGenerator
return time;
}
private final void checkDayOfWeek(final int defaultValue)
private final void checkDayOfWeek(int defaultValue)
{
if ((_day_of_week < 1) || (_day_of_week > 7))
{
@@ -101,7 +101,7 @@ public final class AuctionDateGenerator
}
}
private final void checkHourOfDay(final int defaultValue)
private final void checkHourOfDay(int defaultValue)
{
if ((_hour_of_day < 0) || (_hour_of_day > 23))
{
@@ -113,7 +113,7 @@ public final class AuctionDateGenerator
}
}
private final void checkMinuteOfHour(final int defaultValue)
private final void checkMinuteOfHour(int defaultValue)
{
if ((_minute_of_hour < 0) || (_minute_of_hour > 59))
{
@@ -35,7 +35,7 @@ public final class AuctionItem
private final long _itemCount;
private final StatsSet _itemExtra;
public AuctionItem(final int auctionItemId, final int auctionLength, final long auctionInitBid, final int itemId, final long itemCount, final StatsSet itemExtra)
public AuctionItem(int auctionItemId, int auctionLength, long auctionInitBid, int itemId, long itemCount, StatsSet itemExtra)
{
_auctionItemId = auctionItemId;
_auctionLength = auctionLength;
@@ -67,12 +67,12 @@ public final class ItemAuction
private static final String DELETE_ITEM_AUCTION_BID = "DELETE FROM item_auction_bid WHERE auctionId = ? AND playerObjId = ?";
private static final String INSERT_ITEM_AUCTION_BID = "INSERT INTO item_auction_bid (auctionId, playerObjId, playerBid) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE playerBid = ?";
public ItemAuction(final int auctionId, final int instanceId, final long startingTime, final long endingTime, final AuctionItem auctionItem)
public ItemAuction(int auctionId, int instanceId, long startingTime, long endingTime, AuctionItem auctionItem)
{
this(auctionId, instanceId, startingTime, endingTime, auctionItem, new ArrayList<>(), ItemAuctionState.CREATED);
}
public ItemAuction(final int auctionId, final int instanceId, final long startingTime, final long endingTime, final AuctionItem auctionItem, final List<ItemAuctionBid> auctionBids, final ItemAuctionState auctionState)
public ItemAuction(int auctionId, int instanceId, long startingTime, long endingTime, AuctionItem auctionItem, List<ItemAuctionBid> auctionBids, ItemAuctionState auctionState)
{
_auctionId = auctionId;
_instanceId = instanceId;
@@ -110,7 +110,7 @@ public final class ItemAuction
return auctionState;
}
public final boolean setAuctionState(final ItemAuctionState expected, final ItemAuctionState wanted)
public final boolean setAuctionState(ItemAuctionState expected, ItemAuctionState wanted)
{
synchronized (_auctionStateLock)
{
@@ -210,20 +210,20 @@ public final class ItemAuction
}
}
public final int getAndSetLastBidPlayerObjectId(final int playerObjId)
public final int getAndSetLastBidPlayerObjectId(int playerObjId)
{
final int lastBid = _lastBidPlayerObjId;
_lastBidPlayerObjId = playerObjId;
return lastBid;
}
private final void updatePlayerBid(final ItemAuctionBid bid, final boolean delete)
private final void updatePlayerBid(ItemAuctionBid bid, boolean delete)
{
// TODO nBd maybe move such stuff to you db updater :D
updatePlayerBidInternal(bid, delete);
}
final void updatePlayerBidInternal(final ItemAuctionBid bid, final boolean delete)
final void updatePlayerBidInternal(ItemAuctionBid bid, boolean delete)
{
final String query = delete ? DELETE_ITEM_AUCTION_BID : INSERT_ITEM_AUCTION_BID;
try (Connection con = DatabaseFactory.getInstance().getConnection();
@@ -244,7 +244,7 @@ public final class ItemAuction
}
}
public final void registerBid(final L2PcInstance player, final long newBid)
public final void registerBid(L2PcInstance player, long newBid)
{
if (player == null)
{
@@ -325,7 +325,7 @@ public final class ItemAuction
}
}
private final void onPlayerBid(final L2PcInstance player, final ItemAuctionBid bid)
private final void onPlayerBid(L2PcInstance player, ItemAuctionBid bid)
{
if (_highestBid == null)
{
@@ -400,12 +400,12 @@ public final class ItemAuction
}
}
public final void broadcastToAllBidders(final L2GameServerPacket packet)
public final void broadcastToAllBidders(L2GameServerPacket packet)
{
ThreadPoolManager.getInstance().executeGeneral(() -> broadcastToAllBiddersInternal(packet));
}
public final void broadcastToAllBiddersInternal(final L2GameServerPacket packet)
public final void broadcastToAllBiddersInternal(L2GameServerPacket packet)
{
for (int i = _auctionBids.size(); i-- > 0;)
{
@@ -421,7 +421,7 @@ public final class ItemAuction
}
}
public final boolean cancelBid(final L2PcInstance player)
public final boolean cancelBid(L2PcInstance player)
{
if (player == null)
{
@@ -508,7 +508,7 @@ public final class ItemAuction
}
}
private final boolean reduceItemCount(final L2PcInstance player, final long count)
private final boolean reduceItemCount(L2PcInstance player, long count)
{
if (!player.reduceAdena("ItemAuction", count, player, true))
{
@@ -518,7 +518,7 @@ public final class ItemAuction
return true;
}
private final void increaseItemCount(final L2PcInstance player, final long count)
private final void increaseItemCount(L2PcInstance player, long count)
{
player.addAdena("ItemAuction", count, player, true);
}
@@ -528,19 +528,19 @@ public final class ItemAuction
* @param player The player that made the bid
* @return The last bid the player made or -1
*/
public final long getLastBid(final L2PcInstance player)
public final long getLastBid(L2PcInstance player)
{
final ItemAuctionBid bid = getBidFor(player.getObjectId());
return bid != null ? bid.getLastBid() : -1L;
}
public final ItemAuctionBid getBidFor(final int playerObjId)
public final ItemAuctionBid getBidFor(int playerObjId)
{
final int index = getBidIndexFor(playerObjId);
return index != -1 ? _auctionBids.get(index) : null;
}
private final int getBidIndexFor(final int playerObjId)
private final int getBidIndexFor(int playerObjId)
{
for (int i = _auctionBids.size(); i-- > 0;)
{
@@ -27,7 +27,7 @@ public final class ItemAuctionBid
private final int _playerObjId;
private long _lastBid;
public ItemAuctionBid(final int playerObjId, final long lastBid)
public ItemAuctionBid(int playerObjId, long lastBid)
{
_playerObjId = playerObjId;
_lastBid = lastBid;
@@ -43,7 +43,7 @@ public final class ItemAuctionBid
return _lastBid;
}
final void setLastBid(final long lastBid)
final void setLastBid(long lastBid)
{
_lastBid = lastBid;
}
@@ -77,7 +77,7 @@ public final class ItemAuctionInstance
private ItemAuction _nextAuction;
private ScheduledFuture<?> _stateTask;
public ItemAuctionInstance(final int instanceId, final AtomicInteger auctionIds, final Node node) throws Exception
public ItemAuctionInstance(int instanceId, AtomicInteger auctionIds, Node node) throws Exception
{
_instanceId = instanceId;
_auctionIds = auctionIds;
@@ -219,7 +219,7 @@ public final class ItemAuctionInstance
}
}
private final AuctionItem getAuctionItem(final int auctionItemId)
private final AuctionItem getAuctionItem(int auctionItemId)
{
for (int i = _items.size(); i-- > 0;)
{
@@ -344,12 +344,12 @@ public final class ItemAuctionInstance
}
}
public final ItemAuction getAuction(final int auctionId)
public final ItemAuction getAuction(int auctionId)
{
return _auctions.get(auctionId);
}
public final ItemAuction[] getAuctionsByBidder(final int bidderObjId)
public final ItemAuction[] getAuctionsByBidder(int bidderObjId)
{
final Collection<ItemAuction> auctions = getAuctions();
final ArrayList<ItemAuction> stack = new ArrayList<>(auctions.size());
@@ -383,7 +383,7 @@ public final class ItemAuctionInstance
{
private final ItemAuction _auction;
public ScheduleAuctionTask(final ItemAuction auction)
public ScheduleAuctionTask(ItemAuction auction)
{
_auction = auction;
}
@@ -479,7 +479,7 @@ public final class ItemAuctionInstance
}
}
final void onAuctionFinished(final ItemAuction auction)
final void onAuctionFinished(ItemAuction auction)
{
auction.broadcastToAllBiddersInternal(SystemMessage.getSystemMessage(SystemMessageId.S1_S_AUCTION_HAS_ENDED).addInt(auction.getAuctionId()));
@@ -514,7 +514,7 @@ public final class ItemAuctionInstance
}
}
final void setStateTask(final ScheduledFuture<?> future)
final void setStateTask(ScheduledFuture<?> future)
{
final ScheduledFuture<?> stateTask = _stateTask;
if (stateTask != null)
@@ -525,7 +525,7 @@ public final class ItemAuctionInstance
_stateTask = future;
}
private final ItemAuction createAuction(final long after)
private final ItemAuction createAuction(long after)
{
final AuctionItem auctionItem = _items.get(Rnd.get(_items.size()));
final long startingTime = _dateGenerator.nextDate(after);
@@ -535,7 +535,7 @@ public final class ItemAuctionInstance
return auction;
}
private final ItemAuction loadAuction(final int auctionId) throws SQLException
private final ItemAuction loadAuction(int auctionId) throws SQLException
{
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
@@ -27,7 +27,7 @@ public enum ItemAuctionState
private final byte _stateId;
private ItemAuctionState(final byte stateId)
private ItemAuctionState(byte stateId)
{
_stateId = stateId;
}
@@ -37,7 +37,7 @@ public enum ItemAuctionState
return _stateId;
}
public static final ItemAuctionState stateForStateId(final byte stateId)
public static final ItemAuctionState stateForStateId(byte stateId)
{
for (ItemAuctionState state : ItemAuctionState.values())
{
@@ -2469,7 +2469,7 @@ public final class L2ItemInstance extends L2Object
final int slot_id = rs.getInt("slot_id");
if (effect_id != 0)
{
SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effect_id);
final SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effect_id);
sco.setSlot(slot_id);
if (sco.isSpecial())
@@ -2495,7 +2495,7 @@ public final class L2ItemInstance extends L2Object
public void applySoulCrystalOptionEffect()
{
L2PcInstance owner = getActingPlayer();
final L2PcInstance owner = getActingPlayer();
if ((owner == null) || (!isEquipped()))
{
return;
@@ -2519,7 +2519,7 @@ public final class L2ItemInstance extends L2Object
public void removeSoulCrystalOptionEffect()
{
L2PcInstance owner = getActingPlayer();
final L2PcInstance owner = getActingPlayer();
if ((owner == null) || (isEquipped()))
{
return;
@@ -1030,7 +1030,7 @@ public final class Skill implements IIdentifiable
* @param player the player
* @return {@code true} if the player can use this skill, {@code false} otherwise
*/
public boolean canBeUseWhileRiding(final L2PcInstance player)
public boolean canBeUseWhileRiding(L2PcInstance player)
{
return (_rideState == null) || _rideState.contains(player.getMountType());
}
@@ -26,7 +26,7 @@ import com.l2jmobius.gameserver.model.zone.ZoneId;
*/
public class L2HqZone extends L2ZoneType
{
public L2HqZone(final int id)
public L2HqZone(int id)
{
super(id);
}
@@ -57,7 +57,7 @@ public class L2HqZone extends L2ZoneType
}
@Override
protected void onEnter(final L2Character character)
protected void onEnter(L2Character character)
{
if (character.isPlayer())
{
@@ -66,7 +66,7 @@ public class L2HqZone extends L2ZoneType
}
@Override
protected void onExit(final L2Character character)
protected void onExit(L2Character character)
{
if (character.isPlayer())
{
@@ -26,13 +26,13 @@ import com.l2jmobius.gameserver.model.zone.ZoneId;
*/
public class L2NoStoreZone extends L2ZoneType
{
public L2NoStoreZone(final int id)
public L2NoStoreZone(int id)
{
super(id);
}
@Override
protected void onEnter(final L2Character character)
protected void onEnter(L2Character character)
{
if (character.isPlayer())
{
@@ -41,7 +41,7 @@ public class L2NoStoreZone extends L2ZoneType
}
@Override
protected void onExit(final L2Character character)
protected void onExit(L2Character character)
{
if (character.isPlayer())
{
@@ -31,7 +31,7 @@ public class GameCrypt
System.arraycopy(key, 0, _outKey, 0, 16);
}
public void decrypt(byte[] raw, final int offset, final int size)
public void decrypt(byte[] raw, int offset, int size)
{
if (!_isEnabled)
{
@@ -59,7 +59,7 @@ public class GameCrypt
_inKey[11] = (byte) ((old >> 0x18) & 0xff);
}
public void encrypt(byte[] raw, final int offset, final int size)
public void encrypt(byte[] raw, int offset, int size)
{
if (!_isEnabled)
{
@@ -197,7 +197,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
}
@Override
public boolean encrypt(final ByteBuffer buf, final int size)
public boolean encrypt(ByteBuffer buf, int size)
{
_crypt.encrypt(buf.array(), buf.position(), size);
buf.position(buf.position() + size);
@@ -36264,7 +36264,7 @@ public final class NpcStringId
}
}
private static final int parseMessageParameters(final String name)
private static final int parseMessageParameters(String name)
{
int paramCount = 0;
char c1, c2;
@@ -36284,23 +36284,23 @@ public final class NpcStringId
return paramCount;
}
public static final NpcStringId getNpcStringId(final int id)
public static final NpcStringId getNpcStringId(int id)
{
return getNpcStringIdOrDefault(id, new NpcStringId(id));
}
public static final NpcStringId getNpcStringIdOrDefault(final int id, NpcStringId defaultValue)
public static final NpcStringId getNpcStringIdOrDefault(int id, NpcStringId defaultValue)
{
final NpcStringId nsi = getNpcStringIdInternal(id);
return nsi == null ? defaultValue : nsi;
}
private static final NpcStringId getNpcStringIdInternal(final int id)
private static final NpcStringId getNpcStringIdInternal(int id)
{
return VALUES.get(id);
}
public static final NpcStringId getNpcStringId(final String name)
public static final NpcStringId getNpcStringId(String name)
{
try
{
@@ -36415,7 +36415,7 @@ public final class NpcStringId
private NSLocalisation[] _localisations;
private ExShowScreenMessage _staticScreenMessage;
protected NpcStringId(final int id)
protected NpcStringId(int id)
{
_id = id;
_localisations = EMPTY_NSL_ARRAY;
@@ -36426,7 +36426,7 @@ public final class NpcStringId
return _id;
}
private final void setName(final String name)
private final void setName(String name)
{
_name = name;
}
@@ -36445,7 +36445,7 @@ public final class NpcStringId
* You better don`t touch this!
* @param params
*/
public final void setParamCount(final int params)
public final void setParamCount(int params)
{
if (params < 0)
{
@@ -36465,7 +36465,7 @@ public final class NpcStringId
_params = (byte) params;
}
public final NSLocalisation getLocalisation(final String lang)
public final NSLocalisation getLocalisation(String lang)
{
NSLocalisation nsl;
for (int i = _localisations.length; i-- > 0;)
@@ -36479,7 +36479,7 @@ public final class NpcStringId
return null;
}
public final void attachLocalizedText(final String lang, final String text)
public final void attachLocalizedText(String lang, String text)
{
final int length = _localisations.length;
final NSLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1);
@@ -36497,7 +36497,7 @@ public final class NpcStringId
return _staticScreenMessage;
}
public final void setStaticSystemMessage(final ExShowScreenMessage ns)
public final void setStaticSystemMessage(ExShowScreenMessage ns)
{
_staticScreenMessage = ns;
}
@@ -36513,7 +36513,7 @@ public final class NpcStringId
private final String _lang;
private final Builder _builder;
public NSLocalisation(final String lang, final String text)
public NSLocalisation(String lang, String text)
{
_lang = lang;
_builder = Builder.newBuilder(text);
@@ -36524,7 +36524,7 @@ public final class NpcStringId
return _lang;
}
public final String getLocalisation(final Object... params)
public final String getLocalisation(Object... params)
{
return _builder.toString(params);
}
@@ -15206,7 +15206,7 @@ public final class SystemMessageId
}
}
private static final int parseMessageParameters(final String name)
private static final int parseMessageParameters(String name)
{
int paramCount = 0;
char c1, c2;
@@ -15226,18 +15226,18 @@ public final class SystemMessageId
return paramCount;
}
public static final SystemMessageId getSystemMessageId(final int id)
public static final SystemMessageId getSystemMessageId(int id)
{
final SystemMessageId smi = getSystemMessageIdInternal(id);
return smi == null ? new SystemMessageId(id) : smi;
}
private static final SystemMessageId getSystemMessageIdInternal(final int id)
private static final SystemMessageId getSystemMessageIdInternal(int id)
{
return VALUES.get(id);
}
public static final SystemMessageId getSystemMessageId(final String name)
public static final SystemMessageId getSystemMessageId(String name)
{
try
{
@@ -15352,7 +15352,7 @@ public final class SystemMessageId
private SMLocalisation[] _localisations;
private SystemMessage _staticSystemMessage;
private SystemMessageId(final int id)
private SystemMessageId(int id)
{
_id = id;
_localisations = EMPTY_SML_ARRAY;
@@ -15363,7 +15363,7 @@ public final class SystemMessageId
return _id;
}
private final void setName(final String name)
private final void setName(String name)
{
_name = name;
}
@@ -15382,7 +15382,7 @@ public final class SystemMessageId
* You better don`t touch this!
* @param params
*/
public final void setParamCount(final int params)
public final void setParamCount(int params)
{
if (params < 0)
{
@@ -15402,7 +15402,7 @@ public final class SystemMessageId
_params = (byte) params;
}
public final SMLocalisation getLocalisation(final String lang)
public final SMLocalisation getLocalisation(String lang)
{
SMLocalisation sml;
for (int i = _localisations.length; i-- > 0;)
@@ -15416,7 +15416,7 @@ public final class SystemMessageId
return null;
}
public final void attachLocalizedText(final String lang, final String text)
public final void attachLocalizedText(String lang, String text)
{
final int length = _localisations.length;
final SMLocalisation[] localisations = Arrays.copyOf(_localisations, length + 1);
@@ -15434,7 +15434,7 @@ public final class SystemMessageId
return _staticSystemMessage;
}
public final void setStaticSystemMessage(final SystemMessage sm)
public final void setStaticSystemMessage(SystemMessage sm)
{
_staticSystemMessage = sm;
}
@@ -15450,7 +15450,7 @@ public final class SystemMessageId
private final String _lang;
private final Builder _builder;
public SMLocalisation(final String lang, final String text)
public SMLocalisation(String lang, String text)
{
_lang = lang;
_builder = Builder.newBuilder(text);
@@ -15461,7 +15461,7 @@ public final class SystemMessageId
return _lang;
}
public final String getLocalisation(final Object... params)
public final String getLocalisation(Object... params)
{
return _builder.toString(params);
}
@@ -1656,7 +1656,7 @@ public final class RequestActionUse extends L2GameClientPacket
* Perform a couple social action.
* @param id the couple social action Id
*/
private void useCoupleSocial(final int id)
private void useCoupleSocial(int id)
{
final L2PcInstance requester = getActiveChar();
if (requester == null)
@@ -281,7 +281,7 @@ public class RequestExEnchantItemAttribute extends L2GameClientPacket
player.sendPacket(iu);
}
private int addElement(final L2PcInstance player, final L2ItemInstance stone, final L2ItemInstance item, byte elementToAdd)
private int addElement(L2PcInstance player, L2ItemInstance stone, L2ItemInstance item, byte elementToAdd)
{
final Elementals oldElement = item.getElemental(elementToAdd);
final int elementValue = oldElement == null ? 0 : oldElement.getValue();
@@ -108,7 +108,7 @@ public final class RequestRestartPoint extends L2GameClientPacket
portPlayer(activeChar);
}
protected final void portPlayer(final L2PcInstance activeChar)
protected final void portPlayer(L2PcInstance activeChar)
{
Location loc = null;
Castle castle = null;
@@ -55,7 +55,7 @@ public class RequestItemEnsoul extends L2GameClientPacket
final int SCObjectId = readD(); // Soul Crystal objectId
final int effectId = readD(); // EffectId
SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effectId);
final SoulCrystalOption sco = SoulCrystalOptionsData.getInstance().getByEffectId(effectId);
sco.setSoulCrystalObjectId(SCObjectId);
sco.setSpecial(special);
sco.setSlot(slot);
@@ -57,7 +57,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
private final byte _type;
private final Object _value;
public SMParam(final byte type, final Object value)
public SMParam(byte type, Object value)
{
_type = type;
_value = value;
@@ -148,7 +148,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
_params[_paramIndex++] = param;
}
public final T addString(final String text)
public final T addString(String text)
{
append(new SMParam(TYPE_TEXT, text));
return (T) this;
@@ -173,25 +173,25 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param number the conquerable entity
* @return the system message with the proper parameter
*/
public final T addCastleId(final int number)
public final T addCastleId(int number)
{
append(new SMParam(TYPE_CASTLE_NAME, number));
return (T) this;
}
public final T addInt(final int number)
public final T addInt(int number)
{
append(new SMParam(TYPE_INT_NUMBER, number));
return (T) this;
}
public final T addLong(final long number)
public final T addLong(long number)
{
append(new SMParam(TYPE_LONG_NUMBER, number));
return (T) this;
}
public final T addCharName(final L2Character cha)
public final T addCharName(L2Character cha)
{
if (cha.isNpc())
{
@@ -223,7 +223,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addString(cha.getName());
}
public final T addPcName(final L2PcInstance pc)
public final T addPcName(L2PcInstance pc)
{
append(new SMParam(TYPE_PLAYER_NAME, pc.getAppearance().getVisibleName()));
return (T) this;
@@ -245,12 +245,12 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addNpcName(npc.getTemplate());
}
public final T addNpcName(final L2Summon npc)
public final T addNpcName(L2Summon npc)
{
return addNpcName(npc.getId());
}
public final T addNpcName(final L2NpcTemplate template)
public final T addNpcName(L2NpcTemplate template)
{
if (template.isUsingServerSideName())
{
@@ -259,23 +259,23 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addNpcName(template.getId());
}
public final T addNpcName(final int id)
public final T addNpcName(int id)
{
append(new SMParam(TYPE_NPC_NAME, 1000000 + id));
return (T) this;
}
public T addItemName(final L2ItemInstance item)
public T addItemName(L2ItemInstance item)
{
return addItemName(item.getId());
}
public T addItemName(final L2Item item)
public T addItemName(L2Item item)
{
return addItemName(item.getId());
}
public final T addItemName(final int id)
public final T addItemName(int id)
{
final L2Item item = ItemTable.getInstance().getTemplate(id);
if (item.getDisplayId() != id)
@@ -287,7 +287,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return (T) this;
}
public final T addZoneName(final int x, final int y, final int z)
public final T addZoneName(int x, int y, int z)
{
append(new SMParam(TYPE_ZONE_NAME, new int[]
{
@@ -298,7 +298,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return (T) this;
}
public final T addSkillName(final Skill skill)
public final T addSkillName(Skill skill)
{
if (skill.getId() != skill.getDisplayId())
{
@@ -307,12 +307,12 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
return addSkillName(skill.getId(), skill.getLevel());
}
public final T addSkillName(final int id)
public final T addSkillName(int id)
{
return addSkillName(id, 1);
}
public final T addSkillName(final int id, final int lvl)
public final T addSkillName(int id, int lvl)
{
append(new SMParam(TYPE_SKILL_NAME, new int[]
{
@@ -327,7 +327,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type
* @return
*/
public final T addElemental(final int type)
public final T addElemental(int type)
{
append(new SMParam(TYPE_ELEMENT_NAME, type));
return (T) this;
@@ -338,7 +338,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type
* @return
*/
public final T addSystemString(final int type)
public final T addSystemString(int type)
{
append(new SMParam(TYPE_SYSTEM_STRING, type));
return (T) this;
@@ -349,7 +349,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type
* @return
*/
public final T addClassId(final int type)
public final T addClassId(int type)
{
append(new SMParam(TYPE_CLASS_ID, type));
return (T) this;
@@ -371,7 +371,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
* @param type id of instance
* @return
*/
public final T addInstanceName(final int type)
public final T addInstanceName(int type)
{
append(new SMParam(TYPE_INSTANCE_NAME, type));
return (T) this;
@@ -530,7 +530,7 @@ public abstract class AbstractMessagePacket<T extends AbstractMessagePacket<?>>e
}
}
public final T getLocalizedMessage(final String lang)
public final T getLocalizedMessage(String lang)
{
if (!Config.L2JMOD_MULTILANG_SM_ENABLE || (getSystemMessageId() == SystemMessageId.S13))
{
@@ -20,7 +20,7 @@ public final class CSShowComBoard extends L2GameServerPacket
{
private final byte[] _html;
public CSShowComBoard(final byte[] html)
public CSShowComBoard(byte[] html)
{
_html = html;
}
@@ -147,7 +147,7 @@ public final class ExBasicActionList extends L2GameServerPacket
private final int[] _actionIds;
public ExBasicActionList(final int[] actionIds)
public ExBasicActionList(int[] actionIds)
{
_actionIds = actionIds;
}
@@ -30,7 +30,7 @@ public final class ExItemAuctionInfoPacket extends AbstractItemPacket
private final ItemAuction _currentAuction;
private final ItemAuction _nextAuction;
public ExItemAuctionInfoPacket(final boolean refresh, final ItemAuction currentAuction, final ItemAuction nextAuction)
public ExItemAuctionInfoPacket(boolean refresh, ItemAuction currentAuction, ItemAuction nextAuction)
{
if (currentAuction == null)
{
@@ -23,12 +23,12 @@ import com.l2jmobius.gameserver.network.SystemMessageId;
*/
public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
{
private SystemMessage(final SystemMessageId smId)
private SystemMessage(SystemMessageId smId)
{
super(smId);
}
public static final SystemMessage sendString(final String text)
public static final SystemMessage sendString(String text)
{
if (text == null)
{
@@ -40,7 +40,7 @@ public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
return sm;
}
public static final SystemMessage getSystemMessage(final SystemMessageId smId)
public static final SystemMessage getSystemMessage(SystemMessageId smId)
{
SystemMessage sm = smId.getStaticSystemMessage();
if (sm != null)
@@ -73,7 +73,7 @@ public final class SystemMessage extends AbstractMessagePacket<SystemMessage>
* @deprecated
*/
@Deprecated
private SystemMessage(final int id)
private SystemMessage(int id)
{
this(SystemMessageId.getSystemMessageId(id));
}
@@ -57,7 +57,7 @@ public class ExBRBuyProduct extends L2GameServerPacket
private final int _reply;
public ExBRBuyProduct(final ExBrProductReplyType type)
public ExBRBuyProduct(ExBrProductReplyType type)
{
_reply = type.getId();
}
@@ -27,7 +27,7 @@ public class ExBRGamePoint extends L2GameServerPacket
private final int _charId;
private final int _charPoints;
public ExBRGamePoint(final L2PcInstance player)
public ExBRGamePoint(L2PcInstance player)
{
_charId = player.getObjectId();
_charPoints = player.getPrimePoints();
@@ -69,7 +69,7 @@ public final class FloodProtectorAction
* @param client the game client for which flood protection is being created
* @param config flood protector configuration
*/
public FloodProtectorAction(final L2GameClient client, final FloodProtectorConfig config)
public FloodProtectorAction(L2GameClient client, FloodProtectorConfig config)
{
super();
_client = client;
@@ -81,7 +81,7 @@ public final class FloodProtectorAction
* @param command command issued or short command description
* @return true if action is allowed, otherwise false
*/
public boolean tryPerformAction(final String command)
public boolean tryPerformAction(String command)
{
final int curTick = GameTimeController.getInstance().getGameTicks();
@@ -51,7 +51,7 @@ public final class FloodProtectorConfig
* Creates new instance of FloodProtectorConfig.
* @param floodProtectorType {@link #FLOOD_PROTECTOR_TYPE}
*/
public FloodProtectorConfig(final String floodProtectorType)
public FloodProtectorConfig(String floodProtectorType)
{
super();
FLOOD_PROTECTOR_TYPE = floodProtectorType;
@@ -94,7 +94,7 @@ public final class FloodProtectors
* Creates new instance of FloodProtectors.
* @param client game client for which the collection of flood protectors is being created.
*/
public FloodProtectors(final L2GameClient client)
public FloodProtectors(L2GameClient client)
{
super();
_useItem = new FloodProtectorAction(client, Config.FLOOD_PROTECTOR_USE_ITEM);
@@ -71,7 +71,7 @@ public class MinionList
* <BR>
* @param minions
*/
public final void spawnMinions(final List<MinionHolder> minions)
public final void spawnMinions(List<MinionHolder> minions)
{
if (_master.isAlikeDead())
{
@@ -28,7 +28,7 @@ public final class AccountInfo
private final int _accessLevel;
private final int _lastServer;
public AccountInfo(final String login, final String passHash, final int accessLevel, final int lastServer)
public AccountInfo(String login, String passHash, int accessLevel, int lastServer)
{
Objects.requireNonNull(login, "login");
Objects.requireNonNull(passHash, "passHash");
@@ -48,7 +48,7 @@ public final class AccountInfo
_lastServer = lastServer;
}
public boolean checkPassHash(final String passHash)
public boolean checkPassHash(String passHash)
{
return _passHash.equals(passHash);
}
@@ -98,7 +98,7 @@ public abstract class BaseGameServerRegister
{
try (Connection con = DatabaseFactory.getInstance().getConnection();
PreparedStatement ps = con.prepareStatement("DELETE FROM gameservers WHERE server_id = ?"))
{
ps.setInt(1, id);
ps.executeUpdate();
+8 -8
View File
@@ -51,7 +51,7 @@ public class HexUtils
* @param data byte to generate the hexadecimal character presentation from
* @return a new char array with exactly 2 elements
*/
public static char[] b2HexChars(final byte data)
public static char[] b2HexChars(byte data)
{
return b2HexChars(data, null, 0);
}
@@ -63,7 +63,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to
*/
public static char[] b2HexChars(final byte data, char[] dstHexChars, int dstOffset)
public static char[] b2HexChars(byte data, char[] dstHexChars, int dstOffset)
{
if (dstHexChars == null)
{
@@ -84,7 +84,7 @@ public class HexUtils
* @param data integer to generate the hexadecimal character presentation from
* @return new char array with 8 elements
*/
public static char[] int2HexChars(final int data)
public static char[] int2HexChars(int data)
{
return int2HexChars(data, new char[8], 0);
}
@@ -96,7 +96,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to
*/
public static char[] int2HexChars(final int data, char[] dstHexChars, int dstOffset)
public static char[] int2HexChars(int data, char[] dstHexChars, int dstOffset)
{
if (dstHexChars == null)
{
@@ -119,7 +119,7 @@ public class HexUtils
* @param len number of bytes to generate the hexadecimal character presentation from
* @return a new char array with len*2 elements
*/
public static char[] bArr2HexChars(final byte[] data, final int offset, final int len)
public static char[] bArr2HexChars(byte[] data, int offset, int len)
{
return bArr2HexChars(data, offset, len, null, 0);
}
@@ -133,7 +133,7 @@ public class HexUtils
* @param dstOffset offset at which the hexadecimal character presentation is copied to dstHexChars
* @return the char array the hexadecimal character presentation was copied to
*/
public static char[] bArr2HexChars(final byte[] data, final int offset, final int len, char[] dstHexChars, int dstOffset)
public static char[] bArr2HexChars(byte[] data, int offset, int len, char[] dstHexChars, int dstOffset)
{
if (dstHexChars == null)
{
@@ -152,12 +152,12 @@ public class HexUtils
return dstHexChars;
}
public static char[] bArr2AsciiChars(byte[] data, final int offset, final int len)
public static char[] bArr2AsciiChars(byte[] data, int offset, int len)
{
return bArr2AsciiChars(data, offset, len, new char[len], 0);
}
public static char[] bArr2AsciiChars(byte[] data, final int offset, final int len, char[] dstAsciiChars, int dstOffset)
public static char[] bArr2AsciiChars(byte[] data, int offset, int len, char[] dstAsciiChars, int dstOffset)
{
if (dstAsciiChars == null)
{
+20 -20
View File
@@ -40,19 +40,19 @@ public final class Rnd
this(++SEED_UNIQUIFIER + System.nanoTime());
}
public NonAtomicRandom(final long seed)
public NonAtomicRandom(long seed)
{
setSeed(seed);
}
@Override
public final int next(final int bits)
public final int next(int bits)
{
return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits));
}
@Override
public final void setSeed(final long seed)
public final void setSeed(long seed)
{
_seed = (seed ^ MULTIPLIER) & MASK;
}
@@ -65,7 +65,7 @@ public final class Rnd
{
private final Random _random;
protected RandomContainer(final Random random)
protected RandomContainer(Random random)
{
_random = random;
}
@@ -90,7 +90,7 @@ public final class Rnd
* @param n The superior limit (exclusive)
* @return A random integer number from 0 to n-1
*/
public final int get(final int n)
public final int get(int n)
{
return (int) (_random.nextDouble() * n);
}
@@ -101,7 +101,7 @@ public final class Rnd
* @param max The maximum value
* @return A random integer number from min to max
*/
public final int get(final int min, final int max)
public final int get(int min, int max)
{
return min + (int) (_random.nextDouble() * ((max - min) + 1));
}
@@ -112,7 +112,7 @@ public final class Rnd
* @param max The maximum value
* @return A random long number from min to max
*/
public final long get(final long min, final long max)
public final long get(long min, long max)
{
return min + (long) (_random.nextDouble() * ((max - min) + 1));
}
@@ -132,7 +132,7 @@ public final class Rnd
* @param array The array to be filled with random byte numbers
* @see java.util.Random#nextBytes(byte[] bytes)
*/
public final void nextBytes(final byte[] array)
public final void nextBytes(byte[] array)
{
_random.nextBytes(array);
}
@@ -235,17 +235,17 @@ public final class Rnd
{
long _seed;
Seed(final long seed)
Seed(long seed)
{
setSeed(seed);
}
final int next(final int bits)
final int next(int bits)
{
return (int) ((_seed = ((_seed * MULTIPLIER) + ADDEND) & MASK) >>> (48 - bits));
}
final void setSeed(final long seed)
final void setSeed(long seed)
{
_seed = (seed ^ MULTIPLIER) & MASK;
}
@@ -265,7 +265,7 @@ public final class Rnd
};
}
public ThreadLocalRandom(final long seed)
public ThreadLocalRandom(long seed)
{
_seedLocal = new ThreadLocal<Seed>()
{
@@ -278,13 +278,13 @@ public final class Rnd
}
@Override
public final int next(final int bits)
public final int next(int bits)
{
return _seedLocal.get().next(bits);
}
@Override
public final void setSeed(final long seed)
public final void setSeed(long seed)
{
if (_seedLocal != null)
{
@@ -323,7 +323,7 @@ public final class Rnd
* @param n The superior limit (exclusive)
* @return A random integer number from 0 to n-1
*/
public static final int get(final int n)
public static final int get(int n)
{
return rnd.get(n);
}
@@ -334,7 +334,7 @@ public final class Rnd
* @param max The maximum value
* @return A random integer number from min to max
*/
public static final int get(final int min, final int max)
public static final int get(int min, int max)
{
return rnd.get(min, max);
}
@@ -345,12 +345,12 @@ public final class Rnd
* @param max The maximum value
* @return A random long number from min to max
*/
public static final long get(final long min, final long max)
public static final long get(long min, long max)
{
return rnd.get(min, max);
}
public static final RandomContainer newInstance(final RandomType type)
public static final RandomContainer newInstance(RandomType type)
{
switch (type)
{
@@ -390,7 +390,7 @@ public final class Rnd
* @param array The array to be filled with random byte numbers
* @see java.util.Random#nextBytes(byte[] bytes)
*/
public static final void nextBytes(final byte[] array)
public static final void nextBytes(byte[] array)
{
rnd.nextBytes(array);
}
@@ -440,7 +440,7 @@ public final class Rnd
* @return
* @see com.l2jmobius.util.Rnd#get(int n)
*/
public static final int nextInt(final int n)
public static final int nextInt(int n)
{
return get(n);
}
@@ -197,7 +197,7 @@ public final class StringUtil
* @param strings strings to be concatenated
* @return concatenated string
*/
public static String concat(final String... strings)
public static String concat(String... strings)
{
final StringBuilder sbString = new StringBuilder();
for (String string : strings)
@@ -213,7 +213,7 @@ public final class StringUtil
* @param strings strings to be appended
* @return created string builder
*/
public static StringBuilder startAppend(final int sizeHint, final String... strings)
public static StringBuilder startAppend(int sizeHint, String... strings)
{
final int length = getLength(strings);
final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length);
@@ -229,7 +229,7 @@ public final class StringUtil
* @param sbString string builder
* @param strings strings to be appended
*/
public static void append(final StringBuilder sbString, final String... strings)
public static void append(StringBuilder sbString, String... strings)
{
sbString.ensureCapacity(sbString.length() + getLength(strings));
@@ -239,7 +239,7 @@ public final class StringUtil
}
}
public static int getLength(final Iterable<String> strings)
public static int getLength(Iterable<String> strings)
{
int length = 0;
for (String string : strings)
@@ -254,7 +254,7 @@ public final class StringUtil
* @param strings array of strings
* @return total length of all the strings
*/
public static int getLength(final String[] strings)
public static int getLength(String[] strings)
{
int length = 0;
for (String string : strings)
@@ -1215,7 +1215,7 @@ public final class BlowfishEngine
* @throws IllegalStateException The cipher was not yet initialized
* @throws IOException The source array is too small to hold a block at the given index
*/
public void tryEncryptBlock(byte[] src, final int srcIndex) throws IOException
public void tryEncryptBlock(byte[] src, int srcIndex) throws IOException
{
if (workingKey == null)
{
@@ -1239,7 +1239,7 @@ public final class BlowfishEngine
* @throws IllegalStateException The cipher was not yet initialized
* @throws IOException The source or destination array is too small to hold a block at the given index
*/
public void tryEncryptBlock(final byte[] src, final int srcIndex, byte[] dst, final int dstIndex) throws IOException
public void tryEncryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex) throws IOException
{
if (workingKey == null)
{
@@ -1269,7 +1269,7 @@ public final class BlowfishEngine
* @param src source array with the plain data
* @param srcIndex index where the block to encrypt is located
*/
public void encryptBlock(byte[] src, final int srcIndex)
public void encryptBlock(byte[] src, int srcIndex)
{
encryptBlock(src, srcIndex, src, srcIndex);
}
@@ -1288,7 +1288,7 @@ public final class BlowfishEngine
* @param dst destination array the encryption will go to
* @param dstIndex index where the encrypted block is to be stored
*/
public void encryptBlock(final byte[] src, final int srcIndex, byte[] dst, final int dstIndex)
public void encryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
{
int xl = bytesTo32bits(src, srcIndex);
int xr = bytesTo32bits(src, srcIndex + 4);
@@ -1325,7 +1325,7 @@ public final class BlowfishEngine
* @throws IllegalStateException The cipher was not yet initialized
* @throws IOException The source array is too small to hold a block at the given index
*/
public void tryDecryptBlock(byte[] src, final int srcIndex) throws IOException
public void tryDecryptBlock(byte[] src, int srcIndex) throws IOException
{
if (workingKey == null)
{
@@ -1348,7 +1348,7 @@ public final class BlowfishEngine
* @throws IllegalStateException The cipher was not yet initialized
* @throws IOException The source or destination array is too small to hold a block at the given index
*/
public void tryDecryptBlock(final byte[] src, final int srcIndex, byte[] dst, final int dstIndex) throws IOException
public void tryDecryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex) throws IOException
{
if (workingKey == null)
{
@@ -1378,7 +1378,7 @@ public final class BlowfishEngine
* @param src source array with the encrypted data
* @param srcIndex index where the block to decrypt is located
*/
public void decryptBlock(byte[] src, final int srcIndex)
public void decryptBlock(byte[] src, int srcIndex)
{
decryptBlock(src, srcIndex, src, srcIndex);
}
@@ -1398,7 +1398,7 @@ public final class BlowfishEngine
* @param dstIndex index where the decrypted block is to be stored
* @throws IllegalStateException The cipher was not yet initialized
*/
public void decryptBlock(final byte[] src, final int srcIndex, byte[] dst, final int dstIndex)
public void decryptBlock(byte[] src, int srcIndex, byte[] dst, int dstIndex)
{
int xl = bytesTo32bits(src, srcIndex);
int xr = bytesTo32bits(src, srcIndex + 4);
@@ -66,7 +66,7 @@ public class LoginCrypt
* @return true when checksum could be verified, false otherwise
* @throws IOException the size is not multiple of blowfishs block size or the raw array can't hold size bytes starting at offset due to it's size
*/
public boolean decrypt(byte[] raw, final int offset, final int size) throws IOException
public boolean decrypt(byte[] raw, int offset, int size) throws IOException
{
if ((size % 8) != 0)
{
@@ -90,7 +90,7 @@ public class LoginCrypt
* @return the new array size
* @throws IOException packet is too long to make padding and add verification data
*/
public int encrypt(byte[] raw, final int offset, int size) throws IOException
public int encrypt(byte[] raw, int offset, int size) throws IOException
{
// reserve checksum
size += 4;
@@ -47,7 +47,7 @@ public final class NewCrypt
* @param raw data array to be verified
* @return true when the checksum of the data is valid, false otherwise
*/
public static boolean verifyChecksum(final byte[] raw)
public static boolean verifyChecksum(byte[] raw)
{
return NewCrypt.verifyChecksum(raw, 0, raw.length);
}
@@ -60,7 +60,7 @@ public final class NewCrypt
* @param size number of bytes to verify
* @return true if the checksum of the data is valid, false otherwise
*/
public static boolean verifyChecksum(final byte[] raw, final int offset, final int size)
public static boolean verifyChecksum(byte[] raw, int offset, int size)
{
// check if size is multiple of 4 and if there is more then only the checksum
if (((size & 3) != 0) || (size <= 4))
@@ -95,7 +95,7 @@ public final class NewCrypt
* Equivalent to calling {@link #appendChecksum(byte[], int, int)} with parameters (raw, 0, raw.length)
* @param raw data array to compute the checksum from
*/
public static void appendChecksum(final byte[] raw)
public static void appendChecksum(byte[] raw)
{
NewCrypt.appendChecksum(raw, 0, raw.length);
}
@@ -106,7 +106,7 @@ public final class NewCrypt
* @param offset offset where to start in the data array
* @param size number of bytes to compute the checksum from
*/
public static void appendChecksum(final byte[] raw, final int offset, final int size)
public static void appendChecksum(byte[] raw, int offset, int size)
{
long chksum = 0;
final int count = size - 4;
@@ -153,7 +153,7 @@ public final class NewCrypt
* @param size Length of the data to be encrypted
* @param key The 4 bytes (int) XOR key
*/
static void encXORPass(byte[] raw, final int offset, final int size, int key)
static void encXORPass(byte[] raw, int offset, int size, int key)
{
final int stop = size - 8;
int pos = 4 + offset;
@@ -192,7 +192,7 @@ public final class NewCrypt
* @param offset the offset at which to start decrypting
* @param size the number of bytes to be decrypted
*/
public void decrypt(byte[] raw, final int offset, final int size)
public void decrypt(byte[] raw, int offset, int size)
{
for (int i = offset; i < (offset + size); i += 8)
{
@@ -208,7 +208,7 @@ public final class NewCrypt
* @param offset the offset at which to start decrypting
* @param size the number of bytes to be decrypted
*/
public void crypt(byte[] raw, final int offset, final int size)
public void crypt(byte[] raw, int offset, int size)
{
for (int i = offset; i < (offset + size); i += 8)
{