You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/01/22 21:44:42 UTC
[isis] branch ISIS-1846_internal_utils updated: ISIS-1846 another
occurrence of capitalize consolidated
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch ISIS-1846_internal_utils
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/ISIS-1846_internal_utils by this push:
new 996cf2980 ISIS-1846 another occurrence of capitalize consolidated
996cf2980 is described below
commit 996cf2980e54a08b28888bac23334954aee8c51f
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Jan 22 22:44:42 2018 +0100
ISIS-1846 another occurrence of capitalize consolidated
---
.../isis/core/specsupport/specs/CukeGlueAbstract.java | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/specs/CukeGlueAbstract.java b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/specs/CukeGlueAbstract.java
index 8a3b95b..1b6bc45 100644
--- a/core/specsupport/src/main/java/org/apache/isis/core/specsupport/specs/CukeGlueAbstract.java
+++ b/core/specsupport/src/main/java/org/apache/isis/core/specsupport/specs/CukeGlueAbstract.java
@@ -28,6 +28,7 @@ import org.jmock.States;
import org.jmock.internal.ExpectationBuilder;
import org.apache.isis.applib.DomainObjectContainer;
+import org.apache.isis.applib.internal.base._Strings;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionForUnit;
@@ -220,7 +221,7 @@ public abstract class CukeGlueAbstract {
}
final Class<? extends Object> cls = obj.getClass();
try {
- final String methodName = "get" + capitalize(propertyName);
+ final String methodName = "get" + _Strings.capitalize(propertyName);
final Method method = cls.getMethod(methodName, new Class[]{});
if(method != null) {
return method.invoke(obj);
@@ -230,7 +231,7 @@ public abstract class CukeGlueAbstract {
}
try {
- final String methodName = "is" + capitalize(propertyName);
+ final String methodName = "is" + _Strings.capitalize(propertyName);
final Method method = cls.getMethod(methodName, new Class[]{});
if(method != null) {
return method.invoke(obj);
@@ -254,17 +255,6 @@ public abstract class CukeGlueAbstract {
return null;
}
- private static String capitalize(final String str) {
- if (str == null || str.length() == 0) {
- return str;
- }
- if (str.length() == 1) {
- return str.toUpperCase();
- }
- return Character.toUpperCase(str.charAt(0)) + str.substring(1);
- }
-
-
// //////////////////////////////////////
/**
--
To stop receiving notification emails like this one, please contact
ahuber@apache.org.