Skip to content

Commit

Permalink
Ports IllegalArgumentException : Can't decide wich method to use fix
Browse files Browse the repository at this point in the history
This refers to #159
  • Loading branch information
lukaszlenart committed Sep 1, 2022
1 parent 2f8c786 commit 32dd054
Show file tree
Hide file tree
Showing 295 changed files with 881 additions and 781 deletions.
4 changes: 2 additions & 2 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ efficient. The class then takes an `OgnlContext` and a root object to
evaluate against.

```java
import org.ognl.Ognl;
import org.ognl.OgnlContext;
import ognl.Ognl;
import ognl.OgnlContext;

public class OgnlExpression {

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>9</version>
</parent>

<groupId>org.ognl</groupId>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<packaging>jar</packaging>
<version>3.4.0-SNAPSHOT</version>
Expand Down Expand Up @@ -177,7 +177,7 @@
<phase>generate-sources</phase>
<configuration>
<outputDirectory>${project.build.directory}/generated-sources/java</outputDirectory>
<packageName>org.ognl</packageName>
<packageName>ognl</packageName>
<!-- Uncomment if AST files needs to be generated
<nodePackage>*.jtree</nodePackage>
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.ExpressionCompiler;
import ognl.OgnlParser;
import ognl.enhance.ExpressionCompiler;

import java.math.BigDecimal;
import java.math.BigInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.ExpressionCompiler;
import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.ExpressionCompiler;
import ognl.enhance.UnsupportedCompilationException;

public class ASTAnd extends BooleanExpression {

Expand Down Expand Up @@ -93,7 +94,7 @@ public String toGetSourceString(OgnlContext context, Object target) {
if (!OgnlRuntime.isBoolean(second) && !context.getCurrentType().isPrimitive())
second = OgnlRuntime.getCompiler().createLocalReference(context, second, context.getCurrentType());

result += "(org.ognl.OgnlOps.booleanValue(" + first + ")";
result += "(ognl.OgnlOps.booleanValue(" + first + ")";

result += " ? ";

Expand Down Expand Up @@ -141,7 +142,7 @@ public String toSetSourceString(OgnlContext context, Object target) {
+ pre + children[1].toSetSourceString(context, target);

if (!OgnlRuntime.isBoolean(first))
result += "if(org.ognl.OgnlOps.booleanValue(" + first + ")){";
result += "if(ognl.OgnlOps.booleanValue(" + first + ")){";
else
result += "if(" + first + "){";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.OrderedReturn;
import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.OrderedReturn;
import ognl.enhance.UnsupportedCompilationException;

public class ASTAssign extends SimpleNode {

Expand Down Expand Up @@ -65,7 +66,7 @@ public String toGetSourceString(OgnlContext context, Object target) {
core = core.substring(0, core.lastIndexOf(";"));

second = OgnlRuntime.getCompiler().createLocalReference(context,
"org.ognl.OgnlOps.returnValue(($w)" + core + ", ($w) " + seq.getLastExpression() + ")",
"ognl.OgnlOps.returnValue(($w)" + core + ", ($w) " + seq.getLastExpression() + ")",
Object.class);
}

Expand All @@ -85,7 +86,7 @@ public String toGetSourceString(OgnlContext context, Object target) {
// System.out.println("building ordered ret from child[0] with result of:" + result);

result = OgnlRuntime.getCompiler().createLocalReference(context,
"org.ognl.OgnlOps.returnValue(($w)" + result + ", ($w)" + ((OrderedReturn) children[0]).getLastExpression() + ")",
"ognl.OgnlOps.returnValue(($w)" + result + ", ($w)" + ((OrderedReturn) children[0]).getLastExpression() + ")",
Object.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTBitAnd extends NumericExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTBitNegate extends NumericExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTBitOr extends NumericExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.ExpressionCompiler;
import org.ognl.enhance.OrderedReturn;
import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.ExpressionCompiler;
import ognl.enhance.OrderedReturn;
import ognl.enhance.UnsupportedCompilationException;

import java.lang.reflect.Array;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.UnsupportedCompilationException;

import java.math.BigDecimal;
import java.math.BigInteger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.ExpressionCompiler;
import ognl.OgnlParser;
import ognl.enhance.ExpressionCompiler;

import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTDivide extends NumericExpression {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTEq extends ComparisonExpression {

Expand All @@ -41,6 +43,6 @@ public String getExpressionOperator(int index) {
}

public String getComparisonFunction() {
return "org.ognl.OgnlOps.equal";
return "ognl.OgnlOps.equal";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.UnsupportedCompilationException;

public class ASTEval extends SimpleNode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTGreater extends ComparisonExpression {

Expand All @@ -42,6 +44,6 @@ public String getExpressionOperator(int index) {
}

public String getComparisonFunction() {
return "org.ognl.OgnlOps.greater";
return "ognl.OgnlOps.greater";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTGreaterEq extends ComparisonExpression {

Expand All @@ -41,6 +43,6 @@ public String getExpressionOperator(int index) {
}

public String getComparisonFunction() {
return "!org.ognl.OgnlOps.less";
return "!ognl.OgnlOps.less";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.UnsupportedCompilationException;

public class ASTIn extends SimpleNode implements NodeType {

Expand Down Expand Up @@ -54,7 +55,7 @@ public Class<?> getSetterClass() {

public String toGetSourceString(OgnlContext context, Object target) {
try {
String result = "org.ognl.OgnlOps.in( ($w) ";
String result = "ognl.OgnlOps.in( ($w) ";

result += OgnlRuntime.getChildSource(context, target, children[0]) + ", ($w) " + OgnlRuntime.getChildSource(context, target, children[1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTInstanceof extends SimpleNode implements NodeType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTKeyValue extends SimpleNode {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

class ASTLess extends ComparisonExpression {

Expand All @@ -42,6 +44,6 @@ public String getExpressionOperator(int index) {
}

public String getComparisonFunction() {
return "org.ognl.OgnlOps.less";
return "ognl.OgnlOps.less";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import ognl.OgnlParser;

public class ASTLessEq extends ComparisonExpression {

Expand All @@ -41,7 +43,7 @@ public String getExpressionOperator(int index) {
}

public String getComparisonFunction() {
return "!org.ognl.OgnlOps.greater";
return "!ognl.OgnlOps.greater";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.ExpressionCompiler;
import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.ExpressionCompiler;
import ognl.enhance.UnsupportedCompilationException;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -124,14 +125,14 @@ public String toGetSourceString(OgnlContext context, Object target) {

value = OgnlRuntime.getCompiler().createLocalReference(context,
"(" + ExpressionCompiler.getCastString(ctorClass)
+ ")org.ognl.OgnlOps.toArray(" + value + ", " + ctorClass.getComponentType().getName()
+ ")ognl.OgnlOps.toArray(" + value + ", " + ctorClass.getComponentType().getName()
+ ".class, true)",
ctorClass
);

} else if (ctorClass != Object.class) {
value = OgnlRuntime.getCompiler().createLocalReference(context,
"(" + ctorClass.getName() + ")org.ognl.OgnlOps.convertValue(" + value + "," + ctorClass.getName() + ".class)",
"(" + ctorClass.getName() + ")ognl.OgnlOps.convertValue(" + value + "," + ctorClass.getName() + ".class)",
ctorClass
);
} else if ((children[i] instanceof NodeType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.ognl;
package ognl;

import org.ognl.enhance.UnsupportedCompilationException;
import ognl.OgnlParser;
import ognl.enhance.UnsupportedCompilationException;

import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Loading

0 comments on commit 32dd054

Please sign in to comment.