wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jra...@apache.org
Subject svn commit: r1027993 - /incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java
Date Wed, 27 Oct 2010 15:07:20 GMT
Author: jramos
Date: Wed Oct 27 15:07:19 2010
New Revision: 1027993

URL: http://svn.apache.org/viewvc?rev=1027993&view=rev
Log:
Error handling code in case proxy's are called out context

Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java?rev=1027993&r1=1027992&r2=1027993&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/registry/ContextAccessor.java
Wed Oct 27 15:07:19 2010
@@ -99,6 +99,12 @@ public class ContextAccessor {
                                               // use runtimeContext from TLS
                                               RuntimeContext runtimeContext =
                                                   RuntimeContextTLS.getRuntimeContext();
+                                              if (runtimeContext == null) {
+                                                  if("toString".equals(method.getName())
&& (args == null || args.length == 0)) {
+                                                      return "Proxy for " + contextClass.getName();
+                                                  }
+                                                  throw new IllegalStateException();
+                                              }
                                               // get the real context from the
                                               // RuntimeContext
                                               Object context =



Mime
View raw message