java - Refactoring code inside of for loops -


in application, using loop , if-else statement in side of it. client suggesting avoid loops, means need avoid conditional statements inside of loop.

abstractimporter importer = null; (uploadedfile uploadedfile : uploadedfiles) {     if (stringutils.contains(uploadedfile.getname(), "_" + locale)) {         importer = "";         importerfactory.getimporterfortype(getextension(uploadedfile.getname()));         try {             tablerows.addall(importer.importdata(uploadedfile));         } catch (exception e) {             logger.error(e);             facesmessageutil.addglobalunexpectederrormessage();         }     } else {         facesmessageutil.addstatusmessage(top_panel, messagekey, new object[]{uploadedfile.getname()});     } } 


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -