< prev index next >

langtools/test/jdk/javadoc/tool/CheckResourceKeys.java

Print this page




 131                 error("missing resources in output ?");
 132             }
 133         } else {
 134             error("failed to execute javadoc");
 135         }
 136     }
 137 
 138     /**
 139      * Find keys in resource bundles which are probably no longer required.
 140      * A key is required if there is a string in the code that is a resource key,
 141      * or if the key is well-known according to various pragmatic rules.
 142      */
 143     void findDeadKeys(Set<String> codeKeys, Set<String> resourceKeys) {
 144         for (String rk: resourceKeys) {
 145             // ignore these synthesized keys, tested by usageTests
 146             if (rk.startsWith("doclet.usage.") || rk.startsWith("doclet.xusage"))
 147                 continue;
 148             if (codeKeys.contains(rk))
 149                 continue;
 150 
 151             error("Resource key not found in code: " + rk);
 152         }
 153     }
 154 
 155     /**
 156      * For all strings in the code that look like they might be
 157      * a resource key, verify that a key exists.
 158      */
 159     void findMissingKeys(Set<String> codeKeys, Set<String> resourceKeys) {
 160         for (String ck: codeKeys) {
 161             // ignore these synthesized keys, tested by usageTests
 162             if (ck.startsWith("doclet.usage.") || ck.startsWith("doclet.xusage."))
 163                 continue;
 164             if (resourceKeys.contains(ck))
 165                 continue;
 166             error("No resource for \"" + ck + "\"");
 167         }
 168     }
 169 
 170     /**
 171      * Get the set of strings from (most of) the javadoc classfiles.




 131                 error("missing resources in output ?");
 132             }
 133         } else {
 134             error("failed to execute javadoc");
 135         }
 136     }
 137 
 138     /**
 139      * Find keys in resource bundles which are probably no longer required.
 140      * A key is required if there is a string in the code that is a resource key,
 141      * or if the key is well-known according to various pragmatic rules.
 142      */
 143     void findDeadKeys(Set<String> codeKeys, Set<String> resourceKeys) {
 144         for (String rk: resourceKeys) {
 145             // ignore these synthesized keys, tested by usageTests
 146             if (rk.startsWith("doclet.usage.") || rk.startsWith("doclet.xusage"))
 147                 continue;
 148             if (codeKeys.contains(rk))
 149                 continue;
 150 
 151             error("Resource key not found in code: '" + rk + '"');
 152         }
 153     }
 154 
 155     /**
 156      * For all strings in the code that look like they might be
 157      * a resource key, verify that a key exists.
 158      */
 159     void findMissingKeys(Set<String> codeKeys, Set<String> resourceKeys) {
 160         for (String ck: codeKeys) {
 161             // ignore these synthesized keys, tested by usageTests
 162             if (ck.startsWith("doclet.usage.") || ck.startsWith("doclet.xusage."))
 163                 continue;
 164             if (resourceKeys.contains(ck))
 165                 continue;
 166             error("No resource for \"" + ck + "\"");
 167         }
 168     }
 169 
 170     /**
 171      * Get the set of strings from (most of) the javadoc classfiles.


< prev index next >