Re: 7.0 wishlist?

Hash: SHA1

Harold Yarmouth schreef:
Hendrik Maryns wrote:
Harold Yarmouth schreef:
Hendrik Maryns wrote:
[some attributions are missing here, but I think it's just me and
Hendrik alternating]

I am sorry for that.

It does, but let me think about this a bit:

{ 1, 3 } is an array, so should, like any array in Java, be passed by

Now, is it mutable? Take the method

public void nasty(int[] ints) {
ints[0] = 0;
// other stuff

What do you propose would happen if you did nasty({ 1, 3 })? Without
the comment, nothing of course, but let’s just assume the ‘other stuff’
does more with the array, like use its values.

What does it currently do if passed

static final int[] array = {1, 3};

If that array can actually be modified, then there's a bit of ugliness
in Java, but it does not stem from any proposal of mine.

I think it is modifiable. AFAIK, there is no way in (current) Java to
make an array immutable.

I tend to agree that this is a bit of ugliness.

So I’d say: even you literal is mutable. I don’t think it is desirable
to introduce new behavior here.

But are we? See above.

Which above? If you mean the array should be immutable, then AFAIK you
are introducing new behavior, since there is no way to do that now.

- --
Hendrik Maryns
Ask smart questions, get good answers:
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE -