From 14308c66d76924c0ae6e6d96e5c46529ac99ce82 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Tue, 19 Feb 2013 12:10:48 +0100 Subject: [PATCH] Library: converted nulls to checked exceptions, removed printStackTrace, added "dependencies" member --- app/src/processing/app/Base.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index a53597cab..169aba346 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1132,14 +1132,14 @@ public class Base { } } - public LibraryList scanLibraries(List folders) { + public LibraryList scanLibraries(List folders) throws IOException { LibraryList res = new LibraryList(); for (File folder : folders) res.addOrReplaceAll(scanLibraries(folder)); return res; } - public LibraryList scanLibraries(File folder) { + public LibraryList scanLibraries(File folder) throws IOException { LibraryList res = new LibraryList(); String list[] = folder.list(new OnlyDirs()); @@ -1184,7 +1184,11 @@ public class Base { // Scan for libraries in each library folder. // Libraries located in the latest folders on the list can override // other libraries with the same name. - libraries = scanLibraries(librariesFolders); + try { + libraries = scanLibraries(librariesFolders); + } catch (IOException e) { + showWarning(_("Error"), _("Error reading preferences"), e); + } String currentArch = Base.getTargetPlatform().getName(); libraries = libraries.filterByArchitecture(currentArch);