961N/A * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 596N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 596N/A * This code is free software; you can redistribute it and/or modify it 596N/A * under the terms of the GNU General Public License version 2 only, as 596N/A * published by the Free Software Foundation. 596N/A * This code is distributed in the hope that it will be useful, but WITHOUT 596N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 596N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 596N/A * version 2 for more details (a copy is included in the LICENSE file that 596N/A * accompanied this code). 596N/A * You should have received a copy of the GNU General Public License version 596N/A * 2 along with this work; if not, write to the Free Software Foundation, 596N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 596N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 596N/A * or visit www.oracle.com if you need additional information or have any 915N/A * @bug 6964768 6964461 6964469 6964487 6964460 6964481 6980021 596N/A * @summary need test program to validate javac resource bundles 596N/A * Compare string constants in javac classes against keys in javac resource bundles. 596N/A * look for keys in resource bundles that are no longer required 596N/A * look for keys in resource bundles that are missing 596N/A * @throws Exception if invoked by jtreg and errors occur 596N/A * Find keys in resource bundles which are probably no longer required. 596N/A * A key is probably required if there is a string fragment in the code 596N/A * that is part of the resource key, or if the key is well-known 596N/A * according to various pragmatic rules. 596N/A "compiler.err.",
"compiler.warn.",
"compiler.note.",
"compiler.misc.",
596N/A // some keys are used directly, without a prefix. 596N/A // remove standard prefix 596N/A error(
"Resource key does not start with a standard prefix: " +
rk);
596N/A // keys ending in .1 are often synthesized 596N/A // verbose keys are generated by ClassReader.printVerbose 596N/A // mandatory warning messages are synthesized with no characteristic substring 596N/A // check known (valid) exceptions 596N/A // check known suspects 596N/A * The keys for mandatory warning messages are all synthesized and do not 596N/A * have a significant recognizable substring to look for. 596N/A String[]
tails = {
".filename",
".filename.additional",
".plural",
".plural.additional",
".recompile" };
596N/A // See Resolve.getErrorKey 596N/A "compiler.err.cant.resolve.args",
596N/A "compiler.err.cant.resolve.args.params",
596N/A "compiler.err.cant.resolve.location.args",
596N/A "compiler.err.cant.resolve.location.args.params",
596N/A // JavaCompiler, reports #errors and #warnings 596N/A "compiler.misc.count.error",
596N/A "compiler.misc.count.error.plural",
596N/A "compiler.misc.count.warn",
596N/A "compiler.misc.count.warn.plural",
596N/A // Used for LintCategory 596N/A "compiler.warn.lintOption",
596N/A "compiler.misc.base.membership" // (sic) 596N/A "compiler.err.cant.read.file",
// UNUSED 596N/A "compiler.err.illegal.self.ref",
// UNUSED 596N/A "compiler.err.io.exception",
// UNUSED 596N/A "compiler.err.limit.pool.in.class",
// UNUSED 596N/A "compiler.err.name.reserved.for.internal.use",
// UNUSED 596N/A "compiler.err.no.match.entry",
// UNUSED 596N/A "compiler.err.not.within.bounds.explain",
// UNUSED 596N/A "compiler.err.signature.doesnt.match.intf",
// UNUSED 596N/A "compiler.err.signature.doesnt.match.supertype",
// UNUSED 596N/A "compiler.err.type.var.more.than.once",
// UNUSED 596N/A "compiler.err.type.var.more.than.once.in.result",
// UNUSED 596N/A "compiler.misc.ccf.found.later.version",
// UNUSED 596N/A "compiler.misc.non.denotable.type",
// UNUSED 596N/A "compiler.misc.unnamed.package",
// should be required, CR 6964147 596N/A "compiler.misc.verbose.retro",
// UNUSED 596N/A "compiler.misc.verbose.retro.with",
// UNUSED 596N/A "compiler.misc.verbose.retro.with.list",
// UNUSED 596N/A "compiler.warn.proc.type.already.exists",
// TODO in JavacFiler 596N/A "javac.err.invalid.arg",
// UNUSED ?? 596N/A "javac.opt.arg.class",
// UNUSED ?? 596N/A "javac.opt.arg.pathname",
// UNUSED ?? 596N/A "javac.opt.moreinfo",
// option commented out 596N/A "javac.opt.nogj",
// UNUSED 596N/A "javac.opt.printflat",
// option commented out 596N/A "javac.opt.printsearch",
// option commented out 596N/A "javac.opt.prompt",
// option commented out 596N/A "javac.opt.retrofit",
// UNUSED 596N/A "javac.opt.s",
// option commented out 596N/A "javac.opt.scramble",
// option commented out 596N/A "javac.opt.scrambleall" // option commented out 596N/A * For all strings in the code that look like they might be fragments of 596N/A * a resource key, verify that a key exists. 596N/A // ignore filenames (i.e. in SourceFile attribute 596N/A // ignore package and class names 596N/A // explicit known exceptions 596N/A // look for matching resource 596N/A * Look for a resource that ends in this string fragment. 596N/A * Get the set of strings from (most of) the javac classfiles. 596N/A "javax.annotation.processing",
596N/A // ignore resource files, and files which are not really part of javac 604N/A // depending on how the test is run, javac may be on bootclasspath or classpath 596N/A * Get the set of strings from a class file. 596N/A * Only strings that look like they might be a resource key are returned. 596N/A * Get the set of keys from the javac resource bundles.