"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/client/utils/URIUtils.java" between
httpcomponents-client-4.5.9-src.tar.gz and httpcomponents-client-4.5.10-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

URIUtils.java  (httpcomponents-client-4.5.9-src):URIUtils.java  (httpcomponents-client-4.5.10-src)
skipping to change at line 220 skipping to change at line 220
uribuilder.setPort(target.getPort()); uribuilder.setPort(target.getPort());
} else { } else {
uribuilder.setScheme(null); uribuilder.setScheme(null);
uribuilder.setHost(null); uribuilder.setHost(null);
uribuilder.setPort(-1); uribuilder.setPort(-1);
} }
if (flags.contains(UriFlag.DROP_FRAGMENT)) { if (flags.contains(UriFlag.DROP_FRAGMENT)) {
uribuilder.setFragment(null); uribuilder.setFragment(null);
} }
if (flags.contains(UriFlag.NORMALIZE)) { if (flags.contains(UriFlag.NORMALIZE)) {
final List<String> pathSegments = new ArrayList<String>(uribuilder.g final List<String> originalPathSegments = uribuilder.getPathSegments
etPathSegments()); ();
final List<String> pathSegments = new ArrayList<String>(originalPath
Segments);
for (final Iterator<String> it = pathSegments.iterator(); it.hasNext (); ) { for (final Iterator<String> it = pathSegments.iterator(); it.hasNext (); ) {
final String pathSegment = it.next(); final String pathSegment = it.next();
if (pathSegment.isEmpty() && it.hasNext()) { if (pathSegment.isEmpty() && it.hasNext()) {
it.remove(); it.remove();
} }
} }
uribuilder.setPathSegments(pathSegments); if (pathSegments.size() != originalPathSegments.size()) {
uribuilder.setPathSegments(pathSegments);
}
} }
if (uribuilder.isPathEmpty()) { if (uribuilder.isPathEmpty()) {
uribuilder.setPathSegments(""); uribuilder.setPathSegments("");
} }
return uribuilder.build(); return uribuilder.build();
} }
/** /**
* A convenience method for * A convenience method for
* {@link URIUtils#rewriteURI(URI, HttpHost, EnumSet)} that always keeps the * {@link URIUtils#rewriteURI(URI, HttpHost, EnumSet)} that always keeps the
 End of changes. 2 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)