dev@javaserverfaces.java.net

Re: Call for review for bug21207471

From: zhijun Ren <ren.zhijun_at_oracle.com>
Date: Mon, 15 Jun 2015 16:08:02 +0800

Sorry, the mail should be send to: dev_at_javaserverfaces.java.net

On 6/15/15, 16:06, zhijun Ren wrote:
> Hi Ed,
>
> /Cause I met the GF issue in 2.1.29 which need to co-work with GF, so
> I will firstly fix the /
> /issue in 2.1.20 which need only run on WLS./
> /
> Please help to review the code of which change bundle has been
> attached in the bug.
>
> 1. Not changed in 2.1.29, cause GF also has problem when scanning the
> java 8 class with lambda expression;
> Question is whether we need to file a bug for GF here?
> 2. Not add test for this bug, cause the test should be compiled by jdk 8;
> 3. Fix the scan issue by adding some unhandled tag types in constant pool;
> https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html
> /
> BR,
> Zhijun
>
> On 6/10/15, 10:19, zhijun Ren wrote:
>> Hi Ed,
>>
>> Yes, ArrayIndexOutOfBoundsException is not related to JSF and you can
>> see in the stack dump that their scanner
>> com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter can not
>> handle the class including the lambda expression.
>>
>> I just tested against gf4.1 with 2.2.x patch, the war application can
>> be deployed and run without the problem.
>>
>> BR,
>> Zhijun
>>
>> On 6/9/15, 20:57, Edward Burns wrote:
>>>>>>>> On Tue, 09 Jun 2015 16:26:07 +0800, zhijun
>>>>>>>> Ren<ren.zhijun_at_oracle.com> said:
>>> RZ> Hi Ed,
>>> RZ> As you required, I was planning to work on 2.1.20 first. I
>>> wrote an
>>> RZ> application with including the following class and compiled
>>> with java8
>>> RZ> and tested against glassfish3 and glassfish4 with java8 as the
>>> java
>>> RZ> platform:
>>>
>>> RZ> /_at_FacesComponent(value = "failingComponent")
>>> RZ> public class FailingComponent extends UIInput implements
>>> NamingContainer {
>>>
>>> RZ> @Override
>>> RZ> public String getFamily() {
>>> RZ> return UINamingContainer.COMPONENT_FAMILY;
>>> RZ> }
>>>
>>> RZ> @Override
>>> RZ> public void encodeBegin(final FacesContext context) throws
>>> RZ> IOException {
>>> RZ> init();
>>> RZ> super.encodeBegin(context);
>>> RZ> }
>>>
>>> RZ> protected void init() {
>>> RZ> final List<Object> list = new ArrayList<>(0);
>>> RZ> // comment out following useless stream/lambda
>>> statements in
>>> RZ> order to
>>> RZ> // make this component work.
>>> RZ> list.stream()
>>> RZ> .sorted((a, b) ->
>>> (a.getClass().getName().compareTo(b
>>> RZ> .getClass().getName())))
>>> RZ> .filter((o) ->
>>> (!o.getClass().getName().isEmpty()));
>>> RZ> }
>>> RZ> }/
>>>
>>> RZ> this application can be deployed But it failed at the following
>>> RZ> exception when the first page accessed:
>>>
>>> RZ> /java.lang.ArrayIndexOutOfBoundsException: 26977
>>> RZ> at
>>> org.objectweb.asm.ClassReader.readUTF8(ClassReader.java:1946)
>>> RZ> at
>>> org.objectweb.asm.ClassReader.readClass(ClassReader.java:2015)
>>> RZ> at org.objectweb.asm.ClassReader.accept(ClassReader.java:469)
>>> RZ> at org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
>>> RZ> at
>>> org.glassfish.hk2.classmodel.reflect.Parser$5.on(Parser.java:362)
>>> RZ> at
>>> RZ>
>>> com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.handleEntry(ReadableArchiveScannerAdapter.java:165)
>>> RZ> at
>>> RZ>
>>> com.sun.enterprise.v3.server.ReadableArchiveScannerAdapter.onSelectedEntries(ReadableArchiveScannerAdapter.java:127)
>>> RZ> at
>>> org.glassfish.hk2.classmodel.reflect.Parser.doJob(Parser.java:347)
>>> RZ> at
>>> RZ>
>>> org.glassfish.hk2.classmodel.reflect.Parser.access$300(Parser.java:67)
>>> RZ> at
>>> org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:306)
>>> RZ> at
>>> org.glassfish.hk2.classmodel.reflect.Parser$3.call(Parser.java:295)
>>> RZ> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>>> RZ> at
>>> RZ>
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>>> RZ> at
>>> RZ>
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>>> RZ> at java.lang.Thread.run(Thread.java:745)/
>>>
>>> RZ> So seems that glassfish can't handle this kind of class either.
>>>
>>> Wow, that's a surprise. So that ArrayIndexOutOfBoundsException has
>>> nothing to do with Mojarra?
>>>
>>> What happens if you try the above class (within a war of course) in
>>> GlassFish 4.1 with Mojarra 2.2.8-08 installed? Does it deploy?
>>>
>>> Ed
>>>