activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1410077 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/main/scala/org/apache/activemq/apollo/br...
Date Thu, 15 Nov 2012 22:42:50 GMT
Author: chirino
Date: Thu Nov 15 22:42:46 2012
New Revision: 1410077

URL: http://svn.apache.org/viewvc?rev=1410077&view=rev
Log:
Clean up scala sources so the are more compatible /w Scala 2.10

Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBClient.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreFunSuiteSupport.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreTests.scala
    activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/SnappyTrait.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/UowHaveLocatorsTest.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala
    activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
    activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ClassFinder.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
    activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Result.scala
    activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
    activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/path/PathMapMemoryTest.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBClient.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBClient.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBClient.scala
Thu Nov 15 22:42:46 2012
@@ -88,7 +88,7 @@ class BDBClient(store: BDBStore) {
           -1
         }
       } catch {
-        case e => throw new Exception("Unexpected version file format: "+version_file)
+        case e:Throwable => throw new Exception("Unexpected version file format: "+version_file)
       }
       ver match {
         case STORE_SCHEMA_VERSION => // All is good.

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Broker.scala
Thu Nov 15 22:42:46 2012
@@ -163,7 +163,7 @@ object Broker extends Log {
     val data = mbean_server.getAttribute(new ObjectName("java.lang:type=Memory"), "HeapMemoryUsage").asInstanceOf[CompositeData]
     data.get("max").asInstanceOf[java.lang.Long].longValue()
   } catch {
-    case _ => 1024L * 1024 * 1024 // assume it's 1 GIG (that's the default apollo ships
with)
+    case _:Throwable => 1024L * 1024 * 1024 // assume it's 1 GIG (that's the default apollo
ships with)
   }
 
   val BLOCKABLE_THREAD_POOL = ApolloThreadPool.INSTANCE
@@ -203,7 +203,7 @@ object Broker extends Log {
         case _ => None
       }
     } catch {
-      case _ => None
+      case _:Throwable => None
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/CustomServiceFactory.scala
Thu Nov 15 22:42:46 2012
@@ -76,14 +76,14 @@ object SimpleCustomServiceFactory extend
       try {
         service.asInstanceOf[ServiceDuckType].broker = broker
       } catch {
-        case _ =>
+        case _:Throwable =>
       }
 
       // Try to inject the config via reflection..
       try {
         service.asInstanceOf[ServiceDuckType].config = dto
       } catch {
-        case _ =>
+        case _:Throwable =>
       }
 
       service

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/DestinationParser.scala
Thu Nov 15 22:42:46 2012
@@ -50,7 +50,7 @@ class DestinationParser extends PathPars
       null
     } else {
       val rc = new StringBuilder
-      addresses.foreach { address =>
+      addresses.foreach { address:DestinationAddress =>
         if (rc.length() != 0 ) {
           assert( destination_separator!=null )
           rc.append(destination_separator)

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/LocalRouter.scala
Thu Nov 15 22:42:46 2012
@@ -231,7 +231,7 @@ class LocalRouter(val virtual_host:Virtu
         val owner = address.path.parts(2).asInstanceOf[LiteralPart]
         Some((broker.value, owner.value))
       } catch {
-        case _ => None
+        case _:Throwable => None
       }
     }
   }
@@ -518,14 +518,14 @@ class LocalRouter(val virtual_host:Virtu
           dest.unbind_durable_subscription(dsub)
         }
 
-        // Delete any consumer temp queues..
-        for( consumer <- dest.consumers ) {
-          consumer match {
-            case queue:Queue =>
-              _destroy_queue(queue)
-            case _ =>
-          }
-        }
+//        // Delete any consumer temp queues..
+//        for( consumer <- dest.consumers ) {
+//          consumer match {
+//            case queue:Queue =>
+//              _destroy_queue(queue)
+//            case _ =>
+//          }
+//        }
 
         // Un-register the topic.
         remove_destination(path, dest)
@@ -622,14 +622,14 @@ class LocalRouter(val virtual_host:Virtu
     }
 
     def unbind_topics(queue: Queue, topics: Traversable[_ <: BindAddress]) {
-      topics.foreach { topic =>
+      topics.foreach { topic:BindAddress =>
         var matches = local_topic_domain.get_destination_matches(topic.path)
         matches.foreach(_.unbind_durable_subscription(queue))
       }
     }
 
     def bind_topics(queue: Queue, address: SubscriptionAddress, topics: Traversable[_ <:
BindAddress]) {
-      topics.foreach { topic =>
+      topics.foreach { topic:BindAddress =>
         val wildcard = PathParser.containsWildCards(topic.path)
         var matches = local_topic_domain.get_destination_matches(topic.path)
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/jetty/JettyWebServer.scala
Thu Nov 15 22:42:46 2012
@@ -50,7 +50,7 @@ object JettyWebServerFactory extends Web
     this.getClass.getClassLoader.loadClass(classOf[WebAppContext].getName)
     true
   } catch {
-    case _ =>
+    case _:Throwable =>
     false
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/Protocol.scala
Thu Nov 15 22:42:46 2012
@@ -150,10 +150,10 @@ object SimpleProtocolFilter2Factory exte
       }
       try {
         filter.asInstanceOf[FilterDuckType].protocol_handler = handler
-      } catch { case _ => }
+      } catch { case _:Throwable => }
       try {
         filter.asInstanceOf[FilterDuckType].dto = dto
-      } catch { case _ => }
+      } catch { case _:Throwable => }
       filter
     case _ => null
   }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/protocol/UdpProtocol.scala
Thu Nov 15 22:42:46 2012
@@ -193,7 +193,7 @@ abstract class UdpProtocolHandler extend
           try {
             route = new UdpProducerRoute(host, address)
           } catch {
-            case e =>
+            case e:Throwable =>
               // We could run into a error like the address not parsing
               debug(e, "Could not create the producer route")
               return

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
Thu Nov 15 22:42:46 2012
@@ -166,16 +166,17 @@ trait DelayingStoreSupport extends Store
 
 
     def on_complete(callback: (Boolean)=>Unit) = {
-      if(this.synchronized {
-        if( state eq UowCompleted ) {
-          true
+      var (completed, value) = this.synchronized {
+        if (state eq UowCompleted) {
+          (true, canceled)
         } else {
           flush_sync = true
           complete_listeners += callback
-          false
+          (false, canceled)
         }
-      }) {
-        callback
+      }
+      if(completed) {
+        callback(value)
       }
     }
     

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
Thu Nov 15 22:42:46 2012
@@ -79,7 +79,7 @@ case class ImportStreamManager(source:In
     }
     read_text(stream).toInt
   } catch {
-    case e => new IOException("Could not determine export format version: "+e)
+    case e:Throwable => new IOException("Could not determine export format version: "+e)
   }
   
   def getNext:AnyRef = {

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
Thu Nov 15 22:42:46 2012
@@ -205,7 +205,7 @@ class MultiBrokerTestSupport extends Fun
       try {
         admin.afterAll
       } catch {
-        case e => debug(e)
+        case e:Throwable => debug(e)
       }
     }
     admins = Array()

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreFunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreFunSuiteSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreFunSuiteSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreFunSuiteSupport.scala
Thu Nov 15 22:42:46 2012
@@ -121,7 +121,7 @@ abstract class StoreFunSuiteSupport exte
       next_seq += 1
     }
 
-    val tracker = new TaskTracker()
+    val tracker = new TaskTracker("unknown", 0)
 
     val task = tracker.task("uow complete")
     batch.on_complete(task.run)

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreTests.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreTests.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreTests.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/store/StoreTests.scala
Thu Nov 15 22:42:46 2012
@@ -124,7 +124,7 @@ abstract class StoreTests extends StoreF
     val m1 = add_message(batch, "message 1")
     batch.enqueue(entry(A, 1, m1))
 
-    val tracker = new TaskTracker()
+    val tracker = new TaskTracker("unknown", 0)
     val task = tracker.task("uow complete")
     batch.on_complete(task.run)
     batch.release
@@ -144,7 +144,7 @@ abstract class StoreTests extends StoreF
     val m1 = add_message(batch, "message 1")
     batch.enqueue(entry(A, 1, m1))
 
-    val tracker = new TaskTracker()
+    val tracker = new TaskTracker("unknown", 0)
     val task = tracker.task("uow complete")
     batch.on_complete(task.run)
     batch.release

Modified: activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Create.scala
Thu Nov 15 22:42:46 2012
@@ -253,7 +253,7 @@ class Create extends Action {
       getClass.getClassLoader.loadClass(name)
       true
     } catch {
-      case _ => false
+      case _:Throwable => false
     }
   }
 
@@ -278,7 +278,7 @@ class Create extends Action {
     try {
         system(path.getParentFile(), Array("chmod", "a+x", path.getName))
     } catch {
-      case x =>
+      case _:Throwable =>
     }
   }
 
@@ -296,7 +296,7 @@ class Create extends Action {
               c = is.read(buffer)
             }
           } catch {
-            case x =>
+            case _:Throwable =>
           }
         }
       }.start

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/SnappyTrait.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/SnappyTrait.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/SnappyTrait.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/SnappyTrait.scala
Thu Nov 15 22:42:46 2012
@@ -53,7 +53,7 @@ package object leveldb  {
             attempt = Thread.currentThread().getContextClassLoader().loadClass(name).newInstance().asInstanceOf[SnappyTrait];
             attempt.compress("test")
         } catch {
-          case _ =>
+          case _:Throwable =>
             attempt = null
         }
       }

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBClient.scala
Thu Nov 15 22:42:46 2012
@@ -304,7 +304,7 @@ class LevelDBClient(store: LevelDBStore)
           -1
         }
       } catch {
-        case e => throw new Exception("Unexpected version file format: " + version_file)
+        case e:Throwable => throw new Exception("Unexpected version file format: " + version_file)
       }
       ver match {
         case STORE_SCHEMA_VERSION => // All is good.
@@ -506,7 +506,7 @@ class LevelDBClient(store: LevelDBStore)
           }
           referenced_queues += queue_key
         } catch {
-          case e =>
+          case e:Throwable =>
             trace("invalid queue entry record: %s, error: %s", new Buffer(key), e)
             fixed_records += 1
             // Invalid record.
@@ -526,7 +526,7 @@ class LevelDBClient(store: LevelDBStore)
           }
           referenced_queues -= queue_key
         } catch {
-          case e =>
+          case e:Throwable =>
             trace("invalid queue record: %s, error: %s", new Buffer(key), e)
             fixed_records += 1
             // Invalid record.

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/UowHaveLocatorsTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/UowHaveLocatorsTest.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/UowHaveLocatorsTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/test/scala/org/apache/activemq/apollo/broker/store/leveldb/UowHaveLocatorsTest.scala
Thu Nov 15 22:42:46 2012
@@ -50,7 +50,7 @@ class UowHaveLocatorsTest extends StoreF
     val queueEntryRecord: QueueEntryRecord =  entry(queue, 1, m1)
     batch.enqueue(queueEntryRecord)
 
-    var tracker = new TaskTracker()
+    var tracker = new TaskTracker("uknown", 0)
     var task = tracker.task("uow complete")
     batch.on_complete(task.run)
     batch.release
@@ -65,7 +65,7 @@ class UowHaveLocatorsTest extends StoreF
     val batch2 = store.create_uow
     batch2.enqueue(queueEntryRecord)
 
-    tracker = new TaskTracker()
+    tracker = new TaskTracker("uknown", 0)
     task = tracker.task("uow complete")
     batch2.on_complete(task.run)
     batch2.release

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/OpenwireTestSupport.scala
Thu Nov 15 22:42:46 2012
@@ -41,7 +41,7 @@ class OpenwireTestSupport extends Broker
       try {
         connection.close()
       } catch {
-        case e =>
+        case e:Throwable =>
       }
     }
     connections = Nil

Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-openwire/src/test/scala/org/apache/activemq/apollo/openwire/test/SecurityTest.scala
Thu Nov 15 22:42:46 2012
@@ -58,7 +58,7 @@ class SecurityTest extends OpenwireTestS
     try {
       connect("?jms.alwaysSyncSend=true", user="can_only_connect", password="can_only_connect")
     } catch {
-      case e =>
+      case e:Throwable =>
         e.printStackTrace()
         fail("Should not have thrown an exception ")
     }
@@ -114,7 +114,7 @@ class SecurityTest extends OpenwireTestS
     try {
       producer.send(session.createTextMessage("Test Message"))
     } catch {
-      case e => fail("Should not have thrown an exception")
+      case e:Throwable => fail("Should not have thrown an exception")
     }
   }
 
@@ -129,7 +129,7 @@ class SecurityTest extends OpenwireTestS
       producer.send(session.createTextMessage("Test Message"))
       fail("Should have thrown an exception since dest is not created.")
     } catch {
-      case e =>
+      case e:Throwable =>
     }
 
     // Now actually create it...
@@ -138,7 +138,7 @@ class SecurityTest extends OpenwireTestS
     try {
       producer.send(session.createTextMessage("Test Message"))
     } catch {
-      case e =>
+      case e:Throwable =>
         e.printStackTrace()
         fail("Should not have thrown an exception since it was created")
     }

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompProtocolHandler.scala
Thu Nov 15 22:42:46 2012
@@ -1245,7 +1245,7 @@ class StompProtocolHandler extends Proto
             rc ::= (REPLY_TO -> encode_header(encode_address(dests)))
           }
         } catch {
-          case _=> // the translation is a best effort thing.
+          case _:Throwable=> // the translation is a best effort thing.
         }
       }
     }
