fix wrong compare urls for github and bitbucket

This commit is contained in:
Sebastian Sdorra
2011-12-03 16:33:34 +01:00
parent 6e8f63fee6
commit 296c78acd6

View File

@@ -99,24 +99,6 @@ public abstract class AbstractCompareUrlBuilder implements CompareUrlBuilder
other.getVersion()); other.getVersion());
} }
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param url
*
* @return
*/
@Override
public boolean isCompareable(String url)
{
return url.contains(getServername());
}
//~--- methods --------------------------------------------------------------
/** /**
* Method description * Method description
* *
@@ -127,8 +109,8 @@ public abstract class AbstractCompareUrlBuilder implements CompareUrlBuilder
* *
* @return * @return
*/ */
private String createCompareUrl(String urlString, String version, public String createCompareUrl(String urlString, String version,
String otherVersion) String otherVersion)
{ {
String result = null; String result = null;
@@ -139,6 +121,8 @@ public abstract class AbstractCompareUrlBuilder implements CompareUrlBuilder
if (Util.isNotEmpty(path)) if (Util.isNotEmpty(path))
{ {
path = HttpUtil.getUriWithoutStartSeperator(path);
String[] parts = path.split(HttpUtil.SEPARATOR_PATH); String[] parts = path.split(HttpUtil.SEPARATOR_PATH);
if (parts.length >= 2) if (parts.length >= 2)
@@ -155,4 +139,20 @@ public abstract class AbstractCompareUrlBuilder implements CompareUrlBuilder
return result; return result;
} }
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param url
*
* @return
*/
@Override
public boolean isCompareable(String url)
{
return url.contains(getServername());
}
} }