8157608: deprecate old entry points for javadoc tool

Reviewed-by: ksrini
This commit is contained in:
Jonathan Gibbons 2016-05-26 17:35:26 -07:00
parent 8a3eaf7f44
commit f6dd27010c
4 changed files with 52 additions and 5 deletions

View File

@ -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.javadoc.*;
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 @@ public class SourceToHTMLConverter {
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);

View File

@ -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 @@ import com.sun.tools.javadoc.main.Start;
* 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 {
/**

View File

@ -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;

View File

@ -221,6 +221,7 @@ public class Start extends ToolOption.Helper {
* 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 @@ public class Start extends ToolOption.Helper {
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 @@ public class Start extends ToolOption.Helper {
initMessager();
messager.setLocale(locale);
try {
@SuppressWarnings("deprecation")
Object o = docletClass.newInstance();
doclet = (Doclet) o;
} catch (InstantiationException | IllegalAccessException exc) {