langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/JavadocMemberEnter.java
author mcimadamore
Fri, 16 Dec 2016 15:27:34 +0000
changeset 42827 36468b5fa7f4
parent 39364 bd6d4a7936b4
permissions -rw-r--r--
8181370: Convert anonymous inner classes into lambdas/method references Reviewed-by: jjg, rfield, mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
     2
 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1264
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    26
package jdk.javadoc.internal.tool;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14802
969e90f68ac5 8004828: refactor init of *DocImpl classes
jjg
parents: 14441
diff changeset
    28
import com.sun.source.util.TreePath;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.javac.code.Flags;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.javac.code.Symbol.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.javac.comp.MemberEnter;
19666
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    32
import com.sun.tools.javac.tree.JCTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.javac.tree.JCTree.*;
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents: 10189
diff changeset
    34
import com.sun.tools.javac.util.Context;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
19666
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    36
import static com.sun.tools.javac.code.Flags.*;
27224
228abfa87080 8054457: Refactor Symbol kinds from small ints to an enum
emc
parents: 25874
diff changeset
    37
import static com.sun.tools.javac.code.Kinds.Kind.*;
19666
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    38
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *  Javadoc's own memberEnter phase does a few things above and beyond that
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 *  done by javac.
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    42
 *
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    43
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    44
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    45
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    46
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 13077
diff changeset
    47
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 *  @author Neal Gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 */
10189
57268b86d4da 7059905: (javadoc) promote method visibility for netbeans usage
ksrini
parents: 8614
diff changeset
    50
public class JavadocMemberEnter extends MemberEnter {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
    public static JavadocMemberEnter instance0(Context context) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
        MemberEnter instance = context.get(memberEnterKey);
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
        if (instance == null)
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
            instance = new JavadocMemberEnter(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
        return (JavadocMemberEnter)instance;
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
8614
06e42328ddab 7021650: fix Context issues
jjg
parents: 5520
diff changeset
    58
    public static void preRegister(Context context) {
42827
36468b5fa7f4 8181370: Convert anonymous inner classes into lambdas/method references
mcimadamore
parents: 39364
diff changeset
    59
        context.put(memberEnterKey, (Context.Factory<MemberEnter>)JavadocMemberEnter::new);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
    62
    final ToolEnvironment toolEnv;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    protected JavadocMemberEnter(Context context) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
        super(context);
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
    66
        toolEnv = ToolEnvironment.instance(context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents: 10189
diff changeset
    69
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    public void visitMethodDef(JCMethodDecl tree) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        super.visitMethodDef(tree);
868
d0f233085cbb 6657907: javadoc has unchecked warnings
jjg
parents: 10
diff changeset
    72
        MethodSymbol meth = tree.sym;
27224
228abfa87080 8054457: Refactor Symbol kinds from small ints to an enum
emc
parents: 25874
diff changeset
    73
        if (meth == null || meth.kind != MTH) return;
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
    74
        TreePath treePath = toolEnv.getTreePath(env.toplevel, env.enclClass, tree);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    75
        // do not add those methods that may be mandated by the spec,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    76
        // or those that are synthesized, thus if it does not exist in
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    77
        // tree best to let other logic determine the TreePath.
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    78
        if (env.enclClass.defs.contains(tree)) {
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
    79
            toolEnv.setElementToTreePath(meth, treePath);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    80
        }
14441
6c066a762e05 8002146: javadoc doesn't release resources in a timely manner
jjg
parents: 14260
diff changeset
    81
        // release resources
6c066a762e05 8002146: javadoc doesn't release resources in a timely manner
jjg
parents: 14260
diff changeset
    82
        tree.body = null;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
13077
16fb753bb5dc 7174143: encapsulate doc comment table
jjg
parents: 10189
diff changeset
    85
    @Override
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    public void visitVarDef(JCVariableDecl tree) {
19666
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    87
        if (tree.init != null) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    88
            boolean isFinal = (tree.mods.flags & FINAL) != 0
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    89
                    || (env.enclClass.mods.flags & INTERFACE) != 0;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    90
            if (!isFinal || containsNonConstantExpression(tree.init)) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    91
                // Avoid unnecessary analysis and release resources.
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    92
                // In particular, remove non-constant expressions
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    93
                // which may trigger Attr.attribClass, since
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    94
                // method bodies are also removed, in visitMethodDef.
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    95
                tree.init = null;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    96
            }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
    97
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
        super.visitVarDef(tree);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 27224
diff changeset
    99
        if (tree.sym != null && tree.sym.kind == VAR && !isParameter(tree.sym)) {
39364
bd6d4a7936b4 8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents: 35426
diff changeset
   100
            toolEnv.setElementToTreePath(tree.sym, toolEnv.getTreePath(env.toplevel, env.enclClass, tree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    private static boolean isParameter(VarSymbol var) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        return (var.flags() & Flags.PARAMETER) != 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    }
19666
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   107
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   108
    /**
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   109
     * Simple analysis of an expression tree to see if it contains tree nodes
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   110
     * for any non-constant expression. This does not include checking references
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   111
     * to other fields which may or may not be constant.
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   112
     */
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   113
    private static boolean containsNonConstantExpression(JCExpression tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   114
        return new MaybeConstantExpressionScanner().containsNonConstantExpression(tree);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   115
    }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   116
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   117
    /**
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   118
     * See JLS 15.18, Constant Expression
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   119
     */
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   120
    private static class MaybeConstantExpressionScanner extends JCTree.Visitor {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   121
        boolean maybeConstantExpr = true;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   122
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   123
        public boolean containsNonConstantExpression(JCExpression tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   124
            scan(tree);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   125
            return !maybeConstantExpr;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   126
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   127
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   128
        public void scan(JCTree tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   129
            // short circuit scan when end result is definitely false
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   130
            if (maybeConstantExpr && tree != null)
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   131
                tree.accept(this);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   132
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   133
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   134
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   135
        /** default for any non-overridden visit method. */
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   136
        public void visitTree(JCTree tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   137
            maybeConstantExpr = false;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   138
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   139
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   140
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   141
        public void visitBinary(JCBinary tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   142
            switch (tree.getTag()) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   143
                case MUL: case DIV: case MOD:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   144
                case PLUS: case MINUS:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   145
                case SL: case SR: case USR:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   146
                case LT: case LE: case GT: case GE:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   147
                case EQ: case NE:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   148
                case BITAND: case BITXOR: case BITOR:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   149
                case AND: case OR:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   150
                    break;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   151
                default:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   152
                    maybeConstantExpr = false;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   153
            }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   154
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   155
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   156
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   157
        public void visitConditional(JCConditional tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   158
            scan(tree.cond);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   159
            scan(tree.truepart);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   160
            scan(tree.falsepart);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   161
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   162
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   163
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   164
        public void visitIdent(JCIdent tree) { }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   165
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   166
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   167
        public void visitLiteral(JCLiteral tree) { }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   168
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   169
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   170
        public void visitParens(JCParens tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   171
            scan(tree.expr);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   172
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   173
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   174
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   175
        public void visitSelect(JCTree.JCFieldAccess tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   176
            scan(tree.selected);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   177
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   178
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   179
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   180
        public void visitTypeCast(JCTypeCast tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   181
            scan(tree.clazz);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   182
            scan(tree.expr);
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   183
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   184
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   185
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   186
        public void visitTypeIdent(JCPrimitiveTypeTree tree) { }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   187
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   188
        @Override
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   189
        public void visitUnary(JCUnary tree) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   190
            switch (tree.getTag()) {
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   191
                case POS: case NEG: case COMPL: case NOT:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   192
                    break;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   193
                default:
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   194
                    maybeConstantExpr = false;
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   195
            }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   196
        }
01a225608c25 8010310: [javadoc] Error processing sources with -private
jjg
parents: 15354
diff changeset
   197
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
}