					public void run() {
						if (RayTracingOutputHandler.this.taskId == -1) return;

						System.out.println("RayTracingJobOutputHandler: Started file output thread for " +
											RayTracingOutputHandler.this.taskId + ".");

						w: while (!RayTracingOutputHandler.this.isComplete()) {
							try {
								Thread.sleep(1200000);

								if (RayTracingOutputHandler.this.image.length <= 0) continue w;

								System.out.println("RayTracingJobOutputHandler: Writing image for task " +
													RayTracingOutputHandler.this.taskId + " (" +
													RayTracingOutputHandler.this.image.length + ", " +
													RayTracingOutputHandler.this.image[0].length + ")...");

								try (PrintStream p = new PrintStream(new FileOutputStream(
											"images/NetworkRender-" +
											RayTracingOutputHandler.this.taskId + ".raw"))) {
									for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
										for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
											p.println("[" + i + ", " + j + "]: " +
													RayTracingOutputHandler.this.image[i][j]);
										}
									}
								}

								FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
										new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
										FileEncoder.JPEGEncoding);
							} catch (InterruptedException ie) {
								System.out.println("RayTracingOutputHandler: " + ie);
							} catch (IOException ioe) {
								System.out.println("RayTracingOutputHandler: " + ioe);
							}
						}

						if (RayTracingJob.defaultOutputHandler.children.remove(
								RayTracingOutputHandler.this))
							System.out.println("RayTracingOutputHandler (" +
									RayTracingOutputHandler.this.taskId +
									" Task is complete.");

						RayTracingOutputHandler.completedTasks.add(
								new Long(RayTracingOutputHandler.this.taskId));
					}

					public void run() {
						if (RayTracingOutputHandler.this.taskId == -1) return;

						System.out.println("RayTracingJobOutputHandler: Started file output thread for " +
											RayTracingOutputHandler.this.taskId + ".");

						w: while (!RayTracingOutputHandler.this.isComplete()) {
							try {
								Thread.sleep(1200000);

								if (RayTracingOutputHandler.this.image.length <= 0) continue w;

								System.out.println("RayTracingJobOutputHandler: Writing image for task " +
													RayTracingOutputHandler.this.taskId + " (" +
													RayTracingOutputHandler.this.image.length + ", " +
													RayTracingOutputHandler.this.image[0].length + ")...");

								PrintStream p = new PrintStream(new FileOutputStream(
											"images/NetworkRender-" +
											RayTracingOutputHandler.this.taskId + ".raw"));

								for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
									for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
										p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
									}
								}

								p.flush();
								p.close();

								FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
										new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
										FileEncoder.JPEGEncoding);
							} catch (InterruptedException ie) {
								System.out.println("RayTracingOutputHandler: " + ie);
							} catch (IOException ioe) {
								System.out.println("RayTracingOutputHandler: " + ioe);
							}
						}

						if (RayTracingJob.defaultOutputHandler.children.remove(
								RayTracingOutputHandler.this))
							System.out.println("RayTracingOutputHandler (" +
									RayTracingOutputHandler.this.taskId +
									" Task is complete.");

						RayTracingOutputHandler.completedTasks.add(
								new Long(RayTracingOutputHandler.this.taskId));
					}

Try With Resources try(PrintStream p=new PrintStream(new FileOutputStream("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) in method public run() : void from class com.almostrealism.raytracer.network.RayTracingJob.RayTracingOutputHandler.RayTracingOutputHandler.t.new Thread.new Runnable


		public void writeImage() {
			if (RayTracingOutputHandler.this.image.length <= 0) return;

			System.out.println("RayTracingOutputHandler: Writing image for task " +
								RayTracingOutputHandler.this.taskId + " (" +
								RayTracingOutputHandler.this.image.length + ", " +
								RayTracingOutputHandler.this.image[0].length + ")...");

			try (PrintStream p = new PrintStream(new FileOutputStream(
							"NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) {
				for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
					for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
						p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
					}
				}

				FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
						new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
						FileEncoder.JPEGEncoding);
			} catch (IOException ioe) {
				System.out.println("RayTracingJobOutputHandler: " + ioe);
			}
		}

		public void writeImage() {
			try {
				if (RayTracingOutputHandler.this.image.length <= 0) return;

				System.out.println("RayTracingOutputHandler: Writing image for task " +
									RayTracingOutputHandler.this.taskId + " (" +
									RayTracingOutputHandler.this.image.length + ", " +
									RayTracingOutputHandler.this.image[0].length + ")...");

				PrintStream p = new PrintStream(new FileOutputStream(
							"NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"));

				for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
					for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
						p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
					}
				}

				p.flush();
				p.close();

				FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
						new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
						FileEncoder.JPEGEncoding);
			} catch (IOException ioe) {
				System.out.println("RayTracingJobOutputHandler: " + ioe);
			}
		}

