diff artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java @ 8856:5e38e2924c07 3.2.x

Fix code style.
author Tom Gottfried <tom@intevation.de>
date Thu, 18 Jan 2018 20:12:01 +0100
parents af415396d9ca
children 951a4af24a09 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Jan 18 20:10:59 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Thu Jan 18 20:12:01 2018 +0100
@@ -79,7 +79,7 @@
 
     public static final String COMPUTING_CACHE = "computed.values";
 
-    /** The XPath that points to the input data elements of the FEED document. */
+    /** XPath that points to the input data elements of the FEED document. */
     public static final String XPATH_FEED_INPUT =
         "/art:action/art:data/art:input";
 
@@ -97,7 +97,8 @@
     public static final String XPATH_IDS = "/art:action/art:ids/@value";
 
     /** Path to 'target_out' (data) in doc that comes from datacage. */
-    public static final String XPATH_TARGET_OUT = "/art:action/art:target_out/@value";
+    public static final String XPATH_TARGET_OUT =
+        "/art:action/art:target_out/@value";
 
     /** The constant string that shows that an operation was successful. */
     public static final String OPERATION_SUCCESSFUL = "SUCCESS";
@@ -180,7 +181,8 @@
 
 
     /**
-     * Initialize the artifact and insert new data if <code>data</code> contains
+     * Initialize the artifact and insert new data
+     * if <code>data</code> contains
      * information necessary for this artifact.
      *
      * @param identifier The UUID.
@@ -249,7 +251,11 @@
         this.facets.put(currentState, staticFacets);
     }
 
-    protected void handleInitModel(Document data, Object context, CallMeta callMeta) {
+    protected void handleInitModel(
+        Document data,
+        Object context,
+        CallMeta callMeta
+    ) {
         RiverContext flysContext = RiverUtils.getFlysContext(context);
 
         String model = XMLUtils.xpathString(
@@ -357,7 +363,8 @@
 
     /**
      * (called from setup).
-     * @param artifact master-artifact (if any, otherwise initialize is not called).
+     * @param artifact master-artifact
+     *                 (if any, otherwise initialize is not called).
      */
     protected void initialize(
         Artifact artifact,
@@ -377,7 +384,7 @@
         facets           = flys.cloneFacets();
         // Do not clone filter facets!
 
-        ArrayList<String> stateIds     = (ArrayList<String>) getPreviousStateIds();
+        ArrayList<String> stateIds = (ArrayList<String>) getPreviousStateIds();
         ArrayList<String> toInitialize = (ArrayList<String>) stateIds.clone();
 
         toInitialize.add(getCurrentStateId());
@@ -433,15 +440,17 @@
 
                 int index;
                 try {
-                    index = Integer.parseInt(facetElement.getAttribute("index"));
+                    index = Integer.parseInt(
+                        facetElement.getAttribute("index"));
                 }
                 catch (NumberFormatException nfe) {
                     log.warn(nfe);
                     index = 0;
                 }
                 if (log.isDebugEnabled()) {
-                    log.debug("Creating filter facet " + fName + " with  index " + index +
-                            " for out " + oName);
+                    log.debug("Creating filter facet " + fName
+                        + " with  index " + index
+                        + " for out " + oName);
                 }
                 facets.add(new DefaultFacet(index, fName, ""));
             }
@@ -535,7 +544,8 @@
 
         State current = getCurrentState(context);
 
-        ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash());
+        ProtocolUtils.appendDescribeHeader(
+            creator, root, identifier(), hash());
         ProtocolUtils.appendState(creator, root, current);
         ProtocolUtils.appendReachableStates(creator, root, reachable);
 
@@ -940,8 +950,8 @@
      *
      * @param name The name of the StateData object.
      *
-     * @return a Boolean representing the value of the data object or null if no
-     * such object is existing.
+     * @return a Boolean representing the value of the data object or
+     * null if no such object is existing.
      */
     public Boolean getDataAsBoolean(String name) {
         String value = getDataAsString(name);
@@ -964,7 +974,7 @@
     }
 
     /**
-     * This method returns all stored StateData in this artifact as a Collection
+     * Returns all stored StateData in this artifact as a Collection
      * @return a Collection of all StateData objects in this artifact
      */
     public Collection<StateData> getAllData() {
@@ -1103,7 +1113,8 @@
     protected boolean isStateReachable(String stateId, Object context) {
 
         if (log.isDebugEnabled()) {
-            log.debug("Determine if the state '" + stateId + "' is reachable.");
+            log.debug("Determine if the state '"
+                + stateId + "' is reachable.");
         }
 
         RiverContext flysContext = RiverUtils.getFlysContext(context);
@@ -1190,7 +1201,8 @@
             List<Facet> fFacets = filterFacets.get(outName);
             if (fFacets != null) {
                 if (debug) {
-                    log.debug("" + fFacets.size() + " filters for: " + outName);
+                    log.debug("" + fFacets.size()
+                        + " filters for: " + outName);
                     for (Facet tmp: fFacets) {
                         log.debug("   filter = '" + tmp.getName() + "'");
                     }
@@ -1430,8 +1442,9 @@
 
 
     /**
-     * Dispatches the computation request to compute(CallContext context, String
-     * hash) with the current hash value of the artifact which is provided by
+     * Dispatches the computation request to
+     * compute(CallContext context, String hash)
+     * with the current hash value of the artifact which is provided by
      * hash().
      *
      * @param context The CallContext.
@@ -1517,7 +1530,8 @@
             if (cache != null) {
                 net.sf.ehcache.Element element = cache.get(key);
                 if (element != null) {
-                    log.debug("Got computation result from cache for key: " + key);
+                    log.debug(
+                        "Got computation result from cache for key: " + key);
                     old = element.getValue();
                 }
             }
@@ -1534,7 +1548,8 @@
                     res = state.computeAdvance(this, key, context, fs, old);
                     break;
                 case INIT:
-                    res = state.computeInit(this, key, context, context.getMeta(), fs);
+                    res = state.computeInit(
+                        this, key, context, context.getMeta(), fs);
                 default:
                     res = null;
             }
@@ -1679,7 +1694,7 @@
             log.debug("D4EArtifact.endOfLife: " + identifier());
         }
 
-        ArrayList<String> ids       = (ArrayList<String>) getPreviousStateIds();
+        ArrayList<String> ids = (ArrayList<String>) getPreviousStateIds();
         ArrayList<String> toDestroy = (ArrayList<String>) ids.clone();
 
         toDestroy.add(getCurrentStateId());

http://dive4elements.wald.intevation.org