Link to home
Start Free TrialLog in
Avatar of cmlane08
cmlane08

asked on

Undefined Label causing compile error

I am receiving the following compile error on code that was previously compiled.   All I did was decompile it can attempt to recompile.  I haven't touched this code.  I am tried several ways to define this label but I'm having no luck.  Please help!


    [javac] C:\projects\MyCSP_CMS\Code\src\com\vignette\tas\util\RemoteDataHandl
er.java:206: undefined label: MISSING_BLOCK_LABEL_338
    [javac]         break MISSING_BLOCK_LABEL_338;



Here is the code that is causing the error.  It is the   break MISSING_BLOCK_LABEL_338; line.   I don't know what to do.





public void getRemoteData(HttpServletRequest request, HttpServletResponse response)
    {
        String urlString;
        String queryString;
        String userName;
        UserNameCallback userNameCallback;
        Locale locale;
        URLConnection connection;
        urlString = null;
        queryString = request.getQueryString();
        userName = null;
        userNameCallback = null;
        locale = null;
        connection = null;
        Set cookies;
        URL url;
        try
        {
            userNameCallback = getUserNameCallback();
            locale = userNameCallback.getLocale(request);
            urlString = getRemoteURLString(request, userNameCallback);
            if(!userNameCallback.isProxyRequest(request))
            {
                userNameCallback.doNonProxyActivity(request, response);
                return;
            }
        }
        finally
        {
            try
            {
                if(connection != null)
                    connection.getInputStream().close();
            }
            catch(IOException e) { }
        }
        cookies = null;
        if(userNameCallback.needsAuthentication(request, response))
        {
            userName = userNameCallback.getUserName(request);
            cookies = getAuthenticatedUserData(request, response, userName);
        } else
        {
            cookies = CookieHandler.addCookiesFromBrowser(request);
        }
        url = new URL(urlString);
        LOG.debug("Connecting to remote url " + urlString);
        connection = getConnection(url, request, response, cookies, queryString);
        if(connection == null)
            return;
        if(!userNameCallback.needsAuthentication(request, response))
        {
            cookies = CookieHandler.getCookiesFromRemoteRequest(connection, request);
            setCookieCache(cookies, request, response);
        }
        String loginKeyValue = connection.getHeaderField("x-vgn-vcm-login-page");
        if(loginKeyValue != null && loginKeyValue.equals("true") && userNameCallback.needsAuthentication(request, response))
        {
            LOG.debug("Login screen showed up, re-authenticating");
            cookies = getAuthenticatedUserData(request, response, userName, true);
            connection = getConnection(url, request, response, cookies, queryString);
            if(connection == null)
                return;
        }
        try
        {
            postRemoteData(connection, response);
        }
        catch(Throwable e)
        {
            handleCMAError(e, response, locale);
        }
        break MISSING_BLOCK_LABEL_338;
    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Kuldeepchaturvedi
Kuldeepchaturvedi
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cmlane08
cmlane08

ASKER

I think you're right.   I removed the break altogether because there was no loop.   I then received errors because some exceptions weren't properly caught in a try/catch block.   I added them and now I'm able to compile!

Thanks so much for your help.   I will accept this as the Solution.
thanks so much for your help!
Just delete the line with THIS break statement.
From the decompiler's point of view it simply marks the end of that particular method (i.e labeled block) and attempts to return a thread of execution to the caller.

Avdej