Formatting and import organizations

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1461812 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java b/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
index 2231091..b213bbe 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/PrinterMode.java
@@ -6,9 +6,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
index 4ade7f3..d5ae348 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/AbstractWebConsolePlugin.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,7 +46,7 @@
 
     /**
      * Constructor
-     *
+     * 
      * @param inventoryPrinterManager The manager
      */
     AbstractWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager)
@@ -83,7 +83,7 @@
      * <p>
      * This method sets the <code>Cache-Control</code>, <code>Expires</code>,
      * and <code>Pragma</code> headers.
-     *
+     * 
      * @param response The response for which to set the cache prevention
      */
     private final void setNoCache(final HttpServletResponse response)
@@ -205,9 +205,12 @@
 
             final JSONConfigurationWriter jcw = new JSONConfigurationWriter(response.getWriter());
             final PrinterMode mode;
-            if (handler.supports(PrinterMode.JSON)) {
+            if (handler.supports(PrinterMode.JSON))
+            {
                 mode = PrinterMode.JSON;
-            } else {
+            }
+            else
+            {
                 mode = PrinterMode.TEXT;
                 jcw.startJSONWrapper();
             }
@@ -552,8 +555,8 @@
 
         /**
          * Escapes HTML special chars like: <>&\r\n and space
-         *
-         *
+         * 
+         * 
          * @param text the text to escape
          * @return the escaped text
          */
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java b/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
index 8a52967..cdb139e 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/Activator.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
index 3e04b15..2e013aa 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/DefaultWebConsolePlugin.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,7 +33,7 @@
 
     /**
      * Constructor
-     *
+     * 
      * @param inventoryPrinterAdapter The adapter
      */
     DefaultWebConsolePlugin(final InventoryPrinterManagerImpl inventoryPrinterManager)
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
index dc8b501..7e2e8df 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterAdapter.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,7 +18,6 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
-import java.lang.reflect.Method;
 import java.text.DateFormat;
 import java.util.Comparator;
 import java.util.Locale;
@@ -32,7 +31,7 @@
 
 /**
  * Helper class for a inventory printer.
- *
+ * 
  * The adapter simplifies accessing and working with the inventory printer.
  */
 public class InventoryPrinterAdapter implements InventoryPrinterHandler, Comparable
@@ -45,19 +44,6 @@
         Locale.US);
 
     /**
-     * Create a new adapter if the provided service is either a printer or
-     * provides
-     * the print method.
-     *
-     * @return An adapter or <code>null</code> if the method is missing.
-     */
-    public static InventoryPrinterAdapter createAdapter(final InventoryPrinterDescription description,
-        final InventoryPrinter service)
-    {
-        return new InventoryPrinterAdapter(description, service);
-    }
-
-    /**
      * Comparator for adapters based on the service ranking.
      */
     public static final Comparator RANKING_COMPARATOR = new Comparator()
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
index 9f20b36..17ab8f7 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/InventoryPrinterManagerImpl.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -70,7 +70,7 @@
 
     /**
      * Create the inventory printer manager
-     *
+     * 
      * @param btx Bundle Context
      * @throws InvalidSyntaxException Should only happen if we have an error in
      *             the code
@@ -140,6 +140,16 @@
         this.addService(reference, (InventoryPrinter) service);
     }
 
+    /**
+     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
+     *      java.lang.Object)
+     */
+    public void removedService(final ServiceReference reference, final Object service)
+    {
+        this.removeService(reference);
+        this.bundleContext.ungetService(reference);
+    }
+
     private void addService(final ServiceReference reference, final InventoryPrinter obj)
     {
         final InventoryPrinterDescription desc = new InventoryPrinterDescription(reference);
@@ -165,16 +175,7 @@
         }
         if (valid)
         {
-            final InventoryPrinterAdapter adapter = InventoryPrinterAdapter.createAdapter(desc, obj);
-            if (adapter == null)
-            {
-                Activator.log(null, LogService.LOG_INFO, "Ignoring inventory printer - printer method is missing: "
-                    + reference, null);
-            }
-            else
-            {
-                this.addAdapter(adapter);
-            }
+            this.addAdapter(new InventoryPrinterAdapter(desc, obj));
         }
     }
 
@@ -235,16 +236,6 @@
         }
     }
 
-    /**
-     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
-     *      java.lang.Object)
-     */
-    public void removedService(final ServiceReference reference, final Object service)
-    {
-        this.removeService(reference);
-        this.bundleContext.ungetService(reference);
-    }
-
     private void removeService(final ServiceReference reference)
     {
         synchronized (this.allAdapters)
@@ -290,7 +281,7 @@
 
     /**
      * Get all inventory printer handlers.
-     *
+     * 
      * @return A list of handlers - might be empty.
      */
     public InventoryPrinterHandler[] getAllHandlers()
@@ -301,7 +292,7 @@
 
     /**
      * Get all handlers supporting the mode.
-     *
+     * 
      * @return A list of handlers - might be empty.
      */
     public InventoryPrinterHandler[] getHandlers(final PrinterMode mode)
@@ -321,7 +312,7 @@
 
     /**
      * Return a handler for the unique name.
-     *
+     * 
      * @return The corresponding handler or <code>null</code>.
      */
     public InventoryPrinterHandler getHandler(final String name)
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
index 35279f2..0b76aee 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConfigurationPrinterAdapter.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
index eca29e8..2568170 100644
--- a/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
+++ b/inventory/src/main/java/org/apache/felix/inventory/impl/webconsole/ConsoleConstants.java
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
- *
+ * 
  * http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java b/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
index aa192fe..f2db39d 100644
--- a/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
+++ b/inventory/src/test/java/org/apache/felix/inventory/PrinterModeTest.java
@@ -1,18 +1,18 @@
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
+ * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
+ * regarding copyright ownership. The ASF licenses this file
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
+ * with the License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
+ * KIND, either express or implied. See the License for the
  * specific language governing permissions and limitations
  * under the License.
  */