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

fp.bugs 3325 java.lang.String : monitor InternSet, get(this) and put(this)

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description


      From: ###@###.###
      This does not look like form output to me.


      1) This is mainly a bug report, but I'm as well proposing a feature related to sa
      me place
      2) jdk-1.0
      3) jdk-1.0
      4) see below
      5)-9) don't apply; I found bug in source code...

      Bug report:
      ===========
      The method "intern" in java.lang.String has two bugs

      a) creation of InternSet is not monitored; a race condition could cause
      two intern of the same string to use different hashtables

      b) The sequence get(this) and put(this) is not monitored...


      Feature request:
      ================
      Also in java.lang.String
      There is no way to check whether a string has been intern'ed without
      automatically interning the string and making the hashtable grow. I
      think a method similar to intern but returning null if the string wasn't
      already intern'ed could allow a user in some cases to get benefits of
      intern without paying the cost...


      Chris
      ###@###.###

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              apalanissunw Anand Palaniswamy (Inactive)
              Reporter:
              bhagen Benjamin Hagen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: