|
[ https://issues.apache.org/jira/browse/OFBIZ-9788?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dennis Balkir updated OFBIZ-9788: --------------------------------- Attachment: OFBIZ-9788_org.apache.ofbiz.shipment.shipment_bugfixes.patch class ShipmentServices: - Line 171: added a default Locale to {{toUpperCase()}} - Line 506: removed {{&& shippableFeatureMap != null}} since {{shippableFeatureMap}} is used before and is initialized with the {{new}} operator, which means, that it cannot be a null object at this time - Line 533: removed the if-phrase with the null-check of {{shippableItemSizes}} since it is used before and is initialized with the {{new}} operator, which means, that it cannot be a null object at this time class ShipmentWorker: - Line 60: removed the declaration, because {{value}} is declared later before it is read anyways - Line 180: removed {{toString()}} since {{productId}} is already a string > [FB] Package org.apache.ofbiz.shipment.shipment > ----------------------------------------------- > > Key: OFBIZ-9788 > URL: https://issues.apache.org/jira/browse/OFBIZ-9788 > Project: OFBiz > Issue Type: Sub-task > Components: framework > Affects Versions: Trunk > Reporter: Dennis Balkir > Priority: Minor > Attachments: OFBIZ-9788_org.apache.ofbiz.shipment.shipment_bugfixes.patch > > > --- ShipmentServices.java:171, DM_CONVERT_CASE > Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.shipment.shipment.ShipmentServices.applyQuantityBreak(Map, Map, List, Delegator, GenericValue, String, String, String) > A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the > String.toUpperCase( Locale l ) > String.toLowerCase( Locale l ) > versions instead. > --- ShipmentServices.java:506, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE > RCN: Redundant nullcheck of shippableFeatureMap, which is known to be non-null in org.apache.ofbiz.shipment.shipment.ShipmentServices.calcShipmentCostEstimate(DispatchContext, Map) > This method contains a redundant check of a known non-null value against the constant null. > --- ShipmentServices.java:533, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE > RCN: Redundant nullcheck of shippableItemSizes, which is known to be non-null in org.apache.ofbiz.shipment.shipment.ShipmentServices.calcShipmentCostEstimate(DispatchContext, Map) > This method contains a redundant check of a known non-null value against the constant null. > --- ShipmentWorker.java:59, DLS_DEAD_LOCAL_STORE > DLS: Dead store to value in org.apache.ofbiz.shipment.shipment.ShipmentWorker.getShipmentPackageContentValue(GenericValue) > This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used. > Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives. > --- ShipmentWorker.java:179, DM_STRING_TOSTRING > Dm: org.apache.ofbiz.shipment.shipment.ShipmentWorker.calcPackageWeight(DispatchContext, Map, List, BigDecimal) invokes toString() method on a String > Calling String.toString() is just a redundant operation. Just use the String. -- This message was sent by Atlassian JIRA (v6.4.14#64029) |
| Free forum by Nabble | Edit this page |
