please add String.isJavaIdentifier

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P5
    • None
    • Affects Version/s: 1.4.0
    • Component/s: core-libs
    • None
    • generic
    • solaris_7

      It seems strange to have the methods
      Character.isJavaIdentifierStart
      and
      Character.isJavaIdentifierPart
      and yet there is no method
      String.isJavaIdentifier

      which would look something like this

          public boolean isJavaIdentifier() {
            int n = length();
            if (n==0) return false;
            if (!Character.isJavaIdentifierStart(charAt(0)))
                return false;
            for (int i = 1; i < n; i++)
                if (!Character.isJavaIdentifierPart(charAt(i)))
                    return false;
            return true;
          }

            Assignee:
            John Oconner (Inactive)
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: