JDK-8027829 : CompileCommand does not accept all JLS-conformant class/method names
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-11-05
  • Updated: 2015-06-03
  • Resolved: 2015-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b48Fixed
Related Reports
Relates :  
Relates :  
Description
According to JLS, identifier name may contain any character that is java letter or digit. For such characters Character.isJavaIdentifierPart return true.

CompileCommand accepts only subset of these characters, so you can't specify some methods in CompileCommand:

it does not works with 0x01 (note that Character.isJavaIdentifierPart(1) returns true):

$jdk1.8.0/fastdebug/bin/java -XX:CompileCommand=exclude,`echo -e "UnicodeIdentifierTest.methodWithUnicode\u0001"`  UnicodeIdentifierTest
CompilerOracle: unrecognized line
  "exclude UnicodeIdentifierTest methodWithUnicode"
  Unrecognized text after command: 
Can I use \u0001 in identifier name? yes

but works fine with 0xff:

$ jdk1.8.0/fastdebug/bin/java -XX:CompileCommand=exclude,`echo -e "UnicodeIdentifierTest.methodWithUnicode\u00ff"`  UnicodeIdentifierTest
CompilerOracle: exclude UnicodeIdentifierTest.methodWithUnicode\u00ff
Can I use \u0001 in identifier name? yes

Possible workaround is to use wildcards.

ILW = MLL => P5.
Comments
No limitation in matching as a char array, must just make sure the right chars are allowed. The current list (RANGEBASE) matches neither JavaIdentifierStart nor JavaIdentiferPart.
20-11-2014

The parser for compileCommands operates on 8-bit chars. If it success the match will be saved as a utf-8 symbol. So for some char streams you might get lucky.
19-11-2014