Thank you for the feedback I've created a Jira ticket OFBIZ-10343 <https://issues.apache.org/jira/browse/OFBIZ-10343> and I will add patches for the same for your review.
Thanks & Regards, -- *Pradhan Yash Sharma* On Fri, Apr 13, 2018 at 5:50 PM, Taher Alkhateeb <slidingfilame...@gmail.com > wrote: > Hello Pradhan, > > Refactoring is exactly what we need and is a welcomed activity. I > think we should, however, try to avoid "big ideas" across the entire > code base. The subject of your message is the reason why I say that. > > So, if you want to start refactoring, I suggest to start with one > piece of code, study it careful, issue a JIRA, and provide a patch. > This should be focused similar to your notes on UtilCache. > > On Fri, Apr 13, 2018 at 12:14 PM, Pradhan Yash Sharma > <pradhanyashsharm...@gmail.com> wrote: > > Hello, > > > > While I was working on UtilCache.java file came across some improvements, > > they are as follows: > > > > 1) Method and Variable access modifiers can be narrowed down to private > > access modifier. > > > > 2) Then AtomicLong can be given value 0L instead of 0. > > > > 3) Some Variables is used in both synchronized and unsynchronized blocks, > > so they can be declared final. eg, > > > > > > > > *protected AtomicLong hitCount = new AtomicLong(0); > private > > final AtomicLong hitCount = new AtomicLong(0L);* > > One variable was able to get most of my attention is > > > > * protected ConcurrentMap<Object, CacheLine<V>> > memoryTable > > = null;* > > > > This is used in synchronized and unsynchronized blocks, this Object can > be > > converted into ThreadLocal or AtomicReference but it would require > changes > > in the current implementation as well. > > > > Lastly, there is extensive use of for loops for iteration we can use > Java 8 > > Streams, Collector, and other functions to leverage implicit looping > > mechanism. > > > > > > -- > > Pradhan Yash Sharma >