package com.example.hugo;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.util.Log;

import java.lang.Override;
import java.lang.String;

import hugo.weaving.DebugLog;

public class HugoActivity extends Activity {
  @Override protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TextView tv = new TextView(this);
    tv.setText("Check logcat!");
    setContentView(tv);

    printArgs("The", "Quick", "Brown", "Fox");

    Log.i("Fibonacci", "fibonacci's 4th number is " + fibonacci(4));

    Greeter greeter = new Greeter("Jake");
    Log.d("Greeting", greeter.sayHello());

    (new Annonymous() {
      @Override
      @DebugLog
      public String whoIsThis() {
        return "I'm a nobody!";
      }
    }).whoIsThis();

  }

  @DebugLog
  private void printArgs(String... args) {
    for (String arg : args) {
      Log.i("Args", arg);
    }
  }

  @DebugLog
  private int fibonacci(int number) {
    if (number <= 0) {
      throw new IllegalArgumentException("Number must be greater than zero.");
    }
    if (number == 1 || number == 2) {
      return 1;
    }
    // NOTE: Don't ever do this. Use the iterative approach!
    return fibonacci(number - 1) + fibonacci(number - 2);
  }

  static class Greeter {
    private final String name;

    @DebugLog
    Greeter(String name) {
      this.name = name;
    }

    @DebugLog
    public String sayHello() {
      return "Hello, " + name;
    }
  }

  private static interface Annonymous {
      String whoIsThis();
  }
}

@@ -671,160 +671,8 @@
 ));%0A
-%0A    (new Annonymous() %7B%0A      @Override%0A      @DebugLog%0A      public String whoIsThis() %7B%0A        return %22I'm a nobody!%22;%0A      %7D%0A    %7D).whoIsThis();%0A%0A
   %7D%0A
@@ -1354,78 +1354,7 @@
 %0A  %7D
-%0A%0A  private static interface Annonymous %7B%0A      String whoIsThis();%0A  %7D
 %0A%7D%0A

Undo last commit