mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
initialize the class if necessary when the "new" operator is invoked
This is one of the conditions specified in http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.1, which I had forgotten about.
This commit is contained in:
parent
7e2d265fb9
commit
fcfdd6be3a
@ -3252,22 +3252,35 @@ instanceOfFromReference(Thread* t, object pair, object o)
|
||||
uint64_t
|
||||
makeNewGeneral64(Thread* t, object class_)
|
||||
{
|
||||
PROTECT(t, class_);
|
||||
|
||||
initClass(t, class_);
|
||||
|
||||
return reinterpret_cast<uintptr_t>(makeNewGeneral(t, class_));
|
||||
}
|
||||
|
||||
uint64_t
|
||||
makeNew64(Thread* t, object class_)
|
||||
{
|
||||
PROTECT(t, class_);
|
||||
|
||||
initClass(t, class_);
|
||||
|
||||
return reinterpret_cast<uintptr_t>(makeNew(t, class_));
|
||||
}
|
||||
|
||||
uint64_t
|
||||
makeNewFromReference(Thread* t, object pair)
|
||||
{
|
||||
return makeNewGeneral64
|
||||
(t, resolveClass
|
||||
(t, classLoader(t, methodClass(t, pairFirst(t, pair))),
|
||||
referenceName(t, pairSecond(t, pair))));
|
||||
object class_ = resolveClass
|
||||
(t, classLoader(t, methodClass(t, pairFirst(t, pair))),
|
||||
referenceName(t, pairSecond(t, pair)));
|
||||
|
||||
PROTECT(t, class_);
|
||||
|
||||
initClass(t, class_);
|
||||
|
||||
return makeNewGeneral64(t, class_);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
Loading…
Reference in New Issue
Block a user