Try With Resources try(PrintStream p=new PrintStream(new FileOutputStream("NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) in method public writeImage() : void from class com.almostrealism.raytracer.network.RayTracingJob.RayTracingOutputHandler


		public void storeOutput(long time, int uid, JobOutput data) {
			if (data instanceof RayTracingJobOutput == false) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			RayTracingJobOutput output = (RayTracingJobOutput) data;

			if (output.getTaskId() <= 0) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			t: if (this.taskId == -1) {
				Iterator itr = this.children.iterator();

				long id = output.getTaskId();

				while (itr.hasNext()) {
					RayTracingOutputHandler h = (RayTracingOutputHandler) itr.next();

					if (h.isComplete()) itr.remove();

					if (h.getId() == id) {
						h.storeOutput(time, uid, data);
						break t;
					}
				}

				System.out.println("RayTracingOutputHandler: Recieved " + output);
				System.out.println("RayTracingOutputHandler: Spawning Output Handler for job " + id + "...");

				RayTracingOutputHandler h = new RayTracingOutputHandler(id, output.getDx(), output.getDy());
				h.storeOutput(time, uid, data);

				this.children.add(h);

				this.lastTaskId = this.currentTaskId;
				this.currentTaskId = id;

				System.out.println("RayTracingJob: Writing index.html");

				String s = RayTracingJob.htmlPre + this.lastTaskId + RayTracingJob.htmlPost;

				try (PrintStream out = new PrintStream(new FileOutputStream("index.html"))) {
					out.println(s);
				} catch (IOException ioe) {
					System.out.println("RayTracingOutputHandler: IO error writing index.html (" +
										ioe.getMessage() + ")");
				}
			}

			this.addToImage(output, output.getX(), output.getY(), output.getDx(), output.getDy());
		}

		public void storeOutput(long time, int uid, JobOutput data) {
			if (data instanceof RayTracingJobOutput == false) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			RayTracingJobOutput output = (RayTracingJobOutput) data;

			if (output.getTaskId() <= 0) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			t: if (this.taskId == -1) {
				Iterator itr = this.children.iterator();

				long id = output.getTaskId();

				while (itr.hasNext()) {
					RayTracingOutputHandler h = (RayTracingOutputHandler) itr.next();

					if (h.isComplete()) itr.remove();

					if (h.getId() == id) {
						h.storeOutput(time, uid, data);
						break t;
					}
				}

				System.out.println("RayTracingOutputHandler: Recieved " + output);
				System.out.println("RayTracingOutputHandler: Spawning Output Handler for job " + id + "...");

				RayTracingOutputHandler h = new RayTracingOutputHandler(id, output.getDx(), output.getDy());
				h.storeOutput(time, uid, data);

				this.children.add(h);

				this.lastTaskId = this.currentTaskId;
				this.currentTaskId = id;

				try {
					System.out.println("RayTracingOutputHandler: Writing index.html");

					String s = RayTracingJob.htmlPre + this.lastTaskId + RayTracingJob.htmlPost;

					PrintStream out = new PrintStream(new FileOutputStream("index.html"));
					out.println(s);
					out.flush();
					out.close();
				} catch (IOException ioe) {
					System.out.println("RayTracingOutputHandler: IO error writing index.html (" +
										ioe.getMessage() + ")");
				}
			}

			this.addToImage(output, output.getX(), output.getY(), output.getDx(), output.getDy());
		}

Try With Resources try(PrintStream out=new PrintStream(new FileOutputStream("index.html"))) in method public storeOutput(time long, uid int, data JobOutput) : void from class com.almostrealism.raytracer.network.RayTracingJob.RayTracingOutputHandler


	public void tick(double s) {
		if (this.first) {
			this.start = System.currentTimeMillis();
			this.first = false;
		}

		double r = 1.0;
		if (this.verbose > 0.0) r = Math.random();

		if (r < this.verbose)
			System.out.println("Photons: " + this.photons.size());

		Iterator itr = this.photons.iterator();

		boolean o = true;

		double delta = PhysicalConstants.C * s;

		i: while (itr.hasNext()) {
			double p[][] = (double[][]) itr.next();

			p[0][0] += p[1][0] * delta;
			p[0][1] += p[1][1] * delta;
			p[0][2] += p[1][2] * delta;

			if (p[3][0] > 0.0) p[3][0] -= delta;

			if (trace && p[3][0] > this.lifetime) {
				itr.remove();
				continue i;
			}

			if (o && r < this.verbose) {
				System.out.println("PhotonMoved: " + VectorMath.length(
									new double[] {
										p[1][0] * delta,
										p[1][1] * delta,
										p[1][2] * delta
									}));
				o = false;
			}

			double dist = 0.0;

			if (this.trace && p[3][0] < 0.0 && this.absorber instanceof AbsorberSet)
				dist = ((AbsorberSet) this.absorber).getDistance(p[0], p[1]);

			if (r < this.verbose)
				System.out.println("DefaultPhotonField: Distance = " + dist);

			p[3][0] = dist;

			if (this.absorber instanceof AbsorberSet &&
				VectorMath.length(p[0]) >
				((AbsorberSet)this.absorber).getMaxProximity()) {
					itr.remove();
			} else if ((!trace || p[3][0] <= delta) &&
						this.absorber.absorb(p[0], p[1], p[2][0])) {
				itr.remove();
			}
		}

		double next;

		w: while ((next = this.absorber.getNextEmit()) < s) {
			if (r < this.verbose)
				System.out.println("Next Emit: " + next);

			double d = this.absorber.getEmitEnergy();
			double x[] = this.absorber.getEmitPosition();
			double y[] = this.absorber.emit();

			if (x == null) {
				System.out.println("DefaultPhotonField: " + this.absorber +
									" returned null emit position.");
				continue w;
			}

			if (y == null) {
				System.out.println("DefaultPhotonField: " + this.absorber +
									" returned null emit direction.");
				continue w;
			}

			if (this.checkLength) {
				double l = VectorMath.length(y);
				if (l > 1.0 + this.ep || l < 1.0 - this.ep)
					System.out.println("DefaultPhotonField: Length was " +
										VectorMath.length(y));
			}

			if (this.trace)
				this.photons.add(new double[][] {x, y, {d}, {-1.0}});
			else
				this.photons.add(new double[][] {x, y, {d}, {0.0}});
		}

		this.tot++;

		if (this.log > 0 && this.tot % this.log == 0) {
			double rate = (System.currentTimeMillis() - this.start) /
							(60 * 60000 * this.clock.getTime());
			this.timeGraph.addEntry(rate);

			this.sizeGraph.addEntry(this.getSize());

			if (this.file != null) {
				StringBuffer b = new StringBuffer();
				this.sizeGraph.print(b);

				try (BufferedWriter out = new BufferedWriter(new FileWriter(this.file))) {
					out.write(b.toString());
				} catch (IOException e) {
					System.out.println("DefaultPhotonField: " + e.getMessage());
				}
			}
		}
	}

	public void tick(double s) {
		if (this.first) {
			this.start = System.currentTimeMillis();
			this.first = false;
		}

		double r = 1.0;
		if (this.verbose > 0.0) r = Math.random();

		if (r < this.verbose)
			System.out.println("Photons: " + this.photons.size());

		Iterator itr = this.photons.iterator();

		boolean o = true;

		double delta = PhysicalConstants.C * s;

		i: while (itr.hasNext()) {
			double p[][] = (double[][]) itr.next();

			p[0][0] += p[1][0] * delta;
			p[0][1] += p[1][1] * delta;
			p[0][2] += p[1][2] * delta;

			if (p[3][0] > 0.0) p[3][0] -= delta;

			if (trace && p[3][0] > this.lifetime) {
				itr.remove();
				continue i;
			}

			if (o && r < this.verbose) {
				System.out.println("PhotonMoved: " + VectorMath.length(
									new double[] {
										p[1][0] * delta,
										p[1][1] * delta,
										p[1][2] * delta
									}));
				o = false;
			}

			double dist = 0.0;

			if (this.trace && p[3][0] < 0.0 && this.absorber instanceof AbsorberSet)
				dist = ((AbsorberSet) this.absorber).getDistance(p[0], p[1]);

			if (r < this.verbose)
				System.out.println("DefaultPhotonField: Distance = " + dist);

			p[3][0] = dist;

			if (this.absorber instanceof AbsorberSet &&
				VectorMath.length(p[0]) >
				((AbsorberSet)this.absorber).getMaxProximity()) {
					itr.remove();
			} else if ((!trace || p[3][0] <= delta) &&
						this.absorber.absorb(p[0], p[1], p[2][0])) {
				itr.remove();
			}
		}

		double next;

		w: while ((next = this.absorber.getNextEmit()) < s) {
			if (r < this.verbose)
				System.out.println("Next Emit: " + next);

			double d = this.absorber.getEmitEnergy();
			double x[] = this.absorber.getEmitPosition();
			double y[] = this.absorber.emit();

			if (x == null) {
				System.out.println("DefaultPhotonField: " + this.absorber +
									" returned null emit position.");
				continue w;
			}

			if (y == null) {
				System.out.println("DefaultPhotonField: " + this.absorber +
									" returned null emit direction.");
				continue w;
			}

			if (this.checkLength) {
				double l = VectorMath.length(y);
				if (l > 1.0 + this.ep || l < 1.0 - this.ep)
					System.out.println("DefaultPhotonField: Length was " +
										VectorMath.length(y));
			}

			if (this.trace)
				this.photons.add(new double[][] {x, y, {d}, {-1.0}});
			else
				this.photons.add(new double[][] {x, y, {d}, {0.0}});
		}

		this.tot++;

		if (this.log > 0 && this.tot % this.log == 0) {
			double rate = (System.currentTimeMillis() - this.start) /
							(60 * 60000 * this.clock.getTime());
			this.timeGraph.addEntry(rate);

			this.sizeGraph.addEntry(this.getSize());

			if (this.file != null) {
				try {
					StringBuffer b = new StringBuffer();
					this.sizeGraph.print(b);
					BufferedWriter out = new BufferedWriter(new FileWriter(this.file));
					out.write(b.toString());
					out.close();
				} catch (IOException e) {
					System.out.println("DefaultPhotonField: " + e.getMessage());
				}
			}
		}
	}

Try With Resources try(BufferedWriter out=new BufferedWriter(new FileWriter(this.file))) in method public tick(s double) : void from class net.sf.j3d.physics.pfield.DefaultPhotonField


					public void run() {
						if (RayTracingOutputHandler.this.taskId == -1) return;

						System.out.println("RayTracingJobOutputHandler: Started file output thread for " +
											RayTracingOutputHandler.this.taskId + ".");

						w: while (!RayTracingOutputHandler.this.isComplete()) {
							try {
								Thread.sleep(1200000);

								if (RayTracingOutputHandler.this.image.length <= 0) continue w;

								System.out.println("RayTracingJobOutputHandler: Writing image for task " +
													RayTracingOutputHandler.this.taskId + " (" +
													RayTracingOutputHandler.this.image.length + ", " +
													RayTracingOutputHandler.this.image[0].length + ")...");

								try (PrintStream p = new PrintStream(new FileOutputStream(
											"images/NetworkRender-" +
											RayTracingOutputHandler.this.taskId + ".raw"))) {
									for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
										for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
											p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
										}
									}

									p.flush();
								}

								FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
										new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
										FileEncoder.JPEGEncoding);
							} catch (InterruptedException ie) {
								System.out.println("RayTracingOutputHandler: " + ie);
							} catch (IOException ioe) {
								System.out.println("RayTracingOutputHandler: " + ioe);
							}
						}

						if (RayTracingJob.defaultOutputHandler.children.remove(
								RayTracingOutputHandler.this))
							System.out.println("RayTracingOutputHandler (" +
									RayTracingOutputHandler.this.taskId +
									" Task is complete.");

						RayTracingOutputHandler.completedTasks.add(
								Long.valueOf(RayTracingOutputHandler.this.taskId));
					}

					public void run() {
						if (RayTracingOutputHandler.this.taskId == -1) return;

						System.out.println("RayTracingJobOutputHandler: Started file output thread for " +
											RayTracingOutputHandler.this.taskId + ".");

						w: while (!RayTracingOutputHandler.this.isComplete()) {
							try {
								Thread.sleep(1200000);

								if (RayTracingOutputHandler.this.image.length <= 0) continue w;

								System.out.println("RayTracingJobOutputHandler: Writing image for task " +
													RayTracingOutputHandler.this.taskId + " (" +
													RayTracingOutputHandler.this.image.length + ", " +
													RayTracingOutputHandler.this.image[0].length + ")...");

								PrintStream p = new PrintStream(new FileOutputStream(
											"images/NetworkRender-" +
											RayTracingOutputHandler.this.taskId + ".raw"));

								for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
									for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
										p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
									}
								}

								p.flush();
								p.close();

								FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
										new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
										FileEncoder.JPEGEncoding);
							} catch (InterruptedException ie) {
								System.out.println("RayTracingOutputHandler: " + ie);
							} catch (IOException ioe) {
								System.out.println("RayTracingOutputHandler: " + ioe);
							}
						}

						if (RayTracingJob.defaultOutputHandler.children.remove(
								RayTracingOutputHandler.this))
							System.out.println("RayTracingOutputHandler (" +
									RayTracingOutputHandler.this.taskId +
									" Task is complete.");

						RayTracingOutputHandler.completedTasks.add(
								Long.valueOf(RayTracingOutputHandler.this.taskId));
					}

