apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [06/16] incubator-apex-core git commit: APEXCORE-423 style fix for apex-core engine
Date Sat, 09 Apr 2016 03:52:24 GMT
http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
index 7a24c51..8aa2c20 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorDiscoverer.java
@@ -18,47 +18,63 @@
  */
 package com.datatorrent.stram.webapp;
 
-import com.datatorrent.api.Operator;
-import com.datatorrent.netlet.util.DTThrowable;
-import com.datatorrent.stram.util.ObjectMapperFactory;
-import com.datatorrent.stram.webapp.TypeDiscoverer.UI_TYPE;
-import com.datatorrent.stram.webapp.TypeGraph.TypeGraphVertex;
-import com.datatorrent.stram.webapp.asm.CompactAnnotationNode;
-import com.datatorrent.stram.webapp.asm.CompactFieldNode;
-import com.google.common.base.Predicate;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-import java.beans.*;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.*;
-import java.net.*;
-import java.util.*;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-import javax.xml.parsers.*;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
 
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang.ClassUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.text.WordUtils;
 import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jettison.json.*;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.ClassUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.text.WordUtils;
+
+import com.google.common.base.Predicate;
+import com.google.common.base.Splitter;
+import com.google.common.base.Throwables;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+import com.datatorrent.api.Operator;
+import com.datatorrent.stram.util.ObjectMapperFactory;
+import com.datatorrent.stram.webapp.TypeDiscoverer.UI_TYPE;
+import com.datatorrent.stram.webapp.TypeGraph.TypeGraphVertex;
+import com.datatorrent.stram.webapp.asm.CompactAnnotationNode;
+import com.datatorrent.stram.webapp.asm.CompactFieldNode;
+
 /**
  * <p>OperatorDiscoverer class.</p>
  * Discover Operators.
@@ -71,7 +87,7 @@ public class OperatorDiscoverer
   public static final String GENERATED_CLASSES_JAR = "_generated-classes.jar";
   private Set<String> operatorClassNames;
   private static final Logger LOG = LoggerFactory.getLogger(OperatorDiscoverer.class);
-  private final List<String> pathsToScan = new ArrayList<String>();
+  private final List<String> pathsToScan = new ArrayList<>();
   private final ClassLoader classLoader;
   private static final String DT_OPERATOR_DOCLINK_PREFIX = "https://www.datatorrent.com/docs/apidocs/index.html";
   public static final String PORT_TYPE_INFO_KEY = "portTypeInfo";
@@ -81,20 +97,21 @@ public class OperatorDiscoverer
 
   private static final String SCHEMA_REQUIRED_KEY = "schemaRequired";
 
-  private final Map<String, OperatorClassInfo> classInfo = new HashMap<String, OperatorClassInfo>();
+  private final Map<String, OperatorClassInfo> classInfo = new HashMap<>();
 
-  private static class OperatorClassInfo {
+  private static class OperatorClassInfo
+  {
     String comment;
-    final Map<String, String> tags = new HashMap<String, String>();
-    final Map<String, MethodInfo> getMethods = Maps.newHashMap();
-    final Map<String, MethodInfo> setMethods = Maps.newHashMap();
-    final Map<String, String> fields = new HashMap<String, String>();
+    final Map<String, String> tags = new HashMap<>();
+    final Map<String, MethodInfo> getMethods = new HashMap<>();
+    final Map<String, MethodInfo> setMethods = new HashMap<>();
+    final Map<String, String> fields = new HashMap<>();
   }
 
   private static class MethodInfo
   {
-    Map<String, String> descriptions = Maps.newHashMap();
-    Map<String, String> useSchemas = Maps.newHashMap();
+    Map<String, String> descriptions = new HashMap<>();
+    Map<String, String> useSchemas = new HashMap<>();
     String comment;
     boolean omitFromUI;
   }
@@ -126,8 +143,8 @@ public class OperatorDiscoverer
     }
   }
 
-  private class JavadocSAXHandler extends DefaultHandler {
-
+  private class JavadocSAXHandler extends DefaultHandler
+  {
     private String className = null;
     private OperatorClassInfo oci = null;
     private StringBuilder comment;
@@ -153,11 +170,9 @@ public class OperatorDiscoverer
       if (qName.equalsIgnoreCase("class")) {
         className = attributes.getValue("qualified");
         oci = new OperatorClassInfo();
-      }
-      else if (qName.equalsIgnoreCase("comment")) {
+      } else if (qName.equalsIgnoreCase("comment")) {
         comment = new StringBuilder();
-      }
-      else if (qName.equalsIgnoreCase("tag")) {
+      } else if (qName.equalsIgnoreCase("tag")) {
         if (oci != null) {
           String tagName = attributes.getValue("name");
           String tagText = attributes.getValue("text").trim();
@@ -175,19 +190,15 @@ public class OperatorDiscoverer
 //              oci.getMethods.put(methodName, tagText);
 //            }
             //do nothing
-          }
-          else if (fieldName != null) {
+          } else if (fieldName != null) {
             // do nothing
-          }
-          else {
+          } else {
             oci.tags.put(tagName, tagText);
           }
         }
-      }
-      else if (qName.equalsIgnoreCase("field")) {
+      } else if (qName.equalsIgnoreCase("field")) {
         fieldName = attributes.getValue("name");
-      }
-      else if (qName.equalsIgnoreCase("method")) {
+      } else if (qName.equalsIgnoreCase("method")) {
         methodName = attributes.getValue("name");
       }
     }
@@ -203,8 +214,8 @@ public class OperatorDiscoverer
         mi.omitFromUI = true;
         return;
       }
-      String[] tagParts = Iterables.toArray(Splitter.on(WHITESPACE_PATTERN).trimResults().omitEmptyStrings().
-        limit(2).split(tagText), String.class);
+      String[] tagParts = Iterables.toArray(Splitter.on(WHITESPACE_PATTERN).trimResults().omitEmptyStrings()
+          .limit(2).split(tagText), String.class);
       if (tagParts.length == 2) {
         if (tagType == MethodTagType.DESCRIPTION) {
           mi.descriptions.put(tagParts[0], tagParts[1]);
@@ -215,13 +226,13 @@ public class OperatorDiscoverer
     }
 
     @Override
-    public void endElement(String uri, String localName, String qName) throws SAXException {
+    public void endElement(String uri, String localName, String qName) throws SAXException
+    {
       if (qName.equalsIgnoreCase("class")) {
         classInfo.put(className, oci);
         className = null;
         oci = null;
-      }
-      else if (qName.equalsIgnoreCase("comment") && oci != null) {
+      } else if (qName.equalsIgnoreCase("comment") && oci != null) {
         if (methodName != null) {
           // do nothing
           if (isGetter(methodName)) {
@@ -239,25 +250,22 @@ public class OperatorDiscoverer
             }
             mi.comment = comment.toString();
           }
-        }
-        else if (fieldName != null) {
+        } else if (fieldName != null) {
           oci.fields.put(fieldName, comment.toString());
-        }
-        else {
+        } else {
           oci.comment = comment.toString();
         }
         comment = null;
-      }
-      else if (qName.equalsIgnoreCase("field")) {
+      } else if (qName.equalsIgnoreCase("field")) {
         fieldName = null;
-      }
-      else if (qName.equalsIgnoreCase("method")) {
+      } else if (qName.equalsIgnoreCase("method")) {
         methodName = null;
       }
     }
 
     @Override
-    public void characters(char ch[], int start, int length) throws SAXException {
+    public void characters(char[] ch, int start, int length) throws SAXException
+    {
       if (comment != null) {
         comment.append(ch, start, length);
       }
@@ -276,8 +284,7 @@ public class OperatorDiscoverer
       pathsToScan.add(jars[i]);
       try {
         urls[i] = new URL("file://" + jars[i]);
-      }
-      catch (MalformedURLException ex) {
+      } catch (MalformedURLException ex) {
         throw new RuntimeException(ex);
       }
     }
@@ -294,7 +301,7 @@ public class OperatorDiscoverer
   public void addDefaultValue(String className, JSONObject oper) throws Exception
   {
     ObjectMapper defaultValueMapper = ObjectMapperFactory.getOperatorValueSerializer();
-    Class<? extends Operator> clazz = (Class<? extends Operator>) classLoader.loadClass(className);
+    Class<? extends Operator> clazz = (Class<? extends Operator>)classLoader.loadClass(className);
     if (clazz != null) {
       Operator operIns = clazz.newInstance();
       String s = defaultValueMapper.writeValueAsString(operIns);
@@ -304,8 +311,8 @@ public class OperatorDiscoverer
 
   public void buildTypeGraph()
   {
-    Map<String, JarFile> openJarFiles = new HashMap<String, JarFile>();
-    Map<String, File> openClassFiles = new HashMap<String, File>();
+    Map<String, JarFile> openJarFiles = new HashMap<>();
+    Map<String, File> openClassFiles = new HashMap<>();
     // use global cache to load resource in/out of the same jar as the classes
     Set<String> resourceCacheSet = new HashSet<>();
     try {
@@ -380,7 +387,7 @@ public class OperatorDiscoverer
         try {
           entry.getValue().close();
         } catch (IOException e) {
-          DTThrowable.wrapIfChecked(e);
+          throw Throwables.propagate(e);
         }
       }
     }
@@ -423,7 +430,7 @@ public class OperatorDiscoverer
       searchTerm = searchTerm.toLowerCase();
     }
 
-    Set<String> result = new HashSet<String>();
+    Set<String> result = new HashSet<>();
     for (String clazz : filteredClass) {
       if (parent.equals(Operator.class.getName()) || typeGraph.isAncestor(parent, clazz)) {
         if (searchTerm == null) {
@@ -557,19 +564,16 @@ public class OperatorDiscoverer
           String doclink = oci.tags.get("@doclink");
           if (doclink != null) {
             response.put("doclink", doclink + "?" + getDocName(clazz));
-          }
-          else if (clazz.startsWith("com.datatorrent.lib.") ||
-                  clazz.startsWith("com.datatorrent.contrib.")) {
-            response.put("doclink", DT_OPERATOR_DOCLINK_PREFIX  + "?" + getDocName(clazz));
+          } else if (clazz.startsWith("com.datatorrent.lib.") ||
+              clazz.startsWith("com.datatorrent.contrib.")) {
+            response.put("doclink", DT_OPERATOR_DOCLINK_PREFIX + "?" + getDocName(clazz));
           }
         }
-      }
-      catch (JSONException ex) {
+      } catch (JSONException ex) {
         throw new RuntimeException(ex);
       }
       return response;
-    }
-    else {
+    } else {
       throw new UnsupportedOperationException();
     }
   }
@@ -618,7 +622,7 @@ public class OperatorDiscoverer
       String getPrefix = (propJ.getString("type").equals("boolean") || propJ.getString("type").equals("java.lang.Boolean")) ? "is" : "get";
       String setPrefix = "set";
       OperatorClassInfo oci = getOperatorClassWithGetterSetter(operatorClass, setPrefix + propName, getPrefix + propName);
-      if(oci == null) {
+      if (oci == null) {
         result.put(propJ);
         continue;
       }
@@ -713,7 +717,7 @@ public class OperatorDiscoverer
       desc.put("enum", enumNames);
     }
     UI_TYPE ui_type = UI_TYPE.getEnumFor(clazz);
-    if(ui_type!=null){
+    if (ui_type != null) {
       desc.put("uiType", ui_type.getName());
     }
     desc.put("properties", getClassProperties(clazz, 0));
@@ -749,38 +753,38 @@ public class OperatorDiscoverer
         }
         //LOG.info("name: " + pd.getName() + " type: " + pd.getPropertyType());
 
-          Class<?> propertyType = pd.getPropertyType();
-          if (propertyType != null) {
-            JSONObject propertyObj = new JSONObject();
-            propertyObj.put("name", pd.getName());
-            propertyObj.put("canGet", readMethod != null);
-            propertyObj.put("canSet", pd.getWriteMethod() != null);
-            if (readMethod != null) {
-              for (Class<?> c = clazz; c != null; c = c.getSuperclass()) {
-                OperatorClassInfo oci = classInfo.get(c.getName());
-                if (oci != null) {
-                  MethodInfo getMethodInfo = oci.getMethods.get(readMethod.getName());
-                  if (getMethodInfo != null) {
-                    addTagsToProperties(getMethodInfo, propertyObj);
-                    break;
-                  }
+        Class<?> propertyType = pd.getPropertyType();
+        if (propertyType != null) {
+          JSONObject propertyObj = new JSONObject();
+          propertyObj.put("name", pd.getName());
+          propertyObj.put("canGet", readMethod != null);
+          propertyObj.put("canSet", pd.getWriteMethod() != null);
+          if (readMethod != null) {
+            for (Class<?> c = clazz; c != null; c = c.getSuperclass()) {
+              OperatorClassInfo oci = classInfo.get(c.getName());
+              if (oci != null) {
+                MethodInfo getMethodInfo = oci.getMethods.get(readMethod.getName());
+                if (getMethodInfo != null) {
+                  addTagsToProperties(getMethodInfo, propertyObj);
+                  break;
                 }
               }
-              // type can be a type symbol or parameterized type
-              td.setTypeArguments(clazz, readMethod.getGenericReturnType(), propertyObj);
-            } else {
-              if (pd.getWriteMethod() != null) {
-                td.setTypeArguments(clazz, pd.getWriteMethod().getGenericParameterTypes()[0], propertyObj);
-              }
             }
-            //if (!propertyType.isPrimitive() && !propertyType.isEnum() && !propertyType.isArray() && !propertyType.getName().startsWith("java.lang") && level < MAX_PROPERTY_LEVELS) {
-            //  propertyObj.put("properties", getClassProperties(propertyType, level + 1));
-            //}
-            arr.put(propertyObj);
+            // type can be a type symbol or parameterized type
+            td.setTypeArguments(clazz, readMethod.getGenericReturnType(), propertyObj);
+          } else {
+            if (pd.getWriteMethod() != null) {
+              td.setTypeArguments(clazz, pd.getWriteMethod().getGenericParameterTypes()[0], propertyObj);
+            }
           }
+          //if (!propertyType.isPrimitive() && !propertyType.isEnum() && !propertyType.isArray() && !propertyType
+          // .getName().startsWith("java.lang") && level < MAX_PROPERTY_LEVELS) {
+          //  propertyObj.put("properties", getClassProperties(propertyType, level + 1));
+          //}
+          arr.put(propertyObj);
+        }
       }
-    }
-    catch (JSONException ex) {
+    } catch (JSONException ex) {
       throw new RuntimeException(ex);
     }
     return arr;
@@ -795,8 +799,7 @@ public class OperatorDiscoverer
     while (match.find()) {
       if (deCameled.length() == 0) {
         deCameled.append(match.group());
-      }
-      else {
+      } else {
         deCameled.append(" ");
         deCameled.append(match.group().toLowerCase());
       }
@@ -832,7 +835,7 @@ public class OperatorDiscoverer
 
         try {
           //building port class hierarchy
-          LinkedList<String> queue = Lists.newLinkedList();
+          LinkedList<String> queue = new LinkedList<>();
           queue.add(portType);
           while (!queue.isEmpty()) {
             String currentType = queue.remove();
@@ -842,7 +845,7 @@ public class OperatorDiscoverer
             }
             List<String> immediateParents = typeGraph.getParents(currentType);
             if (immediateParents == null) {
-              portClassHierarchy.put(currentType, Lists.<String>newArrayList());
+              portClassHierarchy.put(currentType, new ArrayList<String>());
               continue;
             }
             portClassHierarchy.put(currentType, immediateParents);
@@ -858,8 +861,8 @@ public class OperatorDiscoverer
           continue;
         }
         if (portType.equals("byte") || portType.equals("short") || portType.equals("char") || portType.equals("int")
-          || portType.equals("long") || portType.equals("float") || portType.equals("double")
-          || portType.equals("java.lang.String") || portType.equals("java.lang.Object")) {
+            || portType.equals("long") || portType.equals("float") || portType.equals("double")
+            || portType.equals("java.lang.String") || portType.equals("java.lang.Object")) {
           //ignoring primitives, strings and object types as this information is needed only for complex types.
           continue;
         }
@@ -892,7 +895,7 @@ public class OperatorDiscoverer
 
   public JSONArray getDescendants(String fullClassName)
   {
-    if(typeGraph.size()==0){
+    if (typeGraph.size() == 0) {
       buildTypeGraph();
     }
     return new JSONArray(typeGraph.getDescendants(fullClassName));

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/OperatorInfo.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorInfo.java b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorInfo.java
index 011e4bd..fcf4346 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorInfo.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorInfo.java
@@ -18,7 +18,11 @@
  */
 package com.datatorrent.stram.webapp;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -73,7 +77,7 @@ public class OperatorInfo
   public long recoveryWindowId;
   public long currentWindowId;
   @RecordField(type = "stats")
