Beispiel #1
0
    public void start(Context context)
    {
        Object obj;
        if (!loggingEnabled)
        {
            break MISSING_BLOCK_LABEL_51;
        }
        obj = new AndroidAgentLog();
_L1:
        AgentLogManager.setAgentLog(((AgentLog) (obj)));
        if (isInstrumented())
        {
            AndroidAgentImpl.init(context, token, collectorAddress, ssl, locationServicesEnabled, appName);
            return;
        }
        break MISSING_BLOCK_LABEL_75;
        try
        {
            obj = new NullAgentLog();
        }
        // Misplaced declaration of an exception variable
        catch (Context context)
        {
            log.error("Error occurred while starting the New Relic agent!", context);
            return;
        }
          goto _L1
Beispiel #2
0
public class NewRelic
{

    private static final String DEFAULT_COLLECTOR_ADDR = "mobile-collector.newrelic.com";
    private static final AgentLog log = AgentLogManager.getAgentLog();
    private String appName;
    private String collectorAddress;
    private boolean locationServicesEnabled;
    private boolean loggingEnabled;
    private boolean ssl;
    private final String token;

    private NewRelic(String s)
    {
        collectorAddress = "mobile-collector.newrelic.com";
        ssl = true;
        loggingEnabled = true;
        locationServicesEnabled = false;
        token = s;
    }

    private boolean isInstrumented()
    {
        return true;
    }

    public static NewRelic withApplicationToken(String s)
    {
        return new NewRelic(s);
    }

    public void start(Context context)
    {
        Object obj;
        if (!loggingEnabled)
        {
            break MISSING_BLOCK_LABEL_51;
        }
        obj = new AndroidAgentLog();
_L1:
        AgentLogManager.setAgentLog(((AgentLog) (obj)));
        if (isInstrumented())
        {
            AndroidAgentImpl.init(context, token, collectorAddress, ssl, locationServicesEnabled, appName);
            return;
        }
        break MISSING_BLOCK_LABEL_75;
        try
        {
            obj = new NullAgentLog();
        }
        // Misplaced declaration of an exception variable
        catch (Context context)
        {
            log.error("Error occurred while starting the New Relic agent!", context);
            return;
        }
          goto _L1
        log.error("Failed to detect New Relic instrumentation.  Something likely went wrong during your build process and you should contact [email protected].");
        return;
    }