Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- include/vm/method.h | 5 +++++ vm/reflection.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/vm/method.h b/include/vm/method.h index f17f474..ebb1abe 100644 --- a/include/vm/method.h +++ b/include/vm/method.h @@ -52,6 +52,11 @@ struct vm_method { int vm_method_init(struct vm_method *vmm, struct vm_class *vmc, unsigned int method_index); +static inline bool vm_method_is_public(struct vm_method *vmm) +{ + return vmm->method->access_flags & CAFEBABE_METHOD_ACC_PUBLIC; +} + static inline bool vm_method_is_static(struct vm_method *vmm) { return vmm->method->access_flags & CAFEBABE_METHOD_ACC_STATIC; diff --git a/vm/reflection.c b/vm/reflection.c index f8df788..65998ac 100644 --- a/vm/reflection.c +++ b/vm/reflection.c @@ -92,7 +92,8 @@ native_vmclass_get_declared_constructors(struct vm_object *class_object, for (int i = 0; i < vmc->class->methods_count; i++) { struct vm_method *vmm = &vmc->methods[i]; - if (vm_method_is_constructor(vmm)) + if (vm_method_is_constructor(vmm) && + (vm_method_is_public(vmm) || !public_only)) count++; } @@ -110,7 +111,8 @@ native_vmclass_get_declared_constructors(struct vm_object *class_object, for (int i = 0; i < vmc->class->methods_count; i++) { struct vm_method *vmm = &vmc->methods[i]; - if (!vm_method_is_constructor(vmm)) + if (!vm_method_is_constructor(vmm) || + (!vm_method_is_public(vmm) && public_only)) continue; struct vm_object *ctor -- 1.6.0.6 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel