camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [3/3] camel git commit: Clean up the code of camel-scr
Date Thu, 20 Nov 2014 08:16:04 GMT
Clean up the code of camel-scr


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3e15ab8c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3e15ab8c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3e15ab8c

Branch: refs/heads/master
Commit: 3e15ab8c546c3035422d4617cf28404be046d607
Parents: dfdec00
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Nov 20 16:13:21 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Thu Nov 20 16:14:28 2014 +0800

----------------------------------------------------------------------
 .../apache/camel/scr/AbstractCamelRunner.java   | 22 ++++++++------------
 .../apache/camel/scr/internal/ScrHelper.java    |  8 ++++---
 2 files changed, 14 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/3e15ab8c/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java
----------------------------------------------------------------------
diff --git a/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java
b/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java
index cadeaa4..2e60d59 100644
--- a/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java
+++ b/components/camel-scr/src/main/java/org/apache/camel/scr/AbstractCamelRunner.java
@@ -52,15 +52,15 @@ public abstract class AbstractCamelRunner implements Runnable {
 
     public static final int START_DELAY = 5000;
     public static final String PROPERTY_PREFIX = "camel.scr.properties.prefix";
-
-    // Configured fields
-    private String camelContextId = "camel-runner-default";
-    private boolean active = false;
-
+    
     protected Logger log = LoggerFactory.getLogger(getClass());
     protected ModelCamelContext context;
     protected SimpleRegistry registry = new SimpleRegistry();
 
+    // Configured fields
+    private String camelContextId = "camel-runner-default";
+    private boolean active;   
+
     private ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
     private ScheduledFuture starter;
     private volatile boolean activated;
@@ -101,8 +101,7 @@ public abstract class AbstractCamelRunner implements Runnable {
         }
         setupPropertiesComponent(context, props, log);
     }
-
-    @SuppressWarnings("unused")
+    
     protected void setupCamelContext(final BundleContext bundleContext, final String camelContextId)
throws Exception {
         // Set up CamelContext
         context.setNameStrategy(new ExplicitCamelContextNameStrategy(camelContextId));
@@ -217,19 +216,16 @@ public abstract class AbstractCamelRunner implements Runnable {
             started = false;
         }
     }
-
-    @SuppressWarnings("unused")
+    
     public ModelCamelContext getContext() {
         return context;
     }
 
-    @SuppressWarnings("unused")
     protected void gotCamelComponent(final ComponentResolver componentResolver) {
         log.trace("Got a new Camel Component.");
         runWithDelay(this);
     }
 
-    @SuppressWarnings("unused")
     protected void lostCamelComponent(final ComponentResolver componentResolver) {
         log.trace("Lost a Camel Component.");
     }
@@ -239,7 +235,7 @@ public abstract class AbstractCamelRunner implements Runnable {
     }
 
     public static <T> T configure(final CamelContext context, final T target, final
Logger log, final boolean deep) {
-        Class clazz = target.getClass();
+        Class<?> clazz = target.getClass();
         log.debug("Configuring {}", clazz.getName());
         Collection<Field> fields = new ArrayList<Field>();
         fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
@@ -274,7 +270,7 @@ public abstract class AbstractCamelRunner implements Runnable {
         if (type instanceof ParameterizedType) {
             clazz = (Class<?>) ((ParameterizedType) type).getRawType();
         } else if (type instanceof Class) {
-            clazz = (Class) type;
+            clazz = (Class<?>) type;
         }
         if (null != value) {
             if (clazz.isInstance(value)) {

http://git-wip-us.apache.org/repos/asf/camel/blob/3e15ab8c/components/camel-scr/src/main/java/org/apache/camel/scr/internal/ScrHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-scr/src/main/java/org/apache/camel/scr/internal/ScrHelper.java
b/components/camel-scr/src/main/java/org/apache/camel/scr/internal/ScrHelper.java
index 40a4770..493edba 100644
--- a/components/camel-scr/src/main/java/org/apache/camel/scr/internal/ScrHelper.java
+++ b/components/camel-scr/src/main/java/org/apache/camel/scr/internal/ScrHelper.java
@@ -30,12 +30,14 @@ import javax.xml.xpath.XPathExpression;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
 /**
  * Helper class.
  */
@@ -81,7 +83,7 @@ public final class ScrHelper {
             }
 
             @Override
-            public Iterator getPrefixes(String namespaceURI) {
+            public Iterator<String> getPrefixes(String namespaceURI) {
                 return null;
             }
         });


Mime
View raw message