Backward compatibility changes for Java 8.
This commit is contained in:
@@ -27,6 +27,9 @@ public class Rnd
|
||||
* Thread-specific random number generator.<br>
|
||||
* Each is seeded with the thread ID, so the sequence of random numbers are unique between threads.
|
||||
*/
|
||||
// Java 1.8
|
||||
// private static ThreadLocal<Random> RANDOM = new ThreadLocal<Random>()
|
||||
// Java 10
|
||||
private static ThreadLocal<Random> RANDOM = new ThreadLocal<>()
|
||||
{
|
||||
@Override
|
||||
|
@@ -29,8 +29,8 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
*/
|
||||
public class WarehouseCacheManager
|
||||
{
|
||||
private static final Map<PlayerInstance, Long> CACHED_WH = new ConcurrentHashMap<>();
|
||||
private static final long CACHE_TIME = Config.WAREHOUSE_CACHE_TIME * 60000;
|
||||
protected static final Map<PlayerInstance, Long> CACHED_WH = new ConcurrentHashMap<>();
|
||||
protected static final long CACHE_TIME = Config.WAREHOUSE_CACHE_TIME * 60000;
|
||||
|
||||
protected WarehouseCacheManager()
|
||||
{
|
||||
@@ -49,6 +49,10 @@ public class WarehouseCacheManager
|
||||
|
||||
private class CacheScheduler implements Runnable
|
||||
{
|
||||
public CacheScheduler()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
@@ -56,7 +56,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
public class BotReportTable
|
||||
{
|
||||
// Zoey76: TODO: Split XML parsing from SQL operations, use IGameXmlReader instead of SAXParser.
|
||||
private static final Logger LOGGER = Logger.getLogger(BotReportTable.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(BotReportTable.class.getName());
|
||||
|
||||
private static final int COLUMN_BOT_ID = 1;
|
||||
private static final int COLUMN_REPORTER_ID = 2;
|
||||
@@ -609,6 +609,10 @@ public class BotReportTable
|
||||
|
||||
private class ResetPointTask implements Runnable
|
||||
{
|
||||
public ResetPointTask()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
@@ -155,6 +155,10 @@ public class FortCommanderInstance extends DefenderInstance
|
||||
|
||||
private class ScheduleTalkTask implements Runnable
|
||||
{
|
||||
public ScheduleTalkTask()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
|
@@ -74,6 +74,9 @@ public class EventMethodNotification
|
||||
|
||||
private void invoke(Object instance) throws Exception
|
||||
{
|
||||
// Java 1.8
|
||||
// final boolean wasAccessible = _method.isAccessible();
|
||||
// Java 10
|
||||
final boolean wasAccessible = _method.canAccess(instance);
|
||||
if (!wasAccessible)
|
||||
{
|
||||
|
@@ -60,7 +60,7 @@ public class LongTimeEvent extends Quest
|
||||
// Messages
|
||||
protected String _onEnterMsg = "";
|
||||
protected String _endMsg = "";
|
||||
private int _enterAnnounceId = -1;
|
||||
protected int _enterAnnounceId = -1;
|
||||
|
||||
protected DateRange _eventPeriod = null;
|
||||
protected DateRange _dropPeriod;
|
||||
|
@@ -24,12 +24,12 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
|
||||
|
||||
public class QuestTimer
|
||||
{
|
||||
private final String _name;
|
||||
private final Quest _quest;
|
||||
private final Npc _npc;
|
||||
private final PlayerInstance _player;
|
||||
private final boolean _isRepeating;
|
||||
private ScheduledFuture<?> _scheduler;
|
||||
protected final String _name;
|
||||
protected final Quest _quest;
|
||||
protected final Npc _npc;
|
||||
protected final PlayerInstance _player;
|
||||
protected final boolean _isRepeating;
|
||||
protected ScheduledFuture<?> _scheduler;
|
||||
|
||||
public QuestTimer(Quest quest, String name, long time, Npc npc, PlayerInstance player, boolean repeating)
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ public class ExEnterWorld implements IClientOutgoingPacket
|
||||
_epochInSeconds = (int) now.getEpochSecond();
|
||||
ZoneRules rules = ZoneId.systemDefault().getRules();
|
||||
_zoneIdOffsetSeconds = rules.getStandardOffset(now).getTotalSeconds();
|
||||
_daylight = (int) rules.getDaylightSavings(now).toSeconds();
|
||||
_daylight = (int) (rules.getDaylightSavings(now).toMillis() / 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -40,9 +40,9 @@ import org.l2jmobius.gameserver.util.Locator;
|
||||
*/
|
||||
public class SystemPanel extends JPanel
|
||||
{
|
||||
private static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
|
||||
protected static final Logger LOGGER = Logger.getLogger(SystemPanel.class.getName());
|
||||
|
||||
private static final long START_TIME = System.currentTimeMillis();
|
||||
protected static final long START_TIME = System.currentTimeMillis();
|
||||
|
||||
public SystemPanel()
|
||||
{
|
||||
|
@@ -49,6 +49,10 @@ public class DocumentItem extends DocumentBase implements IXmlReader
|
||||
|
||||
private class DocumentItemDataHolder
|
||||
{
|
||||
public DocumentItemDataHolder()
|
||||
{
|
||||
}
|
||||
|
||||
int id;
|
||||
String type;
|
||||
StatSet set;
|
||||
|
@@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.holders.MinionHolder;
|
||||
*/
|
||||
public class MinionList
|
||||
{
|
||||
private final MonsterInstance _master;
|
||||
protected final MonsterInstance _master;
|
||||
private final List<MonsterInstance> _spawnedMinions = new CopyOnWriteArrayList<>();
|
||||
private final List<ScheduledFuture<?>> _respawnTasks = new CopyOnWriteArrayList<>();
|
||||
|
||||
|
Reference in New Issue
Block a user