This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
The following commit(s) were added to refs/heads/master by this push:
new 5b033438 Camel-case parameter names
5b033438 is described below
commit 5b033438995e4ef0f023582aeb2ff694769576d0
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Oct 19 10:21:44 2023 -0400
Camel-case parameter names
Javadoc
---
.../org/apache/commons/jexl3/internal/Engine.java | 6 ++--
.../commons/jexl3/internal/InterpreterBase.java | 32 +++++++++++-----------
.../jexl3/internal/introspection/ClassMap.java | 6 ++--
.../jexl3/internal/introspection/IndexedType.java | 8 +++---
.../jexl3/internal/introspection/Introspector.java | 12 ++++----
.../jexl3/internal/introspection/MethodKey.java | 4 +--
.../introspection/PropertySetExecutor.java | 6 ++--
.../commons/jexl3/introspection/JexlSandbox.java | 24 ++++++++--------
8 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/src/main/java/org/apache/commons/jexl3/internal/Engine.java
b/src/main/java/org/apache/commons/jexl3/internal/Engine.java
index 54e5e9a2..82cbcc9d 100644
--- a/src/main/java/org/apache/commons/jexl3/internal/Engine.java
+++ b/src/main/java/org/apache/commons/jexl3/internal/Engine.java
@@ -502,14 +502,14 @@ public class Engine extends JexlEngine {
private void processPragmaNamespace(final Map<String, Object> ns, final
String key, final Object value) {
if (value instanceof String) {
// jexl.namespace.***
- final String nsname = key.substring(PRAGMA_JEXLNS.length());
- if (!nsname.isEmpty()) {
+ final String namespaceName = key.substring(PRAGMA_JEXLNS.length());
+ if (!namespaceName.isEmpty()) {
final String nsclass = value.toString();
final Class<?> clazz = uberspect.getClassByName(nsclass);
if (clazz == null) {
logger.warn(key + ": unable to find class " + nsclass);
} else {
- ns.put(nsname, clazz);
+ ns.put(namespaceName, clazz);
}
}
} else {
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java
b/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java
index 8b68e5c1..5152effb 100644
--- a/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java
+++ b/src/main/java/org/apache/commons/jexl3/internal/InterpreterBase.java
@@ -858,13 +858,13 @@ public abstract class InterpreterBase extends
ParserVisitor {
* Whether the method is a target method.
*
* @param ntarget the target instance
- * @param mname the method name
+ * @param methodName the method name
* @param arguments the method arguments
* @return true if arithmetic, false otherwise
*/
- protected boolean isTargetMethod(final Object ntarget, final String
mname, final Object[] arguments) {
+ protected boolean isTargetMethod(final Object ntarget, final String
methodName, final Object[] arguments) {
// try a method
- vm = uberspect.getMethod(ntarget, mname, arguments);
+ vm = uberspect.getMethod(ntarget, methodName, arguments);
if (vm != null) {
argv = arguments;
target = ntarget;
@@ -879,12 +879,12 @@ public abstract class InterpreterBase extends
ParserVisitor {
/**
* Whether the method is a context method.
*
- * @param mname the method name
+ * @param methodName the method name
* @param arguments the method arguments
* @return true if arithmetic, false otherwise
*/
- protected boolean isContextMethod(final String mname, final Object[]
arguments) {
- vm = uberspect.getMethod(context, mname, arguments);
+ protected boolean isContextMethod(final String methodName, final
Object[] arguments) {
+ vm = uberspect.getMethod(context, methodName, arguments);
if (vm != null) {
argv = arguments;
target = context;
@@ -899,12 +899,12 @@ public abstract class InterpreterBase extends
ParserVisitor {
/**
* Whether the method is an arithmetic method.
*
- * @param mname the method name
+ * @param methodName the method name
* @param arguments the method arguments
* @return true if arithmetic, false otherwise
*/
- protected boolean isArithmeticMethod(final String mname, final
Object[] arguments) {
- vm = uberspect.getMethod(arithmetic, mname, arguments);
+ protected boolean isArithmeticMethod(final String methodName, final
Object[] arguments) {
+ vm = uberspect.getMethod(arithmetic, methodName, arguments);
if (vm != null) {
argv = arguments;
target = arithmetic;
@@ -921,18 +921,18 @@ public abstract class InterpreterBase extends
ParserVisitor {
* it was cacheable).
*
* @param ntarget the target instance
- * @param mname the method name
+ * @param methodName the method name
* @param arguments the method arguments
* @return TRY_FAILED if invocation was not possible or failed, the
* result otherwise
*/
- protected Object tryEval(final Object ntarget, final String mname,
final Object[] arguments) {
+ protected Object tryEval(final Object ntarget, final String
methodName, final Object[] arguments) {
// do we have a method/function name ?
// attempt to reuse last funcall cached in volatile JexlNode.value
(if it was not a variable)
- if (mname != null && cacheable && ntarget != null) {
+ if (methodName != null && cacheable && ntarget != null) {
final Object cached = node.jjtGetValue();
if (cached instanceof Funcall) {
- return ((Funcall) cached).tryInvoke(InterpreterBase.this,
mname, ntarget, arguments);
+ return ((Funcall) cached).tryInvoke(InterpreterBase.this,
methodName, ntarget, arguments);
}
}
return JexlEngine.TRY_FAILED;
@@ -941,11 +941,11 @@ public abstract class InterpreterBase extends
ParserVisitor {
/**
* Evaluates the method previously dispatched.
*
- * @param mname the method name
+ * @param methodName the method name
* @return the method invocation result
* @throws Exception when invocation fails
*/
- protected Object eval(final String mname) throws Exception {
+ protected Object eval(final String methodName) throws Exception {
// we have either evaluated and returned or might have found a
method
if (vm != null) {
// vm cannot be null if xjexl is null
@@ -956,7 +956,7 @@ public abstract class InterpreterBase extends ParserVisitor
{
}
return eval;
}
- return unsolvableMethod(node, mname, argv);
+ return unsolvableMethod(node, methodName, argv);
}
}
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
index 1a6829b4..fac798e5 100644
---
a/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
+++
b/src/main/java/org/apache/commons/jexl3/internal/introspection/ClassMap.java
@@ -151,11 +151,11 @@ final class ClassMap {
/**
* Find a Field using its name.
*
- * @param fname the field name
+ * @param fieldName the field name
* @return A Field object representing the field to invoke or null.
*/
- Field getField(final String fname) {
- return fieldCache.get(fname);
+ Field getField(final String fieldName) {
+ return fieldCache.get(fieldName);
}
/**
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java
b/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java
index 40e412ab..4363f05b 100644
---
a/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java
+++
b/src/main/java/org/apache/commons/jexl3/internal/introspection/IndexedType.java
@@ -187,8 +187,8 @@ public final class IndexedType implements JexlPropertyGet {
}
}
final Object[] args = {key};
- final String mname = getters[0].getName();
- final MethodKey km = new MethodKey(mname, args);
+ final String methodName = getters[0].getName();
+ final MethodKey km = new MethodKey(methodName, args);
jm = km.getMostSpecificMethod(getters);
if (jm != null) {
final Object invoked = jm.invoke(object, args);
@@ -222,8 +222,8 @@ public final class IndexedType implements JexlPropertyGet {
}
}
final Object[] args = {key, value};
- final String mname = setters[0].getName();
- final MethodKey km = new MethodKey(mname, args);
+ final String methodName = setters[0].getName();
+ final MethodKey km = new MethodKey(methodName, args);
jm = km.getMostSpecificMethod(setters);
if (jm != null) {
final Object invoked = jm.invoke(object, args);
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java
b/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java
index 465fd278..c8d3b90a 100644
---
a/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java
+++
b/src/main/java/org/apache/commons/jexl3/internal/introspection/Introspector.java
@@ -245,19 +245,19 @@ public final class Introspector {
// miss or not?
return CTOR_MISS.equals(ctor) ? null : ctor;
}
- final String cname = key.getMethod();
+ final String constructorName = key.getMethod();
// do we know about this class?
- Class<?> clazz = constructibleClasses.get(cname);
+ Class<?> clazz = constructibleClasses.get(constructorName);
try {
// do find the most specific ctor
if (clazz == null) {
if (c != null && c.getName().equals(key.getMethod())) {
clazz = c;
} else {
- clazz = loader.loadClass(cname);
+ clazz = loader.loadClass(constructorName);
}
// add it to list of known loaded classes
- constructibleClasses.put(cname, clazz);
+ constructibleClasses.put(constructorName, clazz);
}
final List<Constructor<?>> l = new ArrayList<>();
for (final Constructor<?> ictor : clazz.getConstructors()) {
@@ -275,13 +275,13 @@ public final class Introspector {
} catch (final ClassNotFoundException xnotfound) {
if (logger != null && logger.isDebugEnabled()) {
logger.debug("unable to find class: "
- + cname + "."
+ + constructorName + "."
+ key.debugString(), xnotfound);
}
} catch (final MethodKey.AmbiguousException xambiguous) {
if (logger != null && xambiguous.isSevere() &&
logger.isInfoEnabled()) {
logger.info("ambiguous constructor invocation: "
- + cname + "."
+ + constructorName + "."
+ key.debugString(), xambiguous);
}
ctor = null;
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java
b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java
index 8bce34ae..6345f31a 100644
---
a/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java
+++
b/src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java
@@ -194,12 +194,12 @@ public final class MethodKey {
if (ptypes.length == 0 || ptypes[ptypes.length - 1].getComponentType()
== null) {
return false;
}
- final String mname = method.getName();
+ final String methodName = method.getName();
// if this is an override, was it actually declared as varargs?
Class<?> clazz = method.getDeclaringClass();
do {
try {
- final Method m = clazz.getMethod(mname, ptypes);
+ final Method m = clazz.getMethod(methodName, ptypes);
if (m.isVarArgs()) {
return true;
}
diff --git
a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java
b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java
index aa9e76fd..dce63627 100644
---
a/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java
+++
b/src/main/java/org/apache/commons/jexl3/internal/introspection/PropertySetExecutor.java
@@ -168,12 +168,12 @@ public class PropertySetExecutor extends
AbstractExecutor.Set {
* <p>This checks only one method with that name accepts an array as sole
parameter.
* @param is the introspector
* @param clazz the class to find the get method from
- * @param mname the method name to find
+ * @param methodName the method name to find
* @return the sole method that accepts an array as parameter
*/
- private static java.lang.reflect.Method lookupSetEmptyArray(final
Introspector is, final Class<?> clazz, final String mname) {
+ private static java.lang.reflect.Method lookupSetEmptyArray(final
Introspector is, final Class<?> clazz, final String methodName) {
java.lang.reflect.Method candidate = null;
- final java.lang.reflect.Method[] methods = is.getMethods(clazz, mname);
+ final java.lang.reflect.Method[] methods = is.getMethods(clazz,
methodName);
if (methods != null) {
for (final java.lang.reflect.Method method : methods) {
final Class<?>[] paramTypes = method.getParameterTypes();
diff --git
a/src/main/java/org/apache/commons/jexl3/introspection/JexlSandbox.java
b/src/main/java/org/apache/commons/jexl3/introspection/JexlSandbox.java
index 11150b34..88b4f33b 100644
--- a/src/main/java/org/apache/commons/jexl3/introspection/JexlSandbox.java
+++ b/src/main/java/org/apache/commons/jexl3/introspection/JexlSandbox.java
@@ -466,12 +466,12 @@ public final class JexlSandbox {
/**
* Adds a list of readable property names to these permissions.
*
- * @param pnames the property names
+ * @param propertyNames the property names
* @return this instance of permissions
*/
- public Permissions read(final String... pnames) {
- for (final String pname : pnames) {
- read.add(pname);
+ public Permissions read(final String... propertyNames) {
+ for (final String propertyName : propertyNames) {
+ read.add(propertyName);
}
return this;
}
@@ -479,12 +479,12 @@ public final class JexlSandbox {
/**
* Adds a list of writable property names to these permissions.
*
- * @param pnames the property names
+ * @param propertyNames the property names
* @return this instance of permissions
*/
- public Permissions write(final String... pnames) {
- for (final String pname : pnames) {
- write.add(pname);
+ public Permissions write(final String... propertyNames) {
+ for (final String propertyName : propertyNames) {
+ write.add(propertyName);
}
return this;
}
@@ -493,12 +493,12 @@ public final class JexlSandbox {
* Adds a list of executable methods names to these permissions.
* <p>The constructor is denoted as the empty-string, all other
methods by their names.</p>
*
- * @param mnames the method names
+ * @param methodNames the method names
* @return this instance of permissions
*/
- public Permissions execute(final String... mnames) {
- for (final String mname : mnames) {
- execute.add(mname);
+ public Permissions execute(final String... methodNames) {
+ for (final String methodName : methodNames) {
+ execute.add(methodName);
}
return this;
}