if (getModule() != null) { buffer.append(getUrl()); } else { buffer.append(RenderUtils.getModuleRelativePath(getUrl())); }
buffer.append(getUrl());
    private String calculateUrl() {        StringBuilder buffer = new StringBuilder();                if (getModule() != null) {            buffer.append(RenderUtils.getContextRelativePath(getModule()));        }                if (getUrl() != null) {            if (getModule() != null) {                buffer.append(getUrl());            }            else {                buffer.append(RenderUtils.getModuleRelativePath(getUrl()));            }        }                if (! getParameters().isEmpty()) {            if (getUrl().indexOf('?') == -1) {                buffer.append("?");            }            else {                buffer.append("&");            }                        Set<String> keys = getParameters().keySet();                        int count = keys.size();            for (String key : keys) {                buffer.append(key);                buffer.append("=");                buffer.append(getParameters().get(key));                               count--;                if (count > 0) {                    buffer.append("&");                }            }        }                if (getAnchor() != null) {            buffer.append("#");            buffer.append(getAnchor());        }                // allways make a link        if (buffer.length() == 0) {            buffer.append("#");        }                return buffer.toString();    }