package com.alexrnl.subtitlecorrector.common;

import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;

import com.alexrnl.commons.utils.CollectionUtils;

/**
 * Represent a single subtitle file.<br />
 * @author Alex
 */
public class SubtitleFile extends TreeSet<Subtitle> {
	/** Logger */
	private static Logger		lg					= Logger.getLogger(SubtitleFile.class.getName());
	
	/** Serial Version UID */
	private static final long	serialVersionUID	= -5783605599009372323L;
	
	/** The actual file which is represented */
	private final URI			file;
	
	/**
	 * Constructor #1.<br />
	 * @param file
	 *        the file backed-up by this instance.
	 */
	public SubtitleFile (final Path file) {
		super();
		this.file = file == null ? null : file.toUri();
		
		if (lg.isLoggable(Level.FINE)) {
			lg.fine(this.getClass().getSimpleName() + " created: " + toString());
		}
	}
	
	/**
	 * Return the file represented by this instance.
	 * @return the file.
	 */
	public Path getFile () {
		return file == null ? null : Paths.get(file);
	}
	
	/**
	 * Update the subtitle so the ordering is updated if necessary.
	 */
	public void update () {
		if (CollectionUtils.isSorted(this)) {
			return;
		}

		final List<Subtitle> tmp = new ArrayList<>(this);
		this.clear();
		for (final Subtitle subtitle : tmp) {
			this.add(subtitle);
		}
	}
}

@@ -204,75 +204,8 @@
 et;%0D
-%0Aimport java.util.logging.Level;%0D%0Aimport java.util.logging.Logger;%0D
 %0A%0D%0Ai
@@ -386,109 +386,8 @@
  %7B%0D%0A
-%09/** Logger */%0D%0A%09private static Logger%09%09lg%09%09%09%09%09= Logger.getLogger(SubtitleFile.class.getName());%0D%0A%09%0D%0A
 %09/**
@@ -715,24 +715,24 @@
 %09%09super();%0D%0A
+
 %09%09this.file 
@@ -774,127 +774,8 @@
 );%0D%0A
-%09%09%0D%0A%09%09if (lg.isLoggable(Level.FINE)) %7B%0D%0A%09%09%09lg.fine(this.getClass().getSimpleName() + %22 created: %22 + toString());%0D%0A%09%09%7D%0D%0A
 %09%7D%0D%0A

Remove logger in SubtitleFile class