Missing inherited static variables #150

abscondment opened this Issue Sep 27, 2011 · 1 comment


None yet
2 participants

abscondment commented Sep 27, 2011

This came up when using image-related classes in the Android API.

Usually I would access the 'id' column like this:

import android.provider.MediaStore.Images.Media



However, I can't do this. _ID isn't defined on the Media class:

Inferring types...
rake aborted!
org.apache.tools.ant.BuildException: org.jruby.exceptions.RaiseException: (NoMethodError) Cannot find static method _ID() on android.provider.MediaStore$Images$Media

It's on a superclass of Media called BaseColumns.

I can simply import BaseColumns and use it directly. But if a later Android version decides to change Media and override the _ID value, my code will break.

This comment has been minimized.

Show comment Hide comment

baroquebobcat Mar 5, 2013


this should be pretty similar to the subclass static method lookup stuff.


baroquebobcat commented Mar 5, 2013

this should be pretty similar to the subclass static method lookup stuff.

baroquebobcat added a commit that referenced this issue Aug 28, 2013

add inherited lookup to static fields
now GregorianCalendar.AM will find Calendar.AM

This is needed for improved android support. Android uses static field inheritance as a way of providing some API flexibility.

Fixes #150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment