Ambiguous base class

Java API classes generated by Java API generator often (indirectly) derive from the same base class multiple times. This can be java::lang::Object (all Java classes AND interfaces extend it), or some interface implemented by more than one base class.

In such cases, use base_class member to disambiguate access:

#include <scapix/java_api/java/lang/String.h>

using namespace scapix::java_api;

void test()
{
    auto s = java::lang::String::new_object();
    s->getClass(); // Error: ambiguity
    s->java::lang::Object::getClass(); // Error: ambiguity
    s->base_class<java::lang::Object>::getClass(); // OK
    ref<java::lang::Object> s1 = s; // OK
}
#include <scapix/java_api/java/lang/RuntimeException.h>

using namespace scapix::java_api;

void test()
{
    auto r = java::lang::RuntimeException::new_object();
    r->getClass(); // Error: ambiguity
    r->java::lang::Object::getClass(); // Error: ambiguity
    r->base_class<java::lang::Object>::getClass(); // OK
    ref<java::lang::Object> r1 = r; // OK
}
#include <scapix/java_api/java/util/HashSet.h>

using namespace scapix::java_api;

void test()
{
    auto h = java::util::HashSet::new_object();
    h->toArray(); // Error: ambiguity
    h->java::util::Collection::toArray(); // Error: ambiguity
    h->base_class<java::util::Collection>::toArray(); // OK
    ref<java::util::Collection> h1 = h; // OK
}