Guest User

Untitled

a guest
Jul 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. public void login() {
  2. Log.d(TAG, "Login");
  3. if (validate()) {
  4. this._loginButton.setEnabled(false);
  5. final ProgressDialog progressDialog = new ProgressDialog(this, R.style.AppTheme.Dark.Dialog);
  6. progressDialog.setIndeterminate(true);
  7. progressDialog.setMessage("Authenticating...");
  8. progressDialog.show();
  9. String email = this._emailText.getText().toString();
  10. String password = this._passwordText.getText().toString();
  11. new Handler().postDelayed(new Runnable() {
  12. public void run() {
  13. LoginActivity.this.onLoginSuccess();
  14. progressDialog.dismiss();
  15. }
  16. }, 300);
  17. return;
  18. }
  19. onLoginFailed();
  20. }
  21.  
  22. FileInputStream in = new FileInputStream("LoginActivity.java");
  23.  
  24. com.github.javaparser.ast.CompilationUnit cu;
  25. try
  26. {
  27. cu = JavaParser.parse(in);
  28. }
  29. finally
  30. {
  31. in.close();
  32. }
  33. new MethodVisitor().visit(cu, null);
  34. }
  35.  
  36. private static class MethodVisitor extends VoidVisitorAdapter
  37. {
  38. @Override
  39. public void visit(MethodCallExpr methodCall, Object arg)
  40. {
  41.  
  42. System.out.print("parent node : " +methodCall.getChildrenNodes() +"|| Method call : "+methodCall.getName()+" || "+ methodCall.getScope()+"n");
  43.  
  44. List<Expression> args = methodCall.getArgs();
  45. if (args != null)
  46. handleExpressions(args);
  47. }
  48.  
  49.  
  50. private void handleExpressions(List<Expression> expressions)
  51. {
  52. for (Expression expr : expressions)
  53. {
  54. if (expr instanceof MethodCallExpr)
  55. visit((MethodCallExpr) expr, null);
  56. else if (expr instanceof BinaryExpr)
  57. {
  58. BinaryExpr binExpr = (BinaryExpr)expr;
  59. handleExpressions(Arrays.asList(binExpr.getLeft(), binExpr.getRight()));
  60. }
  61. }
  62. }
  63. }
Add Comment
Please, Sign In to add comment