Buggy code:
public final class HttpHelper { private static final Logger LOG = LoggerFactory . getLogger ( HttpHelper . class ) ; private HttpHelper ( ) { } public static void setCharsetFromContentType ( String contentType , Exchange exchange ) { } public static void writeObjectToServletResponse ( ServletResponse response , Object target ) throws IOException { } public static void writeObjectToStream ( OutputStream stream , Object target ) throws IOException { } @ Deprecated public static Object deserializeJavaObjectFromStream ( InputStream is ) throws IOException , ClassNotFoundException { } public static Object deserializeJavaObjectFromStream ( InputStream is , CamelContext context ) throws IOException , ClassNotFoundException { } public static Object readResponseBodyFromServletRequest ( HttpServletRequest request , Exchange exchange ) throws IOException { } public static Object readResponseBodyFromInputStream ( InputStream is , Exchange exchange ) throws IOException { } public static String createURL ( Exchange exchange , HttpEndpoint endpoint ) { } public static URI createURI ( Exchange exchange , String url , HttpEndpoint endpoint ) throws URISyntaxException { } public static HttpMethods createMethod ( Exchange exchange , HttpEndpoint endpoint , boolean hasPayload ) throws URISyntaxException { } public static HttpVersion parserHttpVersion ( String s ) throws ProtocolException { } public static boolean isSecureConnection ( String uri ) { } @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static void appendHeader ( Map < String , Object > headers , String key , Object value ) { } public static Object extractHttpParameterValue ( String value ) { } public static String urlRewrite ( Exchange exchange , String url , HttpEndpoint endpoint , Producer producer ) throws Exception { String answer = null ; String relativeUrl ; if ( ( endpoint . getUrlRewrite ( ) ) != null ) { String baseUrl ; relativeUrl = endpoint . getHttpUri ( ) . toASCIIString ( ) ; if ( url . startsWith ( relativeUrl ) ) { baseUrl = url . substring ( 0 , relativeUrl . length ( ) ) ; relativeUrl = url . substring ( relativeUrl . length ( ) ) ; } else { baseUrl = null ; relativeUrl = url ; } if ( ObjectHelper . isEmpty ( relativeUrl ) ) { relativeUrl = null ; } String newUrl ; if ( ( endpoint . getUrlRewrite ( ) ) instanceof HttpServletUrlRewrite ) { HttpServletRequest request = exchange . getIn ( ) . getBody ( HttpServletRequest . class ) ; if ( request == null ) { HttpMessage msg = exchange . getIn ( HttpMessage . class ) ; if ( msg != null ) { request = msg . getRequest ( ) ; } } if ( request == null ) { throw new IllegalArgumentException ( ( ( ( ( "UrlRewrite<seq2seq4repair_space>" + ( endpoint . getUrlRewrite ( ) ) ) + "<seq2seq4repair_space>requires<seq2seq4repair_space>the<seq2seq4repair_space>message<seq2seq4repair_space>body<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>a" ) + "HttpServletRequest<seq2seq4repair_space>instance,<seq2seq4repair_space>but<seq2seq4repair_space>was:<seq2seq4repair_space>" ) + ( ObjectHelper . className ( exchange . getIn ( ) . getBody ( ) ) ) ) ) ; } String contextPath = exchange . getIn ( ) . getHeader ( "CamelServletContextPath" , String . class ) ; request = new UrlRewriteHttpServletRequestAdapter ( request , contextPath ) ; newUrl = ( ( HttpServletUrlRewrite ) ( endpoint . getUrlRewrite ( ) ) ) . rewrite ( url , relativeUrl , producer , request ) ; } else { newUrl = endpoint . getUrlRewrite ( ) . rewrite ( url , relativeUrl , producer ) ; } <START_BUG> if ( ( ObjectHelper . isNotEmpty ( newUrl ) ) && ( newUrl != url ) ) { <END_BUG> if ( ( newUrl . startsWith ( "http:" ) ) || ( newUrl . startsWith ( "https:" ) ) ) { answer = newUrl ; } else if ( baseUrl != null ) { if ( ( baseUrl . endsWith ( "//" ) ) && ( newUrl . startsWith ( "//" ) ) ) { answer = baseUrl + ( newUrl . substring ( 1 ) ) ; } else { answer = baseUrl + newUrl ; } } else { answer = newUrl ; } if ( HttpHelper . LOG . isDebugEnabled ( ) ) { HttpHelper . LOG . debug ( "Using<seq2seq4repair_space>url<seq2seq4repair_space>rewrite<seq2seq4repair_space>to<seq2seq4repair_space>rewrite<seq2seq4repair_space>from<seq2seq4repair_space>url<seq2seq4repair_space>{}<seq2seq4repair_space>to<seq2seq4repair_space>{}<seq2seq4repair_space>-><seq2seq4repair_space>{}" , new Object [ ] { relativeUrl != null ? relativeUrl : url , newUrl , answer } ) ; } } } return answer ; } }

Fix:
if ( ( ObjectHelper . isNotEmpty ( newUrl ) ) && ( ! ( newUrl . equals ( url ) ) ) ) {