play.classloading.enhancers.LocalvariablesNamesEnhancer exception that probably needs fixing before 1.22 if not already fixed

165 views
Skip to first unread message

Ivan Meredith

unread,
May 24, 2011, 6:48:27 AM5/24/11
to play-fr...@googlegroups.com
Sorry if someone else has already emailed about this, I did search :)

http://play.lighthouseapp.com/projects/57987-play-framework/tickets/857-unexpectedexception-while-applying-class-playclassloadingenhancerslocalvariablesnamesenhancer#ticket-857-2

Basically you get an exception like 

An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on controllers.Texts

when you try and use ++, or += like below (or --, -= etc)

// This example failes. 

int i=0;
for(int j = 0; j < 10; j++) System.out.println(i++);

// This example works. 

int i=0;
for(int j = 0; j < 10; j++) { i++; System.out.println(i);}

II'm not sure how the code works or I would try submitting a patch.

(p.s we have at least 3 people that can reproduce this, the ticket submitter, me, and fredix on irc)

Stéphane Godbillon

unread,
May 24, 2011, 7:33:04 AM5/24/11
to play-fr...@googlegroups.com
Yes, I noticed it too a couple of days ago. But at the first look it
seems to be a javassist bug :

Caused by: play.exceptions.UnexpectedException: While applying class
play.classloading.enhancers.LocalvariablesNamesEnhancer on
controllers.Application
at play.CorePlugin.enhance(CorePlugin.java:299)
at play.plugins.PluginCollection.enhance(PluginCollection.java:434)
... 5 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 5
at javassist.bytecode.stackmap.Tracer.doLDC(Tracer.java:273)
at javassist.bytecode.stackmap.Tracer.doOpcode0_53(Tracer.java:185)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:94)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:161)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:171)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:120)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:404)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:389)
at javassist.CtBehavior.insertBefore(CtBehavior.java:674)
at javassist.CtBehavior.insertBefore(CtBehavior.java:640)

I will look at it closer.
--
Stephane Godbillon

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>

Ivan Meredith

unread,
May 24, 2011, 8:23:35 AM5/24/11
to play-fr...@googlegroups.com
Ah, well even if its a javassist bug I guess it still needs to be worked around temporarily

It's certainly no fun for people that get the error and haven't seen this bug report as its an obtuse message.

2011/5/24 Stéphane Godbillon <s...@zenexity.fr>

ogregras

unread,
Nov 13, 2011, 8:20:27 PM11/13/11
to play-fr...@googlegroups.com
I just got this exception...

+1 to at least document this problem if it won't be fixed!

It's not easy to understand what's happening with a "UnexpectedException While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer" exception message!

Thanks for this thread!

Stéphane Godbillon

unread,
Nov 20, 2011, 12:11:18 PM11/20/11
to play-fr...@googlegroups.com
Hi,

Should be fixed with this pull request :
https://github.com/playframework/play/pull/384 .

Cheers :)
--
Stephane Godbillon

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.

> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/O00a-gf77WUJ.

ogregras

unread,
Nov 20, 2011, 12:21:11 PM11/20/11
to play-fr...@googlegroups.com
Thanks Stephane. But I'm not used to those kind of fixes (and not used to Git either).. It is written "Theses fixes won't apply to master since the localvariable enhancer logic has changed.". Does it mean they will never be part of a release? That I have to apply the diff by myself?

Stéphane Godbillon

unread,
Nov 20, 2011, 12:23:39 PM11/20/11
to play-fr...@googlegroups.com
Nope, it just means that the fixes I did are for 1.2.x but do not
apply to master (master has a very different logic to retrieve the
local variable names).

--
Stephane Godbillon

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/play-framework/-/RU9qnwzFgx8J.

Reply all
Reply to author
Forward
0 new messages