source: trunk/gcc/libjava/java/lang/natVMSecurityManager.cc

Last change on this file was 1389, checked in by bird, 21 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.3 KB
Line 
1/* Copyright (C) 2002 Free Software Foundation
2
3 This file is part of libgcj.
4
5This software is copyrighted work licensed under the terms of the
6Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
7details. */
8
9// Written by Tom Tromey <tromey@redhat.com>
10
11#include <config.h>
12
13#include <gcj/cni.h>
14#include <jvm.h>
15#include <java/lang/VMSecurityManager.h>
16#include <java/lang/SecurityManager.h>
17#include <java/lang/ClassLoader.h>
18#include <java/lang/Class.h>
19#include <gnu/gcj/runtime/StackTrace.h>
20
21JArray<jclass> *
22java::lang::VMSecurityManager::getClassContext ()
23{
24 JArray<jclass> *result = NULL;
25 gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace();
26 if (t)
27 {
28 int maxlen = t->length();
29
30 int len = 0;
31 while (len < maxlen)
32 {
33 jclass klass = t->classAt(len);
34 if (klass != NULL && klass != &java::lang::VMSecurityManager::class$
35 && klass != &java::lang::SecurityManager::class$)
36 ++len;
37 }
38
39 result =
40 (JArray<jclass> *) _Jv_NewObjectArray (len, &java::lang::Class::class$,
41 NULL);
42
43 len = 0;
44 while (len < maxlen)
45 {
46 jclass klass = t->classAt(len);
47 if (klass != NULL && klass != &java::lang::VMSecurityManager::class$
48 && klass != &java::lang::SecurityManager::class$)
49 elements(result)[len++] = klass;
50 }
51 }
52
53 return result;
54}
Note: See TracBrowser for help on using the repository browser.