  public static List<File> getFontFiles(String fontDir) {
    List<File> fontFiles = new ArrayList<>();
    getFontFiles(fontFiles, new File(fontDir), "", true);
    return fontFiles;
  }

  public static List<File> getFontFiles(String fontDir) {
    List<File> fontFiles = new ArrayList<File>();
    getFontFiles(fontFiles, new File(fontDir), "", true);
    return fontFiles;
  }

Replace Generic With Diamond ArrayList<File> with ArrayList<> in method public getFontFiles(fontDir String) : List<File> from class com.google.typography.font.sfntly.table.opentype.testing.FontLoader


  private static Font[] load(File file) throws IOException {
    FontFactory fontFactory = FontFactory.getInstance();
    fontFactory.fingerprintFont(true);
    try (FileInputStream is = new FileInputStream(file)) {
      return fontFactory.loadFonts(is);
    } catch (FileNotFoundException e) {
      System.err.println("Could not load the font : " + file.getName());
      return null;
    }
  }

  private static Font[] load(File file) throws IOException {
    FontFactory fontFactory = FontFactory.getInstance();
    fontFactory.fingerprintFont(true);
    FileInputStream is = new FileInputStream(file);
    try {
      return fontFactory.loadFonts(is);
    } catch (FileNotFoundException e) {
      System.err.println("Could not load the font : " + file.getName());
      return null;
    } finally {
      is.close();
    }
  }

Try With Resources try(FileInputStream is=new FileInputStream(file)) in method private load(file File) : Font[] from class com.google.typography.font.sfntly.table.opentype.testing.FontLoader


  private static List<String> availableLangs(String wordsDir) {
    List<String> langs = new ArrayList<>();
    File[] wordFiles = new File(wordsDir).listFiles();
    for (File file : wordFiles) {
      String lang = file.getName();
      if (lang.startsWith(".")) {
        continue;
      }
      langs.add(lang);
    }
    return langs;
  }

  private static List<String> availableLangs(String wordsDir) {
    List<String> langs = new ArrayList<String>();
    File[] wordFiles = new File(wordsDir).listFiles();
    for (File file : wordFiles) {
      String lang = file.getName();
      if (lang.startsWith(".")) {
        continue;
      }
      langs.add(lang);
    }
    return langs;
  }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private availableLangs(wordsDir String) : List<String> from class com.google.typography.font.sfntly.table.opentype.testing.TestLanguagesForFonts


  public MtxFontBuilder() {
    tables = new HashMap<>();
    headBuilder = new MtxHeadBuilder();
  }

  public MtxFontBuilder() {
    tables = new HashMap<Integer, ReadableFontData>();
    headBuilder = new MtxHeadBuilder();
  }

Replace Generic With Diamond HashMap<Integer,ReadableFontData> with HashMap<> in method public MtxFontBuilder() from class com.google.typography.font.tools.conversion.eot.MtxFontBuilder


  private static Set<Integer> createRemoveTables() {
    Set<Integer> result = new HashSet<>();
    result.add(Tag.VDMX);
    result.add(Tag.glyf);
    result.add(Tag.cvt);
    result.add(Tag.loca);
    result.add(Tag.hdmx);
    result.add(Tag.head);
    return Collections.unmodifiableSet(result);
  }

  private static Set<Integer> createRemoveTables() {
    Set<Integer> result = new HashSet<Integer>();
    result.add(Tag.VDMX);
    result.add(Tag.glyf);
    result.add(Tag.cvt);
    result.add(Tag.loca);
    result.add(Tag.hdmx);
    result.add(Tag.head);
    return Collections.unmodifiableSet(result);
  }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method private createRemoveTables() : Set<Integer> from class com.google.typography.font.tools.conversion.eot.MtxWriter


  public void subsetFontFile() throws IOException {
    FontFactory fontFactory = FontFactory.getInstance();
    try (FileInputStream fis = new FileInputStream(fontFile)) {
      byte[] fontBytes = new byte[(int) fontFile.length()];
      fis.read(fontBytes);
      Font[] fontArray = fontFactory.loadFonts(fontBytes);
      Font font = fontArray[0];
      List<CMapTable.CMapId> cmapIds = new ArrayList<>();
      cmapIds.add(CMapTable.CMapId.WINDOWS_BMP);
      for (int i = 0; i < iterations; i++) {
        Font newFont = font;
        if (subsetString != null) {
          Subsetter subsetter = new RenumberingSubsetter(newFont, fontFactory);
          subsetter.setCMaps(cmapIds, 1);
          List<Integer> glyphs = GlyphCoverage.getGlyphCoverage(font, subsetString);
          subsetter.setGlyphs(glyphs);
          Set<Integer> removeTables = new HashSet<>();
          // Most of the following are valid tables, but we don't renumber them yet, so strip
          removeTables.add(Tag.GDEF);
          removeTables.add(Tag.GPOS);
          removeTables.add(Tag.GSUB);
          removeTables.add(Tag.kern);
          removeTables.add(Tag.hdmx);
          removeTables.add(Tag.vmtx);
          removeTables.add(Tag.VDMX);
          removeTables.add(Tag.LTSH);
          removeTables.add(Tag.DSIG);
          removeTables.add(Tag.vhea);
          // AAT tables, not yet defined in sfntly Tag class
          removeTables.add(Tag.intValue(new byte[] {'m', 'o', 'r', 't'}));
          removeTables.add(Tag.intValue(new byte[] {'m', 'o', 'r', 'x'}));
          subsetter.setRemoveTables(removeTables);
          newFont = subsetter.subset().build();
        }
        if (strip) {
          Subsetter hintStripper = new HintStripper(newFont, fontFactory);
          Set<Integer> removeTables = new HashSet<>();
          removeTables.add(Tag.fpgm);
          removeTables.add(Tag.prep);
          removeTables.add(Tag.cvt);
          removeTables.add(Tag.hdmx);
          removeTables.add(Tag.VDMX);
          removeTables.add(Tag.LTSH);
          removeTables.add(Tag.DSIG);
          removeTables.add(Tag.vhea);
          hintStripper.setRemoveTables(removeTables);
          newFont = hintStripper.subset().build();
        }

        FileOutputStream fos = new FileOutputStream(outputFile);
        if (woff) {
          WritableFontData woffData = new WoffWriter().convert(newFont);
          woffData.copyTo(fos);
        } else if (eot) {
          WritableFontData eotData = new EOTWriter(mtx).convert(newFont);
          eotData.copyTo(fos);
        } else {
          fontFactory.serializeFont(newFont, fos);
        }
      }
    }
  }

  public void subsetFontFile(File fontFile, File outputFile, int nIters)
      throws IOException {
    FontFactory fontFactory = FontFactory.getInstance();
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(fontFile);
      byte[] fontBytes = new byte[(int)fontFile.length()];
      fis.read(fontBytes);
      Font[] fontArray = null;
      fontArray = fontFactory.loadFonts(fontBytes);
      Font font = fontArray[0];
      List<CMapTable.CMapId> cmapIds = new ArrayList<CMapTable.CMapId>();
      cmapIds.add(CMapTable.CMapId.WINDOWS_BMP);
//      byte[] newFontData = null;
      for (int i = 0; i < nIters; i++) {
        Font newFont = font;
        if (subsetString != null) {
          Subsetter subsetter = new RenumberingSubsetter(newFont, fontFactory);
          subsetter.setCMaps(cmapIds, 1);
          List<Integer> glyphs = GlyphCoverage.getGlyphCoverage(font, subsetString);
          subsetter.setGlyphs(glyphs);
          Set<Integer> removeTables = new HashSet<Integer>();
          // Most of the following are valid tables, but we don't renumber them yet, so strip
          removeTables.add(Tag.GDEF);
          removeTables.add(Tag.GPOS);
          removeTables.add(Tag.GSUB);
          removeTables.add(Tag.kern);
          removeTables.add(Tag.hdmx);
          removeTables.add(Tag.vmtx);
          removeTables.add(Tag.VDMX);
          removeTables.add(Tag.LTSH);
          removeTables.add(Tag.DSIG);
          // AAT tables, not yet defined in sfntly Tag class
          removeTables.add(Tag.intValue(new byte[]{'m', 'o', 'r', 't'}));
          removeTables.add(Tag.intValue(new byte[]{'m', 'o', 'r', 'x'}));
          subsetter.setRemoveTables(removeTables);
          newFont = subsetter.subset().build();
        }
        if (strip) {
          Subsetter hintStripper = new HintStripper(newFont, fontFactory);
          Set<Integer> removeTables = new HashSet<Integer>();
          removeTables.add(Tag.fpgm);
          removeTables.add(Tag.prep);
          removeTables.add(Tag.cvt);
          removeTables.add(Tag.hdmx);
          removeTables.add(Tag.VDMX);
          removeTables.add(Tag.LTSH);
          removeTables.add(Tag.DSIG);
          hintStripper.setRemoveTables(removeTables);
          newFont = hintStripper.subset().build();
        }

        FileOutputStream fos = new FileOutputStream(outputFile);
        if (woff) {
          WritableFontData woffData = new WoffWriter().convert(newFont);
          woffData.copyTo(fos);
        } else if (eot) {
          WritableFontData eotData = new EOTWriter(mtx).convert(newFont);
          eotData.copyTo(fos);
        } else {
          fontFactory.serializeFont(newFont, fos);
        }
      }
    } finally {
      if (fis != null) {
        fis.close();
      }
    }
  }

Try With Resources try(FileInputStream fis=new FileInputStream(fontFile)) in method public subsetFontFile() : void from class com.google.typography.font.tools.sfnttool.SfntTool


    CMap4Segment(int startCode, int endCode) {
      this.startCode = startCode;
      this.endCode = endCode;
      this.glyphIds = new ArrayList<>();
    }

    CMap4Segment(int startCode, int endCode) {
      this.startCode = startCode;
      this.endCode = endCode;
      this.glyphIds = new ArrayList<Integer>();
    }

Replace Generic With Diamond ArrayList<Integer> with ArrayList<> in method package CMap4Segment(startCode int, endCode int) from class com.google.typography.font.tools.subsetter.CMapTableBuilder.CMap4Segment


  private static Map<String, Integer> invertNameMap(String[] names) {
    Map<String, Integer> nameMap = new HashMap<>();
    for (int i = 0; i < names.length; i++) {
      nameMap.put(names[i], i);
    }
    return nameMap;
  }

  private static Map<String, Integer> invertNameMap(String[] names) {
    Map<String, Integer> nameMap = new HashMap<String, Integer>();
    for (int i = 0; i < names.length; i++) {
      nameMap.put(names[i], i);
    }
    return nameMap;
  }

Replace Generic With Diamond HashMap<String,Integer> with HashMap<> in method private invertNameMap(names String[]) : Map<String,Integer> from class com.google.typography.font.tools.subsetter.PostScriptTableBuilder


  static Map<Integer, Integer> computeMapping(Subsetter subsetter, Font font) {
    CMapFormat4 cmap4 = getCMapFormat4(font);
    if (cmap4 == null) {
      throw new RuntimeException("CMap format 4 table in source font not found");
    }
    Map<Integer, Integer> inverseMapping = subsetter.getInverseMapping();
    Map<Integer, Integer> mapping = new HashMap<>();
    for (Integer unicode : cmap4) {
      int glyph = cmap4.glyphId(unicode);
      if (inverseMapping.containsKey(glyph)) {
        mapping.put(unicode, inverseMapping.get(glyph));
      }
    }
    return mapping;
  }

  static Map<Integer, Integer> computeMapping(Subsetter subsetter, Font font) {
    CMapFormat4 cmap4 = getCMapFormat4(font);
    if (cmap4 == null) {
      throw new RuntimeException("CMap format 4 table in source font not found");
    }
    Map<Integer, Integer> inverseMapping = subsetter.getInverseMapping();
    Map<Integer, Integer> mapping = new HashMap<Integer, Integer>();
    for (Integer unicode : cmap4) {
      int glyph = cmap4.glyphId(unicode);
      if (inverseMapping.containsKey(glyph)) {
        mapping.put(unicode, inverseMapping.get(glyph));
      }
    }
    return mapping;
  }

