Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8320684

Missing privacy modifier on class fields

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      We found that there is a missing privacy modifier on the fields of the internal classes in the java.util.Collections class. As of now, it is not possible for the user to access these fields, thus not making it an issue while developing. However, if there were to be made changes to the class in the future, the lack of a privacy modifier could result in the state of the fields potentially leaking outside of the inner classes.

      For example the list field in the private inner java.util.Collections.SynchronizedList class is public, and if a new instance of this class is created inside of the java.util.Collections, the library developer would not be prevented from using this field in an unintentional way.


            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: