Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39437
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jeff Higgins <invalid@invalid.org> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Character.isIdentifierIgnorable |
| Date | Fri, 24 Apr 2020 20:12:10 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 59 |
| Message-ID | <r7vv8t$8a7$1@dont-email.me> (permalink) |
| References | <r7vqa2$ekn$1@dont-email.me> <r7vqo0$15g0$1@gioia.aioe.org> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Sat, 25 Apr 2020 00:12:13 -0000 (UTC) |
| Injection-Info | reader02.eternal-september.org; posting-host="9a8fc7e31976b9214d29a9072514a11d"; logging-data="8519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1851GpT3AO2rsRfKA6d2lCTudxZasUEoo0=" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
| Cancel-Lock | sha1:7Hl45cPGuRG7Cs6UhWBNLklJUW4= |
| In-Reply-To | <r7vqo0$15g0$1@gioia.aioe.org> |
| Content-Language | en-US |
| Xref | csiph.com comp.lang.java.programmer:39437 |
Show key headers only | View raw
On 4/24/20 6:54 PM, Arne Vajhøj wrote:
>>
>> For instance I can do:
>>
>> class IdentifierTest {
>> class _\u0001 {}
>> class _\u0001\u0001 {}
>> }
>>
>> and javac doesn't complain
>
> My javac complains.
>
> :-)
Well, I guess that is what I get for not doing what I said.
I used the Eclipse Java compiler to compile my example above.
When I use javac I get:
javac -version
javac 1.8.0_252
javac Z.java
Z.java:2: warning: '_' used as an identifier
class _\u0001{}
^
(use of '_' as an identifier might not be supported in releases after
Java SE 8)
Z.java:3: error: illegal unicode escape
class _\u001\u0001{}
^
Z.java:3: warning: '_' used as an identifier
class _\u001\u0001{}
^
(use of '_' as an identifier might not be supported in releases after
Java SE 8)
1 error
2 warnings
When I compile and run in Eclipse using OpenJDK 8 and 11 :
class Z {
public static void main(String[] args) {
class _\u0001{String z = "z";}
class _\u0001\u0001{String z = "zz";}
_\u0001 Z = new _\u0001();
_\u0001\u0001 ZZ = new _\u0001\u0001();
System.out.println(Z.z + ZZ.z);
}
}
prints "zzz"
That's worrisome!
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 18:46 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-24 18:54 -0400
Re: Character.isIdentifierIgnorable Martin Gregorie <martin@mydomain.invalid> - 2020-04-24 23:07 +0000
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 20:12 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-24 20:29 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 20:37 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-24 22:24 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 23:36 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-25 12:57 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-25 13:01 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-25 13:39 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-25 13:51 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-25 14:36 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 23:41 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 20:25 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-24 20:32 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-24 20:42 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-25 09:53 -0400
Re: Character.isIdentifierIgnorable Arne Vajhøj <arne@vajhoej.dk> - 2020-04-25 12:55 -0400
Re: Character.isIdentifierIgnorable Jeff Higgins <invalid@invalid.org> - 2020-04-25 13:43 -0400
csiph-web