Try With Resources try(PrintStream p=new PrintStream(new FileOutputStream("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) in method public run() : void from class com.almostrealism.raytracer.RayTracingJob.RayTracingOutputHandler.RayTracingOutputHandler.t.new Thread.new Runnable


		public void writeImage() {
			try {
				if (RayTracingOutputHandler.this.image.length <= 0) return;

				System.out.println("RayTracingOutputHandler: Writing image for task " +
									RayTracingOutputHandler.this.taskId + " (" +
									RayTracingOutputHandler.this.image.length + ", " +
									RayTracingOutputHandler.this.image[0].length + ")...");

				try (PrintStream p = new PrintStream(new FileOutputStream(
							"NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) {
					for (int i = 0; i < RayTracingOutputHandler.this.image.length; i++) {
						for (int j = 0; j < RayTracingOutputHandler.this.image[i].length; j++) {
							p.println("[" + i + ", " + j + "]: " + RayTracingOutputHandler.this.image[i][j]);
						}
					}

					p.flush();
				}

				FileEncoder.encodeImageFile(RayTracingOutputHandler.this.getImage(),
						new File("images/NetworkRender-" + RayTracingOutputHandler.this.taskId + ".jpg"),
						FileEncoder.JPEGEncoding);
			} catch (IOException ioe) {
				System.out.println("RayTracingJobOutputHandler: " + ioe);
			}
		}

Try With Resources try(PrintStream p=new PrintStream(new FileOutputStream("NetworkRender-" + RayTracingOutputHandler.this.taskId + ".raw"))) in method public writeImage() : void from class com.almostrealism.raytracer.RayTracingJob.RayTracingOutputHandler


		public void storeOutput(long time, int uid, JobOutput data) {
			if (data instanceof RayTracingJobOutput == false) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			RayTracingJobOutput output = (RayTracingJobOutput) data;

			if (output.getTaskId() <= 0) {
				System.out.println("RayTracingOutputHandler (" + this.taskId + ") recieved: " + data);
				return;
			}

			t: if (this.taskId == -1) {
				Iterator itr = this.children.iterator();

				long id = output.getTaskId();

				while (itr.hasNext()) {
					RayTracingOutputHandler h = (RayTracingOutputHandler) itr.next();

					if (h.isComplete()) itr.remove();

					if (h.getId() == id) {
						h.storeOutput(time, uid, data);
						break t;
					}
				}

				System.out.println("RayTracingOutputHandler: Recieved " + output);
				System.out.println("RayTracingOutputHandler: Spawning Output Handler for job " + id + "...");

				RayTracingOutputHandler h = new RayTracingOutputHandler(id, output.getDx(), output.getDy());
				h.storeOutput(time, uid, data);

				this.children.add(h);

				this.lastTaskId = this.currentTaskId;
				this.currentTaskId = id;

				System.out.println("RayTracingOutputHandler: Writing index.html");

				String s = RayTracingJob.htmlPre + this.lastTaskId + RayTracingJob.htmlPost;

				try (PrintStream out = new PrintStream(new FileOutputStream("index.html"))) {
					out.println(s);
					out.flush();
				} catch (IOException ioe) {
					System.out.println("RayTracingOutputHandler: IO error writing index.html (" +
										ioe.getMessage() + ")");
				}
			}

			this.addToImage(output, output.getX(), output.getY(), output.getDx(), output.getDy());
		}

Try With Resources try(PrintStream out=new PrintStream(new FileOutputStream("index.html"))) in method public storeOutput(time long, uid int, data JobOutput) : void from class com.almostrealism.raytracer.RayTracingJob.RayTracingOutputHandler


	public void read(InputStream in) {
		try (XMLDecoder dec = new XMLDecoder(in)) {
			Object read = null;

			for (int i = 0; (read = dec.readObject()) != null; i++) {
				if (i % 2 == 0) {
					xSomes.add((Chromosome<Double>) read);
				} else {
					ySomes.add((Chromosome<T>) read);
				}
			}
		} catch (ArrayIndexOutOfBoundsException e) {
			// End of file
		}
	}

	public void read(InputStream in) {
		XMLDecoder dec = new XMLDecoder(in);

		Object read = null;

		try {
			for (int i = 0; (read = dec.readObject()) != null; i++) {
				if (i % 2 == 0) {
					xSomes.add((Chromosome<Double>) read);
				} else {
					ySomes.add((Chromosome<T>) read);
				}
			}
		} catch (ArrayIndexOutOfBoundsException e) {
			// End of file
		}

		dec.close();
	}

Try With Resources try(XMLDecoder dec=new XMLDecoder(in)) in method public read(in InputStream) : void from class com.almostrealism.feedgrow.population.SimpleOrganPopulation


    private HashMap<String, String> importSingleQuotes(String path) {

        HashMap<String, String> map = new HashMap<>();
        File file = new File(path);

        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
        Quote[] quotes;

        try {
            quotes = objectMapper.readValue(file, Quote[].class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        for (Quote currentQuote: quotes) {
            if (currentQuote.type.equals("single"))
                map.put(currentQuote.name, currentQuote.output);
        }

        return map;
    }

    private HashMap<String, String> importSingleQuotes(String path) {

        HashMap<String, String> map = new HashMap<String, String>();
        File file = new File(path);

        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
        Quote[] quotes;

        try {
            quotes = objectMapper.readValue(file, Quote[].class);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        for (Quote currentQuote: quotes) {
            if (currentQuote.type.equals("single"))
                map.put(currentQuote.name, currentQuote.output);
        }

        return map;
    }

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method private importSingleQuotes(path String) : HashMap<String,String> from class OutputLibrary


    public static List<SmartDevice> makeDevices() {
        List<SmartDevice> devices = new ArrayList<>();
        devices.add(new SmartSpeaker("1111", false,15, "RFM", "Marshall"));
        devices.add(new SmartBulb("12345", true, SmartBulb.WARM, 2.0));
        return devices;
    }

    public static List<SmartDevice> makeDevices() {
        List<SmartDevice> devices = new ArrayList<SmartDevice>();
        devices.add(new SmartSpeaker("1111", false,15, "RFM", "Marshall"));
        devices.add(new SmartBulb("12345", true, SmartBulb.WARM, 2.0));
        return devices;
    }

Replace Generic With Diamond ArrayList<SmartDevice> with ArrayList<> in method public makeDevices() : List<SmartDevice> from class menu


	public static List<LocalInstall> allInstalls() {
		ArrayList<LocalInstall> inst = new ArrayList<>();

		managedInstalls().forEach(f -> inst.add(versionFromDir(f)));
        inst.addAll(localInstalls());

		inst.sort((i1, i2) -> compareVersions(i1.getVersion(), i2.getVersion()));

		return inst;
	}

	public static List<LocalInstall> allInstalls() {
		ArrayList<LocalInstall> inst = new ArrayList<LocalInstall>();

		managedInstalls().forEach(f -> inst.add(versionFromDir(f)));
        inst.addAll(localInstalls());

		inst.sort((i1, i2) -> compareVersions(i1.getVersion(), i2.getVersion()));

		return inst;
	}

Replace Generic With Diamond ArrayList<LocalInstall> with ArrayList<> in method public allInstalls() : List<LocalInstall> from class org.luke.jwin.local.managers.JdkManager


	private static ArrayList<String> deserializeList(String arr) {
		ArrayList<String> res = new ArrayList<>();
		JSONArray jarr = new JSONArray(arr);
		jarr.forEach(o -> res.add((String) o));
		return res;
	}

	private static ArrayList<String> deserializeList(String arr) {
		ArrayList<String> res = new ArrayList<String>();
		JSONArray jarr = new JSONArray(arr);
		jarr.forEach(o -> res.add((String) o));
		return res;
	}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private deserializeList(arr String) : ArrayList<String> from class org.luke.jwin.local.LocalStore


	public static void write(String content, File dest) {
		try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dest)))){
			bw.append(content);
			bw.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void write(String content, File dest) {
		try {
			BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dest)));
			bw.append(content);
			bw.flush();
			bw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

Try With Resources try(BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dest)))) in method public write(content String, dest File) : void from class org.luke.jwin.app.file.FileDealer


    public <T> T tx(Function<Session, T> command) {
        var session = sf.openSession();
        try (session) {
            var tx = session.beginTransaction();
            T rsl = command.apply(session);
            tx.commit();
            return rsl;
        } catch (Exception e) {
            var tx = session.getTransaction();
            if (tx.isActive()) {
                tx.rollback();
            }
            throw e;
        }
    }

    private <T> T tx(final Function<Session, T> command) {
        final Session session = sf.openSession();
        final Transaction tx = session.beginTransaction();
        try {
            T rsl = command.apply(session);
            tx.commit();
            return rsl;
        } catch (final Exception e) {
            session.getTransaction().rollback();
            throw e;
        } finally {
            session.close();
        }
    }

Try With Resources try(session) in method public tx(command Function<Session,T>) : T from class ru.job4j.todo.store.CrudRepository


        @Override
        public ListCell<AbstractTask> call(ListView<AbstractTask> param) {
          return new ListCell<>() {
            @Override
            public void updateItem(AbstractTask item, boolean empty) {
              super.updateItem(item, empty);
              if (item != null && !empty) {
                Image icon = getApplicationDefaults().taskPendingImage;
                if (item.isRunning()) {
                  icon = getApplicationDefaults().taskRunningImage;
                } else if (item.isDone()) {
                  icon = getApplicationDefaults().taskSuccessImage;
                }
                if (item.getState().equals(State.FAILED)) {
                  icon = getApplicationDefaults().taskFailImage;
                }
                ImageView imageView = new ImageView(icon);
                setGraphic(imageView);
                setText(item.getName());
              }
            }
          };
        }

        @Override
        public ListCell<AbstractTask> call(ListView<AbstractTask> param) {
          return new JFXListCell<AbstractTask>() {
            @Override
            public void updateItem(AbstractTask item, boolean empty) {
              super.updateItem(item, empty);
              if (item != null && !empty) {
                Image icon = getApplicationDefaults().taskPendingImage;
                if (item.isRunning()) {
                  icon = getApplicationDefaults().taskRunningImage;
                } else if (item.isDone()) {
                  icon = getApplicationDefaults().taskSuccessImage;
                }
                if (item.getState().equals(State.FAILED)) {
                  icon = getApplicationDefaults().taskFailImage;
                }
                ImageView imageView = new ImageView(icon);
                setGraphic(imageView);
                setText(item.getName());
              }
            }
          };
        }

Replace Generic With Diamond JFXListCell<AbstractTask> with ListCell<> in method public call(param ListView<AbstractTask>) : ListCell<AbstractTask> from class com.owlplug.core.controllers.TaskBarController.openTaskHistory.setCellFactory.new Callback<ListView<AbstractTask>,ListCell<AbstractTask>>


  private void openTaskHistory() {

    if (!taskRunner.getTaskHistory().isEmpty()) {
      ListView<AbstractTask> list = new ListView<>();
      list.setPrefSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);

      ArrayList<AbstractTask> tasks = new ArrayList<>(taskRunner.getTaskHistory());
      tasks.addAll(taskRunner.getPendingTasks());
      list.getItems().addAll(tasks);

      list.setCellFactory(new Callback<ListView<AbstractTask>, ListCell<AbstractTask>>() {
        @Override
        public ListCell<AbstractTask> call(ListView<AbstractTask> param) {
          return new ListCell<>() {
            @Override
            public void updateItem(AbstractTask item, boolean empty) {
              super.updateItem(item, empty);
              if (item != null && !empty) {
                Image icon = getApplicationDefaults().taskPendingImage;
                if (item.isRunning()) {
                  icon = getApplicationDefaults().taskRunningImage;
                } else if (item.isDone()) {
                  icon = getApplicationDefaults().taskSuccessImage;
                }
                if (item.getState().equals(State.FAILED)) {
                  icon = getApplicationDefaults().taskFailImage;
                }
                ImageView imageView = new ImageView(icon);
                setGraphic(imageView);
                setText(item.getName());
              }
            }
          };
        }
      });

      JFXPopup popup = new JFXPopup(list);
      popup.show(taskHistoryButton, PopupVPosition.BOTTOM, PopupHPosition.RIGHT);
    }

  }

  private void openTaskHistory() {

    if (!taskRunner.getTaskHistory().isEmpty()) {
      JFXListView<AbstractTask> list = new JFXListView<>();
      list.setPrefSize(Region.USE_COMPUTED_SIZE, Region.USE_COMPUTED_SIZE);

      ArrayList<AbstractTask> tasks = new ArrayList<>(taskRunner.getTaskHistory());
      tasks.addAll(taskRunner.getPendingTasks());
      list.getItems().addAll(tasks);

      list.setCellFactory(new Callback<ListView<AbstractTask>, ListCell<AbstractTask>>() {
        @Override
        public ListCell<AbstractTask> call(ListView<AbstractTask> param) {
          return new JFXListCell<AbstractTask>() {
            @Override
            public void updateItem(AbstractTask item, boolean empty) {
              super.updateItem(item, empty);
              if (item != null && !empty) {
                Image icon = getApplicationDefaults().taskPendingImage;
                if (item.isRunning()) {
                  icon = getApplicationDefaults().taskRunningImage;
                } else if (item.isDone()) {
                  icon = getApplicationDefaults().taskSuccessImage;
                }
                if (item.getState().equals(State.FAILED)) {
                  icon = getApplicationDefaults().taskFailImage;
                }
                ImageView imageView = new ImageView(icon);
                setGraphic(imageView);
                setText(item.getName());
              }
            }
          };
        }
      });

      JFXPopup popup = new JFXPopup(list);
      popup.show(taskHistoryButton, PopupVPosition.BOTTOM, PopupHPosition.RIGHT);
    }

  }

Replace Generic With Diamond JFXListCell<AbstractTask> with ListCell<> in method private openTaskHistory() : void from class com.owlplug.core.controllers.TaskBarController


  @Override
  public ListCell<PluginComponent> call(ListView<PluginComponent> arg0) {

    return new ListCell<>() {
      @Override
      public void updateItem(PluginComponent plugin, boolean empty) {
        super.updateItem(plugin, empty);
        if (empty) {
          setText(null);
          setGraphic(null);
        } else {
          ImageView imageView = new ImageView();
          imageView.setImage(applicationDefaults.pluginComponentImage);
          setText(plugin.getName());
          setGraphic(imageView);
        }
      }
    };
  }

  @Override
  public JFXListCell<PluginComponent> call(ListView<PluginComponent> arg0) {

    return new JFXListCell<PluginComponent>() {
      @Override
      public void updateItem(PluginComponent plugin, boolean empty) {
        super.updateItem(plugin, empty);
        if (empty) {
          setText(null);
          setGraphic(null);
        } else {
          ImageView imageView = new ImageView();
          imageView.setImage(applicationDefaults.pluginComponentImage);
          setText(plugin.getName());
          setGraphic(imageView);
        }
      }
    };
  }

Replace Generic With Diamond JFXListCell<PluginComponent> with ListCell<> in method public call(arg0 ListView<PluginComponent>) : ListCell<PluginComponent> from class com.owlplug.core.ui.PluginComponentCellFactory


  private void init() {

    HashMap<String, StoreFilterCriteria> suggestions = new LinkedHashMap<>();

    suggestions.put("Effect", new StoreFilterCriteria(PluginType.EFFECT, StoreFilterCriteriaType.TYPE,
        applicationDefaults.effectImage, "Effect"));
    suggestions.put("Instrument", new StoreFilterCriteria(PluginType.INSTRUMENT, StoreFilterCriteriaType.TYPE,
        applicationDefaults.instrumentImage, "Instrument"));

    suggestions.put("Amp", new StoreFilterCriteria("Amp", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Analog",
        new StoreFilterCriteria("Analog", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Ambient",
        new StoreFilterCriteria("Ambient", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Bass", new StoreFilterCriteria("Bass", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Brass",
        new StoreFilterCriteria("Brass", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Compressor",
        new StoreFilterCriteria("Compressor", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Delay",
        new StoreFilterCriteria("Delay", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Distortion",
        new StoreFilterCriteria("Distortion", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Drum", new StoreFilterCriteria("Drum", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Equalizer",
        new StoreFilterCriteria("Equalizer", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Filter",
        new StoreFilterCriteria("Filter", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Flanger",
        new StoreFilterCriteria("Flanger", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Gate", new StoreFilterCriteria("Gate", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Guitar",
        new StoreFilterCriteria("Guitar", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("LFO", new StoreFilterCriteria("LFO", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Limiter",
        new StoreFilterCriteria("Limiter", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Maximizer",
        new StoreFilterCriteria("Maximizer", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Monophonic",
        new StoreFilterCriteria("Monophonic", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Orchestral",
        new StoreFilterCriteria("Orchestral", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Organ",
        new StoreFilterCriteria("Organ", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Panner",
        new StoreFilterCriteria("Panner", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Phaser",
        new StoreFilterCriteria("Phaser", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Piano",
        new StoreFilterCriteria("Piano", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Reverb",
        new StoreFilterCriteria("Reverb", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Tremolo",
        new StoreFilterCriteria("Tremolo", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Tube", new StoreFilterCriteria("Tube", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Synth",
        new StoreFilterCriteria("Synth", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Vintage",
        new StoreFilterCriteria("Vintage", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));

    for (String creator : pluginCreators) {
      suggestions.put(creator, new StoreFilterCriteria(creator, StoreFilterCriteriaType.CREATOR,
          applicationDefaults.userImage));
    }

    this.getSuggestions().addAll(suggestions.values());
    this.setConverter(new StringConverter<>() {
      @Override
      public String toString(StoreFilterCriteria object) {
        return object.toString();
      }

      @Override
      public StoreFilterCriteria fromString(String string) {
        String filter = string.trim();
        StoreFilterCriteria found = suggestions.get(filter);
        return found == null ? new StoreFilterCriteria(filter, StoreFilterCriteriaType.NAME) : found;
      }
    });

    this.setChipFactory((chipView, criteria) -> new JFXDefaultChip<>(chipView, criteria) {
      {
        if (getItem().getFilterType() == StoreFilterCriteriaType.TYPE) {
          root.getStyleClass().add("chip-brown");
        }
        if (getItem().getFilterType() == StoreFilterCriteriaType.TAG) {
          root.getStyleClass().add("chip-red");
        }
        if (getItem().getFilterType() == StoreFilterCriteriaType.CREATOR) {
          root.getStyleClass().add("chip-blue");
        }
      }
    });

    this.getChips().addListener((ListChangeListener<StoreFilterCriteria>) change -> {
      // Only display prompt text if any chips is selected
      if (getChips().size() == 0) {
        displayPromptText();
      } else {
        hidePromptText();
      }
    });

    this.setSuggestionsCellFactory(param -> new ListCell<>() {
      protected void updateItem(StoreFilterCriteria item, boolean empty) {
        super.updateItem(item, empty);
        if (item != null && !empty) {
          setText(item.toString());
          ImageView imageView = new ImageView(item.getIcon());
          imageView.setFitWidth(10);
          imageView.setFitHeight(10);
          setGraphic(imageView);
        } else {
          setGraphic(null);
          setText(null);
        }
      }
    });

    displayPromptText();
  }

  private void init() {

    HashMap<String, StoreFilterCriteria> suggestions = new LinkedHashMap<>();

    suggestions.put("Effect", new StoreFilterCriteria(PluginType.EFFECT, StoreFilterCriteriaType.TYPE,
        applicationDefaults.effectImage, "Effect"));
    suggestions.put("Instrument", new StoreFilterCriteria(PluginType.INSTRUMENT, StoreFilterCriteriaType.TYPE,
        applicationDefaults.instrumentImage, "Instrument"));

    suggestions.put("Amp", new StoreFilterCriteria("Amp", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Analog",
        new StoreFilterCriteria("Analog", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Ambient",
        new StoreFilterCriteria("Ambient", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Bass", new StoreFilterCriteria("Bass", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Brass",
        new StoreFilterCriteria("Brass", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Compressor",
        new StoreFilterCriteria("Compressor", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Delay",
        new StoreFilterCriteria("Delay", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Distortion",
        new StoreFilterCriteria("Distortion", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Drum", new StoreFilterCriteria("Drum", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Equalizer",
        new StoreFilterCriteria("Equalizer", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Filter",
        new StoreFilterCriteria("Filter", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Flanger",
        new StoreFilterCriteria("Flanger", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Gate", new StoreFilterCriteria("Gate", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Guitar",
        new StoreFilterCriteria("Guitar", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("LFO", new StoreFilterCriteria("LFO", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Limiter",
        new StoreFilterCriteria("Limiter", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Maximizer",
        new StoreFilterCriteria("Maximizer", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Monophonic",
        new StoreFilterCriteria("Monophonic", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Orchestral",
        new StoreFilterCriteria("Orchestral", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Organ",
        new StoreFilterCriteria("Organ", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Panner",
        new StoreFilterCriteria("Panner", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Phaser",
        new StoreFilterCriteria("Phaser", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Piano",
        new StoreFilterCriteria("Piano", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Reverb",
        new StoreFilterCriteria("Reverb", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Tremolo",
        new StoreFilterCriteria("Tremolo", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Tube", new StoreFilterCriteria("Tube", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Synth",
        new StoreFilterCriteria("Synth", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));
    suggestions.put("Vintage",
        new StoreFilterCriteria("Vintage", StoreFilterCriteriaType.TAG, applicationDefaults.tagImage));

    for (String creator : pluginCreators) {
      suggestions.put(creator, new StoreFilterCriteria(creator, StoreFilterCriteriaType.CREATOR,
          applicationDefaults.userImage));
    }

    this.getSuggestions().addAll(suggestions.values());
    this.setConverter(new StringConverter<StoreFilterCriteria>() {
      @Override
      public String toString(StoreFilterCriteria object) {
        return object.toString();
      }

      @Override
      public StoreFilterCriteria fromString(String string) {
        String filter = string.trim();
        StoreFilterCriteria found = suggestions.get(filter);
        return found == null ? new StoreFilterCriteria(filter, StoreFilterCriteriaType.NAME) : found;
      }
    });

    this.setChipFactory((chipView, criteria) -> new JFXDefaultChip<StoreFilterCriteria>(chipView, criteria) {
      {
        if (getItem().getFilterType() == StoreFilterCriteriaType.TYPE) {
          root.getStyleClass().add("chip-brown");
        }
        if (getItem().getFilterType() == StoreFilterCriteriaType.TAG) {
          root.getStyleClass().add("chip-red");
        }
        if (getItem().getFilterType() == StoreFilterCriteriaType.CREATOR) {
          root.getStyleClass().add("chip-blue");
        }
      }
    });

    this.getChips().addListener((ListChangeListener) change -> {
      // Only display prompt text if any chips is selected
      if (getChips().size() == 0) {
        displayPromptText();
      } else {
        hidePromptText();
      }
    });

    this.setSuggestionsCellFactory(param -> new ListCell<StoreFilterCriteria>() {
      protected void updateItem(StoreFilterCriteria item, boolean empty) {
        super.updateItem(item, empty);
        if (item != null && !empty) {
          setText(item.toString());
          ImageView imageView = new ImageView(item.getIcon());
          imageView.setFitWidth(10);
          imageView.setFitHeight(10);
          setGraphic(imageView);
        } else {
          setGraphic(null);
          setText(null);
        }
      }
    });

    displayPromptText();
  }

Replace Generic With Diamond JFXDefaultChip<StoreFilterCriteria> with JFXDefaultChip<> in method private init() : void from class com.owlplug.store.ui.StoreChipView


	private File downloadInTempDirectory(StoreProduct product) throws TaskException {

		URL website;
		try {
			website = new URL(product.getDownloadUrl());
		} catch (MalformedURLException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: Can't download plugin files");
			throw new TaskException(e);

		}

		SimpleDateFormat horodateFormat = new SimpleDateFormat("ddMMyyhhmmssSSS");
		new File(applicationDefaults.getTempDowloadDirectory()).mkdirs();
		String outPutFileName =  horodateFormat.format(new Date()) + ".owlpack";
		String outputFilePath = applicationDefaults.getTempDowloadDirectory() + File.separator + outPutFileName;
		File outputFile = new File(outputFilePath);

		try (
				ReadableByteChannel rbc = Channels.newChannel(website.openStream());
				FileOutputStream fos = new FileOutputStream(outputFile)
		) {

			fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
			return outputFile;

		} catch (MalformedURLException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: Can't download plugin files");
			throw new TaskException(e);
		} catch (FileNotFoundException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: File not found");
			throw new TaskException(e);
		} catch (IOException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: Can't write file on disk");
			throw new TaskException(e);
		}

	}

	private File downloadInTempDirectory(StoreProduct product) throws TaskException {

		try {
			URL website = new URL(product.getDownloadUrl());
			SimpleDateFormat horodateFormat = new SimpleDateFormat("ddMMyyhhmmssSSS");

			new File(applicationDefaults.getTempDowloadDirectory()).mkdirs();

			String outPutFileName =  horodateFormat.format(new Date()) + ".owlpack";
			String outputFilePath = applicationDefaults.getTempDowloadDirectory() + File.separator + outPutFileName;
			File outputFile = new File(outputFilePath);
			ReadableByteChannel rbc = Channels.newChannel(website.openStream());
			FileOutputStream fos = new FileOutputStream(outputFile);
			fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);

			fos.close();
			return outputFile;

		} catch (MalformedURLException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: Can't download plugin files");
			throw new TaskException(e);
		} catch (FileNotFoundException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: File not found");
			throw new TaskException(e);
		} catch (IOException e) {
			this.updateMessage("Installation of " + product.getName() + " canceled: Can't write file on disk");
			throw new TaskException(e);
		}

	}

Try With Resources try(ReadableByteChannel rbc=Channels.newChannel(website.openStream()); FileOutputStream fos=new FileOutputStream(outputFile)) in method private downloadInTempDirectory(product StoreProduct) : File from class com.dropsnorz.owlplug.store.tasks.ProductInstallTask


				@Override
				public void onSuccess(TaskResult result) {
					Platform.runLater(() -> {
							refresh(true);
					});
				}

				@Override
				public void onSuccess(TaskResult result) {
					Platform.runLater(new Runnable() {

						@Override
						public void run() {
							refresh(true);
						}

					});
				}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.services.TaskManager.refresh.addCallback.new ListenableFutureCallback<TaskResult>.onSuccess.runLater.new Runnable with () -> {refresh(true); in method public onSuccess(result TaskResult) : void from class com.dropsnorz.owlplug.core.components.TaskRunner.refresh.addCallback.new ListenableFutureCallback<TaskResult>


				@Override
				public void onFailure(Throwable ex) {
					Platform.runLater(() -> {
							refresh(true);
					});

				}});

				@Override
				public void onFailure(Throwable ex) {
					Platform.runLater(new Runnable() {

						@Override
						public void run() {
							refresh(true);
						}
					});

				}});

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.services.TaskManager.refresh.addCallback.new ListenableFutureCallback<TaskResult>.onFailure.runLater.new Runnable with () -> {refresh(true); in method public onFailure(ex Throwable) : void from class com.dropsnorz.owlplug.core.components.TaskRunner.refresh.addCallback.new ListenableFutureCallback<TaskResult>


	public void initialize() {

		googleButton.setOnAction(e -> {

				buttonPane.setVisible(false);
				authProgressIndicator.setVisible(true);
				messageLabel.setText("Your default browser is opening... Proceed to sign in and come back here.");
				messageLabel.setVisible(true);

				Task<Void> task = new Task<Void>() {
					@Override
					protected Void call() throws Exception {

						log.debug("Google auth task started");
						authentificationService.createAccountAndAuth();
						this.updateProgress(1, 1);
						return null;
					}

				};

				task.setOnSucceeded(event ->  {

						log.debug("Google auth task complete");
						authProgressIndicator.setVisible(false);
						buttonPane.setVisible(false);
						cancelButton.setVisible(false);
						closeButton.setVisible(true);
						messageLabel.setText("Your account has been successfully added");
						messageLabel.setVisible(true);

						cancelFlag = false;

						mainController.refreshAccounts();
				});

				task.setOnFailed(event -> {

						log.debug("Google auth task failed");
						authProgressIndicator.setVisible(false);
						buttonPane.setVisible(true);
						cancelButton.setVisible(false);
						closeButton.setVisible(true);

						messageLabel.setVisible(false);

						if(!cancelFlag) {
							messageLabel.setText("En error occured during authentification");
							messageLabel.setVisible(true);
						}

						cancelFlag = false;
				});

				cancelButton.setVisible(true);
				closeButton.setVisible(false);
				new Thread(task).start();
		});

		cancelButton.setOnAction(event ->{
				cancelFlag = true;
				authentificationService.stopAuthReceiver();

		});

		closeButton.setOnAction(event -> {
				close();
		});
	}

	public void initialize() {

		googleButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				buttonPane.setVisible(false);
				authProgressIndicator.setVisible(true);
				messageLabel.setText("Your default browser is opening... Proceed to sign in and come back here.");
				messageLabel.setVisible(true);

				Task<Void> task = new Task<Void>() {
					@Override
					protected Void call() throws Exception {

						log.debug("Google auth task started");

						authentificationService.createAccountAndAuth();

						this.updateProgress(1, 1);
						return null;
					}

				};

				task.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
					@Override
					public void handle(WorkerStateEvent event) {

						log.debug("Google auth task complete");
						authProgressIndicator.setVisible(false);
						buttonPane.setVisible(false);
						cancelButton.setVisible(false);
						closeButton.setVisible(true);
						currentAuthTask = null;
						messageLabel.setText("Your account has been successfully added");
						messageLabel.setVisible(true);

						cancelFlag = false;

						mainController.refreshAccounts();
					}
				});

				task.setOnFailed(new EventHandler<WorkerStateEvent>(){
					@Override
					public void handle(WorkerStateEvent event) {

						log.debug("Google auth task failed");
						authProgressIndicator.setVisible(false);
						buttonPane.setVisible(true);
						cancelButton.setVisible(false);
						closeButton.setVisible(true);
						currentAuthTask = null;

						messageLabel.setVisible(false);

						if(!cancelFlag) {
							messageLabel.setText("En error occured during authentification");
							messageLabel.setVisible(true);
						}

						cancelFlag = false;
					}
				});

				currentAuthTask = task;
				cancelButton.setVisible(true);
				closeButton.setVisible(false);
				new Thread(task).start();

			};
		});

		cancelButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				cancelFlag = true;
				authentificationService.stopAuthReceiver();

			}

		});

		closeButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				close();

			}
		});
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.auth.controllers.AccountController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {buttonPane.setVisible(false); in method public initialize() : void from class com.dropsnorz.owlplug.auth.controllers.AccountController


	@FXML
	public void initialize() {

		openDirectoryButton.setGraphic(new ImageView(applicationDefaults.directoryImage));
		openDirectoryButton.setOnAction(e -> {
				PlatformUtils.openDirectoryExplorer(pluginDirectory.getPath());
		});

		pluginDirectoryListView.setCellFactory(new PluginListCellFactory(applicationDefaults));

		deleteDirectoryButton.setOnAction(e ->  {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove directory"));
				layout.setBody(new Label("Do you really want to remove " + pluginDirectory.getName()
				+ " and all of its content ? This will permanently delete the file from your hard drive."));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(cancelEvent -> {
						dialog.close();
				});

				JFXButton removeButton = new JFXButton("Remove");
				removeButton.setOnAction(removeEvent -> {
						dialog.close();
						taskFactory.run(taskFactory.createDirectoryRemoveTask(pluginDirectory));
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();
		});
	}

	@FXML
	public void initialize() {

		openDirectoryButton.setGraphic(new ImageView(applicationDefaults.directoryImage));
		openDirectoryButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				PlatformUtils.openDirectoryExplorer(pluginDirectory.getPath());
			};
		});

		pluginDirectoryListView.setCellFactory(new PluginListCellFactory(applicationDefaults));

		deleteDirectoryButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove directory"));
				layout.setBody(new Label("Do you really want to remove " + pluginDirectory.getName()
				+ " and all of its content ? This will permanently delete the file from your hard drive."));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
					};
				});

				JFXButton removeButton = new JFXButton("Remove");

				removeButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
						taskFactory.run(taskFactory.createDirectoryRemoveTask(pluginDirectory));
					};
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();

			};
		});

	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.DirectoryInfoController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {JFXDialog dialog=dialogController.newDialog(); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.DirectoryInfoController


	@FXML
	public void initialize() {

		viewRegistry.preload();

		this.tabPaneHeader.getSelectionModel().selectedIndexProperty().addListener((options, oldValue, newValue) -> {
			tabPaneContent.getSelectionModel().select(newValue.intValue());
			leftDrawer.close();
		});

		accountComboBox.getSelectionModel().selectedItemProperty().addListener( (options, oldValue, newValue) -> {
			if(newValue instanceof AccountMenuItem) {
				accountController.show();
				// Delay comboBox selector change
				Platform.runLater(() -> accountComboBox.setValue(oldValue));

			}
		});

		accountComboBox.setButtonCell(new AccountCellFactory(Pos.CENTER_RIGHT).call(null));
		accountComboBox.setCellFactory(new AccountCellFactory(authentificationService,true));
		accountComboBox.setSkin(new JFXComboBoxListViewSkin<AccountItem>(accountComboBox) {
			@Override
			protected boolean isHideOnClickEnabled() {
				return false;
			}
		});

		refreshAccounts();

	}

	@FXML
	public void initialize() {

		viewRegistry.preload();

		this.tabPaneHeader.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
			@Override
			public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
				tabPaneContent.getSelectionModel().select(newValue.intValue());
				leftDrawer.close();
			}
		});

		accountComboBox.getSelectionModel().selectedItemProperty().addListener( (options, oldValue, newValue) -> {
			if(newValue != null && newValue instanceof AccountMenuItem) {
				accountController.show();
				// Delay comboBox selector change
				Platform.runLater(() -> accountComboBox.setValue(oldValue));

			}
		});

		accountComboBox.setButtonCell(new AccountCellFactory(Pos.CENTER_RIGHT).call(null));
		accountComboBox.setCellFactory(new AccountCellFactory(authentificationService,true));
		accountComboBox.setSkin(new JFXComboBoxListViewSkin<AccountItem>(accountComboBox) {
	        @Override
	        protected boolean isHideOnClickEnabled() {
	            return false;
	        }
	    });

		refreshAccounts();

	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.MainController.initialize.addListener.new ChangeListener<Number> with (options, oldValue, newValue) -> {tabPaneContent.getSelectionModel().select(newValue.intValue()); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.MainController


	@FXML
	public void initialize() {

		pluginDirectoryTextField.setDisable(false);
		pluginDirectoryButton.setDisable(false);

		vst2ToggleButton.selectedProperty().addListener((observable, oldValue, newValue) -> {

				prefs.putBoolean(ApplicationDefaults.VST2_DISCOVERY_ENABLED_KEY, newValue);
		});

		vst3ToggleButton.selectedProperty().addListener((observable, oldValue, newValue) ->{

				prefs.putBoolean(ApplicationDefaults.VST3_DISCOVERY_ENABLED_KEY, newValue);
		});

		pluginDirectoryButton.setOnAction(e -> {
				DirectoryChooser directoryChooser = new DirectoryChooser();
				Window mainWindow = pluginDirectoryButton.getScene().getWindow();

				File selectedDirectory =
						directoryChooser.showDialog(mainWindow);

				if(selectedDirectory == null){
					pluginDirectoryTextField.setText("");
				}else{
					pluginDirectoryTextField.setText(selectedDirectory.getAbsolutePath());
				}
		});

		pluginDirectoryTextField.textProperty().addListener((observable, oldValue, newValue) -> {
			prefs.put(ApplicationDefaults.VST_DIRECTORY_KEY, newValue);
		});

		syncPluginsCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
			prefs.putBoolean(ApplicationDefaults.SYNC_PLUGINS_STARTUP_KEY, newValue);
		});

		removeDataButton.setOnAction(e -> {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove plugin"));
				layout.setBody(new Label("Do you really want to remove all user data including accounts, repositories and custom settings ?"));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(cancelEvent -> {
						dialog.close();
				});

				JFXButton removeButton = new JFXButton("Clear");

				removeButton.setOnAction(removeEvent -> {
						dialog.close();
						optionsService.clearAllUserData();
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();
		});

		refreshView();
	}

	@FXML
	public void initialize() {

		pluginDirectoryTextField.setDisable(false);
		pluginDirectoryButton.setDisable(false);

		vst2ToggleButton.selectedProperty().addListener(new ChangeListener<Boolean>(){

			@Override
			public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {

				prefs.putBoolean(ApplicationDefaults.VST2_DISCOVERY_ENABLED_KEY, newValue);
			}

		});

		vst3ToggleButton.selectedProperty().addListener(new ChangeListener<Boolean>(){

			@Override
			public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {

				prefs.putBoolean(ApplicationDefaults.VST3_DISCOVERY_ENABLED_KEY, newValue);
			}

		});

		pluginDirectoryButton.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {
				DirectoryChooser directoryChooser = new DirectoryChooser();
				Window mainWindow = pluginDirectoryButton.getScene().getWindow();

				File selectedDirectory =
						directoryChooser.showDialog(mainWindow);

				if(selectedDirectory == null){
					pluginDirectoryTextField.setText("");
				}else{
					pluginDirectoryTextField.setText(selectedDirectory.getAbsolutePath());
				}
			}
		});

		pluginDirectoryTextField.textProperty().addListener((observable, oldValue, newValue) -> {
			prefs.put(ApplicationDefaults.VST_DIRECTORY_KEY, newValue);
		});

		syncPluginsCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> {
			prefs.putBoolean(ApplicationDefaults.SYNC_PLUGINS_STARTUP_KEY, newValue);
		});

		removeDataButton.setOnAction(new EventHandler<ActionEvent>() {
			@Override
			public void handle(ActionEvent event) {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove plugin"));
				layout.setBody(new Label("Do you really want to remove all user data including accounts, repositories and custom settings ?"));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
					};
				});

				JFXButton removeButton = new JFXButton("Clear");

				removeButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
						optionsService.clearAllUserData();
					};
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();
			}
		});

		refreshView();

	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.OptionsController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {JFXDialog dialog=dialogController.newDialog(); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.OptionsController


	@FXML
	public void initialize() {

		openDirectoryButton.setGraphic(new ImageView(applicationDefaults.directoryImage));
		openDirectoryButton.setText("");
		openDirectoryButton.setOnAction(e -> {
			File pluginFile = new File(pluginPathLabel.getText());
			PlatformUtils.openDirectoryExplorer(pluginFile.getParentFile());
		});

		uninstallButton.setOnAction(e -> {

			JFXDialog dialog = dialogController.newDialog();

			JFXDialogLayout layout = new JFXDialogLayout();

			layout.setHeading(new Label("Remove plugin"));
			layout.setBody(new Label("Do you really want to remove " + currentPlugin.getName()
			+ " ? This will permanently delete the file from your hard drive."));

			JFXButton cancelButton = new JFXButton("Cancel");

			cancelButton.setOnAction( cancelEvent -> {
				dialog.close();
			});

			JFXButton removeButton = new JFXButton("Remove");

			removeButton.setOnAction( removeEvent -> {
				dialog.close();
				pluginService.removePlugin(currentPlugin);
			});
			removeButton.getStyleClass().add("button-danger");

			layout.setActions(removeButton, cancelButton);
			dialog.setContent(layout);
			dialog.show();

		});
	}

	@FXML
	public void initialize() {

		openDirectoryButton.setGraphic(new ImageView(applicationDefaults.directoryImage));
		openDirectoryButton.setText("");
		openDirectoryButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				File pluginFile = new File(pluginPathLabel.getText());
				PlatformUtils.openDirectoryExplorer(pluginFile.getParentFile());
			};
		});

		uninstallButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove plugin"));
				layout.setBody(new Label("Do you really want to remove " + currentPlugin.getName()
				+ " ? This will permanently delete the file from your hard drive."));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
					};
				});

				JFXButton removeButton = new JFXButton("Remove");

				removeButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
						pluginService.removePlugin(currentPlugin);
					};
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();

			};
		});
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.PluginInfoController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {JFXDialog dialog=dialogController.newDialog(); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.PluginInfoController


	public void initialize() {

		pluginRepositoryListView.setCellFactory(new PluginListCellFactory(applicationDefaults));

		pullButton.setOnAction(e -> {
			repositoryService.pull(repository);
		});

		openRepositoryButton.setOnAction(e -> {
			PlatformUtils.openDirectoryExplorer(repositoryService.getLocalRepositoryPath(repository));
		});

		editButton.setOnAction(e ->  {
			if(repository instanceof FileSystemRepository) {
				fileSystemRepositoryController.show();
				fileSystemRepositoryController.startUpdateSequence((FileSystemRepository) repository);
			}
			if(repository instanceof GoogleDriveRepository) {
				googleDriveRepositoryController.show();
				googleDriveRepositoryController.startUpdateSequence((GoogleDriveRepository) repository);
			}
		});

		deleteButton.setOnAction(e -> {

			JFXDialog dialog = dialogController.newDialog();
			JFXDialogLayout layout = new JFXDialogLayout();

			layout.setHeading(new Label("Remove directory"));
			layout.setBody(new Label("Do you really want to remove repository " + repository.getName()
			+ " and all of its content ? This will permanently delete the files from your hard drive."));

			JFXButton cancelButton = new JFXButton("Cancel");
			cancelButton.setOnAction(cancelEvent -> {
				dialog.close();
			});

			JFXButton removeButton = new JFXButton("Remove");
			removeButton.setOnAction(removeEvent -> {
				dialog.close();
				repositoryService.delete(repository);
			});
			removeButton.getStyleClass().add("button-danger");

			layout.setActions(removeButton, cancelButton);
			dialog.setContent(layout);
			dialog.show();
		});
	}

	public void initialize() {

		pluginRepositoryListView.setCellFactory(new PluginListCellFactory(applicationDefaults));

		pullButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				repositoryService.pull(repository);
			};
		});

		openRepositoryButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				PlatformUtils.openDirectoryExplorer(repositoryService.getLocalRepositoryPath(repository));
			};
		});

		editButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				if(repository instanceof FileSystemRepository) {
					fileSystemRepositoryController.show();
					fileSystemRepositoryController.startUpdateSequence((FileSystemRepository) repository);
				}
				if(repository instanceof GoogleDriveRepository) {
					googleDriveRepositoryController.show();
					googleDriveRepositoryController.startUpdateSequence((GoogleDriveRepository) repository);
				}
			};
		});

		deleteButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {

				JFXDialog dialog = dialogController.newDialog();

				JFXDialogLayout layout = new JFXDialogLayout();

				layout.setHeading(new Label("Remove directory"));
				layout.setBody(new Label("Do you really want to remove repository " + repository.getName()
				+ " and all of its content ? This will permanently delete the files from your hard drive."));

				JFXButton cancelButton = new JFXButton("Cancel");

				cancelButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
					};
				});

				JFXButton removeButton = new JFXButton("Remove");

				removeButton.setOnAction(new EventHandler<ActionEvent>() {
					public void handle(ActionEvent e) {
						dialog.close();
						repositoryService.delete(repository);
					};
				});
				removeButton.getStyleClass().add("button-danger");

				layout.setActions(removeButton, cancelButton);
				dialog.setContent(layout);
				dialog.show();

			};
		});

	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.RepositoryInfoController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {JFXDialog dialog=dialogController.newDialog(); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.RepositoryInfoController


	public JFXDialog newSimpleInfoDialog(Node title, Node body) {
		JFXDialogLayout layout = new JFXDialogLayout();

		layout.setHeading(title);
		layout.setBody(body);

		JFXButton button = new JFXButton("Close");

		button.setOnAction(e -> {
				dialog.close();
		});

		layout.setActions(button);
		return newDialog(layout);

	}

	public JFXDialog newSimpleInfoDialog(Node title, Node body) {
		JFXDialogLayout layout = new JFXDialogLayout();

		layout.setHeading(title);
		layout.setBody(body);

		JFXButton button = new JFXButton("Close");

		button.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				dialog.close();
			};
		});

		layout.setActions(button);

		return newDialog(layout);

	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.dialogs.DialogController.newSimpleInfoDialog.setOnAction.new EventHandler<ActionEvent> with e -> {dialog.close(); in method public newSimpleInfoDialog(title Node, body Node) : JFXDialog from class com.dropsnorz.owlplug.core.controllers.dialogs.DialogController


	public void initialize() {

		closeButton.setOnAction(e -> {
				close();
		});

		addButton.setOnAction(e -> {
				if(currentRepository != null) {
					updateRepository();
				}
				else {
					createRepository();
				}
		});

		AccountCellFactory cellFactory = new AccountCellFactory();

		accountComboBox.setButtonCell(cellFactory.call(null));
		accountComboBox.setCellFactory(cellFactory);
	}

	public void initialize() {

		closeButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				close();
			};
		});

		addButton.setOnAction(new EventHandler<ActionEvent>() {
			public void handle(ActionEvent e) {
				if(currentRepository != null) {
					updateRepository();
				}
				else {
					createRepository();
				}
			};
		});

		AccountCellFactory cellFactory = new AccountCellFactory();

		accountComboBox.setButtonCell(cellFactory.call(null));
		accountComboBox.setCellFactory(cellFactory);
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.controllers.dialogs.GoogleDriveRepositoryController.initialize.setOnAction.new EventHandler<ActionEvent> with e -> {if(currentRepository != null){updateRepository(); in method public initialize() : void from class com.dropsnorz.owlplug.core.controllers.dialogs.GoogleDriveRepositoryController


	public SyncPluginTask createSyncPluginTask() {

		SyncPluginTask task = new SyncPluginTask(pluginService, pluginDAO);
		task.setOnSucceeded(e -> {
			pluginsController.refreshPlugins();
		});

		return task;
	}

	public SyncPluginTask createSyncPluginTask() {

		SyncPluginTask task = new SyncPluginTask(pluginService, pluginDAO);

		task.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
			@Override
			public void handle(WorkerStateEvent event) {

				pluginsController.refreshPlugins();

			}
		});
		return task;
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.services.TaskFactory.createSyncPluginTask.setOnSucceeded.new EventHandler<WorkerStateEvent> with e -> {pluginsController.refreshPlugins(); in method public createSyncPluginTask() : SyncPluginTask from class com.dropsnorz.owlplug.core.services.TaskFactory


	public PluginRemoveTask createPluginRemoveTask(Plugin plugin) {

		PluginRemoveTask task = new PluginRemoveTask(plugin, pluginDAO);
		task.setOnSucceeded(e -> {
			pluginsController.refreshPlugins();
		});

		return task;
	}

	public PluginRemoveTask createPluginRemoveTask(Plugin plugin) {

		PluginRemoveTask task = new PluginRemoveTask(plugin, pluginDAO);

		task.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
			@Override
			public void handle(WorkerStateEvent event) {

				pluginsController.refreshPlugins();

			}
		});

		return task;
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.services.TaskFactory.createPluginRemoveTask.setOnSucceeded.new EventHandler<WorkerStateEvent> with e -> {pluginsController.refreshPlugins(); in method public createPluginRemoveTask(plugin Plugin) : PluginRemoveTask from class com.dropsnorz.owlplug.core.services.TaskFactory


	public DirectoryRemoveTask createDirectoryRemoveTask(PluginDirectory pluginDirectory) {

		DirectoryRemoveTask task = new DirectoryRemoveTask(pluginDirectory);
		task.setOnSucceeded(e -> {
			taskManager.addTask(createSyncPluginTask());
		});

		return task;
	}

	public DirectoryRemoveTask createDirectoryRemoveTask(PluginDirectory pluginDirectory) {

		DirectoryRemoveTask task = new DirectoryRemoveTask(pluginDirectory);

		task.setOnSucceeded(new EventHandler<WorkerStateEvent>(){
			@Override
			public void handle(WorkerStateEvent event) {

				taskManager.addTask(createSyncPluginTask());

			}
		});

		return task;
	}

Replace Anonymous With Lambda com.dropsnorz.owlplug.core.services.TaskFactory.createDirectoryRemoveTask.setOnSucceeded.new EventHandler<WorkerStateEvent> with e -> {taskManager.addTask(createSyncPluginTask()); in method public createDirectoryRemoveTask(pluginDirectory PluginDirectory) : DirectoryRemoveTask from class com.dropsnorz.owlplug.core.services.TaskFactory


    private void registerConfig(Config config, ClassLoader forClassLoader) {
        synchronized (DefaultConfigProvider.class) {
            configs.put(forClassLoader, new WeakReference<>(config));
        }
    }

    private void registerConfig(Config config, ClassLoader forClassLoader) {
        synchronized (DefaultConfigProvider.class) {
            configs.put(forClassLoader, new WeakReference<Config>(config));
        }
    }

Replace Generic With Diamond WeakReference<Config> with WeakReference<> in method private registerConfig(config Config, forClassLoader ClassLoader) : void from class org.apache.geronimo.config.DefaultConfigProvider


    @Override
    public Iterator<T> iterator() {
        Iterator<T> it = new Iterator<>() {
            private int currentIndex = 0;

            @Override
            public boolean hasNext() {
                return currentIndex < size; }

            @Override
            public T next() {
                if (!hasNext()) {
                    throw new NoSuchElementException();
                }
                return element[currentIndex++];
            }
        };
        return it;
    }

    @Override
    public Iterator<T> iterator() {
        Iterator<T> it = new Iterator<T>() {
            private int currentIndex = 0;

            @Override
            public boolean hasNext() {
                return currentIndex < size && element[currentIndex] != null;
            }

            @Override
            public T next() {
                if (!hasNext()) {
                    throw new NoSuchElementException();
                }
                return element[currentIndex++];
            }

        };
        return it;
    }

Replace Generic With Diamond Iterator<T> with Iterator<> in method public iterator() : Iterator<T> from class ru.job4j.generics.SimpleArray


    public void listenForMessage(){
        new Thread(
                () -> {
                    String msgFromGroupChat;
                    while(client.isConnected()){
                        try {
                            msgFromGroupChat = in.readLine();
                            System.out.println(msgFromGroupChat);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }

                    }
                }
        ).start();

    }

    public void listenForMessage(){
        new Thread(
                new Runnable() {
                    @Override
                    public void run() {
                        String msgFromGroupChat;
                        while(client.isConnected()){
                            try {
                                msgFromGroupChat = in.readLine();
                                System.out.println(msgFromGroupChat);
                            } catch (IOException e) {
                                throw new RuntimeException(e);
                            }

                        }
                    }
                }
        ).start();

    }

Replace Anonymous With Lambda org.chat.Client.listenForMessage.start.new Thread.new Runnable with () -> {String msgFromGroupChat; in method public listenForMessage() : void from class org.chat.Client


    public static void main(String[] args)
    {
        try (ServerSocket serverSocket = new ServerSocket(PORT))
        {

            System.out.println(String.format("The Secure Chat Server is running on port %s ...", PORT));

            while (true)
            {
                Socket clientSocket = serverSocket.accept();
                ClientHandler clientHandler = new ClientHandler(clientSocket);
                threadPool.execute(clientHandler);
            }
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

    public static void main(String[] args)
    {
        try
        {
            SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
            SSLServerSocket serverSocket = (SSLServerSocket) factory.createServerSocket(PORT);

            System.out.println(String.format("The Secure Chat Server is running on port %s ...", PORT));

            while (true)
            {
                Socket clientSocket = serverSocket.accept();
                ClientHandler clientHandler = new ClientHandler(clientSocket);
                threadPool.execute(clientHandler);
            }
        } catch (IOException e)
        {
            e.printStackTrace();
        }
    }

Try With Resources try(ServerSocket serverSocket=new ServerSocket(PORT)) in method public main(args String[]) : void from class uct.cs.networks.ui.ChatServer


    public JobInfo buildJobInfo(Scheduler scheduler, QuartzTask task) {
        String id = String.valueOf(task.getStringID());
        String jobName = JOB + id;
        String groupName = GROUP + id;
        try {
            JobDetail jobDetail = detailBuilder.buildJobDetail(scheduler, task, new JobKey(jobName, groupName));

            //TODO fix cast to Configurazione, implement proper handling of QuartzTask
            Trigger trigger = triggerBuilder.buildConfigTrigger((Configurazione) task, new TriggerKey(jobName, groupName));

            Objects.requireNonNull(jobDetail, "JobDetail is required.");
            Objects.requireNonNull(trigger, "Trigger is required.");
            log.info("Job scheduled for Azione n. {}.", task.getStringID());
            return new JobInfo(jobDetail, trigger);
        } catch (IllegalArgumentException | SchedulerException | JSQLParserException e) {
            log.error("Failed to build job: ", e);
            return new JobInfo(null, null);
        } catch (NullPointerException e) {
            if (e.getMessage().contains("JobDetail is required.")) {
                log.error("Could not create job, skipping.");
            } else {
                log.error("Failed to build job info, defaulting to no-op. Cause: ", e);
            }
            return new JobInfo(null, null);
        }
    }

    public JobInfo buildJobInfo(Scheduler scheduler, QuartzTask task) {
        String id = String.valueOf(task.getStringID());
        String jobName = JOB + id;
        String groupName = GROUP + id;
        try {
            JobDetail jobDetail = buildJobDetail(scheduler, task, new JobKey(jobName, groupName));

            //TODO fix cast to Configurazione, implement proper handling of QuartzTask
            Trigger trigger = buildConfigTrigger((Configurazione) task, new TriggerKey(jobName, groupName));

            Objects.requireNonNull(jobDetail, "JobDetail is required.");
            Objects.requireNonNull(trigger, "Trigger is required.");
            log.info("Job scheduled for Azione n. {}.", task.getStringID());
            return new JobInfo(jobDetail, trigger);
        } catch (IllegalArgumentException e) {
            log.error("Failed to build job: ", e);
            return new JobInfo(null, null);
        } catch (SchedulerException e) {
            log.error("Failed to build job info, defaulting to no-op. Cause: ", e);
            return new JobInfo(null, null);
        } catch (NullPointerException e) {
            if (e.getMessage().contains("JobDetail is required.")) {
                log.error("Could not create job, skipping.");
            } else {
                log.error("Failed to build job info, defaulting to no-op. Cause: ", e);
            }
            return new JobInfo(null, null);
        }
    }

Merge Catch [catch(IllegalArgumentException e), catch(SchedulerException e)] to catch(IllegalArgumentException|SchedulerException|JSQLParserException e) in method public buildJobInfo(scheduler Scheduler, task QuartzTask) : JobInfo from class it.dmi.quartz.builders.JobInfoBuilder


    public static void main(String[] args) {
        List<Attachment> attachments = Arrays.asList(
                new Attachment("image 1", 100),
                new Attachment("image 2", 34),
                new Attachment("image 3", 13)
        );

        Comparator<Attachment> comparator = new Comparator<>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getSize() - right.getSize();
            }
        };

        attachments.sort(comparator);
        System.out.println(attachments);

        Comparator<Attachment> comparator1 = new Comparator<>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getName().compareTo(right.getName());
            }
        };
        attachments.sort(comparator1);
        System.out.println(attachments);
    }

    public static void main(String[] args) {
        List<Attachment> attachments = Arrays.asList(
                new Attachment("image 1", 100),
                new Attachment("image 2", 34),
                new Attachment("image 3", 13)
        );

        Comparator<Attachment> comparator =  new Comparator<Attachment>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getSize() - right.getSize();
            }
        };

        attachments.sort(comparator);
        System.out.println(attachments);

        Comparator<Attachment> comparator1 =  new Comparator<Attachment>() {
            @Override
            public int compare(Attachment left, Attachment right) {
                return left.getName().compareTo(right.getName());
            }
        };
        attachments.sort(comparator1);
        System.out.println(attachments);
    }

Replace Generic With Diamond Comparator<Attachment> with Comparator<> in method public main(args String[]) : void from class ru.job4j.lambda.AttachmentSort


    private void handleSubmitButton(Button button) {
        button.getStyleClass().add("button1");
        button.setOnAction(event -> {
            LoginMenuMessages message = LoginMenuController.login(usernameTextField.getText(),passwordField.getText(),true);
            if (message.equals(LoginMenuMessages.LOGIN_SUCCESSFUL)) {
                Main.getStage().setScene(new Scene(new MainMenu().getPane()));
                Main.getStage().show();
            } else {
                usernameTextField.setText("");
                passwordField.setText("");
                errorText.getStyleClass().add("error");
                errorText.setText(message.getMessage());
            }
        });
    }

    private void handleSubmitButton(Button button) {
        button.getStyleClass().add("button1");
        button.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                LoginMenuMessages message = LoginMenuController.login(usernameTextField.getText(),passwordField.getText(),true);
                if (message.equals(LoginMenuMessages.LOGIN_SUCCESSFUL)) {
                    Main.getStage().setScene(new Scene(new MainMenu().getPane()));
                    Main.getStage().show();
                } else {
                    usernameTextField.setText("");
                    passwordField.setText("");
                    errorText.getStyleClass().add("error");
                    errorText.setText(message.getMessage());
                }
            }
        });
    }

