MCPcopy Index your code
hub / github.com/apache/tomcat / isJavaKeyword

Method isJavaKeyword

java/org/apache/jasper/compiler/JspUtil.java:907–923  ·  view source on GitHub ↗

Test whether the argument is a Java keyword. @param key The name @return true if the name is a java identifier

(String key)

Source from the content-addressed store, hash-verified

905 * @return <code>true</code> if the name is a java identifier
906 */
907 public static boolean isJavaKeyword(String key) {
908 int i = 0;
909 int j = javaKeywords.length;
910 while (i < j) {
911 int k = (i + j) >>> 1;
912 int result = javaKeywords[k].compareTo(key);
913 if (result == 0) {
914 return true;
915 }
916 if (result < 0) {
917 i = k + 1;
918 } else {
919 j = k;
920 }
921 }
922 return false;
923 }
924
925 static InputStreamReader getReader(String fname, String encoding, Jar jar, JspCompilationContext ctxt,
926 ErrorDispatcher err) throws JasperException, IOException {

Callers 1

makeJavaIdentifierMethod · 0.95

Calls 1

compareToMethod · 0.65

Tested by

no test coverage detected