Details

    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      I have a java class which inherits the static method objectId() from http://commons.apache.org/logging/apidocs/org/apache/commons/logging/impl/LogFactory.html

      When I migrated my codebase from jruby 1.4 to 1.5, my app started breaking because a const_missing call ended up dying in activesupport/.../introspection.rb where it was polling .object_id of a variety of constants. It seems that the wrapper for SomeJavaClass maps .object_id to SomeJavaClass.objectId(arg1), and was dying in a 0 for 1 argument error.

      JavaUtil.getRubyCasedName(...) seems to be involved, however, i believe i tracked down the core issue here:
      http://github.com/jruby/jruby/commit/7c4139b5eb12ac5794b79a20fe37e8f2877d6da4
      in

      • RESERVED_NAMES.put("object_id", new AssignedName("object_id", Priority.RESERVED));

      It's not clear to me why "object_id" would be removed from RESERVED_NAMES but "_id_" was not. Was this change made in error? Should object_id have been added to STATIC_RESERVED_NAMES and/or INSTANCE_RESERVED_NAMES? (my case deals with STATIC, but I can see this affecting INSTANCEs as well)

      I fixed the regression locally by reverting the one line of the change
      + RESERVED_NAMES.put("object_id", new AssignedName("object_id", Priority.RESERVED));

        Activity

        Hide
        Hiro Asari added a comment -

        Charlie,

        Do you remember the rationale for this change? Restoring "object_id" method as reserved does not seem to fail any existing test.

        Show
        Hiro Asari added a comment - Charlie, Do you remember the rationale for this change? Restoring "object_id" method as reserved does not seem to fail any existing test.
        Hide
        Hiro Asari added a comment -

        Not sure when "object_id" was removed, but it is no longer there on the master or the 1.6 branch.

        Show
        Hiro Asari added a comment - Not sure when "object_id" was removed, but it is no longer there on the master or the 1.6 branch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Hetzler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: