Skip to content

Commit

Permalink
refactor: minor change of function call with method
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Dec 23, 2024
1 parent 88038cf commit e5de4be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.orientechnologies.orient.core.command.OCommandContext;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.sql.executor.OResult;

/** @author Luigi Dell'Aquila (l.dellaquila-(at)-orientdb.com) */
public interface OSQLFunctionFiltered extends OSQLFunction {
Expand All @@ -30,7 +31,7 @@ public interface OSQLFunctionFiltered extends OSQLFunction {
* Process a record.
*
* @param iThis
* @param iCurrentRecord : current record
* @param current : current record
* @param iCurrentResult TODO
* @param iParams : function parameters, number is ensured to be within minParams and maxParams.
* @param iPossibleResults : a set of possible results (the function will return, as a result,
Expand All @@ -41,7 +42,7 @@ public interface OSQLFunctionFiltered extends OSQLFunction {
*/
public Object execute(
Object iThis,
OIdentifiable iCurrentRecord,
OResult current,
Object iCurrentResult,
Object[] iParams,
Iterable<OIdentifiable> iPossibleResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.orientechnologies.orient.core.db.ODatabaseSession;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.sql.OSQLEngine;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.functions.OSQLFunctionFiltered;

/** Created by luigidellaquila on 03/01/17. */
Expand All @@ -26,7 +27,7 @@ public OSQLFunctionMoveFiltered(final String iName, final int iMin, final int iM
@Override
public Object execute(
final Object iThis,
final OIdentifiable iCurrentRecord,
final OResult current,
final Object iCurrentResult,
final Object[] iParameters,
final Iterable<OIdentifiable> iPossibleResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,8 @@ private static Object invokeGraphFunction(
List<Object> paramValues) {
if (graphFunction instanceof OSQLFunctionFiltered) {
OResult current = ctx.getCurrent();
OIdentifiable currentR = ((OResult) current).getElement().orElse(null);
return ((OSQLFunctionFiltered) graphFunction)
.execute(
targetObjects,
(OIdentifiable) currentR,
null,
paramValues.toArray(),
iPossibleResults,
ctx);
.execute(targetObjects, current, null, paramValues.toArray(), iPossibleResults, ctx);
} else {
OResult current = ctx.getCurrent();
if (current != null) {
Expand Down

0 comments on commit e5de4be

Please sign in to comment.