You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2020/06/11 07:25:48 UTC

[myfaces-tobago] branch master updated: lint

This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 263c9a4  lint
263c9a4 is described below

commit 263c9a421f324a913ed0c0d0d90b65e7e68656c2
Author: Udo Schnurpfeil <ud...@irian.eu>
AuthorDate: Thu Jun 11 09:25:31 2020 +0200

    lint
---
 .../org/apache/myfaces/tobago/example/demo/CantorInterval.java     | 6 +++---
 .../org/apache/myfaces/tobago/example/demo/EventController.java    | 7 ++++---
 .../org/apache/myfaces/tobago/example/demo/NavigationNode.java     | 5 ++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CantorInterval.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CantorInterval.java
index 49aeb6b..e9c8b26 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CantorInterval.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/CantorInterval.java
@@ -31,8 +31,8 @@ import java.util.Enumeration;
  */
 public class CantorInterval extends DefaultMutableTreeNode {
 
-  private Fraction begin;
-  private Fraction end;
+  private final Fraction begin;
+  private final Fraction end;
   private boolean initialized;
 
   public CantorInterval() {
@@ -72,7 +72,7 @@ public class CantorInterval extends DefaultMutableTreeNode {
   }
 
   @Override
-  public Enumeration children() {
+  public Enumeration<TreeNode> children() {
     init();
     return super.children();
   }
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
index 74d083e..1dd52de 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/EventController.java
@@ -93,14 +93,14 @@ import java.util.TreeSet;
 @Named
 public class EventController implements Serializable {
 
-  private List<EventsOnComponent> eventsOnComponents = new ArrayList<>();
+  private final List<EventsOnComponent> eventsOnComponents = new ArrayList<>();
   private EventsOnComponent selectedComponent;
   private String eventName;
   private int action = 0;
   private int actionListener = 0;
   private int ajaxListener = 0;
   private int valueChangeListener = 0;
-  private List<SolarObject> planets = new ArrayList<>();
+  private final List<SolarObject> planets = new ArrayList<>();
 
   public EventController() {
     eventsOnComponents.add(new EventsOnComponent(new UIBar()));
@@ -233,7 +233,7 @@ public class EventController implements Serializable {
     return planets;
   }
 
-  public class EventsOnComponent implements Serializable {
+  public static class EventsOnComponent implements Serializable {
     private final String tagName;
     private final Collection<String> eventNames = new TreeSet<>();
 
@@ -313,6 +313,7 @@ public class EventController implements Serializable {
         for (final CommonEvent commonEvent : CommonEvent.values()) {
           if (name.equals(commonEvent.name())) {
             isSpecialEvent = false;
+            break;
           }
         }
 
diff --git a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java
index d79dd99..329f0ac 100644
--- a/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java
+++ b/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationNode.java
@@ -26,7 +26,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-public class NavigationNode extends DefaultMutableTreeNode implements Comparable {
+public class NavigationNode extends DefaultMutableTreeNode implements Comparable<NavigationNode> {
 
   private final String name;
   private final String label;
@@ -53,8 +53,7 @@ public class NavigationNode extends DefaultMutableTreeNode implements Comparable
   }
 
   @Override
-  public int compareTo(final Object o) {
-    final NavigationNode other = (NavigationNode) o;
+  public int compareTo(final NavigationNode other) {
     return branch.compareTo(other.getBranch());
   }