Browse Source

Removed debug println calls.

Ludwig Tietze 7 years ago
parent
commit
23828868ac
1 changed files with 2 additions and 8 deletions
  1. 2 8
      src/ui/view/Util.java

+ 2 - 8
src/ui/view/Util.java

@@ -75,7 +75,6 @@ public class Util {
 				try {
 					img= ImageIO.read(loadStream(origin, url));
 				} catch (IOException e) {
-					System.err.println("Warning: '" + url + "' loading failed!");
 					e.printStackTrace();
 					return defaultImage;
 				}
@@ -86,28 +85,23 @@ public class Util {
 		try {
 			return ImageIO.read(loadStream(origin, url));
 		} catch (IOException e) {
-			System.err.println("Warning: '" + url + "' loading failed!");
 			e.printStackTrace();
 			return defaultImage;
 		}
 	}
 	
 	static InputStream loadStream(Object origin, String url){
-		System.out.println("Resource loaded!");
 		InputStream o=origin.getClass().getResourceAsStream(url);
 		if(o!=null)return o;
 		else{
-			System.out.println("Loading of \""+url+"\" as local resource failed.\nWill attempt to load as File.");
 			boolean rootSymbol=false;	//Whether url starts with a / or \
 			switch(url.charAt(0)){		//So we can make sure to construct res/path correctly.
 			case '/':case '\\':rootSymbol=true;
 			}
 			try {
-				//I am checking, whether the requested File is an internal resource.
-				//If it is, res/url has to be used, otherwise url.
 				//Mixed separators might cause problems. Will fix later.
-				File f=new File(url);
-				if(!f.exists()/*||!f.getAbsolutePath().equals(url)*/)url="res"+(rootSymbol?"":"/")+url;
+				File f=new File(url);//Possible bug with duplicate names.
+				if(!f.exists())url="res"+(rootSymbol?"":"/")+url;
 				return new FileInputStream(url);
 			} catch (FileNotFoundException e1) {
 				e1.printStackTrace();