Input:
    public HTTPStatus request(String method, String path, HTTPHeader header, InputStream body, int ok1, int ok2, OutputStream dst, DefaultHandler handler, SVNErrorMessage context) throws SVNException {
        myLastStatus = null;
        myRequestCount++;
        if ("".equals(path) || path == null) {
            path = "/";
        }
        ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager();
        HTTPSSLKeyManager keyManager = myKeyManager == null && authManager != null ? createKeyManager() : myKeyManager;
        TrustManager trustManager = myTrustManager == null && authManager != null ? authManager.getTrustManager(myRepository.getLocation()) : myTrustManager;
        ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(myRepository.getLocation()) : null;
        String sslRealm = "<" + myHost.getProtocol() + "://" + myHost.getHost() + ":" + myHost.getPort() + ">";
        SVNAuthentication httpAuth = myLastValidAuth;
        boolean isAuthForced = authManager != null ? authManager.isAuthenticationForced() : false;
        if (httpAuth == null && isAuthForced) {
            httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, sslRealm, null);
            myChallengeCredentials = new HTTPBasicAuthentication((SVNPasswordAuthentication)httpAuth, myCharset);
        }
        String realm = null;
        HTTPRequest request = new HTTPRequest(myCharset);
        request.setConnection(this);
        request.setKeepAlive(true);
        request.setRequestBody(body);
        request.setResponseHandler(handler);
        request.setResponseStream(dst);
        SVNErrorMessage err = null;
        boolean ntlmAuthIsRequired = false;
        boolean ntlmProxyAuthIsRequired = false;
        boolean negoAuthIsRequired = false;
        int authAttempts = 0;
        while (true) {
            if (myNextRequestTimeout < 0 || System.currentTimeMillis() >= myNextRequestTimeout) {
                SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "Keep-Alive timeout detected");
                close();
                if (isClearCredentialsOnClose(myChallengeCredentials)) {
                    httpAuth = null;
                }
            }
            int retryCount = 1;
            try {
                err = null;
                String httpAuthResponse = null;
                String proxyAuthResponse = null;
                while(retryCount >= 0) {
                    connect(keyManager, trustManager, proxyManager);
                    request.reset();
                    request.setProxied(myIsProxied);
                    request.setSecured(myIsSecured);
                    if (myProxyAuthentication != null && (ntlmProxyAuthIsRequired || !"NTLM".equals(myProxyAuthentication.getAuthenticationScheme()))) {
                        if (proxyAuthResponse == null) {
                            request.initCredentials(myProxyAuthentication, method, path);
                            proxyAuthResponse = myProxyAuthentication.authenticate();
                        }
                        request.setProxyAuthentication(proxyAuthResponse);
                    }
                    if (myChallengeCredentials != null && (ntlmAuthIsRequired || negoAuthIsRequired || ((!"NTLM".equals(myChallengeCredentials.getAuthenticationScheme())) && !"Negotiate".equals(myChallengeCredentials.getAuthenticationScheme())) &&
                            httpAuth != null)) {
                        if (httpAuthResponse == null) {
                            request.initCredentials(myChallengeCredentials, method, path);
                            httpAuthResponse = myChallengeCredentials.authenticate();
                        }
                        request.setAuthentication(httpAuthResponse);
                    }
                    if (myCookies != null && !myCookies.isEmpty()) {
                        request.setCookies(myCookies);
                    }
                    try {
                        request.dispatch(method, path, header, ok1, ok2, context);
                        break;
                    } catch (EOFException pe) {
                        if (retryCount > 0) {
                            close();
                            continue;
                        }
                        throw (IOException) new IOException(pe.getMessage()).initCause(pe);
                    } finally {
                        retryCount--;
                    }
                }
                if (request.getResponseHeader().hasHeader(HTTPHeader.SET_COOKIE)) {
                    myCookies = request.getResponseHeader().getHeaderValues(HTTPHeader.COOKIE);
                }
                myNextRequestTimeout = request.getNextRequestTimeout();
                myLastStatus = request.getStatus();
            } catch (SSLHandshakeException ssl) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, ssl);
                close();
	            if (ssl.getCause() instanceof SVNSSLUtil.CertificateNotTrustedException) {
		            SVNErrorManager.cancel(ssl.getCause().getMessage(), SVNLogType.NETWORK);
	            }
                SVNErrorMessage sslErr = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "SSL handshake failed: ''{0}''", new Object[] { ssl.getMessage() }, SVNErrorMessage.TYPE_ERROR, ssl);
		            if (keyManager != null) {
			            keyManager.acknowledgeAndClearAuthentication(sslErr);
		            }
                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, ssl);
	            continue;
            } catch (IOException e) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, e);
                if (e instanceof SocketTimeoutException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "timed out waiting for server", null, SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof UnknownHostException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "unknown host", null, SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof ConnectException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "connection refused by the server", null,
	                        SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof SVNCancellableOutputStream.IOCancelException) {
                    SVNErrorManager.cancel(e.getMessage(), SVNLogType.NETWORK);
                } else if (e instanceof SSLException) {
                    err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
                            e.getMessage());
                } else {
                    err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
                            e.getMessage());
                }
            } catch (SVNException e) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, e);
                close();
                throw e;
            } finally {
                finishResponse(request);
            }
            if (err != null) {
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(false, err);
                }
                close();
                break;
            }
            if (proxyManager != null) {
                proxyManager.acknowledgeProxyContext(true, err);
            }
            if (keyManager != null) {
	            myKeyManager = keyManager;
	            myTrustManager = trustManager;
	            keyManager.acknowledgeAndClearAuthentication(null);
            }
            if (myLastStatus.getCode() == HttpURLConnection.HTTP_FORBIDDEN) {
                if (httpAuth != null && authManager != null) {
                    BasicAuthenticationManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.PASSWORD, realm, request.getErrorMessage(), httpAuth, myRepository.getLocation(), authManager);
                }
                myLastValidAuth = null;
                close();
                err = request.getErrorMessage();
            } else if (myIsProxied && myLastStatus.getCode() == HttpURLConnection.HTTP_PROXY_AUTH) {
                Collection<String> proxyAuthHeaders = request.getResponseHeader().getHeaderValues(HTTPHeader.PROXY_AUTHENTICATE_HEADER);
                Collection<String> authTypes = null;
                if (authManager != null && authManager instanceof DefaultSVNAuthenticationManager) {
                    DefaultSVNAuthenticationManager defaultAuthManager = (DefaultSVNAuthenticationManager) authManager;
                    authTypes = defaultAuthManager.getAuthTypes(myRepository.getLocation());
                }
                try {
                    myProxyAuthentication = HTTPAuthentication.parseAuthParameters(proxyAuthHeaders, myProxyAuthentication, myCharset, authTypes, null, myRequestCount);
                } catch (SVNException svne) {
                    myRepository.getDebugLog().logFine(SVNLogType.NETWORK, svne);
                    err = svne.getErrorMessage();
                    break;
                }
                if (myProxyAuthentication instanceof HTTPNTLMAuthentication) {
                    ntlmProxyAuthIsRequired = true;
                    HTTPNTLMAuthentication ntlmProxyAuth = (HTTPNTLMAuthentication)myProxyAuthentication;
                    if (ntlmProxyAuth.isInType3State()) {
                        continue;
                    }
                }
                err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "HTTP proxy authorization failed");
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(false, err);
                }
                close();
                break;
            } else if (myLastStatus.getCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
                authAttempts++;
                Collection<String> authHeaderValues = request.getResponseHeader().getHeaderValues(HTTPHeader.AUTHENTICATE_HEADER);
                if (authHeaderValues == null || authHeaderValues.size() == 0) {
                    err = request.getErrorMessage();
                    myLastStatus.setError(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, err.getMessageTemplate(), err.getRelatedObjects()));
                    if ("LOCK".equalsIgnoreCase(method)) {
                        myLastStatus.getError().setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
                                "Probably you are trying to lock file in repository that only allows anonymous access"));
                    }
                    SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK);
                    return myLastStatus;
                }
                boolean skip = false;
                isAuthForced = authManager != null ? authManager.isAuthenticationForced() : false;
                if (isAuthForced) {
                    if (httpAuth != null && myChallengeCredentials != null && !HTTPAuthentication.isSchemeSupportedByServer(myChallengeCredentials.getAuthenticationScheme(), authHeaderValues)) {
                        skip = true;
                    }
                }
                Collection<String> authTypes = null;
                if (authManager != null && authManager instanceof DefaultSVNAuthenticationManager) {
                    DefaultSVNAuthenticationManager defaultAuthManager = (DefaultSVNAuthenticationManager) authManager;
                    authTypes = defaultAuthManager.getAuthTypes(myRepository.getLocation());
                }
                try {
                    myChallengeCredentials = HTTPAuthentication.parseAuthParameters(authHeaderValues, myChallengeCredentials, myCharset, authTypes, authManager, myRequestCount);
                } catch (SVNException svne) {
                    err = svne.getErrorMessage();
                    break;
                }
                myChallengeCredentials.setChallengeParameter("method", method);
                myChallengeCredentials.setChallengeParameter("uri", HTTPParser.getCanonicalPath(path, null).toString());
                if (skip) {
                    close();
                    continue;
                }
                HTTPNTLMAuthentication ntlmAuth = null;
                HTTPNegotiateAuthentication negoAuth = null;
                if (myChallengeCredentials instanceof HTTPNTLMAuthentication) {
                    ntlmAuthIsRequired = true;
                    ntlmAuth = (HTTPNTLMAuthentication)myChallengeCredentials;
                    if (ntlmAuth.isInType3State()) {
                        continue;
                    }
                } else if (myChallengeCredentials instanceof HTTPDigestAuthentication) {
                    if (myLastValidAuth != null) {
                        myLastValidAuth = null;
                        continue;
                    }
                } else if (myChallengeCredentials instanceof HTTPNegotiateAuthentication) {
                    negoAuthIsRequired = true;
                    negoAuth = (HTTPNegotiateAuthentication)myChallengeCredentials;
                    if (negoAuth.isStarted()) {
                        continue;
                    }
                }
                myLastValidAuth = null;
                if (ntlmAuth != null && ntlmAuth.isNative() && authAttempts == 1) {
                    continue;
                }
                if (negoAuth != null && !negoAuth.needsLogin()) {
                    continue;
                }
                if (authManager == null) {
                    err = request.getErrorMessage();
                    break;
                }
                realm = myChallengeCredentials.getChallengeParameter("realm");
                realm = realm == null ? "" : " " + realm;
                realm = "<" + myHost.getProtocol() + "://" + myHost.getHost() + ":" + myHost.getPort() + ">" + realm;
                if (httpAuth == null) {
                    httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, realm, myRepository.getLocation());
                } else if (authAttempts >= requestAttempts) {
                    BasicAuthenticationManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.PASSWORD, realm, request.getErrorMessage(), httpAuth, myRepository.getLocation(), authManager);
                    httpAuth = authManager.getNextAuthentication(ISVNAuthenticationManager.PASSWORD, realm, myRepository.getLocation());
                }
                if (httpAuth == null) {
                    err = SVNErrorMessage.create(SVNErrorCode.CANCELLED, "HTTP authorization cancelled");
                    break;
                }
                if (httpAuth != null) {
                    myChallengeCredentials.setCredentials((SVNPasswordAuthentication) httpAuth);
                }
                continue;
            } else if (myLastStatus.getCode() == HttpURLConnection.HTTP_MOVED_PERM || myLastStatus.getCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
                String newLocation = request.getResponseHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER);
                if (newLocation == null) {
                    err = request.getErrorMessage();
                    break;
                }
                int hostIndex = newLocation.indexOf("://");
                if (hostIndex > 0) {
                    hostIndex += 3;
                    hostIndex = newLocation.indexOf("/", hostIndex);
                }
                if (hostIndex > 0 && hostIndex < newLocation.length()) {
                    String newPath = newLocation.substring(hostIndex);
                    if (newPath.endsWith("/") &&
                            !newPath.endsWith("//") && !path.endsWith("/") &&
                            newPath.substring(0, newPath.length() - 1).equals(path)) {
                        path += "//";
                        continue;
                    }
                }
                err = request.getErrorMessage();
                close();
            } else if (request.getErrorMessage() != null) {
                err = request.getErrorMessage();
            } else {
                ntlmProxyAuthIsRequired = false;
                ntlmAuthIsRequired = false;
                negoAuthIsRequired = false;
            }
            if (err != null) {
                break;
            }
            if (myIsProxied) {
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(true, null);
                }
            }
            if (httpAuth != null && realm != null && authManager != null) {
                BasicAuthenticationManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.PASSWORD, realm, null, httpAuth, myRepository.getLocation(), authManager);
            }
	        if (trustManager != null && authManager != null) {
		        authManager.acknowledgeTrustManager(trustManager);
	        }
            if (httpAuth != null) {
                myLastValidAuth = httpAuth;
            }
            if (authManager instanceof ISVNAuthenticationManagerExt) {
                ((ISVNAuthenticationManagerExt)authManager).acknowledgeConnectionSuccessful(myRepository.getLocation());
            }
            myLastStatus.setHeader(request.getResponseHeader());
            return myLastStatus;
        }
        close();
        if (err != null && err.getErrorCode().getCategory() != SVNErrorCode.RA_DAV_CATEGORY &&
            err.getErrorCode() != SVNErrorCode.UNSUPPORTED_FEATURE) {
            SVNErrorManager.error(err, SVNLogType.NETWORK);
        }
        myRepository.getDebugLog().logFine(SVNLogType.NETWORK, new Exception(err.getMessage()));
        SVNErrorMessage err2 = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {method, path}, err.getType(), err.getCause());
        SVNErrorManager.error(err, err2, SVNLogType.NETWORK);
        return null;
    }

