Documentation of Project Coin features as implemented in the JDK 7 developer preview
Rémi Forax
forax at univ-mlv.fr
Wed Mar 9 06:30:31 PST 2011
On 03/09/2011 03:17 PM, Maurizio Cimadamore wrote:
> On 09/03/11 13:49, Eamonn McManus wrote:
>>> So it is more a compiler bug erroneously accepting spaces 'inside' the
>>> diamond. The compiler should be fixed.
>> I don't understand this. We're not introducing a new lexical<> token,
>> are we? So obviously the compiler must allow spaces between< and>,
>> as between any pair of tokens. Stylistically, some people might prefer
>> to write List< Integer>, say, and would certainly be surprised not
>> to be able to write List< >.
> I think it would be better if the compiler would be stricter about this,
> and to deal with diamond as if it were a token - otherwise, programmer
> might abuse of current behavior:
>
> new ArrayList< >();
>
> new ArrayList<
> >();
>
> Which is ugly.
>
> Maurizio
It's not fundamentally different from
new ArrayList
<>
();
which is legal.
And considering <> is a kind of new operator is weird.
As Éamonn says new ArrayList < String > is legal so new ArrayList < >
should be legal.
Rémi
>> Éamonn
>>
>> On 9/3/11 2:25 PM, Maurizio Cimadamore wrote:
>>> On 09/03/11 12:57, Ulf Zibis wrote:
>>>> Why do you allow whitespace between the "<" and">" of a diamond.
>>> Good catch - I don't think this is a spec problem, as the grammar for
>>> diamond is defined as follows in the latest draft:
>>>
>>> /TypeArgumentsOrDiamond:/
>>>
>>> /TypeArguments/
>>>
>>> |<||>|
>>>
>>>
>>> So it is more a compiler bug erroneously accepting spaces 'inside' the
>>> diamond. The compiler should be fixed.
>>>
>>> Maurizio
>>>> Is whitespace allowed for ++ operator e.g.?
>>>>
>>>> -Ulf
>>>>
>>>>
>>>> Am 09.03.2011 07:40, schrieb Joe Darcy:
>>>>> Joe Darcy wrote:
>>>>>> Hello.
>>>>>>
>>>>>> I've posted documentation of the semantics of the Project Coin
>>>>>> features as implemented in the JDK 7 developer preview, b130, at:
>>>>>> http://cr.openjdk.java.net/~darcy/ProjectCoin/ProjectCoin-Documentation-v0.83.html
>>>>>>
>>>>>>
>>>>>> Before sending in comments or questions about a feature to coin-dev,
>>>>>> please read the discussion section after a feature. Many design
>>>>>> considerations are discussed in those sections. Additionally, some
>>>>>> known bugs in the current implementation are noted in the text. In
>>>>>> particular, javac in the JDK 7 developer preview erroneously accepts
>>>>>> diamond combined with non-generic classes and accepts some uses of
>>>>>> diamond with anonymous inner classes. These bugs will be corrected in
>>>>>> future builds.
>>>>>>
>>>>>> Happy reading,
>>>>>>
>>>>>> -Joe
>>>>> No comments from the coin-dev readership on the posted documentation?
>>>>>
>>>>> -Joe
>>>>>
>>>>>
>
More information about the coin-dev
mailing list