bval-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject [03/50] bval git commit: ensure to test more precisely getter names
Date Tue, 16 Oct 2018 17:31:07 GMT
ensure to test more precisely getter names


Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/7eaa3359
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/7eaa3359
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/7eaa3359

Branch: refs/heads/bv2
Commit: 7eaa33590b869c74c9aeef0a6265b3efee41efa1
Parents: a9610dc
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Thu May 17 07:14:48 2018 +0200
Committer: Matt Benson <mbenson@apache.org>
Committed: Tue Oct 16 12:28:20 2018 -0500

----------------------------------------------------------------------
 bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/7eaa3359/bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java b/bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java
index d8f2875..2ac4418 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/util/Methods.java
@@ -33,10 +33,10 @@ public final class Methods {
             return false;
         }
         // TODO look for capital letter after verb?
-        if (Boolean.TYPE.equals(m.getReturnType()) && isGetter(m.getName())) {
+        if (Boolean.TYPE.equals(m.getReturnType()) && m.getName().length() > 2
&& m.getName().startsWith("is")) {
             return true;
         }
-        return !Void.TYPE.equals(m.getReturnType()) && isGetter(m.getName());
+        return !Void.TYPE.equals(m.getReturnType()) && m.getName().length() >
3 && m.getName().startsWith("get");
     }
 
     public static boolean isGetter(String methodName) {


Mime
View raw message