Author: jleroux
Date: Mon Dec 16 13:30:46 2013 New Revision: 1551207 URL: http://svn.apache.org/r1551207 Log: No functional changes: Removes all remaining unchecked warnings Automatically adds some @Override Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Compare.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Mon Dec 16 13:30:46 2013 @@ -1118,7 +1118,9 @@ public class OrderServices { Map<String, Object> ripResult = dispatcher.runSync("receiveInventoryProduct", ripCtx); if (ServiceUtil.isError(ripResult)) { String errMsg = ServiceUtil.getErrorMessage(ripResult); - resErrorMessages.addAll((Collection<? extends String>) UtilMisc.<String, String>toMap("reasonCode", "ReceiveInventoryServiceError", "description", errMsg)); + @SuppressWarnings("unchecked") + Collection<? extends String> map = (Collection<? extends String>) UtilMisc.<String, String>toMap("reasonCode", "ReceiveInventoryServiceError", "description", errMsg); + resErrorMessages.addAll(map); } } catch (GenericServiceException e) { Debug.logWarning(e, "Error invoking receiveInventoryProduct service in createOrder", module); @@ -5631,6 +5633,7 @@ public class OrderServices { List<String> orderIds; try { orderIds = TransactionUtil.doNewTransaction(new Callable<List<String>>() { + @Override public List<String> call() throws Exception { List<String> orderIds = new LinkedList<String>(); EntityListIterator eli = null; Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/category/CategoryServices.java Mon Dec 16 13:30:46 2013 @@ -31,7 +31,6 @@ import javax.servlet.http.HttpServletRes import javolution.util.FastList; import javolution.util.FastMap; - import net.sf.json.JSONObject; import org.ofbiz.base.util.Debug; @@ -504,7 +503,6 @@ public class CategoryServices { } } - @SuppressWarnings("unchecked") public static void toJsonObjectList(List attrList, HttpServletResponse response){ StringBuilder jsonBuilder = new StringBuilder("["); for (Object attrMap : attrList) { Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/container/ContainerLoader.java Mon Dec 16 13:30:46 2013 @@ -27,9 +27,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.apache.log4j.Logger; import org.apache.log4j.Appender; - +import org.apache.log4j.Logger; import org.ofbiz.base.component.ComponentConfig; import org.ofbiz.base.start.Config; import org.ofbiz.base.start.StartupException; @@ -58,6 +57,7 @@ public class ContainerLoader implements /** * @see org.ofbiz.base.start.StartupLoader#load(Config, String[]) */ + @Override public synchronized void load(Config config, String args[]) throws StartupException { if (this.loaded || this.unloading) { return; @@ -223,6 +223,7 @@ public class ContainerLoader implements /** * @see org.ofbiz.base.start.StartupLoader#start() */ + @Override public synchronized void start() throws StartupException { if (!this.loaded || this.unloading) { throw new IllegalStateException("start() called on unloaded containers"); @@ -248,6 +249,7 @@ public class ContainerLoader implements /** * @see org.ofbiz.base.start.StartupLoader#unload() */ + @Override public void unload() throws StartupException { if (!this.unloading) { this.unloading = true; @@ -268,6 +270,7 @@ public class ContainerLoader implements Debug.logInfo("Stopped container " + container.getName(), module); } } + @SuppressWarnings("unchecked") Enumeration<Appender> en = Logger.getRootLogger().getAllAppenders(); while (en.hasMoreElements()) { Appender appender = en.nextElement(); Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java (original) +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/test/AssertTests.java Mon Dec 16 13:30:46 2013 @@ -35,7 +35,6 @@ public class AssertTests extends TestCas super(name); } - @SuppressWarnings("unchecked") public void testAssert(){ Object testObject = new Object(); Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java (original) +++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonEvents.java Mon Dec 16 13:30:46 2013 @@ -465,9 +465,9 @@ public class CommonEvents { response.setContentType("image/jpeg"); ImageIO.write(bufferedImage, "jpg", response.getOutputStream()); HttpSession session = request.getSession(); - Map captchaCodeMap = (Map)session.getAttribute("_CAPTCHA_CODE_"); + Map<String, String> captchaCodeMap = UtilGenerics.checkMap(session.getAttribute("_CAPTCHA_CODE_")); if (captchaCodeMap == null) { - captchaCodeMap = new HashMap(); + captchaCodeMap = new HashMap<String, String>(); session.setAttribute("_CAPTCHA_CODE_", captchaCodeMap); } captchaCodeMap.put(captchaCodeId, captchaCode); Modified: ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Compare.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Compare.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Compare.java (original) +++ ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/conditional/Compare.java Mon Dec 16 13:30:46 2013 @@ -102,7 +102,6 @@ public abstract class Compare { private static final class CompareContains extends Compare { - @SuppressWarnings("unchecked") @Override public boolean doCompare(Object lValue, Object rValue, Class<?> type, Locale locale, TimeZone timeZone, String format) throws Exception { // The type parameter is ignored when using the contains operator, so no conversions will be performed. Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java Mon Dec 16 13:30:46 2013 @@ -43,8 +43,8 @@ import org.ofbiz.base.util.GeneralExcept import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.config.model.DelegatorElement; import org.ofbiz.entity.config.EntityConfigUtil; +import org.ofbiz.entity.config.model.DelegatorElement; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.model.ModelReader; import org.ofbiz.service.DispatchContext; @@ -144,7 +144,7 @@ public class ArtifactInfoFactory { public void prepareAll() throws GeneralException { Debug.logInfo("Loading artifact info objects...", module); - List<Future<Void>> futures = new ArrayList(); + List<Future<Void>> futures = new ArrayList<Future<Void>>(); Set<String> entityNames = this.getEntityModelReader().getEntityNames(); for (String entityName: entityNames) { this.getEntityArtifactInfo(entityName); @@ -158,7 +158,7 @@ public class ArtifactInfoFactory { Collection<ComponentConfig> componentConfigs = ComponentConfig.getAllComponents(); ExecutionPool.getAllFutures(futures); - futures = new ArrayList(); + futures = new ArrayList<Future<Void>>(); for (ComponentConfig componentConfig: componentConfigs) { futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(prepareTaskForComponentAnalysis(componentConfig))); } @@ -382,8 +382,10 @@ public class ArtifactInfoFactory { } // private methods + @SuppressWarnings("unchecked") private Callable<Void> prepareTaskForServiceAnalysis(final String serviceName) { return new Callable() { + @Override public Callable<Void> call() throws Exception { try { getServiceArtifactInfo(serviceName); @@ -395,8 +397,10 @@ public class ArtifactInfoFactory { }; } + @SuppressWarnings("unchecked") private Callable<Void> prepareTaskForComponentAnalysis(final ComponentConfig componentConfig) { return new Callable() { + @Override public Callable<Void> call() throws Exception { String componentName = componentConfig.getGlobalName(); String rootComponentPath = componentConfig.getRootLocation(); Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/WidgetWorker.java Mon Dec 16 13:30:46 2013 @@ -427,6 +427,7 @@ public class WidgetWorker { } } + @SuppressWarnings("unchecked") public Map<String, String> getParametersMap(Map<String, Object> context, String defaultServiceName) { Map<String, String> autServiceParams = FastMap.newInstance(); LocalDispatcher dispatcher = (LocalDispatcher) context.get("dispatcher"); @@ -492,6 +493,7 @@ public class WidgetWorker { } } + @SuppressWarnings("unchecked") public Map<String, String> getParametersMap(Map<String, Object> context, String defaultEntityName) { Map<String, String> autEntityParams = FastMap.newInstance(); Delegator delegator = (Delegator) context.get("delegator"); Modified: ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java?rev=1551207&r1=1551206&r2=1551207&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java (original) +++ ofbiz/trunk/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java Mon Dec 16 13:30:46 2013 @@ -226,7 +226,7 @@ public class ScrumServices { List<GenericValue> workEffortList = delegator.findList("WorkEffort", EntityCondition.makeCondition(exprsAnd, EntityOperator.AND), null, null, null, false); if (UtilValidate.isEmpty(workeffContentList) && UtilValidate.isNotEmpty(workEffortList)) { - Map inputMap = FastMap.newInstance(); + Map<String, Object> inputMap = FastMap.newInstance(); inputMap.put("taskId", taskId); inputMap.put("user", user); inputMap.put("revisionNumber", Integer.toString(i)); |
Free forum by Nabble | Edit this page |