* Removed all Id tags.
[cacao.git] / src / native / vm / java_lang_Class.c
1 /* src/native/vm/java_lang_Class.c - java/lang/Class
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25 */
26
27
28 #include "config.h"
29
30 #include <assert.h>
31 #include <stdint.h>
32 #include <string.h>
33
34 #include "vm/types.h"
35
36 #include "mm/memory.h"
37
38 #include "native/jni.h"
39 #include "native/llni.h"
40 #include "native/native.h"
41
42 /* keep this order of the native includes */
43
44 #include "native/include/java_lang_String.h"
45
46 #if defined(ENABLE_JAVASE)
47 # if defined(WITH_CLASSPATH_SUN)
48 #  include "native/include/java_nio_ByteBuffer.h"       /* required by j.l.CL */
49 # endif
50 # include "native/include/java_lang_ClassLoader.h"
51 #endif
52
53 #include "native/include/java_lang_Object.h"
54 #include "native/include/java_lang_Class.h"
55
56 #if defined(ENABLE_JAVASE)
57 # include "native/include/java_lang_reflect_Constructor.h"
58 # include "native/include/java_lang_reflect_Field.h"
59 # include "native/include/java_lang_reflect_Method.h"
60 #endif
61
62 #include "native/vm/java_lang_Class.h"
63
64 #if defined(ENABLE_JAVASE)
65 # include "native/vm/reflect.h"
66 #endif
67
68 #include "toolbox/logging.h"
69
70 #include "vm/builtin.h"
71 #include "vm/exceptions.h"
72 #include "vm/global.h"
73 #include "vm/initialize.h"
74 #include "vm/primitive.h"
75 #include "vm/resolve.h"
76 #include "vm/stringlocal.h"
77
78 #include "vmcore/class.h"
79 #include "vmcore/loader.h"
80
81 #if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
82 #include "vm/vm.h"
83 #include "vmcore/annotation.h"
84 #include "native/include/sun_reflect_ConstantPool.h"
85 #endif
86
87 /*
88  * Class:     java/lang/Class
89  * Method:    getName
90  * Signature: ()Ljava/lang/String;
91  */
92 java_lang_String *_Jv_java_lang_Class_getName(java_lang_Class *klass)
93 {
94         classinfo        *c;
95         java_lang_String *s;
96         java_chararray_t *ca;
97         u4                i;
98
99         c = LLNI_classinfo_unwrap(klass);
100
101         /* create a java string */
102
103         s = (java_lang_String *) javastring_new(c->name);
104
105         if (s == NULL)
106                 return NULL;
107
108         /* return string where '/' is replaced by '.' */
109
110         LLNI_field_get_ref(s, value, ca);
111
112         for (i = 0; i < LLNI_array_size(ca); i++) {
113                 if (LLNI_array_direct(ca, i) == '/')
114                         LLNI_array_direct(ca, i) = '.';
115         }
116
117         return s;
118 }
119
120
121 /*
122  * Class:     java/lang/Class
123  * Method:    forName
124  * Signature: (Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
125  */
126 #if defined(ENABLE_JAVASE)
127 java_lang_Class *_Jv_java_lang_Class_forName(java_lang_String *name, s4 initialize, java_lang_ClassLoader *loader)
128 #elif defined(ENABLE_JAVAME_CLDC1_1)
129 java_lang_Class *_Jv_java_lang_Class_forName(java_lang_String *name)
130 #endif
131 {
132 #if defined(ENABLE_JAVASE)
133         classloader *cl;
134 #endif
135         utf         *ufile;
136         utf         *uname;
137         classinfo   *c;
138         u2          *pos;
139         s4           i;
140
141 #if defined(ENABLE_JAVASE)
142         cl = (classloader *) loader;
143 #endif
144
145         /* illegal argument */
146
147         if (name == NULL) {
148                 exceptions_throw_nullpointerexception();
149                 return NULL;
150         }
151
152         /* create utf string in which '.' is replaced by '/' */
153
154         ufile = javastring_toutf((java_handle_t *) name, true);
155         uname = javastring_toutf((java_handle_t *) name, false);
156
157         /* name must not contain '/' (mauve test) */
158
159         for (i = 0, pos = LLNI_field_direct(name, value)->data + LLNI_field_direct(name, offset); i < LLNI_field_direct(name, count); i++, pos++) {
160                 if (*pos == '/') {
161                         exceptions_throw_classnotfoundexception(uname);
162                         return NULL;
163                 }
164         }
165
166         /* try to load, ... */
167
168 #if defined(ENABLE_JAVASE)
169         c = load_class_from_classloader(ufile, cl);
170 #elif defined(ENABLE_JAVAME_CLDC1_1)
171         c = load_class_bootstrap(ufile);
172 #endif
173
174         if (c == NULL)
175             return NULL;
176
177         /* link, ... */
178
179         if (!link_class(c))
180                 return NULL;
181         
182         /* ...and initialize it, if required */
183
184 #if defined(ENABLE_JAVASE)
185         if (initialize)
186 #endif
187                 if (!initialize_class(c))
188                         return NULL;
189
190         return LLNI_classinfo_wrap(c);
191 }
192
193
194 /*
195  * Class:     java/lang/Class
196  * Method:    isInstance
197  * Signature: (Ljava/lang/Object;)Z
198  */
199 s4 _Jv_java_lang_Class_isInstance(java_lang_Class *klass, java_lang_Object *o)
200 {
201         classinfo     *c;
202         java_handle_t *ob;
203
204         c = LLNI_classinfo_unwrap(klass);
205         ob = (java_handle_t *) o;
206
207         if (!(c->state & CLASS_LINKED))
208                 if (!link_class(c))
209                         return 0;
210
211         return builtin_instanceof(ob, c);
212 }
213
214
215 /*
216  * Class:     java/lang/Class
217  * Method:    isAssignableFrom
218  * Signature: (Ljava/lang/Class;)Z
219  */
220 s4 _Jv_java_lang_Class_isAssignableFrom(java_lang_Class *klass, java_lang_Class *c)
221 {
222         classinfo *kc;
223         classinfo *cc;
224
225         kc = LLNI_classinfo_unwrap(klass);
226         cc = LLNI_classinfo_unwrap(c);
227
228         if (cc == NULL) {
229                 exceptions_throw_nullpointerexception();
230                 return 0;
231         }
232
233         if (!(kc->state & CLASS_LINKED))
234                 if (!link_class(kc))
235                         return 0;
236
237         if (!(cc->state & CLASS_LINKED))
238                 if (!link_class(cc))
239                         return 0;
240
241         return class_isanysubclass(cc, kc);
242 }
243
244
245 /*
246  * Class:     java/lang/Class
247  * Method:    isInterface
248  * Signature: ()Z
249  */
250 JNIEXPORT int32_t JNICALL _Jv_java_lang_Class_isInterface(JNIEnv *env, java_lang_Class *this)
251 {
252         classinfo *c;
253
254         c = LLNI_classinfo_unwrap(this);
255
256         return class_is_interface(c);
257 }
258
259
260 #if defined(ENABLE_JAVASE)
261
262 /*
263  * Class:     java/lang/Class
264  * Method:    isPrimitive
265  * Signature: ()Z
266  */
267 s4 _Jv_java_lang_Class_isPrimitive(java_lang_Class *klass)
268 {
269         classinfo *c;
270
271         c = LLNI_classinfo_unwrap(klass);
272
273         return class_is_primitive(c);
274 }
275
276
277 /*
278  * Class:     java/lang/Class
279  * Method:    getSuperclass
280  * Signature: ()Ljava/lang/Class;
281  */
282 java_lang_Class *_Jv_java_lang_Class_getSuperclass(java_lang_Class *klass)
283 {
284         classinfo *c;
285         classinfo *super;
286
287         c = LLNI_classinfo_unwrap(klass);
288
289         super = class_get_superclass(c);
290
291         return LLNI_classinfo_wrap(super);
292 }
293
294
295 /*
296  * Class:     java/lang/Class
297  * Method:    getInterfaces
298  * Signature: ()[Ljava/lang/Class;
299  */
300 java_handle_objectarray_t *_Jv_java_lang_Class_getInterfaces(java_lang_Class *klass)
301 {
302         classinfo                 *c;
303         java_handle_objectarray_t *oa;
304
305         c = LLNI_classinfo_unwrap(klass);
306
307         oa = class_get_interfaces(c);
308
309         return oa;
310 }
311
312
313 /*
314  * Class:     java/lang/Class
315  * Method:    getModifiers
316  * Signature: (Z)I
317  */
318 s4 _Jv_java_lang_Class_getModifiers(java_lang_Class *klass, s4 ignoreInnerClassesAttrib)
319 {
320         classinfo             *c;
321         classref_or_classinfo  inner;
322         classref_or_classinfo  outer;
323         utf                   *innername;
324         s4                     i;
325
326         c = LLNI_classinfo_unwrap(klass);
327
328         if (!ignoreInnerClassesAttrib && (c->innerclasscount != 0)) {
329                 /* search for passed class as inner class */
330
331                 for (i = 0; i < c->innerclasscount; i++) {
332                         inner = c->innerclass[i].inner_class;
333                         outer = c->innerclass[i].outer_class;
334
335                         /* Check if inner is a classref or a real class and get
336                the name of the structure */
337
338                         innername = IS_CLASSREF(inner) ? inner.ref->name : inner.cls->name;
339
340                         /* innerclass is this class */
341
342                         if (innername == c->name) {
343                                 /* has the class actually an outer class? */
344
345                                 if (outer.any)
346                                         /* return flags got from the outer class file */
347                                         return c->innerclass[i].flags & ACC_CLASS_REFLECT_MASK;
348                                 else
349                                         return c->flags & ACC_CLASS_REFLECT_MASK;
350                         }
351                 }
352         }
353
354         /* passed class is no inner class or it was not requested */
355
356         return c->flags & ACC_CLASS_REFLECT_MASK;
357 }
358
359
360 /*
361  * Class:     java/lang/Class
362  * Method:    getDeclaringClass
363  * Signature: ()Ljava/lang/Class;
364  */
365 java_lang_Class *_Jv_java_lang_Class_getDeclaringClass(java_lang_Class *klass)
366 {
367         classinfo *c;
368         classinfo *dc;
369
370         c = LLNI_classinfo_unwrap(klass);
371
372         dc = class_get_declaringclass(c);
373
374         return LLNI_classinfo_wrap(dc);
375 }
376
377
378 /*
379  * Class:     java/lang/Class
380  * Method:    getDeclaredClasses
381  * Signature: (Z)[Ljava/lang/Class;
382  */
383 java_handle_objectarray_t *_Jv_java_lang_Class_getDeclaredClasses(java_lang_Class *klass, s4 publicOnly)
384 {
385         classinfo                 *c;
386         java_handle_objectarray_t *oa;
387
388         c = LLNI_classinfo_unwrap(klass);
389
390         oa = class_get_declaredclasses(c, publicOnly);
391
392         return oa;
393 }
394
395
396 /*
397  * Class:     java/lang/Class
398  * Method:    getDeclaredFields
399  * Signature: (Z)[Ljava/lang/reflect/Field;
400  */
401 java_handle_objectarray_t *_Jv_java_lang_Class_getDeclaredFields(java_lang_Class *klass, s4 publicOnly)
402 {
403         classinfo                 *c;
404         java_handle_objectarray_t *oa;          /* result: array of field-objects */
405         fieldinfo                 *f;
406         java_lang_reflect_Field   *rf;
407         s4 public_fields;                    /* number of elements in field-array */
408         s4 pos;
409         s4 i;
410
411         c = LLNI_classinfo_unwrap(klass);
412
413         /* determine number of fields */
414
415         for (i = 0, public_fields = 0; i < c->fieldscount; i++)
416                 if ((c->fields[i].flags & ACC_PUBLIC) || (publicOnly == 0))
417                         public_fields++;
418
419         /* create array of fields */
420
421         oa = builtin_anewarray(public_fields, class_java_lang_reflect_Field);
422
423         if (oa == NULL)
424                 return NULL;
425
426         /* get the fields and store in the array */
427
428         for (i = 0, pos = 0; i < c->fieldscount; i++) {
429                 f = &(c->fields[i]);
430
431                 if ((f->flags & ACC_PUBLIC) || (publicOnly == 0)) {
432                         /* create Field object */
433
434                         rf = reflect_field_new(f);
435
436                         /* store object into array */
437
438                         LLNI_objectarray_element_set(oa, pos, rf);
439                         pos++;
440                 }
441         }
442
443         return oa;
444 }
445
446
447 /*
448  * Class:     java/lang/Class
449  * Method:    getDeclaredMethods
450  * Signature: (Z)[Ljava/lang/reflect/Method;
451  */
452 java_handle_objectarray_t *_Jv_java_lang_Class_getDeclaredMethods(java_lang_Class *klass, s4 publicOnly)
453 {
454         classinfo                 *c;
455         java_lang_reflect_Method  *rm;
456         java_handle_objectarray_t *oa;         /* result: array of Method-objects */
457         methodinfo                *m;     /* the current method to be represented */
458         s4 public_methods;               /* number of public methods of the class */
459         s4 pos;
460         s4 i;
461
462         c = LLNI_classinfo_unwrap(klass);
463
464         public_methods = 0;
465
466         /* JOWENN: array classes do not declare methods according to mauve
467            test.  It should be considered, if we should return to my old
468            clone method overriding instead of declaring it as a member
469            function. */
470
471         if (class_is_array(c))
472                 return builtin_anewarray(0, class_java_lang_reflect_Method);
473
474         /* determine number of methods */
475
476         for (i = 0; i < c->methodscount; i++) {
477                 m = &c->methods[i];
478
479                 if (((m->flags & ACC_PUBLIC) || (publicOnly == false)) &&
480                         ((m->name != utf_init) && (m->name != utf_clinit)) &&
481                         !(m->flags & ACC_MIRANDA))
482                         public_methods++;
483         }
484
485         oa = builtin_anewarray(public_methods, class_java_lang_reflect_Method);
486
487         if (oa == NULL)
488                 return NULL;
489
490         for (i = 0, pos = 0; i < c->methodscount; i++) {
491                 m = &c->methods[i];
492
493                 if (((m->flags & ACC_PUBLIC) || (publicOnly == false)) && 
494                         ((m->name != utf_init) && (m->name != utf_clinit)) &&
495                         !(m->flags & ACC_MIRANDA)) {
496                         /* create Method object */
497
498                         rm = reflect_method_new(m);
499
500                         /* store object into array */
501
502                         LLNI_objectarray_element_set(oa, pos, rm);
503                         pos++;
504                 }
505         }
506
507         return oa;
508 }
509
510
511 /*
512  * Class:     java/lang/Class
513  * Method:    getDeclaredConstructors
514  * Signature: (Z)[Ljava/lang/reflect/Constructor;
515  */
516 java_handle_objectarray_t *_Jv_java_lang_Class_getDeclaredConstructors(java_lang_Class *klass, s4 publicOnly)
517 {
518         classinfo                     *c;
519         methodinfo                    *m; /* the current method to be represented */
520         java_handle_objectarray_t     *oa;     /* result: array of Method-objects */
521         java_lang_reflect_Constructor *rc;
522         s4 public_methods;               /* number of public methods of the class */
523         s4 pos;
524         s4 i;
525
526         c = LLNI_classinfo_unwrap(klass);
527
528         /* determine number of constructors */
529
530         for (i = 0, public_methods = 0; i < c->methodscount; i++) {
531                 m = &c->methods[i];
532
533                 if (((m->flags & ACC_PUBLIC) || (publicOnly == 0)) &&
534                         (m->name == utf_init))
535                         public_methods++;
536         }
537
538         oa = builtin_anewarray(public_methods, class_java_lang_reflect_Constructor);
539
540         if (oa == NULL)
541                 return NULL;
542
543         for (i = 0, pos = 0; i < c->methodscount; i++) {
544                 m = &c->methods[i];
545
546                 if (((m->flags & ACC_PUBLIC) || (publicOnly == 0)) &&
547                         (m->name == utf_init)) {
548                         /* create Constructor object */
549
550                         rc = reflect_constructor_new(m);
551
552                         /* store object into array */
553
554                         LLNI_objectarray_element_set(oa, pos, rc);
555                         pos++;
556                 }
557         }
558
559         return oa;
560 }
561
562
563 /*
564  * Class:     java/lang/Class
565  * Method:    getClassLoader
566  * Signature: ()Ljava/lang/ClassLoader;
567  */
568 java_lang_ClassLoader *_Jv_java_lang_Class_getClassLoader(java_lang_Class *klass)
569 {
570         classinfo *c;
571
572         c = LLNI_classinfo_unwrap(klass);
573
574         return (java_lang_ClassLoader *) c->classloader;
575 }
576
577 #endif /* defined(ENABLE_JAVASE) */
578
579
580 /*
581  * Class:     java/lang/Class
582  * Method:    isArray
583  * Signature: ()Z
584  */
585 JNIEXPORT int32_t JNICALL _Jv_java_lang_Class_isArray(JNIEnv *env, java_lang_Class *this)
586 {
587         classinfo *c;
588
589         c = LLNI_classinfo_unwrap(this);
590
591         return class_is_array(c);
592 }
593
594
595 #if defined(ENABLE_JAVASE)
596
597 /*
598  * Class:     java/lang/Class
599  * Method:    throwException
600  * Signature: (Ljava/lang/Throwable;)V
601  */
602 void _Jv_java_lang_Class_throwException(java_lang_Throwable *t)
603 {
604         java_handle_t *o;
605
606         o = (java_handle_t *) t;
607
608         exceptions_set_exception(o);
609 }
610
611
612 #if defined(WITH_CLASSPATH_GNU) && defined(ENABLE_ANNOTATIONS)
613 /*
614  * Class:     java/lang/Class
615  * Method:    getDeclaredAnnotations
616  * Signature: (Ljava/lang/Class;)[Ljava/lang/annotation/Annotation;
617  */
618 java_handle_objectarray_t *_Jv_java_lang_Class_getDeclaredAnnotations(java_lang_Class* klass)
619 {
620         classinfo                *c               = NULL;
621         static methodinfo        *m_parseAnnotationsIntoArray   = NULL;
622         utf                      *utf_parseAnnotationsIntoArray = NULL;
623         utf                      *utf_desc        = NULL;
624         java_handle_bytearray_t  *annotations     = NULL;
625         sun_reflect_ConstantPool *constantPool    = NULL;
626         java_lang_Object         *constantPoolOop = (java_lang_Object*)klass;
627
628         if (klass == NULL) {
629                 exceptions_throw_nullpointerexception();
630                 return NULL;
631         }
632         
633         c = LLNI_classinfo_unwrap(klass);
634
635         /* get annotations: */
636         annotations = class_get_annotations(c);
637
638         if (exceptions_get_exception() != NULL) {
639                 /* the only exception possible here should be a out of memory exception
640                  * raised by copying the annotations into a java bytearray */
641                 return NULL;
642         }
643
644         constantPool = 
645                 (sun_reflect_ConstantPool*)native_new_and_init(
646                         class_sun_reflect_ConstantPool);
647         
648         if(constantPool == NULL) {
649                 /* out of memory */
650                 return NULL;
651         }
652
653         LLNI_field_set_ref(constantPool, constantPoolOop, constantPoolOop);
654
655         /* only resolve the method the first time */
656         if (m_parseAnnotationsIntoArray == NULL) {
657                 utf_parseAnnotationsIntoArray = utf_new_char("parseAnnotationsIntoArray");
658                 utf_desc = utf_new_char(
659                         "([BLsun/reflect/ConstantPool;Ljava/lang/Class;)"
660                         "[Ljava/lang/annotation/Annotation;");
661
662                 if (utf_parseAnnotationsIntoArray == NULL || utf_desc == NULL) {
663                         /* out of memory */
664                         return NULL;
665                 }
666
667                 m_parseAnnotationsIntoArray = class_resolveclassmethod(
668                         class_sun_reflect_annotation_AnnotationParser,
669                         utf_parseAnnotationsIntoArray,
670                         utf_desc,
671                         class_java_lang_Class,
672                         true);
673
674                 if (m_parseAnnotationsIntoArray == NULL) {
675                         /* method not found */
676                         return NULL;
677                 }
678         }
679
680         return (java_handle_objectarray_t*)vm_call_method(
681                 m_parseAnnotationsIntoArray, NULL,
682                 annotations, constantPool, klass);
683 }
684 #endif
685
686
687 /* _Jv_java_lang_Class_getEnclosingMethod_intern *******************************
688
689    Helper function for _Jv_java_lang_Class_getEnclosingConstructor and
690    _Jv_java_lang_Class_getEnclosingMethod.
691
692 *******************************************************************************/
693
694 static methodinfo *_Jv_java_lang_Class_getEnclosingMethod_intern(classinfo *c)
695 {
696         constant_nameandtype *cn;
697         classinfo            *ec;
698         methodinfo           *m;
699
700         /* get enclosing class and method */
701
702         ec = class_get_enclosingclass(c);
703         cn = c->enclosingmethod;
704
705         /* check for enclosing class and method */
706
707         if (ec == NULL)
708                 return NULL;
709
710         if (cn == NULL)
711                 return NULL;
712
713         /* find method in enclosing class */
714
715         m = class_findmethod(ec, cn->name, cn->descriptor);
716
717         if (m == NULL) {
718                 exceptions_throw_internalerror("Enclosing method doesn't exist");
719                 return NULL;
720         }
721
722         return m;
723 }
724
725
726 /*
727  * Class:     java/lang/Class
728  * Method:    getEnclosingConstructor
729  * Signature: (Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
730  */
731 java_lang_reflect_Constructor *_Jv_java_lang_Class_getEnclosingConstructor(java_lang_Class *klass)
732 {
733         classinfo                     *c;
734         methodinfo                    *m;
735         java_lang_reflect_Constructor *rc;
736
737         c = LLNI_classinfo_unwrap(klass);
738
739         /* get enclosing method */
740
741         m = _Jv_java_lang_Class_getEnclosingMethod_intern(c);
742
743         if (m == NULL)
744                 return NULL;
745
746         /* check for <init> */
747
748         if (m->name != utf_init)
749                 return NULL;
750
751         /* create Constructor object */
752
753         rc = reflect_constructor_new(m);
754
755         return rc;
756 }
757
758
759 /*
760  * Class:     java/lang/Class
761  * Method:    getEnclosingMethod
762  * Signature: (Ljava/lang/Class;)Ljava/lang/reflect/Method;
763  */
764 java_lang_reflect_Method *_Jv_java_lang_Class_getEnclosingMethod(java_lang_Class *klass)
765 {
766         classinfo                *c;
767         methodinfo               *m;
768         java_lang_reflect_Method *rm;
769
770         c = LLNI_classinfo_unwrap(klass);
771
772         /* get enclosing method */
773
774         m = _Jv_java_lang_Class_getEnclosingMethod_intern(c);
775
776         if (m == NULL)
777                 return NULL;
778
779         /* check for <init> */
780
781         if (m->name == utf_init)
782                 return NULL;
783
784         /* create java.lang.reflect.Method object */
785
786         rm = reflect_method_new(m);
787
788         return rm;
789 }
790
791
792 /*
793  * Class:     java/lang/Class
794  * Method:    getClassSignature
795  * Signature: (Ljava/lang/Class;)Ljava/lang/String;
796  */
797 java_lang_String *_Jv_java_lang_Class_getClassSignature(java_lang_Class* klass)
798 {
799         classinfo     *c;
800         java_handle_t *o;
801
802         c = LLNI_classinfo_unwrap(klass);
803
804         if (c->signature == NULL)
805                 return NULL;
806
807         o = javastring_new(c->signature);
808
809         /* in error case o is NULL */
810
811         return (java_lang_String *) o;
812 }
813
814 #endif /* ENABLE_JAVASE */
815
816
817 /*
818  * These are local overrides for various environment variables in Emacs.
819  * Please do not remove this and leave it at the end of the file, where
820  * Emacs will automagically detect them.
821  * ---------------------------------------------------------------------
822  * Local variables:
823  * mode: c
824  * indent-tabs-mode: t
825  * c-basic-offset: 4
826  * tab-width: 4
827  * End:
828  * vim:noexpandtab:sw=4:ts=4:
829  */