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 <[email protected]> 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
