Fixed FELIX-2471 /No class def found error - Permissions Admin (see screenshot)/
https://issues.apache.org/jira/browse/FELIX-2471

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@963256 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/PermissionsConfigurationPrinter.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/PermissionsConfigurationPrinter.java
index 984cbd9..501092a 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/PermissionsConfigurationPrinter.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/PermissionsConfigurationPrinter.java
@@ -39,9 +39,9 @@
 

     private static final String TITLE = "Permissions";

 

-    private static final String PERMISSION_ADMIN_NAME = "org.osgi.service.permissionadmin.PermissionAdmin";

+    private static final String PERMISSION_ADMIN_NAME = "org.osgi.service.permissionadmin.PermissionAdmin"; //$NON-NLS-1$

 

-    private static final String CONDITIONAL_PERMISSION_ADMIN_NAME = "org.osgi.service.condpermadmin.ConditionalPermissionAdmin";

+    private static final String CONDITIONAL_PERMISSION_ADMIN_NAME = "org.osgi.service.condpermadmin.ConditionalPermissionAdmin"; //$NON-NLS-1$

 

 

     /**

@@ -60,23 +60,22 @@
         final BundleContext bc = getBundleContext();

         final ServiceReference paRef = bc.getServiceReference( PERMISSION_ADMIN_NAME );

         final ServiceReference cpaRef = bc.getServiceReference( CONDITIONAL_PERMISSION_ADMIN_NAME );

-        final PermissionAdmin pa = paRef != null ? (PermissionAdmin) bc.getService(paRef)

-            : null;

-        final ConditionalPermissionAdmin cpa = cpaRef != null ? (ConditionalPermissionAdmin) bc.getService(cpaRef)

-            : null;

+        final Object paSvc = paRef != null ? bc.getService(paRef) : null;

+        final Object cpaSvc = cpaRef != null ? bc.getService(cpaRef) : null;

 

         try

         {

             pw.print("Status: Permission Admin ");

-            if (null == pa)

+            if (null == paSvc)

                 pw.print("not ");

             pw.print("available, Conditional Permission Admin ");

-            if (null == cpa)

+            if (null == cpaSvc)

                 pw.print("not ");

             pw.println("available.");

 

-            if (pa != null)

+            if (paSvc != null)

             {

+                final PermissionAdmin pa = (PermissionAdmin) paRef;

                 pw.println();

                 pw.println("Permission Admin");

 

@@ -92,8 +91,9 @@
                 }

             }

 

-            if (cpa != null)

+            if (cpaSvc != null)

             {

+                final ConditionalPermissionAdmin cpa = (ConditionalPermissionAdmin) cpaSvc;

                 pw.println();

                 pw.println("Conditional Permission Admin");

 

@@ -116,7 +116,7 @@
                     hasPermissions = true;

                     //final ConditionalPermissionInfo info = (ConditionalPermissionInfo) list.get(i);

                     final ConditionalPermissionInfo info = (ConditionalPermissionInfo) e.nextElement();

-                    pw.print("  ");

+                    pw.print("  "); //$NON-NLS-1$

                     pw.print(info.getName());

 

                     if (getAccessDecision != null)

@@ -124,9 +124,9 @@
                         try

                         {

                             final Object ad = getAccessDecision.invoke(info, null);

-                            pw.print(" (");

+                            pw.print(" ("); //$NON-NLS-1$

                             pw.print(ad);

-                            pw.print(")");

+                            pw.print(")"); //$NON-NLS-1$

                         }

                         catch (Throwable t)

                         {

@@ -164,7 +164,7 @@
         {

             for (int i = 0, len = infos.length; i < len; i++)

             {

-                pw.print("    ");

+                pw.print("    "); //$NON-NLS-1$

                 pw.println(infos[i].getEncoded());

             }

         }

@@ -181,7 +181,7 @@
         {

             for (int i = 0, len = infos.length; i < len; i++)

             {

-                pw.print("    ");

+                pw.print("    "); //$NON-NLS-1$

                 pw.println(infos[i].getEncoded());

             }

         }