Replace Anonymous With Lambda view.LoginMenu.handleSubmitButton.setOnAction.new EventHandler<ActionEvent> with event -> {LoginMenuMessages message=LoginMenuController.login(usernameTextField.getText(),passwordField.getText(),true); in method private handleSubmitButton(button Button) : void from class view.LoginMenu


    public static WriterCommand getFlushCmd() {
      return new WriterCommand(WriterCommandType.FLUSH, null, new CompletableFuture<>());
    }

    public static WriterCommand getFlushCmd() {
      return new WriterCommand(WriterCommandType.FLUSH, null, new CompletableFuture<Void>());
    }

Replace Generic With Diamond WriterCommand with WriterCommand in method public getFlushCmd() : WriterCommand from class com.quantiply.elasticsearch.HTTPBulkLoader.WriterCommand


    @Test
    public void testBuckets() throws Exception {
        WindowedMapGauge<Long> gauge = new WindowedMapGauge<>("wtf", 60000L, Long::max);
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L), gauge.getWindowStartTimes(0L));
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L), gauge.getWindowStartTimes(1L));
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L) , gauge.getWindowStartTimes(59999L));
        assertEquals(new WindowedMapGauge.Windows(60000L, 0L), gauge.getWindowStartTimes(60000L));
        assertEquals(new WindowedMapGauge.Windows(300000L, 240000L), gauge.getWindowStartTimes(300001L));
    }

    @Test
    public void testBuckets() throws Exception {
        WindowedMapGauge<Long> gauge = new WindowedMapGauge<Long>("wtf", 60000L, Long::max);
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L), gauge.getWindowStartTimes(0L));
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L), gauge.getWindowStartTimes(1L));
        assertEquals(new WindowedMapGauge.Windows(0L, -60000L) , gauge.getWindowStartTimes(59999L));
        assertEquals(new WindowedMapGauge.Windows(60000L, 0L), gauge.getWindowStartTimes(60000L));
        assertEquals(new WindowedMapGauge.Windows(300000L, 240000L), gauge.getWindowStartTimes(300001L));
    }

