8010309 : PlatformLogger: isLoggable performance / waste due to HashMap<Integer, Level (original) (raw)

Laurent Bourgès bourges.laurent at gmail.com
Fri Mar 22 10:34:57 UTC 2013


Peter,

You've beaten me! I have been preparing them too ;-) ...

Ok I definitely stop working on the code and let you do it.

I also did some some renames, that I think make the code more consistent: - LevelEnum -> Level (the code is not dependent on java.util.logging.Level, so the name can be reused, its private anyway) - julLevel -> javaLevel (javaLevel / JavaLogger) - LevelEnum.forValue -> Level.valueOf (Mandy) - JavaLogger.julLevelToEnum -> JavaLogger.javaLevelToLevel

For consistency and clarity, I would prefer having following conventions:

Other changes (to webrev.05):

- removed the occurrence counts in switch comments (as per Mandy's suggestion) - made LoggerProxy and JavaLogger private - fixed double-read of volatile LoggerProxy.levelValue in LoggerProxy.isLoggable() - added static Level.javaLevel(int value) shortcut (Mandy)

I also updated the test to exercise the correctness of mappings.

Well done.

cheers, Laurent



More information about the core-libs-dev mailing list