svn commit: r1848673 [4/4] - in /ofbiz: ofbiz-framework/trunk/ ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/ ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thir...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1848673 [4/4] - in /ofbiz: ofbiz-framework/trunk/ ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/ ofbiz-framework/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thir...

jleroux@apache.org
Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java Tue Dec 11 13:33:49 2018
@@ -821,10 +821,10 @@ public class HtmlReport extends Abstract
     public String paramsAsHidden(HttpServletRequest request, Collection<?> excludes) {
         StringBuffer result = new StringBuffer(512);
         Map<String, Object> params = paramValues(request);
-        Iterator<?> i = params.entrySet().iterator();
+        Iterator<Map.Entry<String, Object>> i = params.entrySet().iterator();
         while (i.hasNext()) {
-            Map.Entry entry = (Map.Entry)i.next();
-            String param = (String)entry.getKey();
+            Map.Entry<String, Object> entry = i.next();
+            String param = entry.getKey();
             if ((excludes == null) || (!excludes.contains(param))) {
                 result.append("<input type=\"hidden\" name=\"");
                 result.append(param);
@@ -850,7 +850,7 @@ public class HtmlReport extends Abstract
         Map<String, Object> map = new HashMap<String, Object>(methods.size());
         Iterator<Method> i = methods.iterator();
         while (i.hasNext()) {
-            Method m = (Method)i.next();
+            Method m = i.next();
             Object o = null;
             try {
                 o = m.invoke(this, new Object[0]);

Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportEncoder.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportEncoder.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportEncoder.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/htmlreport/util/ReportEncoder.java Tue Dec 11 13:33:49 2018
@@ -632,7 +632,7 @@ public final class ReportEncoder {
      */
     public static String lookupEncoding(String encoding, String fallback) {
 
-        String result = (String) encodingCache.get(encoding);
+        String result = encodingCache.get(encoding);
         if (result != null) {
             return result;
         }

Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/AbstractPricatParser.java Tue Dec 11 13:33:49 2018
@@ -559,7 +559,7 @@ public abstract class AbstractPricatPars
             if (sequenceNum < 1L) {
                 historyValue = EntityQuery.use(delegator).from("ExcelImportHistory").where("userLoginId", userLoginId, "logFileName", logFileName).orderBy("sequenceNum DESC").filterByDate().queryFirst();
             } else {
-                historyValue = EntityQuery.use(delegator).from("ExcelImportHistory").where("userLoginId", userLoginId, "sequenceNum", (Long) sequenceNum).queryOne();
+                historyValue = EntityQuery.use(delegator).from("ExcelImportHistory").where("userLoginId", userLoginId, "sequenceNum", sequenceNum).queryOne();
             }
             Timestamp now = UtilDateTime.nowTimestamp();
             if (UtilValidate.isEmpty(historyValue)) {

Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatEvents.java Tue Dec 11 13:33:49 2018
@@ -94,7 +94,7 @@ public class PricatEvents {
         } else {
             String action = request.getParameter("action");
             if (UtilValidate.isNotEmpty(action) && "downloadPricat".equals(action)) {
-                String sequenceNumString = (String) request.getParameter("sequenceNum");
+                String sequenceNumString = request.getParameter("sequenceNum");
                 long sequenceNum = -1;
                 if (UtilValidate.isNotEmpty(sequenceNumString)) {
                     try {

Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/PricatParseExcelHtmlThread.java Tue Dec 11 13:33:49 2018
@@ -112,8 +112,6 @@ public class PricatParseExcelHtmlThread
     
     private String selectedPricatType = DEFAULT_PRICAT_TYPE;
     
-    private String selectedFacilityId;
-    
     public static final Map<String, String> PricatTypeLabels = UtilMisc.toMap("sample_pricat", "SamplePricatTemplate",
                                                                               "ofbiz_pricat", "OFBizPricatTemplate");
     

Modified: ofbiz/ofbiz-plugins/trunk/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java (original)
+++ ofbiz/ofbiz-plugins/trunk/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java Tue Dec 11 13:33:49 2018
@@ -122,8 +122,8 @@ public class ScrumServices {
      * @return Map with the result of the service, the output parameters.
      */
     public static Map<String, Object> viewScrumRevision(DispatchContext ctx, Map<String, ? extends Object> context) {
-        Delegator delegator = ctx.getDelegator();
-        LocalDispatcher dispatcher = ctx.getDispatcher();
+        ctx.getDelegator();
+        ctx.getDispatcher();
         String revision = (String) context.get("revision");
         String repository = (String) context.get("repository");
         Map<String, Object> result = ServiceUtil.returnSuccess();
@@ -264,7 +264,7 @@ public class ScrumServices {
      */
     public static Map<String, Object> removeDuplicateScrumRevision(DispatchContext ctx, Map<String, ? extends Object> context) {
         Delegator delegator = ctx.getDelegator();
-        LocalDispatcher dispatcher = ctx.getDispatcher();
+        ctx.getDispatcher();
         String repositoryRoot = (String) context.get("repositoryRoot");
         Map<String, Object> result = ServiceUtil.returnSuccess();
         try {

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/CategoryUtil.java Tue Dec 11 13:33:49 2018
@@ -129,7 +129,7 @@ public final class CategoryUtil {
         int i = 0;
         for (List<String> trailElement : trailElements) {
             for (Iterator<String> trailIter = trailElement.iterator(); trailIter.hasNext();) {
-                String trailString = (String) trailIter.next();
+                String trailString = trailIter.next();
                 if (catMember.length() > 0){
                     catMember.append("/");
                     i++;

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/ProductUtil.java Tue Dec 11 13:33:49 2018
@@ -26,7 +26,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.UtilMisc;
@@ -88,7 +87,7 @@ public final class ProductUtil {
                 List<GenericValue> category = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition(UtilMisc.toMap("productId", productId)), null, null, null, false);
                 List<String> trails = new ArrayList<String>();
                 for (Iterator<GenericValue> catIterator = category.iterator(); catIterator.hasNext();) {
-                    GenericValue cat = (GenericValue) catIterator.next();
+                    GenericValue cat = catIterator.next();
                     String productCategoryId = (String) cat.get("productCategoryId");
                     List<List<String>> trailElements = CategoryUtil.getCategoryTrail(productCategoryId, dctx);
                     //Debug.log("trailElements ======> " + trailElements.toString());
@@ -98,7 +97,7 @@ public final class ProductUtil {
                         Iterator<String> trailIter = trailElement.iterator();
                       
                         while (trailIter.hasNext()) {
-                            String trailString = (String) trailIter.next();
+                            String trailString = trailIter.next();
                             if (catMember.length() > 0){
                                 catMember.append("/");
                                 i++;
@@ -136,7 +135,7 @@ public final class ProductUtil {
                     return ServiceUtil.returnError(ServiceUtil.getErrorMessage(featureSet));
                 }
                 if (featureSet != null) {
-                    dispatchContext.put("features", (Set<?>) featureSet.get("featureSet"));
+                    dispatchContext.put("features", featureSet.get("featureSet"));
                 }
 
                 Map<String, Object> productInventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", UtilMisc.toMap("productId", productId));

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrProductSearch.java Tue Dec 11 13:33:49 2018
@@ -132,7 +132,8 @@ public abstract class SolrProductSearch
         try {
             Debug.logInfo("Solr: Generating and indexing document for productId '" + productId + "'", module);
 
-            client = SolrUtil.getInstance().getHttpSolrClient(solrIndexName);
+            SolrUtil.getInstance();
+            client = SolrUtil.getHttpSolrClient(solrIndexName);
 
             // Construct Documents
             SolrInputDocument doc1 = SolrUtil.generateSolrDocument(context);
@@ -219,8 +220,9 @@ public abstract class SolrProductSearch
                 }
                 docs.add(doc1);
             }
+            SolrUtil.getInstance();
             // push Documents to server
-            client = SolrUtil.getInstance().getHttpSolrClient(solrIndexName);
+            client = SolrUtil.getHttpSolrClient(solrIndexName);
             client.add(docs);
             client.commit();
 
@@ -281,7 +283,8 @@ public abstract class SolrProductSearch
         String solrIndexName = (String) context.get("indexName");
         Map<String, Object> result;
         try {
-            client = SolrUtil.getInstance().getHttpSolrClient(solrIndexName);
+            SolrUtil.getInstance();
+            client = SolrUtil.getHttpSolrClient(solrIndexName);
             // create Query Object
             SolrQuery solrQuery = new SolrQuery();
             solrQuery.setQuery((String) context.get("query"));
@@ -548,14 +551,14 @@ public abstract class SolrProductSearch
             result = ServiceUtil.returnSuccess();
             result.put("numFound", (long) 0);
             Map<String, Object> categories = new HashMap<String, Object>();
-            List<FacetField> catList = (List<FacetField>) cat.getFacetFields();
+            List<FacetField> catList = cat.getFacetFields();
             for (Iterator<FacetField> catIterator = catList.iterator(); catIterator.hasNext();) {
-                FacetField field = (FacetField) catIterator.next();
-                List<Count> catL = (List<Count>) field.getValues();
+                FacetField field = catIterator.next();
+                List<Count> catL = field.getValues();
                 if (catL != null) {
                     // Debug.logInfo("FacetFields = " + catL, module);
                     for (Iterator<Count> catIter = catL.iterator(); catIter.hasNext();) {
-                        FacetField.Count f = (FacetField.Count) catIter.next();
+                        FacetField.Count f = catIter.next();
                         if (f.getCount() > 0) {
                             categories.put(f.getName(), Long.toString(f.getCount()));
                         }
@@ -606,13 +609,13 @@ public abstract class SolrProductSearch
                     QueryResponse cat = (QueryResponse) query.get("rows");
                     List<Map<String, Object>> categories = new ArrayList<Map<String, Object>>();
 
-                    List<FacetField> catList = (List<FacetField>) cat.getFacetFields();
+                    List<FacetField> catList = cat.getFacetFields();
                     for (Iterator<FacetField> catIterator = catList.iterator(); catIterator.hasNext();) {
-                        FacetField field = (FacetField) catIterator.next();
-                        List<Count> catL = (List<Count>) field.getValues();
+                        FacetField field = catIterator.next();
+                        List<Count> catL = field.getValues();
                         if (catL != null) {
                             for (Iterator<Count> catIter = catL.iterator(); catIter.hasNext();) {
-                                FacetField.Count f = (FacetField.Count) catIter.next();
+                                FacetField.Count f = catIter.next();
                                 if (f.getCount() > 0) {
                                     Map<String, Object> catMap = new HashMap<String, Object>();
                                     LinkedList<String> iName = new LinkedList<String>();
@@ -662,7 +665,8 @@ public abstract class SolrProductSearch
         Boolean treatConnectErrorNonFatal = (Boolean) context.get("treatConnectErrorNonFatal");
 
         try {
-            client = SolrUtil.getInstance().getHttpSolrClient(solrIndexName);
+            SolrUtil.getInstance();
+            client = SolrUtil.getHttpSolrClient(solrIndexName);
 
             // now lets fetch all products
             List<Map<String, Object>> solrDocs = new ArrayList<Map<String, Object>>();

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/SolrUtil.java Tue Dec 11 13:33:49 2018
@@ -183,7 +183,7 @@ public final class SolrUtil {
             List<String> category = UtilGenerics.<String>checkList(context.get("category"));
             Iterator<String> catIter = category.iterator();
             while (catIter.hasNext()) {
-                String cat = (String) catIter.next();
+                String cat = catIter.next();
                 doc1.addField("cat", cat);
             }
         }

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/test/SolrTests.java Tue Dec 11 13:33:49 2018
@@ -25,23 +25,15 @@ import java.util.Map;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.jasper.tagplugins.jstl.core.Remove;
-import org.apache.ofbiz.base.util.UtilMisc;
-import org.apache.ofbiz.entity.Delegator;
 import org.apache.ofbiz.entity.GenericValue;
 import org.apache.ofbiz.entity.util.EntityQuery;
 import org.apache.ofbiz.service.ServiceUtil;
 import org.apache.ofbiz.service.testtools.OFBizTestCase;
-import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.client.solrj.response.QueryResponse;
 
 public class SolrTests extends OFBizTestCase {
 
     protected GenericValue userLogin = null;
     private Map<String, Object> context;
-    private Map<String, Object> emptyContext = new HashMap<String, Object>();
     private Map<String, Object> response;
     private String validTestProductId = "GZ-1006";
     private String validTestProductId_2 = "GZ-1005";

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrLoadAdminUiServlet.java Tue Dec 11 13:33:49 2018
@@ -72,7 +72,13 @@ public class OFBizSolrLoadAdminUiServlet
                 out.write(StringUtils.replaceEach(html, search, replace));
                 out.flush();
             } finally {
-                IOUtils.closeQuietly(in);
+                try {
+                    if (in != null) {
+                        in.close();
+                    }
+                } catch (final IOException ioe) {
+                    // ignore
+                }
             }
         } else {
             response.sendError(404);

Modified: ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java?rev=1848673&r1=1848672&r2=1848673&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/src/main/java/org/apache/ofbiz/solr/webapp/OFBizSolrRedirectServlet.java Tue Dec 11 13:33:49 2018
@@ -28,7 +28,6 @@ import javax.servlet.http.HttpSession;
 import org.apache.solr.servlet.RedirectServlet;
 import org.apache.ofbiz.base.util.UtilValidate;
 import org.apache.ofbiz.entity.GenericValue;
-import org.apache.ofbiz.security.Security;
 import org.apache.ofbiz.webapp.control.LoginWorker;
 
 /**