hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject svn commit: r1658945 - /httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
Date Wed, 11 Feb 2015 12:56:51 GMT
Author: michaelo
Date: Wed Feb 11 12:56:50 2015
New Revision: 1658945

URL: http://svn.apache.org/r1658945
Log:
HTTPCORE-395: VersionInfo#getUserAgent reports incorrect Java version

Restored logic with UNAVAILABLE relase identifier

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java?rev=1658945&r1=1658944&r2=1658945&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
(original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
Wed Feb 11 12:56:50 2015
@@ -301,8 +301,7 @@ public class VersionInfo {
     }
 
     /**
-     * Sets the user agent to {@code "<name>/<release> (Java/<java.version>)"}.
If release is
-     * {@link #UNAVAILABLE}, it will be omitted.
+     * Sets the user agent to {@code "<name>/<release> (Java/<java.version>)"}.
      * <p>
      * For example:
      * <pre>"Apache-HttpClient/4.3 (Java/1.6.0_35)"</pre>
@@ -321,11 +320,7 @@ public class VersionInfo {
         final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
         final String javaVersion = System.getProperty("java.version");
 
-        String nameAndRelease = name;
-        if (!UNAVAILABLE.equals(release))
-            nameAndRelease += "/" + release;
-
-        return String.format("%s (Java/%s)", nameAndRelease, javaVersion);
+        return String.format("%s/%s (Java/%s)", name, release, javaVersion);
     }
 
 } // class VersionInfo



Mime
View raw message