This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: NullPointerException on android when calling load
- From: Per Bothner <per at bothner dot com>
- To: Ben Simon <benjisimon at gmail dot com>
- Cc: kawa <kawa at sourceware dot org>
- Date: Mon, 17 Nov 2014 21:31:22 -0800
- Subject: Re: NullPointerException on android when calling load
- Authentication-results: sourceware.org; auth=none
- References: <CAEE0d3Ci7bMv5g7-+xKcX-mRRmOvfDAJH2SyC8pG+2dz79s58A at mail dot gmail dot com> <546A48C4 dot 2090303 at bothner dot com> <CAEE0d3B5Rs7tV20cmm4EFGeMBSObFLULtZKB2dZkRZApGghDwg at mail dot gmail dot com>
On 11/17/2014 09:01 PM, Ben Simon wrote:
On Mon, Nov 17, 2014 at 2:13 PM, Per Bothner <per@bothner.com> wrote:
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?
No, I don't have a list. You won't be able to do define-class or
define-simple-class. Resolution of overloaded methods may be subtly different.
You can't do invoke-special. I'm sure there are others.
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
I assume you mean numInherited == 1 - otherwise the loop in lookupInherited
would be skipped.
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?
Looks like Environment.global is not being set.
Try adding a call to:
Scheme.registerEnvironment();
before the load.
--
--Per Bothner
per@bothner.com http://per.bothner.com/