Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves handling VarArgs #126

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/ognl/ASTMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public ASTMethod(OgnlParser p, int id)
super(p, id);
}

/**
/**
* Called from parser action.
*
* @param methodName the method name.
Expand All @@ -74,7 +74,7 @@ public void setMethodName(String methodName)

/**
* Returns the method name that this node will call.
*
*
* @return the method name.
*/
public String getMethodName()
Expand Down Expand Up @@ -192,7 +192,7 @@ public String toGetSourceString(OgnlContext context, Object target)

// TODO: This is a hacky workaround until javassist supports varargs method invocations

boolean varArgs = OgnlRuntime.isJdk15() && m.isVarArgs();
boolean varArgs = m.isVarArgs();

if (varArgs)
{
Expand Down Expand Up @@ -353,7 +353,7 @@ public String toSetSourceString(OgnlContext context, Object target)
_getterClass = wrapper;
}

boolean varArgs = OgnlRuntime.isJdk15() && m.isVarArgs();
boolean varArgs = m.isVarArgs();

if (varArgs)
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ognl/ASTStaticField.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean isNodeConstant(OgnlContext context)
if (fieldName.equals("class"))
{
result = true;
} else if (OgnlRuntime.isJdk15() && c.isEnum())
} else if (c.isEnum())
{
result = true;
} else
Expand Down Expand Up @@ -129,7 +129,7 @@ Class getFieldClass(OgnlContext context)
if (fieldName.equals("class"))
{
return c;
} else if (OgnlRuntime.isJdk15() && c.isEnum())
} else if (c.isEnum())
{
return c;
} else
Expand Down
Loading