From ba6388b3fe5c3f2462fe5074a0ea42cd79c83a72 Mon Sep 17 00:00:00 2001 From: Ruben Wagner Date: Sat, 10 Aug 2013 00:51:36 +0200 Subject: [PATCH] prepare release 0.8 --- build.sbt | 4 ++-- .../classfile/ClassFileInterpretation.scala | 16 ++++------------ .../classfile/filter/ClassAnnotationFilter.scala | 5 +++-- .../classfile/filter/InterfaceFilter.scala | 5 +++-- .../classfile/filter/SuperClassFilter.scala | 5 +++-- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/build.sbt b/build.sbt index eb475d7..4d8a073 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ name := "scanndal" version := "0.8" -scalaVersion := "2.9.3" +scalaVersion := "2.10.2" homepage := Some(url("https://github.com/ouven/scanndal/wiki")) @@ -23,7 +23,7 @@ publishTo <<= version { v: String => publishMavenStyle := true -scalacOptions += "-deprecation" +scalacOptions ++= Seq("-deprecation", "-feature") publishArtifact in Test := false diff --git a/src/main/scala/de/aktey/scanndal/classfile/ClassFileInterpretation.scala b/src/main/scala/de/aktey/scanndal/classfile/ClassFileInterpretation.scala index bb2c90a..7c15fec 100644 --- a/src/main/scala/de/aktey/scanndal/classfile/ClassFileInterpretation.scala +++ b/src/main/scala/de/aktey/scanndal/classfile/ClassFileInterpretation.scala @@ -13,24 +13,15 @@ package de.aktey.scanndal.classfile */ trait ClassFileInterpretation { - /** - * extend a de.aktey.scanndal.classfile.ClassFile - */ - implicit def extendClassFile(classFile: ClassFile) = new ExtendedClassFile(classFile) - - /** - * extend a de.aktey.scanndal.classfile.ConstantPoolEntryUtf8 - */ - implicit def extendConstantPoolEntryUtf8(cpe: ConstantPoolEntryUtf8) = new ExtendedConstantPoolEntryUtf8(cpe) - @inline def toCanonicalName(cpUtf8Entry: String) = cpUtf8Entry.replace('/', '.') @inline def fromCanonicalName(canonicalName: String) = canonicalName.replace('.', '/') /** + * extend a de.aktey.scanndal.classfile.ClassFile * @param classFile class file to extend */ - class ExtendedClassFile(classFile: ClassFile) { + implicit class ExtendedClassFile(classFile: ClassFile) { /** * get an index of a class name from the constant pool * @@ -90,9 +81,10 @@ trait ClassFileInterpretation { } /** + * extend a de.aktey.scanndal.classfile.ConstantPoolEntryUtf8 * @param constantPoolEntry utf8 pool entry to extend */ - class ExtendedConstantPoolEntryUtf8(constantPoolEntry: ConstantPoolEntryUtf8) { + implicit class ExtendedConstantPoolEntryUtf8(constantPoolEntry: ConstantPoolEntryUtf8) { /** * @return represented String utf-8 decoded */ diff --git a/src/main/scala/de/aktey/scanndal/classfile/filter/ClassAnnotationFilter.scala b/src/main/scala/de/aktey/scanndal/classfile/filter/ClassAnnotationFilter.scala index fcd28d3..be504c2 100644 --- a/src/main/scala/de/aktey/scanndal/classfile/filter/ClassAnnotationFilter.scala +++ b/src/main/scala/de/aktey/scanndal/classfile/filter/ClassAnnotationFilter.scala @@ -1,6 +1,7 @@ package de.aktey.scanndal.classfile.filter import de.aktey.scanndal.classfile.{ClassFileInterpretation, RuntimeVisibleAnnotationsAttribute, ClassFile} +import scala.reflect._ /** * Created with IntelliJ IDEA. @@ -13,8 +14,8 @@ import de.aktey.scanndal.classfile.{ClassFileInterpretation, RuntimeVisibleAnnot * test class files for a class annotation A * @tparam A the annotation class */ -class ClassAnnotationFilter[A: Manifest] extends Filter with ClassFileInterpretation { - val annotationTypeDescriptor = "L" + fromCanonicalName(manifest[A].erasure.getCanonicalName) + ";" +class ClassAnnotationFilter[A: ClassTag] extends Filter with ClassFileInterpretation { + val annotationTypeDescriptor = "L" + fromCanonicalName(classTag[A].runtimeClass.getCanonicalName) + ";" /** * @param cf classfile to test diff --git a/src/main/scala/de/aktey/scanndal/classfile/filter/InterfaceFilter.scala b/src/main/scala/de/aktey/scanndal/classfile/filter/InterfaceFilter.scala index e714afb..a7fe4ab 100644 --- a/src/main/scala/de/aktey/scanndal/classfile/filter/InterfaceFilter.scala +++ b/src/main/scala/de/aktey/scanndal/classfile/filter/InterfaceFilter.scala @@ -1,6 +1,7 @@ package de.aktey.scanndal.classfile.filter import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile} +import scala.reflect._ /** * Created with IntelliJ IDEA. @@ -8,8 +9,8 @@ import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile} * Date: 09.08.13 * Time: 23:33 */ -class InterfaceFilter[T: Manifest] extends Filter with ClassFileInterpretation { - val interfaceName = fromCanonicalName(manifest[T].erasure.getCanonicalName) +class InterfaceFilter[T: ClassTag] extends Filter with ClassFileInterpretation { + val interfaceName = fromCanonicalName(classTag[T].runtimeClass.getCanonicalName) def apply(classFile: ClassFile) = classFile .interfaces.toStream diff --git a/src/main/scala/de/aktey/scanndal/classfile/filter/SuperClassFilter.scala b/src/main/scala/de/aktey/scanndal/classfile/filter/SuperClassFilter.scala index 276e30b..4fa8700 100644 --- a/src/main/scala/de/aktey/scanndal/classfile/filter/SuperClassFilter.scala +++ b/src/main/scala/de/aktey/scanndal/classfile/filter/SuperClassFilter.scala @@ -1,6 +1,7 @@ package de.aktey.scanndal.classfile.filter import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile} +import scala.reflect._ /** * Created with IntelliJ IDEA. @@ -10,8 +11,8 @@ import de.aktey.scanndal.classfile.{ClassFileInterpretation, ClassFile} * * filters for all classes with the direct super type S */ -class SuperClassFilter[S: Manifest] extends Filter with ClassFileInterpretation { - val superTypeInfo = fromCanonicalName(manifest[S].erasure.getCanonicalName) +class SuperClassFilter[S: ClassTag] extends Filter with ClassFileInterpretation { + val superTypeInfo = fromCanonicalName(classTag[S].runtimeClass.getCanonicalName) def apply(cf: ClassFile) = cf.superClassName == superTypeInfo }