/*
 * Copyright (C) 2020 Narongrit Unwerawattana <narongrit.kie@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 */

package jolie.lang.parse.module.exceptions;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import jolie.lang.Constants;

public class ModuleNotFoundException extends FileNotFoundException {

	private static final long serialVersionUID = Constants.serialVersionUID();

	private final List< String > lookedPaths;

	private final String moduleName;

	public ModuleNotFoundException( String moduleName ) {
		super( moduleName );
		this.moduleName = moduleName;
		this.lookedPaths = new ArrayList<>();
	}

	public ModuleNotFoundException( String moduleName, List< String > lookedPaths ) {
		super( moduleName );
		this.moduleName = moduleName;
		this.lookedPaths = lookedPaths;
	}

	public ModuleNotFoundException( String moduleName, String lookedPath ) {
		super( moduleName );
		this.moduleName = moduleName;
		this.lookedPaths = new ArrayList<>();
		this.lookedPaths.add( lookedPath );
	}

	public void addLookedPath( String path ) {
		this.lookedPaths.add( path );
	}


	@Override
	public String getMessage() {
		return "Module \"" + this.moduleName + "\" not found from lookup path "
			+ Arrays.toString( this.lookedPaths.toArray() );
	}

}

@@ -1077,17 +1077,16 @@
 ption %7B%0A
-%0A
 %09private
@@ -1197,17 +1197,16 @@
 dPaths;%0A
-%0A
 %09private
@@ -1236,162 +1236,8 @@
 e;%0A%0A
-%09public ModuleNotFoundException( String moduleName ) %7B%0A%09%09super( moduleName );%0A%09%09this.moduleName = moduleName;%0A%09%09this.lookedPaths = new ArrayList%3C%3E();%0A%09%7D%0A%0A
 %09pub
@@ -1619,93 +1619,12 @@
  );%0A
+
 %09%7D%0A%0A
-%09public void addLookedPath( String path ) %7B%0A%09%09this.lookedPaths.add( path );%0A%09%7D%0A%0A%0A
 %09@Ov

simplify ModuleNotFoundException