From 5cf19ac6d08e8d066aec30740743ac5dcec245bf Mon Sep 17 00:00:00 2001
From: HorridoJoho <HorridoJoho@users.noreply.github.com>
Date: Fri, 24 Jun 2016 15:39:06 +0200
Subject: [PATCH] Syntax: Fixing illegal FlagWar.super expression.

Using super to get the this reference as a reference of the type of the
super class is not valid. According to java documentation super can be
used to access members and methods of it's super class. Using it to get
a reference to the current class is not documented. In the past ECJ
allowed this expression and hapilly compiled. But tests one year ago has
shown that the JDK compiler in tools.jar was reporting it as an error.
Now as reported @Sacrifice, the last update of Eclipse also complains
about this, so this expression is now removed and the code a little bit
cleaned using a lambda instead of inner class.

Reported By: @Sacrifice
Patch By: @Sacrifice, @HorridoJoho
---
 .../conquerablehalls/flagwar/FlagWar.java     | 29 ++++---------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java b/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
index a5b00b7757..9335168c75 100644
--- a/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
+++ b/dist/game/data/scripts/conquerablehalls/flagwar/FlagWar.java
@@ -42,7 +42,6 @@ import com.l2jserver.gameserver.model.Location;
 import com.l2jserver.gameserver.model.TeleportWhereType;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.entity.Siegable;
 import com.l2jserver.gameserver.model.entity.clanhall.ClanHallSiegeEngine;
 import com.l2jserver.gameserver.model.entity.clanhall.SiegeStatus;
 import com.l2jserver.gameserver.model.zone.type.L2ResidenceHallTeleportZone;
@@ -417,7 +416,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
 							}
 							
 							_hall.getSiegeZone().setIsActive(true);
-						}, 300000);
+						} , 300000);
 					}
 				}
 				else
@@ -500,25 +499,9 @@ public abstract class FlagWar extends ClanHallSiegeEngine
 			}
 		}
 		
-		// Schedule open doors closement and siege start in 2 minutes
-		ThreadPoolManager.getInstance().scheduleGeneral(new CloseOutterDoorsTask(FlagWar.super), 300000);
-	}
-	
-	/**
-	 * Runnable class to schedule doors closing and siege start.
-	 * @author Zoey76
-	 */
-	protected class CloseOutterDoorsTask implements Runnable
-	{
-		private final Siegable _siegable;
-		
-		protected CloseOutterDoorsTask(Siegable clanHallSiege)
-		{
-			_siegable = clanHallSiege;
-		}
-		
-		@Override
-		public void run()
+		// Schedule open doors closement, banish non siege participants and<br>
+		// siege start in 2 minutes
+		ThreadPoolManager.getInstance().scheduleGeneral(() ->
 		{
 			for (int door : OUTTER_DOORS_TO_OPEN)
 			{
@@ -527,8 +510,8 @@ public abstract class FlagWar extends ClanHallSiegeEngine
 			
 			_hall.getZone().banishNonSiegeParticipants();
 			
-			_siegable.startSiege();
-		}
+			startSiege();
+		} , 300000);
 	}
 	
 	@Override
-- 
GitLab