File: jawt-CustomJavaCode.java

package info (click to toggle)
libjogl2-java 2.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,484 kB
  • sloc: java: 257,713; ansic: 86,782; xml: 7,914; objc: 4,880; sh: 3,033; cpp: 139; makefile: 50; awk: 46; perl: 27
file content (23 lines) | stat: -rw-r--r-- 833 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
private int jawt_version_cached = 0;

public final int getCachedVersion() {
    return jawt_version_cached;
}

protected static boolean getJAWT(final JAWT jawt, final int jawt_version_flags) {
    JAWTUtil.initSingleton();
    // Workaround for 4845371.
    // Make sure the first reference to the JNI GetDirectBufferAddress is done
    // from a privileged context so the VM's internal class lookups will succeed.
    return SecurityUtil.doPrivileged(new PrivilegedAction<Boolean>() {
        public Boolean run() {
          jawt.setVersion(jawt_version_flags);
          if (JAWTFactory.JAWT_GetAWT(jawt)) {
            jawt.jawt_version_cached = jawt.getVersion();
            return new Boolean(true);
          }
          jawt.jawt_version_cached = 0;
          return new Boolean(false);
        }
      }).booleanValue();
}