Replace Generic With Diamond HashMap<Integer,Integer> with HashMap<> in method package computeMapping(subsetter Subsetter, font Font) : Map<Integer,Integer> from class com.google.typography.font.tools.subsetter.RenumberingCMapTableSubsetter


  public void setGlyphs(List<Integer> glyphs) {
    this.newToOldGlyphs = new ArrayList<>(glyphs);
  }

  public void setGlyphs(List<Integer> glyphs) {
    this.newToOldGlyphs = new ArrayList<Integer>(glyphs);
  }

Replace Generic With Diamond ArrayList<Integer> with ArrayList<> in method public setGlyphs(glyphs List<Integer>) : void from class com.google.typography.font.tools.subsetter.Subsetter


  public void setRemoveTables(Set<Integer> removeTables) {
    this.removeTables = new HashSet<>(removeTables);
  }

  public void setRemoveTables(Set<Integer> removeTables) {
    this.removeTables = new HashSet<Integer>(removeTables);
  }

Replace Generic With Diamond HashSet<Integer> with HashSet<> in method public setRemoveTables(removeTables Set<Integer>) : void from class com.google.typography.font.tools.subsetter.Subsetter


  /**
   * Get the inverse mapping, from new glyph id to old.
   *
   * @return the inverse mapping
   */
  Map<Integer, Integer> getInverseMapping() {
    if (oldToNewGlyphs == null) {
      oldToNewGlyphs = new HashMap<>();
      List<Integer> mapping = glyphMappingTable();
      for (int i = 0; i < mapping.size(); i++) {
        oldToNewGlyphs.put(mapping.get(i), i);
      }
    }
    return oldToNewGlyphs;
  }

  /**
   * Get the inverse mapping, from new glyph id to old.
   *
   * @return the inverse mapping
   */
  Map<Integer, Integer> getInverseMapping() {
    if (oldToNewGlyphs == null) {
      oldToNewGlyphs = new HashMap<Integer, Integer>();
      List<Integer> mapping = glyphMappingTable();
      for (int i = 0; i < mapping.size(); i++) {
        oldToNewGlyphs.put(mapping.get(i), i);
      }
    }
    return oldToNewGlyphs;
  }

Replace Generic With Diamond HashMap<Integer,Integer> with HashMap<> in method package getInverseMapping() : Map<Integer,Integer> from class com.google.typography.font.tools.subsetter.Subsetter


private void documentChanged() {
    //  View of the component has not been updated at the time
    //  the DocumentEvent is fired

    SwingUtilities.invokeLater(() -> {
        try {
            int endPos = component.getDocument().getLength();
            Rectangle rect = component.modelToView(endPos);

            if (rect != null && rect.y != lastHeight) {
                setPreferredWidth();
                repaint();
                lastHeight = rect.y;
            }
        } catch (BadLocationException ex) {
            /* nothing to do */ }
    });
}

    private void documentChanged() {
        //  View of the component has not been updated at the time
        //  the DocumentEvent is fired

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    int endPos = component.getDocument().getLength();
                    Rectangle rect = component.modelToView(endPos);

                    if (rect != null && rect.y != lastHeight) {
                        setPreferredWidth();
                        repaint();
                        lastHeight = rect.y;
                    }
                } catch (BadLocationException ex) {
                    /* nothing to do */ }
            }
        });
    }

Replace Anonymous With Lambda org.example.NumeroLinea.documentChanged.invokeLater.new Runnable with () -> {tryint endPos=component.getDocument().getLength(); in method private documentChanged() : void from class org.example.NumeroLinea


    public void start(Stage stage) {
        signInLayout.getChildren().addAll(welcomeVbox);
        userInterfaceLayout.getChildren().addAll(recipientInfoVbox, toAndFromAddressesVbox, templateVbox, userInfoVbox, credentialsVbox, spreadSheetVbox, emailingVbox);

        styleSignInPage();
        setFadePhysics();
        styleUserInterface();

        chooseTemplateFile.setOnAction(this::handleFileSelection);
        chooseSpreadsheetFile.setOnAction(this::handleFileSelection);
        removeStoredCredential.setOnAction(this::handleTokenRemoval);
        sendEmail.setOnAction(this::handleEmailSending);

        signInButton.setOnAction(e -> {
            fd1.play();
            fd1.setOnFinished(event -> {
                fd2.play();
                stage.setScene(userInterfaceScene);
            });
        });

        signInScene.setFill(new LinearGradient(
                0, 0, 1, 1, true, CycleMethod.NO_CYCLE,
                new Stop(0, Color.web(gradient1)),
                new Stop(0.5, Color.web(gradient2)),
                new Stop(1, Color.web(gradient3)))
        );

        stage.setScene(signInScene);
        stage.show();
    }

    public void start(Stage stage) {
        signInLayout.getChildren().addAll(welcomeVbox);
        userInterfaceLayout.getChildren().addAll(recipientInfoVbox, toAndFromAddressesVbox, templateVbox, userInfoVbox, credentialsVbox, spreadSheetVbox, emailingVbox);

        styleSignInPage();
        setFadePhysics();
        styleUserInterface();

        chooseTemplateFile.setOnAction(this::handleFileSelection);
        chooseSpreadsheetFile.setOnAction(this::handleFileSelection);
        removeStoredCredential.setOnAction(this::handleTokenRemoval);
        sendEmail.setOnAction(this::handleEmailSending);

        signInButton.setOnAction(e -> {
            fd1.play();
            fd1.setOnFinished(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    fd2.play();
                    stage.setScene(userInterfaceScene);
                }
            });
        });

        signInScene.setFill(new LinearGradient(
                0, 0, 1, 1, true, CycleMethod.NO_CYCLE,
                new Stop(0, Color.web(gradient1)),
                new Stop(0.5, Color.web(gradient2)),
                new Stop(1, Color.web(gradient3)))
        );

        stage.setScene(signInScene);
        stage.show();
    }

Replace Anonymous With Lambda com.company.FalconMail.start.setOnAction.setOnFinished.new EventHandler<ActionEvent> with event -> {fd2.play(); in method public start(stage Stage) : void from class com.company.FalconMail


    @Test
    void generateXmlOutput() {
        XmlTransformer<Object> xmlTransformer = new XmlTransformer.XmlTransformerBuilder<>().pretty(true).build();
        CharSequence xmlOutput = xmlTransformer.generate(retrieveCompositeSchema(), 2);

        LOGGER.info(xmlOutput);
    }

    @Test
    void generateXmlOutput() {
        XmlTransformer<Object> xmlTransformer = new XmlTransformer.XmlTransformerBuilder<Object>().pretty(true).build();
        CharSequence xmlOutput = xmlTransformer.generate(retrieveCompositeSchema(), 2);

        LOGGER.info(xmlOutput);
    }

Replace Generic With Diamond XmlTransformer.XmlTransformerBuilder<Object> with XmlTransformer.XmlTransformerBuilder<> in method package generateXmlOutput() : void from class com.eliasnogueira.datafaker.schema.JsonAndXmlSchemaTest


	public void putDoor(L2DoorInstance door, int region) {
		_doors.put(door.getId(), door);

		if (!_regions.containsKey(region)) {
			_regions.put(region, new ArrayList<>());
		}
		_regions.get(region).add(door);
	}

	public void putDoor(L2DoorInstance door, int region) {
		_doors.put(door.getId(), door);

		if (!_regions.containsKey(region)) {
			_regions.put(region, new ArrayList<L2DoorInstance>());
		}
		_regions.get(region).add(door);
	}

Replace Generic With Diamond ArrayList<L2DoorInstance> with ArrayList<> in method public putDoor(door L2DoorInstance, region int) : void from class com.l2jserver.gameserver.data.xml.impl.DoorData


	@Override
	public void parseDocument(Document doc) {
		int counter = 0;
		for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling()) {
			if ("list".equalsIgnoreCase(n.getNodeName())) {
				for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) {
					if ("item".equalsIgnoreCase(d.getNodeName())) {
						int itemId = parseInteger(d.getAttributes(), "id");
						if (!_data.containsKey(itemId)) {
							_data.put(itemId, new HashMap<>());
						}
						for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling()) {
							if ("options".equalsIgnoreCase(cd.getNodeName())) {
								final EnchantOptions op = new EnchantOptions(parseInteger(cd.getAttributes(), "level"));
								_data.get(itemId).put(op.getLevel(), op);

								for (byte i = 0; i < 3; i++) {
									final Node att = cd.getAttributes().getNamedItem("option" + (i + 1));
									if ((att != null) && Util.isDigit(att.getNodeValue())) {
										op.setOption(i, parseInteger(att));
									}
								}
								counter++;
							}
						}
					}
				}
			}
		}
		LOG.info("Loaded {} items and {} options.", _data.size(), counter);
	}

	@Override
	public void parseDocument(Document doc) {
		int counter = 0;
		for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling()) {
			if ("list".equalsIgnoreCase(n.getNodeName())) {
				for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) {
					if ("item".equalsIgnoreCase(d.getNodeName())) {
						int itemId = parseInteger(d.getAttributes(), "id");
						if (!_data.containsKey(itemId)) {
							_data.put(itemId, new HashMap<Integer, EnchantOptions>());
						}
						for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling()) {
							if ("options".equalsIgnoreCase(cd.getNodeName())) {
								final EnchantOptions op = new EnchantOptions(parseInteger(cd.getAttributes(), "level"));
								_data.get(itemId).put(op.getLevel(), op);

								for (byte i = 0; i < 3; i++) {
									final Node att = cd.getAttributes().getNamedItem("option" + (i + 1));
									if ((att != null) && Util.isDigit(att.getNodeValue())) {
										op.setOption(i, parseInteger(att));
									}
								}
								counter++;
							}
						}
					}
				}
			}
		}
		LOG.info("Loaded {} items and {} options.", _data.size(), counter);
	}

Replace Generic With Diamond HashMap<Integer,EnchantOptions> with HashMap<> in method public parseDocument(doc Document) : void from class com.l2jserver.gameserver.data.xml.impl.EnchantItemOptionsData


	/**
	 * Register new event for dualbox check. Should be called only once.
	 * @param eventId
	 */
	public void registerEvent(int eventId) {
		_eventIPs.putIfAbsent(eventId, new ConcurrentHashMap<>());
	}

	/**
	 * Register new event for dualbox check. Should be called only once.
	 * @param eventId
	 */
	public void registerEvent(int eventId) {
		_eventIPs.putIfAbsent(eventId, new ConcurrentHashMap<Integer, AtomicInteger>());
	}

Replace Generic With Diamond ConcurrentHashMap<Integer,AtomicInteger> with ConcurrentHashMap<> in method public registerEvent(eventId int) : void from class com.l2jserver.gameserver.instancemanager.AntiFeedManager


	private void loadRooms() {
		try (var con = ConnectionFactory.getInstance().getConnection();
			var s = con.createStatement();
			var rs = s.executeQuery("SELECT * FROM dimensional_rift")) {
			while (rs.next()) {
				// 0 waiting room, 1 recruit, 2 soldier, 3 officer, 4 captain , 5 commander, 6 hero
				byte type = rs.getByte("type");
				byte room_id = rs.getByte("room_id");

				// coords related
				int xMin = rs.getInt("xMin");
				int xMax = rs.getInt("xMax");
				int yMin = rs.getInt("yMin");
				int yMax = rs.getInt("yMax");
				int z1 = rs.getInt("zMin");
				int z2 = rs.getInt("zMax");
				int xT = rs.getInt("xT");
				int yT = rs.getInt("yT");
				int zT = rs.getInt("zT");
				boolean isBossRoom = rs.getByte("boss") > 0;

				if (!_rooms.containsKey(type)) {
					_rooms.put(type, new HashMap<>(9));
				}

				_rooms.get(type).put(room_id, new DimensionalRiftRoom(type, room_id, xMin, xMax, yMin, yMax, z1, z2, xT, yT, zT, isBossRoom));
			}
		} catch (Exception ex) {
			LOG.warn("Can not load Dimension Rift zones!", ex);
		}

		int typeSize = _rooms.keySet().size();
		int roomSize = 0;

		for (byte b : _rooms.keySet()) {
			roomSize += _rooms.get(b).keySet().size();
		}

		LOG.info("Loaded {} room types with {} rooms.", typeSize, roomSize);
	}

	private void loadRooms() {
		try (var con = ConnectionFactory.getInstance().getConnection();
			var s = con.createStatement();
			var rs = s.executeQuery("SELECT * FROM dimensional_rift")) {
			while (rs.next()) {
				// 0 waiting room, 1 recruit, 2 soldier, 3 officer, 4 captain , 5 commander, 6 hero
				byte type = rs.getByte("type");
				byte room_id = rs.getByte("room_id");

				// coords related
				int xMin = rs.getInt("xMin");
				int xMax = rs.getInt("xMax");
				int yMin = rs.getInt("yMin");
				int yMax = rs.getInt("yMax");
				int z1 = rs.getInt("zMin");
				int z2 = rs.getInt("zMax");
				int xT = rs.getInt("xT");
				int yT = rs.getInt("yT");
				int zT = rs.getInt("zT");
				boolean isBossRoom = rs.getByte("boss") > 0;

				if (!_rooms.containsKey(type)) {
					_rooms.put(type, new HashMap<Byte, DimensionalRiftRoom>(9));
				}

				_rooms.get(type).put(room_id, new DimensionalRiftRoom(type, room_id, xMin, xMax, yMin, yMax, z1, z2, xT, yT, zT, isBossRoom));
			}
		} catch (Exception ex) {
			LOG.warn("Can not load Dimension Rift zones!", ex);
		}

		int typeSize = _rooms.keySet().size();
		int roomSize = 0;

		for (byte b : _rooms.keySet()) {
			roomSize += _rooms.get(b).keySet().size();
		}

		LOG.info("Loaded {} room types with {} rooms.", typeSize, roomSize);
	}

