(OFBIZ-11004)
Overriding a synchronized method with a non-synchronized one can
introduce potential runtime concurrency bugs. Since
‘ExtendedProperties#loadFromXML’ is overridding
‘Properties#loadFromXML’ which is synchronized, it is safer to mark it
as synchonized.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858490 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10933)
This is done to remove a warning in OpenJDK 8 which doesn't seem to
handle ‘@safevarargs’ annotation properly when using generics. This
warning was not present with OpenJDK 11.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858483 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-11003)
Probably due to some IDE auto-importing mistake, some classes meant as
backports of the ‘java.util.Arrays’ and ‘java.util.Collections’
classes were imported. This make no sense since we are requiring
Java 8 which already provides those.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858480 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10660)
Steps to Regenerate
1. Open /catalog/control/createProductPriceCond
2. Add the name for a new Price Rule
3. Add Condition and go to Add Action panel
4. Check the dropdown values under Action Type
*Actual: *
Same value reflecting twice in the dropdown ( Flat Amount Modify)
The Image is attached in Jira for reference
Thanks: Archana Asthana for report Prakhar Kumar for the fix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858355 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10187)
This makes the sanitizing enabled/disabled by configuration and enhances
the functionality to support custom sanitizer policies. A reasonable
example policy class is also included.
Thanks Dennis Balkir for reporting and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858352 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10939)
The ‘@Override’ annotation helps readers understand that the method at
hand is overriding a super class or implementing an interface.
Additionally it allows the compiler to check if the methods annotated
with ‘@Override’ are actually implementing an abstract method.
Using that annotation makes ‘@see foo.bar.ParentClass#myMethod’
comments useless, so those they have been removed for the newly
annotated methods.
Thanks Jacques Le Roux and Swapnil M Mane for acknowledging the commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858295 13f79535-47bb-0310-9956-ffa450edef68
components
(OFBIZ-9905)
As the title says + removes now useless labels
Thanks: Aayush Jain for report, Sourabh Jain for the fix, Pierre Smits and
Rishi Solanki for comments
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858291 13f79535-47bb-0310-9956-ffa450edef68
called directly.
(OFBIZ-10895)
Partially revert r1858094, just replaces "rmaps == null" by "rmaps.isEmpty()"
As Mathieu mentioned in dev:
<<Checking for ‘null’ here is not a solution since ‘resolveURI’ contract
it to return a non-nullable collection.
This commit is only bypassing the error handling.>>
As I said in r1858094:
<<This has been somehow broken by OFBIZ-10438 but actually it was already broken
before but not for the same reason.>>
We need now to review/check how it worked in R15 where it's OK, and possibly
implements the same
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858180 13f79535-47bb-0310-9956-ffa450edef68
directly.
(OFBIZ-10895)
This has been somehow broken by OFBIZ-10438 but actually it was already broken
before but not for the same reason. Finally r1838081 (for OFBIZ-10438) allows to
easy fix it when in previous versions (pre R18) it would need another fix.
Since it's only annoying text in log I'll let users search the solution for
pre R18 versions and will fix it only for trunk and R18.
Replaces rmaps.isEmpty() by rmaps == null as it was before R16 (R15 has not this
issue)
Also includes Eclipse automated imports sorting
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858092 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10833)
Reason: The UtilHttp.getMultiPartParameterMap method is used to get the parameters in case of multipart/form-data type.
The getMultiPartParameterMap parse the request to get the parameters.
{code}
uploadedItems = UtilGenerics.<FileItem>checkList(upload.parseRequest(request));
{code}
As per the Apache commons-fileupload guideline, a request can only be parsed once [1]. So, for the next response, again the same getMultiPartParameterMap method is executed (with the same request object), and no parameters are found, since, the request is already parsed.
Also, have a look at the StackOverflow question [2], it also contains related information.
Fix for the issue:
Set the consumed parameters (except uploaded file(s)) in the request attribute so that it will be available to the next response.
The uploaded file(s) are not set in request attribute again to avoid unnecessary memory consumption, also it makes no sense to traverse the uploaded file in the request.
[1] http://commons.apache.org/proper/commons-fileupload/faq.html#empty-parse
[2] https://stackoverflow.com/questions/13881272/servletfileuploadparserequestrequest-returns-an-empty-list
Thanks: Ingo Wolfmayr for reporting issue and Jacques Le Roux for review.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1858035 13f79535-47bb-0310-9956-ffa450edef68
The equality between two maps is defined by the presence of the same
set of entries in both maps, so checking equality of the maps is
equivalent to checking directly their entries.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857958 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10937)
Since Java 1.7, when defining generic types it is unnecessary to
redefine those types in the constructor when it is done in the
declared type.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857906 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10935)
Use ‘PoolableConnectionFactory#setAutoCommitOnReturn’ instead of
‘PoolableConnectionFactory#setEnableAutoCommitOnReturn’ from
‘org.apache.commons.dbcp2’ package.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857898 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10933)
This fixes a regression introduced in revision 1837462.
When pushing a ‘LinkedHashMap’ inside a ‘MapContext’, the iteration
order of the ‘MapContext’ values was not corresponding to the
insertion order of the embedded ‘LinkedHashMap’ which is important in
the ‘ControllerConfig’ case where configuration elements are stored in
‘LinkedHashMap’ objects and the ‘include’ mechanism relies on
‘MapContext’.
To avoid such regression in the future, a test reproducing the bug has
been added.
Thanks: Gil Portenseigne for investigating.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857818 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10933)
It is convenient to use ‘UtilMisc#toMap’ to create pseudo-literal
maps. Previously it was not possible to specify the concrete class of
the constructed map. The ‘UtilMisc#toMap(Supplier<Map<K, V>>,
Object...)’ overload now provides a convenient way to instantiate
specific map types like ‘LinkedHashMap’ objects.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857817 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9241)
While working on OFBIZ-9206 I remembered how the ecommerce webapp is deeply
entrenched in some applications components. This can at least be tested with
product and catalog webapp.
Get to catalog/control/EditProduct?productId=GZ-1000
Click on the "Product Page" button => ecommerce
There are much more cases (96 occurrences actually) but most of them are not
hard dependencies.
Since the ecommerce component is now a plugin, we need to remove all ecommerce
links from applications, I even wonder if this issue is really an improvement
or should not be now considered a bug...
This is a temporary solution with a FIXME it was waiting for months and I
almost forgot it. There are better ideas in the Jira but nothing have been done
yet.
Thanks: Michael and Deepak for discussion and ideas
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857398 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10837)
Fixes CVE-2019-0189
Cleans and simplifies things in UtilObject.java and also handles patterns.
That's what we missed most when needing to update.
Fixes typos in SafeObjectInputStream class and add a commented line for a WIP in
resolveProxyClass method
Also includes work done in UtilObject.java for OFBIZ-9855
"Using try-with-resources with File IO Objects."
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857392 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-5028)
To escape exception on native conversion, we add converter for StringBuffer and StringWrapper on MiscConverters
Thanks to Christoph Neuroth for this issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857371 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9855)
Uses try with resources for File IO objects like ObjectInputStream and other
objects. File classes have the AutoCloseable interface.
jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...
All tests pass
Thanks: Pradhan Yash Sharma
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857099 13f79535-47bb-0310-9956-ffa450edef68
This commit causing 'ResultSet not open' while rendering list forms.
Scott's comments from ML:
You'll need to be careful with this one, based on the limited usage of the
iterator here it seems likely that it will be used again later in the
process.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857095 13f79535-47bb-0310-9956-ffa450edef68
‘java.io.ObjectInputStream’ already implements the ‘AutoCloseable’
interface, so there is no need to declare it in
‘SafeObjectInputStream’ which extends this class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857088 13f79535-47bb-0310-9956-ffa450edef68
JobPoller so that important jobs can be prioritized over normal jobs, and low
priority jobs can be left until last. [OFBIZ-10865]
Changes are as follows:
* Add a "priority" field to JobSandbox entity (numeric/Long)
* Add JobPriority constants class containing fields LOW (0), NORMAL (50) and HIGH (100)
* Add getPriority method to the Job interface and implement methods for AbstractJob (returns NORMAL), PersistedServiceJob (returns JobSandbox.priority) and PurgeJob (returns LOW)
* Change the JobPoller executor's queue to use PriorityBlockingQueue (unbounded) instead of LinkedBlockingQueue (bounded)
* Implement custom Comparator for the priority queue to sort by priority descending and then runTime ascending
* Change the poll size per poll to be (queueSize() - queue.size) instead of queue.remainingCapacity() due to the new queue being unbounded
* I've also opted to limit the database poll query to the poll size using maxRows() because it seemed dangerous to me to use an unconstrained query on this table
* Ensured recurring jobs receive the default (NORMAL) priority when being rescheduled so that they're sorted correctly on the next time they show up in the database poll
* Ensured jobs generated at runtime are given a default priority of NORMAL
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857071 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10706)
I tried to find the history for why the service does not take the
defaultFromEmailAddress property from general.properties and I found that It was
last modified in revision r418498 on 02/07/2006, I think it was always broken.
This uses defaultFromEmailAddress property in sendMail if sendFrom is missing
Thanks: Benjanmin Jugl reported, Pawan Verma fixed and others for discussion
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856667 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10377)
In the case of entity auto service, when an invalid status change is performed, the error message doesn't show the current status of the item from which the user is changing the status.
Thanks: Lalit Dashora for reporting the issue and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856598 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10817)
When freemarker failed to execute a template, you have on end screen rendered all java stack trace generated.
I improve this to display the stack trace only when widget is on verbose, no regression during development and when you switch to production site, in general your widget verbose is off so end user haven't stack trace and replace it by ∎ (that totally unused for them but help to detect a problem).
I also introduce two new properties on widget.properties:
widget.freemarker.template.verbose : if your widget verbose is off and you want display the freemarker stacktrace when your template generate an exception set it to true
widget.freemarker.template.exception.message : when you don't displaying freemarker stacktrace, you can replace it by an other message by default it use ∎ but you can set what you want, like 'ERROR', '##' or ' '
Thanks to Deepak Dixit, Jacques Le Roux, Michael Brohl and Mathieu Lirzin for their suggest
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856524 13f79535-47bb-0310-9956-ffa450edef68