diff options
author | Robert Schuster <thebohemian@gmx.net> | 2011-05-20 11:49:16 +0200 |
---|---|---|
committer | BogDan Vatra <bog_dan_ro@yahoo.com> | 2011-07-26 10:24:04 +0300 |
commit | e0e57cda4dfce32bf2987d2e7c1252a2ecde58c7 (patch) | |
tree | 90fe22ed471cb45edd168b3af11dfefe67bdd6d2 /Ministro | |
parent | d3cb132e532a52dc7f804782759a0d26df5477d9 (diff) |
MinistroService.java: Added type-safety to source.
(addModules): Made private, added proper types, removed Unchecked-annotation
(checkModules): Added proper types, removed Unchecked-annotation
Diffstat (limited to 'Ministro')
-rw-r--r-- | Ministro/src/eu/licentia/necessitas/ministro/MinistroService.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Ministro/src/eu/licentia/necessitas/ministro/MinistroService.java b/Ministro/src/eu/licentia/necessitas/ministro/MinistroService.java index 894025a..c7b1738 100644 --- a/Ministro/src/eu/licentia/necessitas/ministro/MinistroService.java +++ b/Ministro/src/eu/licentia/necessitas/ministro/MinistroService.java @@ -328,11 +328,9 @@ public class MinistroService extends Service { } // check/add all modules. Returns true if all modules are found. - @SuppressWarnings("unchecked") - public boolean checkModules(Object lbs, Object notFoundModules) + private boolean checkModules(ArrayList<String> libs, ArrayList<String> notFoundModules) { ArrayList<Module> modules= new ArrayList<Module>(); - ArrayList<String> libs = (ArrayList<String>) lbs; boolean res=true; for (int i=0;i<libs.size();i++) res = res & addModules(libs.get(i), modules, notFoundModules); // don't stop on first error @@ -346,11 +344,8 @@ public class MinistroService extends Service { } // adds recursively all modules and dependencies to modules list - @SuppressWarnings("unchecked") - boolean addModules(String module, Object modulesObject, Object notFoundModulesObject) + private boolean addModules(String module, ArrayList<Module> modules, ArrayList<String> notFoundModules) { - ArrayList<Module> modules = (ArrayList<Module>) modulesObject; - ArrayList<String> notFoundModules = (ArrayList<String>) notFoundModulesObject; if (modules == null) return false; // we are in deep shit if this happens @@ -372,7 +367,7 @@ public class MinistroService extends Service { boolean res = true; if (m_downloadedLibraries.get(i).depends != null) for (int depIt=0;depIt<m_downloadedLibraries.get(i).depends.length;depIt++) - res &= addModules(m_downloadedLibraries.get(i).depends[depIt], modules, notFoundModulesObject); + res &= addModules(m_downloadedLibraries.get(i).depends[depIt], modules, notFoundModules); return res; } } |