langtools/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/DocLocale.java
author jjg
Fri, 27 May 2016 13:06:58 -0700
changeset 38617 d93a7f64e231
parent 37938 42baa89d2156
permissions -rw-r--r--
8157606: deprecate com.sun.javadoc API Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5520
diff changeset
     2
 * Copyright (c) 2000, 2012, 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: 10
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: 10
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: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
37938
42baa89d2156 8075703: jdk.javadoc module exports com.sun.tools.javadoc package which contains a lot of internal API.
jjg
parents: 25874
diff changeset
    26
package com.sun.tools.javadoc.main;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5520
diff changeset
    28
import java.text.BreakIterator;
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5520
diff changeset
    29
import java.text.Collator;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import java.util.Locale;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * This class holds the information about locales.
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    35
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    36
 *  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: 14258
diff changeset
    37
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    38
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    39
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @since 1.4
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Robert Field
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 */
38617
d93a7f64e231 8157606: deprecate com.sun.javadoc API
jjg
parents: 37938
diff changeset
    43
@Deprecated
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
class DocLocale {
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     * The locale name will be set by Main, if option is provided on the
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     * command line.
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    final String localeName;
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
    /**
14543
43edeaf6d0a9 8003257: refactor javadoc tool option handling
jjg
parents: 14260
diff changeset
    53
     * The locale to be used. If user doesn't provide this,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * then set it to default locale value.
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    final Locale locale;
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * The collator for this application. This is to take care of Locale
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * Specific or Natural Language Text sorting.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    final Collator collator;
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * Enclosing DocEnv
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    private final DocEnv docenv;
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * Sentence instance from the BreakIterator.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    private final BreakIterator sentenceBreaker;
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     * True is we should use <code>BreakIterator</code>
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * to compute first sentence.
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    private boolean useBreakIterator = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * The HTML sentence terminators.
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    static final String[] sentenceTerminators =
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
                    {
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
                        "<p>", "</p>", "<h1>", "<h2>",
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
                        "<h3>", "<h4>", "<h5>", "<h6>",
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
                        "</h1>", "</h2>", "</h3>", "</h4>", "</h5>",
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
                        "</h6>", "<hr>", "<pre>", "</pre>"
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
                    };
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * Constructor
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    DocLocale(DocEnv docenv, String localeName, boolean useBreakIterator) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
        this.docenv = docenv;
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
        this.localeName = localeName;
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
        this.useBreakIterator = useBreakIterator;
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
        locale = getLocale();
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
        if (locale == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
            docenv.exit();
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        } else {
14543
43edeaf6d0a9 8003257: refactor javadoc tool option handling
jjg
parents: 14260
diff changeset
   102
            Locale.setDefault(locale); // NOTE: updating global state
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
        collator = Collator.getInstance(locale);
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
        sentenceBreaker = BreakIterator.getSentenceInstance(locale);
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
     * Get the locale if specified on the command line
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
     * else return null and if locale option is not used
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     * then return default locale.
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    private Locale getLocale() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
        Locale userlocale = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
        if (localeName.length() > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
            int firstuscore = localeName.indexOf('_');
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
            int seconduscore = -1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
            String language = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
            String country = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
            String variant = null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
            if (firstuscore == 2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
                language = localeName.substring(0, firstuscore);
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
                seconduscore = localeName.indexOf('_', firstuscore + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
                if (seconduscore > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
                    if (seconduscore != firstuscore + 3 ||
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
                           localeName.length() <= seconduscore + 1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                        docenv.error(null, "main.malformed_locale_name", localeName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
                        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
                    country = localeName.substring(firstuscore + 1,
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
                                                   seconduscore);
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
                    variant = localeName.substring(seconduscore + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
                } else if (localeName.length() == firstuscore + 3) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
                    country = localeName.substring(firstuscore + 1);
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
                    docenv.error(null, "main.malformed_locale_name", localeName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
                    return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
                }
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            } else if (firstuscore == -1 && localeName.length() == 2) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                language = localeName;
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
                docenv.error(null, "main.malformed_locale_name", localeName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
            userlocale = searchLocale(language, country, variant);
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
            if (userlocale == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
                docenv.error(null, "main.illegal_locale_name", localeName);
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
            } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
                return userlocale;
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
            return Locale.getDefault();
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
     * Search the locale for specified language, specified country and
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
     * specified variant.
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    private Locale searchLocale(String language, String country,
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
                                String variant) {
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   163
        for (Locale loc : Locale.getAvailableLocales()) {
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   164
            if (loc.getLanguage().equals(language) &&
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   165
                (country == null || loc.getCountry().equals(country)) &&
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   166
                (variant == null || loc.getVariant().equals(variant))) {
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   167
                return loc;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    String localeSpecificFirstSentence(DocImpl doc, String s) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
        if (s == null || s.length() == 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
            return "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        int index = s.indexOf("-->");
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
        if(s.trim().startsWith("<!--") && index != -1) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
            return localeSpecificFirstSentence(doc, s.substring(index + 3, s.length()));
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
        if (useBreakIterator || !locale.getLanguage().equals("en")) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
            sentenceBreaker.setText(s.replace('\n', ' '));
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
            int start = sentenceBreaker.first();
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
            int end = sentenceBreaker.next();
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
            return s.substring(start, end).trim();
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
            return englishLanguageFirstSentence(s).trim();
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
     * Return the first sentence of a string, where a sentence ends
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
     * with a period followed be white space.
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    private String englishLanguageFirstSentence(String s) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
        if (s == null) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
            return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        int len = s.length();
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
        boolean period = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
        for (int i = 0 ; i < len ; i++) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
            switch (s.charAt(i)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
                case '.':
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
                    period = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                case ' ':
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
                case '\t':
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                case '\n':
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
            case '\r':
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
            case '\f':
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
                    if (period) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                        return s.substring(0, i);
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
            case '<':
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                    if (i > 0) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                        if (htmlSentenceTerminatorFound(s, i)) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                            return s.substring(0, i);
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
                        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                    break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                default:
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                    period = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        return s;
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
     * Find out if there is any HTML tag in the given string. If found
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
     * return true else return false.
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    private boolean htmlSentenceTerminatorFound(String str, int index) {
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   234
        for (String terminator : sentenceTerminators) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
            if (str.regionMatches(true, index, terminator,
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
                                  0, terminator.length())) {
22159
682da512ec17 8030253: Update langtools to use strings-in-switch
briangoetz
parents: 14543
diff changeset
   237
                return true;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
        return false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
}