This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NullPointerException on android when calling load


On Mon, Nov 17, 2014 at 2:13 PM, Per Bothner <per@bothner.com> wrote:
>> ... Basically, it's a REPL, but using
>> a static file instead of being interactive.
>
> Just be aware that we can't create bytecode on-the-fly in Android, so
> load (or eval) has to use the Kawa interpreter, which doesn't have the
> same or full functionality (compare to the compiler), and which gets less
> testing.

Are the limitations outlined somewhere, or is it more trial-and-error?

>> The first step is figuring out why either inherited or inherited[i] is null
> even though numInherited>0.

I dropped in a few System.err.println's and here's what I've learned:

a) numInherited = 0, and inherited[i] == null - just like you suggested

b) I added a println to the  InheritingEnvironment constructor and
found that it was getting invoked once:
   name = main, parent = null

c) I also confirmed that InheritingEnvironment.addParent is being
called once, and it's being passed null.  No great surprise here, as
the constructor for InheritingEnvironment calls addParent.

Where should I look next?

...
> As a matter of fact (require 'android-defs) define a parameter
> current-activity so that (current-activity) returns the current Activity (if
> any).
> At least in the body of on-create and on-create-view.

Ahh yes, I saw that. That's perfect.

-Ben

-- 
Have an idea for software?  I can make it happen -
http://www.ideas2executables.com
My Blog: http://www.BlogByBen.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]