Output:
    public HTTPStatus request(String method, String path, HTTPHeader header, InputStream body, int ok1, int ok2, OutputStream dst, DefaultHandler handler, SVNErrorMessage context) throws SVNException {
        myLastStatus = null;
        myRequestCount++;
        if ("".equals(path) || path == null) {
            path = "/";
        }
        ISVNAuthenticationManager authManager = myRepository.getAuthenticationManager();
        HTTPSSLKeyManager keyManager = myKeyManager == null && authManager != null ? createKeyManager() : myKeyManager;
        TrustManager trustManager = myTrustManager == null && authManager != null ? authManager.getTrustManager(myRepository.getLocation()) : myTrustManager;
        ISVNProxyManager proxyManager = authManager != null ? authManager.getProxyManager(myRepository.getLocation()) : null;
        String sslRealm = "<" + myHost.getProtocol() + "://" + myHost.getHost() + ":" + myHost.getPort() + ">";
        SVNAuthentication httpAuth = myLastValidAuth;
        boolean isAuthForced = authManager != null ? authManager.isAuthenticationForced() : false;
        if (httpAuth == null && isAuthForced) {
            httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, sslRealm, null);
            myChallengeCredentials = new HTTPBasicAuthentication((SVNPasswordAuthentication)httpAuth, myCharset);
        }
        String realm = null;
        HTTPRequest request = new HTTPRequest(myCharset);
        request.setConnection(this);
        request.setKeepAlive(true);
        request.setRequestBody(body);
        request.setResponseHandler(handler);
        request.setResponseStream(dst);
        SVNErrorMessage err = null;
        boolean ntlmAuthIsRequired = false;
        boolean ntlmProxyAuthIsRequired = false;
        boolean negoAuthIsRequired = false;
        int authAttempts = 0;
        while (true) {
            if (myNextRequestTimeout < 0 || System.currentTimeMillis() >= myNextRequestTimeout) {
                SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "Keep-Alive timeout detected");
                close();
                if (isClearCredentialsOnClose(myChallengeCredentials)) {
                    httpAuth = null;
                }
            }
            int retryCount = 1;
            try {
                err = null;
                String httpAuthResponse = null;
                String proxyAuthResponse = null;
                while(retryCount >= 0) {
                    connect(keyManager, trustManager, proxyManager);
                    request.reset();
                    request.setProxied(myIsProxied);
                    request.setSecured(myIsSecured);
                    if (myProxyAuthentication != null && (ntlmProxyAuthIsRequired || !"NTLM".equals(myProxyAuthentication.getAuthenticationScheme()))) {
                        if (proxyAuthResponse == null) {
                            request.initCredentials(myProxyAuthentication, method, path);
                            proxyAuthResponse = myProxyAuthentication.authenticate();
                        }
                        request.setProxyAuthentication(proxyAuthResponse);
                    }
                    if (myChallengeCredentials != null && (ntlmAuthIsRequired || negoAuthIsRequired || ((!"NTLM".equals(myChallengeCredentials.getAuthenticationScheme())) && !"Negotiate".equals(myChallengeCredentials.getAuthenticationScheme())) &&
                            httpAuth != null)) {
                        if (httpAuthResponse == null) {
                            request.initCredentials(myChallengeCredentials, method, path);
                            httpAuthResponse = myChallengeCredentials.authenticate();
                        }
                        request.setAuthentication(httpAuthResponse);
                    }
                    if (myCookies != null && !myCookies.isEmpty()) {
                        request.setCookies(myCookies);
                    }
                    try {
                        request.dispatch(method, path, header, ok1, ok2, context);
                        break;
                    } catch (EOFException pe) {
                        if (retryCount > 0) {
                            close();
                            continue;
                        }
                        throw (IOException) new IOException(pe.getMessage()).initCause(pe);
                    } finally {
                        retryCount--;
                    }
                }
                if (request.getResponseHeader().hasHeader(HTTPHeader.SET_COOKIE)) {
                    myCookies = request.getResponseHeader().getHeaderValues(HTTPHeader.COOKIE);
                }
                myNextRequestTimeout = request.getNextRequestTimeout();
                myLastStatus = request.getStatus();
            } catch (SSLHandshakeException ssl) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, ssl);
                close();
	            if (ssl.getCause() instanceof SVNSSLUtil.CertificateNotTrustedException) {
		            SVNErrorManager.cancel(ssl.getCause().getMessage(), SVNLogType.NETWORK);
	            }
                SVNErrorMessage sslErr = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "SSL handshake failed: ''{0}''", new Object[] { ssl.getMessage() }, SVNErrorMessage.TYPE_ERROR, ssl);
		            if (keyManager != null) {
			            keyManager.acknowledgeAndClearAuthentication(sslErr);
		            }
                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, ssl);
	            continue;
            } catch (IOException e) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, e);
                if (e instanceof SocketTimeoutException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "timed out waiting for server", null, SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof UnknownHostException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "unknown host", null, SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof ConnectException) {
	                err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
	                        "connection refused by the server", null,
	                        SVNErrorMessage.TYPE_ERROR, e);
                } else if (e instanceof SVNCancellableOutputStream.IOCancelException) {
                    SVNErrorManager.cancel(e.getMessage(), SVNLogType.NETWORK);
                } else if (e instanceof SSLException) {
                    err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
                            e);
                } else {
                    err = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED,
                            e);
                }
            } catch (SVNException e) {
                myRepository.getDebugLog().logFine(SVNLogType.NETWORK, e);
                close();
                throw e;
            } finally {
                finishResponse(request);
            }
            if (err != null) {
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(false, err);
                }
                close();
                break;
            }
            if (proxyManager != null) {
                proxyManager.acknowledgeProxyContext(true, err);
            }
            if (keyManager != null) {
	            myKeyManager = keyManager;
	            myTrustManager = trustManager;
	            keyManager.acknowledgeAndClearAuthentication(null);
            }
            if (myLastStatus.getCode() == HttpURLConnection.HTTP_FORBIDDEN) {
                if (httpAuth != null && authManager != null) {
                    BasicAuthenticationManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.PASSWORD, realm, request.getErrorMessage(), httpAuth, myRepository.getLocation(), authManager);
                }
                myLastValidAuth = null;
                close();
                err = request.getErrorMessage();
            } else if (myIsProxied && myLastStatus.getCode() == HttpURLConnection.HTTP_PROXY_AUTH) {
                Collection<String> proxyAuthHeaders = request.getResponseHeader().getHeaderValues(HTTPHeader.PROXY_AUTHENTICATE_HEADER);
                Collection<String> authTypes = null;
                if (authManager != null && authManager instanceof DefaultSVNAuthenticationManager) {
                    DefaultSVNAuthenticationManager defaultAuthManager = (DefaultSVNAuthenticationManager) authManager;
                    authTypes = defaultAuthManager.getAuthTypes(myRepository.getLocation());
                }
                try {
                    myProxyAuthentication = HTTPAuthentication.parseAuthParameters(proxyAuthHeaders, myProxyAuthentication, myCharset, authTypes, null, myRequestCount);
                } catch (SVNException svne) {
                    myRepository.getDebugLog().logFine(SVNLogType.NETWORK, svne);
                    err = svne.getErrorMessage();
                    break;
                }
                if (myProxyAuthentication instanceof HTTPNTLMAuthentication) {
                    ntlmProxyAuthIsRequired = true;
                    HTTPNTLMAuthentication ntlmProxyAuth = (HTTPNTLMAuthentication)myProxyAuthentication;
                    if (ntlmProxyAuth.isInType3State()) {
                        continue;
                    }
                }
                err = SVNErrorMessage.create(SVNErrorCode.RA_NOT_AUTHORIZED, "HTTP proxy authorization failed");
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(false, err);
                }
                close();
                break;
            } else if (myLastStatus.getCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
                authAttempts++;
                Collection<String> authHeaderValues = request.getResponseHeader().getHeaderValues(HTTPHeader.AUTHENTICATE_HEADER);
                if (authHeaderValues == null || authHeaderValues.size() == 0) {
                    err = request.getErrorMessage();
                    myLastStatus.setError(SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, err.getMessageTemplate(), err.getRelatedObjects()));
                    if ("LOCK".equalsIgnoreCase(method)) {
                        myLastStatus.getError().setChildErrorMessage(SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
                                "Probably you are trying to lock file in repository that only allows anonymous access"));
                    }
                    SVNErrorManager.error(myLastStatus.getError(), SVNLogType.NETWORK);
                    return myLastStatus;
                }
                boolean skip = false;
                isAuthForced = authManager != null ? authManager.isAuthenticationForced() : false;
                if (isAuthForced) {
                    if (httpAuth != null && myChallengeCredentials != null && !HTTPAuthentication.isSchemeSupportedByServer(myChallengeCredentials.getAuthenticationScheme(), authHeaderValues)) {
                        skip = true;
                    }
                }
                Collection<String> authTypes = null;
                if (authManager != null && authManager instanceof DefaultSVNAuthenticationManager) {
                    DefaultSVNAuthenticationManager defaultAuthManager = (DefaultSVNAuthenticationManager) authManager;
                    authTypes = defaultAuthManager.getAuthTypes(myRepository.getLocation());
                }
                try {
                    myChallengeCredentials = HTTPAuthentication.parseAuthParameters(authHeaderValues, myChallengeCredentials, myCharset, authTypes, authManager, myRequestCount);
                } catch (SVNException svne) {
                    err = svne.getErrorMessage();
                    break;
                }
                myChallengeCredentials.setChallengeParameter("method", method);
                myChallengeCredentials.setChallengeParameter("uri", HTTPParser.getCanonicalPath(path, null).toString());
                if (skip) {
                    close();
                    continue;
                }
                HTTPNTLMAuthentication ntlmAuth = null;
                HTTPNegotiateAuthentication negoAuth = null;
                if (myChallengeCredentials instanceof HTTPNTLMAuthentication) {
                    ntlmAuthIsRequired = true;
                    ntlmAuth = (HTTPNTLMAuthentication)myChallengeCredentials;
                    if (ntlmAuth.isInType3State()) {
                        continue;
                    }
                } else if (myChallengeCredentials instanceof HTTPDigestAuthentication) {
                    if (myLastValidAuth != null) {
                        myLastValidAuth = null;
                        continue;
                    }
                } else if (myChallengeCredentials instanceof HTTPNegotiateAuthentication) {
                    negoAuthIsRequired = true;
                    negoAuth = (HTTPNegotiateAuthentication)myChallengeCredentials;
                    if (negoAuth.isStarted()) {
                        continue;
                    }
                }
                myLastValidAuth = null;
                if (ntlmAuth != null && ntlmAuth.isNative() && authAttempts == 1) {
                    continue;
                }
                if (negoAuth != null && !negoAuth.needsLogin()) {
                    continue;
                }
                if (authManager == null) {
                    err = request.getErrorMessage();
                    break;
                }
                realm = myChallengeCredentials.getChallengeParameter("realm");
                realm = realm == null ? "" : " " + realm;
                realm = "<" + myHost.getProtocol() + "://" + myHost.getHost() + ":" + myHost.getPort() + ">" + realm;
                if (httpAuth == null) {
                    httpAuth = authManager.getFirstAuthentication(ISVNAuthenticationManager.PASSWORD, realm, myRepository.getLocation());
                } else if (authAttempts >= requestAttempts) {
                    BasicAuthenticationManager.acknowledgeAuthentication(false, ISVNAuthenticationManager.PASSWORD, realm, request.getErrorMessage(), httpAuth, myRepository.getLocation(), authManager);
                    httpAuth = authManager.getNextAuthentication(ISVNAuthenticationManager.PASSWORD, realm, myRepository.getLocation());
                }
                if (httpAuth == null) {
                    err = SVNErrorMessage.create(SVNErrorCode.CANCELLED, "HTTP authorization cancelled");
                    break;
                }
                if (httpAuth != null) {
                    myChallengeCredentials.setCredentials((SVNPasswordAuthentication) httpAuth);
                }
                continue;
            } else if (myLastStatus.getCode() == HttpURLConnection.HTTP_MOVED_PERM || myLastStatus.getCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
                String newLocation = request.getResponseHeader().getFirstHeaderValue(HTTPHeader.LOCATION_HEADER);
                if (newLocation == null) {
                    err = request.getErrorMessage();
                    break;
                }
                int hostIndex = newLocation.indexOf("://");
                if (hostIndex > 0) {
                    hostIndex += 3;
                    hostIndex = newLocation.indexOf("/", hostIndex);
                }
                if (hostIndex > 0 && hostIndex < newLocation.length()) {
                    String newPath = newLocation.substring(hostIndex);
                    if (newPath.endsWith("/") &&
                            !newPath.endsWith("//") && !path.endsWith("/") &&
                            newPath.substring(0, newPath.length() - 1).equals(path)) {
                        path += "//";
                        continue;
                    }
                }
                err = request.getErrorMessage();
                close();
            } else if (request.getErrorMessage() != null) {
                err = request.getErrorMessage();
            } else {
                ntlmProxyAuthIsRequired = false;
                ntlmAuthIsRequired = false;
                negoAuthIsRequired = false;
            }
            if (err != null) {
                break;
            }
            if (myIsProxied) {
                if (proxyManager != null) {
                    proxyManager.acknowledgeProxyContext(true, null);
                }
            }
            if (httpAuth != null && realm != null && authManager != null) {
                BasicAuthenticationManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.PASSWORD, realm, null, httpAuth, myRepository.getLocation(), authManager);
            }
	        if (trustManager != null && authManager != null) {
		        authManager.acknowledgeTrustManager(trustManager);
	        }
            if (httpAuth != null) {
                myLastValidAuth = httpAuth;
            }
            if (authManager instanceof ISVNAuthenticationManagerExt) {
                ((ISVNAuthenticationManagerExt)authManager).acknowledgeConnectionSuccessful(myRepository.getLocation());
            }
            myLastStatus.setHeader(request.getResponseHeader());
            return myLastStatus;
        }
        close();
        if (err != null && err.getErrorCode().getCategory() != SVNErrorCode.RA_DAV_CATEGORY &&
            err.getErrorCode() != SVNErrorCode.UNSUPPORTED_FEATURE) {
            SVNErrorManager.error(err, SVNLogType.NETWORK);
        }
        myRepository.getDebugLog().logFine(SVNLogType.NETWORK, new Exception(err.getMessage()));
        SVNErrorMessage err2 = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "{0} request failed on ''{1}''", new Object[] {method, path}, err.getType(), err.getCause());
        SVNErrorManager.error(err, err2, SVNLogType.NETWORK);
        return null;
    }


Input:
    public Packet decodePacket(RTMP rtmp, ByteBuffer in) {
		final int remaining = in.remaining();
		if (remaining < 1) {
			rtmp.bufferDecoding(1);
			return null;
		}
		final int position = in.position();
		final byte headerByte = in.get();
		final byte channelId = RTMPUtils.decodeChannelId(headerByte);
		if (channelId < 0) {
			throw new ProtocolException("Bad channel id: " + channelId);
		}
		final byte headerSize = RTMPUtils.decodeHeaderSize(headerByte);
		int headerLength = RTMPUtils.getHeaderLength(headerSize);
		if (headerLength > remaining) {
			if (log.isDebugEnabled()) {
				log.debug("Header too small, buffering. remaining: " + remaining);
			}
			in.position(position);
			rtmp.bufferDecoding(headerLength);
			return null;
		}
		in.position(position);
		final Header header = decodeHeader(in, rtmp
				.getLastReadHeader(channelId));
		if (header == null) {
			throw new ProtocolException("Header is null, check for error");
		}
		rtmp.setLastReadHeader(channelId, header);
		Packet packet = rtmp.getLastReadPacket(channelId);
		if (packet == null) {
			packet = new Packet(header);
			rtmp.setLastReadPacket(channelId, packet);
		}
		final ByteBuffer buf = packet.getData();
		final int addSize = (header.getTimer() == 0xffffff ? 4 : 0);
		final int readRemaining = header.getSize() + addSize - buf.position();
		final int chunkSize = rtmp.getReadChunkSize();
		final int readAmount = (readRemaining > chunkSize) ? chunkSize
				: readRemaining;
		if (in.remaining() < readAmount) {
			if (log.isDebugEnabled()) {
				log.debug("Chunk too small, buffering (" + in.remaining() + ','
						+ readAmount);
			}
			in.position(position);
			rtmp.bufferDecoding(headerSize + readAmount);
			return null;
		}
		BufferUtils.put(buf, in, readAmount);
		if (buf.position() < header.getSize() + addSize) {
			rtmp.continueDecoding();
			return null;
		}
		buf.flip();
		final IRTMPEvent message = decodeMessage(rtmp, packet.getHeader(), buf);
		packet.setMessage(message);
		if (message instanceof ChunkSize) {
			ChunkSize chunkSizeMsg = (ChunkSize) message;
			rtmp.setReadChunkSize(chunkSizeMsg.getSize());
		}
		rtmp.setLastReadPacket(channelId, null);
		return packet;
	}

Output:
    public Packet decodePacket(RTMP rtmp, ByteBuffer in) {
		final int remaining = in.remaining();
		if (remaining < 1) {
			rtmp.bufferDecoding(1);
			return null;
		}
		final int position = in.position();
		final byte headerByte = in.get();
		final byte channelId = RTMPUtils.decodeChannelId(headerByte);
		if (channelId < 0) {
			throw new ProtocolException("Bad channel id: " + channelId);
		}
		int headerLength = RTMPUtils.getHeaderLength(RTMPUtils.decodeHeaderSize(headerByte));
		if (headerLength > remaining) {
			if (log.isDebugEnabled()) {
				log.debug("Header too small, buffering. remaining: " + remaining);
			}
			in.position(position);
			rtmp.bufferDecoding(headerLength);
			return null;
		}
		in.position(position);
		final Header header = decodeHeader(in, rtmp
				.getLastReadHeader(channelId));
		if (header == null) {
			throw new ProtocolException("Header is null, check for error");
		}
		rtmp.setLastReadHeader(channelId, header);
		Packet packet = rtmp.getLastReadPacket(channelId);
		if (packet == null) {
			packet = new Packet(header);
			rtmp.setLastReadPacket(channelId, packet);
		}
		final ByteBuffer buf = packet.getData();
		final int addSize = (header.getTimer() == 0xffffff ? 4 : 0);
		final int readRemaining = header.getSize() + addSize - buf.position();
		final int chunkSize = rtmp.getReadChunkSize();
		final int readAmount = (readRemaining > chunkSize) ? chunkSize
				: readRemaining;
		if (in.remaining() < readAmount) {
			if (log.isDebugEnabled()) {
				log.debug("Chunk too small, buffering (" + in.remaining() + ','
						+ readAmount);
			}
			in.position(position);
			rtmp.bufferDecoding(headerLength + readAmount);
			return null;
		}
		BufferUtils.put(buf, in, readAmount);
		if (buf.position() < header.getSize() + addSize) {
			rtmp.continueDecoding();
			return null;
		}
		buf.flip();
		final IRTMPEvent message = decodeMessage(rtmp, packet.getHeader(), buf);
		packet.setMessage(message);
		if (message instanceof ChunkSize) {
			ChunkSize chunkSizeMsg = (ChunkSize) message;
			rtmp.setReadChunkSize(chunkSizeMsg.getSize());
		}
		rtmp.setLastReadPacket(channelId, null);
		return packet;
	}


Input:
	public ConfigManager(Plugin plugin) {
		this.plugin = plugin;
		FileConfiguration config = plugin.getConfig();
		config.options().copyDefaults(true);
		plugin.saveDefaultConfig();
		try {
			ConfigurationSection dreamSection = config.getConfigurationSection("dream");
			dreamWorldName = dreamSection.getString("world name");
			noAnimalSpawning = dreamSection.getBoolean("no animal spawning");
			noMonsterSpawning = dreamSection.getBoolean("no monster spawning");
			dreamChance = dreamSection.getInt("chance");
			minDurationSeconds = dreamSection.getInt("min duration in seconds");
			maxDurationSeconds = dreamSection.getInt("max duration in seconds");
			spawnRandomly = dreamSection.getBoolean("spawn randomly each time");
			dreamSpawns = SoftLocation.getFromStringList(dreamSection.getStringList("random spawns"));
			applyInitialGamemode = dreamSection.getBoolean("gamemode.apply");
			initialGamemode = GameMode.getByValue(dreamSection.getInt("gamemode.initial gamemode"));
			applyInitialHealth = dreamSection.getBoolean("health.apply");
			initialHealth = dreamSection.getInt("health.initial health");
			applyInitialHunger = dreamSection.getBoolean("hunger.apply");
			initialHunger = dreamSection.getInt("hunger.initial hunger");
			applyInitialPotionEffects = dreamSection.getBoolean("potion effects.apply");
			initialPotionEffects = new ArrayList<PotionEffect>();
			ConfigurationSection potionsSection = dreamSection.getConfigurationSection("potion effects.initial potion effects");
			if (potionsSection != null) {
				for (String type : potionsSection.getKeys(false)) {
					ConfigurationSection potionSection = potionsSection.getConfigurationSection(type);
					if (potionSection == null) continue;
					PotionEffectType potionType = PotionEffectType.getByName(type);
					if (potionType == null) {
						plugin.getLogger().warning("Invalid potion effect type '" + type + "'. Skipping this effect now. You can find a list of all possible PotionEffectTypes by googling 'bukkit PotionEffectType'.");
						continue;
					}
					initialPotionEffects.add(new PotionEffect(potionType, potionSection.getInt("duration"), potionSection.getInt("level", 1)));
				}
			}
			clearAndRestorePlayer = dreamSection.getBoolean("clear and restore player");
			purgeAfterMinutes = dreamSection.getInt("purge saved dream data after x minutes");
			ignoreIfRemainingTimeIsLowerThan = dreamSection.getInt("ignore if remaining seconds is lower than");
			ConfigurationSection fakeTimeSection = dreamSection.getConfigurationSection("fake client time");
			fakeTimeEnabled = fakeTimeSection.getBoolean("enabled") ;
			fakeTime = fakeTimeSection.getInt("time (in ticks)");
			fakeTimeRandomBounds = fakeTimeSection.getInt("random bounds");
			fakeTimeFixed = fakeTimeSection.getBoolean("fixed time");
			fakeRain = dreamSection.getBoolean("fake client weather.raining");
			ConfigurationSection disabledSection = dreamSection.getConfigurationSection("disabled");
			hungerDisabled = disabledSection.getBoolean("hunger");
			fallDamageDisabled = disabledSection.getBoolean("fall damage");
		    entityDamageDisabled = disabledSection.getBoolean("entity damage");
		    allDamageDisabled = disabledSection.getBoolean("all damage");
			weatherDisabled = disabledSection.getBoolean("weather");
			itemDroppingDisabled = disabledSection.getBoolean("item dropping");
			itemPickupDisabled = disabledSection.getBoolean("item pickup");
			blockPlacingDisabled = disabledSection.getBoolean("block placing");
			blockBreakingDisabled = disabledSection.getBoolean("block breaking");
			allowedCommands = dreamSection.getStringList("allowed commands");
			wasConfigValid = true;
		} catch (Exception e) {
			e.printStackTrace();
			wasConfigValid = false;
		}
	}

Output:
	public ConfigManager(Plugin plugin) {
		this.plugin = plugin;
		plugin.saveDefaultConfig();
		FileConfiguration config = plugin.getConfig();
		config.options().copyDefaults(true);
		try {
			ConfigurationSection dreamSection = config.getConfigurationSection("dream");
			dreamWorldName = dreamSection.getString("world name");
			noAnimalSpawning = dreamSection.getBoolean("no animal spawning");
			noMonsterSpawning = dreamSection.getBoolean("no monster spawning");
			dreamChance = dreamSection.getInt("chance");
			minDurationSeconds = dreamSection.getInt("min duration in seconds");
			maxDurationSeconds = dreamSection.getInt("max duration in seconds");
			spawnRandomly = dreamSection.getBoolean("spawn randomly each time");
			dreamSpawns = SoftLocation.getFromStringList(dreamSection.getStringList("random spawns"));
			applyInitialGamemode = dreamSection.getBoolean("gamemode.apply");
			initialGamemode = GameMode.getByValue(dreamSection.getInt("gamemode.initial gamemode"));
			applyInitialHealth = dreamSection.getBoolean("health.apply");
			initialHealth = dreamSection.getInt("health.initial health");
			applyInitialHunger = dreamSection.getBoolean("hunger.apply");
			initialHunger = dreamSection.getInt("hunger.initial hunger");
			applyInitialPotionEffects = dreamSection.getBoolean("potion effects.apply");
			initialPotionEffects = new ArrayList<PotionEffect>();
			ConfigurationSection potionsSection = dreamSection.getConfigurationSection("potion effects.initial potion effects");
			if (potionsSection != null) {
				for (String type : potionsSection.getKeys(false)) {
					ConfigurationSection potionSection = potionsSection.getConfigurationSection(type);
					if (potionSection == null) continue;
					PotionEffectType potionType = PotionEffectType.getByName(type);
					if (potionType == null) {
						plugin.getLogger().warning("Invalid potion effect type '" + type + "'. Skipping this effect now. You can find a list of all possible PotionEffectTypes by googling 'bukkit PotionEffectType'.");
						continue;
					}
					initialPotionEffects.add(new PotionEffect(potionType, potionSection.getInt("duration"), potionSection.getInt("level")));
				}
			}
			clearAndRestorePlayer = dreamSection.getBoolean("clear and restore player");
			purgeAfterMinutes = dreamSection.getInt("purge saved dream data after x minutes");
			ignoreIfRemainingTimeIsLowerThan = dreamSection.getInt("ignore if remaining seconds is lower than");
			ConfigurationSection fakeTimeSection = dreamSection.getConfigurationSection("fake client time");
			fakeTimeEnabled = fakeTimeSection.getBoolean("enabled") ;
			fakeTime = fakeTimeSection.getInt("time (in ticks)");
			fakeTimeRandomBounds = fakeTimeSection.getInt("random bounds");
			fakeTimeFixed = fakeTimeSection.getBoolean("fixed time");
			fakeRain = dreamSection.getBoolean("fake client weather.raining");
			ConfigurationSection disabledSection = dreamSection.getConfigurationSection("disabled");
			hungerDisabled = disabledSection.getBoolean("hunger");
			fallDamageDisabled = disabledSection.getBoolean("fall damage");
		    entityDamageDisabled = disabledSection.getBoolean("entity damage");
		    allDamageDisabled = disabledSection.getBoolean("all damage");
			weatherDisabled = disabledSection.getBoolean("weather");
			itemDroppingDisabled = disabledSection.getBoolean("item dropping");
			itemPickupDisabled = disabledSection.getBoolean("item pickup");
			blockPlacingDisabled = disabledSection.getBoolean("block placing");
			blockBreakingDisabled = disabledSection.getBoolean("block breaking");
			allowedCommands = dreamSection.getStringList("allowed commands");
			wasConfigValid = true;
		} catch (Exception e) {
			e.printStackTrace();
			wasConfigValid = false;
		}
	}


Input:
    public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) {
        try {
            FilePath[] files = build.getProject().getWorkspace().list("test-result/*");
            for (FilePath filePath : files) {
                filePath.delete();
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        Map<String,String> exitcodes = new HashMap<String, String>();
        String playpath = null;
        if(play_path != null && play_path.length() > 0) {
            playpath = play_path;
        } else if(getDescriptor().path()!= null){
            playpath = getDescriptor().path();
        }else{
            listener.getLogger().println("play path is null");
            return false;
        }
        listener.getLogger().println("play path is "+playpath);
        FilePath workDir = build.getWorkspace();
        String application_path = ((PlayAutoTestJobProperty)build.getProject().getProperty(PlayAutoTestJobProperty.class)).getApplication_path();
        if (application_path!= null && application_path.length() > 0) {
            workDir = build.getWorkspace().child(application_path);
        }
        try {
            for(String play_cmd : this.play_cmds){
                if(play_cmd!=null && play_cmd.length()==0) continue;
                listener.getLogger().println("Substituting job parameters from " + play_cmd);
                ParametersAction param = build.getAction(hudson.model.ParametersAction.class);
                List<ParameterValue> values = param.getParameters();
                if (values != null) {
                    for (ParameterValue value : values) {
                        String v = value.createVariableResolver(build).resolve(value.getName());
                        play_cmd = play_cmd.replace("${" + value.getName() + "}", v);
                    }
                }
                String[] cmds= play_cmd.split(" ",2);
                String cmd = playpath + " " + cmds[0] +" "+workDir.toString()+" "+(cmds.length>=2? cmds[1]:"");
                listener.getLogger().println("Executing " + cmd);
                Proc proc = launcher.launch(cmd, new String[0],listener.getLogger(),workDir);
                int exitcode = proc.join();
                exitcodes.put(play_cmd, (exitcode==0? "Done":"Fail"));
                if(exitcode!=0) {
                    listener.getLogger().println("****************************************************");
                    listener.getLogger().println("* ERROR!!! while executing "+play_cmd);
                    listener.getLogger().println("****************************************************");
                    return false;
                }
                if("auto-test".equalsIgnoreCase(play_cmd)){
                    if(! new File(workDir.toString()+"/test-result/result.passed").exists()){
                        build.setResult(Result.UNSTABLE);
                    }
                }
            }
            listener.getLogger().println("Each commands' results:");
            for(Map.Entry<String, String> rec : exitcodes.entrySet()){
                listener.getLogger().println("  "+rec.getKey()+": "+rec.getValue());
            }
            return exitcodes.containsValue("Fail")? false : true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

Output:
    public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) {
        try {
            FilePath[] files = build.getProject().getWorkspace().list("test-result/*");
            for (FilePath filePath : files) {
                filePath.delete();
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        Map<String,String> exitcodes = new HashMap<String, String>();
        String playpath = null;
        if(play_path != null && play_path.length() > 0) {
            playpath = play_path;
        } else if(getDescriptor().path()!= null){
            playpath = getDescriptor().path();
        }else{
            listener.getLogger().println("play path is null");
            return false;
        }
        listener.getLogger().println("play path is "+playpath);
        FilePath workDir = build.getWorkspace();
        String application_path = ((PlayAutoTestJobProperty)build.getProject().getProperty(PlayAutoTestJobProperty.class)).getApplication_path();
        if (application_path!= null && application_path.length() > 0) {
            workDir = build.getWorkspace().child(application_path);
        }
        try {
            for(String play_cmd : this.play_cmds){
                if(play_cmd!=null && play_cmd.length()==0) continue;
                listener.getLogger().println("Substituting job parameters from " + play_cmd);
                ParametersAction param = build.getAction(hudson.model.ParametersAction.class);
                List<ParameterValue> values = param.getParameters();
                if (values != null) {
                    for (ParameterValue value : values) {
                        String v = value.createVariableResolver(build).resolve(value.getName());
                        play_cmd = play_cmd.replace("${" + value.getName() + "}", v);
                    }
                }
                String[] cmds= play_cmd.split(" ",2);
                String cmd = playpath + " " + cmds[0] +" \""+workDir.toString()+"\" "+(cmds.length>=2? cmds[1]:"");
                listener.getLogger().println("Executing " + cmd);
                Proc proc = launcher.launch(cmd, new String[0],listener.getLogger(),workDir);
                int exitcode = proc.join();
                exitcodes.put(play_cmd, (exitcode==0? "Done":"Fail"));
                if(exitcode!=0) {
                    listener.getLogger().println("****************************************************");
                    listener.getLogger().println("* ERROR!!! while executing "+play_cmd);
                    listener.getLogger().println("****************************************************");
                    return false;
                }
                if("auto-test".equalsIgnoreCase(play_cmd)){
                    if(! new File(workDir.toString()+"/test-result/result.passed").exists()){
                        build.setResult(Result.UNSTABLE);
                    }
                }
            }
            listener.getLogger().println("Each commands' results:");
            for(Map.Entry<String, String> rec : exitcodes.entrySet()){
                listener.getLogger().println("  "+rec.getKey()+": "+rec.getValue());
            }
            return exitcodes.containsValue("Fail")? false : true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }


Input:
	public void testSendReceive() throws Exception {
		String sendTxt;
		String expectTxt;
		InputStream in;
		sendTxt = "This is my text";
		expectTxt = sendTxt.length() + "\n" + sendTxt;
		byte[] result = new byte[sendTxt.length()];
		PipedInputStream pIn;
		PipedOutputStream pOut;
		pIn = new PipedInputStream();
		pOut = new PipedOutputStream(pIn);
		in = new BufferedInputStream(pIn,sendTxt.length());
		pOut.write(sendTxt.getBytes());
		file1.receiveFrom(in,new NullProgressMonitor(),sendTxt.length(),false,false);
		in.close();
		pOut.close();
		result = new byte[expectTxt.length()];
		pIn = new PipedInputStream();
		pOut = new PipedOutputStream(pIn);
		in = new BufferedInputStream(pIn,sendTxt.length());
		file1.sendTo(pOut,new NullProgressMonitor(),false);
		in.read(result);
		in.close();
		pOut.close();
		assertEquals(new String(result),expectTxt);
	}

Output:
	public void testSendReceive() throws Exception {
		String sendTxt;
		String expectTxt;
		InputStream in;
		sendTxt = "This is my text";
		expectTxt = sendTxt.length() + "\n" + sendTxt;
		byte[] result = new byte[sendTxt.length()];
		PipedInputStream pIn;
		PipedOutputStream pOut;
		pIn = new PipedInputStream();
		pOut = new PipedOutputStream(pIn);
		in = new BufferedInputStream(pIn,sendTxt.length());
		pOut.write(sendTxt.getBytes());
		file1.receiveFrom(in,sendTxt.length(),false,false, new NullProgressMonitor());
		in.close();
		pOut.close();
		result = new byte[expectTxt.length()];
		pIn = new PipedInputStream();
		pOut = new PipedOutputStream(pIn);
		in = new BufferedInputStream(pIn,sendTxt.length());
		file1.sendTo(pOut,false, new NullProgressMonitor());
		in.read(result);
		in.close();
		pOut.close();
		assertEquals(new String(result),expectTxt);
	}


Input:
	protected String computeIdentifierPrefix(int offset) {
		final AbstractDocument document = (AbstractDocument) getSourceViewer().getDocument();
		if (offset <= 0 || offset > document.getLength()) {
			return "";
		}
		try {
			ITypedRegion partition = document.getPartition(getEditor().getPartitioning().getPartitioning(), offset, true);
			if (partition.getType() == IRDocumentPartitions.R_QUOTED_SYMBOL) {
				offset = partition.getOffset();
			}
			int goodStart = offset;
			SEARCH_START: while (offset > 0) {
				final char c = document.getChar(offset - 1);
				if (RTokens.isRobustSeparator(c, false)) {
					switch (c) {
					case ':':
					case '$':
					case '@':
						offset --;
						continue SEARCH_START;
					case ' ':
					case '\t':
						if (offset >= 2) {
							final char c2 = document.getChar(offset - 2);
							if ((offset == getInvocationOffset()) ?
									!RTokens.isRobustSeparator(c, false) :
									(c2 == ':' && c2 == '$' && c2 == '@')) {
								offset -= 2;
								continue SEARCH_START;
							}
						}
						break SEARCH_START;
					case '`':
						partition = document.getPartition(getEditor().getPartitioning().getPartitioning(), offset, false);
						if (partition.getType() == IRDocumentPartitions.R_QUOTED_SYMBOL) {
							offset = goodStart = partition.getOffset();
							continue SEARCH_START;
						}
						else {
							break SEARCH_START;
						}
					default:
						break SEARCH_START;
					}
				}
				else {
					offset --;
					goodStart = offset;
					continue SEARCH_START;
				}
			}
			return document.get(offset, getInvocationOffset() - goodStart);
		}
		catch (final BadLocationException e) {
		}
		catch (final BadPartitioningException e) {
		}
		return "";
	}

Output:
	protected String computeIdentifierPrefix(int offset) {
		final AbstractDocument document = (AbstractDocument) getSourceViewer().getDocument();
		if (offset <= 0 || offset > document.getLength()) {
			return "";
		}
		try {
			ITypedRegion partition = document.getPartition(getEditor().getPartitioning().getPartitioning(), offset, true);
			if (partition.getType() == IRDocumentPartitions.R_QUOTED_SYMBOL) {
				offset = partition.getOffset();
			}
			int goodStart = offset;
			SEARCH_START: while (offset > 0) {
				final char c = document.getChar(offset - 1);
				if (RTokens.isRobustSeparator(c, false)) {
					switch (c) {
					case ':':
					case '$':
					case '@':
						offset --;
						continue SEARCH_START;
					case ' ':
					case '\t':
						if (offset >= 2) {
							final char c2 = document.getChar(offset - 2);
							if ((offset == getInvocationOffset()) ?
									!RTokens.isRobustSeparator(c, false) :
									(c2 == ':' && c2 == '$' && c2 == '@')) {
								offset -= 2;
								continue SEARCH_START;
							}
						}
						break SEARCH_START;
					case '`':
						partition = document.getPartition(getEditor().getPartitioning().getPartitioning(), offset - 1, false);
						if (partition.getType() == IRDocumentPartitions.R_QUOTED_SYMBOL) {
							offset = goodStart = partition.getOffset();
							continue SEARCH_START;
						}
						else {
							break SEARCH_START;
						}
					default:
						break SEARCH_START;
					}
				}
				else {
					offset --;
					goodStart = offset;
					continue SEARCH_START;
				}
			}
			return document.get(offset, getInvocationOffset() - goodStart);
		}
		catch (final BadLocationException e) {
		}
		catch (final BadPartitioningException e) {
		}
		return "";
	}


Input:
	public void initComponentActivity(Body body) {
		if (!init) {
			this.logger = LoggerFactory.getLogger(this.getClass());
			logger.info("Initialising {} component.", this.getClass().getSimpleName());
			eleGenerator = new EleGeneratorForConstructQuery();
			try {
				String address = Constants.getProperties().getProperty("platfomservices.querydispatchapi.endpoint");
				soapServer = Endpoint.publish(address, this);
				logger.info("QueryDispatch SOAP service started at {}.", address);
			} catch (Exception e) {
				logger.error("Exception while publishing QueryDispatch SOAP Service", e);
			}
			try {
				restServer = new PlayPlatformservicesRest(this);
	        	logger.info(String.format("QueryDispatch REST service started with WADL available at "
	        			+ "%sapplication.wadl\n", PlayPlatformservicesRest.BASE_URI));
			} catch (ProcessingException e) {
				logger.error("Exception while publishing QueryDispatch REST Service", e);
			}
			this.init = true;
		}
	}

Output:
	public void initComponentActivity(Body body) {
		if (!init) {
			this.logger = LoggerFactory.getLogger(this.getClass());
			logger.info("Initialising {} component.", this.getClass().getSimpleName());
			eleGenerator = new EleGeneratorForConstructQuery();
			try {
				String address = Constants.getProperties().getProperty("platfomservices.querydispatchapi.endpoint");
				soapServer = Endpoint.publish(address, this);
				logger.info("QueryDispatch SOAP service started at {}.", address);
			} catch (Exception e) {
				logger.error("Exception while publishing QueryDispatch SOAP Service", e);
			}
			try {
				restServer = new PlayPlatformservicesRest(this);
	        	logger.info(String.format("QueryDispatch REST service started at %s with WADL remotely available at "
	        			+ "%sapplication.wadl\n", PlayPlatformservicesRest.BASE_URI, Constants.getProperties().getProperty("platfomservices.querydispatchapi.rest")));
			} catch (ProcessingException e) {
				logger.error("Exception while publishing QueryDispatch REST Service", e);
			}
			this.init = true;
		}
	}


Input:
	public IStatus validate(IValidationContext ctx) {
		EObject eObj = ctx.getTarget();
		if (eObj instanceof Task) {
			Task ta = (Task) eObj;
			if (ta.getExtensionValues() != null && ta.getExtensionValues().size() > 0) {
				boolean foundDistributionType = false;
				String distributionTypeValue = "";
				boolean foundDuration = false;
				boolean foundTimeUnits = false;
				boolean foundRange = false;
				boolean foundStandardDeviation = false;
				for (ExtensionAttributeValue extattrval : ta.getExtensionValues()) {
					FeatureMap extensionElements = extattrval.getValue();
					if (extensionElements == null) {
					    continue;
					}
					@SuppressWarnings("unchecked")
					List<MetadataType> metadataTypeExtensions = (List<MetadataType>) extensionElements.get(
							DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, true);
					if (metadataTypeExtensions != null && metadataTypeExtensions.size() > 0) {
						MetadataType metaType = metadataTypeExtensions.get(0);
						for (Object metaEntryObj : metaType.getMetaentry()) {
							MetaentryType entry = (MetaentryType) metaEntryObj;
							if (entry.getName() != null && entry.getName().equals("costpertimeunit")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Cost per Time Unit value must be positive");
								}
							}
							if (entry.getName() != null && entry.getName().equals("distributiontype")) {
								foundDistributionType = true;
								distributionTypeValue = entry.getValue();
							}
							if (entry.getName() != null && entry.getName().equals("duration")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Duration value must be positive");
								}
								foundDuration = true;
							}
							if (entry.getName() != null && entry.getName().equals("timeunit")) {
								foundTimeUnits = true;
							}
							if (entry.getName() != null && entry.getName().equals("workinghours")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Working Hours value must be positive");
								}
							}
							if (entry.getName() != null && entry.getName().equals("range")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Range value must be positive");
								}
								foundRange = true;
							}
							if (entry.getName() != null && entry.getName().equals("standarddeviation")) {
								foundStandardDeviation = true;
							}
						}
					}
				}
				if (!foundDistributionType) {
					ctx.createFailureStatus("Task has no distribution type defined");
				}
				if (!foundDuration) {
					ctx.createFailureStatus("Task has no duration defined");
				}
				if (!foundTimeUnits) {
					ctx.createFailureStatus("Task has no Time Units defined");
				}
				if (foundDistributionType) {
					if ((distributionTypeValue.equals("random") || distributionTypeValue.equals("uniform"))
							&& !foundRange) {
						ctx.createFailureStatus("Task has no Range defined");
					}
					if (distributionTypeValue.equals("normal") && !foundStandardDeviation) {
						ctx.createFailureStatus("Task has no Standard Deviation defined");
					}
				}
			}
		}
		return ctx.createSuccessStatus();
	}

Output:
	public IStatus validate(IValidationContext ctx) {
		EObject eObj = ctx.getTarget();
		if (eObj instanceof Task) {
			Task ta = (Task) eObj;
			if (ta.getExtensionValues() != null && ta.getExtensionValues().size() > 0) {
				boolean foundDistributionType = false;
				String distributionTypeValue = "";
				boolean foundDuration = false;
				boolean foundTimeUnits = false;
				boolean foundRange = false;
				boolean foundStandardDeviation = false;
				for (ExtensionAttributeValue extattrval : ta.getExtensionValues()) {
					FeatureMap extensionElements = extattrval.getValue();
					if (extensionElements == null) {
					    continue;
					}
					@SuppressWarnings("unchecked")
					List<MetadataType> metadataTypeExtensions = null;
					try {
						metadataTypeExtensions = (List<MetadataType>) extensionElements.get(
							DroolsPackage.Literals.DOCUMENT_ROOT__METADATA, true);
					}
					catch (Exception e) {
						continue;
					}
					if (metadataTypeExtensions != null && metadataTypeExtensions.size() > 0) {
						MetadataType metaType = metadataTypeExtensions.get(0);
						for (Object metaEntryObj : metaType.getMetaentry()) {
							MetaentryType entry = (MetaentryType) metaEntryObj;
							if (entry.getName() != null && entry.getName().equals("costpertimeunit")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Cost per Time Unit value must be positive");
								}
							}
							if (entry.getName() != null && entry.getName().equals("distributiontype")) {
								foundDistributionType = true;
								distributionTypeValue = entry.getValue();
							}
							if (entry.getName() != null && entry.getName().equals("duration")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Duration value must be positive");
								}
								foundDuration = true;
							}
							if (entry.getName() != null && entry.getName().equals("timeunit")) {
								foundTimeUnits = true;
							}
							if (entry.getName() != null && entry.getName().equals("workinghours")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Working Hours value must be positive");
								}
							}
							if (entry.getName() != null && entry.getName().equals("range")) {
								Float f = new Float(entry.getValue());
								if (f.floatValue() < 0) {
									ctx.createFailureStatus("Range value must be positive");
								}
								foundRange = true;
							}
							if (entry.getName() != null && entry.getName().equals("standarddeviation")) {
								foundStandardDeviation = true;
							}
						}
					}
				}
				if (!foundDistributionType) {
					ctx.createFailureStatus("Task has no distribution type defined");
				}
				if (!foundDuration) {
					ctx.createFailureStatus("Task has no duration defined");
				}
				if (!foundTimeUnits) {
					ctx.createFailureStatus("Task has no Time Units defined");
				}
				if (foundDistributionType) {
					if ((distributionTypeValue.equals("random") || distributionTypeValue.equals("uniform"))
							&& !foundRange) {
						ctx.createFailureStatus("Task has no Range defined");
					}
					if (distributionTypeValue.equals("normal") && !foundStandardDeviation) {
						ctx.createFailureStatus("Task has no Standard Deviation defined");
					}
				}
			}
		}
		return ctx.createSuccessStatus();
	}


Input:
	public void initialize(){
		float sf = this.backgroundScaleFactor;
		InvisibleWalls walls = new InvisibleWalls(sf*52f, sf*52f, sf*550f, sf*52f, this.background);
		map = new Map(walls);
		this.game = new Game(background);
		this.game.addEntity(map);
		this.game.addEntities(map.walkers);
		this.gameProcess = new GameProcess(game, this.engine, this.starWarsScene);
		this.touchProcess = new TouchProcess(game, this.starWarsScene, this.context);
		this.playersCommandsProcess = new WalkersProcess(game,map);
		this.lasersProcess = new LaserBeamsProcess(game,map);
		this.renderPlayersProcess = new RenderWalkersProcess(game, this.background);
		this.renderBallsProcess = new RenderLaserProcess(game, this.background);
		this.bubblesBallsProcess = new RenderBubbleProcess(game, this.background);
		game.addProcess(this.gameProcess, 1);
		game.addProcess(this.touchProcess, 10);
		game.addProcess(this.lasersProcess, 20);
		game.addProcess(this.playersCommandsProcess, 21);
		game.addProcess(this.renderPlayersProcess, 98);
		game.addProcess(this.renderBallsProcess, 99);
		game.addProcess(this.bubblesBallsProcess, 99);
	}

Output:
	public void initialize(){
		float sf = this.backgroundScaleFactor;
		InvisibleWalls walls = new InvisibleWalls(sf*52f, sf*52f, sf*600f, sf*52f, this.background);
		map = new Map(walls);
		this.game = new Game(background);
		this.game.addEntity(map);
		this.game.addEntities(map.walkers);
		this.gameProcess = new GameProcess(game, this.engine, this.starWarsScene);
		this.touchProcess = new TouchProcess(game, this.starWarsScene, this.context);
		this.playersCommandsProcess = new WalkersProcess(game,map);
		this.lasersProcess = new LaserBeamsProcess(game,map);
		this.renderPlayersProcess = new RenderWalkersProcess(game, this.background);
		this.renderBallsProcess = new RenderLaserProcess(game, this.background);
		this.bubblesBallsProcess = new RenderBubbleProcess(game, this.background);
		game.addProcess(this.gameProcess, 1);
		game.addProcess(this.touchProcess, 10);
		game.addProcess(this.lasersProcess, 20);
		game.addProcess(this.playersCommandsProcess, 21);
		game.addProcess(this.renderPlayersProcess, 98);
		game.addProcess(this.renderBallsProcess, 99);
		game.addProcess(this.bubblesBallsProcess, 99);
	}


Input:
	protected void onDraw(Canvas canvas) {
		if(screen_mode==Configuration.ORIENTATION_PORTRAIT){
			canvas.drawRect(0, 0, gap/2, unit_width*0.75f, marginPaint);
			canvas.drawRect(gap/2, 0, screen_width/5-gap/2, unit_width*0.75f, mPaint);
			canvas.drawRect(screen_width/5-gap/2, 0, screen_width/5, unit_width*0.75f, marginPaint);
			canvas.drawLine(0, unit_width*0.75f+strokeWdith/2, screen_width/5, unit_width*0.75f+strokeWdith/2, linePaint);
		}else{
			canvas.drawRect(0, 0, gap/2, getMeasuredHeight(), marginPaint);
			canvas.drawRect(0, 0, getMeasuredWidth(),gap/2, marginPaint);
			canvas.drawRect(gap/2, 0, getMeasuredWidth()-gap/2, getMeasuredHeight()-gap/2, mPaint);
			canvas.drawRect(0, getMeasuredWidth()-gap/2, getMeasuredWidth(), getMeasuredHeight(), marginPaint);
			canvas.drawRect(screen_width/5-gap/2, 0, screen_width/5, getMeasuredHeight(), marginPaint);
			canvas.drawLine(getMeasuredWidth()-gap/2+strokeWdith/2, 0, getMeasuredWidth()-gap/2+strokeWdith/2, getMeasuredHeight(), linePaint);
		}
		super.onDraw(canvas);
	}

Output:
	protected void onDraw(Canvas canvas) {
		if(screen_mode==Configuration.ORIENTATION_PORTRAIT){
			canvas.drawRect(0, 0, gap/2, unit_width*0.75f, marginPaint);
			canvas.drawRect(gap/2, 0, screen_width/5-gap/2, unit_width*0.75f, mPaint);
			canvas.drawRect(screen_width/5-gap/2, 0, screen_width/5, unit_width*0.75f, marginPaint);
			canvas.drawLine(0, unit_width*0.75f+strokeWdith/2, screen_width/5, unit_width*0.75f+strokeWdith/2, linePaint);
		}else{
			canvas.drawRect(0, 0, gap/2, getMeasuredHeight(), marginPaint);
			canvas.drawRect(0, 0, getMeasuredWidth(),gap/2, marginPaint);
			canvas.drawRect(gap/2, 0, getMeasuredWidth()-gap/2, getMeasuredHeight()-gap/2, mPaint);
			canvas.drawRect(gap/2, getMeasuredHeight(), screen_width/5, getMeasuredHeight(), marginPaint);
			canvas.drawRect(screen_width/5-gap/2, 0, screen_width/5, getMeasuredHeight(), marginPaint);
			canvas.drawLine(getMeasuredWidth()-gap/2+strokeWdith/2, 0, getMeasuredWidth()-gap/2+strokeWdith/2, getMeasuredHeight(), linePaint);
		}
		super.onDraw(canvas);
	}


Input:
    public void event(SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event) {
        GELFMessage gelf = new GELFMessage();
        if (event instanceof GraylogSyslogServerEvent) {
            GraylogSyslogServerEvent glEvent = (GraylogSyslogServerEvent) event;
            LOG.debug("Received syslog message (via AMQP): " + event.getMessage());
            LOG.debug("AMQP queue: " + glEvent.getAmqpReceiverQueue());
            gelf.addAdditionalData("_amqp_queue", glEvent.getAmqpReceiverQueue());
        } else {
            LOG.debug("Received syslog message: " + event.getMessage());
        }
        LOG.debug("Host: " + event.getHost());
        LOG.debug("Facility: " + event.getFacility() + " (" + Tools.syslogFacilityToReadable(event.getFacility()) + ")");
        LOG.debug("Level: " + event.getLevel() + " (" + Tools.syslogLevelToReadable(event.getLevel()) + ")");
        LOG.debug("Raw: " + new String(event.getRaw()));
        if (event.getDate() == null) {
            LOG.info("Syslog message is missing date or could not be parsed. Not further handling. Message was: " + event.getRaw());
            return;
        }
        try {
            gelf.setCreatedAt(Tools.getUTCTimestampWithMilliseconds(event.getDate().getTime()));
            gelf.setConvertedFromSyslog(true);
            gelf.setVersion("0");
            gelf.setShortMessage(event.getMessage());
            gelf.setHost(event.getHost());
            gelf.setFacility(Tools.syslogFacilityToReadable(event.getFacility()));
            gelf.setLevel(event.getLevel());
            gelf.setRaw(event.getRaw());
        } catch (Exception e) {
            LOG.info("Could not parse syslog message to GELF: " + e.toString(), e);
            return;
        }
        if (gelf.allRequiredFieldsSet()) {
            try {
                SimpleGELFClientHandler gelfHandler = new SimpleGELFClientHandler(gelf);
                gelfHandler.handle();
            } catch (Exception e) {
                LOG.debug("Couldn't process message with GELF handler", e);
            }
        } else {
            LOG.info("Broken or incomplete syslog message. Not further handling. Message was: " + event.getRaw());
        }
    }

Output:
    public void event(SyslogServerIF syslogServer, SocketAddress socketAddress, SyslogServerEventIF event) {
        GELFMessage gelf = new GELFMessage();
        if (event instanceof GraylogSyslogServerEvent) {
            GraylogSyslogServerEvent glEvent = (GraylogSyslogServerEvent) event;
            LOG.debug("Received syslog message (via AMQP): " + event.getMessage());
            LOG.debug("AMQP queue: " + glEvent.getAmqpReceiverQueue());
            gelf.addAdditionalData("_amqp_queue", glEvent.getAmqpReceiverQueue());
        } else {
            LOG.debug("Received syslog message: " + event.getMessage());
        }
        LOG.debug("Host: " + event.getHost());
        LOG.debug("Facility: " + event.getFacility() + " (" + Tools.syslogFacilityToReadable(event.getFacility()) + ")");
        LOG.debug("Level: " + event.getLevel() + " (" + Tools.syslogLevelToReadable(event.getLevel()) + ")");
        LOG.debug("Raw: " + new String(event.getRaw()));
        if (event.getDate() == null) {
            LOG.info("Syslog message is missing date or could not be parsed. Not further handling. Message was: " + event.getRaw());
            return;
        }
        try {
            gelf.setCreatedAt(Tools.getUTCTimestampWithMilliseconds(event.getDate().getTime()));
            gelf.setConvertedFromSyslog(true);
            gelf.setVersion("0");
            gelf.setShortMessage(event.getMessage());
            gelf.setFullMessage(new String(event.getRaw()));
            gelf.setHost(event.getHost());
            gelf.setFacility(Tools.syslogFacilityToReadable(event.getFacility()));
            gelf.setLevel(event.getLevel());
            gelf.setRaw(event.getRaw());
        } catch (Exception e) {
            LOG.info("Could not parse syslog message to GELF: " + e.toString(), e);
            return;
        }
        if (gelf.allRequiredFieldsSet()) {
            try {
                SimpleGELFClientHandler gelfHandler = new SimpleGELFClientHandler(gelf);
                gelfHandler.handle();
            } catch (Exception e) {
                LOG.debug("Couldn't process message with GELF handler", e);
            }
        } else {
            LOG.info("Broken or incomplete syslog message. Not further handling. Message was: " + event.getRaw());
        }
    }


Input:
    public void execute() throws MojoExecutionException, MojoFailureException {
        checkParameters();
        final File thriftSourceRoot = getThriftSourceRoot();
        if (thriftSourceRoot.exists()) {
            try {
                ImmutableSet<File> thriftFiles = findThriftFilesInDirectory(thriftSourceRoot);
                final File outputDirectory = getOutputDirectory();
                ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
                if (thriftFiles.isEmpty()) {
                    getLog().info("No thrift files to compile.");
                } else if (checkStaleness && ((lastModified(thriftFiles) + staleMillis) < lastModified(outputFiles))) {
                    getLog().info("Skipping compilation because target directory newer than sources.");
                } else {
                    ImmutableSet<File> derivedThriftPathElements =
                            makeThriftPathFromJars(temporaryThriftFileDirectory, getDependencyArtifactFiles());
                    outputDirectory.mkdirs();
                    cleanDirectory(outputDirectory);
                    Thrift thrift = new Thrift.Builder(thriftExecutable, outputDirectory)
                            .setGenerator(generator)
                            .addThriftPathElement(thriftSourceRoot)
                            .addThriftPathElements(derivedThriftPathElements)
                            .addThriftPathElements(asList(additionalThriftPathElements))
                            .addThriftFiles(thriftFiles)
                            .build();
                    final int exitStatus = thrift.compile();
                    if (exitStatus != 0) {
                        getLog().error("thrift failed output: " + thrift.getOutput());
                        getLog().error("thrift failed error: " + thrift.getError());
                        throw new MojoFailureException(
                                "thrift did not exit cleanly. Review output for more information.");
                    }
                    attachFiles();
                }
            } catch (IOException e) {
                throw new MojoExecutionException("An IO error occured", e);
            } catch (IllegalArgumentException e) {
                throw new MojoFailureException("thrift failed to execute because: " + e.getMessage(), e);
            } catch (CommandLineException e) {
                throw new MojoExecutionException("An error occurred while invoking thrift.", e);
            }
        } else {
            getLog().info(format("%s does not exist. Review the configuration or consider disabling the plugin.",
                    thriftSourceRoot));
        }
    }

Output:
    public void execute() throws MojoExecutionException, MojoFailureException {
        checkParameters();
        final File thriftSourceRoot = getThriftSourceRoot();
        if (thriftSourceRoot.exists()) {
            try {
                ImmutableSet<File> thriftFiles = findThriftFilesInDirectory(thriftSourceRoot);
                final File outputDirectory = getOutputDirectory();
                ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
                if (thriftFiles.isEmpty()) {
                    getLog().info("No thrift files to compile.");
                } else if (checkStaleness && ((lastModified(thriftFiles) + staleMillis) < lastModified(outputFiles))) {
                    getLog().info("Skipping compilation because target directory newer than sources.");
                    attachFiles();
                } else {
                    ImmutableSet<File> derivedThriftPathElements =
                            makeThriftPathFromJars(temporaryThriftFileDirectory, getDependencyArtifactFiles());
                    outputDirectory.mkdirs();
                    cleanDirectory(outputDirectory);
                    Thrift thrift = new Thrift.Builder(thriftExecutable, outputDirectory)
                            .setGenerator(generator)
                            .addThriftPathElement(thriftSourceRoot)
                            .addThriftPathElements(derivedThriftPathElements)
                            .addThriftPathElements(asList(additionalThriftPathElements))
                            .addThriftFiles(thriftFiles)
                            .build();
                    final int exitStatus = thrift.compile();
                    if (exitStatus != 0) {
                        getLog().error("thrift failed output: " + thrift.getOutput());
                        getLog().error("thrift failed error: " + thrift.getError());
                        throw new MojoFailureException(
                                "thrift did not exit cleanly. Review output for more information.");
                    }
                    attachFiles();
                }
            } catch (IOException e) {
                throw new MojoExecutionException("An IO error occured", e);
            } catch (IllegalArgumentException e) {
                throw new MojoFailureException("thrift failed to execute because: " + e.getMessage(), e);
            } catch (CommandLineException e) {
                throw new MojoExecutionException("An error occurred while invoking thrift.", e);
            }
        } else {
            getLog().info(format("%s does not exist. Review the configuration or consider disabling the plugin.",
                    thriftSourceRoot));
        }
    }


Input:
    protected Layer doInBackground(ProgressMonitor pm) throws Exception {
        try {
            pm.beginTask("Reading shapes", ProgressMonitor.UNKNOWN);
            final ProductSceneView sceneView = context.getAppContext().getSelectedProductSceneView();
            CoordinateReferenceSystem targetCrs = (CoordinateReferenceSystem) context.getLayerContext().getCoordinateReferenceSystem();
            final Geometry clipGeometry = ShapefileUtils.createGeoBoundaryPolygon(sceneView.getRaster());
            File file = new File((String) context.getPropertyValue(ShapefileLayerSource.PROPERTY_NAME_FILE_PATH));
            Object featureCollectionValue = context.getPropertyValue(ShapefileLayerSource.PROPERTY_NAME_FEATURE_COLLECTION);
            FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection;
            if (featureCollectionValue == null) {
                featureCollection = ShapefileUtils.createFeatureCollection(file.toURI().toURL(), targetCrs, clipGeometry);
            } else {
                featureCollection = (FeatureCollection<SimpleFeatureType, SimpleFeature>) featureCollectionValue;
            }
            Style[] styles = getStyles(file, featureCollection);
            Style selectedStyle = getSelectedStyle(styles);
            final LayerType type = LayerType.getLayerType(FeatureLayerType.class.getName());
            final ValueContainer configuration = type.getConfigurationTemplate();
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_URL, file.toURI().toURL());
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CRS, targetCrs);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CLIP_GEOMETRY, clipGeometry);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION, featureCollection);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_SLD_STYLE, selectedStyle);
            Layer featureLayer = type.createLayer(sceneView.getLayerContext(), configuration);
            featureLayer.setName(file.getName());
            featureLayer.setVisible(true);
            return featureLayer;
        } finally {
            pm.done();
        }
    }

Output:
    protected Layer doInBackground(ProgressMonitor pm) throws Exception {
        try {
            pm.beginTask("Reading shapes", ProgressMonitor.UNKNOWN);
            final ProductSceneView sceneView = context.getAppContext().getSelectedProductSceneView();
            CoordinateReferenceSystem targetCrs = (CoordinateReferenceSystem) context.getLayerContext().getCoordinateReferenceSystem();
            final Geometry clipGeometry = ShapefileUtils.createGeoBoundaryPolygon(sceneView.getRaster());
            File file = new File((String) context.getPropertyValue(ShapefileLayerSource.PROPERTY_NAME_FILE_PATH));
            Object featureCollectionValue = context.getPropertyValue(ShapefileLayerSource.PROPERTY_NAME_FEATURE_COLLECTION);
            FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection;
            if (featureCollectionValue == null) {
                featureCollection = ShapefileUtils.createFeatureCollection(file.toURI().toURL(), targetCrs, clipGeometry);
            } else {
                featureCollection = (FeatureCollection<SimpleFeatureType, SimpleFeature>) featureCollectionValue;
            }
            Style[] styles = getStyles(file, featureCollection);
            Style selectedStyle = getSelectedStyle(styles);
            final LayerType type = LayerType.getLayerType(FeatureLayerType.class.getName());
            final ValueContainer configuration = type.getConfigurationTemplate();
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_URL, file.toURI().toURL());
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CRS, targetCrs);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION_CLIP_GEOMETRY, clipGeometry);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_FEATURE_COLLECTION, featureCollection);
            configuration.setValue(FeatureLayerType.PROPERTY_NAME_SLD_STYLE, selectedStyle);
            Layer featureLayer = type.createLayer(sceneView, configuration);
            featureLayer.setName(file.getName());
            featureLayer.setVisible(true);
            return featureLayer;
        } finally {
            pm.done();
        }
    }


Input:
	public void doWrite(Query query) throws Exception {
		Socket socket = null;
		statusLock.lock();
		try {
			while(status == GraphiteWriterStatus.STARTING) {
				statusConditionStarted.await();
			}
			if (status != GraphiteWriterStatus.STARTED) {
				throw new LifecycleException("GraphiteWriter instance should be started");
			}
			socket = (Socket) pool.borrowObject(address);
		} finally {
			statusLock.unlock();
		}
		try {
			PrintWriter writer = new PrintWriter(socket.getOutputStream(), true);
			List<String> typeNames = this.getTypeNames();
			for (Result result : query.getResults()) {
				if (isDebugEnabled()) {
					log.debug("Query result: " + result.toString());
				}
				Map<String, Object> resultValues = result.getValues();
				if (resultValues != null) {
					for (Entry<String, Object> values : resultValues.entrySet()) {
                        Object value = values.getValue();
                        if (JmxUtils.isNumeric(value)) {
							StringBuilder sb = new StringBuilder();
							sb.append(JmxUtils.getKeyString(query, result, values, typeNames, rootPrefix).replaceAll("[()]", "_"));
							sb.append(" ");
							sb.append(value.toString());
							sb.append(" ");
							sb.append(result.getEpoch() / 1000);
							sb.append("\n");
							String line = sb.toString();
							if (isDebugEnabled()) {
								log.debug("Graphite Message: " + line.trim());
							}
							writer.write(line);
							writer.flush();
						} else {
                            if (log.isWarnEnabled()) {
                                log.warn("Unable to submit non-numeric value to Graphite: \"" + value + "\" from result " + result);
                            }
                        }
					}
				}
			}
		} finally {
			pool.returnObject(address, socket);
		}
	}

Output:
	public void doWrite(Query query) throws Exception {
		Socket socket = null;
		statusLock.lock();
		try {
			while (status == GraphiteWriterStatus.STARTING) {
				statusConditionStarted.await();
			}
			if (status != GraphiteWriterStatus.STARTED) {
				throw new LifecycleException("GraphiteWriter instance should be started");
			}
			socket = (Socket) pool.borrowObject(address);
		} finally {
			statusLock.unlock();
		}
		try {
			PrintWriter writer = new PrintWriter(socket.getOutputStream(), true);
			List<String> typeNames = this.getTypeNames();
			for (Result result : query.getResults()) {
				if (isDebugEnabled()) {
					log.debug("Query result: " + result.toString());
				}
				Map<String, Object> resultValues = result.getValues();
				if (resultValues != null) {
					for (Entry<String, Object> values : resultValues.entrySet()) {
						Object value = values.getValue();
						if (JmxUtils.isNumeric(value)) {
							StringBuilder sb = new StringBuilder();
							sb.append(JmxUtils.getKeyString(query, result, values, typeNames, rootPrefix).replaceAll("[()]", "_"));
							sb.append(" ");
							sb.append(value.toString());
							sb.append(" ");
							sb.append(result.getEpoch() / 1000);
							sb.append("\n");
							String line = sb.toString();
							if (isDebugEnabled()) {
								log.debug("Graphite Message: " + line.trim());
							}
							writer.write(line);
							writer.flush();
						} else {
							if (log.isWarnEnabled()) {
								log.warn("Unable to submit non-numeric value to Graphite: \"" + value + "\" from result " + result);
							}
						}
					}
				}
			}
		} finally {
			pool.returnObject(address, socket);
		}
	}


Input:
	public final View doLogin(
			@RequestParam("type") final String type,
			@RequestParam(value = "user", required = false) final String guestName,
			@RequestParam(value = "referer", required = false) final String forcedReferer,
			@RequestParam(value = "successurl", required = false) final String successUrl,
			@RequestParam(value = "failureurl", required = false) final String failureUrl,
			final HttpServletRequest request,
			final HttpServletResponse response
	) throws IOException, ServletException {
		String referer = request.getHeader("referer");
		if (null != forcedReferer && !UrlUtils.isAbsoluteUrl(referer)) {
			referer = forcedReferer;
		}
		if (null == referer) {
			referer = "/";
		}
		request.getSession().setAttribute("ars-login-success-url",
			null == successUrl ? referer + "#auth/checkLogin" : successUrl
		);
		request.getSession().setAttribute("ars-login-failure-url",
			null == failureUrl ? referer : failureUrl
		);
		if ("cas".equals(type)) {
			casEntryPoint.commence(request, response, null);
		} else if ("twitter".equals(type)) {
			String authUrl = twitterProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("facebook".equals(type)) {
			String authUrl = facebookProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("google".equals(type)) {
			String authUrl = googleProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("guest".equals(type)) {
			List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
			authorities.add(new SimpleGrantedAuthority("ROLE_GUEST"));
			String username = "";
			if (guestName != null && guestName.startsWith("Guest") && guestName.length() == MAX_USERNAME_LENGTH) {
				username = guestName;
			} else {
				username = "Guest" + Sha512DigestUtils.shaHex(request.getSession().getId()).substring(0, 10);
			}
			org.springframework.security.core.userdetails.User user =
					new org.springframework.security.core.userdetails.User(
							username, "", true, true, true, true, authorities
					);
			Authentication token = new UsernamePasswordAuthenticationToken(user, null, authorities);
			SecurityContextHolder.getContext().setAuthentication(token);
			request.getSession(true).setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
					SecurityContextHolder.getContext());
			return new RedirectView(null == successUrl ? referer + "#auth/checkLogin" : successUrl);
		}
		return null;
	}

Output:
	public final View doLogin(
			@RequestParam("type") final String type,
			@RequestParam(value = "user", required = false) final String guestName,
			@RequestParam(value = "referer", required = false) final String forcedReferer,
			@RequestParam(value = "successurl", required = false) final String successUrl,
			@RequestParam(value = "failureurl", required = false) final String failureUrl,
			final HttpServletRequest request,
			final HttpServletResponse response
	) throws IOException, ServletException {
		String referer = request.getHeader("referer");
		if (null != forcedReferer && null != referer && !UrlUtils.isAbsoluteUrl(referer)) {
			referer = forcedReferer;
		}
		if (null == referer) {
			referer = "/";
		}
		request.getSession().setAttribute("ars-login-success-url",
			null == successUrl ? referer + "#auth/checkLogin" : successUrl
		);
		request.getSession().setAttribute("ars-login-failure-url",
			null == failureUrl ? referer : failureUrl
		);
		if ("cas".equals(type)) {
			casEntryPoint.commence(request, response, null);
		} else if ("twitter".equals(type)) {
			String authUrl = twitterProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("facebook".equals(type)) {
			String authUrl = facebookProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("google".equals(type)) {
			String authUrl = googleProvider.getAuthorizationUrl(new HttpUserSession(request));
			return new RedirectView(authUrl);
		} else if ("guest".equals(type)) {
			List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
			authorities.add(new SimpleGrantedAuthority("ROLE_GUEST"));
			String username = "";
			if (guestName != null && guestName.startsWith("Guest") && guestName.length() == MAX_USERNAME_LENGTH) {
				username = guestName;
			} else {
				username = "Guest" + Sha512DigestUtils.shaHex(request.getSession().getId()).substring(0, 10);
			}
			org.springframework.security.core.userdetails.User user =
					new org.springframework.security.core.userdetails.User(
							username, "", true, true, true, true, authorities
					);
			Authentication token = new UsernamePasswordAuthenticationToken(user, null, authorities);
			SecurityContextHolder.getContext().setAuthentication(token);
			request.getSession(true).setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
					SecurityContextHolder.getContext());
			return new RedirectView(null == successUrl ? referer + "#auth/checkLogin" : successUrl);
		}
		return null;
	}


Input:
	public String nicePrint()
	{
		String day = this.day+" day";
		String hour = this.hour+" hour";
		String minute = this.minutes+" minute";
		if(this.day==0)
			day="";
		else if(this.day!=1)
			day+="s";
		if(this.hour==0)
			hour="";
		else if(this.hour!=1)
			hour+="s";
		if(this.hour!=0)
			hour+=" and ";
		if(this.hour!=0 && this.day!=0)
			day+= ", ";
		if(this.minutes!=1)
			minute+="s";
		return day+hour+minute;
	}

Output:
	public String nicePrint()
	{
		String day = this.day+" day";
		String hour = this.hour+" hour";
		String minute = this.minutes+" minute";
		if(this.day==0)
			day="";
		else if(this.day!=1)
			day+="s";
		if(this.hour==0)
			hour="";
		else if(this.hour!=1)
			hour+="s";
		if(this.hour!=0||(this.hour==0&&this.day!=0&&this.minutes!=0))
			hour+=" and ";
		if(this.hour!=0 && this.day!=0)
			day+= ", ";
		if(this.minutes!=1)
			minute+="s";
		return day+hour+minute;
	}