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

Breakpoints in empty finalizer methods treated incorrectly

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Hi,
                                                                                 
      there is a problem when a breakpoint is set in an empty finalize()
      method. Consider the following situation:
                                                                                 
      Class A has an empty finalize() method, so it would not take part in the
       finalizing game (no Finalizer refs allocated for objects of that class)
      . Now a user sets a breakpoint in the finalize() method and after that
      we load Class B, which has Class A as its superklass. Class B does not
      overrides finalize(), so we would expect objects of Class B not to take
      part in the finalizer game too.
                                                                                 
      But in ClassFileParser::set_precomputed_flags(), where it is detected if
       a class has a non-empty finalize() method, methodOopDesc::
      is_empty_method() is called, which just checks the first bytecode of the
       method. But now we have the breakpoint bytecode at this place, so
      methodOopDesc::is_empty_method() thinks the method is not empty and
      objects of Class B are treated as having a non-empty finalize method.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: