8004961: rename Plugin.call to Plugin.init
authorjjg
Mon, 17 Dec 2012 10:55:40 -0800
changeset 14954 f8eea2960bcb
parent 14953 89a34297b198
child 14955 8fe779a6d616
8004961: rename Plugin.call to Plugin.init Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/source/util/Plugin.java
langtools/src/share/classes/com/sun/tools/javac/main/Main.java
langtools/test/tools/javac/plugin/showtype/ShowTypePlugin.java
langtools/test/tools/javac/plugin/showtype/Test.java
--- a/langtools/src/share/classes/com/sun/source/util/Plugin.java	Mon Dec 17 16:13:01 2012 +0000
+++ b/langtools/src/share/classes/com/sun/source/util/Plugin.java	Mon Dec 17 10:55:40 2012 -0800
@@ -56,9 +56,9 @@
     String getName();
 
     /**
-     * Invoke the plug-in for a given compilation task.
+     * Initialize the plug-in for a given compilation task.
      * @param task The compilation task that has just been started
      * @param args Arguments, if any, for the plug-in
      */
-    void call(JavacTask task, String... args);
+    void init(JavacTask task, String... args);
 }
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Mon Dec 17 16:13:01 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Mon Dec 17 10:55:40 2012 -0800
@@ -448,7 +448,7 @@
                             try {
                                 if (task == null)
                                     task = JavacTask.instance(pEnv);
-                                plugin.call(task, p.tail.toArray(new String[p.tail.size()]));
+                                plugin.init(task, p.tail.toArray(new String[p.tail.size()]));
                             } catch (Throwable ex) {
                                 if (apiMode)
                                     throw new RuntimeException(ex);
--- a/langtools/test/tools/javac/plugin/showtype/ShowTypePlugin.java	Mon Dec 17 16:13:01 2012 +0000
+++ b/langtools/test/tools/javac/plugin/showtype/ShowTypePlugin.java	Mon Dec 17 10:55:40 2012 -0800
@@ -41,7 +41,7 @@
         return "showtype";
     }
 
-    public void call(JavacTask task, String... args) {
+    public void init(JavacTask task, String... args) {
         Pattern pattern = null;
         if (args.length == 1)
             pattern = Pattern.compile(args[0]);
--- a/langtools/test/tools/javac/plugin/showtype/Test.java	Mon Dec 17 16:13:01 2012 +0000
+++ b/langtools/test/tools/javac/plugin/showtype/Test.java	Mon Dec 17 10:55:40 2012 -0800
@@ -1,22 +1,3 @@
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Locale;
-import java.util.Objects;
-import javax.tools.JavaCompiler;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
-import javax.tools.StandardJavaFileManager;
-import javax.tools.StandardLocation;
-import javax.tools.ToolProvider;
-
 /*
  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,10 +23,28 @@
 
 /**
  *  @test
- *  @bug 8001098
+ *  @bug 8001098 8004961
  *  @summary Provide a simple light-weight "plug-in" mechanism for javac
  */
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Locale;
+import java.util.Objects;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
 public class Test {
     public static void main(String... args) throws Exception {
         new Test().run();