Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 22a0532f0f4351d8147c73d7d777d24e > files > 7

geronimo-specs-1.0-3.8.1mdv2008.0.src.rpm

*** specs/j2ee-jacc/src/java/javax/security/jacc/EJBMethodPermission.java.orig	2006-03-07 18:15:13.000000000 -0500
--- specs/j2ee-jacc/src/java/javax/security/jacc/EJBMethodPermission.java	2006-03-07 18:20:53.000000000 -0500
***************
*** 200,205 ****
--- 200,225 ----
              initActions();
          }
  
+         private static String getTypeName(Class klass) {
+             String className = klass.getName();
+                                                                                 
+             if (! klass.isArray())
+                 // not an Array, so we have the proper name
+                 return className;
+             else {
+                 // For an Array we need to find out its dimensions
+                 int dimentions = className.indexOf('L');
+                 // Clean up class name
+                 className = className.substring(dimentions + 1, className.length() - 1);                                                                                
+                 // Create a display name with the required format
+                 StringBuffer b = new StringBuffer(className.length() + 2 * dimentions);
+                 b.append(className);
+                 for (int i = 0; i < dimentions; ++i)
+                   b.append("[]");
+                 return b.toString();
+             }
+         }
+ 
          public MethodSpec(String mthdInterface, Method method) {
              checkMethodInterface(mthdInterface);
  
***************
*** 210,219 ****
              if (paramTypes.length == 0) {
                  methodParams = "";
              } else {
!                 StringBuffer buffer = new StringBuffer(paramTypes[0].getName());
!                 for (int i = 1; i < paramTypes.length; i++) {
                      buffer.append(",");
!                     buffer.append(paramTypes[i].getName());
                  }
                  methodParams = buffer.toString();
              }
--- 230,238 ----
              if (paramTypes.length == 0) {
                  methodParams = "";
              } else {
!                 StringBuffer buffer = new StringBuffer(getTypeName(paramTypes[0]));                for (int i = 1; i < paramTypes.length; i++) {
                      buffer.append(",");
!                     buffer.append(getTypeName(paramTypes[i]));
                  }
                  methodParams = buffer.toString();
              }