src/share/vm/runtime/arguments.cpp

changeset 2298
35f885165c69
parent 2230
4e22405d98d6
child 2299
9752a6549f2e
equal deleted inserted replaced
2297:1070423b51f3 2298:35f885165c69
114 } 114 }
115 115
116 // Initialize system properties key and value. 116 // Initialize system properties key and value.
117 void Arguments::init_system_properties() { 117 void Arguments::init_system_properties() {
118 118
119 PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.version", "1.0", false));
120 PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.name", 119 PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.name",
121 "Java Virtual Machine Specification", false)); 120 "Java Virtual Machine Specification", false));
122 PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(), false)); 121 PropertyList_add(&_system_properties, new SystemProperty("java.vm.version", VM_Version::vm_release(), false));
123 PropertyList_add(&_system_properties, new SystemProperty("java.vm.name", VM_Version::vm_name(), false)); 122 PropertyList_add(&_system_properties, new SystemProperty("java.vm.name", VM_Version::vm_name(), false));
124 PropertyList_add(&_system_properties, new SystemProperty("java.vm.info", VM_Version::vm_info_string(), true)); 123 PropertyList_add(&_system_properties, new SystemProperty("java.vm.info", VM_Version::vm_info_string(), true));
149 } 148 }
150 149
151 150
152 // Update/Initialize System properties after JDK version number is known 151 // Update/Initialize System properties after JDK version number is known
153 void Arguments::init_version_specific_system_properties() { 152 void Arguments::init_version_specific_system_properties() {
154 PropertyList_add(&_system_properties, new SystemProperty("java.vm.specification.vendor", 153 enum { bufsz = 16 };
155 JDK_Version::is_gte_jdk17x_version() ? "Oracle Corporation" : "Sun Microsystems Inc.", false)); 154 char buffer[bufsz];
156 PropertyList_add(&_system_properties, new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(), false)); 155 const char* spec_vendor = "Sun Microsystems Inc.";
156 uint32_t spec_version = 0;
157
158 if (JDK_Version::is_gte_jdk17x_version()) {
159 spec_vendor = "Oracle Corporation";
160 spec_version = JDK_Version::current().major_version();
161 }
162 jio_snprintf(buffer, bufsz, "1." UINT32_FORMAT, spec_version);
163
164 PropertyList_add(&_system_properties,
165 new SystemProperty("java.vm.specification.vendor", spec_vendor, false));
166 PropertyList_add(&_system_properties,
167 new SystemProperty("java.vm.specification.version", buffer, false));
168 PropertyList_add(&_system_properties,
169 new SystemProperty("java.vm.vendor", VM_Version::vm_vendor(), false));
157 } 170 }
158 171
159 /** 172 /**
160 * Provide a slightly more user-friendly way of eliminating -XX flags. 173 * Provide a slightly more user-friendly way of eliminating -XX flags.
161 * When a flag is eliminated, it can be added to this list in order to 174 * When a flag is eliminated, it can be added to this list in order to

mercurial