Commit Graph
2421 Commits
Author SHA1 Message Date
Nicolas Malin 61cf2fa891 Fixed: Add converter for StringWrapper and StringBuffer
(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
2019-04-12 07:17:28 +00:00
Jacques Le Roux f85a480f01 Improved: Using try-with-resources with File IO Objects.
(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
2019-04-08 09:17:55 +00:00
Mathieu Lirzin a15b7b1996 Reverted: Changes done at r#1857089 and r#1857090 (OFBIZ-10911)(OFBIZ-10912)
The Cleanups introduced by those revisions has introduced some
unexpected regressions making the Gradle ‘loadAll’ task fail.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857091 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 23:36:29 +00:00
Mathieu Lirzin d639aba7e7 Improved: Remove redundant null checks (OFBIZ-10911)
Redundant null checks detected by Eclipse has been removed.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857089 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 23:02:39 +00:00
Mathieu Lirzin f3a39e9665 Fixed: Remove redundant interface declaration (OFBIZ-10910)
‘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
2019-04-07 22:11:53 +00:00
Mathieu Lirzin 8700328f09 Fixed: Remove unused type parameters (OFBIZ-10909)
No functional change.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857087 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 22:00:16 +00:00
Mathieu Lirzin 264ed9c8d2 Improved: Remove unused private ‘UnsupportedClassConverter’ class (OFBIZ-10908)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857085 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 19:39:54 +00:00
Mathieu Lirzin 3111fc6b40 Fixed: Remove unused ‘java.util.TreeMap’ import
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857083 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 19:35:37 +00:00
Mathieu Lirzin f2a72984e1 Fixed: Remove Raw type cast warning in ‘ObjectType’
Use ‘UtilGenerics#cast’ for shorter syntax.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857082 13f79535-47bb-0310-9956-ffa450edef68
2019-04-07 19:33:44 +00:00
Nicolas Malin 7a34878e51 Improved: Configure stackTrace displaying on ftl rendering
(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
2019-03-29 08:28:15 +00:00
Jacques Le Roux ad21c41b34 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Ed Mack
This adds 
org.apache.ofbiz.widget.model.ModelTheme
java.util.Collections 
java.util.LinkedList 
java.util.ArrayList
java.util.TimeZonz


Thanks: Ed Mack at OFBIZ-10876

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856484 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 15:36:13 +00:00
Jacques Le Roux 495a76f886 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

There was a recurring typo in previous commit.
For arrays of primitives it should be 
"\\[Z","\\[B","\\[S","\\[I","\\[J","\\[F","\\[D","\\[C"
and not 
"[Z","[B","[S","[I","[J","[F","[D","[C"
It shows how tired I'm :/


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856460 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 08:30:21 +00:00
Jacques Le Roux 0cc1913a34 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

There was a recurring typo in previous commit.
For arrays of primitives it should be 
"[Z","[B","[S","[I","[J","[F","[D","[C"
and not 
"[Z ","[B ","[S ","[I ","[J ","[F ","[D ","[C "
Just spotted that while reviewing again (did not have the time to test)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856459 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 08:18:19 +00:00
Jacques Le Roux 87a1138fb2 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Ed Mack
This adds all arrays of primitives and java.math.BigDecimal 

Thanks: Ed Mack at OFBIZ-10876

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856455 13f79535-47bb-0310-9956-ffa450edef68
2019-03-28 07:50:32 +00:00
Jacques Le Roux 6f8cb540eb Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Wolfgang Rauchholz on user
ML 
This adds java.math.BigDecimal and "[B" (ie [B == byte[] and I don't understand
why in this case "byte[]" does not work)

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Ingo Wolfmayr at OFBIZ-10870

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856405 13f79535-47bb-0310-9956-ffa450edef68
2019-03-27 14:16:24 +00:00
Swapnil Mane 29f2e071eb Improved: Moved the nodeType check after node.getTextContent() method call
(OFBIZ-10832)

Since most nodes will contain text then it will be more efficient to do a null check after retrieving nodeValue.

Thanks: Scott for your valuable inputs.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855898 13f79535-47bb-0310-9956-ffa450edef68
2019-03-20 12:15:59 +00:00
Mathieu Lirzin d90431a3f5 Fixed: Adapt some javadoc to let the build succeed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855674 13f79535-47bb-0310-9956-ffa450edef68
2019-03-16 23:23:09 +00:00
Jacques Le Roux 458f2217b8 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Wolfgang Rauchholz on user
ML 
This adds java.util.Date

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Wolfgang Rauchholz

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855492 13f79535-47bb-0310-9956-ffa450edef68
2019-03-14 08:28:27 +00:00
Jacques Le Roux f94a5b94d0 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Wolfgang Rauchholz on user
ML 
This adds java.sql.Timestamp

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Wolfgang Rauchholz

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855488 13f79535-47bb-0310-9956-ffa450edef68
2019-03-14 07:42:17 +00:00
Swapnil Mane ff17b108c5 Fixed: simpleTypeConvert always returns Null for Document, Document Type and Notation Node
(OFBIZ-10832)

As per the code, getTextContent() method is used get text content of the node and its descendants but the node.getTextContent() always return Null for the following Node type
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE [1]

Since we can't get the text value of Document, Document Type and Notation Node, thus simply return the same object.

[1] https://docs.oracle.com/javase/7/docs/api/org/w3c/dom/Node.html#getTextContent()

Thanks: Deepak Dixit for reviewing the code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855403 13f79535-47bb-0310-9956-ffa450edef68
2019-03-13 12:27:13 +00:00
Jacques Le Roux 40a9d42769 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Deepak at OFBIZ-10837
This adds sun.util.calendar.ZoneInfo

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Deepak Dexit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855371 13f79535-47bb-0310-9956-ffa450edef68
2019-03-13 08:19:32 +00:00
Jacques Le Roux 02157fa5b0 Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Rohit at OFBIZ-10573
This adds FlexibleStringExpander

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Rohit Koushal

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855287 13f79535-47bb-0310-9956-ffa450edef68
2019-03-12 08:29:37 +00:00
Deepak Dixit 7b9ea305d7 Preparation for JDK11 update, Updated following code to fix warning with respect to JDK11
- Replaced Class::newInstance occurrences 
- Removed deprecated override method Object::finalize
(OFBIZ-10757)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854683 13f79535-47bb-0310-9956-ffa450edef68
2019-03-03 10:27:29 +00:00
Mathieu Lirzin e8ea418cb6 Improved: Rewrite ‘ComponentConfig’ constructor (OFBIZ-10829)
Previouly this constructor was containing a lot of duplicated code
that is now factorized by using the newly added ‘collectElements’
private method.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854671 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 20:28:36 +00:00
Mathieu Lirzin 617b762915 Improved: Disallow extension of the script helper bindings (OFBIZ-10825)
‘ScriptHelper’ is a mechanism used to add some useful bindings to
scripts.  This feature has been introduced in revision 1299924 by
Adrian Crum as part of an general effort of supporting the Generic
Scripting Engine specified by JSR-223.

Previously this mechanism was extensible, however it appears to be
undesirable (nor used in practice) to extend the bindings available to
services since the internal service implementations are highly coupled
to those bindings.  As a consequence the usage of the Abstract Factory
pattern which was used for that purpose is now removed.

The side effect of this change is that we have now simpler code.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854668 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 19:40:48 +00:00
Mathieu Lirzin 10891b6022 Improved: Remove ‘GroovyUtil#loadClass’ (OFBIZ-10820)
The ‘GroovyUtil#loadClass’ method was not used anywhere in the
framework.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854665 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 19:19:40 +00:00
Mathieu Lirzin dea9ca9445 Improved: Rewrite ‘GroovyUtil#parseClass’ (OFBIZ-10822)
The ‘parseClass(InputStream in, String location)’ and
‘parseClass(InputStream in, String location, GroovyClassLoader
groovyClassLoader)’ methods from GroovyUtil are now merged in a
private and documented method.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854663 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 19:14:24 +00:00
Mathieu Lirzin 4af444183d Improved: Rewrite ‘GroovyUtil#runScriptAtLocation’ (OFBIZ-10807)
The ‘GroovyUtil#runScriptAtLocation’ method has now a javadoc and is
rewritten as a simple ternary expression.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854653 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 17:09:54 +00:00
Mathieu Lirzin 164849a796 Improved: Remove Groovy Base script redundancy (OFBIZ-10806)
According to Groovy documentation [1] the following construction:

    CompilerConfiguration cfg = new CompilerConfiguration();
    cfg.setScriptBaseClass(scriptBaseClass);
    groovyClassLoader =
        new GroovyClassLoader(GroovyUtil.class.getClassLoader(), cfg);

is equivalent to running the a script containing the ‘@BaseScript’
annotation.  Previously in ‘org.apache.ofbiz.base.util.GroovyUtil’
instead of choosing one solution, we were doing both.  Now we only
rely on the construction described above.

[1] http://docs.groovy-lang.org/latest/html/documentation/#_script_base_classes


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854652 13f79535-47bb-0310-9956-ffa450edef68
2019-03-02 17:02:32 +00:00
Mathieu Lirzin 6be4f5e37f Improved: Refactor ‘WebAppCache’ (OFBIZ-10606)
This makes use of streams and lambdas.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854431 13f79535-47bb-0310-9956-ffa450edef68
2019-02-26 22:57:00 +00:00
Mathieu Lirzin d0356437c8 Improved: Add tests for ‘WebAppCache’ (OFBIZ-10606)
Those tests requires additional constructors for ‘ComponentConfig’
and ‘ComponentConfig.WebappInfo’ to be able to instantiate them
without an XML element.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854430 13f79535-47bb-0310-9956-ffa450edef68
2019-02-26 22:52:27 +00:00
Mathieu Lirzin 4aa65a5b68 Improved: Add ‘WebAppCache’ (OFBIZ-10606)
This improves the cohesion of the ‘ComponentConfig’ class by
extracting the webapps cache related methods into a separate
‘WebAppCache’ class.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1854429 13f79535-47bb-0310-9956-ffa450edef68
2019-02-26 22:47:58 +00:00
Jacques Le Roux 40c971275a Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

The white list I used was not complete.
This adds "java.util.HashMap", "Boolean", "Number", "Integer" which are the ones
missing I found so far. 
Maybe other classes could still miss OOTB. So I added a warning in 
SafeObjectInputStream::resolveClass

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1853745 13f79535-47bb-0310-9956-ffa450edef68
2019-02-17 12:38:06 +00:00
Jacques Le Roux cd5ba2b8ce Improved: Improve ObjectInputStream class
(OFBIZ-10837)

Fixes CVE-2019-0189

As reported by FindBugs and Sonar, it's troubling (a Bad practice in Sonar[1], 
a code smell in Findbugs[2]) when extending to use the same name than the 
extended Object

[1] https://sbforge.org/sonar/rules/show/findbugs:NM_SAME_SIMPLE_NAME_AS_SUPERCLASS?layout=false
[2] https://logging.apache.org/log4j/log4j-2.2/log4j-jul/findbugs.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1853691 13f79535-47bb-0310-9956-ffa450edef68
2019-02-16 09:42:03 +00:00
Taher A. Alkhateeb 61b35b92d0 Improved: Refactor the startup API to completely remove the startup loaders collection
This commit refactors the startup bootstrapping logic to remove any references to the
StartupLoader API and any related files. This is due to the fact that any loaders
including the old POS is completely removed from the system. Thus this improvement
simplifies the startup logic and makes it easier to maintain.

Thank you: Mathieu Lirzin for the patch, careful review and patience


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1852847 13f79535-47bb-0310-9956-ffa450edef68
2019-02-03 19:47:27 +00:00
Jacques Le Roux 193bd6b75c Fixed: Impossible secure and autologin cookie names when mountpoint contains a
slash inside its name
(OFBIZ-10766)

Deepak Nigam reported on dev ML:
When there is one web app with the empty mount point (i.e. deployed on root), 
the auto-login cookie will not work for that particular webapp due to the change 
in the path of the cookie from "/" to "/" + applicationName. Because the system 
will try to find the cookie at the "/" but it is actually at "/" + applicationName.

Thanks Deepak for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851998 13f79535-47bb-0310-9956-ffa450edef68
2019-01-24 08:17:38 +00:00
Jacques Le Roux c4c5c8a142 Improved: ‘ObjectType’ contains unneeded code
(OFBIZ-10771)

The ObjectType class contains utilities that extends the Java reflection API by 
defining methods which accepts string representation of Java types and classes.
It appears that this class contains unneeded code which is either dead or is 
redundant with the services already defined in the reflection API

Removes the useless isOrSubOf, instanceOf and interfaceOf methods. 
Additionally it removes the getInstance method which is not used anywhere in 
the framework or in the plugins.

Also includes similar changes in 
AbstractConverter.java
Converters.java 
DateTimeConverters.java 
GenericEntity.java
IfInstanceOf.java

Thanks: Mathieu

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851701 13f79535-47bb-0310-9956-ffa450edef68
2019-01-20 09:39:30 +00:00
Jacques Le Roux 6393eca331 Improved: ObjectType::doRealCompare returns null instead of a boolean in few
places
(OFBIZ-10812)

While reviewing OFBIZ-10811 I found that I could improve ObjectType class on 2 
points:
    doRealCompare returning null instead of a boolean
    simpleTypeOrObjectConvert Javadoc (2 other instance not documented)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851363 13f79535-47bb-0310-9956-ffa450edef68
2019-01-15 14:22:31 +00:00
Jacques Le Roux dd58f19c94 Reverted: Impossible secure and autologin cookie names when mountpoint contains
a slash inside its name
(OFBIZ-10766)

In my previous commit I reverted the initial change. As I said in the Jira
I had a second look and it's better to fix the problem at the root as I did 
initially. 

I wrote in my previous commit: "This method is used in other places where the 
name should not be changed." I checked there are no issues changing slashes to
underscores in the cookies names anywhere.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851200 13f79535-47bb-0310-9956-ffa450edef68
2019-01-13 13:31:13 +00:00
Jacques Le Roux 9712ec2963 Improved: function parseBigDecimalForEntity is in wrong location
(OFBIZ-10689)

After I changed the method name from  ObjectType::simpleTypeConvert to
ObjectType::simpleTypeOrObjectConvert, Shikha Jaiswal noticed that I missed 
the groovy files.

Checking further I found that I also missed the simple-methods.xsd and 
ObjectTypeTests.java (though this last one was no really a problem)

Thanks: Shikha Jaiswal 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1851156 13f79535-47bb-0310-9956-ffa450edef68
2019-01-12 09:29:29 +00:00
Jacques Le Roux a37cf7ecd5 Fixed: Impossible secure and autologin cookie names when mountpoint contains a
slash inside its name
(OFBIZ-10766)

My previous commit was wrong this one fixes it.
I made a mistake trying to generalise changing UtilHttp::getApplicationName. 
This method is used in other places where the name should not be changed. 
Only cookies are concerned.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850685 13f79535-47bb-0310-9956-ffa450edef68
2019-01-07 20:37:10 +00:00
Jacques Le Roux a225496988 Improved: no functional change: fixes a typo in a comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850534 13f79535-47bb-0310-9956-ffa450edef68
2019-01-06 08:45:42 +00:00
Jacques Le Roux e7c83e76fb Fixed: Impossible secure and autologin cookie names when mountpoint contains a
slash inside its name
(OFBIZ-10766)

When you set a mountpoint which contains a slash inside its name 
(ie not only a slash as a trailer, which is possible), as it's needed with 
OFBIZ-10765, OFBiz tries to create a cookie with a slash in its name and 
that's impossible

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850530 13f79535-47bb-0310-9956-ffa450edef68
2019-01-06 08:40:38 +00:00
Aditya Sharma 5da4f7cd5e Improved: Refactor boolean returns from methods
(OFBIZ-10725)
Improved boolean returns with a single statement, replacing if blocks with the explicit boolean return.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850223 13f79535-47bb-0310-9956-ffa450edef68
2019-01-03 08:51:14 +00:00
Aditya Sharma 1c8ecdb9cf Improved: Refactor boolean returns for UtilValidate methods
(OFBIZ-10728)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850043 13f79535-47bb-0310-9956-ffa450edef68
2018-12-31 12:54:38 +00:00
Jacques Le Roux b7f211729f Improved: function parseBigDecimalForEntity is in wrong location
(OFBIZ-10689)

Actually this is a firts step that simply renames 
  ObjectType::simpleTypeConvert to
  ObjectType::simpleTypeOrObjectConvert
and improves the simpleTypeOrObjectConvert Javadoc

Thanks: Pierre Smits for report, Deepak Dixit for discussion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850027 13f79535-47bb-0310-9956-ffa450edef68
2018-12-31 09:23:36 +00:00
Jacques Le Roux 9364ebd3b4 Improved: Prepare the migration to XStream 1.5
(OFBIZ-10756)

Fixes CVE-2018-17200

We currently use the UnsupportedClassConverter method in UtilXml class. 
When the 1.5 version of XStream will be available another way to handle this 
kind of things will be available and used by default. It's already possible to 
use the same with the 1.4 version of XStream with its setupDefaultSecurity method.

So this replaces the UnsupportedClassConverter in UtilXml class by 
XStream::setupDefaultSecurity method.

It's an improvement but better to backport it as much as possible

The UtilXmlTests class and its use is removed and the UnsupportedClassConverter 
method deprecated (no use OOTB)



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1850015 13f79535-47bb-0310-9956-ffa450edef68
2018-12-31 06:38:36 +00:00
Aditya Sharma 0abeb293a8 Improved: Refactor boolean returns for UtilHttp methods
(OFBIZ-10726)
Improves code in isJavaScriptEnabled()
Instead of using if-else block, a ternary operator is used for improving readability.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849738 13f79535-47bb-0310-9956-ffa450edef68
2018-12-26 04:56:33 +00:00
Aditya Sharma 4b677ab1de Improved: Refactor boolean returns for UtilHttp methods
(OFBIZ-10726)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return. Improves code in checkURLforSpiders().

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849675 13f79535-47bb-0310-9956-ffa450edef68
2018-12-24 09:02:54 +00:00
Aditya Sharma 4487e3ccb0 Improved: Refactor boolean returns for UtilValidate methods
(OFBIZ-10728)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return.
Improves code in isGiftCard().
Thanks Suraj Khurana for the review.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849673 13f79535-47bb-0310-9956-ffa450edef68
2018-12-24 07:51:53 +00:00