You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by stephanos <st...@gmail.com> on 2010/11/03 18:21:15 UTC

Problem with Scala's 'lazy val' in Pages

Something I just noticed: I have a class 'BasePage' which every page inherits
from, this base class has a Scala 'lazy val' field (private) - yet this
error is issues (seems 
http://scala-programming-language.1934581.n4.nabble.com/Why-is-bitmap-0-public-td2255232.html
Scala creates a public field  for it).

Stacktrace:
Caused by: java.lang.RuntimeException: Class
com.lumberjack.web.pages.base.BasePage contains field(s) (bitmap$0) that are
not private. You should change these fields to private, and add accessor
methods if needed.  
	at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadFields(InternalClassTransformationImpl.java:940)
~[tapestry-core-5.2.2.jar:5.2.2]
	at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.preloadMembers(InternalClassTransformationImpl.java:886)
~[tapestry-core-5.2.2.jar:5.2.2]
	at
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.<init>(InternalClassTransformationImpl.java:805)
~[tapestry-core-5.2.2.jar:5.2.2]
	at
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:186)
~[tapestry-core-5.2.2.jar:5.2.2]

Dunno if/how you want to handle this. Just wanted to bring it up :)

Cheers
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3248823.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Scala's 'lazy val' in Pages

Posted by stephanos <st...@gmail.com>.
Cool - thanks, will look into it :)
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3249068.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Scala's 'lazy val' in Pages

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 03 Nov 2010 18:00:29 -0200, stephanos <st...@gmail.com>  
wrote:

> I know what the message says :)
> I'm merely pointing out that there might be a problem for some users - I
> meanwhile re-wrote the 'lazy val'-thing.

Ooops, I'm sorry for misunderstanding your post. By the way, François  
Armand posted some nice articles about Scala with Tapestry in his blog:  
http://fanf42.blogspot.com/search/label/tapestry%205.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Scala's 'lazy val' in Pages

Posted by stephanos <st...@gmail.com>.
I know what the message says :)
I'm merely pointing out that there might be a problem for some users - I
meanwhile re-wrote the 'lazy val'-thing.
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Problem-with-Scala-s-lazy-val-in-Pages-tp3248823p3249059.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Problem with Scala's 'lazy val' in Pages

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 03 Nov 2010 15:21:15 -0200, stephanos <st...@gmail.com>  
wrote:

> Something I just noticed: I have a class 'BasePage' which every page  
> inherits from, this base class has a Scala 'lazy val' field (private) -  
> yet this
> error is issues (seems  
> http://scala-programming-language.1934581.n4.nabble.com/Why-is-bitmap-0-public-td2255232.html
> Scala creates a public field  for it).

Hi!

Tapestry's page classes cannot have non-private fields, just as the error  
message said:

> com.lumberjack.web.pages.base.BasePage contains field(s) (bitmap$0) that  
> are not private. You should change these fields to private, and add  
> accessor
> methods if needed.

I want to learn Scala some day, but I haven't had the time yet. Do you  
need to use this lazy val language feature?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org