[Tynstep-svn] r198 - in trunk/step/step-web/src: main/java/com/tyndalehouse/step/rest/controllers test/java/com/tyndalehouse/step/rest/controllers

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Sun Dec 19 04:35:11 MST 2010


Author: ChrisBurrell
Date: 2010-12-19 04:35:11 -0700 (Sun, 19 Dec 2010)
New Revision: 198

Modified:
   trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/FrontController.java
   trunk/step/step-web/src/test/java/com/tyndalehouse/step/rest/controllers/FrontControllerTest.java
Log:


Modified: trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/FrontController.java
===================================================================
--- trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/FrontController.java	2010-12-19 11:28:35 UTC (rev 197)
+++ trunk/step/step-web/src/main/java/com/tyndalehouse/step/rest/controllers/FrontController.java	2010-12-19 11:35:11 UTC (rev 198)
@@ -190,7 +190,8 @@
         final Class<? extends Object> controllerClass = controllerInstance.getClass();
 
         // try cache first
-        final String cacheKey = getCacheKey(controllerClass.getName(), methodName, args.length);
+        final String cacheKey = getCacheKey(controllerClass.getName(), methodName, args == null ? 0
+                : args.length);
 
         // retrieve method from cache, or put in cache if not there
         Method controllerMethod = this.methodNames.get(cacheKey);

Modified: trunk/step/step-web/src/test/java/com/tyndalehouse/step/rest/controllers/FrontControllerTest.java
===================================================================
--- trunk/step/step-web/src/test/java/com/tyndalehouse/step/rest/controllers/FrontControllerTest.java	2010-12-19 11:28:35 UTC (rev 197)
+++ trunk/step/step-web/src/test/java/com/tyndalehouse/step/rest/controllers/FrontControllerTest.java	2010-12-19 11:35:11 UTC (rev 198)
@@ -66,8 +66,8 @@
      */
     @Test
     public void testCacheKey() {
-        assertEquals("controllergetName",
-                new FrontController(mock(Injector.class)).getCacheKey("controller", "getName", null));
+        assertEquals("controllergetName7",
+                new FrontController(mock(Injector.class)).getCacheKey("controller", "getName", 7));
     }
 
     /**




More information about the Tynstep-svn mailing list