felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1297658 - in /felix/trunk/examples: servicebased.circle/ servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/ servicebased.host/ servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ service...
Date Tue, 06 Mar 2012 19:19:05 GMT
Author: rickhall
Date: Tue Mar  6 19:19:04 2012
New Revision: 1297658

URL: http://svn.apache.org/viewvc?rev=1297658&view=rev
Log:
Apply patches for FELIX-3375 to update example to Java 5.

Modified:
    felix/trunk/examples/servicebased.circle/pom.xml
    felix/trunk/examples/servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/Activator.java
    felix/trunk/examples/servicebased.host/pom.xml
    felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
    felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
    felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
    felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
    felix/trunk/examples/servicebased.square/pom.xml
    felix/trunk/examples/servicebased.square/src/main/java/org/apache/felix/example/servicebased/square/Activator.java
    felix/trunk/examples/servicebased.trapezoid/pom.xml
    felix/trunk/examples/servicebased.trapezoid/src/main/java/org/apache/felix/example/servicebased/trapezoid/Activator.java
    felix/trunk/examples/servicebased.triangle/pom.xml
    felix/trunk/examples/servicebased.triangle/src/main/java/org/apache/felix/example/servicebased/triangle/Activator.java

Modified: felix/trunk/examples/servicebased.circle/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.circle/pom.xml?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.circle/pom.xml (original)
+++ felix/trunk/examples/servicebased.circle/pom.xml Tue Mar  6 19:19:04 2012
@@ -16,8 +16,8 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  
   <parent>
     <groupId>org.apache.felix</groupId>
     <artifactId>felix</artifactId>
@@ -59,6 +59,14 @@
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: felix/trunk/examples/servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/Activator.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/Activator.java
(original)
+++ felix/trunk/examples/servicebased.circle/src/main/java/org/apache/felix/example/servicebased/circle/Activator.java
Tue Mar  6 19:19:04 2012
@@ -23,11 +23,13 @@ import java.awt.Color;
 import java.awt.GradientPaint;
 import java.awt.Graphics2D;
 import java.awt.Point;
-import java.awt.geom.*;
+import java.awt.geom.Ellipse2D;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import javax.swing.ImageIcon;
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 
 /**
  * This class implements a simple bundle activator for the circle
@@ -47,7 +49,7 @@ public class Activator implements Bundle
     public void start(BundleContext context)
     {
         m_context = context;
-        Hashtable dict = new Hashtable();
+        Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(SimpleShape.NAME_PROPERTY, "Circle");
         dict.put(SimpleShape.ICON_PROPERTY,
             new ImageIcon(this.getClass().getResource("circle.png")));

Modified: felix/trunk/examples/servicebased.host/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.host/pom.xml?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.host/pom.xml (original)
+++ felix/trunk/examples/servicebased.host/pom.xml Tue Mar  6 19:19:04 2012
@@ -16,7 +16,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache.felix</groupId>
@@ -59,6 +59,14 @@
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
(original)
+++ felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/Activator.java
Tue Mar  6 19:19:04 2012
@@ -22,17 +22,18 @@ import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.io.File;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
-import javax.swing.*;
-
-import org.osgi.framework.*;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
 import org.apache.felix.framework.Felix;
 import org.apache.felix.framework.util.FelixConstants;
-import org.apache.felix.framework.util.StringMap;
-import org.apache.felix.framework.cache.BundleCache;
 import org.apache.felix.main.AutoActivator;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
 
 /**
  * The activator of the host application bundle. The activator creates the
@@ -62,13 +63,14 @@ public class Activator implements Bundle
     **/
     public void start(final BundleContext context)
     {
-        javax.swing.SwingUtilities.invokeLater(new Runnable() {
+        SwingUtilities.invokeLater(new Runnable() {
             // This creates of the application window.
             public void run()
             {
                 m_frame = new DrawingFrame();
                 m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                 m_frame.addWindowListener(new WindowAdapter() {
+                    @Override
                     public void windowClosing(WindowEvent evt)
                     {
                         try
@@ -114,7 +116,7 @@ public class Activator implements Bundle
         {
             try
             {
-                javax.swing.SwingUtilities.invokeAndWait(runner);
+                SwingUtilities.invokeAndWait(runner);
             }
             catch (Exception ex)
             {
@@ -140,13 +142,14 @@ public class Activator implements Bundle
         final File cachedir = File.createTempFile("felix.example.servicebased", null);
         cachedir.delete();
         Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override
             public void run()
             {
                 deleteFileOrDir(cachedir);
             }
         });
 
-        Map configMap = new StringMap(false);
+        Map<String, Object> configMap = new HashMap<String, Object>();
         configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,
             "org.apache.felix.example.servicebased.host.service; version=1.0.0");
         configMap.put(AutoActivator.AUTO_START_PROP + ".1",
@@ -157,7 +160,7 @@ public class Activator implements Bundle
         configMap.put(Constants.FRAMEWORK_STORAGE, cachedir.getAbsolutePath());
 
         // Create list to hold custom framework activators.
-        List list = new ArrayList();
+        List<BundleActivator> list = new ArrayList<BundleActivator>();
         // Add activator to process auto-start/install properties.
         list.add(new AutoActivator(configMap));
         // Add our own activator.

Modified: felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
(original)
+++ felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/DrawingFrame.java
Tue Mar  6 19:19:04 2012
@@ -18,11 +18,23 @@
  */
 package org.apache.felix.example.servicebased.host;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
-
-import javax.swing.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+import javax.swing.JToolBar;
 
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
 
@@ -38,13 +50,13 @@ public class DrawingFrame extends JFrame
 {
     private static final long serialVersionUID = 1L;
     private static final int BOX = 54;
-    private JToolBar m_toolbar;
+    private final JToolBar m_toolbar;
     private String m_selected;
-    private JPanel m_panel;
+    private final JPanel m_panel;
     private ShapeComponent m_selectedComponent;
-    private Map m_shapes = new HashMap();
-    private SimpleShape m_defaultShape = new DefaultShape();
-    private ActionListener m_reusableActionListener = new ShapeActionListener();
+    private final Map<String, ShapeInfo> m_shapes = new HashMap<String, ShapeInfo>();
+    private final SimpleShape m_defaultShape = new DefaultShape();
+    private final ActionListener m_reusableActionListener = new ShapeActionListener();
 
     /**
      * Default constructor that populates the main window.
@@ -83,7 +95,7 @@ public class DrawingFrame extends JFrame
     **/
     public SimpleShape getShape(String name)
     {
-        ShapeInfo info = (ShapeInfo) m_shapes.get(name);
+        ShapeInfo info = m_shapes.get(name);
         if (info == null)
         {
             return m_defaultShape;
@@ -261,9 +273,9 @@ public class DrawingFrame extends JFrame
     **/
     private static class ShapeInfo
     {
-        public String m_name;
-        public Icon m_icon;
-        public SimpleShape m_shape;
+        private final String m_name;
+        private final Icon m_icon;
+        private final SimpleShape m_shape;
         public ShapeInfo(String name, Icon icon, SimpleShape shape)
         {
             m_name = name;

Modified: felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
(original)
+++ felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeComponent.java
Tue Mar  6 19:19:04 2012
@@ -18,10 +18,11 @@
  */
 package org.apache.felix.example.servicebased.host;
 
-import java.awt.*;
-
-import javax.swing.*;
-
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.RenderingHints;
+import javax.swing.JComponent;
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
 
 /**
@@ -31,8 +32,8 @@ import org.apache.felix.example.serviceb
 public class ShapeComponent extends JComponent
 {
     private static final long serialVersionUID = 1L;
-    private DrawingFrame m_frame;
-    private String m_shapeName;
+    private final DrawingFrame m_frame;
+    private final String m_shapeName;
 
     /**
      * Construct a component for the specified drawing frame with the specified
@@ -54,7 +55,8 @@ public class ShapeComponent extends JCom
      * to account for service dynamism.
      * @param g The graphics object to use for painting.
     **/
-    protected void paintComponent(Graphics g)
+    @Override
+	protected void paintComponent(Graphics g)
     {
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D) g;

Modified: felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
(original)
+++ felix/trunk/examples/servicebased.host/src/main/java/org/apache/felix/example/servicebased/host/ShapeTracker.java
Tue Mar  6 19:19:04 2012
@@ -18,11 +18,13 @@
  */
 package org.apache.felix.example.servicebased.host;
 
-import javax.swing.*;
+import javax.swing.Icon;
+import javax.swing.SwingUtilities;
 
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
-import org.osgi.framework.*;
-import org.osgi.util.tracker.*;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
 
 /**
  * Extends the <tt>ServiceTracker</tt> to create a tracker for
@@ -35,16 +37,10 @@ import org.osgi.util.tracker.*;
 **/
 public class ShapeTracker extends ServiceTracker
 {
-    // Flag indicating an added shape.
-    private static final int ADDED = 1;
-    // Flag indicating a modified shape.
-    private static final int MODIFIED = 2;
-    // Flag indicating a removed shape.
-    private static final int REMOVED = 3;
     // The bundle context used for tracking.
-    private BundleContext m_context;
+    private final BundleContext m_context;
     // The application object to notify.
-    private DrawingFrame m_frame;
+    private final DrawingFrame m_frame;
 
     /**
      * Constructs a tracker that uses the specified bundle context to
@@ -66,10 +62,11 @@ public class ShapeTracker extends Servic
      * @param ref The service reference of the added service.
      * @return The service object to be used by the tracker.
     **/
+    @Override
     public Object addingService(ServiceReference ref)
     {
         SimpleShape shape = new DefaultShape(m_context, ref);
-        processShapeOnEventThread(ADDED, ref, shape);
+        processShapeOnEventThread(ShapeEvent.ADDED, ref, shape);
         return shape;
     }
 
@@ -79,9 +76,10 @@ public class ShapeTracker extends Servic
      * @param ref The service reference of the modified service.
      * @param svc The service object of the modified service.
     **/
+    @Override
     public void modifiedService(ServiceReference ref, Object svc)
     {
-        processShapeOnEventThread(MODIFIED, ref, (SimpleShape) svc);
+        processShapeOnEventThread(ShapeEvent.MODIFIED, ref, (SimpleShape) svc);
     }
 
     /**
@@ -90,9 +88,10 @@ public class ShapeTracker extends Servic
      * @param ref The service reference of the removed service.
      * @param svc The service object of the removed service.
     **/
+    @Override
     public void removedService(ServiceReference ref, Object svc)
     {
-        processShapeOnEventThread(REMOVED, ref, (SimpleShape) svc);
+        processShapeOnEventThread(ShapeEvent.REMOVED, ref, (SimpleShape) svc);
         ((DefaultShape) svc).dispose();
     }
 
@@ -100,22 +99,22 @@ public class ShapeTracker extends Servic
      * Processes a received service notification from the <tt>ServiceTracker</tt>,
      * forcing the processing of the notification onto the Swing event thread
      * if it is not already on it.
-     * @param action The type of action associated with the notification.
+     * @param event The type of action associated with the notification.
      * @param ref The service reference of the corresponding service.
      * @param shape The service object of the corresponding service.
     **/
     private void processShapeOnEventThread(
-        int action, ServiceReference ref, SimpleShape shape)
+        ShapeEvent event, ServiceReference ref, SimpleShape shape)
     {
         try
         {
             if (SwingUtilities.isEventDispatchThread())
             {
-                processShape(action, ref, shape);
+                processShape(event, ref, shape);
             }
             else
             {
-                SwingUtilities.invokeAndWait(new ShapeRunnable(action, ref, shape));
+                SwingUtilities.invokeAndWait(new ShapeRunnable(event, ref, shape));
             }
         }
         catch (Exception ex)
@@ -128,15 +127,15 @@ public class ShapeTracker extends Servic
      * Actually performs the processing of the service notification. Invokes
      * the appropriate callback method on the application object depending on
      * the action type of the notification.
-     * @param action The type of action associated with the notification.
+     * @param event The type of action associated with the notification.
      * @param ref The service reference of the corresponding service.
      * @param shape The service object of the corresponding service.
     **/
-    private void processShape(int action, ServiceReference ref, SimpleShape shape)
+    private void processShape(ShapeEvent event, ServiceReference ref, SimpleShape shape)
     {
         String name = (String) ref.getProperty(SimpleShape.NAME_PROPERTY);
 
-        switch (action)
+        switch (event)
         {
             case MODIFIED:
                 m_frame.removeShape(name);
@@ -160,20 +159,20 @@ public class ShapeTracker extends Servic
     **/
     private class ShapeRunnable implements Runnable
     {
-        private int m_action;
-        private ServiceReference m_ref;
-        private SimpleShape m_shape;
+        private final ShapeEvent m_event;
+        private final ServiceReference m_ref;
+        private final SimpleShape m_shape;
 
         /**
          * Constructs an object with the specified action, service reference,
          * and service object for processing on the Swing event thread.
-         * @param action The type of action associated with the notification.
+         * @param event The type of action associated with the notification.
          * @param ref The service reference of the corresponding service.
          * @param shape The service object of the corresponding service.
         **/
-        public ShapeRunnable(int action, ServiceReference ref, SimpleShape shape)
+        public ShapeRunnable(ShapeEvent event, ServiceReference ref, SimpleShape shape)
         {
-            m_action = action;
+            m_event = event;
             m_ref = ref;
             m_shape = shape;
         }
@@ -183,7 +182,14 @@ public class ShapeTracker extends Servic
         **/
         public void run()
         {
-            processShape(m_action, m_ref, m_shape);
+            processShape(m_event, m_ref, m_shape);
         }
     }
+
+    private static enum ShapeEvent
+    {
+        ADDED,
+        MODIFIED,
+        REMOVED
+    }
 }
\ No newline at end of file

Modified: felix/trunk/examples/servicebased.square/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.square/pom.xml?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.square/pom.xml (original)
+++ felix/trunk/examples/servicebased.square/pom.xml Tue Mar  6 19:19:04 2012
@@ -16,7 +16,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache.felix</groupId>
@@ -59,6 +59,14 @@
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: felix/trunk/examples/servicebased.square/src/main/java/org/apache/felix/example/servicebased/square/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.square/src/main/java/org/apache/felix/example/servicebased/square/Activator.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.square/src/main/java/org/apache/felix/example/servicebased/square/Activator.java
(original)
+++ felix/trunk/examples/servicebased.square/src/main/java/org/apache/felix/example/servicebased/square/Activator.java
Tue Mar  6 19:19:04 2012
@@ -23,11 +23,13 @@ import java.awt.Color;
 import java.awt.GradientPaint;
 import java.awt.Graphics2D;
 import java.awt.Point;
-import java.awt.geom.*;
+import java.awt.geom.Rectangle2D;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import javax.swing.ImageIcon;
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 
 /**
  * This class implements a simple bundle activator for the square
@@ -47,7 +49,7 @@ public class Activator implements Bundle
     public void start(BundleContext context)
     {
         m_context = context;
-        Hashtable dict = new Hashtable();
+        Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(SimpleShape.NAME_PROPERTY, "Square");
         dict.put(SimpleShape.ICON_PROPERTY,
             new ImageIcon(this.getClass().getResource("square.png")));

Modified: felix/trunk/examples/servicebased.trapezoid/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.trapezoid/pom.xml?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.trapezoid/pom.xml (original)
+++ felix/trunk/examples/servicebased.trapezoid/pom.xml Tue Mar  6 19:19:04 2012
@@ -16,7 +16,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache</groupId>
@@ -57,6 +57,14 @@
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: felix/trunk/examples/servicebased.trapezoid/src/main/java/org/apache/felix/example/servicebased/trapezoid/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.trapezoid/src/main/java/org/apache/felix/example/servicebased/trapezoid/Activator.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.trapezoid/src/main/java/org/apache/felix/example/servicebased/trapezoid/Activator.java
(original)
+++ felix/trunk/examples/servicebased.trapezoid/src/main/java/org/apache/felix/example/servicebased/trapezoid/Activator.java
Tue Mar  6 19:19:04 2012
@@ -23,11 +23,13 @@ import java.awt.Color;
 import java.awt.GradientPaint;
 import java.awt.Graphics2D;
 import java.awt.Point;
-import java.awt.geom.*;
+import java.awt.geom.GeneralPath;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import javax.swing.ImageIcon;
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 
 /**
  * This class implements a simple bundle activator for the trapezoid
@@ -47,7 +49,7 @@ public class Activator implements Bundle
     public void start(BundleContext context)
     {
         m_context = context;
-        Hashtable dict = new Hashtable();
+        Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(SimpleShape.NAME_PROPERTY, "Trapezoid");
         dict.put(SimpleShape.ICON_PROPERTY,
             new ImageIcon(this.getClass().getResource("trapezoid.png")));

Modified: felix/trunk/examples/servicebased.triangle/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.triangle/pom.xml?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.triangle/pom.xml (original)
+++ felix/trunk/examples/servicebased.triangle/pom.xml Tue Mar  6 19:19:04 2012
@@ -16,7 +16,7 @@
  specific language governing permissions and limitations
  under the License.
 -->
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
   <parent>
     <groupId>org.apache.felix</groupId>
@@ -59,6 +59,14 @@
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>

Modified: felix/trunk/examples/servicebased.triangle/src/main/java/org/apache/felix/example/servicebased/triangle/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/examples/servicebased.triangle/src/main/java/org/apache/felix/example/servicebased/triangle/Activator.java?rev=1297658&r1=1297657&r2=1297658&view=diff
==============================================================================
--- felix/trunk/examples/servicebased.triangle/src/main/java/org/apache/felix/example/servicebased/triangle/Activator.java
(original)
+++ felix/trunk/examples/servicebased.triangle/src/main/java/org/apache/felix/example/servicebased/triangle/Activator.java
Tue Mar  6 19:19:04 2012
@@ -23,11 +23,13 @@ import java.awt.Color;
 import java.awt.GradientPaint;
 import java.awt.Graphics2D;
 import java.awt.Point;
-import java.awt.geom.*;
+import java.awt.geom.GeneralPath;
+import java.util.Dictionary;
 import java.util.Hashtable;
 import javax.swing.ImageIcon;
 import org.apache.felix.example.servicebased.host.service.SimpleShape;
-import org.osgi.framework.*;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
 
 /**
  * This class implements a simple bundle activator for the triangle
@@ -47,7 +49,7 @@ public class Activator implements Bundle
     public void start(BundleContext context)
     {
         m_context = context;
-        Hashtable dict = new Hashtable();
+        Dictionary<String, Object> dict = new Hashtable<String, Object>();
         dict.put(SimpleShape.NAME_PROPERTY, "Triangle");
         dict.put(SimpleShape.ICON_PROPERTY,
             new ImageIcon(this.getClass().getResource("triangle.png")));



Mime
View raw message