Replace Generic With Diamond WindowedMapGauge<Long> with WindowedMapGauge<> in method public testBuckets() : void from class com.quantiply.samza.metrics.WindowedMapGaugeTest


    /**
     * Find cluster, which can contains current id. If such cluster not exists in RAM, upload it from file data storage
     *
     * @param id Record id, for which execute search
     * @return Cluster, which can contains current id, or null, if such cluster not contains in data storage
     */
    @Override
    protected synchronized Cluster<Record> findCurrentClusterFromId(final String id) {
        String clusterId = clusterNames.floor(id);
        if (openClusters.containsKey(clusterId)) {
            return openClusters.get(clusterId);
        } else {
            if (Objects.isNull(clusterId)) {
                return null;
            }
            try(Stream<String> stream = Files.lines(Path.of(directory.getAbsolutePath(), clusterId))) {
                TreeMap<String, Record> tempClusterData = new TreeMap<>();
                stream.forEach(line -> {
                    int index = line.indexOf(':');
                    tempClusterData.put(line.substring(0, index),
                            gson.fromJson(line.substring(index + 1), type));
                });
                openClusters.put(clusterId, new Cluster<>(tempClusterData, this));
                checkAndDrop();
                return openClusters.get(clusterId);
            } catch (IOException e) {
                throw new InternalImnormException(e);
            }
        }
    }

    /**
     * Find cluster, which can contains current id. If such cluster not exists in RAM, upload it from file data storage
     *
     * @param id Record id, for which execute search
     * @return Cluster, which can contains current id, or null, if such cluster not contains in data storage
     */
    @Override
    protected synchronized Cluster<Record> findCurrentClusterFromId(final String id) {
        String clusterId = clusterNames.floor(id);
        if (openClusters.containsKey(clusterId)) {
            return openClusters.get(clusterId);
        } else {
            if (Objects.isNull(clusterId)) {
                return null;
            }
            try {
                TreeMap<String, Record> tempClusterData = new TreeMap<>();
                Files.lines(Path.of(directory.getAbsolutePath(), clusterId)).forEach(line -> {
                    int index = line.indexOf(':');
                    tempClusterData.put(line.substring(0, index),
                            gson.fromJson(line.substring(index + 1), type));
                });
                openClusters.put(clusterId, new Cluster<>(tempClusterData, this));
                checkAndDrop();
                return openClusters.get(clusterId);
            } catch (IOException e) {
                throw new InternalImnormException(e);
            }
        }
    }

