src/share/native/java/lang/System.c

Print this page


   1 /*
   2  * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  85         jstring jkey = JNU_NewStringPlatform(env, key); \
  86         jobject r = (*env)->CallObjectMethod(env, props, removeID, jkey); \
  87         if ((*env)->ExceptionOccurred(env)) return NULL; \
  88         (*env)->DeleteLocalRef(env, jkey); \
  89         (*env)->DeleteLocalRef(env, r); \
  90     } else ((void) 0)
  91 #define GETPROP(props, key, jret) \
  92     if (1) { \
  93         jstring jkey = JNU_NewStringPlatform(env, key); \
  94         jret = (*env)->CallObjectMethod(env, props, getPropID, jkey); \
  95         if ((*env)->ExceptionOccurred(env)) return NULL; \
  96         (*env)->DeleteLocalRef(env, jkey); \
  97     } else ((void) 0)
  98 
  99 #ifndef VENDOR /* Third party may overwrite this. */
 100 #define VENDOR "Oracle Corporation"
 101 #define VENDOR_URL "http://java.oracle.com/"
 102 #define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
 103 #endif
 104 
 105 #define JAVA_MAX_SUPPORTED_VERSION 51
 106 #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
 107 
 108 #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */
 109   #error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed"
 110 #else
 111   #define JAVA_SPECIFICATION_VENDOR "Oracle Corporation"
 112 #endif
 113 
 114 static int fmtdefault; // boolean value
 115 jobject fillI18nProps(JNIEnv *env, jobject props, char *baseKey,
 116                       char *platformDispVal, char *platformFmtVal,
 117                       jmethodID putID, jmethodID getPropID) {
 118     jstring jVMBaseVal = NULL;
 119 
 120     GETPROP(props, baseKey, jVMBaseVal);
 121     if (jVMBaseVal) {
 122         // user specified the base property.  there's nothing to do here.
 123         (*env)->DeleteLocalRef(env, jVMBaseVal);
 124     } else {
 125         char buf[64];


   1 /*
   2  * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  85         jstring jkey = JNU_NewStringPlatform(env, key); \
  86         jobject r = (*env)->CallObjectMethod(env, props, removeID, jkey); \
  87         if ((*env)->ExceptionOccurred(env)) return NULL; \
  88         (*env)->DeleteLocalRef(env, jkey); \
  89         (*env)->DeleteLocalRef(env, r); \
  90     } else ((void) 0)
  91 #define GETPROP(props, key, jret) \
  92     if (1) { \
  93         jstring jkey = JNU_NewStringPlatform(env, key); \
  94         jret = (*env)->CallObjectMethod(env, props, getPropID, jkey); \
  95         if ((*env)->ExceptionOccurred(env)) return NULL; \
  96         (*env)->DeleteLocalRef(env, jkey); \
  97     } else ((void) 0)
  98 
  99 #ifndef VENDOR /* Third party may overwrite this. */
 100 #define VENDOR "Oracle Corporation"
 101 #define VENDOR_URL "http://java.oracle.com/"
 102 #define VENDOR_URL_BUG "http://bugreport.sun.com/bugreport/"
 103 #endif
 104 
 105 #define JAVA_MAX_SUPPORTED_VERSION 52
 106 #define JAVA_MAX_SUPPORTED_MINOR_VERSION 0
 107 
 108 #ifdef JAVA_SPECIFICATION_VENDOR /* Third party may NOT overwrite this. */
 109   #error "ERROR: No override of JAVA_SPECIFICATION_VENDOR is allowed"
 110 #else
 111   #define JAVA_SPECIFICATION_VENDOR "Oracle Corporation"
 112 #endif
 113 
 114 static int fmtdefault; // boolean value
 115 jobject fillI18nProps(JNIEnv *env, jobject props, char *baseKey,
 116                       char *platformDispVal, char *platformFmtVal,
 117                       jmethodID putID, jmethodID getPropID) {
 118     jstring jVMBaseVal = NULL;
 119 
 120     GETPROP(props, baseKey, jVMBaseVal);
 121     if (jVMBaseVal) {
 122         // user specified the base property.  there's nothing to do here.
 123         (*env)->DeleteLocalRef(env, jVMBaseVal);
 124     } else {
 125         char buf[64];