myriad-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smare...@apache.org
Subject incubator-myriad git commit: removing compilation warnings
Date Wed, 28 Oct 2015 23:59:18 GMT
Repository: incubator-myriad
Updated Branches:
  refs/heads/master 2df7da0e1 -> f29bde67f


removing compilation warnings

This closes: #24
Review: https://github.com/apache/incubator-myriad/pull/24


Project: http://git-wip-us.apache.org/repos/asf/incubator-myriad/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-myriad/commit/f29bde67
Tree: http://git-wip-us.apache.org/repos/asf/incubator-myriad/tree/f29bde67
Diff: http://git-wip-us.apache.org/repos/asf/incubator-myriad/diff/f29bde67

Branch: refs/heads/master
Commit: f29bde67fa1dcd275d61d288096fb542b1a5f436
Parents: 2df7da0
Author: Ken Sipe <kensipe@gmail.com>
Authored: Wed Oct 28 16:56:45 2015 -0700
Committer: Santosh Marella <marella@gmail.com>
Committed: Wed Oct 28 16:56:45 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/myriad/MyriadModule.java         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-myriad/blob/f29bde67/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
----------------------------------------------------------------------
diff --git a/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java b/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
index 59866fe..30773c8 100644
--- a/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
+++ b/myriad-scheduler/src/main/java/org/apache/myriad/MyriadModule.java
@@ -110,7 +110,7 @@ public class MyriadModule extends AbstractModule {
         String taskFactoryClass = entry.getValue().getTaskFactoryImplName().orNull();
         if (taskFactoryClass != null) {
           try {
-            Class<? extends TaskFactory> implClass = (Class<? extends TaskFactory>)
Class.forName(taskFactoryClass);
+            Class<? extends TaskFactory> implClass = getTaskFactoryClass(taskFactoryClass);
             mapBinder.addBinding(entry.getKey()).to(implClass).in(Scopes.SINGLETON);
           } catch (ClassNotFoundException e) {
             LOGGER.error("ClassNotFoundException", e);
@@ -124,6 +124,11 @@ public class MyriadModule extends AbstractModule {
     bind(NodeScaleDownPolicy.class).to(LeastAMNodesFirstPolicy.class).in(Scopes.SINGLETON);
   }
 
+  @SuppressWarnings("unchecked")
+  private Class<? extends TaskFactory> getTaskFactoryClass(String taskFactoryClass)
throws ClassNotFoundException {
+    return (Class<? extends TaskFactory>) Class.forName(taskFactoryClass);
+  }
+
   @Provides
   @Singleton
   SchedulerState providesSchedulerState(MyriadConfiguration cfg) {


Mime
View raw message