Example #1
0
 private void validateModificationOfNativeMethod(int access, String name) {
   if (isNative(access) && !Startup.isJava6OrLater()) {
     throw new IllegalArgumentException(
         "Mocking of native methods not supported under JDK 1.5; please filter out method \""
             + name
             + "\", or run under JDK 1.6+");
   }
 }
Example #2
0
  public void removeCaptureTransformers(int previousTransformerCount) {
    int currentTransformerCount = captureTransformers.size();

    for (int i = currentTransformerCount - 1; i >= previousTransformerCount; i--) {
      CaptureTransformer<?> transformer = captureTransformers.get(i);
      transformer.deactivate();
      Startup.instrumentation().removeTransformer(transformer);
      captureTransformers.remove(i);
    }
  }
Example #3
0
  public Arisu() {
    try {
      config.load(new FileInputStream("config.properties"));
    } catch (IOException ex) {
      System.err.println("Error loading config.properties.\n" + ex);
      System.exit(0);
    }

    try {
      Startup.onStartup(admins, this, mods);
      this.setName(config.getProperty("nick", "Arisu"));
      this.setLogin(config.getProperty("realname", "Arisu"));
    } catch (Exception ex) {
      System.out.println("Startup failed.\n" + ex);
      System.exit(0);
    }

    cmds = new ArrayList<Commands>();

    cmds.add(new AdminsCommand());
    cmds.add(new ModsCommand());
    cmds.add(new BanCommand());
    cmds.add(new HelloCommand());
    // cmds.add(new BanCommand());
    cmds.add(new InviteCommand());
    cmds.add(new JoinCommand());
    cmds.add(new LeaveCommand());
    cmds.add(new ShutdownCommand());
    cmds.add(new SayCommand());
    cmds.add(new ActCommand());
    cmds.add(new OpCommand());
    cmds.add(new ShellCommand());
    cmds.add(new AuthCommand());
    cmds.add(new GitHubCommand());
    cmds.add(new IgnoreCommand());
    cmds.add(new UnIgnoreCommand());
    cmds.add(new YamlCommand());
  }
 static {
   Startup.verifyInitialization();
 }