odftoolkit icon indicating copy to clipboard operation
odftoolkit copied to clipboard

refactor the OdfName class

Open xzel23 opened this issue 7 months ago • 0 comments

  • declare the class explicitly as final (it was effectively final before because it only has a private constructor)
  • use a ConcurrentHashMap to avoid the need for explicit synchronization
  • use computeIfAbsent() to avoid double key lookup
  • fix equals() - the old implementation was not symmetric: an OdfName with string content "x" would be equal to the simple string "x", but the reverse comparison ("x".equals(OdfName "x") would yield not equal

xzel23 avatar May 24 '25 07:05 xzel23