jjfiv / dalvik-js

Project for CS 691ST - Dalvik VM implementation in Javascript
23 stars 11 forks source link

throw exception when we try to find a class that is not in the class lib #82

Closed etosch closed 12 years ago

etosch commented 12 years ago

Inner classes were not showing up in the ClassLibrary due to peculiarities of the dx tool. ClassLibrary should throw an exeception on findClass when this happens.

jjfiv commented 12 years ago

Does this need to be a secondary pass? After all classes are loaded, check to make sure that each classes parents and all their references are in the class library? I don't know how well this will work for the part of the standard library I mangled.

etosch commented 12 years ago

Well in the event that there's a dexing problem, I do think so. It took me a while to figure out what was wrong when the innerclasses weren't loading. I'll throw a line of code in there and see if it breaks anything...

jjfiv commented 12 years ago

I see what you're saying now. I think inner classes are an obvious test/assert win. I think if you try to extend that assertion to any class, rather than just inner classes, things will break fast.

I imagine you'll be filtering the type list to do this?

etosch commented 12 years ago

Yeah, I can just filter with a regex. Though I'm testing with all classes first, because I won't believe what you say, that it'll break, until I try it myself...

etosch commented 12 years ago

I just tested without the filter and everything seems to be fine. We'll see if that holds for the rest of the week.