protected void injectLocation(final TreeLogger logger, final ClassBuffer cls, final JRealClassType injectionType) { String location; try { location = (String)injectionType.getClass().getMethod("getLocation").invoke(injectionType); } catch (final Exception e) { if (logOnce) { logOnce = false; logger.log(Type.ERROR, "Unable to call "+injectionType.getClass().getName()+".getLocation on "+injectionType.getJNISignature()); logger.log(Type.ERROR, "Ensure that you have the jar/artifact net.wetheinter:gwt-reflect before gwt-dev on your classpath."); logger.log(Type.TRACE, "The artifact net.wetheinter:com.google.gwt.thirdparty.xapi-gwt-api contains a class, ClasspathFixer, which can help you."); logger.log(Type.TRACE, "For unit tests, com.google.gwt.thirdparty.xapi-gwt-test overrides JUnitShell to fix the classpath for you.", e); } return; } cls.addImports(ProtectionDomain.class); cls .println("private ProtectionDomain domain;") .createMethod("public ProtectionDomain getProtectionDomain()") .println("if (domain == null) ") .indentln("domain = new ProtectionDomain(\"" +location+"\");") .println("return domain;"); }
protected void injectLocation(TreeLogger logger, ClassBuffer cls, JRealClassType injectionType) { String location; try { location = (String)injectionType.getClass().getMethod("getLocation").invoke(injectionType); } catch (Exception e) { if (logOnce) { logOnce = false; logger.log(Type.ERROR, "Unable to call "+injectionType.getClass().getName()+".getLocation on "+injectionType.getJNISignature()); logger.log(Type.ERROR, "Ensure that you have the jar/artifact net.wetheinter:gwt-reflect before gwt-dev on your classpath."); logger.log(Type.TRACE, "The artifact net.wetheinter:xapi-gwt-api contains a class, ClasspathFixer, which can help you."); logger.log(Type.TRACE, "For unit tests, xapi-gwt-test overrides JUnitShell to fix the classpath for you.", e); } return; } cls.addImports(ProtectionDomain.class); cls .println("private ProtectionDomain domain;") .createMethod("public ProtectionDomain getProtectionDomain()") .println("if (domain == null) ") .indentln("domain = new ProtectionDomain(\"" +location+"\");") .println("return domain;"); }