Try With Resources try(Stream<String> stream=Files.lines(Path.of(directory.getAbsolutePath(),clusterId))) in method protected findCurrentClusterFromId(id String) : Cluster<Record> from class io.github.alekseykn.imnorm.FrugalRepository


    /**
     * @return Number of records in the repository
     */
    @Override
    public synchronized long size() {
        return clusterNames.parallelStream()
                .filter(clusterName -> !openClusters.containsKey(clusterName))
                .mapToLong(clusterName -> {
                    try(Stream<String> stream = Files.lines(Path.of(directory.getAbsolutePath(), clusterName))) {
                        return stream.count();
                    } catch (IOException e) {
                        throw new InternalImnormException(e);
                    }
                }).sum()
                + openClusters.values().stream().mapToInt(Cluster::size).sum();
    }

    /**
     * @return Number of records in the repository
     */
    @Override
    public synchronized long size() {
        return clusterNames.parallelStream()
                .filter(clusterName -> !openClusters.containsKey(clusterName))
                .mapToLong(clusterName -> {
                    try {
                        return Files.lines(Path.of(directory.getAbsolutePath(), clusterName)).count();
                    } catch (IOException e) {
                        throw new InternalImnormException(e);
                    }
                }).sum()
                + openClusters.values().stream().mapToInt(Cluster::size).sum();
    }

Try With Resources try(Stream<String> stream=Files.lines(Path.of(directory.getAbsolutePath(),clusterName))) in method public size() : long from class io.github.alekseykn.imnorm.FrugalRepository