Replace Generic With Diamond HashMap<Byte,DimensionalRiftRoom> with HashMap<> in method private loadRooms() : void from class com.l2jserver.gameserver.instancemanager.DimensionalRiftManager


	/**
	 * @param players
	 * @param items
	 * @param limit
	 * @return
	 */
	private static Map<L2PcInstance, Map<Integer, Long>> calculateDistribution(Collection<L2PcInstance> players, Collection<ItemHolder> items, Function<Integer, Long> limit) {
		Map<L2PcInstance, Map<Integer, Long>> rewardedCounts = new HashMap<>();
		for (L2PcInstance player : players) {
			rewardedCounts.put(player, new HashMap<>());
		}
		NEXT_ITEM:
		for (ItemHolder item : items) {
			long equaldist = item.getCount() / players.size();
			long randomdist = item.getCount() % players.size();
			List<L2PcInstance> toDist = new ArrayList<>(players);
			do // this must happen at least once in order to get away already full players (and then equaldist can become nonzero)
			{
				for (Iterator<L2PcInstance> it = toDist.iterator(); it.hasNext();) {
					L2PcInstance player = it.next();
					if (!rewardedCounts.get(player).containsKey(item.getId())) {
						rewardedCounts.get(player).put(item.getId(), 0L);
					}
					long maxGive = avoidNull(limit, item.getId()) - player.getInventory().getInventoryItemCount(item.getId(), -1, true) - rewardedCounts.get(player).get(item.getId());
					long toGive = equaldist;
					if (equaldist >= maxGive) {
						toGive = maxGive;
						randomdist += (equaldist - maxGive); // overflown items are available to next players
						it.remove(); // this player is already full
					}
					rewardedCounts.get(player).put(item.getId(), rewardedCounts.get(player).get(item.getId()) + toGive);
				}
				if (toDist.isEmpty()) {
					// there's no one to give items anymore, all players will be full when we give the items
					continue NEXT_ITEM;
				}
				equaldist = randomdist / toDist.size(); // the rest of items may be allowed to be equally distributed between remaining players
				randomdist %= toDist.size();
			}
			while (equaldist > 0);
			while (randomdist > 0) {
				if (toDist.isEmpty()) {
					// we don't have any player left
					continue NEXT_ITEM;
				}
				L2PcInstance player = toDist.get(getRandom(toDist.size()));
				// avoid null return
				long maxGive = avoidNull(limit, item.getId()) - limit.apply(item.getId()) - player.getInventory().getInventoryItemCount(item.getId(), -1, true) - rewardedCounts.get(player).get(item.getId());
				if (maxGive > 0) {
					// we can add an item to player
					// so we add one item to player
					rewardedCounts.get(player).put(item.getId(), rewardedCounts.get(player).get(item.getId()) + 1);
					randomdist--;
				}
				toDist.remove(player); // Either way this player isn't allowable for next random award
			}
		}
		return rewardedCounts;
	}

	/**
	 * @param players
	 * @param items
	 * @param limit
	 * @return
	 */
	private static Map<L2PcInstance, Map<Integer, Long>> calculateDistribution(Collection<L2PcInstance> players, Collection<ItemHolder> items, Function<Integer, Long> limit) {
		Map<L2PcInstance, Map<Integer, Long>> rewardedCounts = new HashMap<>();
		for (L2PcInstance player : players) {
			rewardedCounts.put(player, new HashMap<Integer, Long>());
		}
		NEXT_ITEM:
		for (ItemHolder item : items) {
			long equaldist = item.getCount() / players.size();
			long randomdist = item.getCount() % players.size();
			List<L2PcInstance> toDist = new ArrayList<>(players);
			do // this must happen at least once in order to get away already full players (and then equaldist can become nonzero)
			{
				for (Iterator<L2PcInstance> it = toDist.iterator(); it.hasNext();) {
					L2PcInstance player = it.next();
					if (!rewardedCounts.get(player).containsKey(item.getId())) {
						rewardedCounts.get(player).put(item.getId(), 0L);
					}
					long maxGive = avoidNull(limit, item.getId()) - player.getInventory().getInventoryItemCount(item.getId(), -1, true) - rewardedCounts.get(player).get(item.getId());
					long toGive = equaldist;
					if (equaldist >= maxGive) {
						toGive = maxGive;
						randomdist += (equaldist - maxGive); // overflown items are available to next players
						it.remove(); // this player is already full
					}
					rewardedCounts.get(player).put(item.getId(), rewardedCounts.get(player).get(item.getId()) + toGive);
				}
				if (toDist.isEmpty()) {
					// there's no one to give items anymore, all players will be full when we give the items
					continue NEXT_ITEM;
				}
				equaldist = randomdist / toDist.size(); // the rest of items may be allowed to be equally distributed between remaining players
				randomdist %= toDist.size();
			}
			while (equaldist > 0);
			while (randomdist > 0) {
				if (toDist.isEmpty()) {
					// we don't have any player left
					continue NEXT_ITEM;
				}
				L2PcInstance player = toDist.get(getRandom(toDist.size()));
				// avoid null return
				long maxGive = avoidNull(limit, item.getId()) - limit.apply(item.getId()) - player.getInventory().getInventoryItemCount(item.getId(), -1, true) - rewardedCounts.get(player).get(item.getId());
				if (maxGive > 0) {
					// we can add an item to player
					// so we add one item to player
					rewardedCounts.get(player).put(item.getId(), rewardedCounts.get(player).get(item.getId()) + 1);
					randomdist--;
				}
				toDist.remove(player); // Either way this player isn't allowable for next random award
			}
		}
		return rewardedCounts;
	}

Replace Generic With Diamond HashMap<Integer,Long> with HashMap<> in method private calculateDistribution(players Collection<L2PcInstance>, items Collection<ItemHolder>, limit Function<Integer,Long>) : Map<L2PcInstance,Map<Integer,Long>> from class com.l2jserver.gameserver.model.events.AbstractScript


	public ScriptDocument(String name, InputStream input) {
		_name = name;

		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		try {
			DocumentBuilder builder = factory.newDocumentBuilder();
			_document = builder.parse(input);

		} catch (SAXException sxe) {
			// Error generated during parsing)
			Exception x = sxe;
			if (sxe.getException() != null) {
				x = sxe.getException();
			}
			_log.warning(getClass().getSimpleName() + ": " + x.getMessage());
		} catch (ParserConfigurationException | IOException pce) {
			// Parser with specified options can't be built
			_log.log(Level.WARNING, "", pce);
		}
	}

	public ScriptDocument(String name, InputStream input) {
		_name = name;

		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		try {
			DocumentBuilder builder = factory.newDocumentBuilder();
			_document = builder.parse(input);

		} catch (SAXException sxe) {
			// Error generated during parsing)
			Exception x = sxe;
			if (sxe.getException() != null) {
				x = sxe.getException();
			}
			_log.warning(getClass().getSimpleName() + ": " + x.getMessage());
		} catch (ParserConfigurationException pce) {
			// Parser with specified options can't be built
			_log.log(Level.WARNING, "", pce);

		} catch (IOException ioe) {
			// I/O error
			_log.log(Level.WARNING, "", ioe);
		}
	}

Merge Catch [catch(ParserConfigurationException pce), catch(IOException ioe)] to catch(ParserConfigurationException|IOException pce) in method public ScriptDocument(name String, input InputStream) from class com.l2jserver.gameserver.script.ScriptDocument


		public ThreadLocalRandom()
		{
			_seedLocal = new ThreadLocal<>()
			{
				@Override
				public final Seed initialValue()
				{
					return new Seed(++SEED_UNIQUIFIER + System.nanoTime());
				}
			};
		}

		public ThreadLocalRandom()
		{
			_seedLocal = new ThreadLocal<Seed>()
			{
				@Override
				public final Seed initialValue()
				{
					return new Seed(++SEED_UNIQUIFIER + System.nanoTime());
				}
			};
		}

Replace Generic With Diamond ThreadLocal<Seed> with ThreadLocal<> in method public ThreadLocalRandom() from class com.l2jserver.util.Rnd.ThreadLocalRandom


		public ThreadLocalRandom(final long seed)
		{
			_seedLocal = new ThreadLocal<>()
			{
				@Override
				public final Seed initialValue()
				{
					return new Seed(seed);
				}
			};
		}

		public ThreadLocalRandom(final long seed)
		{
			_seedLocal = new ThreadLocal<Seed>()
			{
				@Override
				public final Seed initialValue()
				{
					return new Seed(seed);
				}
			};
		}

Replace Generic With Diamond ThreadLocal<Seed> with ThreadLocal<> in method public ThreadLocalRandom(seed long) from class com.l2jserver.util.Rnd.ThreadLocalRandom


	public ItemAuction(final int auctionId, final int instanceId, final long startingTime, final long endingTime, final 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)
	{
		this(auctionId, instanceId, startingTime, endingTime, auctionItem, new ArrayList<ItemAuctionBid>(), ItemAuctionState.CREATED);
	}

Replace Generic With Diamond ArrayList<ItemAuctionBid> with ArrayList<> in method public ItemAuction(auctionId int, instanceId int, startingTime long, endingTime long, auctionItem AuctionItem) from class com.l2jserver.gameserver.model.itemauction.ItemAuction


	/**
	 * @param playerObjId
	 */
	public void restoreInstanceTimes(int playerObjId)
	{
		if (_playerInstanceTimes.containsKey(playerObjId))
		{
			return; // already restored
		}
		_playerInstanceTimes.put(playerObjId, new ConcurrentHashMap<>());
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps = con.prepareStatement(RESTORE_INSTANCE_TIMES))
		{
			ps.setInt(1, playerObjId);
			try (ResultSet rs = ps.executeQuery())
			{
				while (rs.next())
				{
					int id = rs.getInt("instanceId");
					long time = rs.getLong("time");
					if (time < System.currentTimeMillis())
					{
						deleteInstanceTime(playerObjId, id);
					}
					else
					{
						_playerInstanceTimes.get(playerObjId).put(id, time);
					}
				}
			}
		}
		catch (Exception e)
		{
			LOGGER.warning(getClass().getSimpleName() + ": Could not delete character instance time data: " + e.getMessage());
		}
	}

	/**
	 * @param playerObjId
	 */
	public void restoreInstanceTimes(int playerObjId)
	{
		if (_playerInstanceTimes.containsKey(playerObjId))
		{
			return; // already restored
		}
		_playerInstanceTimes.put(playerObjId, new FastMap<Integer, Long>());
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps = con.prepareStatement(RESTORE_INSTANCE_TIMES))
		{
			ps.setInt(1, playerObjId);
			try (ResultSet rs = ps.executeQuery())
			{
				while (rs.next())
				{
					int id = rs.getInt("instanceId");
					long time = rs.getLong("time");
					if (time < System.currentTimeMillis())
					{
						deleteInstanceTime(playerObjId, id);
					}
					else
					{
						_playerInstanceTimes.get(playerObjId).put(id, time);
					}
				}
			}
		}
		catch (Exception e)
		{
			LOGGER.warning(getClass().getSimpleName() + ": Could not delete character instance time data: " + e.getMessage());
		}
	}

