@Test public void testWithGlowrootJar() throws Exception { File glowrootJar = new File("x/glowroot.jar").getAbsoluteFile(); CodeSource codeSource = new CodeSource(glowrootJar.toURI().toURL(), new Certificate[0]); assertThat(AgentPremain.getGlowrootJarFile(codeSource)).isEqualTo(glowrootJar); }
@SuppressWarnings("return.type.incompatible") static File getGlowrootJarFile(CodeSource codeSource) throws Exception { if (codeSource == null) { if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); }
AgentPremain { @SuppressWarnings("return.type.incompatible") static File getGlowrootJarFile(CodeSource codeSource) throws Exception { if (codeSource == null) { if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } }
AgentPremain { @SuppressWarnings("return.type.incompatible") static File getGlowrootJarFile(CodeSource codeSource) throws Exception { if (codeSource == null) { if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } private  AgentPremain(); }
AgentPremain { @SuppressWarnings("return.type.incompatible") static File getGlowrootJarFile(CodeSource codeSource) throws Exception { if (codeSource == null) { if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } private  AgentPremain(); static void premain(@SuppressWarnings("unused") String agentArgs,
            Instrumentation instrumentation); }
AgentPremain { @SuppressWarnings("return.type.incompatible") static File getGlowrootJarFile(CodeSource codeSource) throws Exception { if (codeSource == null) { if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } File codeSourceFile = new File(codeSource.getLocation().toURI()); if (codeSourceFile.getName().endsWith(".jar")) { return codeSourceFile; } if (System.getProperty("glowroot.test.dir") != null) { return null; } throw new IOException("Could not determine glowroot jar location"); } private  AgentPremain(); static void premain(@SuppressWarnings("unused") String agentArgs,
            Instrumentation instrumentation);  }