This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Re: maven and Java 1.6

No replies
Derek Chen-Becker
Joined: 2008-12-16,
User offline. Last seen 42 years 45 weeks ago.

dustin.whitney@gmail.com wrote:
> I want to use java.beans.ConstructorProperties which is only available
> in java 6

The -target option for scalac controls byte-code target, not source
version target. The following code compiles and runs just fine for me
with Scala 2.7.3:

package org.chen_becker.test

import java.beans.ConstructorProperties
import scala.reflect.BeanProperty

object JVM1_6Test {
def main(args : Array[String]) : Unit = {
print(new TestCP("Fred", 99))
}
}
@ConstructorProperties{val value = Array("name", "age")}
class TestCP(@BeanProperty val name : String, @BeanProperty val age : Int) {
override def toString = name + ":" + age
}

Also, you can use reply-all or the following procmail recipe to make
sure that replies go to the list instead of individual authors (unless
that's what you want):

# Auto-mogrify scala lists
:0 fhw
* ^List-Post:.*scala-user@listes.epfl.ch
|formail -f -a "Reply-To: scala-user@listes.epfl.ch"

Derek

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland