ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Brohl (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (OFBIZ-9776) [FB] Package org.apache.ofbiz.product.image
Date Sat, 09 Dec 2017 15:11:00 GMT

     [ https://issues.apache.org/jira/browse/OFBIZ-9776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Brohl closed OFBIZ-9776.
--------------------------------
       Resolution: Implemented
    Fix Version/s: Upcoming Release

Thanks Julian,

your patch is in trunk r1817623. 

> [FB] Package org.apache.ofbiz.product.image
> -------------------------------------------
>
>                 Key: OFBIZ-9776
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9776
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: product
>    Affects Versions: Trunk
>            Reporter: Julian Leichert
>            Assignee: Michael Brohl
>            Priority: Minor
>             Fix For: Upcoming Release
>
>         Attachments: OFBIZ-9776_org.apache.ofbiz.product.image_bugfixes.patch
>
>
> ScaleImage.java:121, DM_CONVERT_CASE
> - Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.product.image.ScaleImage.scaleImageInAllSize(Map,
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.
> ScaleImage.java:137, NP_LOAD_OF_KNOWN_NULL_VALUE
> - NP: Load of known null value in org.apache.ofbiz.product.image.ScaleImage.scaleImageInAllSize(Map,
String, String, String)
> The variable referenced at this point is known to be null due to an earlier check against
null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different
variable, or perhaps the earlier check to see if the variable is null should have been a check
to see if it was non-null).
> ScaleImage.java:141, RV_RETURN_VALUE_IGNORED
> - RV: Return value of String.substring(int, int) ignored in org.apache.ofbiz.product.image.ScaleImage.scaleImageInAllSize(Map,
String, String, String)
> The return value of this method should be checked. One common cause of this warning is
to invoke a method on an immutable object, thinking that it updates the object. For example,
in the following code fragment,
>     String dateString = getHeaderField(name);
>     dateString.trim();
> the programmer seems to be thinking that the trim() method will update the String referenced
by dateString. But since Strings are immutable, the trim() function returns a new String value,
which is being ignored here. The code should be corrected to:
>     String dateString = getHeaderField(name);
>     dateString = dateString.trim();
> ScaleImage.java:180, NP_NULL_ON_SOME_PATH
> - NP: Possible null pointer dereference of newFileLocation in org.apache.ofbiz.product.image.ScaleImage.scaleImageInAllSize(Map,
String, String, String)
> There is a branch of statement that, if executed, guarantees that a null value will be
dereferenced, which would generate a NullPointerException when the code is executed. Of course,
the problem might be that the branch or statement is infeasible and that the null pointer
exception can't ever be executed; deciding that is beyond the ability of FindBugs.
> ScaleImage.java:202, RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
> - RV: Exceptional return value of java.io.File.delete() ignored in org.apache.ofbiz.product.image.ScaleImage.scaleImageInAllSize(Map,
String, String, String)
> This method returns a value that is not checked. The return value should be checked since
it can indicate an unusual or unexpected function execution. For example, the File.delete()
method returns false if the file could not be successfully deleted (rather than throwing an
Exception). If you don't check the result, you won't notice if the method invocation signals
unexpected behavior by returning an atypical return value.
> ScaleImage.java:301, DM_CONVERT_CASE
> - Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.product.image.ScaleImage.scaleImageManageInAllSize(Map,
String, 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.
> ScaleImage.java:308, NP_LOAD_OF_KNOWN_NULL_VALUE
> - NP: Load of known null value in org.apache.ofbiz.product.image.ScaleImage.scaleImageManageInAllSize(Map,
String, String, String, String)
> The variable referenced at this point is known to be null due to an earlier check against
null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different
variable, or perhaps the earlier check to see if the variable is null should have been a check
to see if it was non-null).
> ScaleImage.java:360, NP_NULL_ON_SOME_PATH
> - NP: Possible null pointer dereference of newFileLocation in org.apache.ofbiz.product.image.ScaleImage.scaleImageManageInAllSize(Map,
String, String, String, String)
> There is a branch of statement that, if executed, guarantees that a null value will be
dereferenced, which would generate a NullPointerException when the code is executed. Of course,
the problem might be that the branch or statement is infeasible and that the null pointer
exception can't ever be executed; deciding that is beyond the ability of FindBugs. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message