« Return to Thread: XMLParser: attribute gets truncated when updated

Re: Yikes! String is mutable! (was Re: [groovy-user] XMLParser: attribute gets truncated when updated)

by Scott Hickey-3 :: Rate this Message:

Reply to Author | View in Thread

I assume you understand that private access is possible in Java using reflection.
 
Scott

----- Original Message ----
From: Jim White <jim@...>
To: user@...
Sent: Friday, April 18, 2008 10:22:22 PM
Subject: Re: [groovy-user] Yikes! String is mutable! (was Re: [groovy-user] XMLParser: attribute gets truncated when updated)

Mike Dillon wrote:

> begin Jim White quotation:
>
>>This violation of private permits untold havoc and means all classes,
>>not just java.lang.String, are deprived of assurance that their API
>>contracts are enforced.  But such a succinct case is quite compelling.
>
> I brought this up a while ago:
>
>     http://www.nabble.com/Access-modifiers-in-Groovy-to13099409.html

Indeed, although the case is more compelling with 'ABC' than '[ "A",
"B", "C" ] as char[]'.

I also noted this problem in an earlier (but different) topic:

http://www.nabble.com/Re%3A-Why-does-Groovy-do-object-conversion--p15587047.html

And I should repeat here what I said there, please vote for this issue:

http://jira.codehaus.org/browse/GROOVY-1875

I'm confused now though, because at that time I got the impression that
only private methods were exposed, and I thought I had made a test for
myself that showed fields were protected.  I think though I must have
made a mistake there somewhere.

Ah, I see.  I was misled by the fact that private fields do not show up
in the property list of a class and mistakenly assumed that you couldn't
set a property that isn't in the list.  I'll update the issue.

As I say there, it is time to close the gaping hole and should do it for
1.6.  If it is too big an incompatiblity, and some users can't deal with
it right away (this being so close to time for 1.6RC1), then we can have
a switch to enable the old behavior for them.

Jim


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email







---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: XMLParser: attribute gets truncated when updated