Forum: JRuby Overriding methods of abstract Java classes in jRuby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Manfred U. (Guest)
on 2009-02-17 10:37
(Received via mailing list)
Hi,

extending / implementing abstract Java classes in JRuby does work fine
for me.

I see only a minor blemish: I can't use Ruby naming conventions to
implement the abstract methods.

E.g.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
class ProductTreeTableNode <
    org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
#[...]
  def get_value_at(column_index)
    case column_index
  #[...]
  end
#[...]
end
- - - - - - - - - - - - - - - - - - - - - - - - - - - -

This results in

  Java::JavaLang::AbstractMethodError - java.lang.AbstractMethodError

whereas the following implementation works fine:

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
class ProductTreeTableNode <
    org.jdesktop.swingx.treetable.AbstractMutableTreeTableNode
#[...]
  def getValueAt(column_index)
    case column_index
  #[...]
  end
#[...]
end
- - - - - - - - - - - - - - - - - - - - - - - - - - - -


Is this a flaw or just something which can't be changed for technical
reasons?

I'm using JRuby 1.1.6.

Thanks,
Manfred

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Charles Oliver N. (Guest)
on 2009-02-17 10:44
(Received via mailing list)
Manfred U. wrote:
> Is this a flaw or just something which can't be changed for technical
> reasons?

In 1.1.5 I fixed this for interface implementation, but we have not yet
gotten back to abstract class extension to fix it there. The two areas
do code generation differently.

It is planned, certainly...but just not there yet (and probably not
going to be in 1.2, since it's very invasive to add).

Could you file an enhancement in Jira, if one does not already exist?

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Manfred U. (Guest)
on 2009-02-19 10:07
(Received via mailing list)
On Tue, 17 Feb 2009 02:42:07 -0600
Charles Oliver N. <removed_email_address@domain.invalid> wrote:

> Manfred U. wrote:
> > Is this a flaw or just something which can't be changed for technical
> > reasons?
>
> In 1.1.5 I fixed this for interface implementation, but we have not yet
> gotten back to abstract class extension to fix it there. The two areas
> do code generation differently.
>
> It is planned, certainly...but just not there yet (and probably not
> going to be in 1.2, since it's very invasive to add).

OK, thanks for the info.


> Could you file an enhancement in Jira, if one does not already exist?

Done.


Thanks,
Manfred


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.