river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Creswell <dan.cresw...@gmail.com>
Subject Re: [jira] [Created] (RIVER-417) com.sun.jini.outrigger.FastList fails to compile using Java 7
Date Sat, 09 Feb 2013 19:53:45 GMT
Okay, I've had time to look at the rest of the diff. FastList in the
2.2.0 branch has been changed from trunk to directly access member
variables. As the member variables are private, JDK 6 javac
erroneously compiled the code, whilst JDK 7 will fail it in the same
way as it fails the call to the private remove() method.

FastList in trunk has the member variables private also instead
providing a set of accessor methods which are used by the rest of the
code and thus compiles under both JDK 6 and JDK 7.

Hotspot will trivially in-line the accessor methods and thus the
changes in FastList 2.2.0 are of little value. Probably the quickest
fix is to revert FastList 2.2.0 to the trunk version.

Later,

Dan.


On 9 February 2013 17:10, Dan Creswell <dan.creswell@gmail.com> wrote:
> Mmm, not so sure.
>
> I have JDK 1.7.0_11 on a Mac here and if I checkout trunk, I get a
> clean compile. I checkout 2.2.0 and I get a compile fail with errors
> like those you list below.
>
> If i diff FastList I can see that in 2.2.0, Node.remove is private
> synchronized and in trunk it's package private.
>
> Now, check this out:
>
> http://stackoverflow.com/questions/12043831/javac-behavior-change-in-jdk-7-regarding-private-member-access
>
> And see here:
>
> http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#behavioral
>
> (Search for "Compiler No Longer Allows Access to Private Members of
> Type Variables")
>
> removable is a type variable and node surely has private access on
> remove(). So I think the compiler is right, JDK 6 javac would actually
> compile it but that would erroneous.
>
> Dunno, but I would imagine reverting remove() to package access would
> fix one of 'em, looks like the other members have been private all
> along and are now falling foul of this compiler change. They'll need
> tweaking as well....
>
> Wadaya think?
>
> On 9 February 2013 14:40, Dennis Reedy <dennis.reedy@gmail.com> wrote:
>>
>> On Feb 9, 2013, at 1219AM, Peter Firmstone wrote:
>>
>>> Dennis Reedy wrote:
>>>> On Feb 8, 2013, at 1055PM, Peter Firmstone wrote:
>>>>
>>>>
>>>>> Dennis Reedy (JIRA) wrote:
>>>>>
>>>>>> Dennis Reedy created RIVER-417:
>>>>>> ----------------------------------
>>>>>>
>>>>>>           Summary: com.sun.jini.outrigger.FastList fails to compile
using Java 7
>>>>>>               Key: RIVER-417
>>>>>>               URL: https://issues.apache.org/jira/browse/RIVER-417
>>>>>>           Project: River
>>>>>>        Issue Type: Bug
>>>>>>          Reporter: Dennis Reedy
>>>>>>
>>>>>>
>>>>>> Inner class Node has private properties that are accessed by inner
class FastListIteratorImpl
>>>>>>
>>>>>> --
>>>>>> This message is automatically generated by JIRA.
>>>>>> If you think it was sent incorrectly, please contact your JIRA administrators
>>>>>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>>>>>
>>>>>>
>>>>> Are you sure?
>>>>
>>>> Yes.
>>>>
>>>>
>>>>> Which version?
>>>>>
>>>>
>>>>
>>>> java -version
>>>> java version "1.7.0_13"
>>>> Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
>>>> Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
>>>>
>>> Compiles with 1.7.0_04-b20
>>
>> I'm wondering if it's really just not just latest Java release (1.7.0_13). I issue
with Levels and now this
>>
>>>
>>> Can you do me a favour and show the the compiler output?
>>
>> [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:156:
error: remove() has private access in Node
>>    [javac]                 removable.remove();
>>    [javac]                          ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:174:
error: index has private access in Node
>>    [javac]                 if (node.index >= index) {
>>    [javac]                         ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:216:
error: list has private access in Node
>>    [javac]             if (node.list == null) {
>>    [javac]                     ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:217:
error: list has private access in Node
>>    [javac]                 node.list = this;
>>    [javac]                     ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:223:
error: index has private access in Node
>>    [javac]         node.index = nextIndex.getAndIncrement();
>>    [javac]             ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:238:
error: list has private access in Node
>>    [javac]             if (node.list != this) {
>>    [javac]                     ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:242:
error: remove() has private access in Node
>>    [javac]             return node.remove();
>>    [javac]                        ^
>>    [javac] /Users/dreedy/dev/src/projects/river/river-2.2/src/com/sun/jini/outrigger/FastList.java:255:
error: index has private access in Node
>>    [javac]             if (node.index >= stopIndex) {
>>
>>

Mime
View raw message