FELIX-3898 (name parsing on BundleDependency) and FELIX-3899 (switch to Scala 2.1O)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1445590 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole-plugins/servicediagnostics/changelog.txt b/webconsole-plugins/servicediagnostics/changelog.txt
index d41155e..566f217 100644
--- a/webconsole-plugins/servicediagnostics/changelog.txt
+++ b/webconsole-plugins/servicediagnostics/changelog.txt
@@ -1,4 +1,13 @@
-Changes from 0.1.1 to 0.2.0
+Changes from 0.1.2 to 0.1.3
+---------------------------
+
+** Bug
+  * [FELIX-3898] name parsing issue on BundleDependency
+
+** Improvement
+  * [FELIX-3899] switch to Scala 2.10
+
+Changes from 0.1.1 to 0.1.2
 ---------------------------
 
 ** Bug
diff --git a/webconsole-plugins/servicediagnostics/core/pom.xml b/webconsole-plugins/servicediagnostics/core/pom.xml
index 86f16ef..7e24466 100644
--- a/webconsole-plugins/servicediagnostics/core/pom.xml
+++ b/webconsole-plugins/servicediagnostics/core/pom.xml
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.apache.felix</groupId>
     <artifactId>servicediagnostics.parent</artifactId>
-    <version>0.1.2</version>
+    <version>0.1.3-SNAPSHOT</version>
     <relativePath>../parent/pom.xml</relativePath>
   </parent>
 
@@ -37,7 +37,7 @@
     <dependency>
       <groupId>org.scala-lang</groupId>
       <artifactId>scala-library</artifactId>
-      <version>2.9.1</version>
+      <version>2.10.0</version>
       <scope>provided</scope>
     </dependency>
     <dependency>
diff --git a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DMNotAvail.scala b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DMNotAvail.scala
index 282e752..2985673 100644
--- a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DMNotAvail.scala
+++ b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DMNotAvail.scala
@@ -49,8 +49,8 @@
             comp <- dm.getComponents.map(_.asInstanceOf[Component])
             compdec = comp.asInstanceOf[ComponentDeclaration]
             deps = compdec.getComponentDependencies
-                          .map(dep => new Dependency(dep.getName.takeWhile(_ != ' '), 
-                                           dep.getName.dropWhile(_ != ' ').trim,
+                          .map(dep => new Dependency(dep.getName.takeWhile(_ != '('), 
+                                           dep.getName.dropWhile(_ != '(').trim,
                                            dep.getState != STATE_UNAVAILABLE_REQUIRED)).toList
           }
             // yield Comp builds a list of Comp out of the for comprehension
diff --git a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DSNotAvail.scala b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DSNotAvail.scala
index 9a44cdb..e1d3e9a 100644
--- a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DSNotAvail.scala
+++ b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/impl/DSNotAvail.scala
@@ -41,10 +41,13 @@
         // this involves a bit of type casting gymnastics because the underlying 
         // API uses mutables and no generic types
         // Option is used to avoid null pointers
+        /*val comps = scrService.getComponents
+        if (comps == null) Nil
+        else */
         (for {
-            comp <- Option(scrService.getComponents).flatten.map(_.asInstanceOf[Component])
-            service <- Option(comp.getServices).flatten
-            deps = Option(comp.getReferences).flatten
+            comp <- Option[Array[Component]](scrService.getComponents).getOrElse(Array())
+            service <- Option[Array[String]](comp.getServices).getOrElse(Array())
+            deps = Option[Array[Reference]](comp.getReferences).getOrElse(Array())
                           .map(dep => new Dependency(dep.getServiceName,
                                                      dep.getTarget,
                                                      dep.isSatisfied)).toList
diff --git a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/webconsole/WebConsolePlugin.scala b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/webconsole/WebConsolePlugin.scala
index 86752ab..2aaa6f4 100644
--- a/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/webconsole/WebConsolePlugin.scala
+++ b/webconsole-plugins/servicediagnostics/core/src/main/scala/servicediagnostics/webconsole/WebConsolePlugin.scala
@@ -38,6 +38,7 @@
  *
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
+//class WebConsolePlugin extends SimpleWebConsolePlugin("servicegraph", "Service Graph", "OSGi", Array[String]()) 
 class WebConsolePlugin extends SimpleWebConsolePlugin("servicegraph", "Service Graph", Array[String]()) 
 {
     var engine:ServiceDiagnostics = _ //dependency injection. see Activator.
diff --git a/webconsole-plugins/servicediagnostics/run.sh b/webconsole-plugins/servicediagnostics/run.sh
index 82f8f88..7c46988 100755
--- a/webconsole-plugins/servicediagnostics/run.sh
+++ b/webconsole-plugins/servicediagnostics/run.sh
@@ -4,7 +4,7 @@
 #scala 
 java -classpath $CLASSPATH org.apache.felix.servicediagnostics.sample.FelixLauncher \
   $SCALA\
-  core/target/org.apache.felix.servicediagnostics.plugin-0.1.2-SNAPSHOT.jar\
+  core/target/org.apache.felix.servicediagnostics.plugin-0.1.3-SNAPSHOT.jar\
   sample/target/servicediagnostics.sample-0.1.1-SNAPSHOT.jar\
   $REPO/org/apache/felix/org.apache.felix.main/4.0.3/org.apache.felix.main-4.0.3.jar\
   $REPO/org/apache/felix/org.apache.felix.dependencymanager/3.0.0/org.apache.felix.dependencymanager-3.0.0.jar\
diff --git a/webconsole-plugins/servicediagnostics/sample/pom.xml b/webconsole-plugins/servicediagnostics/sample/pom.xml
index 164e6ce..64e638a 100644
--- a/webconsole-plugins/servicediagnostics/sample/pom.xml
+++ b/webconsole-plugins/servicediagnostics/sample/pom.xml
@@ -32,8 +32,8 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.felix</groupId>
-      <artifactId>${project.groupId}.servicediagnostics.plugin</artifactId>
-      <version>0.1.2-SNAPSHOT</version>
+      <artifactId>org.apache.felix.servicediagnostics.plugin</artifactId>
+      <version>0.1.3-SNAPSHOT</version>
     </dependency>
     <!-- runtime dependencies. added to populate the local repository -->
     <dependency> 
@@ -84,18 +84,13 @@
     <dependency>
       <groupId>org.apache.servicemix.bundles</groupId>
       <artifactId>org.apache.servicemix.bundles.scala-library</artifactId>
-      <version>2.9.1_3</version>
+      <version>2.10.0</version>
     </dependency>
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
-        <groupId>org.scala-tools</groupId>
-        <artifactId>maven-scala-plugin</artifactId>
-      </plugin>
-
-      <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
         <configuration>