Replace Generic With Diamond FastMap<Integer,Long> with ConcurrentHashMap<> in method public restoreInstanceTimes(playerObjId int) : void from class com.l2jserver.gameserver.instancemanager.InstanceManager


	@Override
	public void restoreEffects()
	{
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps1 = con.prepareStatement(RESTORE_SKILL_SAVE);
			PreparedStatement ps2 = con.prepareStatement(DELETE_SKILL_SAVE))
		{
			if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId()))
			{
				ps1.setInt(1, getControlObjectId());
				try (ResultSet rset = ps1.executeQuery())
				{
					while (rset.next())
					{
						int effectCurTime = rset.getInt("remaining_time");

						final Skill skill = SkillData.getInstance().getSkill(rset.getInt("skill_id"), rset.getInt("skill_level"));
						if (skill == null)
						{
							continue;
						}

						if (skill.hasEffects(EffectScope.GENERAL))
						{
							if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId()))
							{
								SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new ArrayList<>());
							}

							SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime));
						}
					}
				}
			}

			ps2.setInt(1, getControlObjectId());
			ps2.executeUpdate();
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "Could not restore " + this + " active effect data: " + e.getMessage(), e);
		}
		finally
		{
			if (SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()) == null)
			{
				return;
			}

			for (SummonEffect se : SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()))
			{
				if (se != null)
				{
					se.getSkill().applyEffects(this, this, false, se.getEffectCurTime());
				}
			}
		}
	}

	@Override
	public void restoreEffects()
	{
		try (Connection con = L2DatabaseFactory.getInstance().getConnection();
			PreparedStatement ps1 = con.prepareStatement(RESTORE_SKILL_SAVE);
			PreparedStatement ps2 = con.prepareStatement(DELETE_SKILL_SAVE))
		{
			if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId()))
			{
				ps1.setInt(1, getControlObjectId());
				try (ResultSet rset = ps1.executeQuery())
				{
					while (rset.next())
					{
						int effectCurTime = rset.getInt("remaining_time");

						final Skill skill = SkillData.getInstance().getSkill(rset.getInt("skill_id"), rset.getInt("skill_level"));
						if (skill == null)
						{
							continue;
						}

						if (skill.hasEffects(EffectScope.GENERAL))
						{
							if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId()))
							{
								SummonEffectsTable.getInstance().getPetEffects().put(getControlObjectId(), new FastList<SummonEffect>());
							}

							SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()).add(SummonEffectsTable.getInstance().new SummonEffect(skill, effectCurTime));
						}
					}
				}
			}

			ps2.setInt(1, getControlObjectId());
			ps2.executeUpdate();
		}
		catch (Exception e)
		{
			_log.log(Level.WARNING, "Could not restore " + this + " active effect data: " + e.getMessage(), e);
		}
		finally
		{
			if (SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()) == null)
			{
				return;
			}

			for (SummonEffect se : SummonEffectsTable.getInstance().getPetEffects().get(getControlObjectId()))
			{
				if (se != null)
				{
					se.getSkill().applyEffects(this, this, false, se.getEffectCurTime());
				}
			}
		}
	}

Replace Generic With Diamond FastList<SummonEffect> with ArrayList<> in method public restoreEffects() : void from class com.l2jserver.gameserver.model.actor.instance.L2PetInstance


	public StatsSet()
	{
		this(new LinkedHashMap<>());
	}

	public StatsSet()
	{
		this(new FastMap<String, Object>());
	}

Replace Generic With Diamond FastMap<String,Object> with LinkedHashMap<> in method public StatsSet() from class com.l2jserver.gameserver.model.StatsSet


	public static IAmountMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
	{
		return (item, victim) ->
		{
			double multiplier = 1;
			if (victim.isChampion())
			{
				multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS : Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
			}
			Float dropChanceMultiplier = Config.RATE_DROP_AMOUNT_MULTIPLIER.get(item.getItemId());
			if (dropChanceMultiplier != null)
			{
				multiplier *= dropChanceMultiplier;
			}
			else if (ItemTable.getInstance().getTemplate(item.getItemId()).hasExImmediateEffect())
			{
				multiplier *= Config.RATE_HERB_DROP_AMOUNT_MULTIPLIER;
			}
			else if (victim.isRaid())
			{
				multiplier *= Config.RATE_RAID_DROP_AMOUNT_MULTIPLIER;
			}
			else
			{
				multiplier *= defaultMultiplier;
			}
			return multiplier;
		};
	}

		public static IAmountMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
		{
			return new IAmountMultiplierStrategy()
			{

				@Override
				public double getAmountMultiplier(GeneralDropItem item, L2Character victim)
				{
					double multiplier = 1;
					if (victim.isChampion())
					{
						multiplier *= item.getItemId() != Inventory.ADENA_ID ? Config.L2JMOD_CHAMPION_REWARDS : Config.L2JMOD_CHAMPION_ADENAS_REWARDS;
					}
					Float dropChanceMultiplier = Config.RATE_DROP_AMOUNT_MULTIPLIER.get(item.getItemId());
					if (dropChanceMultiplier != null)
					{
						multiplier *= dropChanceMultiplier;
					}
					else if (ItemTable.getInstance().getTemplate(item.getItemId()).hasExImmediateEffect())
					{
						multiplier *= Config.RATE_HERB_DROP_AMOUNT_MULTIPLIER;
					}
					else if (victim.isRaid())
					{
						multiplier *= Config.RATE_RAID_DROP_AMOUNT_MULTIPLIER;
					}
					else
					{
						multiplier *= defaultMultiplier;
					}
					return multiplier;
				}
			};
		}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.drops.strategy.IAmountMultiplierStrategy.Foo.DEFAULT_STRATEGY.new IAmountMultiplierStrategy with (item, victim) -> {double multiplier=1; in method public DEFAULT_STRATEGY(defaultMultiplier double) : IAmountMultiplierStrategy from class com.l2jserver.gameserver.model.drops.strategy.IAmountMultiplierStrategy


	public static IChanceMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
	{
		return (item, victim) ->
		{
			float multiplier = 1;
			Float dropChanceMultiplier = Config.RATE_DROP_CHANCE_MULTIPLIER.get(item.getItemId());
			if (dropChanceMultiplier != null)
			{
				multiplier *= dropChanceMultiplier;
			}
			else if (ItemTable.getInstance().getTemplate(item.getItemId()).hasExImmediateEffect())
			{
				multiplier *= Config.RATE_HERB_DROP_CHANCE_MULTIPLIER;
			}
			else if (victim.isRaid())
			{
				multiplier *= Config.RATE_RAID_DROP_CHANCE_MULTIPLIER;
			}
			else
			{
				multiplier *= defaultMultiplier;
			}
			return multiplier;
		};
	}

		public static IChanceMultiplierStrategy DEFAULT_STRATEGY(final double defaultMultiplier)
		{
			return new IChanceMultiplierStrategy()
			{

				@Override
				public double getChanceMultiplier(GeneralDropItem item, L2Character victim)
				{
					float multiplier = 1;
					Float dropChanceMultiplier = Config.RATE_DROP_CHANCE_MULTIPLIER.get(item.getItemId());
					if (dropChanceMultiplier != null)
					{
						multiplier *= dropChanceMultiplier;
					}
					else if (ItemTable.getInstance().getTemplate(item.getItemId()).hasExImmediateEffect())
					{
						multiplier *= Config.RATE_HERB_DROP_CHANCE_MULTIPLIER;
					}
					else if (victim.isRaid())
					{
						multiplier *= Config.RATE_RAID_DROP_CHANCE_MULTIPLIER;
					}
					else
					{
						multiplier *= defaultMultiplier;
					}
					return multiplier;
				}
			};
		}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.drops.strategy.IChanceMultiplierStrategy.Foo.DEFAULT_STRATEGY.new IChanceMultiplierStrategy with (item, victim) -> {float multiplier=1; in method public DEFAULT_STRATEGY(defaultMultiplier double) : IChanceMultiplierStrategy from class com.l2jserver.gameserver.model.drops.strategy.IChanceMultiplierStrategy


	private final void fireCharacterArrived(final L2Character character)
	{
		final L2CharacterAI ai = character.getAI();
		if (ai == null)
		{
			return;
		}

		ThreadPoolManager.getInstance().executeAi(() ->
		{
			try
			{
				if (Config.MOVE_BASED_KNOWNLIST)
				{
					character.getKnownList().findObjects();
				}

				ai.notifyEvent(CtrlEvent.EVT_ARRIVED);
			}
			catch (final Throwable e)
			{
				_log.log(Level.WARNING, "", e);
			}
		});
	}

	private final void fireCharacterArrived(final L2Character character)
	{
		final L2CharacterAI ai = character.getAI();
		if (ai == null)
		{
			return;
		}

		ThreadPoolManager.getInstance().executeAi(new Runnable()
		{
			@Override
			public final void run()
			{
				try
				{
					if (Config.MOVE_BASED_KNOWNLIST)
					{
						character.getKnownList().findObjects();
					}

					ai.notifyEvent(CtrlEvent.EVT_ARRIVED);
				}
				catch (final Throwable e)
				{
					StackTrace.displayStackTraceInformation(e);
				}
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.GameTimeController.fireCharacterArrived.executeAi.new Runnable with () -> {tryif(Config.MOVE_BASED_KNOWNLIST){character.getKnownList().findObjects(); in method private fireCharacterArrived(character L2Character) : void from class com.l2jserver.gameserver.GameTimeController


	public void scheduleRemoveClan(final int clanId)
	{
		ThreadPoolManager.getInstance().scheduleGeneral(() ->
		{
			if (getClan(clanId) == null)
			{
				return;
			}
			if (getClan(clanId).getDissolvingExpiryTime() != 0)
			{
				destroyClan(clanId);
			}
		}, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
	}

	public void scheduleRemoveClan(final int clanId)
	{
		ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				if (getClan(clanId) == null)
				{
					return;
				}
				if (getClan(clanId).getDissolvingExpiryTime() != 0)
				{
					destroyClan(clanId);
				}
			}
		}, Math.max(getClan(clanId).getDissolvingExpiryTime() - System.currentTimeMillis(), 300000));
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.datatables.ClanTable.scheduleRemoveClan.scheduleGeneral.new Runnable with () -> {if(getClan(clanId) == null){return; in method public scheduleRemoveClan(clanId int) : void from class com.l2jserver.gameserver.datatables.ClanTable


	public void updateManorRefresh()
	{
		_log.info("Manor System: Manor refresh updated");

		_scheduledManorRefresh = ThreadPoolManager.getInstance().scheduleGeneral(() ->
		{
			if (!isDisabled())
			{
				setUnderMaintenance(true);
				_log.info("Manor System: Under maintenance mode started");

				_scheduledMaintenanceEnd = ThreadPoolManager.getInstance().scheduleGeneral(() ->
				{
					_log.info("Manor System: Next period started");
					setNextPeriod();
					try
					{
						save();
					}
					catch (Exception e)
					{
						_log.log(Level.WARNING, "Manor System: Failed to save manor data: " + e.getMessage(), e);
					}
					setUnderMaintenance(false);
				}, MAINTENANCE_PERIOD);
			}
			updateManorRefresh();
		}, getMillisToManorRefresh());
	}

	public void updateManorRefresh()
	{
		_log.info("Manor System: Manor refresh updated");

		_scheduledManorRefresh = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				if (!isDisabled())
				{
					setUnderMaintenance(true);
					_log.info("Manor System: Under maintenance mode started");

					_scheduledMaintenanceEnd = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
					{
						@Override
						public void run()
						{
							_log.info("Manor System: Next period started");
							setNextPeriod();
							try
							{
								save();
							}
							catch (Exception e)
							{
								_log.log(Level.WARNING, "Manor System: Failed to save manor data: " + e.getMessage(), e);
							}
							setUnderMaintenance(false);
						}
					}, MAINTENANCE_PERIOD);
				}
				updateManorRefresh();
			}
		}, getMillisToManorRefresh());
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.instancemanager.CastleManorManager.updateManorRefresh.scheduleGeneral.new Runnable with () -> {if(!isDisabled()){setUnderMaintenance(true); in method public updateManorRefresh() : void from class com.l2jserver.gameserver.instancemanager.CastleManorManager


	public void updatePeriodApprove()
	{
		_log.info("Manor System: Manor period approve updated");

		_scheduledNextPeriodapprove = ThreadPoolManager.getInstance().scheduleGeneral(() ->
		{
			if (!isDisabled())
			{
				approveNextPeriod();
				_log.info("Manor System: Next period approved");
			}
			updatePeriodApprove();
		}, getMillisToNextPeriodApprove());
	}

	public void updatePeriodApprove()
	{
		_log.info("Manor System: Manor period approve updated");

		_scheduledNextPeriodapprove = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				if (!isDisabled())
				{
					approveNextPeriod();
					_log.info("Manor System: Next period approved");
				}
				updatePeriodApprove();
			}
		}, getMillisToNextPeriodApprove());
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.instancemanager.CastleManorManager.updatePeriodApprove.scheduleGeneral.new Runnable with () -> {if(!isDisabled()){approveNextPeriod(); in method public updatePeriodApprove() : void from class com.l2jserver.gameserver.instancemanager.CastleManorManager


	/**
	 * @return a list of object IDs of the members of this group
	 */
	public List<Integer> getMembersObjectId()
	{
		final List<Integer> ids = new ArrayList<>();
		forEachMember(m ->
		{
			ids.add(m.getObjectId());
			return true;
		});
		return ids;
	}

	/**
	 * @return a list of object IDs of the members of this group
	 */
	public List<Integer> getMembersObjectId()
	{
		final List<Integer> ids = new ArrayList<>();
		forEachMember(new IL2Procedure<L2PcInstance>()
		{
			@Override
			public boolean execute(L2PcInstance member)
			{
				ids.add(member.getObjectId());
				return true;
			}
		});
		return ids;
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.getMembersObjectId.forEachMember.new IL2Procedure<L2PcInstance> with m -> {ids.add(m.getObjectId()); in method public getMembersObjectId() : List<Integer> from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	/**
	 * Broadcast a packet to every member of this group.
	 * @param packet the packet to broadcast
	 */
	public void broadcastPacket(final L2GameServerPacket packet)
	{
		forEachMember(m ->
		{
			if (m != null)
			{
				m.sendPacket(packet);
			}
			return true;
		});
	}

	/**
	 * Broadcast a packet to every member of this group.
	 * @param packet the packet to broadcast
	 */
	public void broadcastPacket(final L2GameServerPacket packet)
	{
		forEachMember(new IL2Procedure<L2PcInstance>()
		{
			@Override
			public boolean execute(L2PcInstance member)
			{
				if (member != null)
				{
					member.sendPacket(packet);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.broadcastPacket.forEachMember.new IL2Procedure<L2PcInstance> with m -> {if(m != null){m.sendPacket(packet); in method public broadcastPacket(packet L2GameServerPacket) : void from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	public void broadcastCreatureSay(final CreatureSay msg, final L2PcInstance broadcaster)
	{
		forEachMember(m ->
		{
			if ((m != null) && !BlockList.isBlocked(m, broadcaster))
			{
				m.sendPacket(msg);
			}
			return true;
		});
	}

	public void broadcastCreatureSay(final CreatureSay msg, final L2PcInstance broadcaster)
	{
		forEachMember(new IL2Procedure<L2PcInstance>()
		{
			@Override
			public boolean execute(L2PcInstance member)
			{
				if ((member != null) && !BlockList.isBlocked(member, broadcaster))
				{
					member.sendPacket(msg);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.broadcastCreatureSay.forEachMember.new IL2Procedure<L2PcInstance> with m -> {if((m != null) && !BlockList.isBlocked(m,broadcaster)){m.sendPacket(msg); in method public broadcastCreatureSay(msg CreatureSay, broadcaster L2PcInstance) : void from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	/**
	 * Spawn all minions at a regular interval
	 */
	protected void startMaintenanceTask()
	{
		// maintenance task now used only for minions spawn
		if (getTemplate().getMinionData() == null)
		{
			return;
		}

		if (_maintenanceTask == null)
		{
			_maintenanceTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
			{
				if (_enableMinions)
				{
					getMinionList().spawnMinions();
				}
			}, getMaintenanceInterval() + Rnd.get(1000));
		}
	}

	/**
	 * Spawn all minions at a regular interval
	 */
	protected void startMaintenanceTask()
	{
		// maintenance task now used only for minions spawn
		if (getTemplate().getMinionData() == null)
		{
			return;
		}

		if (_maintenanceTask == null)
		{
			_maintenanceTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
			{
				@Override
				public void run()
				{
					if (_enableMinions)
					{
						getMinionList().spawnMinions();
					}
				}
			}, getMaintenanceInterval() + Rnd.get(1000));
		}
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance.startMaintenanceTask.scheduleGeneral.new Runnable with () -> {if(_enableMinions){getMinionList().spawnMinions(); in method protected startMaintenanceTask() : void from class com.l2jserver.gameserver.model.actor.instance.L2MonsterInstance


	protected void createTeleporterTimer(final boolean reasonTP)
	{
		if (_party == null)
		{
			return;
		}

		if (teleporterTimerTask != null)
		{
			teleporterTimerTask.cancel();
			teleporterTimerTask = null;
		}

		if (teleporterTimer != null)
		{
			teleporterTimer.cancel();
			teleporterTimer = null;
		}

		if (earthQuakeTask != null)
		{
			earthQuakeTask.cancel(false);
			earthQuakeTask = null;
		}

		teleporterTimer = new Timer();
		teleporterTimerTask = new TimerTask()
		{
			@Override
			public void run()
			{
				if (_choosenRoom > -1)
				{
					DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).unspawn().setPartyInside(false);
				}

				if (reasonTP && (jumps_current < getMaxJumps()) && (_party.getMemberCount() > deadPlayers.size()))
				{
					jumps_current++;

					_completedRooms.add(_choosenRoom);
					_choosenRoom = -1;

					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToNextRoom(p);
						}
					}
					createTeleporterTimer(true);
					createSpawnTimer(_choosenRoom);
				}
				else
				{
					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToWaitingRoom(p);
						}
					}
					killRift();
					cancel();
				}
			}
		};

		if (reasonTP)
		{
			long jumpTime = calcTimeToNextJump();
			teleporterTimer.schedule(teleporterTimerTask, jumpTime); // Teleporter task, 8-10 minutes

			earthQuakeTask = ThreadPoolManager.getInstance().scheduleGeneral(() ->
			{
				for (L2PcInstance p : _party.getMembers())
				{
					if (!revivedInWaitingRoom.contains(p))
					{
						p.sendPacket(new Earthquake(p.getX(), p.getY(), p.getZ(), 65, 9));
					}
				}
			}, jumpTime - 7000);
		}
		else
		{
			teleporterTimer.schedule(teleporterTimerTask, seconds_5); // incorrect party member invited.
		}
	}

	protected void createTeleporterTimer(final boolean reasonTP)
	{
		if (teleporterTimerTask != null)
		{
			teleporterTimerTask.cancel();
			teleporterTimerTask = null;
		}

		if (teleporterTimer != null)
		{
			teleporterTimer.cancel();
			teleporterTimer = null;
		}

		if (earthQuakeTask != null)
		{
			earthQuakeTask.cancel(false);
			earthQuakeTask = null;
		}

		teleporterTimer = new Timer();
		teleporterTimerTask = new TimerTask()
		{
			@Override
			public void run()
			{
				if (_choosenRoom > -1)
				{
					DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).unspawn().setPartyInside(false);
				}

				if (reasonTP && (jumps_current < getMaxJumps()) && (_party.getMemberCount() > deadPlayers.size()))
				{
					jumps_current++;

					_completedRooms.add(_choosenRoom);
					_choosenRoom = -1;

					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToNextRoom(p);
						}
					}
					createTeleporterTimer(true);
					createSpawnTimer(_choosenRoom);
				}
				else
				{
					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToWaitingRoom(p);
						}
					}
					killRift();
					cancel();
				}
			}
		};

		if (reasonTP)
		{
			long jumpTime = calcTimeToNextJump();
			teleporterTimer.schedule(teleporterTimerTask, jumpTime); // Teleporter task, 8-10 minutes

			earthQuakeTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
			{
				@Override
				public void run()
				{
					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							p.sendPacket(new Earthquake(p.getX(), p.getY(), p.getZ(), 65, 9));
						}
					}
				}
			}, jumpTime - 7000);
		}
		else
		{
			teleporterTimer.schedule(teleporterTimerTask, seconds_5); // incorrect party member invited.
		}
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.entity.DimensionalRift.createTeleporterTimer.scheduleGeneral.new Runnable with () -> {for(L2PcInstance p: _party.getMembers()){if(!revivedInWaitingRoom.contains(p)){p.sendPacket(new Earthquake(p.getX(),p.getY(),p.getZ(),65,9)); in method protected createTeleporterTimer(reasonTP boolean) : void from class com.l2jserver.gameserver.model.entity.DimensionalRift


	/**
	 * Zoey76: TODO: Rewrite this in a way that doesn't iterate over all spawns.
	 */
	public static void unspawnEventNpcs()
	{
		SpawnTable.getInstance().forEachSpawn(spawn ->
		{
			L2Npc npc = spawn.getLastSpawn();
			if ((npc != null) && npc.isEventMob())
			{
				npc.deleteMe();
				spawn.stopRespawn();
				SpawnTable.getInstance().deleteSpawn(spawn, false);
			}
			return true;
		});
	}

	/**
	 * Zoey76: TODO: Rewrite this in a way that doesn't iterate over all spawns.
	 */
	public static void unspawnEventNpcs()
	{
		SpawnTable.getInstance().forEachSpawn(new IL2Procedure<L2Spawn>()
		{
			@Override
			public boolean execute(L2Spawn spawn)
			{
				L2Npc npc = spawn.getLastSpawn();
				if ((npc != null) && npc.isEventMob())
				{
					npc.deleteMe();
					spawn.stopRespawn();
					SpawnTable.getInstance().deleteSpawn(spawn, false);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.entity.L2Event.unspawnEventNpcs.forEachSpawn.new IL2Procedure<L2Spawn> with spawn -> {L2Npc npc=spawn.getLastSpawn(); in method public unspawnEventNpcs() : void from class com.l2jserver.gameserver.model.entity.L2Event


	private void updateCompStatus()
	{
		// _compStarted = false;

		synchronized (this)
		{
			long milliToStart = getMillisToCompBegin();

			double numSecs = (milliToStart / 1000) % 60;
			double countDown = ((milliToStart / 1000.) - numSecs) / 60;
			int numMins = (int) Math.floor(countDown % 60);
			countDown = (countDown - numMins) / 60;
			int numHours = (int) Math.floor(countDown % 24);
			int numDays = (int) Math.floor((countDown - numHours) / 24);

			_log.info("Olympiad System: Competition Period Starts in " + numDays + " days, " + numHours + " hours and " + numMins + " mins.");

			_log.info("Olympiad System: Event starts/started : " + _compStart.getTime());
		}

		_scheduledCompStart = ThreadPoolManager.getInstance().scheduleGeneral(() ->
		{
			if (isOlympiadEnd())
			{
				return;
			}

			_inCompPeriod = true;

			Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_GAME_HAS_STARTED));
			_log.info("Olympiad System: Olympiad Game Started");
			_logResults.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");

			_gameManager = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
			if (Config.ALT_OLY_ANNOUNCE_GAMES)
			{
				_gameAnnouncer = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
			}

			long regEnd = getMillisToCompEnd() - 600000;
			if (regEnd > 0)
			{
				ThreadPoolManager.getInstance().scheduleGeneral(() -> Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_REGISTRATION_PERIOD_ENDED)), regEnd);
			}

			_scheduledCompEnd = ThreadPoolManager.getInstance().scheduleGeneral(() ->
			{
				if (isOlympiadEnd())
				{
					return;
				}
				_inCompPeriod = false;
				Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_GAME_HAS_ENDED));
				_log.info("Olympiad System: Olympiad Game Ended");

				while (OlympiadGameManager.getInstance().isBattleStarted()) // cleared in game manager
				{
					try
					{
						// wait 1 minutes for end of pendings games
						Thread.sleep(60000);
					}
					catch (InterruptedException e)
					{
					}
				}

				if (_gameManager != null)
				{
					_gameManager.cancel(false);
					_gameManager = null;
				}

				if (_gameAnnouncer != null)
				{
					_gameAnnouncer.cancel(false);
					_gameAnnouncer = null;
				}

				saveOlympiadStatus();

				init();
			}, getMillisToCompEnd());
		}, getMillisToCompBegin());
	}

	private void updateCompStatus()
	{
		// _compStarted = false;

		synchronized (this)
		{
			long milliToStart = getMillisToCompBegin();

			double numSecs = (milliToStart / 1000) % 60;
			double countDown = ((milliToStart / 1000.) - numSecs) / 60;
			int numMins = (int) Math.floor(countDown % 60);
			countDown = (countDown - numMins) / 60;
			int numHours = (int) Math.floor(countDown % 24);
			int numDays = (int) Math.floor((countDown - numHours) / 24);

			_log.info("Olympiad System: Competition Period Starts in " + numDays + " days, " + numHours + " hours and " + numMins + " mins.");

			_log.info("Olympiad System: Event starts/started : " + _compStart.getTime());
		}

		_scheduledCompStart = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
		{
			@Override
			public void run()
			{
				if (isOlympiadEnd())
				{
					return;
				}

				_inCompPeriod = true;

				Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_GAME_HAS_STARTED));
				_log.info("Olympiad System: Olympiad Game Started");
				_logResults.info("Result,Player1,Player2,Player1 HP,Player2 HP,Player1 Damage,Player2 Damage,Points,Classed");

				_gameManager = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(OlympiadGameManager.getInstance(), 30000, 30000);
				if (Config.ALT_OLY_ANNOUNCE_GAMES)
				{
					_gameAnnouncer = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new OlympiadAnnouncer(), 30000, 500);
				}

				long regEnd = getMillisToCompEnd() - 600000;
				if (regEnd > 0)
				{
					ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
					{
						@Override
						public void run()
						{
							Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.OLYMPIAD_REGISTRATION_PERIOD_ENDED));
						}
					}, regEnd);
				}

				_scheduledCompEnd = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
				{
					@Override
					public void run()
					{
						if (isOlympiadEnd())
						{
							return;
						}
						_inCompPeriod = false;
						Announcements.getInstance().announceToAll(SystemMessage.getSystemMessage(SystemMessageId.THE_OLYMPIAD_GAME_HAS_ENDED));
						_log.info("Olympiad System: Olympiad Game Ended");

						while (OlympiadGameManager.getInstance().isBattleStarted()) // cleared in game manager
						{
							try
							{
								// wait 1 minutes for end of pendings games
								Thread.sleep(60000);
							}
							catch (InterruptedException e)
							{
							}
						}

						if (_gameManager != null)
						{
							_gameManager.cancel(false);
							_gameManager = null;
						}

						if (_gameAnnouncer != null)
						{
							_gameAnnouncer.cancel(false);
							_gameAnnouncer = null;
						}

						saveOlympiadStatus();

						init();
					}
				}, getMillisToCompEnd());
			}
		}, getMillisToCompBegin());
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.olympiad.Olympiad.updateCompStatus.scheduleGeneral.new Runnable with () -> {if(isOlympiadEnd()){return; in method private updateCompStatus() : void from class com.l2jserver.gameserver.model.olympiad.Olympiad


	private void scheduleWeeklyChange()
	{
		_scheduledWeeklyTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(() ->
		{
			addWeeklyPoints();
			_log.info("Olympiad System: Added weekly points to nobles");
			resetWeeklyMatches();
			_log.info("Olympiad System: Reset weekly matches to nobles");

			Calendar nextChange = Calendar.getInstance();
			_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
		}, getMillisToWeekChange(), WEEKLY_PERIOD);
	}

	private void scheduleWeeklyChange()
	{
		_scheduledWeeklyTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new Runnable()
		{
			@Override
			public void run()
			{
				addWeeklyPoints();
				_log.info("Olympiad System: Added weekly points to nobles");
				resetWeeklyMatches();
				_log.info("Olympiad System: Reset weekly matches to nobles");

				Calendar nextChange = Calendar.getInstance();
				_nextWeeklyChange = nextChange.getTimeInMillis() + WEEKLY_PERIOD;
			}
		}, getMillisToWeekChange(), WEEKLY_PERIOD);
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.olympiad.Olympiad.scheduleWeeklyChange.scheduleGeneralAtFixedRate.new Runnable with () -> {addWeeklyPoints(); in method private scheduleWeeklyChange() : void from class com.l2jserver.gameserver.model.olympiad.Olympiad


	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		try
		{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception e)
		{
			// couldn't care less
		}

		final ResourceBundle bundle = ResourceBundle.getBundle("configurator.Configurator", Locale.getDefault(), LanguageControl.INSTANCE);

		SwingUtilities.invokeLater(() ->
		{
			ConfigUserInterface cui = new ConfigUserInterface(bundle);
			cui.setVisible(true);
		});
	}

	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		try
		{
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception e)
		{
			// couldn't care less
		}

		final ResourceBundle bundle = ResourceBundle.getBundle("configurator.Configurator", Locale.getDefault(), LanguageControl.INSTANCE);

		SwingUtilities.invokeLater(new Runnable()
		{
			@Override
			public void run()
			{
				ConfigUserInterface cui = new ConfigUserInterface(bundle);
				cui.setVisible(true);
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.tools.configurator.ConfigUserInterface.main.invokeLater.new Runnable with () -> {ConfigUserInterface cui=new ConfigUserInterface(bundle); in method public main(args String[]) : void from class com.l2jserver.tools.configurator.ConfigUserInterface


	public DBConfigGUI(String db, String dir, String cleanUp)
	{
		super("L2J Database Installer");
		setLayout(new SpringLayout());
		setDefaultLookAndFeelDecorated(true);
		setIconImage(ImagesTable.getImage("l2j.png").getImage());

		_db = db;
		_dir = dir;
		_cleanUp = cleanUp;

		int width = 260;
		int height = 220;
		Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize();

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height);
		setResizable(false);

		_prop = Preferences.userRoot();

		// Host
		JLabel labelDbHost = new JLabel("Host: ", SwingConstants.LEFT);
		add(labelDbHost);
		_dbHost = new JTextField(15);
		_dbHost.setText(_prop.get("dbHost_" + db, "localhost"));
		labelDbHost.setLabelFor(_dbHost);
		add(_dbHost);

		// Port
		JLabel labelDbPort = new JLabel("Port: ", SwingConstants.LEFT);
		add(labelDbPort);
		_dbPort = new JTextField(15);
		_dbPort.setText(_prop.get("dbPort_" + db, "3306"));
		labelDbPort.setLabelFor(_dbPort);
		add(_dbPort);

		// Username
		JLabel labelDbUser = new JLabel("Username: ", SwingConstants.LEFT);
		add(labelDbUser);
		_dbUser = new JTextField(15);
		_dbUser.setText(_prop.get("dbUser_" + db, "root"));
		labelDbUser.setLabelFor(_dbUser);
		add(_dbUser);

		// Password
		JLabel labelDbPass = new JLabel("Password: ", SwingConstants.LEFT);
		add(labelDbPass);
		_dbPass = new JPasswordField(15);
		_dbPass.setText(_prop.get("dbPass_" + db, ""));
		labelDbPass.setLabelFor(_dbPass);
		add(_dbPass);

		// Database
		JLabel labelDbDbse = new JLabel("Database: ", SwingConstants.LEFT);
		add(labelDbDbse);
		_dbDbse = new JTextField(15);
		_dbDbse.setText(_prop.get("dbDbse_" + db, db));
		labelDbDbse.setLabelFor(_dbDbse);
		add(_dbDbse);

		ActionListener cancelListener = e -> System.exit(0);

		// Cancel
		JButton btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(cancelListener);
		add(btnCancel);

		ActionListener connectListener = e ->
		{
			MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false);

			if (connector.getConnection() != null)
			{
				_prop.put("dbHost_" + _db, _dbHost.getText());
				_prop.put("dbPort_" + _db, _dbPort.getText());
				_prop.put("dbUser_" + _db, _dbUser.getText());
				_prop.put("dbDbse_" + _db, _dbDbse.getText());

				boolean cleanInstall = false;
				DBInstallerGUI dbi = new DBInstallerGUI(connector.getConnection());
				setVisible(false);

				Object[] options =
				{
					"Full Install",
					"Upgrade",
					"Exit"
				};
				int n = JOptionPane.showOptionDialog(null, "Select Installation Type", "Installation Type", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);

				if ((n == 2) || (n == -1))
				{
					System.exit(0);
				}

				if (n == 0)
				{
					int conf = JOptionPane.showConfirmDialog(null, "Do you really want to destroy your db?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);

					if (conf == 1)
					{
						System.exit(0);
					}

					cleanInstall = true;
				}

				dbi.setVisible(true);

				RunTasks task = new RunTasks(dbi, _db, _dir, _cleanUp, cleanInstall);
				task.setPriority(Thread.MAX_PRIORITY);
				task.start();
			}
		};

		// Connect
		JButton btnConnect = new JButton("Connect");
		btnConnect.addActionListener(connectListener);
		add(btnConnect);

		SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);

		setVisible(true);
	}

	public DBConfigGUI(String db, String dir, String cleanUp)
	{
		super("L2J Database Installer");
		setLayout(new SpringLayout());
		setDefaultLookAndFeelDecorated(true);
		setIconImage(ImagesTable.getImage("l2j.png").getImage());

		_db = db;
		_dir = dir;
		_cleanUp = cleanUp;

		int width = 260;
		int height = 220;
		Dimension resolution = Toolkit.getDefaultToolkit().getScreenSize();

		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds((resolution.width - width) / 2, (resolution.height - height) / 2, width, height);
		setResizable(false);

		_prop = Preferences.userRoot();

		// Host
		JLabel labelDbHost = new JLabel("Host: ", SwingConstants.LEFT);
		add(labelDbHost);
		_dbHost = new JTextField(15);
		_dbHost.setText(_prop.get("dbHost_" + db, "localhost"));
		labelDbHost.setLabelFor(_dbHost);
		add(_dbHost);

		// Port
		JLabel labelDbPort = new JLabel("Port: ", SwingConstants.LEFT);
		add(labelDbPort);
		_dbPort = new JTextField(15);
		_dbPort.setText(_prop.get("dbPort_" + db, "3306"));
		labelDbPort.setLabelFor(_dbPort);
		add(_dbPort);

		// Username
		JLabel labelDbUser = new JLabel("Username: ", SwingConstants.LEFT);
		add(labelDbUser);
		_dbUser = new JTextField(15);
		_dbUser.setText(_prop.get("dbUser_" + db, "root"));
		labelDbUser.setLabelFor(_dbUser);
		add(_dbUser);

		// Password
		JLabel labelDbPass = new JLabel("Password: ", SwingConstants.LEFT);
		add(labelDbPass);
		_dbPass = new JPasswordField(15);
		_dbPass.setText(_prop.get("dbPass_" + db, ""));
		labelDbPass.setLabelFor(_dbPass);
		add(_dbPass);

		// Database
		JLabel labelDbDbse = new JLabel("Database: ", SwingConstants.LEFT);
		add(labelDbDbse);
		_dbDbse = new JTextField(15);
		_dbDbse.setText(_prop.get("dbDbse_" + db, db));
		labelDbDbse.setLabelFor(_dbDbse);
		add(_dbDbse);

		ActionListener cancelListener = new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				System.exit(0);
			}
		};

		// Cancel
		JButton btnCancel = new JButton("Cancel");
		btnCancel.addActionListener(cancelListener);
		add(btnCancel);

		ActionListener connectListener = new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				MySqlConnect connector = new MySqlConnect(_dbHost.getText(), _dbPort.getText(), _dbUser.getText(), new String(_dbPass.getPassword()), _dbDbse.getText(), false);

				if (connector.getConnection() != null)
				{
					_prop.put("dbHost_" + _db, _dbHost.getText());
					_prop.put("dbPort_" + _db, _dbPort.getText());
					_prop.put("dbUser_" + _db, _dbUser.getText());
					_prop.put("dbDbse_" + _db, _dbDbse.getText());

					boolean cleanInstall = false;
					DBInstallerGUI dbi = new DBInstallerGUI(connector.getConnection());
					setVisible(false);

					Object[] options =
					{
						"Full Install",
						"Upgrade",
						"Exit"
					};
					int n = JOptionPane.showOptionDialog(null, "Select Installation Type", "Installation Type", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[1]);

					if ((n == 2) || (n == -1))
					{
						System.exit(0);
					}

					if (n == 0)
					{
						int conf = JOptionPane.showConfirmDialog(null, "Do you really want to destroy your db?", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);

						if (conf == 1)
						{
							System.exit(0);
						}

						cleanInstall = true;
					}

					dbi.setVisible(true);

					RunTasks task = new RunTasks(dbi, _db, _dir, _cleanUp, cleanInstall);
					task.setPriority(Thread.MAX_PRIORITY);
					task.start();
				}
			}
		};

		// Connect
		JButton btnConnect = new JButton("Connect");
		btnConnect.addActionListener(connectListener);
		add(btnConnect);

		SpringUtilities.makeCompactGrid(getContentPane(), 6, 2, 5, 5, 5, 5);

		setVisible(true);
	}

Replace Anonymous With Lambda com.l2jserver.tools.dbinstaller.gui.DBConfigGUI.DBConfigGUI.connectListener.new ActionListener with e -> {MySqlConnect connector=new MySqlConnect(_dbHost.getText(),_dbPort.getText(),_dbUser.getText(),new String(_dbPass.getPassword()),_dbDbse.getText(),false); in method public DBConfigGUI(db String, dir String, cleanUp String) from class com.l2jserver.tools.dbinstaller.gui.DBConfigGUI


	/**
	 * Start the GUI.
	 * @param bundle the bundle.
	 */
	private static void startGUI(final ResourceBundle bundle)
	{
		try
		{
			// avoid that ugly Metal LaF
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception e)
		{
			// couldn't care less
		}

		SwingUtilities.invokeLater(() ->
		{
			GUserInterface gui = new GUserInterface(bundle);
			gui.getFrame().setVisible(true);
		});
	}

	/**
	 * Start the GUI.
	 * @param bundle the bundle.
	 */
	private static void startGUI(final ResourceBundle bundle)
	{
		try
		{
			// avoid that ugly Metal LaF
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch (Exception e)
		{
			// couldn't care less
		}

		SwingUtilities.invokeLater(new Runnable()
		{
			@Override
			public void run()
			{
				GUserInterface gui = new GUserInterface(bundle);
				gui.getFrame().setVisible(true);
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.tools.gsregistering.BaseGameServerRegister.startGUI.invokeLater.new Runnable with () -> {GUserInterface gui=new GUserInterface(bundle); in method private startGUI(bundle ResourceBundle) : void from class com.l2jserver.tools.gsregistering.BaseGameServerRegister


	protected void refreshServers()
	{
		if (!isLoaded())
		{
			load();
		}

		// load succeeded?
		if (isLoaded())
		{
			SwingUtilities.invokeLater(() ->
			{
				int size = GameServerTable.getInstance().getServerNames().size();
				if (size == 0)
				{
					String title = getBundle().getString("error");
					String msg = getBundle().getString("noServerNames");
					JOptionPane.showMessageDialog(getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
					System.exit(1);
				}
				// reset
				_dtm.setRowCount(0);

				for (final int id : GameServerTable.getInstance().getRegisteredGameServers().keySet())
				{
					String name = GameServerTable.getInstance().getServerNameById(id);
					JButton button = new JButton(getBundle().getString("btnRemove"), ImagesTable.getImage("cross.png"));
					button.addActionListener(e ->
					{
						String sid = String.valueOf(id);
						String sname = GameServerTable.getInstance().getServerNameById(id);

						int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveText").replace("%d", sid).replace("%s", sname), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
						if (choice == JOptionPane.YES_OPTION)
						{
							try
							{
								BaseGameServerRegister.unregisterGameServer(id);
								GUserInterface.this.refreshAsync();
							}
							catch (SQLException e1)
							{
								GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
							}
						}
					});
					_dtm.addRow(new Object[]
					{
						id,
						name,
						button
					});
				}
			});
		}
	}

	protected void refreshServers()
	{
		if (!isLoaded())
		{
			load();
		}

		// load succeeded?
		if (isLoaded())
		{
			SwingUtilities.invokeLater(new Runnable()
			{
				@Override
				public void run()
				{
					int size = GameServerTable.getInstance().getServerNames().size();
					if (size == 0)
					{
						String title = getBundle().getString("error");
						String msg = getBundle().getString("noServerNames");
						JOptionPane.showMessageDialog(getFrame(), msg, title, JOptionPane.ERROR_MESSAGE);
						System.exit(1);
					}
					// reset
					_dtm.setRowCount(0);

					for (final int id : GameServerTable.getInstance().getRegisteredGameServers().keySet())
					{
						String name = GameServerTable.getInstance().getServerNameById(id);
						JButton button = new JButton(getBundle().getString("btnRemove"), ImagesTable.getImage("cross.png"));
						button.addActionListener(new ActionListener()
						{
							@Override
							public void actionPerformed(ActionEvent e)
							{
								String sid = String.valueOf(id);
								String sname = GameServerTable.getInstance().getServerNameById(id);

								int choice = JOptionPane.showConfirmDialog(getFrame(), getBundle().getString("confirmRemoveText").replace("%d", sid).replace("%s", sname), getBundle().getString("confirmRemoveTitle"), JOptionPane.YES_NO_OPTION);
								if (choice == JOptionPane.YES_OPTION)
								{
									try
									{
										BaseGameServerRegister.unregisterGameServer(id);
										GUserInterface.this.refreshAsync();
									}
									catch (SQLException e1)
									{
										GUserInterface.this.showError(getBundle().getString("errorUnregister"), e1);
									}
								}
							}
						});
						_dtm.addRow(new Object[]
						{
							id,
							name,
							button
						});
					}
				}
			});
		}
	}

Replace Anonymous With Lambda com.l2jserver.tools.gsregistering.GUserInterface.refreshServers.invokeLater.new Runnable with () -> {int size=GameServerTable.getInstance().getServerNames().size(); in method protected refreshServers() : void from class com.l2jserver.tools.gsregistering.GUserInterface


	/**
	 * Delete item object from world
	 */
	public void deleteMe()
	{
		try
		{
			updateDatabase();
		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "deletedMe()", e);
		}
		List<L2Object> items = new FastList<>(_items);
		_items.clear();

		L2World.getInstance().removeObjects(items);
	}

	/**
	 * Delete item object from world
	 */
	public void deleteMe()
	{
		try
		{
			updateDatabase();
		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "deletedMe()", e);
		}
		List<L2Object> items = new FastList<L2Object>(_items);
		_items.clear();

		L2World.getInstance().removeObjects(items);
	}

Replace Generic With Diamond FastList<L2Object> with FastList<> in method public deleteMe() : void from class com.l2jserver.gameserver.model.itemcontainer.ItemContainer


	private final void fireCharacterArrived(final L2Character character)
	{
		final L2CharacterAI ai = character.getAI();
		if (ai == null)
		{
			return;
		}

		ThreadPoolManager.getInstance().executeAi(() ->
		{
			try
			{
				if (Config.MOVE_BASED_KNOWNLIST)
				{
					character.getKnownList().findObjects();
				}

				ai.notifyEvent(CtrlEvent.EVT_ARRIVED);
			}
			catch (final Throwable e)
			{
				_log.log(Level.WARNING, "", e);
			}
		});
	}

	private final void fireCharacterArrived(final L2Character character)
	{
		final L2CharacterAI ai = character.getAI();
		if (ai == null)
		{
			return;
		}

		ThreadPoolManager.getInstance().executeAi(new Runnable()
		{
			@Override
			public final void run()
			{
				try
				{
					if (Config.MOVE_BASED_KNOWNLIST)
					{
						character.getKnownList().findObjects();
					}

					ai.notifyEvent(CtrlEvent.EVT_ARRIVED);
				}
				catch (final Throwable e)
				{
					_log.log(Level.WARNING, "", e);
				}
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.GameTimeController.fireCharacterArrived.executeAi.new Runnable with () -> {tryif(Config.MOVE_BASED_KNOWNLIST){character.getKnownList().findObjects(); in method private fireCharacterArrived(character L2Character) : void from class com.l2jserver.gameserver.GameTimeController


	protected void createTeleporterTimer(final boolean reasonTP)
	{
		if (_party == null)
		{
			return;
		}

		if (teleporterTimerTask != null)
		{
			teleporterTimerTask.cancel();
			teleporterTimerTask = null;
		}

		if (teleporterTimer != null)
		{
			teleporterTimer.cancel();
			teleporterTimer = null;
		}

		if (earthQuakeTask != null)
		{
			earthQuakeTask.cancel(false);
			earthQuakeTask = null;
		}

		teleporterTimer = new Timer();
		teleporterTimerTask = new TimerTask()
		{
			@Override
			public void run()
			{
				if (_choosenRoom > -1)
				{
					DimensionalRiftManager.getInstance().getRoom(_type, _choosenRoom).unspawn().setPartyInside(false);
				}

				if (reasonTP && (jumps_current < getMaxJumps()) && (_party.getMemberCount() > deadPlayers.size()))
				{
					jumps_current++;

					_completedRooms.add(_choosenRoom);
					_choosenRoom = -1;

					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToNextRoom(p);
						}
					}
					createTeleporterTimer(true);
					createSpawnTimer(_choosenRoom);
				}
				else
				{
					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							teleportToWaitingRoom(p);
						}
					}
					killRift();
					cancel();
				}
			}
		};

		if (reasonTP)
		{
			long jumpTime = calcTimeToNextJump();
			teleporterTimer.schedule(teleporterTimerTask, jumpTime); // Teleporter task, 8-10 minutes

			earthQuakeTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
			{
				@Override
				public void run()
				{
					for (L2PcInstance p : _party.getMembers())
					{
						if (!revivedInWaitingRoom.contains(p))
						{
							p.sendPacket(new Earthquake(p.getX(), p.getY(), p.getZ(), 65, 9));
						}
					}
				}
			}, jumpTime - 7000);
		}
		else
		{
			teleporterTimer.schedule(teleporterTimerTask, seconds_5); // incorrect party member invited.
		}
	}


	/**
	 * @return a list of object IDs of the members of this group
	 */
	public List<Integer> getMembersObjectId()
	{
		final List<Integer> ids = new ArrayList<>();
		forEachMember(new IProcedure<L2PcInstance, Boolean>()
		{
			@Override
			public Boolean execute(L2PcInstance member)
			{
				ids.add(member.getObjectId());
				return true;
			}
		});
		return ids;
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.getMembersObjectId.forEachMember.new IProcedure<L2PcInstance,Boolean> with m -> {ids.add(m.getObjectId()); in method public getMembersObjectId() : List<Integer> from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	/**
	 * Broadcast a packet to every member of this group.
	 * @param packet the packet to broadcast
	 */
	public void broadcastPacket(final L2GameServerPacket packet)
	{
		forEachMember(new IProcedure<L2PcInstance, Boolean>()
		{
			@Override
			public Boolean execute(L2PcInstance member)
			{
				if (member != null)
				{
					member.sendPacket(packet);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.broadcastPacket.forEachMember.new IProcedure<L2PcInstance,Boolean> with m -> {if(m != null){m.sendPacket(packet); in method public broadcastPacket(packet L2GameServerPacket) : void from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	public void broadcastCreatureSay(final CreatureSay msg, final L2PcInstance broadcaster)
	{
		forEachMember(new IProcedure<L2PcInstance, Boolean>()
		{
			@Override
			public Boolean execute(L2PcInstance member)
			{
				if ((member != null) && !BlockList.isBlocked(member, broadcaster))
				{
					member.sendPacket(msg);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.AbstractPlayerGroup.broadcastCreatureSay.forEachMember.new IProcedure<L2PcInstance,Boolean> with m -> {if((m != null) && !BlockList.isBlocked(m,broadcaster)){m.sendPacket(msg); in method public broadcastCreatureSay(msg CreatureSay, broadcaster L2PcInstance) : void from class com.l2jserver.gameserver.model.AbstractPlayerGroup


	/**
	 * Zoey76: TODO: Rewrite this in a way that doesn't iterate over all spawns.
	 */
	public static void unspawnEventNpcs()
	{
		SpawnTable.getInstance().forEachSpawn(new IProcedure<L2Spawn, Boolean>()
		{
			@Override
			public Boolean execute(L2Spawn spawn)
			{
				L2Npc npc = spawn.getLastSpawn();
				if ((npc != null) && npc.isEventMob())
				{
					npc.deleteMe();
					spawn.stopRespawn();
					SpawnTable.getInstance().deleteSpawn(spawn, false);
				}
				return true;
			}
		});
	}

Replace Anonymous With Lambda com.l2jserver.gameserver.model.entity.L2Event.unspawnEventNpcs.forEachSpawn.new IProcedure<L2Spawn,Boolean> with spawn -> {L2Npc npc=spawn.getLastSpawn(); in method public unspawnEventNpcs() : void from class com.l2jserver.gameserver.model.entity.L2Event


	public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, String slot, int rate, int max)
	{
		final List<BuffInfo> canceled = new ArrayList<>(max);
		switch (slot)
		{
			case "buff":
			{
				// Resist Modifier.
				int cancelMagicLvl = skill.getMagicLevel();
				final double vuln = target.calcStat(Stats.CANCEL_VULN, 0, target, null);
				final double prof = activeChar.calcStat(Stats.CANCEL_PROF, 0, target, null);
				double resMod = 1 + (((vuln + prof) * -1) / 100);
				double finalRate = rate / resMod;

				if (activeChar.isDebug())
				{
					final StatsSet set = new StatsSet();
					set.set("baseMod", rate);
					set.set("magicLevel", cancelMagicLvl);
					set.set("resMod", resMod);
					set.set("rate", finalRate);
					Debug.sendSkillDebug(activeChar, target, skill, set);
				}

				// Prevent initialization.
				final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs().values()) : new ArrayList<>(1);
				if (target.getEffectList().hasTriggered())
				{
					buffs.addAll(target.getEffectList().getTriggered().values());
				}
				if (target.getEffectList().hasDances())
				{
					buffs.addAll(target.getEffectList().getDances().values());
				}
				for (int i = buffs.size() - 1; i >= 0; i--) // reverse order
				{
					BuffInfo info = buffs.get(i);
					if (!info.getSkill().canBeStolen() || (!calcCancelSuccess(info, cancelMagicLvl, (int) finalRate, skill)))
					{
						continue;
					}
					canceled.add(info);
					if (canceled.size() >= max)
					{
						break;
					}
				}
				break;
			}
			case "debuff":
			{
				final List<BuffInfo> debuffs = new ArrayList<>(target.getEffectList().getDebuffs().values());
				for (int i = debuffs.size() - 1; i >= 0; i--)
				{
					BuffInfo info = debuffs.get(i);
					if (info.getSkill().isDebuff() && info.getSkill().canBeDispeled() && (Rnd.get(100) <= rate))
					{
						canceled.add(info);
						if (canceled.size() >= max)
						{
							break;
						}
					}
				}
				break;
			}
		}
		return canceled;
	}

	public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, Skill skill, String slot, int rate, int max)
	{
		final List<BuffInfo> canceled = new ArrayList<>(max);
		switch (slot)
		{
			case "buff":
			{
				// Resist Modifier.
				int cancelMagicLvl = skill.getMagicLevel();
				final double vuln = target.calcStat(Stats.CANCEL_VULN, 0, target, null);
				final double prof = activeChar.calcStat(Stats.CANCEL_PROF, 0, target, null);
				double resMod = 1 + (((vuln + prof) * -1) / 100);
				double finalRate = rate / resMod;

				if (activeChar.isDebug())
				{
					final StatsSet set = new StatsSet();
					set.set("baseMod", rate);
					set.set("magicLevel", cancelMagicLvl);
					set.set("resMod", resMod);
					set.set("rate", finalRate);
					Debug.sendSkillDebug(activeChar, target, skill, set);
				}

				// Prevent initialization.
				final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs().values()) : new ArrayList<BuffInfo>(1);
				if (target.getEffectList().hasTriggered())
				{
					buffs.addAll(target.getEffectList().getTriggered().values());
				}
				if (target.getEffectList().hasDances())
				{
					buffs.addAll(target.getEffectList().getDances().values());
				}
				for (int i = buffs.size() - 1; i >= 0; i--) // reverse order
				{
					BuffInfo info = buffs.get(i);
					if (!info.getSkill().canBeStolen() || (!calcCancelSuccess(info, cancelMagicLvl, (int) finalRate, skill)))
					{
						continue;
					}
					canceled.add(info);
					if (canceled.size() >= max)
					{
						break;
					}
				}
				break;
			}
			case "debuff":
			{
				final List<BuffInfo> debuffs = new ArrayList<>(target.getEffectList().getDebuffs().values());
				for (int i = debuffs.size() - 1; i >= 0; i--)
				{
					BuffInfo info = debuffs.get(i);
					if (info.getSkill().isDebuff() && info.getSkill().canBeDispeled() && (Rnd.get(100) <= rate))
					{
						canceled.add(info);
						if (canceled.size() >= max)
						{
							break;
						}
					}
				}
				break;
			}
		}
		return canceled;
	}

Replace Generic With Diamond ArrayList<BuffInfo> with ArrayList<> in method public calcCancelStealEffects(activeChar L2Character, target L2Character, skill Skill, slot String, rate int, max int) : List<BuffInfo> from class com.l2jserver.gameserver.model.stats.Formulas


	/**
	 * Delete item object from world
	 */
	public void deleteMe()
	{
		try
		{
			updateDatabase();
		}
		catch (Exception e)
		{
			_log.log(Level.SEVERE, "deletedMe()", e);
		}
		final List<L2Object> items = new ArrayList<>(_items);
		_items.clear();

		L2World.getInstance().removeObjects(items);
	}

Replace Generic With Diamond FastList<L2Object> with ArrayList<> in method public deleteMe() : void from class com.l2jserver.gameserver.model.itemcontainer.ItemContainer


	public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, L2Skill skill, String slot, int rate, int max)
	{
		final List<BuffInfo> canceled = new ArrayList<>(max);
		switch (slot)
		{
			case "buff":
			{
				// Resist Modifier.
				int cancelMagicLvl = skill.getMagicLevel();
				final double vuln = target.calcStat(Stats.CANCEL_VULN, 0, target, null);
				final double prof = activeChar.calcStat(Stats.CANCEL_PROF, 0, target, null);
				double resMod = 1 + (((vuln + prof) * -1) / 100);
				double finalRate = rate / resMod;

				if (activeChar.isDebug())
				{
					final StatsSet set = new StatsSet();
					set.set("baseMod", rate);
					set.set("magicLevel", cancelMagicLvl);
					set.set("resMod", resMod);
					set.set("rate", finalRate);
					Debug.sendSkillDebug(activeChar, target, skill, set);
				}

				// Prevent initialization.
				final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs().values()) : new ArrayList<>(1);
				if (target.getEffectList().hasTriggered())
				{
					buffs.addAll(target.getEffectList().getTriggered().values());
				}
				if (target.getEffectList().hasDances())
				{
					buffs.addAll(target.getEffectList().getDances().values());
				}
				for (int i = buffs.size() - 1; i >= 0; i--) // reverse order
				{
					BuffInfo info = buffs.get(i);
					if (!info.getSkill().canBeStolen() || (!calcCancelSuccess(info, cancelMagicLvl, (int) finalRate, skill)))
					{
						continue;
					}
					canceled.add(info);
					if (canceled.size() >= max)
					{
						break;
					}
				}
				break;
			}
			case "debuff":
			{
				final List<BuffInfo> debuffs = new ArrayList<>(target.getEffectList().getDebuffs().values());
				for (int i = debuffs.size() - 1; i >= 0; i--)
				{
					BuffInfo info = debuffs.get(i);
					if (info.getSkill().isDebuff() && info.getSkill().canBeDispeled() && (Rnd.get(100) <= rate))
					{
						canceled.add(info);
						if (canceled.size() >= max)
						{
							break;
						}
					}
				}
				break;
			}
		}
		return canceled;
	}

	public static List<BuffInfo> calcCancelStealEffects(L2Character activeChar, L2Character target, L2Skill skill, String slot, int rate, int max)
	{
		final List<BuffInfo> canceled = new ArrayList<>(max);
		switch (slot)
		{
			case "buff":
			{
				// Resist Modifier.
				int cancelMagicLvl = skill.getMagicLevel();
				final double vuln = target.calcStat(Stats.CANCEL_VULN, 0, target, null);
				final double prof = activeChar.calcStat(Stats.CANCEL_PROF, 0, target, null);
				double resMod = 1 + (((vuln + prof) * -1) / 100);
				double finalRate = rate / resMod;

				if (activeChar.isDebug())
				{
					final StatsSet set = new StatsSet();
					set.set("baseMod", rate);
					set.set("magicLevel", cancelMagicLvl);
					set.set("resMod", resMod);
					set.set("rate", finalRate);
					Debug.sendSkillDebug(activeChar, target, skill, set);
				}

				// Prevent initialization.
				final List<BuffInfo> buffs = target.getEffectList().hasBuffs() ? new ArrayList<>(target.getEffectList().getBuffs().values()) : new ArrayList<BuffInfo>(1);
				if (target.getEffectList().hasTriggered())
				{
					buffs.addAll(target.getEffectList().getTriggered().values());
				}
				if (target.getEffectList().hasDances())
				{
					buffs.addAll(target.getEffectList().getDances().values());
				}
				for (int i = buffs.size() - 1; i >= 0; i--) // reverse order
				{
					BuffInfo info = buffs.get(i);
					if (!info.getSkill().canBeStolen() || (!calcCancelSuccess(info, cancelMagicLvl, (int) finalRate, skill)))
					{
						continue;
					}
					canceled.add(info);
					if (canceled.size() >= max)
					{
						break;
					}
				}
				break;
			}
			case "debuff":
			{
				final List<BuffInfo> debuffs = new ArrayList<>(target.getEffectList().getDebuffs().values());
				for (int i = debuffs.size() - 1; i >= 0; i--)
				{
					BuffInfo info = debuffs.get(i);
					if (info.getSkill().isDebuff() && info.getSkill().canBeDispeled() && (Rnd.get(100) <= rate))
					{
						canceled.add(info);
						if (canceled.size() >= max)
						{
							break;
						}
					}
				}
				break;
			}
		}
		return canceled;
	}

Replace Generic With Diamond ArrayList<BuffInfo> with ArrayList<> in method public calcCancelStealEffects(activeChar L2Character, target L2Character, skill L2Skill, slot String, rate int, max int) : List<BuffInfo> from class com.l2jserver.gameserver.model.stats.Formulas


	public L2Effect getEffect(Env env, boolean ignoreTest)
	{
		if (!ignoreTest && ((_attachCond != null) && !_attachCond.test(env)))
		{
			return null;
		}

		try
		{
			L2Effect effect = (L2Effect) _constructor.newInstance(env, this);
			return effect;
		}
		catch (IllegalAccessException | InstantiationException e)
		{
			_log.log(Level.WARNING, "", e);
			return null;
		}
		catch (InvocationTargetException e)
		{
			_log.log(Level.WARNING, "Error creating new instance of Class " + _func + " Exception was: " + e.getTargetException().getMessage(), e.getTargetException());
			return null;
		}
	}

	public L2Effect getEffect(Env env, boolean ignoreTest)
	{
		if (!ignoreTest && ((attachCond != null) && !attachCond.test(env)))
		{
			return null;
		}
		try
		{
			L2Effect effect = (L2Effect) _constructor.newInstance(env, this);
			return effect;
		}
		catch (IllegalAccessException e)
		{
			_log.log(Level.WARNING, "", e);
			return null;
		}
		catch (InstantiationException e)
		{
			_log.log(Level.WARNING, "", e);
			return null;
		}
		catch (InvocationTargetException e)
		{
			_log.log(Level.WARNING, "Error creating new instance of Class " + _func + " Exception was: " + e.getTargetException().getMessage(), e.getTargetException());
			return null;
		}

	}

Merge Catch [catch(IllegalAccessException e), catch(InstantiationException e)] to catch(IllegalAccessException|InstantiationException e) in method public getEffect(env Env, ignoreTest boolean) : L2Effect from class com.l2jserver.gameserver.model.effects.EffectTemplate