title: Modfying methods variable using java parser in java file
body: <p>i am using java parser to read a java file. then i have problem with how to access variable in each method, then modifying the variable name and type in each method.</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      // creates an input stream for the file to be parsed
      FileInputStream in = new FileInputStream("test.java");
  
      CompilationUnit cu;
      try {
          // parse the file
          cu = JavaParser.parse(in);
      } finally {
          in.close();
      }
  
      // change the methods names and parameters
      changeMethods(cu);
  
      // prints the changed compilation unit
      System.out.println(cu.toString());
  }
  
  private static void changeMethods(CompilationUnit cu) {
      List&lt;TypeDeclaration&gt; types = cu.getTypes();
      for (TypeDeclaration type : types) {
          List&lt;BodyDeclaration&gt; members = type.getMembers();
          for (BodyDeclaration member : members) {
              if (member instanceof MethodDeclaration) {
                  // what must i do?
              }
          }
      }
  }
  </code></pre>
  
  <p><strong>[UPDATE]</strong></p>
  
  <p>For more details, i have a method such as below:</p>
  
  <pre><code> private double[] getExtremeValues(double[] d) {    
      double min = Double.MAX_VALUE;  
      double max = -min;
  
  }
  </code></pre>
  
  <p>in that method, i just want to modify 'double max' with 'double max1'. The second question, how to get 'double[] d' in the method parameter?
  Please help! Thanks</p>