Missing inherited static variables #150

Closed
abscondment opened this Issue Sep 27, 2011 · 1 comment

Projects

None yet

2 participants

@abscondment

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

[...]

Media._ID

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.

@baroquebobcat
The Mirah Community member

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

@baroquebobcat baroquebobcat added a commit that closed this issue Aug 4, 2013
@baroquebobcat baroquebobcat 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
1f97de5
@baroquebobcat baroquebobcat added a commit that referenced this issue Aug 28, 2013
@baroquebobcat baroquebobcat 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
4ef8b3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment