You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2013/08/27 01:11:23 UTC

Java 1.7 compiler issue

Hi,

I've just checkin a fix for this and appreciate it if someone could try it out on Java 1.6/1.7 on windows and confirm that it works.

https://issues.apache.org/jira/browse/FLEX-33667

Thanks,
Justin

Re: Java 1.7 compiler issue

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I was able to successfully compile a few test projects using the batches.

Thanks for trying that out.

Justin

Re: Java 1.7 compiler issue

Posted by Mark Kessler <ke...@gmail.com>.
I was able to successfully compile a few test projects using the batches.


On Mon, Aug 26, 2013 at 8:18 PM, Mark Kessler
<ke...@gmail.com>wrote:

> I've been using Java 1.7 for a while now and haven't had an issues issues
> with this one problem.  But I call the "mxmlc.bat" instead of "mxmlc" file
> directly.  I'll try the batch changes out and make sure I can still compile
> with it.
>
> -Mark
>
>

Re: Java 1.7 compiler issue

Posted by Mark Kessler <ke...@gmail.com>.
I've been using Java 1.7 for a while now and haven't had an issues issues
with this one problem.  But I call the "mxmlc.bat" instead of "mxmlc" file
directly.  I'll try the batch changes out and make sure I can still compile
with it.

-Mark


On Mon, Aug 26, 2013 at 8:04 PM, Alex Harui <ah...@adobe.com> wrote:

>
>
> On 8/26/13 5:01 PM, "Mark Kessler" <ke...@gmail.com> wrote:
>
> >Was this an eclipse / FB issue?
> At least one customer hit it in FB because it calls MXMLC directly (not
> through the batch or shell scripts.  I hit it doing an ANT build or
> Mustella run or both because I think they also call MXMLC.JAR directly,
> but it was a while ago.
>
> -Alex
>
>

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.

On 8/26/13 5:01 PM, "Mark Kessler" <ke...@gmail.com> wrote:

>Was this an eclipse / FB issue?
At least one customer hit it in FB because it calls MXMLC directly (not
through the batch or shell scripts.  I hit it doing an ANT build or
Mustella run or both because I think they also call MXMLC.JAR directly,
but it was a while ago.

-Alex


Re: Java 1.7 compiler issue

Posted by Mark Kessler <ke...@gmail.com>.
Was this an eclipse / FB issue?

-Mark


On Mon, Aug 26, 2013 at 7:11 PM, Justin Mclean <ju...@classsoftware.com>wrote:

> Hi,
>
> I've just checkin a fix for this and appreciate it if someone could try it
> out on Java 1.6/1.7 on windows and confirm that it works.
>
> https://issues.apache.org/jira/browse/FLEX-33667
>
> Thanks,
> Justin

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.

On 8/26/13 5:42 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>> It is doing the right thing for Java 6, but Java 7 is stricter.
>Sure understand that, but as I said looking at the code it seems to do
>the right thing ie can return 0,1 or -1 as required, obviously there
>something subtle in there.
Yes, the subtlety supposedly has to do with parameter ordering.  I think
if the sort tests a,b and b,a and gets inconsistent results it throws.  In
the example I linked to, I think the way null got handled was the issue.

>
>If swcScript1 == swcScript2 then that could possibly return -1 rather
>than the expected 0?
Not sure.
>
>Do we have a test case that we can reliable reproduce the issue?
I don't have one handy. It may be related to a particular set of swcs with
duplicate compilation units.  I know I hit it once but that was a while
ago.

-Alex


Re: Java 1.7 compiler issue

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> It is doing the right thing for Java 6, but Java 7 is stricter.
Sure understand that, but as I said looking at the code it seems to do the right thing ie can return 0,1 or -1 as required, obviously there something subtle in there.

It might be this section:
                    CompilationUnit swcScript1CompilationUnit = swcScript1.getCompilationUnit();
                    CompilationUnit swcScript2CompilationUnit = swcScript2.getCompilationUnit();

                    if (swcScript1CompilationUnit != null)
                    {
                        if (swcScript1CompilationUnit.hasTypeInfo)
                        {
                            return -1;
                        }
                    }
                    else if (swcScript2CompilationUnit != null)
                    {
                        if (swcScript2CompilationUnit.hasTypeInfo)
                        {
                            return 1;
                        }
                    }

If swcScript1 == swcScript2 then that could possibly return -1 rather than the expected 0?

Do we have a test case that we can reliable reproduce the issue?

Thanks,
Justin

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.

On 8/26/13 5:07 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>The exception points to compare in updateMaps in SwcGroup.java but it
>seems to be doing the right thing.
>
>https://github.com/apache/flex-sdk/blob/e1649ef1a28766647885c7ad2e61bd29a5
>6778a1/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java
>
>Justin
It is doing the right thing for Java 6, but Java 7 is stricter.  Here's an
example fix someone else did:
http://dertompson.com/2012/11/23/sort-algorithm-changes-in-java-7/

My understanding is that the key issue for that person was that there were
cases that mattered on the parameter order.

-Alex


Re: Java 1.7 compiler issue

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

The exception points to compare in updateMaps in SwcGroup.java but it seems to be doing the right thing.

https://github.com/apache/flex-sdk/blob/e1649ef1a28766647885c7ad2e61bd29a56778a1/modules/compiler/src/java/flex2/compiler/swc/SwcGroup.java

Justin

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.

On 8/26/13 4:49 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>> According to SO, the 'right' fix is to change the comparator in the
>> compiler code.
>Do you know which comparator?
Don't know off-hand.  I was hoping to figure it out from the stack trace.
> 
>
>I had a look at every Collections.sort, Arrays.sort and new Comparator()
>call and couldn't see anything obvious (ie no custom comparator or they
>return 0,1 and -1 as far as I can tell).
Yeah, I didn't see anything obvious in the 5 minutes I spent looking when
I hit this at one point, but it may have to implement an interface or
something like that.  I'd have to go find the SO article again (which I
think pointed to an Oracle article).

-Alex


Re: Java 1.7 compiler issue

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> According to SO, the 'right' fix is to change the comparator in the
> compiler code.
Do you know which comparator? 

I had a look at every Collections.sort, Arrays.sort and new Comparator() call and couldn't see anything obvious (ie no custom comparator or they return 0,1 and -1 as far as I can tell).

Thanks,
Justin

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.
According to SO, the 'right' fix is to change the comparator in the
compiler code.  I haven't looked into it, but I can try to fix it at some
point before we release again, if someone else doesn't beat me to it.

On 8/26/13 4:21 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>> I don't think it will work "everywhere".
>Where else would it need to change and can you provide a patch?
>
>Thanks,
>Justin


Re: Java 1.7 compiler issue

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I don't think it will work "everywhere". 
Where else would it need to change and can you provide a patch?

Thanks,
Justin

Re: Java 1.7 compiler issue

Posted by Alex Harui <ah...@adobe.com>.
I don't think it will work "everywhere".  The batch and shell scripts are
not always used to call MXMLC and COMPC.

On 8/26/13 4:11 PM, "Justin Mclean" <ju...@classsoftware.com> wrote:

>Hi,
>
>I've just checkin a fix for this and appreciate it if someone could try
>it out on Java 1.6/1.7 on windows and confirm that it works.
>
>https://issues.apache.org/jira/browse/FLEX-33667
>
>Thanks,
>Justin