@@ -1406,7 +1406,7 @@ class StompProtocolHandler extends Proto
 
     val selector = get(headers, SELECTOR) match {
       case None=> null
-      case Some(x)=> x
+      case Some(x)=>
         try {
           val s = decode_header(x)
           (s, SelectorParser.parse(s))

Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/main/scala/org/apache/activemq/apollo/stomp/StompUdpProtocol.scala
Thu Nov 15 22:42:46 2012
@@ -172,7 +172,7 @@ class StompUdpProtocol extends UdpProtoc
         })
 
       } catch {
-        case e => None
+        case e:Throwable => None
       }
 
     }

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ClassFinder.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ClassFinder.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ClassFinder.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/ClassFinder.scala
Thu Nov 15 22:42:46 2012
@@ -90,7 +90,7 @@ object ClassFinder extends Log {
       try {
         is.close()
       } catch {
-        case _ =>
+        case _:Throwable =>
       }
     }
   }

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/FileSupport.scala
Thu Nov 15 22:42:46 2012
@@ -123,7 +123,7 @@ object FileSupport {
     try {
       proc(closable)
     } finally {
-      try { closable.close  }  catch { case ignore =>  }
+      try { closable.close  }  catch { case ignore:Throwable =>  }
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Result.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Result.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Result.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/main/scala/org/apache/activemq/apollo/util/Result.scala
Thu Nov 15 22:42:46 2012
@@ -19,7 +19,7 @@ package org.apache.activemq.apollo.util
 object ResultSupport {
 
   case class RichResult[A,F](self: Result[A,F]) {
-    def then[B](r2: =>Result[B,F]):Result[B,F] = {
+    def andThen[B](r2: =>Result[B,F]):Result[B,F] = {
       if( self.failed ) {
         Failure(self.failure)
       } else {

Modified: activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/FunSuiteSupport.scala
Thu Nov 15 22:42:46 2012
@@ -52,7 +52,7 @@ abstract class FunSuiteSupport extends F
       "."
     }
   } catch {
-    case x=>
+    case x:Throwable =>
       "."
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/path/PathMapMemoryTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/path/PathMapMemoryTest.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/path/PathMapMemoryTest.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-util/src/test/scala/org/apache/activemq/apollo/util/path/PathMapMemoryTest.scala
Thu Nov 15 22:42:46 2012
@@ -34,27 +34,26 @@ class PathMapMemoryTest {
     map.put(d1, "test")
   }
 
-  @Test def testVeryLongPaths: Unit = {
-    {
-      var i: Int = 1
-      while (i < 100) {
-        var name: String = "1"
-        var j: Int = 2
-        while (j <= i) {
-          name += "." + j
-          j += 1; j
-        }
-        try {
-          var d1: Path = createDestination(name)
-          var map: PathMap[String] = new PathMap[String]
-          map.put(d1, "test")
-        } catch {
-          case e: Throwable => {
-            fail(("Destination name too long: " + name + " : " + e))
-          }
+  @Test
+  def testVeryLongPaths = {
+    var i = 1
+    while (i < 100) {
+      var name: String = "1"
+      var j = 2
+      while (j <= i) {
+        name += "." + j
+        j += 1;
+      }
+      try {
+        var d1: Path = createDestination(name)
+        var map: PathMap[String] = new PathMap[String]
+        map.put(d1, "test")
+      } catch {
+        case e: Throwable => {
+          fail(("Destination name too long: " + name + " : " + e))
         }
-        i += 1; i
       }
+      i += 1
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
Thu Nov 15 22:42:46 2012
@@ -161,7 +161,7 @@ class BrokerResource() extends Resource 
       try {
         func
       } catch {
-        case _ => // ignore
+        case _:Throwable => // ignore
       }
     }
 

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala?rev=1410077&r1=1410076&r2=1410077&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/Support.scala
Thu Nov 15 22:42:46 2012
@@ -92,13 +92,13 @@ abstract class Resource(parent:Resource=
     throw new WebApplicationException(Response.ok().build)
   }
 
-  def if_ok[T](func: =>T)(then: =>T):T = {
+  def if_ok[T](func: =>T)(andThen: =>T):T = {
     try {
       func
     } catch {
       case e:WebApplicationException =>
         if( e.getResponse.getStatus == 200 ) {
-          then
+          andThen
         } else {
           throw e;
         }



Mime
View raw message