-  public List<PortInfo> ports = new ArrayList<PortInfo>();
+  public List<PortInfo> ports = new ArrayList<>();
   @RecordField(type = "meta")
   public String unifierClass;
   @RecordField(type = "meta")
@@ -83,14 +87,14 @@ public class OperatorInfo
   public Object counters;
   @RecordField(type = "stats")
   public Map<String, Object> metrics;
-  @RecordField(type="stats")
+  @RecordField(type = "stats")
   public long checkpointStartTime;
-  @RecordField(type="stats")
+  @RecordField(type = "stats")
   public long checkpointTime;
-  @RecordField(type="stats")
+  @RecordField(type = "stats")
   public long checkpointTimeMA;
+
   /**
-   *
    * @param info
    */
   public void addPort(PortInfo info)
@@ -99,9 +103,7 @@ public class OperatorInfo
   }
 
   /**
-   *
    * @return
-   *
    */
   public Collection<PortInfo> getPorts()
   {

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/OperatorsInfo.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorsInfo.java b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorsInfo.java
index db21b6b..7bb5441 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/OperatorsInfo.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/OperatorsInfo.java
@@ -40,24 +40,24 @@ import javax.xml.bind.annotation.XmlSeeAlso;
 @XmlRootElement(name = "operators")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlSeeAlso({OperatorInfo.class})
-public class OperatorsInfo {
+public class OperatorsInfo
+{
 
-  protected List<OperatorInfo> operators = new ArrayList<OperatorInfo>();
+  protected List<OperatorInfo> operators = new ArrayList<>();
 
   /**
-   *
    * @param operatorInfo
    */
-  public void add(OperatorInfo operatorInfo) {
+  public void add(OperatorInfo operatorInfo)
+  {
     operators.add(operatorInfo);
   }
 
   /**
-   *
    * @return list of operator info
-   *
    */
-  public List<OperatorInfo> getOperators() {
+  public List<OperatorInfo> getOperators()
+  {
     return Collections.unmodifiableList(operators);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/StramWebApp.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/StramWebApp.java b/engine/src/main/java/com/datatorrent/stram/webapp/StramWebApp.java
index 2caffb3..3c64a41 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/StramWebApp.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/StramWebApp.java
@@ -18,7 +18,6 @@
  */
 package com.datatorrent.stram.webapp;
 
-
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
@@ -27,16 +26,16 @@ import javax.ws.rs.ext.ContextResolver;
 import javax.ws.rs.ext.Provider;
 import javax.xml.bind.JAXBContext;
 
-
 import org.apache.hadoop.yarn.webapp.GenericExceptionHandler;
 import org.apache.hadoop.yarn.webapp.RemoteExceptionData;
 import org.apache.hadoop.yarn.webapp.WebApp;
 
-import com.datatorrent.stram.StreamingContainerManager;
 import com.google.inject.Singleton;
 import com.sun.jersey.api.json.JSONConfiguration;
 import com.sun.jersey.api.json.JSONJAXBContext;
 
+import com.datatorrent.stram.StreamingContainerManager;
+
 /**
  *
  * The web services interface in the stram. All web services are routed through this interface<p>
@@ -46,47 +45,48 @@ import com.sun.jersey.api.json.JSONJAXBContext;
  *
  * @since 0.3.2
  */
-public class StramWebApp extends WebApp {
+public class StramWebApp extends WebApp
+{
 
   private final StreamingContainerManager moduleManager;
 
   /**
-   *
    * @param topolManager
    */
-  public StramWebApp(StreamingContainerManager topolManager) {
+  public StramWebApp(StreamingContainerManager topolManager)
+  {
     this.moduleManager = topolManager;
   }
 
   @Singleton
   @Provider
-  public static class JAXBContextResolver implements ContextResolver<JAXBContext> {
+  public static class JAXBContextResolver implements ContextResolver<JAXBContext>
+  {
 
     private final JAXBContext context;
     private final Set<Class<?>> types;
 
     // you have to specify all the dao classes here
     private final Class<?>[] cTypes = {
-      AppInfo.class, RemoteExceptionData.class
+        AppInfo.class, RemoteExceptionData.class
     };
 
     /**
-     *
      * @throws Exception
      */
-    public JAXBContextResolver() throws Exception {
-      this.types = new HashSet<Class<?>>(Arrays.asList(cTypes));
-      this.context = new JSONJAXBContext(JSONConfiguration.natural().
-          rootUnwrapping(false).build(), cTypes);
+    public JAXBContextResolver() throws Exception
+    {
+      this.types = new HashSet<>(Arrays.asList(cTypes));
+      this.context = new JSONJAXBContext(JSONConfiguration.natural().rootUnwrapping(false).build(), cTypes);
     }
 
     /**
-     *
      * @param type
      * @return JAXContext
      */
     @Override
-    public JAXBContext getContext(Class<?> type) {
+    public JAXBContext getContext(Class<?> type)
+    {
       return (types.contains(type)) ? context : null;
     }
 
@@ -96,7 +96,8 @@ public class StramWebApp extends WebApp {
    *
    */
   @Override
-  public void setup() {
+  public void setup()
+  {
     bind(JAXBContextResolver.class);
     bind(GenericExceptionHandler.class);
     bind(WebServices.class);

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java b/engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java
index f11741e..1047f12 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/StramWebServices.java
@@ -20,8 +20,18 @@ package com.datatorrent.stram.webapp;
 
 import java.io.IOException;
 import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.Map.Entry;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
@@ -29,18 +39,16 @@ import java.util.concurrent.TimeUnit;
 import javax.annotation.Nullable;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.*;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 
-import org.apache.commons.beanutils.BeanMap;
-import org.apache.commons.beanutils.BeanUtils;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hadoop.yarn.api.ApplicationConstants;
-import org.apache.hadoop.yarn.webapp.NotFoundException;
-import org.apache.log4j.DTLoggerFactory;
 import org.codehaus.jackson.JsonGenerator;
 import org.codehaus.jackson.JsonProcessingException;
 import org.codehaus.jackson.Version;
@@ -54,14 +62,23 @@ import org.codehaus.jettison.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.commons.beanutils.BeanMap;
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.yarn.api.ApplicationConstants;
+import org.apache.hadoop.yarn.webapp.NotFoundException;
+import org.apache.log4j.DTLoggerFactory;
+
 import com.google.common.collect.Maps;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
+
 import com.datatorrent.api.Attribute;
 import com.datatorrent.api.Context.DAGContext;
 import com.datatorrent.api.Operator;
 import com.datatorrent.api.StringCodec;
-
 import com.datatorrent.stram.StramAppContext;
 import com.datatorrent.stram.StreamingContainerAgent;
 import com.datatorrent.stram.StreamingContainerManager;
@@ -159,8 +176,7 @@ public class StramWebServices
               }
 
             });
-          }
-          catch (Exception ex) {
+          } catch (Exception ex) {
             LOG.error("Caught exception when instantiating codec for class {}", entry.getKey().getName(), ex);
           }
         }
@@ -200,7 +216,7 @@ public class StramWebServices
   public JSONObject getPhysicalPlan() throws Exception
   {
     init();
-    Map<String, Object> result = new HashMap<String, Object>();
+    Map<String, Object> result = new HashMap<>();
     result.put("operators", dagManager.getOperatorInfoList());
     result.put("streams", dagManager.getStreamInfoList());
     return new JSONObject(objectMapper.writeValueAsString(result));
@@ -248,7 +264,7 @@ public class StramWebServices
   public JSONObject getPortsInfo(@PathParam("operatorId") int operatorId) throws Exception
   {
     init();
-    Map<String, Object> map = new HashMap<String, Object>();
+    Map<String, Object> map = new HashMap<>();
     OperatorInfo oi = dagManager.getOperatorInfo(operatorId);
     if (oi == null) {
       throw new NotFoundException();
@@ -287,8 +303,7 @@ public class StramWebServices
     if (parent != null) {
       if (parent.equals("chart")) {
         parent = "com.datatorrent.lib.chart.ChartOperator";
-      }
-      else if (parent.equals("filter")) {
+      } else if (parent.equals("filter")) {
         parent = "com.datatorrent.common.util.SimpleFilterOperator";
       }
     }
@@ -303,11 +318,10 @@ public class StramWebServices
       }
 
       result.put("operatorClasses", classNames);
-    }
-    catch (ClassNotFoundException ex) {
+    } catch (ClassNotFoundException ex) {
       throw new NotFoundException();
-    }
-    catch (JSONException ex) {
+    } catch (JSONException ex) {
+      throw new RuntimeException(ex);
     }
     return result;
   }
@@ -326,12 +340,10 @@ public class StramWebServices
       Class<?> clazz = Class.forName(className);
       if (Operator.class.isAssignableFrom(clazz)) {
         return operatorDiscoverer.describeOperator(className);
-      }
-      else {
+      } else {
         throw new NotFoundException();
       }
-    }
-    catch (Exception ex) {
+    } catch (Exception ex) {
       throw new NotFoundException();
     }
   }
@@ -428,7 +440,7 @@ public class StramWebServices
     init();
     Set<String> stateSet = null;
     if (states != null) {
-      stateSet = new HashSet<String>();
+      stateSet = new HashSet<>();
       stateSet.addAll(Arrays.asList(StringUtils.split(states, ',')));
     }
     ContainersInfo ci = new ContainersInfo();
@@ -463,8 +475,7 @@ public class StramWebServices
     ContainerInfo ci = null;
     if (containerId.equals(System.getenv(ApplicationConstants.Environment.CONTAINER_ID.toString()))) {
       ci = dagManager.getAppMasterContainerInfo();
-    }
-    else {
+    } else {
       for (ContainerInfo containerInfo : dagManager.getCompletedContainerInfo()) {
         if (containerInfo.id.equals(containerId)) {
           ci = containerInfo;
@@ -490,23 +501,21 @@ public class StramWebServices
     JSONObject response = new JSONObject();
     if (containerId.equals(System.getenv(ApplicationConstants.Environment.CONTAINER_ID.toString()))) {
       LOG.info("Received a kill request on application master container. Exiting.");
-      new Thread() {
-
+      new Thread()
+      {
         @Override
         public void run()
         {
           try {
             Thread.sleep(3000);
             System.exit(1);
-          }
-          catch (InterruptedException ex) {
+          } catch (InterruptedException ex) {
             LOG.info("Received interrupt, aborting exit.");
           }
         }
 
       }.start();
-    }
-    else {
+    } else {
       dagManager.stopContainer(containerId);
     }
     return response;
@@ -582,6 +591,7 @@ public class StramWebServices
     }
     return response;
   }
+
   @POST // not supported by WebAppProxyServlet, can only be called directly
   @Path(PATH_PHYSICAL_PLAN_OPERATORS + "/{operatorId:\\d+}/properties")
   @Consumes(MediaType.APPLICATION_JSON)
@@ -598,8 +608,7 @@ public class StramWebServices
         String val = request.isNull(key) ? null : request.getString(key);
         dagManager.setPhysicalOperatorProperty(operatorId, key, val);
       }
-    }
-    catch (JSONException ex) {
+    } catch (JSONException ex) {
       LOG.warn("Got JSON Exception: ", ex);
     }
     return response;
@@ -616,9 +625,9 @@ public class StramWebServices
       throw new NotFoundException();
     }
     HashMap<String, String> map = new HashMap<>();
-    for (Entry<Attribute<?>, Object> entry : dagManager.getOperatorAttributes(operatorName).entrySet()) {
+    for (Map.Entry<Attribute<?>, Object> entry : dagManager.getOperatorAttributes(operatorName).entrySet()) {
       if (attributeName == null || entry.getKey().getSimpleName().equals(attributeName)) {
-        Entry<Attribute<Object>, Object> entry1 = (Entry<Attribute<Object>, Object>)(Entry)entry;
+        Map.Entry<Attribute<Object>, Object> entry1 = (Map.Entry<Attribute<Object>, Object>)(Map.Entry)entry;
         map.put(entry1.getKey().getSimpleName(), entry1.getKey().codec.toString(entry1.getValue()));
       }
     }
@@ -632,9 +641,9 @@ public class StramWebServices
   {
     init();
     HashMap<String, String> map = new HashMap<>();
-    for (Entry<Attribute<?>, Object> entry : dagManager.getApplicationAttributes().entrySet()) {
+    for (Map.Entry<Attribute<?>, Object> entry : dagManager.getApplicationAttributes().entrySet()) {
       if (attributeName == null || entry.getKey().getSimpleName().equals(attributeName)) {
-        Entry<Attribute<Object>, Object> entry1 = (Entry<Attribute<Object>, Object>)(Entry)entry;
+        Map.Entry<Attribute<Object>, Object> entry1 = (Map.Entry<Attribute<Object>, Object>)(Map.Entry)entry;
         map.put(entry1.getKey().getSimpleName(), entry1.getKey().codec.toString(entry1.getValue()));
       }
     }
@@ -690,8 +699,9 @@ public class StramWebServices
     return result;
   }
 
-  private JSONObject getPortObject(Collection<LogicalPlan.InputPortMeta> inputs, Collection<LogicalPlan.OutputPortMeta> outputs,
-                                   String portName) throws JSONException
+  private JSONObject getPortObject(Collection<LogicalPlan.InputPortMeta> inputs,
+      Collection<LogicalPlan.OutputPortMeta> outputs,
+      String portName) throws JSONException
   {
     for (LogicalPlan.InputPortMeta inputPort : inputs) {
       if (inputPort.getPortName().equals(portName)) {
@@ -756,9 +766,9 @@ public class StramWebServices
       throw new NotFoundException();
     }
     HashMap<String, String> map = new HashMap<>();
-    for (Entry<Attribute<?>, Object> entry : dagManager.getPortAttributes(operatorName, portName).entrySet()) {
+    for (Map.Entry<Attribute<?>, Object> entry : dagManager.getPortAttributes(operatorName, portName).entrySet()) {
       if (attributeName == null || entry.getKey().getSimpleName().equals(attributeName)) {
-        Entry<Attribute<Object>, Object> entry1 = (Entry<Attribute<Object>, Object>)(Entry)entry;
+        Map.Entry<Attribute<Object>, Object> entry1 = (Map.Entry<Attribute<Object>, Object>)(Map.Entry)entry;
         map.put(entry1.getKey().getSimpleName(), entry1.getKey().codec.toString(entry1.getValue()));
       }
     }
@@ -789,13 +799,13 @@ public class StramWebServices
 
   private Map<String, Object> getPropertiesAsMap(@QueryParam("propertyName") String propertyName, BeanMap operatorProperties)
   {
-    Map<String, Object> m = new HashMap<String, Object>();
+    Map<String, Object> m = new HashMap<>();
     @SuppressWarnings("rawtypes")
     Iterator entryIterator = operatorProperties.entryIterator();
     while (entryIterator.hasNext()) {
       try {
         @SuppressWarnings("unchecked")
-        Entry<String, Object> entry = (Entry<String, Object>)entryIterator.next();
+        Map.Entry<String, Object> entry = (Map.Entry<String, Object>)entryIterator.next();
         if (propertyName == null) {
           m.put(entry.getKey(), entry.getValue());
         } else if (propertyName.equals(entry.getKey())) {
@@ -823,11 +833,10 @@ public class StramWebServices
 
     try {
       Object object = future.get(waitTime, TimeUnit.MILLISECONDS);
-      if(object != null) {
+      if (object != null) {
         return new JSONObject(new ObjectMapper().writeValueAsString(object));
       }
-    }
-    catch (Exception ex) {
+    } catch (Exception ex) {
       LOG.warn("Caught exception", ex);
       throw new RuntimeException(ex);
     }
@@ -854,7 +863,7 @@ public class StramWebServices
     JSONObject response = new JSONObject();
     try {
       JSONArray jsonArray = request.getJSONArray("requests");
-      List<LogicalPlanRequest> requests = new ArrayList<LogicalPlanRequest>();
+      List<LogicalPlanRequest> requests = new ArrayList<>();
       for (int i = 0; i < jsonArray.length(); i++) {
         JSONObject jsonObj = (JSONObject)jsonArray.get(i);
         LogicalPlanRequest requestObj = (LogicalPlanRequest)Class.forName(LogicalPlanRequest.class.getPackage().getName() + "." + jsonObj.getString("requestType")).newInstance();
@@ -874,18 +883,15 @@ public class StramWebServices
       }
       Future<?> fr = dagManager.logicalPlanModification(requests);
       fr.get(3000, TimeUnit.MILLISECONDS);
-    }
-    catch (Exception ex) {
+    } catch (Exception ex) {
       LOG.error("Error processing plan change", ex);
       try {
         if (ex instanceof ExecutionException) {
           response.put("error", ex.getCause().toString());
-        }
-        else {
+        } else {
           response.put("error", ex.toString());
         }
-      }
-      catch (Exception e) {
+      } catch (Exception e) {
         // ignore
       }
     }
@@ -912,8 +918,7 @@ public class StramWebServices
         if (ConfigValidator.validateLoggersLevel(target, level)) {
           LOG.info("changing logger level for {} to {}", target, level);
           targetChanges.put(target, level);
-        }
-        else {
+        } else {
           LOG.warn("incorrect logger settings {}:{}", target, level);
         }
       }
@@ -923,9 +928,8 @@ public class StramWebServices
         //Changing the levels on Stram after sending the message to all containers.
         DTLoggerFactory.getInstance().changeLoggersLevel(targetChanges);
       }
-    }
-    catch (JSONException ex) {
-      LOG.warn("Got JSON Exception: ", ex);
+    } catch (JSONException ex) {
+      throw new RuntimeException(ex);
     }
     return response;
   }
@@ -941,7 +945,7 @@ public class StramWebServices
     try {
       if (pattern != null) {
         Map<String, String> matches = DTLoggerFactory.getInstance().getClassesMatching(pattern);
-        for (Entry<String, String> match : matches.entrySet()) {
+        for (Map.Entry<String, String> match : matches.entrySet()) {
           JSONObject node = new JSONObject();
           node.put("name", match.getKey());
           node.put("level", match.getValue());
@@ -949,9 +953,8 @@ public class StramWebServices
         }
       }
       response.put("loggers", loggersArray);
-    }
-    catch (JSONException ex) {
-      LOG.warn("Got JSON Exception: ", ex);
+    } catch (JSONException ex) {
+      throw new RuntimeException(ex);
     }
     return response;
   }
@@ -959,12 +962,13 @@ public class StramWebServices
   @GET
   @Path(PATH_LOGGERS)
   @Produces(MediaType.APPLICATION_JSON)
-  public JSONObject getLoggerLevels() throws JSONException {
+  public JSONObject getLoggerLevels() throws JSONException
+  {
     init();
     JSONObject response = new JSONObject();
     JSONArray levelsArray = new JSONArray();
     Map<String, String> currentLevels = DTLoggerFactory.getInstance().getPatternLevels();
-    for (Entry<String, String> lvl : currentLevels.entrySet()) {
+    for (Map.Entry<String, String> lvl : currentLevels.entrySet()) {
       JSONObject node = new JSONObject();
       node.put("target", lvl.getKey());
       node.put("logLevel", lvl.getValue());

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/StreamInfo.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/StreamInfo.java b/engine/src/main/java/com/datatorrent/stram/webapp/StreamInfo.java
index a2903e7..d370b73 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/StreamInfo.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/StreamInfo.java
@@ -35,12 +35,14 @@ import com.datatorrent.api.DAG.Locality;
 @XmlAccessorType(XmlAccessType.FIELD)
 public class StreamInfo
 {
-  public static class Port {
+  public static class Port
+  {
     public String operatorId;
     public String portName;
   }
+
   public String logicalName;
   public Port source = new Port();
-  public List<Port> sinks = new ArrayList<Port>();
+  public List<Port> sinks = new ArrayList<>();
   public Locality locality;
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/StreamsInfo.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/StreamsInfo.java b/engine/src/main/java/com/datatorrent/stram/webapp/StreamsInfo.java
index 6f73ccd..911b462 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/StreamsInfo.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/StreamsInfo.java
@@ -40,23 +40,24 @@ import javax.xml.bind.annotation.XmlSeeAlso;
 @XmlRootElement(name = "streams")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlSeeAlso({StreamInfo.class})
-public class StreamsInfo {
+public class StreamsInfo
+{
 
-  protected List<StreamInfo> streams = new ArrayList<StreamInfo>();
+  protected List<StreamInfo> streams = new ArrayList<>();
 
   /**
-   *
    * @param streamInfo
    */
-  public void add(StreamInfo streamInfo) {
+  public void add(StreamInfo streamInfo)
+  {
     streams.add(streamInfo);
   }
 
   /**
-   *
    * @return list of stream info
    */
-  public List<StreamInfo> getStreams() {
+  public List<StreamInfo> getStreams()
+  {
     return Collections.unmodifiableList(streams);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/TypeDiscoverer.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/TypeDiscoverer.java b/engine/src/main/java/com/datatorrent/stram/webapp/TypeDiscoverer.java
index e1b46d4..b8f4700 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/TypeDiscoverer.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/TypeDiscoverer.java
@@ -18,7 +18,13 @@
  */
 package com.datatorrent.stram.webapp;
 
-import java.lang.reflect.*;
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Map;
@@ -48,7 +54,8 @@ import com.datatorrent.stram.plan.logical.LogicalPlan;
 public class TypeDiscoverer
 {
 
-  enum UI_TYPE{
+  enum UI_TYPE
+  {
 
     LIST(Collection.class, "List"),
 
@@ -67,15 +74,14 @@ public class TypeDiscoverer
 
     public static UI_TYPE getEnumFor(Class<?> clazz)
     {
-      if(clazz.isEnum()){
+      if (clazz.isEnum()) {
         return ENUM;
       }
-      if(clazz.isArray()){
+      if (clazz.isArray()) {
         return LIST;
       }
-      for(UI_TYPE ui_type : UI_TYPE.values()){
-        if(ui_type.assignableTo.isAssignableFrom(clazz))
-        {
+      for (UI_TYPE ui_type : UI_TYPE.values()) {
+        if (ui_type.assignableTo.isAssignableFrom(clazz)) {
           return ui_type;
         }
       }
@@ -104,7 +110,8 @@ public class TypeDiscoverer
   // map of generic type name to actual type
   public final Map<String, Type> typeArguments = Maps.newHashMap();
 
-  public static Type getParameterizedTypeArgument(Type type, Class<?> rawType) {
+  public static Type getParameterizedTypeArgument(Type type, Class<?> rawType)
+  {
     if (type instanceof ParameterizedType) {
       ParameterizedType ptype = (ParameterizedType)type;
       if (rawType == null || rawType.isAssignableFrom((Class<?>)ptype.getRawType())) {
@@ -128,7 +135,7 @@ public class TypeDiscoverer
         if (actualTypeArguments.length != typeParameters.length) {
           throw new AssertionError("type parameters don't match for " + type);
         }
-        for (int i=0; i<typeParameters.length; i++) {
+        for (int i = 0; i < typeParameters.length; i++) {
           LOG.debug("{} tv {} bounds {} type arg {}", rawTypeClass.getSimpleName(), typeParameters[i].getName(), typeParameters[i].getBounds(), actualTypeArguments[i]);
           if (!typeArguments.containsKey(typeParameters[i].getName())) {
             this.typeArguments.put(typeParameters[i].getName(), actualTypeArguments[i]);
@@ -156,7 +163,7 @@ public class TypeDiscoverer
       meta.put("typeArgs", typeArgs);
       meta.put("type", ((Class<?>)ptype.getRawType()).getName());
       UI_TYPE uiType = UI_TYPE.getEnumFor((Class<?>)ptype.getRawType());
-      if(uiType!=null){
+      if (uiType != null) {
         meta.put("uiType", uiType.getName());
       }
     } else if (type instanceof GenericArrayType) {
@@ -188,10 +195,10 @@ public class TypeDiscoverer
       if (ta == null) {
         ta = type;
       }
-      if(ta instanceof Class){
+      if (ta instanceof Class) {
         meta.put("type", ((Class<?>)ta).getName());
         UI_TYPE uiType = UI_TYPE.getEnumFor(((Class<?>)ta));
-        if(uiType!=null){
+        if (uiType != null) {
           meta.put("uiType", uiType.getName());
         }
       } else if (ta instanceof ParameterizedType) {
@@ -234,6 +241,7 @@ public class TypeDiscoverer
 
   /**
    * Fetches application attributes.
+   *
    * @return all application attributes exposed to user.
    * @throws JSONException
    * @throws IllegalAccessException
@@ -247,6 +255,7 @@ public class TypeDiscoverer
 
   /**
    * Fetches operator attributes.
+   *
    * @return all operator attributes exposed to user.
    * @throws JSONException
    * @throws IllegalAccessException
@@ -260,6 +269,7 @@ public class TypeDiscoverer
 
   /**
    * Fetches port attributes.
+   *
    * @return all port attributes exposed to user.
    * @throws JSONException
    * @throws IllegalAccessException
@@ -272,7 +282,7 @@ public class TypeDiscoverer
   }
 
   private static JSONObject getAttrDescription(Context context, Collection<Field> attributes) throws JSONException,
-    IllegalAccessException
+      IllegalAccessException
   {
     JSONObject response = new JSONObject();
     JSONArray attrArray = new JSONArray();
@@ -280,9 +290,9 @@ public class TypeDiscoverer
     for (Field attrField : attributes) {
       JSONObject attrJson = new JSONObject();
       attrJson.put("name", attrField.getName());
-      ParameterizedType attrType = (ParameterizedType) attrField.getGenericType();
+      ParameterizedType attrType = (ParameterizedType)attrField.getGenericType();
 
-      Attribute<?> attr = (Attribute<?>) attrField.get(context);
+      Attribute<?> attr = (Attribute<?>)attrField.get(context);
       Type pType = attrType.getActualTypeArguments()[0];
 
       TypeDiscoverer discoverer = new TypeDiscoverer();

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/TypeGraph.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/TypeGraph.java b/engine/src/main/java/com/datatorrent/stram/webapp/TypeGraph.java
index 6cf36f3..2f91b11 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/TypeGraph.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/TypeGraph.java
@@ -59,6 +59,7 @@ import com.esotericsoftware.kryo.Kryo;
 import com.esotericsoftware.kryo.Serializer;
 import com.esotericsoftware.kryo.io.Input;
 import com.esotericsoftware.kryo.io.Output;
+import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Primitives;
 
@@ -66,7 +67,6 @@ import com.datatorrent.api.Component;
 import com.datatorrent.api.InputOperator;
 import com.datatorrent.api.Operator;
 import com.datatorrent.common.util.BaseOperator;
-import com.datatorrent.netlet.util.DTThrowable;
 import com.datatorrent.stram.webapp.asm.ClassNodeType;
 import com.datatorrent.stram.webapp.asm.ClassSignatureVisitor;
 import com.datatorrent.stram.webapp.asm.CompactClassNode;
@@ -84,7 +84,8 @@ import com.datatorrent.stram.webapp.asm.Type.WildcardTypeNode;
 
 /**
  * A graph data structure holds all type information and their relationship needed in app builder
- * ASM is used to retrieve fields, methods information and kept in java beans and then stored in this graph data structure
+ * ASM is used to retrieve fields, methods information and kept in java beans and then stored in this graph data
+ * structure
  * ASM is used to avoid memory leak and save permgen memory space
  *
  * @since 2.1
@@ -93,11 +94,11 @@ import com.datatorrent.stram.webapp.asm.Type.WildcardTypeNode;
 public class TypeGraph
 {
   // classes to exclude when fetching getter/setter method or in other parsers
-  public static final String[] EXCLUDE_CLASSES = {Object.class.getName().replace('.', '/'), 
-    Enum.class.getName().replace('.', '/'), 
-    Operator.class.getName().replace('.', '/'),
-    Component.class.getName().replace('.', '/'),
-    BaseOperator.class.getName().replace('.', '/')};
+  public static final String[] EXCLUDE_CLASSES = {Object.class.getName().replace('.', '/'),
+      Enum.class.getName().replace('.', '/'),
+      Operator.class.getName().replace('.', '/'),
+      Component.class.getName().replace('.', '/'),
+      BaseOperator.class.getName().replace('.', '/')};
 
   public static final ImmutableSet<String> JACKSON_INSTANTIABLE_CLASSES;
 
@@ -109,7 +110,7 @@ public class TypeGraph
     }
     Iterator<FromStringDeserializer<?>> iter = FromStringDeserializer.all().iterator();
     while (iter.hasNext()) {
-      FromStringDeserializer fsd =  iter.next();
+      FromStringDeserializer fsd = iter.next();
       b.add(fsd.getValueClass().getName());
     }
     JACKSON_INSTANTIABLE_CLASSES = b.build();
@@ -179,12 +180,11 @@ public class TypeGraph
 
     private static String[] GetStringTypes()
     {
-
-      ArrayList<String> l = new ArrayList<String>();
+      ArrayList<String> l = new ArrayList<>();
       l.add(Class.class.getName());
       Iterator<FromStringDeserializer<?>> iter = FromStringDeserializer.all().iterator();
       while (iter.hasNext()) {
-        FromStringDeserializer fsd =  iter.next();
+        FromStringDeserializer fsd = iter.next();
         l.add(fsd.getValueClass().getName());
       }
       String[] a = new String[l.size()];
@@ -233,8 +233,6 @@ public class TypeGraph
       return null;
     }
 
-    
-
     public String getName()
     {
       return name;
@@ -243,7 +241,7 @@ public class TypeGraph
 
   public static List<String> getAllAncestors(TypeGraphVertex tgv, boolean include)
   {
-    List<String> result = new LinkedList<String>();
+    List<String> result = new LinkedList<>();
     if (include) {
       result.add(tgv.typeName);
     }
@@ -259,10 +257,9 @@ public class TypeGraph
     }
   }
 
-
   private static final Logger LOG = LoggerFactory.getLogger(TypeGraph.class);
 
-  private final Map<String, TypeGraphVertex> typeGraph = new HashMap<String, TypeGraphVertex>();
+  private final Map<String, TypeGraphVertex> typeGraph = new HashMap<>();
 
   private TypeGraphVertex addNode(InputStream input, String resName) throws IOException
   {
@@ -339,7 +336,6 @@ public class TypeGraph
 
     tgv.allInstantiableDescendants.addAll(allChildren);
 
-
     for (TypeGraphVertex parent : tgv.ancestors) {
       updateInstantiableDescendants(parent, allChildren);
     }
@@ -356,7 +352,7 @@ public class TypeGraph
     if (tgv == null) {
       return null;
     }
-    Set<String> result = new TreeSet<String>();
+    Set<String> result = new TreeSet<>();
     for (TypeGraphVertex node : tgv.allInstantiableDescendants) {
       if ((isAncestor(InputOperator.class.getName(), node.typeName) || !getAllInputPorts(node).isEmpty())) {
         result.add(node.typeName);
@@ -368,7 +364,7 @@ public class TypeGraph
 
   public Set<String> getDescendants(String fullClassName)
   {
-    Set<String> result = new HashSet<String>();
+    Set<String> result = new HashSet<>();
     TypeGraphVertex tgv = typeGraph.get(fullClassName);
     if (tgv != null) {
       tranverse(tgv, false, result, Integer.MAX_VALUE);
@@ -415,8 +411,8 @@ public class TypeGraph
     /**
      * All instantiable(public type with a public non-arg constructor) implementations including direct and indirect descendants
      */
-    private final transient SortedSet<TypeGraphVertex> allInstantiableDescendants = new TreeSet<TypeGraphVertex>(new Comparator<TypeGraphVertex>() {
-
+    private final transient SortedSet<TypeGraphVertex> allInstantiableDescendants = new TreeSet<>(new Comparator<TypeGraphVertex>()
+    {
       @Override
       public int compare(TypeGraphVertex o1, TypeGraphVertex o2)
       {
@@ -432,9 +428,9 @@ public class TypeGraph
       }
     });
 
-    private final transient Set<TypeGraphVertex> ancestors = new HashSet<TypeGraphVertex>();
+    private final transient Set<TypeGraphVertex> ancestors = new HashSet<>();
 
-    private final transient Set<TypeGraphVertex> descendants = new HashSet<TypeGraphVertex>();
+    private final transient Set<TypeGraphVertex> descendants = new HashSet<>();
 
     private transient TypeGraph owner;
 
@@ -447,7 +443,6 @@ public class TypeGraph
 
     private boolean isInstantiable = false;
 
-
     @SuppressWarnings("unused")
     private TypeGraphVertex()
     {
@@ -553,7 +548,7 @@ public class TypeGraph
 
     public void setJarName(String jarName)
     {
-      this.jarName =  jarName;
+      this.jarName = jarName;
     }
 
     /**
@@ -611,7 +606,7 @@ public class TypeGraph
         if (owner.isAncestor(Operator.class.getName(), typeName)) {
           // load ports if it is an Operator class
           CompactUtil.updateCompactClassPortInfo(classN, ccn);
-          List<CompactFieldNode> prunedFields = new LinkedList<CompactFieldNode>();
+          List<CompactFieldNode> prunedFields = new LinkedList<>();
           TypeGraphVertex portVertex = owner.getTypeGraphVertex(Operator.Port.class.getName());
           for (CompactFieldNode field : ccn.getPorts()) {
             TypeGraphVertex fieldVertex = owner.getTypeGraphVertex(field.getDescription());
@@ -635,9 +630,10 @@ public class TypeGraph
   /**
    * @param clazz parent class
    * @param filter
-   * @param packagePrefix 
+   * @param packagePrefix
    * @param startsWith  case insensitive
-   * @return all instantiable descendants of class clazz which comfort to filter expression, packagePrefix and start with $startsWith
+   * @return all instantiable descendants of class clazz which comfort to filter expression, packagePrefix and start
+   * with $startsWith
    */
   public List<String> getInstantiableDescendants(String clazz, String filter, String packagePrefix, String startsWith)
   {
@@ -645,10 +641,9 @@ public class TypeGraph
     if (tgv == null) {
       return null;
     }
-    
-    List<String> result = new LinkedList<String>();
+
+    List<String> result = new LinkedList<>();
     if (tgv != null) {
-      
       for (TypeGraphVertex node : tgv.allInstantiableDescendants) {
         String typeName = node.typeName;
         if (filter != null && !Pattern.matches(filter, node.typeName)) {
@@ -658,7 +653,7 @@ public class TypeGraph
           continue;
         }
         if (startsWith != null && !typeName.substring(typeName.lastIndexOf('.') + 1).toLowerCase()
-          .startsWith(startsWith.toLowerCase())) {
+            .startsWith(startsWith.toLowerCase())) {
           continue;
         }
         result.add(node.typeName);
@@ -686,9 +681,7 @@ public class TypeGraph
     if (uType != null) {
       desc.put("uiType", uType.getName());
     }
-    
-    addClassPropertiesAndPorts(clazzName,  desc);
-
+    addClassPropertiesAndPorts(clazzName, desc);
     if (tgv.hasResource()) {
       desc.put("hasResource", "true");
     } else {
@@ -699,15 +692,15 @@ public class TypeGraph
   }
 
   private Collection<JSONObject> getPortTypeInfo(String clazzName,
-    Map<Type, Type> typeReplacement, List<CompactFieldNode> ports) throws JSONException
+      Map<Type, Type> typeReplacement, List<CompactFieldNode> ports) throws JSONException
   {
     TypeGraphVertex tgv = typeGraph.get(clazzName);
     if (tgv == null) {
       return null;
     }
-    
-    Collection<JSONObject> portInfo = new ArrayList<JSONObject>();
-    
+
+    Collection<JSONObject> portInfo = new ArrayList<>();
+
     for (CompactFieldNode port : ports) {
       Type fieldType = port.getFieldSignatureNode().getFieldType();
       Type t = fieldType;
@@ -727,7 +720,7 @@ public class TypeGraph
         setTypes(meta, t, typeReplacement);
         portInfo.add(meta);
       } catch (Exception e) {
-        DTThrowable.wrapIfChecked(e);
+        throw Throwables.propagate(e);
       }
     }
 
@@ -781,7 +774,7 @@ public class TypeGraph
 
   public List<CompactFieldNode> getAllInputPorts(TypeGraphVertex tgv)
   {
-    List<CompactFieldNode> ports = new ArrayList<CompactFieldNode>();
+    List<CompactFieldNode> ports = new ArrayList<>();
     if (tgv == null) {
       return ports;
     }
@@ -802,7 +795,7 @@ public class TypeGraph
   public List<CompactFieldNode> getAllOutputPorts(String clazzName)
   {
     TypeGraphVertex tgv = typeGraph.get(clazzName);
-    List<CompactFieldNode> ports = new ArrayList<CompactFieldNode>();
+    List<CompactFieldNode> ports = new ArrayList<>();
     TypeGraphVertex portVertex = typeGraph.get(Operator.OutputPort.class.getName());
     getAllPortsWithAncestor(portVertex, tgv, ports);
     Collections.sort(ports, new Comparator<CompactFieldNode>()
@@ -840,11 +833,11 @@ public class TypeGraph
       return;
     }
 
-    Map<String, JSONObject> results = new TreeMap<String, JSONObject>();
-    List<CompactMethodNode> getters = new LinkedList<CompactMethodNode>();
-    List<CompactMethodNode> setters = new LinkedList<CompactMethodNode>();
-    Map<Type, Type> typeReplacement = new HashMap<Type, Type>();
-    List<CompactFieldNode> ports = new LinkedList<CompactFieldNode>();
+    Map<String, JSONObject> results = new TreeMap<>();
+    List<CompactMethodNode> getters = new LinkedList<>();
+    List<CompactMethodNode> setters = new LinkedList<>();
+    Map<Type, Type> typeReplacement = new HashMap<>();
+    List<CompactFieldNode> ports = new LinkedList<>();
 
     getPublicSetterGetterAndPorts(tgv, setters, getters, typeReplacement, ports);
     desc.put("portTypeInfo", getPortTypeInfo(clazzName, typeReplacement, ports));
@@ -925,7 +918,7 @@ public class TypeGraph
       // if it's visiting classes need to be exclude from parsing, remove methods that override in sub class
       // So the setter/getter methods in Operater, Object, Class won't be counted
       for (CompactMethodNode compactMethodNode : exClass.getGetterMethods()) {
-        for (Iterator<CompactMethodNode> iterator = getters.iterator(); iterator.hasNext();) {
+        for (Iterator<CompactMethodNode> iterator = getters.iterator(); iterator.hasNext(); ) {
           CompactMethodNode cmn = iterator.next();
           if (cmn.getName().equals(compactMethodNode.getName())) {
             iterator.remove();
@@ -933,7 +926,7 @@ public class TypeGraph
         }
       }
       for (CompactMethodNode compactMethodNode : exClass.getSetterMethods()) {
-        for (Iterator<CompactMethodNode> iterator = setters.iterator(); iterator.hasNext();) {
+        for (Iterator<CompactMethodNode> iterator = setters.iterator(); iterator.hasNext(); ) {
           CompactMethodNode cmn = iterator.next();
           if (cmn.getName().equals(compactMethodNode.getName())) {
             iterator.remove();
@@ -948,7 +941,7 @@ public class TypeGraph
         getters.addAll(tgv.getOrLoadClassNode().getGetterMethods());
       }
     }
-    
+
     TypeGraphVertex portVertex = typeGraph.get(Operator.Port.class.getName());
     List<CompactFieldNode> fields = tgv.getOrLoadClassNode().getPorts();
     if (fields != null) {
@@ -959,10 +952,10 @@ public class TypeGraph
         }
       }
     }
-    
+
     ClassSignatureVisitor csv = tgv.getOrLoadClassNode().getCsv();
     Type superC = csv.getSuperClass();
-    
+
     addReplacement(superC, typeReplacement);
 
     if (csv.getInterfaces() != null) {
@@ -998,7 +991,7 @@ public class TypeGraph
     visitedType.add(rawType);
     // type could be replaced
     Type t = resolveType(rawType, typeReplacement);
-    
+
     if (propJ == null) {
       return;
     } else {
@@ -1018,7 +1011,7 @@ public class TypeGraph
             case BYTE:
             case SHORT:
             case STRING:
-              propJ.put("type",  uiType.getName());
+              propJ.put("type", uiType.getName());
               break;
             default:
               propJ.put("uiType", uiType.getName());
@@ -1040,8 +1033,6 @@ public class TypeGraph
       }
       if (t instanceof WildcardTypeNode) {
         JSONObject typeBounds = new JSONObject();
-        
-        
         JSONArray jArray = new JSONArray();
         Type[] bounds = ((WildcardTypeNode)t).getUpperBounds();
         if (bounds != null) {
@@ -1050,7 +1041,7 @@ public class TypeGraph
           }
         }
         typeBounds.put("upper", jArray);
-        
+
         bounds = ((WildcardTypeNode)t).getLowerBounds();
 
         jArray = new JSONArray();
@@ -1067,14 +1058,14 @@ public class TypeGraph
       if (t instanceof ArrayTypeNode) {
         propJ.put("type", t.getByteString());
         propJ.put("uiType", UI_TYPE.LIST.getName());
-        
+
         JSONObject jObj = new JSONObject();
         if (!stopRecursive) {
           setTypes(jObj, ((ArrayTypeNode)t).getActualArrayType(), typeReplacement, visitedType);
         }
         propJ.put("itemType", jObj);
       }
-      
+
       if (t instanceof TypeVariableNode) {
         propJ.put("typeLiteral", ((TypeVariableNode)t).getTypeLiteral());
         if (!stopRecursive) {
@@ -1082,7 +1073,6 @@ public class TypeGraph
         }
       }
 
-
     }
   }
 
@@ -1150,7 +1140,6 @@ public class TypeGraph
     }
   }
 
-  
   private Type resolveType(Type t, Map<Type, Type> typeReplacement)
   {
     if (typeReplacement.containsKey(t)) {
@@ -1172,7 +1161,7 @@ public class TypeGraph
     @Override
     public void write(Kryo kryo, Output output, TypeGraph tg)
     {
-      Map<String, Integer> indexes = new HashMap<String, Integer>();
+      Map<String, Integer> indexes = new HashMap<>();
       // write the size first
       kryo.writeObject(output, tg.typeGraph.size());
       int i = 0;
@@ -1181,7 +1170,7 @@ public class TypeGraph
         indexes.put(e.getKey(), i++);
         kryo.writeObject(output, e.getValue());
       }
-      
+
       // Sequentially store the descendants and instantiable descendants relationships in index in vertex array
       for (Entry<String, TypeGraphVertex> e : tg.typeGraph.entrySet()) {
         int[] refs = fromSet(e.getValue().descendants, indexes);
@@ -1189,7 +1178,7 @@ public class TypeGraph
         refs = fromSet(e.getValue().allInstantiableDescendants, indexes);
         kryo.writeObject(output, refs);
       }
-      
+
     }
 
     private int[] fromSet(Set<TypeGraphVertex> tgvSet, Map<String, Integer> indexes)
@@ -1212,7 +1201,7 @@ public class TypeGraph
       for (int i = 0; i < vertexNo; i++) {
         tgv[i] = kryo.readObject(input, TypeGraphVertex.class);
       }
-      
+
       // build relations between vertexes
       for (int i = 0; i < tgv.length; i++) {
         int[] ref = kryo.readObject(input, int[].class);
@@ -1220,12 +1209,12 @@ public class TypeGraph
           tgv[i].descendants.add(tgv[ref[j]]);
           tgv[ref[j]].ancestors.add(tgv[i]);
         }
-        
+
         ref = kryo.readObject(input, int[].class);
         for (int j = 0; j < ref.length; j++) {
           tgv[i].allInstantiableDescendants.add(tgv[ref[j]]);
         }
-        
+
       }
       TypeGraph result = new TypeGraph();
       for (TypeGraphVertex typeGraphVertex : tgv) {
@@ -1248,7 +1237,7 @@ public class TypeGraph
     if (tgv == null || tgv.ancestors == null) {
       return null;
     }
-    List<String> result = new LinkedList<String>();
+    List<String> result = new LinkedList<>();
     for (TypeGraphVertex p : tgv.ancestors) {
       result.add(p.typeName);
     }

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/ASMUtil.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ASMUtil.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ASMUtil.java
index c9b8f15..9716560 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ASMUtil.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ASMUtil.java
@@ -34,102 +34,92 @@ import org.apache.xbean.asm5.tree.MethodNode;
  */
 public class ASMUtil
 {
-  
   public static final String CONSTRUCTOR_NAME = "<init>";
-  
 
   public static boolean isEnum(ClassNode cn)
   {
     return (cn.access & Opcodes.ACC_ENUM) == Opcodes.ACC_ENUM;
   }
-  
+
   public static boolean isEnumValue(FieldNode fn)
   {
     return (fn.access & Opcodes.ACC_ENUM) == Opcodes.ACC_ENUM;
   }
-  
-  
 
   @SuppressWarnings("unchecked")
   public static List<String> getEnumValues(ClassNode cn)
-  { 
-    List<String> result = new LinkedList<String>();
-    for(FieldNode fn : (List<FieldNode>)cn.fields){
-      if(isEnumValue(fn))
+  {
+    List<String> result = new LinkedList<>();
+    for (FieldNode fn : (List<FieldNode>)cn.fields) {
+      if (isEnumValue(fn)) {
         result.add(fn.name);
-    };
+      }
+    }
     return result;
   }
-  
+
   public static List<FieldNode> getPorts(ClassNode asmNode)
   {
-    List<FieldNode> result = new LinkedList<FieldNode>();
+    List<FieldNode> result = new LinkedList<>();
     List<FieldNode> fields = asmNode.fields;
-    for(FieldNode fn : fields)
-    {
+    for (FieldNode fn : fields) {
       // 'L' represents <class>, ignore primitive types
-      if(fn.desc.charAt(0) == 'L')
-      {
+      if (fn.desc.charAt(0) == 'L') {
         result.add(fn);
       }
     }
 
     return result;
   }
-  
 
   /**
    * Get a list of setter methods from classnode asmNode
    * @param asmNode
    * @return empty list if there is no setter method
    */
-  public static List<MethodNode> getPublicSetter(ClassNode asmNode){
-    List<MethodNode> result = new LinkedList<MethodNode>();
+  public static List<MethodNode> getPublicSetter(ClassNode asmNode)
+  {
+    List<MethodNode> result = new LinkedList<>();
     @SuppressWarnings("unchecked")
     List<MethodNode> mList = asmNode.methods;
     for (MethodNode methodNode : mList) {
 
-      if(methodNode.name.startsWith("set") && 
-          isPublic(methodNode.access) && 
+      if (methodNode.name.startsWith("set") &&
+          isPublic(methodNode.access) &&
           Type.getArgumentTypes(methodNode.desc).length == 1 &&
-          Type.getReturnType(methodNode.desc) == Type.VOID_TYPE)
+          Type.getReturnType(methodNode.desc) == Type.VOID_TYPE) {
         result.add(methodNode);
+      }
     }
     return result;
   }
-  
-  
+
   /**
    * Get a list of getter methods from classnode asmNode
    * @param asmNode
    * @return empty list if there is no getter method
    */
-  public static List<MethodNode> getPublicGetter(ClassNode asmNode){
-    List<MethodNode> result = new LinkedList<MethodNode>();
+  public static List<MethodNode> getPublicGetter(ClassNode asmNode)
+  {
+    List<MethodNode> result = new LinkedList<>();
     @SuppressWarnings("unchecked")
     List<MethodNode> mList = asmNode.methods;
     for (MethodNode methodNode : mList) {
-
-      if(
-          //arg-list is 0 and return type is not void
-          (Type.getArgumentTypes(methodNode.desc).length == 0 && 
-          Type.getReturnType(methodNode.desc) != Type.VOID_TYPE) &&
-          // and method name start with get or start with is if return type is boolean
-          (methodNode.name.startsWith("get") || (methodNode.name.startsWith("is") && Type.getReturnType(methodNode.desc) == Type.BOOLEAN_TYPE))
-          &&
-          // and must be public
-          isPublic(methodNode.access)  
-          )
+      // arg-list is 0 and return type is not void
+      // and method name start with get or start with is if return type is boolean
+      // and must be public
+      if ((Type.getArgumentTypes(methodNode.desc).length == 0 && Type.getReturnType(methodNode.desc) != Type.VOID_TYPE) &&
+          (methodNode.name.startsWith("get") || (methodNode.name.startsWith("is") && Type.getReturnType(methodNode.desc) == Type.BOOLEAN_TYPE)) &&
+          isPublic(methodNode.access)) {
         result.add(methodNode);
+      }
     }
     return result;
   }
 
-  
-
   /**
    * Get all public default constructor(0-arg) for the classnode
-   * 
+   *
    * @param asmNode
    * @return null if there is no public default constructor
    */
@@ -138,16 +128,15 @@ public class ASMUtil
     @SuppressWarnings("unchecked")
     List<MethodNode> mList = asmNode.methods;
     for (MethodNode methodNode : mList) {
-      if(methodNode.name.equals(CONSTRUCTOR_NAME) && 
-          isPublic(methodNode.access) && 
-          Type.getArgumentTypes(methodNode.desc).length == 0)
+      if (methodNode.name.equals(CONSTRUCTOR_NAME) &&
+          isPublic(methodNode.access) &&
+          Type.getArgumentTypes(methodNode.desc).length == 0) {
         return methodNode;
+      }
     }
     return null;
   }
 
-
-
   public static boolean isPublic(int opCode)
   {
     return (opCode & Opcodes.ACC_PUBLIC) == Opcodes.ACC_PUBLIC;
@@ -162,7 +151,7 @@ public class ASMUtil
   {
     return (opCode & Opcodes.ACC_TRANSIENT) == Opcodes.ACC_TRANSIENT;
   }
-  
+
   public static boolean isFinal(int opCode)
   {
     return (opCode & Opcodes.ACC_FINAL) == Opcodes.ACC_FINAL;

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/BaseSignatureVisitor.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/BaseSignatureVisitor.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/BaseSignatureVisitor.java
index cd72295..1b3be74 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/BaseSignatureVisitor.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/BaseSignatureVisitor.java
@@ -44,15 +44,16 @@ import com.datatorrent.stram.webapp.asm.Type.WildcardTypeNode;
 public abstract class BaseSignatureVisitor extends SignatureVisitor
 {
   
-  protected List<TypeVariableNode> typeV = new LinkedList<Type.TypeVariableNode>();
+  protected List<TypeVariableNode> typeV = new LinkedList<>();
   
   protected int stage = -1;
   
   public static final int VISIT_FORMAL_TYPE = 0;
   
-  protected Stack<Type> visitingStack = new Stack<Type>();
+  protected Stack<Type> visitingStack = new Stack<>();
 
-  public BaseSignatureVisitor() {
+  public BaseSignatureVisitor()
+  {
     super(Opcodes.ASM5);
   }
 
@@ -63,7 +64,6 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   @Override
   public SignatureVisitor visitArrayType()
   {
-    //System.out.println("visitArrayType ");
     ArrayTypeNode at = new ArrayTypeNode();
     visitingStack.push(at);
     return this;
@@ -75,7 +75,6 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
     
     Type.TypeNode tn = new Type.TypeNode();
     tn.setObjByteCode(baseType + "");
-//    System.out.println(tn.typeObj);
     visitingStack.push(tn);
     resolveStack();
     // base type could only appear in method parameter list or return type  
@@ -85,7 +84,6 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
 //    if(stage == VISIT_RETURN) {
 //      returnType = tn;
 //    }
-    //System.out.println("visitBaseType:'" + baseType);
   }
 
 
@@ -95,7 +93,6 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
 
     Type.TypeNode tn = new Type.TypeNode();
     tn.setObjByteCode("L" + classType + ";");
-//    System.out.println(tn.typeObj);
     visitingStack.push(tn);
     // base type could only appear in method parameter list or return type  
 //    if(stage == VISIT_PARAM) {
@@ -106,26 +103,26 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
 //    } if(stage == VISIT_EXCEPTION) {
 //      exceptionType = tn;
 //    } 
-    //System.out.print("visitClassType:'" + classType + "'  ,  ");
   }
   
-  private void resolveStack() {
-    if(visitingStack.isEmpty() || visitingStack.size()==1){
+  private void resolveStack()
+  {
+    if (visitingStack.isEmpty() || visitingStack.size() == 1) {
       return;
     }
     Type top = visitingStack.pop();
     Type peek = visitingStack.peek();
-    
-    if(peek instanceof ParameterizedTypeNode){
+
+    if (peek instanceof ParameterizedTypeNode) {
       ((ParameterizedTypeNode)peek).actualTypeArguments.add(top);
       return;
-    } else if(peek instanceof ArrayTypeNode) {
+    } else if (peek instanceof ArrayTypeNode) {
       ((ArrayTypeNode)peek).actualArrayType = top;
       resolveStack();
-    } else if(peek instanceof WildcardTypeNode) {
+    } else if (peek instanceof WildcardTypeNode) {
       ((WildcardTypeNode)peek).bounds.add(top);
       resolveStack();
-    } else if(peek instanceof TypeVariableNode){
+    } else if (peek instanceof TypeVariableNode) {
       ((TypeVariableNode)peek).bounds.add(top);
       resolveStack();
     } else {
@@ -139,15 +136,12 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   public void visitEnd()
   {
     resolveStack();
-    //System.out.print("visitEnd ");
-    //System.out.println();
   }
   
   @Override
   public void visitInnerClassType(String classType)
   {
     visitClassType(classType); 
-    //System.out.print("visitInnerClassType:'" + classType + "'  ,  ");
   }
 
 
@@ -163,7 +157,7 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   @Override
   public SignatureVisitor visitTypeArgument(char typeArg)
   {
-    TypeNode t = (TypeNode) visitingStack.pop();
+    TypeNode t = (TypeNode)visitingStack.pop();
     if (t instanceof ParameterizedTypeNode) {
       visitingStack.push(t);
     } else {
@@ -172,14 +166,13 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
       visitingStack.push(pt);
     }
     
-    if(typeArg == SignatureVisitor.INSTANCEOF){
+    if (typeArg == SignatureVisitor.INSTANCEOF) {
       return this;
     }        
     WildcardTypeNode wtn = new WildcardTypeNode();
     wtn.boundChar = typeArg;
     visitingStack.push(wtn);
     
-    //System.out.print("visitTypeArgument:'" + typeArg + "'  ,  ");
     return this;
   }
   
@@ -190,20 +183,19 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   {
     boolean found = false;
     for (TypeVariableNode typeVariableNode : typeV) {
-      if(typeVariableNode.typeLiteral.equals(typeVariable)){
+      if (typeVariableNode.typeLiteral.equals(typeVariable)) {
         visitingStack.push(typeVariableNode);
         found = true;
         break;
       }
     }
-    if(!found) {
+    if (!found) {
       TypeNode tn = new TypeNode();
       tn.setObjByteCode("T" + typeVariable + ";");
       visitingStack.push(tn);
       
     }
     resolveStack();
-    //System.out.println("visitTypeVariable:'" + typeVariable);
   }
   
   @Override
@@ -215,8 +207,6 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   @Override
   public SignatureVisitor visitInterfaceBound()
   {
-//    System.out.println("*******************visitInterfaceBound");
-//    System.out.println("visitInterfaceBound");
     return this;
   }
 
@@ -229,7 +219,7 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
   @Override
   public void visitFormalTypeParameter(String typeVariable)
   {
-    if(stage==VISIT_FORMAL_TYPE && !visitingStack.isEmpty()){
+    if (stage == VISIT_FORMAL_TYPE && !visitingStack.isEmpty()) {
       visitingStack.pop();
     }
     stage = VISIT_FORMAL_TYPE;
@@ -237,18 +227,12 @@ public abstract class BaseSignatureVisitor extends SignatureVisitor
     tvn.typeLiteral = typeVariable;
     visitingStack.push(tvn);
     typeV.add(tvn);
-//    System.out.println("****************" + typeVariable);
-//    System.out.println("visitFormalTypeParameter");
-
-//    throw new UnsupportedOperationException();
   }
 
   @Override
   public SignatureVisitor visitClassBound()
   {
-//    System.out.println("*******************visitClassBound");
     return this;
-    //throw new UnsupportedOperationException();
   }
   
   public List<TypeVariableNode> getTypeV()

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassNodeType.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassNodeType.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassNodeType.java
index 80f475f..c70bd81 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassNodeType.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassNodeType.java
@@ -18,7 +18,6 @@
  */
 package com.datatorrent.stram.webapp.asm;
 
-
 import org.apache.xbean.asm5.FieldVisitor;
 import org.apache.xbean.asm5.MethodVisitor;
 import org.apache.xbean.asm5.Opcodes;
@@ -34,12 +33,13 @@ import org.apache.xbean.asm5.tree.ClassNode;
 public class ClassNodeType extends ClassNode
 {
 
-  public ClassNodeType() {
+  public ClassNodeType()
+  {
     super(Opcodes.ASM5);
   }
 
   ClassSignatureVisitor csv = new ClassSignatureVisitor();
-  
+
   @SuppressWarnings("unchecked")
   @Override
   public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
@@ -49,17 +49,17 @@ public class ClassNodeType extends ClassNode
     methods.add(mn);
     return mn;
   }
-  
+
   @SuppressWarnings("unchecked")
   @Override
-  public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
+  public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
+  {
     FieldNode fn = new FieldNode(access, name, desc, signature, value);
     fn.typeVariableSignatureNode = csv;
     fields.add(fn);
     return fn;
   }
 
-  
   @Override
   public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
   {
@@ -71,8 +71,9 @@ public class ClassNodeType extends ClassNode
     super.visit(version, access, name, signature, superName, interfaces);
   }
 
-  public void setClassSignatureVisitor(ClassSignatureVisitor csv){    
-    this.csv = csv;    
+  public void setClassSignatureVisitor(ClassSignatureVisitor csv)
+  {
+    this.csv = csv;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassSignatureVisitor.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassSignatureVisitor.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassSignatureVisitor.java
index 9a65061..9343fcd 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassSignatureVisitor.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/ClassSignatureVisitor.java
@@ -27,26 +27,29 @@ import org.apache.xbean.asm5.signature.SignatureVisitor;
  * Follow the visiting path of ASM
  * to decompose method signature to data structure
  *
- * ClassSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitSuperClass visitInterface* )
- * MethodSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitParameterType* visitReturnType visitExceptionType* )
- * TypeSignature = visitBaseType | visitTypeVariable | visitArrayType | ( visitClassType visitTypeArgument* ( visitInnerClassType visitTypeArgument* )* visitEnd ) )
+ * ClassSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitSuperClass
+ * visitInterface* )
+ * MethodSignature = ( visitFormalTypeParameter visitClassBound? visitInterfaceBound* )* ( visitParameterType*
+ * visitReturnType visitExceptionType* )
+ * TypeSignature = visitBaseType | visitTypeVariable | visitArrayType | ( visitClassType visitTypeArgument* (
+ * visitInnerClassType visitTypeArgument* )* visitEnd ) )
  *
  * @since 2.1
  */
 public class ClassSignatureVisitor extends BaseSignatureVisitor
 {
-  
-  public enum END {
+
+  public enum END
+  {
     CLASSNAME, SUPERCLASS, INTERFACE
   }
-  
+
   private Type superClass;
-  
+
   private List<Type> interfaces;
-  
+
   private END end = END.CLASSNAME;
 
-  
   @Override
   public SignatureVisitor visitExceptionType()
   {
@@ -64,8 +67,7 @@ public class ClassSignatureVisitor extends BaseSignatureVisitor
   {
     throw new UnsupportedOperationException();
   }
-  
-  
+
   @Override
   public SignatureVisitor visitSuperclass()
   {
@@ -73,8 +75,7 @@ public class ClassSignatureVisitor extends BaseSignatureVisitor
     end = END.SUPERCLASS;
     return this;
   }
-  
-  
+
   @Override
   public void visitClassType(String classType)
   {
@@ -87,10 +88,10 @@ public class ClassSignatureVisitor extends BaseSignatureVisitor
     // could be superclass before this
     if (!visitingStack.isEmpty() && end == END.SUPERCLASS) {
       superClass = visitingStack.pop();
-    } 
+    }
     // could be another interface before this
     if (interfaces == null) {
-      interfaces = new LinkedList<Type>();
+      interfaces = new LinkedList<>();
     }
     if (end == END.INTERFACE) {
       interfaces.add(0, visitingStack.pop());
@@ -98,19 +99,18 @@ public class ClassSignatureVisitor extends BaseSignatureVisitor
     end = END.INTERFACE;
     return this;
   }
-  
+
   public List<Type> getInterfaces()
   {
-    if(interfaces == null){
-      interfaces = new LinkedList<Type>();
+    if (interfaces == null) {
+      interfaces = new LinkedList<>();
     }
-    if(interfaces!=null && end == END.INTERFACE && !visitingStack.isEmpty()){
+    if (interfaces != null && end == END.INTERFACE && !visitingStack.isEmpty()) {
       interfaces.add(0, visitingStack.pop());
     }
     return interfaces;
   }
-  
-  
+
   public Type getSuperClass()
   {
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactAnnotationNode.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactAnnotationNode.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactAnnotationNode.java
index 7860378..2094cca 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactAnnotationNode.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactAnnotationNode.java
@@ -19,30 +19,36 @@
 package com.datatorrent.stram.webapp.asm;
 
 import java.util.Map;
+
 /**
  * <p>CompactAnnotationNode class.</p>
  *
  * @since 3.2.0
  */
-public class CompactAnnotationNode {
+public class CompactAnnotationNode
+{
 
   private String desc;
-  
+
   private Map<String, Object> annotations;
-  
-  public String getDesc() {
+
+  public String getDesc()
+  {
     return desc;
   }
 
-  public void setDesc(String desc) {
+  public void setDesc(String desc)
+  {
     this.desc = desc;
   }
 
-  public Map<String, Object> getAnnotations() {
+  public Map<String, Object> getAnnotations()
+  {
     return annotations;
   }
 
-  public void setAnnotations(Map<String, Object> annotations) {
+  public void setAnnotations(Map<String, Object> annotations)
+  {
     this.annotations = annotations;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactClassNode.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactClassNode.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactClassNode.java
index 3382cee..551b20b 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactClassNode.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactClassNode.java
@@ -31,23 +31,23 @@ public class CompactClassNode
 {
   
   private int access;
-  
+
   private String name;
-  
+
   private List<CompactFieldNode> ports;
 
   private List<CompactMethodNode> getterMethods;
-  
+
   private List<CompactMethodNode> setterMethods;
-  
+
   private CompactMethodNode defaultConstructor;
-  
+
   private List<CompactClassNode> innerClasses;
-  
+
   private List<String> enumValues;
-  
+
   private ClassSignatureVisitor csv;
-  
+
   public int getAccess()
   {
     return access;
@@ -133,11 +133,13 @@ public class CompactClassNode
     this.csv = csv;
   }
 
-  public List<CompactFieldNode> getPorts() {
+  public List<CompactFieldNode> getPorts()
+  {
     return ports;
   }
 
-  public void setPorts(List<CompactFieldNode> ports) {
+  public void setPorts(List<CompactFieldNode> ports)
+  {
     this.ports = ports;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/85db448e/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactFieldNode.java
----------------------------------------------------------------------
diff --git a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactFieldNode.java b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactFieldNode.java
index 778fc41..f5a247f 100644
--- a/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactFieldNode.java
+++ b/engine/src/main/java/com/datatorrent/stram/webapp/asm/CompactFieldNode.java
@@ -18,62 +18,70 @@
  */
 package com.datatorrent.stram.webapp.asm;
 
-import java.util.LinkedList;
 import java.util.List;
 
-import org.apache.xbean.asm5.tree.AnnotationNode;
-import org.apache.xbean.asm5.tree.FieldNode;
 /**
  * <p>CompactFieldNode class.</p>
  *
  * @since 3.2.0
  */
-public class CompactFieldNode {
+public class CompactFieldNode
+{
   private String name;
   private String desc;
   private String signature;
-  
+
   private List<CompactAnnotationNode> visibleAnnotations;
   private FieldSignatureVisitor fieldSignatureNode;
 
-  public String getName() {
+  public String getName()
+  {
     return name;
   }
 
-  public void setName(String name) {
+  public void setName(String name)
+  {
     this.name = name;
   }
 
-  public String getDescription() {
+  public String getDescription()
+  {
     return desc;
   }
 
-  public void setDescription(String desc) {
+  public void setDescription(String desc)
+  {
     this.desc = desc;
   }
 
-  public String getSignature() {
+  public String getSignature()
+  {
     return signature;
   }
 
-  public void setSignature(String signature) {
+  public void setSignature(String signature)
+  {
     this.signature = signature;
   }
 
-  public List<CompactAnnotationNode> getVisibleAnnotations() {
+  public List<CompactAnnotationNode> getVisibleAnnotations()
+  {
     return visibleAnnotations;
   }
 
-  public void setVisibleAnnotations(List<CompactAnnotationNode> visibleAnnotations) {
+  public void setVisibleAnnotations(List<CompactAnnotationNode> visibleAnnotations)
+  {
     this.visibleAnnotations = visibleAnnotations;
   }
 
-  public FieldSignatureVisitor getFieldSignatureNode() {
+  public FieldSignatureVisitor getFieldSignatureNode()
+  {
     return fieldSignatureNode;
   }
 
-  public void setFieldSignatureNode(FieldSignatureVisitor fieldSignatureNode) {
+  public void setFieldSignatureNode(FieldSignatureVisitor fieldSignatureNode)
+  {
     this.fieldSignatureNode = fieldSignatureNode;
   }
-  
+
 }



Mime
View raw message