< prev index next >

jdk/src/java.base/share/native/libjava/System.c

Print this page


   1 /*
   2  * Copyright (c) 1994, 2016, 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


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


   1 /*
   2  * Copyright (c) 1994, 2017, 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


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


< prev index next >