8157608: deprecate old entry points for javadoc tool
authorjjg
Thu, 26 May 2016 17:35:26 -0700
changeset 38614 364c1a6618c0
parent 38613 2a8e50869b08
child 38615 9221159d84fb
8157608: deprecate old entry points for javadoc tool Reviewed-by: ksrini
langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java
langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java
langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/package-info.java
langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Thu May 26 12:38:21 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Thu May 26 17:35:26 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,6 +33,7 @@
 import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.javadoc.main.SourcePositionImpl;
 
 /**
  * Converts Java Source Code to HTML.
@@ -149,8 +150,8 @@
                 return;
             Reader r;
             // temp hack until we can update SourcePosition API.
-            if (sp instanceof com.sun.tools.javadoc.main.SourcePositionImpl) {
-                FileObject fo = ((com.sun.tools.javadoc.main.SourcePositionImpl) sp).fileObject();
+            if (sp instanceof SourcePositionImpl) {
+                FileObject fo = ((SourcePositionImpl) sp).fileObject();
                 if (fo == null)
                     return;
                 r = fo.openReader(true);
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java	Thu May 26 12:38:21 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/Main.java	Thu May 26 17:35:26 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,8 +38,17 @@
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  *
+ * @deprecated
+ * This class is now deprecated and may be removed in a future release.
+ * See
+ * {@code javax.tools.ToolProvider::getSystemDocumentationTool}
+ * and
+ * {@code javax.tools.DocumentationTool}
+ * for replacement functionality.
+ *
  * @since 1.4
  */
+@Deprecated
 public class Main {
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/package-info.java	Thu May 26 17:35:26 2016 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * This package and its contents are deprecated and
+ * may be removed in a future release.
+ * See
+ * {@code javax.tools.ToolProvider.getSystemDocumentationTool}
+ * and
+ * {@code javax.tools.DocumentationTool}
+ * for replacement functionality.
+ */
+@Deprecated
+package com.sun.tools.javadoc;
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java	Thu May 26 12:38:21 2016 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/Start.java	Thu May 26 17:35:26 2016 -0700
@@ -221,6 +221,7 @@
      * this is to minimize argument processing and most importantly the impact
      * of class loader creation, needed to detect the doclet/taglet class variants.
      */
+    @SuppressWarnings("deprecation")
     int begin(String... argv) {
         // Preprocess @file arguments
         try {
@@ -254,6 +255,7 @@
         return begin(opts, fileObjects);
     }
 
+    @SuppressWarnings("deprecation")
     private boolean begin(List<String> options, Iterable<? extends JavaFileObject> fileObjects) {
         fileManager = context.get(JavaFileManager.class);
         if (fileManager == null) {
@@ -270,7 +272,6 @@
             initMessager();
             messager.setLocale(locale);
             try {
-                @SuppressWarnings("deprecation")
                 Object o = docletClass.newInstance();
                 doclet = (Doclet) o;
             } catch (InstantiationException | IllegalAccessException exc) {