svn commit: r1856207 - in /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator: configuration/ configuration/controller/ configuration/option/ configuration/outlet/ configuration/source/ control/ option/ outlet/ processor...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1856207 - in /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator: configuration/ configuration/controller/ configuration/option/ configuration/outlet/ configuration/source/ control/ option/ outlet/ processor...

painter
Author: painter
Date: Mon Mar 25 15:40:01 2019
New Revision: 1856207

URL: http://svn.apache.org/viewvc?rev=1856207&view=rev
Log:
FindBugs and PMD report cleanup

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/option/FileOptionsSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/ControllerState.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/TokenReplacer.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/option/Options.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/VelocityTemplateFilter.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/DirectoryConfigurationProvider.java Mon Mar 25 15:40:01 2019
@@ -27,9 +27,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 
-import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.torque.generator.configuration.paths.ProjectPaths;

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/controller/Output.java Mon Mar 25 15:40:01 2019
@@ -387,7 +387,7 @@ public class Output
                 contentString,
                 CARRIAGE_RETURN_LINE_FEED);
         // r and n are contained within rn
-        if ((rn >= r - rn) || (rn >= n - rn))
+        if (rn >= r - rn || rn >= n - rn)
         {
             if (rn > 0)
             {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/option/FileOptionsSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/option/FileOptionsSaxHandler.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/option/FileOptionsSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/option/FileOptionsSaxHandler.java Mon Mar 25 15:40:01 2019
@@ -36,12 +36,8 @@ public class FileOptionsSaxHandler exten
 
     public FileOptionsSaxHandler(FileOptionsConfiguration optionsConfiguration)
     {
+     // The super constructor performs the test for null
         super(optionsConfiguration);
-        if (optionsConfiguration == null)
-        {
-            throw new NullPointerException(
-                    "optionsConfiguration must not be null");
-        }
         this.optionsConfiguration = optionsConfiguration;
     }
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/JavaOutletSaxHandler.java Mon Mar 25 15:40:01 2019
@@ -261,7 +261,7 @@ class JavaOutletSaxHandler extends Outle
                     throws SAXException
     {
         level++;
-        if ((level == 2 && MERGEPOINT_TAG.equals(rawName))
+        if (level == 2 && MERGEPOINT_TAG.equals(rawName)
                 || super.isProcessingMergepointTag())
         {
             super.startElement(uri, localName, rawName, attributes);

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/outlet/OutletSaxHandler.java Mon Mar 25 15:40:01 2019
@@ -150,7 +150,7 @@ public abstract class OutletSaxHandler e
             String element = attributes.getValue(INPUT_ELEMENT_NAME_ATTRIBUTE);
             String className = attributes.getValue(INPUT_CLASS_ATTRIBUTE);
             if (element == null && className == null
-                    || (element != null && className != null))
+                    || element != null && className != null)
             {
                 throw new SAXException("Either the attribute "
                         + INPUT_ELEMENT_NAME_ATTRIBUTE
@@ -259,7 +259,7 @@ public abstract class OutletSaxHandler e
      */
     protected boolean isProcessingMergepointTag()
     {
-        return (mergepointSaxHandler != null);
+        return mergepointSaxHandler != null;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/ConfigurableClassSaxHandler.java Mon Mar 25 15:40:01 2019
@@ -288,7 +288,7 @@ public class ConfigurableClassSaxHandler
      */
     public boolean isFinished()
     {
-        return (configuredClass != null && level == 0);
+        return configuredClass != null && level == 0;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/configuration/source/EntityReferenceSaxHandler.java Mon Mar 25 15:40:01 2019
@@ -130,7 +130,7 @@ public class EntityReferenceSaxHandler e
      */
     public boolean isFinished()
     {
-        return (systemId != null);
+        return systemId != null;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/Controller.java Mon Mar 25 15:40:01 2019
@@ -342,7 +342,7 @@ public class Controller
         Object modelRoot = source.getRootElement();
         controllerState.setSourceFile(source.getSourceFile());
         final SourceProcessConfiguration sourceProcessConfiguration
-        = output.getSourceProcessConfiguration();
+         = output.getSourceProcessConfiguration();
         modelRoot = transformSource(
                 modelRoot,
                 sourceProcessConfiguration.getTransformerDefinitions(),
@@ -350,7 +350,7 @@ public class Controller
         controllerState.setModelRoot(modelRoot);
 
         final String startElementsPath
-        = sourceProcessConfiguration.getStartElementsPath();
+         = sourceProcessConfiguration.getStartElementsPath();
 
         final Iterator<SourcePathPointer> iterator = SourcePath.iteratePointer(
                 null,
@@ -367,21 +367,19 @@ public class Controller
             final SourcePathPointer pointer = iterator.next();
             final Object model = pointer.getValue();
             String path = pointer.getPath();
-            if (model instanceof SourceElement)
+
+            // remove root node from path because the root node
+            // is no part of the xpath for sourceElements
+            if (model instanceof SourceElement && path.startsWith("/"))
             {
-                // remove root node from path because the root node
-                // is no part of the xpath for sourceElements
-                if (path.startsWith("/"))
+                int slashIndex = path.indexOf('/', 1);
+                if (slashIndex != -1)
+                {
+                    path = path.substring(slashIndex + 1);
+                }
+                else
                 {
-                    int slashIndex = path.indexOf('/', 1);
-                    if (slashIndex != -1)
-                    {
-                        path = path.substring(slashIndex + 1);
-                    }
-                    else
-                    {
-                        path = "/";
-                    }
+                    path = "/";
                 }
             }
             controllerState.setModel(model, path);

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/ControllerState.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/ControllerState.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/ControllerState.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/ControllerState.java Mon Mar 25 15:40:01 2019
@@ -229,22 +229,19 @@ public class ControllerState
         this.model = model;
         if (newPathToModel != null)
         {
-            if (model instanceof SourceElement)
+            // In source element, the root node precedes the path.
+            // For a correct relative path, the root node
+            // of the relative path must be removed.
+            if (model instanceof SourceElement && newPathToModel.startsWith("/"))
             {
-                // In source element, the root node precedes the path.
-                // For a correct relative path, the root node
-                // of the relative path must be removed.
-                if (newPathToModel.startsWith("/"))
+                int slashIndex = newPathToModel.indexOf('/', 1);
+                if (slashIndex != -1)
                 {
-                    int slashIndex = newPathToModel.indexOf('/', 1);
-                    if (slashIndex != -1)
-                    {
-                        newPathToModel = newPathToModel.substring(slashIndex + 1);
-                    }
-                    else
-                    {
-                        newPathToModel = "/";
-                    }
+                    newPathToModel = newPathToModel.substring(slashIndex + 1);
+                }
+                else
+                {
+                    newPathToModel = "/";
                 }
             }
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/TokenReplacer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/TokenReplacer.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/TokenReplacer.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/control/TokenReplacer.java Mon Mar 25 15:40:01 2019
@@ -52,6 +52,9 @@ public class TokenReplacer implements St
      */
     private ControllerState controllerState;
 
+    /**
+     * @param controllerState to init the token replacer
+     */
     public TokenReplacer(ControllerState controllerState)
     {
         if (controllerState == null)
@@ -163,15 +166,19 @@ public class TokenReplacer implements St
         return result.toString();
     }
 
+    
+    /**
+     * @param tokenName the token name to resolve
+     * @return resolved token
+     */
     private String resolveToken(String tokenName)
     {
-        if (!tokenName.startsWith(OPTION_PREFIX + PREFIX_SEPARATOR))
+     String optionPrefixWithSep = OPTION_PREFIX + PREFIX_SEPARATOR;
+        if (!tokenName.startsWith(optionPrefixWithSep))
         {
-            throw new IllegalArgumentException("Token name must start with"
-                    + OPTION_PREFIX + PREFIX_SEPARATOR);
+            throw new IllegalArgumentException("Token name must start with" + optionPrefixWithSep );
         }
-        String optionName = tokenName.substring(
-                (OPTION_PREFIX + PREFIX_SEPARATOR).length());
+        String optionName = tokenName.substring( optionPrefixWithSep.length() );
         Object optionValue = controllerState.getOption(optionName);
         if (optionValue == null)
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/option/Options.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/option/Options.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/option/Options.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/option/Options.java Mon Mar 25 15:40:01 2019
@@ -176,7 +176,7 @@ public class Options
      */
     public boolean containsKey(QualifiedName key)
     {
-        return (globalScope.containsKey(key));
+        return globalScope.containsKey(key);
     }
 
     @Override

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/outlet/OutletResult.java Mon Mar 25 15:40:01 2019
@@ -87,7 +87,7 @@ public class OutletResult
      */
     public boolean isStringResult()
     {
-        return (byteArrayResult == null);
+        return byteArrayResult == null;
     }
 
     /**
@@ -99,7 +99,7 @@ public class OutletResult
      */
     public boolean isByteArrayResult()
     {
-        return (stringResult == null);
+        return stringResult == null;
     }
 
     @Override

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/processor/string/ConstantNameCreator.java Mon Mar 25 15:40:01 2019
@@ -134,7 +134,7 @@ public class ConstantNameCreator extends
             }
             lastCharWasSpecial = specialChar;
         }
-        if (result.length() == 0 || (result.charAt(0) >= '0' && result.charAt(0) <= '9'))
+        if (result.length() == 0 || result.charAt(0) >= '0' && result.charAt(0) <= '9')
         {
             result.insert(0, toReplaceWith);
         }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElement.java Mon Mar 25 15:40:01 2019
@@ -593,8 +593,8 @@ public class SourceElement implements Se
             final SourceElement toCompare,
             final Set<SourceElement> compared)
     {
-        if ((reference == null && toCompare != null)
-                || (reference != null && toCompare == null))
+        if (reference == null && toCompare != null
+                || reference != null && toCompare == null)
         {
             return false;
         }

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourceElementAttributePointer.java Mon Mar 25 15:40:01 2019
@@ -121,8 +121,8 @@ public class SourceElementAttributePoint
     public boolean testNode(final NodeTest nodeTest)
     {
         return nodeTest == null
-                || ((nodeTest instanceof NodeTypeTest)
-                        && ((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE);
+                || nodeTest instanceof NodeTypeTest
+                        && ((NodeTypeTest) nodeTest).getNodeType() == Compiler.NODE_TYPE_NODE;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/SourcePath.java Mon Mar 25 15:40:01 2019
@@ -337,22 +337,19 @@ public final class SourcePath
         if (root != null)
         {
             final JXPathContext rootContext = JXPathContext.newContext(root);
-            if (root instanceof SourceElement)
+            // In source element, the root node precedes the path.
+            // For a correct relative path, the root node
+            // of the relative path must be removed.
+            if (root instanceof SourceElement && pathToBase.startsWith("/"))
             {
-                // In source element, the root node precedes the path.
-                // For a correct relative path, the root node
-                // of the relative path must be removed.
-                if (pathToBase.startsWith("/"))
+                int slashIndex = pathToBase.indexOf('/', 1);
+                if (slashIndex != -1)
                 {
-                    int slashIndex = pathToBase.indexOf('/', 1);
-                    if (slashIndex != -1)
-                    {
-                        pathToBase = pathToBase.substring(slashIndex + 1);
-                    }
-                    else
-                    {
-                        pathToBase = "/";
-                    }
+                    pathToBase = pathToBase.substring(slashIndex + 1);
+                }
+                else
+                {
+                    pathToBase = "/";
                 }
             }
 

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/PropertyAccess.java Mon Mar 25 15:40:01 2019
@@ -607,7 +607,7 @@ public class PropertyAccess
 
     public boolean isPropertyAccessible()
     {
-        return (field != null || readMethod != null || writeMethod != null);
+        return field != null || readMethod != null || writeMethod != null;
     }
 
     /**

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/transform/model/StringToBooleanConverter.java Mon Mar 25 15:40:01 2019
@@ -31,7 +31,7 @@ public class StringToBooleanConverter im
     @Override
     public boolean accept(final Object value, final Class<?> targetClass)
     {
-        return (value instanceof String && Boolean.class == targetClass);
+        return value instanceof String && Boolean.class == targetClass;
     }
 
     @Override

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/TemplateOutletImpl.java Mon Mar 25 15:40:01 2019
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -179,7 +180,8 @@ implements TemplateOutlet
         Reader reader;
         if (encoding == null)
         {
-            reader = new InputStreamReader(filteredStream);
+         // default to UTF 8 otherwise FindBugs complains of DM_DEFAULT_ENCODING
+         reader = new InputStreamReader(filteredStream, StandardCharsets.UTF_8);
         }
         else
         {

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/VelocityTemplateFilter.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/VelocityTemplateFilter.java?rev=1856207&r1=1856206&r2=1856207&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/VelocityTemplateFilter.java (original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/template/velocity/VelocityTemplateFilter.java Mon Mar 25 15:40:01 2019
@@ -27,6 +27,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
+import java.nio.charset.StandardCharsets;
 
 import org.apache.torque.generator.template.TemplateFilter;
 
@@ -62,7 +63,8 @@ public class VelocityTemplateFilter impl
         InputStreamReader streamReader;
         if (encoding == null)
         {
-            streamReader = new InputStreamReader(resource);
+         // default to UTF 8 otherwise FindBugs complains of DM_DEFAULT_ENCODING
+            streamReader = new InputStreamReader(resource, StandardCharsets.UTF_8);
         }
         else
         {
@@ -73,7 +75,8 @@ public class VelocityTemplateFilter impl
         Writer outputStreamWriter = null;
         if (encoding == null)
         {
-            outputStreamWriter = new OutputStreamWriter(outputStream);
+         // default to UTF 8 otherwise FindBugs complains of DM_DEFAULT_ENCODING
+            outputStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
         }
         else
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]