myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1797117 - /myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
Date Wed, 31 May 2017 21:40:39 GMT
Author: lofwyr
Date: Wed May 31 21:40:39 2017
New Revision: 1797117

URL: http://svn.apache.org/viewvc?rev=1797117&view=rev
Log:
codestyle: SonarQube

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java?rev=1797117&r1=1797116&r2=1797117&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/FacesConfigGenerator.java
Wed May 31 21:40:39 2017
@@ -301,10 +301,10 @@ public class FacesConfigGenerator extend
 
   private org.jdom2.Element getFirstElementByName(final org.jdom2.Element rootElement, final
String tagName) {
     final List<org.jdom2.Element> elements = rootElement.getChildren(tagName, rootElement.getNamespace());
-    if (elements.size() > 0) {
-      return elements.get(0);
-    } else {
+    if (elements.isEmpty()) {
       return null;
+    } else {
+      return elements.get(0);
     }
   }
 
@@ -320,10 +320,11 @@ public class FacesConfigGenerator extend
 
   private int getIndexAfter(final org.jdom2.Element rootElement, final String tagName) {
     final List<org.jdom2.Element> components = rootElement.getChildren(tagName, rootElement.getNamespace());
-    if (!components.isEmpty()) {
+    if (components.isEmpty()) {
+      return 0;
+    } else {
       return rootElement.indexOf(components.get(components.size() - 1)) + 1;
     }
-    return 0;
   }
 
   public boolean equals(final org.jdom2.Element element1, final org.jdom2.Element element2)
{



Mime
View raw message