Skip to content

Commit

Permalink
refactor: removed additional legacy implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Dec 23, 2024
1 parent f974824 commit 2f78c09
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 915 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer;
import com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37Client;
import com.orientechnologies.orient.core.serialization.serializer.record.string.ORecordSerializerStringAbstract;
import com.orientechnologies.orient.core.sql.query.OBasicLegacyResultSet;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataInput;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataOutput;
Expand Down Expand Up @@ -210,10 +209,7 @@ protected Object readSynchResult(
final int tot = network.readInt();
final Collection<OIdentifiable> coll;

coll =
type == 's'
? new HashSet<OIdentifiable>(tot)
: new OBasicLegacyResultSet<OIdentifiable>(tot);
coll = new HashSet<OIdentifiable>(tot);
for (int i = 0; i < tot; ++i) {
final OIdentifiable resultItem = OMessageHelper.readIdentifiable(network, serializer);
if (resultItem instanceof ORecord)
Expand All @@ -224,7 +220,7 @@ protected Object readSynchResult(
result = coll;
break;
case 'i':
coll = new OBasicLegacyResultSet<OIdentifiable>();
coll = new HashSet<OIdentifiable>();
byte status;
while ((status = network.readByte()) > 0) {
final OIdentifiable record = OMessageHelper.readIdentifiable(network, serializer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,21 +734,6 @@ else if (iObject.getClass().isArray()) {
return false;
}

public static int indexOf(final Object iObject, final Object iItem) {
if (iObject == null) return -1;

if (iObject instanceof List) return ((List) iObject).indexOf(iItem);
else if (iObject.getClass().isArray()) {
final int size = Array.getLength(iObject);
for (int i = 0; i < size; ++i) {
final Object item = Array.get(iObject, i);
if (item != null && item.equals(iItem)) return i;
}
}

return -1;
}

public static Object toSet(final Object o) {
if (o instanceof Set<?>) return o;
else if (o instanceof Collection<?>) return new HashSet<Object>((Collection<?>) o);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import com.orientechnologies.orient.core.sql.OCommandSQLParsingException;
import com.orientechnologies.orient.core.sql.executor.OResult;
import com.orientechnologies.orient.core.sql.executor.OResultInternal;
import com.orientechnologies.orient.core.sql.query.OLegacyResultSet;
import java.util.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

public class OProjection extends SimpleNode {
Expand Down Expand Up @@ -188,13 +192,6 @@ private void initExcludes(OCommandContext iContext) {
}
}

public OLegacyResultSet calculateExpand(OCommandContext iContext, OResult iRecord) {
if (!isExpand()) {
throw new IllegalStateException("This is not an expand projection:" + toString());
}
throw new UnsupportedOperationException("Implement expand in projection");
}

public boolean isExpand() {
return items != null && items.size() == 1 && items.get(0).isExpand();
}
Expand Down
Loading

0 comments on commit 2f78c09

Please sign in to comment.