hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Osipov <micha...@apache.org>
Subject Re: svn commit: r1658967 - /httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
Date Sat, 14 Feb 2015 20:47:00 GMT
Am 2015-02-11 um 21:24 schrieb sebb:
> On 11 February 2015 at 14:23,  <michaelo@apache.org> wrote:
>> Author: michaelo
>> Date: Wed Feb 11 14:23:29 2015
>> New Revision: 1658967
>>
>> URL: http://svn.apache.org/r1658967
>> Log:
>> HTTPCORE-395: VersionInfo#getUserAgent reports incorrect Java version
>>
>> Modified:
>>      httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
  (contents, props changed)
>>
>> Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
>> URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java?rev=1658967&r1=1658966&r2=1658967&view=diff
>> ==============================================================================
>> --- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
(original)
>> +++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/VersionInfo.java
Wed Feb 11 14:23:29 2015
>> @@ -301,10 +301,11 @@ public class VersionInfo {
>>       }
>>
>>       /**
>> -     * Sets the user agent to {@code "<name>/<release> (Java 1.5 minimum;
Java/<java.version>)"}.
>> +     * Sets the user agent to {@code "<name>/<release> (Java/<java.version>)"}.
If release is
>> +     * {@link #UNAVAILABLE}, it will be omitted.
>>        * <p>
>>        * For example:
>> -     * <pre>"Apache-HttpClient/4.3 (Java 1.5 minimum; Java/1.6.0_35)"</pre>
>> +     * <pre>"Apache-HttpClient/4.3 (Java/1.6.0_35)"</pre>
>>        *
>>        * @param name the component name, like "Apache-HttpClient".
>>        * @param pkg
>> @@ -319,7 +320,12 @@ public class VersionInfo {
>>           final VersionInfo vi = VersionInfo.loadVersionInfo(pkg, cls.getClassLoader());
>>           final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
>>           final String javaVersion = System.getProperty("java.version");
>> -        return name + "/" + release + " (Java 1.5 minimum; Java/" + javaVersion
+ ")";
>> +
>> +        String nameAndRelease = name;
>> +        if (!UNAVAILABLE.equals(release))
>> +            nameAndRelease += "/" + release;
>
> Conditional statements should alwaya uae blocks please.

Already committed. Thanks for that one. Though, wondering why the 
checkstyle goal did not fail during my build run.

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message