Browse Source

fall back to java.vm.version if java.runtime.version cannot be found

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@802486 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
0d2218167b
2 changed files with 7 additions and 3 deletions
  1. +2
    -2
      WHATSNEW
  2. +5
    -1
      src/main/org/apache/tools/ant/taskdefs/Manifest.java

+ 2
- 2
WHATSNEW View File

@@ -141,8 +141,8 @@ Changes that could break older environments:
set failOnError to false.
Bugzilla Report 47362.

* Ant now uses the java.runtime.version instead of java.vm.version
system property for the Created-By Manifest attribute.
* Ant now prefers the java.runtime.version system property over
java.vm.version for the Created-By Manifest attribute.
Bugzilla Report 47632.

Fixed bugs:


+ 5
- 1
src/main/org/apache/tools/ant/taskdefs/Manifest.java View File

@@ -745,8 +745,12 @@ public class Manifest {
try {
insr = new InputStreamReader(in, "UTF-8");
Manifest defaultManifest = new Manifest(insr);
String version = System.getProperty("java.runtime.version");
if (version == null) {
version = System.getProperty("java.vm.version");
}
Attribute createdBy = new Attribute("Created-By",
System.getProperty("java.runtime.version") + " ("
version + " ("
+ System.getProperty("java.vm.vendor") + ")");
defaultManifest.getMainSection().storeAttribute(createdBy);
return defaultManifest;


Loading…
Cancel
Save