This is an automated email from the ASF dual-hosted git repository.
surajk pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git The following commit(s) were added to refs/heads/trunk by this push: new 6dfc3c1 Improved: Corrected some extra spaces and naming conventions related checkstyle issues. (OFBIZ-11921) Also fixed some access modifiers for some private class members. Thanks Jacques Le Roux for review. 6dfc3c1 is described below commit 6dfc3c19e756dba7d0563d4fc8e920a72cc8bef9 Author: Suraj Khurana <[hidden email]> AuthorDate: Mon Aug 31 20:01:25 2020 +0530 Improved: Corrected some extra spaces and naming conventions related checkstyle issues. (OFBIZ-11921) Also fixed some access modifiers for some private class members. Thanks Jacques Le Roux for review. --- .../cmssite/multisite/MultiSiteRequestWrapper.java | 6 +- .../org/apache/ofbiz/ebaystore/EbayAccount.java | 2 +- .../org/apache/ofbiz/ebaystore/EbayFeedback.java | 2 +- .../java/org/apache/ofbiz/ebaystore/EbayStore.java | 2 +- .../ebaystore/EbayStoreInventoryServices.java | 4 +- .../apache/ofbiz/example/ExampleWebSockets.java | 22 ++++++-- .../org/apache/ofbiz/htmlreport/HtmlReport.java | 66 +++++++++++++--------- 7 files changed, 65 insertions(+), 39 deletions(-) diff --git a/cmssite/src/main/java/org/apache/ofbiz/cmssite/multisite/MultiSiteRequestWrapper.java b/cmssite/src/main/java/org/apache/ofbiz/cmssite/multisite/MultiSiteRequestWrapper.java index 149ad92..4c5ee39 100644 --- a/cmssite/src/main/java/org/apache/ofbiz/cmssite/multisite/MultiSiteRequestWrapper.java +++ b/cmssite/src/main/java/org/apache/ofbiz/cmssite/multisite/MultiSiteRequestWrapper.java @@ -116,9 +116,9 @@ public class MultiSiteRequestWrapper implements HttpServletRequest { } } return pathInfo.substring(nextPathSegmentStart); - } else { - return pathInfo; - } + } else { + return pathInfo; + } } @Override diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayAccount.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayAccount.java index 0210cc9..cfe3a5e 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayAccount.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayAccount.java @@ -79,7 +79,7 @@ public class EbayAccount { street1 = regAddress.getStreet1(); street2 = regAddress.getStreet2(); } - if (firstName == null && lastName == null && name !=null) { + if (firstName == null && lastName == null && name != null) { String nameArray[] = name.split(" "); firstName = nameArray[0]; lastName = nameArray[1]; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java index c6f4ca3..83b5353 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayFeedback.java @@ -240,7 +240,7 @@ public class EbayFeedback { entry.put("userID", transection.getItem().getSeller().getUserID()); entry.put("role", "seller"); } - if (transection.getShippingDetails()!=null) { + if (transection.getShippingDetails() != null) { entry.put("shippingCost", transection.getShippingDetails().getDefaultShippingCost().getValue()); entry.put("shippingCurrency", transection.getShippingDetails().getDefaultShippingCost().getCurrencyID().name()); } diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java index 23123be..25f5cd2 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java @@ -1260,7 +1260,7 @@ public class EbayStore { storeTheme.setThemeID(Integer.parseInt((String) context.get("storeAdvancedTheme"))); } else if ("Basic".equals(context.get("themeType"))) { storeColorScheme = new StoreColorSchemeType(); - if (context.get("storeBasicTheme")!=null) { + if (context.get("storeBasicTheme") != null) { String storeBasicTheme = (String) context.get("storeBasicTheme"); String storeThemeId = null; String storeColorSchemeId = null; diff --git a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java index 8660965..4f6696e 100644 --- a/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java +++ b/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreInventoryServices.java @@ -154,7 +154,7 @@ public class EbayStoreInventoryServices { sellingManagerProductDetailsType.setProductName((EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne()).getString("internalName")); //Must keep productId in SKU NUMBER because ebay allow productId field only long value. sellingManagerProductDetailsType.setCustomLabel(productId); - if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); + if (ebayProductStoreInventory != null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); productReq.setSellingManagerProductDetails(sellingManagerProductDetailsType); productResp = (AddSellingManagerProductResponseType) productCall.execute(productReq); @@ -206,7 +206,7 @@ public class EbayStoreInventoryServices { sellingManagerProductDetailsType.setProductName((EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne()).getString("internalName")); //Must keep productId in SKU NUMBER because ebay allow productId field only long value. sellingManagerProductDetailsType.setCustomLabel(productId); - if (ebayProductStoreInventory!=null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); + if (ebayProductStoreInventory != null) sellingManagerProductDetailsType.setQuantityAvailable(ebayProductStoreInventory.getBigDecimal("availableToPromiseListing").intValue()); req.setSellingManagerProductDetails(sellingManagerProductDetailsType); resp = (ReviseSellingManagerProductResponseType) call.execute(req); diff --git a/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java b/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java index c0afba4..61b36b6 100644 --- a/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java +++ b/example/src/main/java/org/apache/ofbiz/example/ExampleWebSockets.java @@ -37,8 +37,14 @@ public class ExampleWebSockets { private static final String MODULE = ExampleWebSockets.class.getName(); private static Set<Session> clients = Collections.synchronizedSet(new HashSet<Session>()); - + + /** + * On message. + * @param session the session + * @param msg the msg + * @param last the last + */ @OnMessage public void onMessage(Session session, String msg, boolean last) { try { @@ -60,19 +66,27 @@ public class ExampleWebSockets { } } + /** + * On open. + * @param session the session + */ @OnOpen - public void onOpen (Session session) { + public void onOpen(Session session) { // Add session to the connected sessions clients set clients.add(session); } + /** + * On close. + * @param session the session + */ @OnClose - public void onClose (Session session) { + public void onClose(Session session) { // Remove session from the connected sessions clients set clients.remove(session); } - public static Set<Session> getClients () { + public static Set<Session> getClients() { return clients; } } diff --git a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java index 73e5cfa..c513fea 100644 --- a/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java +++ b/pricat/src/main/java/org/apache/ofbiz/htmlreport/HtmlReport.java @@ -66,25 +66,25 @@ public class HtmlReport extends AbstractReport { protected static final String LINEBREAK_TRADITIONAL = "<br>\n"; /** The list of report objects e.g. String, Exception ... */ - protected List<Serializable> content; + private List<Serializable> content; /** The list of report objects e.g. String, Exception ... */ - protected List<Serializable> logContent; + private List<Serializable> logContent; /** * Counter to remember what is already shown, * indicates the next index of the content list that has to be reported. */ - protected int indexNext; + private int indexNext; /** Flag to indicate if an exception should be displayed long or short. */ - protected boolean showExceptionStackTrace; + private boolean showExceptionStackTrace; /** If set to <code>true</code> nothing is kept in memory. */ - protected boolean isTransient; + private boolean isTransient; /** Boolean flag indicating whether this report should generate HTML or JavaScript output. */ - protected boolean writeHtml; + private boolean writeHtml; /** Helper variable to deliver the html end part. */ public static final int HTML_END = 1; @@ -93,19 +93,19 @@ public class HtmlReport extends AbstractReport { public static final int HTML_START = 0; /** The thread to display in this report. */ - protected String paramThread; + private String paramThread; /** The next thread to display after this report. */ - protected String paramThreadHasNext; + private String paramThreadHasNext; - protected String paramAction; + private String paramAction; - protected String paramTitle; + private String paramTitle; - protected String paramResource; + private String paramResource; /** Flag for refreching workplace .*/ - protected String paramRefreshWorkplace; + private String paramRefreshWorkplace; /** Constant for the "OK" button in the build button methods. */ public static final int BUTTON_OK = 0; @@ -152,21 +152,21 @@ public class HtmlReport extends AbstractReport { /** Request parameter value for the action: set. */ public static final String DIALOG_SET = "set"; /** The RESOURCE list parameter value. */ - protected String paramResourcelist; + private String paramResourcelist; /** The list of RESOURCE names for the multi operation. */ - protected List<String> resourceList; + private List<String> resourceList; /** The key name which contains the localized message for the continue checkbox. */ - protected String paramReportContinueKey; + private String paramReportContinueKey; public static final String DIALOG_URI = "dialoguri"; public static final String FORM_URI = "formuri"; private static final String RESOURCE = "PricatUiLabels"; /** Log file. */ - protected File logFile; + private File logFile; /** Log file name. */ - protected String logFileName; + private String logFileName; /** Log file output stream. */ - protected FileOutputStream logFileOutputStream; - protected long sequenceNum = -1; + private FileOutputStream logFileOutputStream; + private long sequenceNum = -1; /** * Constructs a new report using the provided locale for the output language.<p> @@ -210,7 +210,8 @@ public class HtmlReport extends AbstractReport { } return wp; } - public static HtmlReport getInstance(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, String logFileName) { + public static HtmlReport getInstance(HttpServletRequest request, HttpServletResponse response, boolean writeHtml, boolean isTransient, + String logFileName) { HtmlReport wp = (HtmlReport) request.getSession().getAttribute(SESSION_REPORT_CLASS); if (wp == null || UtilValidate.isEmpty(wp.getLogFileName()) || !wp.getLogFileName().equals(logFileName)) { wp = new HtmlReport(request, response, writeHtml, isTransient); @@ -218,14 +219,29 @@ public class HtmlReport extends AbstractReport { } return wp; } + + /** + * Gets param action. + * @param request the request + * @return the param action + */ public String getParamAction(HttpServletRequest request) { paramAction = request.getParameter("action"); return paramAction != null ? paramAction : "reportbegin"; } + + /** + * Sets param action. + * @param action the action + */ public void setParamAction(String action) { paramAction = action; } + /** + * Sets param thread. + * @param name the name + */ public void setParamThread(String name) { paramThread = name; } @@ -776,9 +792,7 @@ public class HtmlReport extends AbstractReport { result.append("<input type=\"hidden\" name=\""); result.append(param); result.append("\" value=\""); - String encoded = ReportEncoder.encode( - entry.getValue().toString(), - "UTF-8"); + String encoded = ReportEncoder.encode(entry.getValue().toString(), "UTF-8"); result.append(encoded); result.append("\">\n"); } @@ -875,8 +889,7 @@ public class HtmlReport extends AbstractReport { * @return the button row */ public String dialogButtonsOkCancel(HttpServletRequest request, String okAttrs, String cancelAttrs) { - if (Boolean.valueOf(getParamThreadHasNext(request)) - && ReportStringUtil.isNotEmpty(getParamReportContinueKey())) { + if (Boolean.valueOf(getParamThreadHasNext(request)) && ReportStringUtil.isNotEmpty(getParamReportContinueKey())) { return dialogButtons(new int[] {BUTTON_OK, BUTTON_CANCEL}, new String[] { okAttrs, cancelAttrs}); @@ -898,8 +911,7 @@ public class HtmlReport extends AbstractReport { } else { downloadAttrs += " "; } - if (Boolean.valueOf(getParamThreadHasNext(request)) - && ReportStringUtil.isNotEmpty(getParamReportContinueKey())) { + if (Boolean.valueOf(getParamThreadHasNext(request)) && ReportStringUtil.isNotEmpty(getParamReportContinueKey())) { return dialogButtons(new int[] {BUTTON_OK, BUTTON_CANCEL, BUTTON_DOWNLOAD}, new String[] { okAttrs, cancelAttrs, |
Free forum by Nabble | Edit this page |