Progressed on port from dotnet to java

This commit is contained in:
David Noble
2019-08-30 23:06:32 -07:00
parent 8c24a961e9
commit ab82943fe0
53 changed files with 764 additions and 868 deletions

View File

@@ -36,6 +36,7 @@ Licensed under the MIT License.
<site.url/> <site.url/>
<test.groups>unit</test.groups> <test.groups>unit</test.groups>
<javadoc.opts/> <javadoc.opts/>
<fastutil.version>8.3.0</fastutil.version>
<guava.version>28.0-jre</guava.version> <guava.version>28.0-jre</guava.version>
<jackson.version>2.9.9</jackson.version> <jackson.version>2.9.9</jackson.version>
<mockito.version>1.10.19</mockito.version> <mockito.version>1.10.19</mockito.version>
@@ -79,6 +80,12 @@ Licensed under the MIT License.
<version>${netty.version}</version> <version>${netty.version}</version>
</dependency> </dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
<version>${fastutil.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>

View File

@@ -1,36 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.data.cosmos.serialization.hybridrow;
public class DefaultSpanResizer<T> implements ISpanResizer<T> {
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes",
// Justification = "Type is immutable.")] public static readonly DefaultSpanResizer<T> Default = new
// DefaultSpanResizer<T>();
public static final DefaultSpanResizer<T> Default = new DefaultSpanResizer<T>();
private DefaultSpanResizer() {
}
/**
* <inheritdoc />
*/
public final Span<T> Resize(int minimumLength) {
return Resize(minimumLength, null);
}
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
//ORIGINAL LINE: public Span<T> Resize(int minimumLength, Span<T> buffer = default)
public final Span<T> Resize(int minimumLength, Span<T> buffer) {
//C# TO JAVA CONVERTER WARNING: Java does not allow direct instantiation of arrays of generic type parameters:
//ORIGINAL LINE: Span<T> next = new Memory<T>(new T[Math.Max(minimumLength, buffer.Length)]).Span;
Span<T> next = (new Memory<T>((T[])new Object[Math.max(minimumLength, buffer.Length)])).Span;
if (!buffer.IsEmpty && next.Slice(0, buffer.Length) != buffer) {
buffer.CopyTo(next);
}
return next;
}
}

View File

@@ -216,18 +216,18 @@ public final class RowBuffer {
* @param srcEdit The field to move into the set/map. * @param srcEdit The field to move into the set/map.
* @return The prepared edit context. * @return The prepared edit context.
*/ */
public RowCursor PrepareSparseMove(Reference<RowCursor> scope, Reference<RowCursor> srcEdit) { public RowCursor prepareSparseMove(RowCursor scope, RowCursor srcEdit) {
checkArgument(scope.get().scopeType().isUniqueScope()); checkArgument(scope.scopeType().isUniqueScope());
checkArgument(scope.get().index() == 0); checkArgument(scope.index() == 0);
RowCursor dstEdit; RowCursor dstEdit;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope.get().Clone(out dstEdit); scope.Clone(out dstEdit);
dstEdit.metaOffset(scope.get().valueOffset()); dstEdit.metaOffset(scope.valueOffset());
int srcSize = this.sparseComputeSize(srcEdit); int srcSize = this.sparseComputeSize(srcEdit);
int srcBytes = srcSize - (srcEdit.get().valueOffset() - srcEdit.get().metaOffset()); int srcBytes = srcSize - (srcEdit.valueOffset() - srcEdit.metaOffset());
while (dstEdit.index() < dstEdit.count()) { while (dstEdit.index() < dstEdit.count()) {
Reference<RowCursor> tempReference_dstEdit = Reference<RowCursor> tempReference_dstEdit =
new Reference<RowCursor>(dstEdit); new Reference<RowCursor>(dstEdit);
@@ -368,7 +368,7 @@ public final class RowBuffer {
return result; return result;
} }
public boolean ReadBit(int offset, LayoutBit bit) { public boolean readBit(int offset, LayoutBit bit) {
if (bit.getIsInvalid()) { if (bit.getIsInvalid()) {
return true; return true;
@@ -377,7 +377,7 @@ public final class RowBuffer {
// TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context: // TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context:
//ORIGINAL LINE: return (this.buffer[bit.GetOffset(offset)] & unchecked((byte)(1 << bit.GetBit()))) != 0; //ORIGINAL LINE: return (this.buffer[bit.GetOffset(offset)] & unchecked((byte)(1 << bit.GetBit()))) != 0;
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
return (this.buffer[bit.GetOffset(offset)] & (byte)(1 << bit.GetBit())) != 0; return (this.buffer[bit.offset(offset)] & (byte)(1 << bit.bit())) != 0;
} }
public LocalDateTime ReadDateTime(int offset) { public LocalDateTime ReadDateTime(int offset) {
@@ -557,7 +557,7 @@ public final class RowBuffer {
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal LayoutType ReadSparseTypeCode(int //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal LayoutType ReadSparseTypeCode(int
// offset) // offset)
public LayoutType ReadSparseTypeCode(int offset) { public LayoutType readSparseTypeCode(int offset) {
return LayoutType.FromCode(LayoutCode.forValue(this.ReadUInt8(offset))); return LayoutType.FromCode(LayoutCode.forValue(this.ReadUInt8(offset)));
} }
@@ -1002,7 +1002,7 @@ public final class RowBuffer {
spaceNeeded = tempOut_spaceNeeded.get(); spaceNeeded = tempOut_spaceNeeded.get();
metaBytes = tempOut_metaBytes.get(); metaBytes = tempOut_metaBytes.get();
this.WriteSparseMetadata(edit, scopeType, typeArgs.clone(), metaBytes); this.WriteSparseMetadata(edit, scopeType, typeArgs.clone(), metaBytes);
this.WriteSparseTypeCode(edit.get().valueOffset(), LayoutCode.END_SCOPE); this.writeSparseTypeCode(edit.get().valueOffset(), LayoutCode.END_SCOPE);
checkState(spaceNeeded == metaBytes + numBytes); checkState(spaceNeeded == metaBytes + numBytes);
newScope.setAndGet(new RowCursor()); newScope.setAndGet(new RowCursor());
newScope.get().scopeType(scopeType); newScope.get().scopeType(scopeType);
@@ -1023,7 +1023,7 @@ public final class RowBuffer {
// TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context: // TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context:
//ORIGINAL LINE: this.buffer[bit.GetOffset(offset)] |= unchecked((byte)(1 << bit.GetBit())); //ORIGINAL LINE: this.buffer[bit.GetOffset(offset)] |= unchecked((byte)(1 << bit.GetBit()));
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
this.buffer[bit.GetOffset(offset)] |= (byte)(1 << bit.GetBit()); this.buffer[bit.offset(offset)] |= (byte)(1 << bit.bit());
} }
public void WriteSparseString(Reference<RowCursor> edit, Utf8Span value, UpdateOptions options) { public void WriteSparseString(Reference<RowCursor> edit, Utf8Span value, UpdateOptions options) {
@@ -1123,11 +1123,11 @@ public final class RowBuffer {
} }
public void UnsetBit(int offset, LayoutBit bit) { public void UnsetBit(int offset, LayoutBit bit) {
checkState(LayoutBit.opNotEquals(bit.clone(), LayoutBit.Invalid)); checkState(LayoutBit.opNotEquals(bit.clone(), LayoutBit.INVALID));
// TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context: // TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'unchecked' in this context:
//ORIGINAL LINE: this.buffer[bit.GetOffset(offset)] &= unchecked((byte)~(1 << bit.GetBit())); //ORIGINAL LINE: this.buffer[bit.GetOffset(offset)] &= unchecked((byte)~(1 << bit.GetBit()));
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
this.buffer[bit.GetOffset(offset)] &= (byte)~(1 << bit.GetBit()); this.buffer[bit.offset(offset)] &= (byte)~(1 << bit.bit());
} }
public void WriteVariableInt(int offset, long value, boolean exists, Out<Integer> shift) { public void WriteVariableInt(int offset, long value, boolean exists, Out<Integer> shift) {
@@ -1567,7 +1567,7 @@ public final class RowBuffer {
spaceNeeded = tempOut_spaceNeeded.get(); spaceNeeded = tempOut_spaceNeeded.get();
metaBytes = tempOut_metaBytes.get(); metaBytes = tempOut_metaBytes.get();
this.WriteSparseMetadata(edit, scopeType, TypeArgumentList.EMPTY, metaBytes); this.WriteSparseMetadata(edit, scopeType, TypeArgumentList.EMPTY, metaBytes);
this.WriteSparseTypeCode(edit.get().valueOffset(), LayoutCode.END_SCOPE); this.writeSparseTypeCode(edit.get().valueOffset(), LayoutCode.END_SCOPE);
checkState(spaceNeeded == metaBytes + numBytes); checkState(spaceNeeded == metaBytes + numBytes);
newScope.setAndGet(new RowCursor()); newScope.setAndGet(new RowCursor());
newScope.get().scopeType(scopeType); newScope.get().scopeType(scopeType);
@@ -1601,11 +1601,11 @@ public final class RowBuffer {
this.WriteSparseMetadata(edit, scopeType, typeArgs.clone(), metaBytes); this.WriteSparseMetadata(edit, scopeType, typeArgs.clone(), metaBytes);
int valueOffset = edit.get().valueOffset(); int valueOffset = edit.get().valueOffset();
for (int i = 0; i < typeArgs.count(); i++) { for (int i = 0; i < typeArgs.count(); i++) {
this.WriteSparseTypeCode(valueOffset, LayoutCode.NULL); this.writeSparseTypeCode(valueOffset, LayoutCode.NULL);
valueOffset += (LayoutCode.SIZE / Byte.SIZE); valueOffset += (LayoutCode.SIZE / Byte.SIZE);
} }
this.WriteSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); this.writeSparseTypeCode(valueOffset, LayoutCode.END_SCOPE);
checkState(spaceNeeded == metaBytes + numBytes); checkState(spaceNeeded == metaBytes + numBytes);
newScope.setAndGet(new RowCursor()); newScope.setAndGet(new RowCursor());
newScope.get().scopeType(scopeType); newScope.get().scopeType(scopeType);
@@ -1641,7 +1641,7 @@ public final class RowBuffer {
// Write scope terminator. // Write scope terminator.
int valueOffset = edit.get().valueOffset() + udt.size(); int valueOffset = edit.get().valueOffset() + udt.size();
this.WriteSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); this.writeSparseTypeCode(valueOffset, LayoutCode.END_SCOPE);
checkState(spaceNeeded == metaBytes + numBytes); checkState(spaceNeeded == metaBytes + numBytes);
newScope.setAndGet(new RowCursor()); newScope.setAndGet(new RowCursor());
newScope.get().scopeType(scopeType); newScope.get().scopeType(scopeType);
@@ -1766,7 +1766,7 @@ public final class RowBuffer {
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void WriteSparseTypeCode(int offset, //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void WriteSparseTypeCode(int offset,
// LayoutCode code) // LayoutCode code)
public void WriteSparseTypeCode(int offset, LayoutCode code) { public void writeSparseTypeCode(int offset, LayoutCode code) {
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: this.WriteUInt8(offset, (byte)code); //ORIGINAL LINE: this.WriteUInt8(offset, (byte)code);
this.WriteUInt8(offset, (byte) code.value()); this.WriteUInt8(offset, (byte) code.value());
@@ -1955,9 +1955,9 @@ public final class RowBuffer {
* *
* @param edit The field to delete. * @param edit The field to delete.
*/ */
public void deleteSparse(Reference<RowCursor> edit) { public void deleteSparse(RowCursor edit) {
// If the field doesn't exist, then nothing to do. // If the field doesn't exist, then nothing to do.
if (!edit.get().exists()) { if (!edit.exists()) {
return; return;
} }
@@ -2010,14 +2010,14 @@ public final class RowBuffer {
int offset = scopeOffset + layout.size(); int offset = scopeOffset + layout.size();
for (int i = layout.numFixed(); i < index; i++) { for (int i = layout.numFixed(); i < index; i++) {
LayoutColumn col = columns[i]; LayoutColumn col = columns[i];
if (this.ReadBit(scopeOffset, col.getNullBit().clone())) { if (this.readBit(scopeOffset, col.getNullBit().clone())) {
int lengthSizeInBytes; int lengthSizeInBytes;
Out<Integer> tempOut_lengthSizeInBytes = new Out<Integer>(); Out<Integer> tempOut_lengthSizeInBytes = new Out<Integer>();
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ulong valueSizeInBytes = this.Read7BitEncodedUInt(offset, out int lengthSizeInBytes); //ORIGINAL LINE: ulong valueSizeInBytes = this.Read7BitEncodedUInt(offset, out int lengthSizeInBytes);
long valueSizeInBytes = this.read7BitEncodedUInt(offset, tempOut_lengthSizeInBytes); long valueSizeInBytes = this.read7BitEncodedUInt(offset, tempOut_lengthSizeInBytes);
lengthSizeInBytes = tempOut_lengthSizeInBytes.get(); lengthSizeInBytes = tempOut_lengthSizeInBytes.get();
if (col.getType().getIsVarint()) { if (col.type().getIsVarint()) {
offset += lengthSizeInBytes; offset += lengthSizeInBytes;
} else { } else {
offset += (int) valueSizeInBytes + lengthSizeInBytes; offset += (int) valueSizeInBytes + lengthSizeInBytes;
@@ -2510,14 +2510,14 @@ public final class RowBuffer {
//ORIGINAL LINE: case LayoutNull _: //ORIGINAL LINE: case LayoutNull _:
case LayoutNull case LayoutNull
_: _:
this.WriteSparseTypeCode(offset, code.LayoutCode); this.writeSparseTypeCode(offset, code.LayoutCode);
return 1; return 1;
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
//ORIGINAL LINE: case LayoutBoolean _: //ORIGINAL LINE: case LayoutBoolean _:
case LayoutBoolean case LayoutBoolean
_: _:
this.WriteSparseTypeCode(offset, LayoutCode.BOOLEAN_FALSE); this.writeSparseTypeCode(offset, LayoutCode.BOOLEAN_FALSE);
return 1; return 1;
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
@@ -2658,7 +2658,7 @@ public final class RowBuffer {
case LayoutArray _: case LayoutArray _:
// Variable length sparse collection scopes take 1 byte for the end-of-scope terminator. // Variable length sparse collection scopes take 1 byte for the end-of-scope terminator.
this.WriteSparseTypeCode(offset, LayoutCode.END_SCOPE); this.writeSparseTypeCode(offset, LayoutCode.END_SCOPE);
return (LayoutCode.SIZE / Byte.SIZE); return (LayoutCode.SIZE / Byte.SIZE);
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
@@ -2683,10 +2683,10 @@ public final class RowBuffer {
// Fixed arity sparse collections take 1 byte for end-of-scope plus a null for each element. // Fixed arity sparse collections take 1 byte for end-of-scope plus a null for each element.
for (int i = 0; i < typeArgs.count(); i++) { for (int i = 0; i < typeArgs.count(); i++) {
this.WriteSparseTypeCode(offset, LayoutCode.NULL); this.writeSparseTypeCode(offset, LayoutCode.NULL);
} }
this.WriteSparseTypeCode(offset, LayoutCode.END_SCOPE); this.writeSparseTypeCode(offset, LayoutCode.END_SCOPE);
return (LayoutCode.SIZE / Byte.SIZE) + ((LayoutCode.SIZE / Byte.SIZE) * typeArgs.count()); return (LayoutCode.SIZE / Byte.SIZE) + ((LayoutCode.SIZE / Byte.SIZE) * typeArgs.count());
// TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements:
@@ -2727,7 +2727,7 @@ public final class RowBuffer {
this.buffer.Slice(offset, udt.getSize()).Fill(0); this.buffer.Slice(offset, udt.getSize()).Fill(0);
// Write scope terminator. // Write scope terminator.
this.WriteSparseTypeCode(offset + udt.getSize(), LayoutCode.END_SCOPE); this.writeSparseTypeCode(offset + udt.getSize(), LayoutCode.END_SCOPE);
return udt.getSize() + (LayoutCode.SIZE / Byte.SIZE); return udt.getSize() + (LayoutCode.SIZE / Byte.SIZE);
default: default:
@@ -3117,7 +3117,7 @@ public final class RowBuffer {
edit.get().scopeType().SetImplicitTypeCode(edit); edit.get().scopeType().SetImplicitTypeCode(edit);
edit.get().valueOffset(edit.get().metaOffset()); edit.get().valueOffset(edit.get().metaOffset());
} else { } else {
edit.get().cellType = this.ReadSparseTypeCode(edit.get().metaOffset()); edit.get().cellType = this.readSparseTypeCode(edit.get().metaOffset());
edit.get().valueOffset(edit.get().metaOffset() + (LayoutCode.SIZE / Byte.SIZE)); edit.get().valueOffset(edit.get().metaOffset() + (LayoutCode.SIZE / Byte.SIZE));
edit.get().cellTypeArgs = TypeArgumentList.EMPTY; edit.get().cellTypeArgs = TypeArgumentList.EMPTY;
if (edit.get().cellType() instanceof LayoutEndScope) { if (edit.get().cellType() instanceof LayoutEndScope) {
@@ -3202,10 +3202,10 @@ public final class RowBuffer {
} }
} else { } else {
if (code == LayoutTypes.Boolean) { if (code == LayoutTypes.Boolean) {
code = this.ReadSparseTypeCode(edit.metaOffset()); code = this.readSparseTypeCode(edit.metaOffset());
checkState(code == LayoutTypes.Boolean || code == LayoutTypes.BooleanFalse); checkState(code == LayoutTypes.Boolean || code == LayoutTypes.BooleanFalse);
} else { } else {
checkState(this.ReadSparseTypeCode(edit.metaOffset()) == code); checkState(this.readSparseTypeCode(edit.metaOffset()) == code);
} }
} }

View File

@@ -13,6 +13,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import com.fasterxml.jackson.databind.exc.MismatchedInputException; import com.fasterxml.jackson.databind.exc.MismatchedInputException;
import com.fasterxml.jackson.databind.ser.std.StdSerializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import it.unimi.dsi.fastutil.ints.Int2ReferenceMap;
import it.unimi.dsi.fastutil.ints.Int2ReferenceOpenHashMap;
import java.io.IOException; import java.io.IOException;
@@ -26,13 +28,13 @@ import static com.google.common.base.Strings.lenientFormat;
@JsonSerialize(using = SchemaId.JsonSerializer.class) @JsonSerialize(using = SchemaId.JsonSerializer.class)
public final class SchemaId { public final class SchemaId {
// TODO: DANOBLE: Consider caching SchemaId instances to reduce memory footprint
public static final SchemaId INVALID = null; public static final SchemaId INVALID = null;
public static final SchemaId NONE = new SchemaId(-1); public static final SchemaId NONE = new SchemaId(-1);
public static final int SIZE = (Integer.SIZE / Byte.SIZE); public static final int SIZE = Integer.SIZE / Byte.SIZE;
private static final long MAX_VALUE = 0x00000000FFFFFFFFL;
private static final Int2ReferenceMap<SchemaId> cache = new Int2ReferenceOpenHashMap<>();
private static long MAX_VALUE = 0x00000000FFFFFFFFL;
private final int value; private final int value;
/** /**
@@ -62,11 +64,25 @@ public final class SchemaId {
return this.value() == other.value(); return this.value() == other.value();
} }
/**
* Returns a {@link SchemaId} from a specified underlying integer value
*
* @return The integer value of this {@link SchemaId}
*/
public static SchemaId from(int value) {
return cache.computeIfAbsent(value, SchemaId::new);
}
@Override @Override
public int hashCode() { public int hashCode() {
return Integer.valueOf(this.value()).hashCode(); return Integer.valueOf(this.value()).hashCode();
} }
@Override
public String toString() {
return String.valueOf(this.value());
}
/** /**
* The underlying integer value of this {@link SchemaId} * The underlying integer value of this {@link SchemaId}
* *
@@ -76,20 +92,6 @@ public final class SchemaId {
return this.value; return this.value;
} }
/**
* Returns a {@link SchemaId} from a specified underlying integer value
*
* @return The integer value of this {@link SchemaId}
*/
public static SchemaId from(int value) {
return new SchemaId(value);
}
@Override
public String toString() {
return String.valueOf(this.value());
}
static final class JsonDeserializer extends StdDeserializer<SchemaId> { static final class JsonDeserializer extends StdDeserializer<SchemaId> {
private JsonDeserializer() { private JsonDeserializer() {

View File

@@ -298,7 +298,7 @@ public final class RowReader {
checkState(this.cursor.scopeType() instanceof LayoutUDT); checkState(this.cursor.scopeType() instanceof LayoutUDT);
LayoutColumn col = this.columns[this.columnIndex]; LayoutColumn col = this.columns[this.columnIndex];
if (!this.row.ReadBit(this.cursor.start(), col.getNullBit().clone())) { if (!this.row.readBit(this.cursor.start(), col.getNullBit().clone())) {
// Skip schematized values if they aren't present. // Skip schematized values if they aren't present.
// TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java: // TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java:
// goto case States.Schematized; // goto case States.Schematized;
@@ -1104,7 +1104,7 @@ public final class RowReader {
return Result.TypeMismatch; return Result.TypeMismatch;
} }
switch (col == null ? null : col.getStorage()) { switch (col == null ? null : col.storage()) {
case Fixed: case Fixed:
Reference<RowBuffer> tempReference_row = Reference<RowBuffer> tempReference_row =
new Reference<RowBuffer>(this.row); new Reference<RowBuffer>(this.row);
@@ -1142,7 +1142,7 @@ public final class RowReader {
return Result.TypeMismatch; return Result.TypeMismatch;
} }
switch (col == null ? null : col.getStorage()) { switch (col == null ? null : col.storage()) {
case Fixed: case Fixed:
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row); Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor); Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);
@@ -1180,7 +1180,7 @@ public final class RowReader {
return Result.TypeMismatch; return Result.TypeMismatch;
} }
switch (col == null ? null : col.getStorage()) { switch (col == null ? null : col.storage()) {
case Fixed: case Fixed:
Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row); Reference<RowBuffer> tempReference_row = new Reference<RowBuffer>(this.row);
Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor); Reference<RowCursor> tempReference_cursor = new Reference<RowCursor>(this.cursor);

View File

@@ -3,7 +3,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Utf8String; import com.azure.data.cosmos.core.Utf8String;
import com.azure.data.cosmos.core.UtfAnyString; import com.azure.data.cosmos.core.UtfAnyString;
import com.azure.data.cosmos.serialization.hybridrow.SchemaId; import com.azure.data.cosmos.serialization.hybridrow.SchemaId;
@@ -11,8 +10,12 @@ import com.azure.data.cosmos.serialization.hybridrow.schemas.Namespace;
import com.azure.data.cosmos.serialization.hybridrow.schemas.Schema; import com.azure.data.cosmos.serialization.hybridrow.schemas.Schema;
import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind; import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
import javax.annotation.Nonnull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Optional;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* A Layout describes the structure of a Hybrid Row * A Layout describes the structure of a Hybrid Row
@@ -36,39 +39,45 @@ public final class Layout {
private final int numVariable; private final int numVariable;
private final HashMap<Utf8String, LayoutColumn> pathMap; private final HashMap<Utf8String, LayoutColumn> pathMap;
private final HashMap<String, LayoutColumn> pathStringMap; private final HashMap<String, LayoutColumn> pathStringMap;
private final SchemaId schemaId = new SchemaId(); private final SchemaId schemaId;
private final int size; private final int size;
private final StringTokenizer tokenizer; private final StringTokenizer tokenizer;
private final LayoutColumn[] topColumns; private final LayoutColumn[] topColumns;
public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, ArrayList<LayoutColumn> columns) { public Layout(
@Nonnull final String name, @Nonnull final SchemaId schemaId, final int numBitmaskBytes,
final int minRequiredSize, @Nonnull final ArrayList<LayoutColumn> columns
) {
checkNotNull(name);
checkNotNull(schemaId);
checkNotNull(columns);
this.name = name; this.name = name;
this.schemaId = schemaId.clone(); this.schemaId = schemaId;
this.numBitmaskBytes = numBitmaskBytes; this.numBitmaskBytes = numBitmaskBytes;
this.size = minRequiredSize; this.size = minRequiredSize;
this.tokenizer = new StringTokenizer(); this.tokenizer = new StringTokenizer();
this.pathMap = new HashMap<Utf8String, LayoutColumn>(columns.size(), SamplingUtf8StringComparer.Default); this.pathMap = new HashMap<>(columns.size());
this.pathStringMap = new HashMap<String, LayoutColumn>(columns.size()); this.pathStringMap = new HashMap<>(columns.size());
final ArrayList<LayoutColumn> top = new ArrayList<LayoutColumn>(columns.size()); final ArrayList<LayoutColumn> top = new ArrayList<>(columns.size());
int numFixed = 0; int numFixed = 0;
int numVariable = 0; int numVariable = 0;
for (LayoutColumn c : columns) { for (LayoutColumn column : columns) {
this.tokenizer().add(c.getPath()); this.tokenizer().add(column.path());
this.pathMap.put(c.getFullPath(), c); this.pathMap.put(column.fullPath(), column);
this.pathStringMap.put(c.getFullPath().toString(), c); this.pathStringMap.put(column.fullPath().toString(), column);
if (c.getStorage() == StorageKind.Fixed) { if (column.storage() == StorageKind.Fixed) {
numFixed++; numFixed++;
} else if (c.getStorage() == StorageKind.Variable) { } else if (column.storage() == StorageKind.Variable) {
numVariable++; numVariable++;
} }
if (c.getParent() == null) { if (column.parent() == null) {
top.add(c); top.add(column);
} }
} }
@@ -78,36 +87,35 @@ public final class Layout {
} }
/** /**
* Finds a column specification for a column with a matching path. * Finds a column specification for a column with a matching path
* *
* @param path The path of the column to find. * @param path path of the column to find
* @param column If found, the column specification, otherwise {@code null}. * @return {@link LayoutColumn}, if a column with the {@code path} is found, {@link Optional#empty()}
* @return {@code true} if a column with the path is found, otherwise {@code false}.
*/ */
public boolean TryFind(UtfAnyString path, Out<LayoutColumn> column) { public Optional<LayoutColumn> tryFind(@Nonnull UtfAnyString path) {
checkNotNull(path);
if (path.isNull()) { if (path.isNull()) {
column.setAndGet(null); return Optional.empty();
return false;
} }
if (path.isUtf8()) { if (path.isUtf8()) {
return (this.pathMap.containsKey(path.toUtf8()) && (column.setAndGet(this.pathMap.get(path.toUtf8()))) == column.get()); return Optional.ofNullable(this.pathMap.get(path.toUtf8()));
} }
String value = path.toUtf16(); return Optional.ofNullable(this.pathStringMap.get(path.toUtf16()));
return (this.pathStringMap.containsKey(value) && (column.setAndGet(this.pathStringMap.get(value))) == column.get());
} }
/** /**
* Finds a column specification for a column with a matching path. * Finds a column specification for a column with a matching path.
* *
* @param path The path of the column to find. * @param path The path of the column to find.
* @param column If found, the column specification, otherwise null.
* @return True if a column with the path is found, otherwise false. * @return True if a column with the path is found, otherwise false.
*/ */
public boolean TryFind(String path, Out<LayoutColumn> column) { public Optional<LayoutColumn> tryFind(@Nonnull String path) {
return (this.pathStringMap.containsKey(path) && (column.setAndGet(this.pathStringMap.get(path))) == column.get()); checkNotNull(path);
return Optional.ofNullable(this.pathStringMap.get(path));
} }
/** /**
@@ -181,15 +189,15 @@ public final class Layout {
sb.append(String.format("\tCount: %1$s\n", this.topColumns.length)); sb.append(String.format("\tCount: %1$s\n", this.topColumns.length));
sb.append(String.format("\tFixedSize: %1$s\n", this.size())); sb.append(String.format("\tFixedSize: %1$s\n", this.size()));
for (LayoutColumn c : this.topColumns) { for (LayoutColumn column : this.topColumns) {
if (c.getType().getIsFixed()) { if (column.type().isFixed()) {
if (c.getType().getIsBool()) { if (column.type().isBoolean()) {
sb.append(String.format("\t%1$s: %2$s @ %3$s:%4$s:%5$s\n", c.getFullPath(), c.getType().getName(), c.getOffset(), c.getNullBit().clone(), c.getBoolBit().clone())); sb.append(String.format("\t%1$s: %2$s @ %3$s:%4$s:%5$s\n", column.fullPath(), column.type().name(), column.getOffset(), column.getNullBit(), column.getBooleanBit()));
} else { } else {
sb.append(String.format("\t%1$s: %2$s @ %3$s\n", c.getFullPath(), c.getType().getName(), c.getOffset())); sb.append(String.format("\t%1$s: %2$s @ %3$s\n", column.fullPath(), column.type().name(), column.getOffset()));
} }
} else { } else {
sb.append(String.format("\t%1$s: %2$s[%4$s] @ %3$s\n", c.getFullPath(), c.getType().getName(), c.getOffset(), c.getSize())); sb.append(String.format("\t%1$s: %2$s[%4$s] @ %3$s\n", column.fullPath(), column.type().name(), column.getOffset(), column.getSize()));
} }
} }

View File

@@ -32,14 +32,14 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// byte[] value) // byte[] value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<byte[]> value) { Out<byte[]> value) {
ReadOnlySpan<Byte> span; ReadOnlySpan<Byte> span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: Result r = this.ReadFixed(ref b, ref scope, col, out ReadOnlySpan<byte> span); //ORIGINAL LINE: Result r = this.ReadFixed(ref b, ref scope, col, out ReadOnlySpan<byte> span);
Result r = this.ReadFixed(b, scope, col, out span); Result r = this.ReadFixed(b, scope, column, out span);
value.setAndGet((r == Result.Success) ? span.ToArray() :) value.setAndGet((r == Result.Success) ? span.ToArray() :)
default default
return r; return r;
@@ -52,7 +52,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
Out<ReadOnlySpan<Byte>> value) { Out<ReadOnlySpan<Byte>> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
checkArgument(col.getSize() >= 0); checkArgument(col.getSize() >= 0);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), col.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
@@ -64,7 +64,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte[] value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte[] value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<byte[]> value) { Out<byte[]> value) {
ReadOnlySpan<Byte> span; ReadOnlySpan<Byte> span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
@@ -93,14 +93,14 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// byte[] value) // byte[] value)
@Override @Override
public Result readVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column
, Out<byte[]> value) { , Out<byte[]> value) {
ReadOnlySpan<Byte> span; ReadOnlySpan<Byte> span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: Result r = this.ReadVariable(ref b, ref scope, col, out ReadOnlySpan<byte> span); //ORIGINAL LINE: Result r = this.ReadVariable(ref b, ref scope, col, out ReadOnlySpan<byte> span);
Result r = this.ReadVariable(b, scope, col, out span); Result r = this.ReadVariable(b, scope, column, out span);
value.setAndGet((r == Result.Success) ? span.ToArray() :) value.setAndGet((r == Result.Success) ? span.ToArray() :)
default default
return r; return r;
@@ -112,7 +112,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
, Out<ReadOnlySpan<Byte>> value) { , Out<ReadOnlySpan<Byte>> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), col.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
@@ -127,12 +127,12 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
//ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte[] //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte[]
// value) // value)
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
byte[] value) { byte[] value) {
checkArgument(value != null); checkArgument(value != null);
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: return this.WriteFixed(ref b, ref scope, col, new ReadOnlySpan<byte>(value)); //ORIGINAL LINE: return this.WriteFixed(ref b, ref scope, col, new ReadOnlySpan<byte>(value));
return this.WriteFixed(b, scope, col, new ReadOnlySpan<Byte>(value)); return this.WriteFixed(b, scope, column, new ReadOnlySpan<Byte>(value));
} }
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
@@ -170,7 +170,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte[] value) { public Result writeSparse(RowBuffer b, RowCursor edit, byte[] value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
@@ -179,7 +179,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, byte[] value, public Result writeSparse(RowBuffer b, RowCursor edit, byte[] value,
UpdateOptions options) { UpdateOptions options) {
checkArgument(value != null); checkArgument(value != null);
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
@@ -254,7 +254,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
return Result.TooBig; return Result.TooBig;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit().clone()); boolean exists = b.get().readBit(scope.get().start(), col.getNullBit().clone());
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); col.getOffset());
int shift; int shift;
@@ -282,7 +282,7 @@ public final class LayoutBinary extends LayoutType<byte[]> implements ILayoutSpa
return Result.TooBig; return Result.TooBig;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit().clone()); boolean exists = b.get().readBit(scope.get().start(), col.getNullBit().clone());
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); col.getOffset());
int shift; int shift;

View File

@@ -5,19 +5,12 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
//C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may differ public final class LayoutBit {
// from the original:
//ORIGINAL LINE: public readonly struct LayoutBit : IEquatable<LayoutBit>
//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# readonly struct:
public final class LayoutBit implements IEquatable<LayoutBit> {
/** /**
* The empty bit. * The empty bit.
*/ */
public static final LayoutBit Invalid = new LayoutBit(-1); public static final LayoutBit INVALID = new LayoutBit(-1);
/**
* The 0-based offset into the layout bitmask.
*/
private int index; private int index;
/** /**
@@ -25,58 +18,50 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
* *
* @param index The 0-based offset into the layout bitmask. * @param index The 0-based offset into the layout bitmask.
*/ */
public LayoutBit() {
}
public LayoutBit(int index) { public LayoutBit(int index) {
checkArgument(index >= -1); checkArgument(index >= -1);
this.index = index; this.index = index;
} }
/** /**
* Compute the division rounding up to the next whole number. * Compute the division rounding up to the next whole number
* *
* @param numerator The numerator to divide. * @param numerator The numerator to divide.
* @param divisor The divisor to divide by. * @param divisor The divisor to divide by.
* @return The ceiling(numerator/divisor). * @return The ceiling(numerator/divisor).
*/ */
public static int DivCeiling(int numerator, int divisor) { public static int divCeiling(int numerator, int divisor) {
return (numerator + (divisor - 1)) / divisor; return (numerator + (divisor - 1)) / divisor;
} }
/** /**
* Returns the 0-based bit from the beginning of the byte that contains this bit. * Zero-based bit from the beginning of the byte that contains this bit
* Also see {@link GetOffset} to identify relevant byte. * <p>
* Also see {@link #offset} to identify relevant byte.
* *
* @return The bit of the byte within the bitmask. * @return The bit of the byte within the bitmask.
*/ */
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: public int bit() {
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetBit() return this.index() % LayoutTypes.BitsPerByte;
public int GetBit() {
return this.index % LayoutType.BitsPerByte;
} }
/** /**
* Returns the 0-based byte offset from the beginning of the row or scope that contains the * Zero-based offset into the layout bitmask
* bit from the bitmask. */
public int index() {
return this.index;
}
/**
* Returns the zero-based byte offset from the beginning of the row or scope that contains the bit from the bitmask
* <p> * <p>
* Also see {@link GetBit} to identify. * Also see {@link #bit} to identify.
* *
* @param offset The byte offset from the beginning of the row where the scope begins. * @param offset The byte offset from the beginning of the row where the scope begins.
* @return The byte offset containing this bit. * @return The byte offset containing this bit.
*/ */
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: public int offset(int offset) {
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetOffset(int offset) return offset + (this.index() / LayoutTypes.BitsPerByte);
public int GetOffset(int offset) {
return offset + (this.index / LayoutType.BitsPerByte);
}
public LayoutBit clone() {
LayoutBit varCopy = new LayoutBit();
varCopy.index = this.index;
return varCopy;
} }
@Override @Override
@@ -84,45 +69,19 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
return other instanceof LayoutBit && this.equals((LayoutBit)other); return other instanceof LayoutBit && this.equals((LayoutBit)other);
} }
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(LayoutBit other)
public boolean equals(LayoutBit other) { public boolean equals(LayoutBit other) {
return this.index == other.index; return other != null && this.index() == other.index();
} }
@Override @Override
public int hashCode() { public int hashCode() {
return (new Integer(this.index)).hashCode(); return Integer.valueOf(this.index()).hashCode();
} }
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(LayoutBit
// left, LayoutBit right)
public static boolean opEquals(LayoutBit left, LayoutBit right) {
return left.equals(right.clone());
}
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes:
//ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(LayoutBit
// left, LayoutBit right)
public static boolean opNotEquals(LayoutBit left, LayoutBit right) {
return !LayoutBit.opEquals(left.clone(), right.clone());
}
/**
* The 0-based offset into the layout bitmask.
*/
int getIndex()
/**
* The 0-based offset into the layout bitmask.
*/
boolean getIsInvalid()
/** /**
* Allocates layout bits from a bitmask. * Allocates layout bits from a bitmask.
*/ */
public static class Allocator { static class Allocator {
/** /**
* The next bit to allocate. * The next bit to allocate.
*/ */
@@ -139,7 +98,7 @@ public final class LayoutBit implements IEquatable<LayoutBit> {
* The number of bytes needed to hold all bits so far allocated. * The number of bytes needed to hold all bits so far allocated.
*/ */
public final int getNumBytes() { public final int getNumBytes() {
return LayoutBit.DivCeiling(this.next, LayoutType.BitsPerByte); return LayoutBit.divCeiling(this.next, LayoutTypes.BitsPerByte);
} }
/** /**

View File

@@ -29,20 +29,20 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Boolean> value) { Out<Boolean> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(false); value.setAndGet(false);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadBit(scope.get().start(), col.getBoolBit().clone())); value.setAndGet(b.get().readBit(scope.get().start(), column.getBooleanBit().clone()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Boolean> value) { Out<Boolean> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -63,9 +63,9 @@ public final class LayoutBoolean extends LayoutType<Boolean> {
} }
if (value) { if (value) {
b.get().SetBit(scope.get().start(), col.getBoolBit().clone()); b.get().SetBit(scope.get().start(), col.getBooleanBit().clone());
} else { } else {
b.get().UnsetBit(scope.get().start(), col.getBoolBit().clone()); b.get().UnsetBit(scope.get().start(), col.getBooleanBit().clone());
} }
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), col.getNullBit().clone());

View File

@@ -12,12 +12,12 @@ import java.util.Stack;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
public final class LayoutBuilder { public final class LayoutBuilder {
private LayoutBit.Allocator bitallocator; private LayoutBit.Allocator bitAllocator;
private ArrayList<LayoutColumn> fixedColumns; private ArrayList<LayoutColumn> fixedColumns;
private int fixedCount; private int fixedCount;
private int fixedSize; private int fixedSize;
private String name; private String name;
private SchemaId schemaId = new SchemaId(); private SchemaId schemaId;
private Stack<LayoutColumn> scope; private Stack<LayoutColumn> scope;
private ArrayList<LayoutColumn> sparseColumns; private ArrayList<LayoutColumn> sparseColumns;
private int sparseCount; private int sparseCount;
@@ -32,112 +32,103 @@ public final class LayoutBuilder {
// ] // ]
public LayoutBuilder(String name, SchemaId schemaId) { public LayoutBuilder(String name, SchemaId schemaId) {
this.name = name; this.name = name;
this.schemaId = schemaId.clone(); this.schemaId = schemaId;
this.Reset(); this.reset();
} }
public void AddFixedColumn(String path, LayoutType type, boolean nullable) { public void addFixedColumn(String path, LayoutType type, boolean nullable, int length) {
AddFixedColumn(path, type, nullable, 0);
}
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
//ORIGINAL LINE: public void AddFixedColumn(string path, LayoutType type, bool nullable, int length = 0)
public void AddFixedColumn(String path, LayoutType type, boolean nullable, int length) {
checkArgument(length >= 0); checkArgument(length >= 0);
checkArgument(!type.getIsVarint()); checkArgument(!type.isVarint());
LayoutColumn col; LayoutColumn column;
if (type.getIsNull()) { if (type.isNull()) {
checkArgument(nullable); checkArgument(nullable);
LayoutBit nullbit = this.bitallocator.Allocate().clone(); LayoutBit nullBit = this.bitAllocator.Allocate();
col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(),
this.fixedCount, 0, nullbit.clone(), LayoutBit.Invalid, 0); this.fixedCount, 0, nullBit, LayoutBit.INVALID, 0);
} else if (type.getIsBool()) { } else if (type.isBoolean()) {
LayoutBit nullbit = nullable ? this.bitallocator.Allocate() : LayoutBit.Invalid; LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID;
LayoutBit boolbit = this.bitallocator.Allocate().clone(); LayoutBit boolbit = this.bitAllocator.Allocate();
col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(),
this.fixedCount, 0, nullbit.clone(), boolbit.clone(), 0); this.fixedCount, 0, nullBit, boolbit, 0);
} else { } else {
LayoutBit nullBit = nullable ? this.bitallocator.Allocate() : LayoutBit.Invalid; LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID;
col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(),
this.fixedCount, this.fixedSize, nullBit.clone(), LayoutBit.Invalid, length); this.fixedCount, this.fixedSize, nullBit, LayoutBit.INVALID, length);
this.fixedSize += type.getIsFixed() ? type.Size : length; this.fixedSize += type.isFixed() ? type.size() : length;
} }
this.fixedCount++; this.fixedCount++;
this.fixedColumns.add(col); this.fixedColumns.add(column);
} }
public void AddObjectScope(String path, LayoutType type) { public void addObjectScope(String path, LayoutType type) {
LayoutColumn col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Sparse, this.getParent(),
this.sparseCount, -1, LayoutBit.Invalid, LayoutBit.Invalid, 0); LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Sparse, this.parent(),
this.sparseCount, -1, LayoutBit.INVALID, LayoutBit.INVALID, 0);
this.sparseCount++; this.sparseCount++;
this.sparseColumns.add(col); this.sparseColumns.add(column);
this.scope.push(col); this.scope.push(column);
} }
public void AddSparseColumn(String path, LayoutType type) { public void addSparseColumn(String path, LayoutType type) {
LayoutColumn col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Sparse, this.getParent(),
this.sparseCount, -1, LayoutBit.Invalid, LayoutBit.Invalid, 0); LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Sparse, this.parent(),
this.sparseCount, -1, LayoutBit.INVALID, LayoutBit.INVALID, 0);
this.sparseCount++;
this.sparseColumns.add(column);
}
public void addTypedScope(String path, LayoutType type, TypeArgumentList typeArgs) {
LayoutColumn col = new LayoutColumn(path, type, typeArgs, StorageKind.Sparse, this.parent(), this.sparseCount,
-1, LayoutBit.INVALID, LayoutBit.INVALID, 0);
this.sparseCount++; this.sparseCount++;
this.sparseColumns.add(col); this.sparseColumns.add(col);
} }
public void AddTypedScope(String path, LayoutType type, TypeArgumentList typeArgs) { public void addVariableColumn(String path, LayoutType type, int length) {
LayoutColumn col = new LayoutColumn(path, type, typeArgs.clone(), StorageKind.Sparse, this.getParent(),
this.sparseCount, -1, LayoutBit.Invalid, LayoutBit.Invalid, 0);
this.sparseCount++;
this.sparseColumns.add(col);
}
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above:
//ORIGINAL LINE: public void AddVariableColumn(string path, LayoutType type, int length = 0)
public void AddVariableColumn(String path, LayoutType type, int length) {
checkArgument(length >= 0); checkArgument(length >= 0);
checkArgument(type.getAllowVariable()); checkArgument(type.allowVariable());
LayoutColumn col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Variable, LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Variable, this.parent(),
this.getParent(), this.varCount, this.varCount, this.bitallocator.Allocate().clone(), LayoutBit.Invalid, this.varCount, this.varCount, this.bitAllocator.Allocate(), LayoutBit.INVALID, length);
length);
this.varCount++; this.varCount++;
this.varColumns.add(col); this.varColumns.add(column);
} }
public void AddVariableColumn(String path, LayoutType type) { public Layout build() {
AddVariableColumn(path, type, 0);
}
public Layout Build() {
// Compute offset deltas. Offset bools by the present byte count, and fixed fields by the sum of the present // Compute offset deltas. Offset bools by the present byte count, and fixed fields by the sum of the present
// and bool count. // and bool count.
int fixedDelta = this.bitallocator.getNumBytes(); int fixedDelta = this.bitAllocator.getNumBytes();
int varIndexDelta = this.fixedCount; int varIndexDelta = this.fixedCount;
// Update the fixedColumns with the delta before freezing them. // Update the fixedColumns with the delta before freezing them.
ArrayList<LayoutColumn> updatedColumns = ArrayList<LayoutColumn> updatedColumns =
new ArrayList<LayoutColumn>(this.fixedColumns.size() + this.varColumns.size()); new ArrayList<LayoutColumn>(this.fixedColumns.size() + this.varColumns.size());
for (LayoutColumn c : this.fixedColumns) { for (LayoutColumn column : this.fixedColumns) {
c.SetOffset(c.getOffset() + fixedDelta); column.offset(column.offset() + fixedDelta);
updatedColumns.add(c); updatedColumns.add(column);
} }
for (LayoutColumn c : this.varColumns) { for (LayoutColumn column : this.varColumns) {
// Adjust variable column indexes such that they begin immediately following the last fixed column. // Adjust variable column indexes such that they begin immediately following the last fixed column.
c.SetIndex(c.getIndex() + varIndexDelta); column.index(column.index() + varIndexDelta);
updatedColumns.add(c); updatedColumns.add(column);
} }
updatedColumns.addAll(this.sparseColumns); updatedColumns.addAll(this.sparseColumns);
Layout layout = new Layout(this.name, this.schemaId.clone(), this.bitallocator.getNumBytes(), this.fixedSize + fixedDelta, updatedColumns); Layout layout = new Layout(this.name, this.schemaId, this.bitAllocator.getNumBytes(), this.fixedSize + fixedDelta, updatedColumns);
this.Reset(); this.reset();
return layout; return layout;
} }
@@ -146,7 +137,7 @@ public final class LayoutBuilder {
this.scope.pop(); this.scope.pop();
} }
private LayoutColumn getParent() { private LayoutColumn parent() {
if (this.scope.empty()) { if (this.scope.empty()) {
return null; return null;
} }
@@ -154,8 +145,8 @@ public final class LayoutBuilder {
return this.scope.peek(); return this.scope.peek();
} }
private void Reset() { private void reset() {
this.bitallocator = new LayoutBit.Allocator(); this.bitAllocator = new LayoutBit.Allocator();
this.fixedSize = 0; this.fixedSize = 0;
this.fixedCount = 0; this.fixedCount = 0;
this.fixedColumns = new ArrayList<LayoutColumn>(); this.fixedColumns = new ArrayList<LayoutColumn>();

View File

@@ -6,235 +6,205 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Utf8String; import com.azure.data.cosmos.core.Utf8String;
import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind; import com.azure.data.cosmos.serialization.hybridrow.schemas.StorageKind;
import javax.annotation.Nonnull;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Strings.lenientFormat;
public final class LayoutColumn { public final class LayoutColumn {
/**
* For bool fields, 0-based index into the bit mask for the bool value. private final LayoutBit booleanBit;
*/ private final Utf8String fullPath;
private LayoutBit boolBit = new LayoutBit(); private final LayoutBit nullBit;
/** private final LayoutColumn parent;
* The full logical path of the field within the row. private final Utf8String path;
*/ private final int size;
private Utf8String fullPath; private final StorageKind storage;
/** private final LayoutType type;
* 0-based index of the column within the structure. Also indicates which presence bit private final TypeArgument typeArg;
* controls this column. private final TypeArgumentList typeArgs;
*/
private int index; private int index;
/**
* For nullable fields, the 0-based index into the bit mask for the null bit.
*/
private LayoutBit nullBit = new LayoutBit();
/**
* If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to
* the field location.
* <para />
* If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the
* field from the beginning of the variable length segment.
* <para />
* For all other values of {@link storage}, {@link Offset} is ignored.
*/
private int offset; private int offset;
/**
* The layout of the parent scope, if a nested column, otherwise null.
*/
private LayoutColumn parent;
/**
* The relative path of the field within its parent scope.
*/
private Utf8String path;
/**
* If {@link LayoutType.IsBool} then the 0-based extra index within the bool byte
* holding the value of this type, otherwise must be 0.
*/
private int size;
/**
* The storage kind of the field.
*/
private StorageKind storage = StorageKind.values()[0];
/**
* The physical layout type of the field.
*/
private LayoutType type;
/**
* The physical layout type of the field.
*/
private TypeArgument typeArg = new TypeArgument();
/**
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
*/
private TypeArgumentList typeArgs = new TypeArgumentList();
/** /**
* Initializes a new instance of the {@link LayoutColumn} class. * Initializes a new instance of the {@link LayoutColumn} class
* *
* @param path The path to the field relative to parent scope. * @param path The path to the field relative to parent scope.
* @param type Type of the field. * @param type Type of the field.
* @param storage Storage encoding of the field. * @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
* @param parent The layout of the parent scope, if a nested column. * @param storage Storage encoding of the field.
* @param index 0-based column index. * @param parent The layout of the parent scope, if a nested column.
* @param offset 0-based Offset from beginning of serialization. * @param index zero-based column index.
* @param nullBit 0-based index into the bit mask for the null bit. * @param offset zero-based Offset from beginning of serialization.
* @param boolBit For bool fields, 0-based index into the bit mask for the bool value. * @param nullBit zero-based index into the bit mask for the null bit.
* @param length For variable length types the length, otherwise 0. * @param booleanBit For bool fields, zero-based index into the bit mask for the boolean value.
* @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type * @param length For variable length types the length, otherwise {@code 0}.
* parameters.
*/ */
public LayoutColumn(
@Nonnull final String path, @Nonnull final LayoutType type, @Nonnull final TypeArgumentList typeArgs,
@Nonnull final StorageKind storage, final LayoutColumn parent, int index, int offset,
@Nonnull final LayoutBit nullBit, @Nonnull final LayoutBit booleanBit, int length) {
public LayoutColumn(String path, LayoutType type, TypeArgumentList typeArgs, StorageKind storage, checkNotNull(path);
LayoutColumn parent, int index, int offset, LayoutBit nullBit, LayoutBit boolBit) { checkNotNull(type);
this(path, type, typeArgs, storage, parent, index, offset, nullBit, boolBit, 0); checkNotNull(typeArgs);
} checkNotNull(storage);
checkNotNull(nullBit);
checkNotNull(booleanBit);
//C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: this.path = Utf8String.transcodeUtf16(path);
//ORIGINAL LINE: internal LayoutColumn(string path, LayoutType type, TypeArgumentList typeArgs, StorageKind this.fullPath = Utf8String.transcodeUtf16(fullPath(parent, path));
// storage, LayoutColumn parent, int index, int offset, LayoutBit nullBit, LayoutBit boolBit, int length = 0)
public LayoutColumn(String path, LayoutType type, TypeArgumentList typeArgs, StorageKind storage,
LayoutColumn parent, int index, int offset, LayoutBit nullBit, LayoutBit boolBit, int length) {
this.path = Utf8String.TranscodeUtf16(path);
this.fullPath = Utf8String.TranscodeUtf16(LayoutColumn.GetFullPath(parent, path));
this.type = type; this.type = type;
this.typeArgs = typeArgs.clone(); this.typeArgs = typeArgs;
this.typeArg = new TypeArgument(type, typeArgs.clone()); this.typeArg = new TypeArgument(type, typeArgs);
this.storage = storage; this.storage = storage;
this.parent = parent; this.parent = parent;
this.index = index; this.index = index;
this.offset = offset; this.offset = offset;
this.nullBit = nullBit.clone(); this.nullBit = nullBit;
this.boolBit = boolBit.clone(); this.booleanBit = booleanBit;
this.size = this.typeArg.type().getIsFixed() ? type.Size : length; this.size = this.typeArg().type().isFixed() ? type.size() : length;
} }
/** /**
* The full logical path of the field within the row. * For bool fields, zero-based index into the bit mask for the bool value.
* <p>
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c'
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'.
*/ */
public Utf8String getFullPath() { public @Nonnull LayoutBit booleanBit() {
return this.booleanBit;
}
/**
* Full logical path of the field within the row
* <p>
* Paths are expressed in dotted notation: e.g. a relative {@link #path} of 'b.c' within the scope 'a' yields a
* {@link #fullPath} of 'a.b.c'.
*/
public @Nonnull Utf8String fullPath() {
return this.fullPath; return this.fullPath;
} }
/** /**
* 0-based index of the column within the structure. Also indicates which presence bit * Zero-based index of the column within the structure
* controls this column. * <p>
* This value also indicates which presence bit controls this column.
*/ */
public int getIndex() { public int index() {
return this.index; return this.index;
} }
/** /**
* The layout of the parent scope, if a nested column, otherwise null. * For nullable fields, the zero-based index into the bit mask for the null bit
*/ */
public LayoutColumn getParent() { public @Nonnull LayoutBit nullBit() {
return this.nullBit;
}
/**
* If {@link #storage} equals {@link StorageKind#Fixed} then the byte offset to the field location.
* <p>
* If {@link #storage} equals {@link StorageKind#Variable} then the zero-based index of the field from the
* beginning of the variable length segment.
* <p>
* For all other values of {@link #storage}, {@link #offset} is ignored.
*/
public int offset() {
return this.offset;
}
/**
* Layout of the parent scope, if a nested column, otherwise null.
*/
public LayoutColumn parent() {
return this.parent; return this.parent;
} }
/** /**
* The relative path of the field within its parent scope. * The relative path of the field within its parent scope.
* <p> * <p>
* Paths are expressed in dotted notation: e.g. a relative {@link Path} of 'b.c' * Paths are expressed in dotted notation: e.g. a relative {@link #path} of 'b.c' within the scope 'a' yields a
* within the scope 'a' yields a {@link FullPath} of 'a.b.c'. * {@link #fullPath} of 'a.b.c'.
*/ */
public Utf8String getPath() { public @Nonnull Utf8String path() {
return this.path; return this.path;
} }
/**
* If {@link LayoutType#isBoolean} then the zero-based extra index within the bool byte
* holding the value of this type, otherwise must be 0.
*/
public int size() {
return this.size;
}
/** /**
* The storage kind of the field. * The storage kind of the field.
*/ */
public StorageKind getStorage() { public @Nonnull StorageKind storage() {
return this.storage; return this.storage;
} }
/** /**
* The physical layout type of the field. * The physical layout type of the field.
*/ */
public LayoutType getType() { public @Nonnull LayoutType type() {
return this.type; return this.type;
} }
/** /**
* The full logical type. * The full logical type
*/ */
public TypeArgument getTypeArg() { public @Nonnull TypeArgument typeArg() {
return this.typeArg.clone(); return this.typeArg;
} }
/** /**
* For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters.
*/ */
public TypeArgumentList getTypeArgs() { public @Nonnull TypeArgumentList typeArgs() {
return this.typeArgs.clone(); return this.typeArgs;
}
public void SetIndex(int index) {
this.index = index;
}
public void SetOffset(int offset) {
this.offset = offset;
} }
/** /**
* The physical layout type of the field cast to the specified type. * The physical layout type of the field cast to the specified type.
*/ */
// TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @SuppressWarnings("unchecked")
//ORIGINAL LINE: [DebuggerHidden] public T TypeAs<T>() where T : ILayoutType public @Nonnull <T extends ILayoutType> T typeAs() {
public <T extends ILayoutType> T TypeAs() { return (T) this.type().typeAs();
return this.type.typeAs(); }
LayoutColumn index(int value) {
this.index = value;
return this;
}
LayoutColumn offset(int value) {
this.offset = value;
return this;
} }
/** /**
* For bool fields, 0-based index into the bit mask for the bool value. * Computes the full logical path to the column
*/
LayoutBit getBoolBit()
/**
* For nullable fields, the the bit in the layout bitmask for the null bit.
*/
LayoutBit getNullBit()
/**
* If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to
* the field location.
* <para />
* If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the
* field from the beginning of the variable length segment.
* <para />
* For all other values of {@link storage}, {@link Offset} is ignored.
*/
int getOffset()
/**
* If {@link storage} equals {@link StorageKind.Fixed} then the fixed number of
* bytes reserved for the value.
* <para />
* If {@link storage} equals {@link StorageKind.Variable} then the maximum number of
* bytes allowed for the value.
*/
int getSize()
/**
* Computes the full logical path to the column.
* *
* @param parent The layout of the parent scope, if a nested column, otherwise null. * @param parent The layout of the parent scope, if a nested column, otherwise null
* @param path The path to the field relative to parent scope. * @param path The path to the field relative to parent scope
* @return The full logical path. * @return The full logical path
*/ */
private static String GetFullPath(LayoutColumn parent, String path) { private static @Nonnull String fullPath(final LayoutColumn parent, @Nonnull final String path) {
if (parent != null) { if (parent != null) {
switch (LayoutCodeTraits.ClearImmutableBit(parent.type.LayoutCode)) { switch (LayoutCodeTraits.ClearImmutableBit(parent.type().layoutCode())) {
case OBJECT_SCOPE: case OBJECT_SCOPE:
case SCHEMA: case SCHEMA:
return parent.getFullPath().toString() + "." + path; return parent.fullPath().toString() + "." + path;
case ARRAY_SCOPE: case ARRAY_SCOPE:
case TYPED_ARRAY_SCOPE: case TYPED_ARRAY_SCOPE:
case TYPED_SET_SCOPE: case TYPED_SET_SCOPE:
case TYPED_MAP_SCOPE: case TYPED_MAP_SCOPE:
return parent.getFullPath().toString() + "[]" + path; return parent.fullPath().toString() + "[]" + path;
default: default:
throw new IllegalStateException(lenientFormat("Parent scope type not supported: %s", parent.type.LayoutCode)); final String message = lenientFormat("Parent scope type not supported: %s", parent.type().layoutCode());
return null; throw new IllegalStateException(message);
} }
} }

View File

@@ -45,7 +45,7 @@ public final class LayoutCompiler {
LayoutBuilder builder = new LayoutBuilder(schema.getName(), schema.getSchemaId().clone()); LayoutBuilder builder = new LayoutBuilder(schema.getName(), schema.getSchemaId().clone());
LayoutCompiler.AddProperties(builder, ns, LayoutCode.SCHEMA, schema.getProperties()); LayoutCompiler.AddProperties(builder, ns, LayoutCode.SCHEMA, schema.getProperties());
return builder.Build(); return builder.build();
} }
private static void AddProperties(LayoutBuilder builder, Namespace ns, LayoutCode scope, private static void AddProperties(LayoutBuilder builder, Namespace ns, LayoutCode scope,
@@ -63,7 +63,7 @@ public final class LayoutCompiler {
} }
ObjectPropertyType op = (ObjectPropertyType)p.getPropertyType(); ObjectPropertyType op = (ObjectPropertyType)p.getPropertyType();
builder.AddObjectScope(p.getPath(), type); builder.addObjectScope(p.getPath(), type);
LayoutCompiler.AddProperties(builder, ns, type.LayoutCode, op.getProperties()); LayoutCompiler.AddProperties(builder, ns, type.LayoutCode, op.getProperties());
builder.EndObjectScope(); builder.EndObjectScope();
break; break;
@@ -84,7 +84,7 @@ public final class LayoutCompiler {
throw new LayoutCompilationException("Non-nullable sparse column are not supported."); throw new LayoutCompilationException("Non-nullable sparse column are not supported.");
} }
builder.AddTypedScope(p.getPath(), type, typeArgs.clone()); builder.addTypedScope(p.getPath(), type, typeArgs.clone());
break; break;
} }
@@ -109,7 +109,7 @@ public final class LayoutCompiler {
"."); ".");
} }
builder.AddFixedColumn(p.getPath(), type, pp.getNullable(), pp.getLength()); builder.addFixedColumn(p.getPath(), type, pp.getNullable(), pp.getLength());
break; break;
case Variable: case Variable:
if (LayoutCodeTraits.ClearImmutableBit(scope) != LayoutCode.SCHEMA) { if (LayoutCodeTraits.ClearImmutableBit(scope) != LayoutCode.SCHEMA) {
@@ -122,7 +122,7 @@ public final class LayoutCompiler {
"supported."); "supported.");
} }
builder.AddVariableColumn(p.getPath(), type, pp.getLength()); builder.addVariableColumn(p.getPath(), type, pp.getLength());
break; break;
case Sparse: case Sparse:
if (!pp.getNullable()) { if (!pp.getNullable()) {
@@ -130,7 +130,7 @@ public final class LayoutCompiler {
"supported."); "supported.");
} }
builder.AddSparseColumn(p.getPath(), type); builder.addSparseColumn(p.getPath(), type);
break; break;
default: default:
throw new LayoutCompilationException(String.format("Unknown storage specification: " + throw new LayoutCompilationException(String.format("Unknown storage specification: " +

View File

@@ -30,7 +30,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result ReadFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
Out<LocalDateTime> value) { Out<LocalDateTime> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), col.getNullBit().clone())) {
value.setAndGet(LocalDateTime.MIN); value.setAndGet(LocalDateTime.MIN);
return Result.NotFound; return Result.NotFound;
} }
@@ -80,7 +80,7 @@ public final class LayoutDateTime extends LayoutType<DateTime> {
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, DateTime value) { public Result writeSparse(RowBuffer b, RowCursor edit, DateTime value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
@@ -28,20 +27,20 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<BigDecimal> value) { Out<BigDecimal> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(new BigDecimal(0)); value.setAndGet(new BigDecimal(0));
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadDecimal(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadDecimal(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<BigDecimal> value) { Out<BigDecimal> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -54,15 +53,15 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
BigDecimal value) { BigDecimal value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().WriteDecimal(scope.get().start() + col.getOffset(), value); b.get().WriteDecimal(scope.get().start() + column.getOffset(), value);
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -70,7 +69,7 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, decimal value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, decimal value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, BigDecimal value, public Result writeSparse(RowBuffer b, RowCursor edit, BigDecimal value,
UpdateOptions options) { UpdateOptions options) {
Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -82,8 +81,8 @@ public final class LayoutDecimal extends LayoutType<BigDecimal> {
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result writeSparse(RowBuffer b, RowCursor edit,
java.math.BigDecimal value) { BigDecimal value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.Float128;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
@@ -26,20 +25,20 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Float128> value) { Out<Float128> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadFloat128(scope.get().start() + col.getOffset()).clone()); value.setAndGet(b.get().ReadFloat128(scope.get().start() + column.getOffset()).clone());
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Float128> value) { Out<Float128> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -52,15 +51,15 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Float128 value) { Float128 value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().writeFloat128(scope.get().start() + col.getOffset(), value); b.get().writeFloat128(scope.get().start() + column.getOffset(), value);
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -68,7 +67,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Float128 value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Float128 value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Float128 value, public Result writeSparse(RowBuffer b, RowCursor edit, Float128 value,
UpdateOptions options) { UpdateOptions options) {
Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -80,7 +79,7 @@ public final class LayoutFloat128 extends LayoutType<com.azure.data.cosmos.seria
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Float128 value) { public Result writeSparse(RowBuffer b, RowCursor edit, Float128 value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -25,20 +25,20 @@ public final class LayoutFloat32 extends LayoutType<Float> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Float> value) { Out<Float> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadFloat32(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadFloat32(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Float> value) { Out<Float> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -25,20 +25,20 @@ public final class LayoutFloat64 extends LayoutType<Double> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Double> value) { Out<Double> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadFloat64(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadFloat64(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Double> value) { Out<Double> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
@@ -27,20 +26,20 @@ public final class LayoutGuid extends LayoutType<UUID> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<UUID> value) { Out<UUID> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadGuid(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadGuid(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<UUID> value) { Out<UUID> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -53,15 +52,15 @@ public final class LayoutGuid extends LayoutType<UUID> {
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
UUID value) { UUID value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().WriteGuid(scope.get().start() + col.getOffset(), value); b.get().WriteGuid(scope.get().start() + column.getOffset(), value);
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -69,7 +68,7 @@ public final class LayoutGuid extends LayoutType<UUID> {
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Guid value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Guid value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UUID value, public Result writeSparse(RowBuffer b, RowCursor edit, UUID value,
UpdateOptions options) { UpdateOptions options) {
Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -81,8 +80,8 @@ public final class LayoutGuid extends LayoutType<UUID> {
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result writeSparse(RowBuffer b, RowCursor edit,
java.util.UUID value) { UUID value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -14,10 +14,6 @@ public abstract class LayoutIndexedScope extends LayoutScope {
LayoutCode code, boolean immutable, boolean isSizedScope, boolean isFixedArity, boolean isUniqueScope, LayoutCode code, boolean immutable, boolean isSizedScope, boolean isFixedArity, boolean isUniqueScope,
boolean isTypedScope boolean isTypedScope
) { ) {
// TODO: C# TO JAVA CONVERTER: C# to Java Converter could not resolve the named parameters in the
// following line:
//ORIGINAL LINE: base(code, immutable, isSizedScope, isIndexedScope: true, isFixedArity: isFixedArity,
// isUniqueScope: isUniqueScope, isTypedScope: isTypedScope);
super(code, immutable, isSizedScope, true, isFixedArity, isUniqueScope, isTypedScope); super(code, immutable, isSizedScope, true, isFixedArity, isUniqueScope, isTypedScope);
} }

View File

@@ -25,20 +25,20 @@ public final class LayoutInt16 extends LayoutType<Short> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Short> value) { Out<Short> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadInt16(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadInt16(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Short> value) { Out<Short> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -25,20 +25,20 @@ public final class LayoutInt32 extends LayoutType<Integer> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Integer> value) { Out<Integer> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadInt32(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadInt32(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Integer> value) { Out<Integer> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -25,20 +25,20 @@ public final class LayoutInt64 extends LayoutType<Long> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Long> value) { Out<Long> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadInt64(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadInt64(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Long> value) { Out<Long> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -25,20 +25,20 @@ public final class LayoutInt8 extends LayoutType<Byte> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Byte> value) { Out<Byte> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadInt8(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadInt8(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Byte> value) { Out<Byte> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
@@ -26,20 +25,20 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<MongoDbObjectId> value) { Out<MongoDbObjectId> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadMongoDbObjectId(scope.get().start() + col.getOffset()).clone()); value.setAndGet(b.get().ReadMongoDbObjectId(scope.get().start() + column.getOffset()).clone());
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<MongoDbObjectId> value) { Out<MongoDbObjectId> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -52,15 +51,15 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
MongoDbObjectId value) { MongoDbObjectId value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().WriteMongoDbObjectId(scope.get().start() + col.getOffset(), value.clone()); b.get().WriteMongoDbObjectId(scope.get().start() + column.getOffset(), value.clone());
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -68,7 +67,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, MongoDbObjectId value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, MongoDbObjectId value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result writeSparse(RowBuffer b, RowCursor edit,
MongoDbObjectId value, UpdateOptions options) { MongoDbObjectId value, UpdateOptions options) {
Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -80,7 +79,7 @@ public final class LayoutMongoDbObjectId extends LayoutType<MongoDbObjectId> {
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result writeSparse(RowBuffer b, RowCursor edit,
MongoDbObjectId value) { MongoDbObjectId value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.NullValue;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
@@ -30,11 +29,11 @@ public final class LayoutNull extends LayoutType<NullValue> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<NullValue> value) { Out<NullValue> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
value.setAndGet(NullValue.Default); value.setAndGet(NullValue.Default);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
return Result.NotFound; return Result.NotFound;
} }
@@ -42,7 +41,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<NullValue> value) { Out<NullValue> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -55,14 +54,14 @@ public final class LayoutNull extends LayoutType<NullValue> {
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
NullValue value) { NullValue value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -70,7 +69,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, NullValue value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, NullValue value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, NullValue value, public Result writeSparse(RowBuffer b, RowCursor edit, NullValue value,
UpdateOptions options) { UpdateOptions options) {
Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -82,7 +81,7 @@ public final class LayoutNull extends LayoutType<NullValue> {
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, NullValue value) { public Result writeSparse(RowBuffer b, RowCursor edit, NullValue value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -95,7 +95,7 @@ public final class LayoutNullable extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkState(value.count() == 1); checkState(value.count() == 1);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes,
value.get(0).typeArgs().clone()); value.get(0).typeArgs().clone());

View File

@@ -71,15 +71,15 @@ public abstract class LayoutScope extends LayoutType {
return this.isUniqueScope; return this.isUniqueScope;
} }
public final Result DeleteScope(Reference<RowBuffer> b, Reference<RowCursor> edit) { public final Result deleteScope(@Nonnull final RowBuffer b, @Nonnull final RowCursor edit) {
Result result = LayoutType.prepareSparseDelete(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseDelete(b, edit, this.layoutCode());
if (result != Result.Success) { if (result != Result.Success) {
return result; return result;
} }
b.get().deleteSparse(edit); b.deleteSparse(edit);
return Result.Success; return Result.Success;
} }
@@ -161,7 +161,7 @@ public abstract class LayoutScope extends LayoutType {
r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success; r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success;
childScope = tempReference_childScope.get(); childScope = tempReference_childScope.get();
if (r != Result.Success) { if (r != Result.Success) {
this.DeleteScope(b, scope); this.deleteScope(b, scope);
return r; return r;
} }

View File

@@ -73,7 +73,7 @@ public final class LayoutTagged extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkArgument(value.count() == 2); checkArgument(value.count() == 2);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
lenInBytes += value.get(1).type().writeTypeArgument(row, offset + lenInBytes, lenInBytes += value.get(1).type().writeTypeArgument(row, offset + lenInBytes,
value.get(1).typeArgs().clone()); value.get(1).typeArgs().clone());

View File

@@ -86,7 +86,7 @@ public final class LayoutTagged2 extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkState(value.count() == 3); checkState(value.count() == 3);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
for (int i = 1; i < value.count(); i++) { for (int i = 1; i < value.count(); i++) {
TypeArgument arg = value.get(i).clone(); TypeArgument arg = value.get(i).clone();

View File

@@ -73,7 +73,7 @@ public final class LayoutTuple extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count); //ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count);

View File

@@ -9,6 +9,8 @@ import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
import javax.annotation.Nonnull;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Strings.lenientFormat; import static com.google.common.base.Strings.lenientFormat;
@@ -92,20 +94,20 @@ public abstract class LayoutType<T> implements ILayoutType {
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
} }
public final Result deleteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col) { public final Result deleteFixed(RowBuffer b, RowCursor scope, LayoutColumn column) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
if (col.getNullBit().getIsInvalid()) { if (column.nullBit().isInvalid()) {
// Cannot delete a non-nullable fixed column. // Cannot delete a non-nullable fixed column.
return Result.TypeMismatch; return Result.TypeMismatch;
} }
b.get().UnsetBit(scope.get().start(), col.getNullBit().clone()); b.UnsetBit(scope.start(), column.nullBit());
return Result.Success; return Result.Success;
} }
@@ -114,8 +116,10 @@ public abstract class LayoutType<T> implements ILayoutType {
* <p> * <p>
* If a value exists, then it is removed. The remainder of the row is resized to accomodate * If a value exists, then it is removed. The remainder of the row is resized to accomodate
* a decrease in required space. If no value exists this operation is a no-op. * a decrease in required space. If no value exists this operation is a no-op.
* @param b
* @param edit
*/ */
public final Result deleteSparse(Reference<RowBuffer> b, Reference<RowCursor> edit) { public final Result deleteSparse(RowBuffer b, RowCursor edit) {
Result result = LayoutType.prepareSparseDelete(b, edit, this.layoutCode()); Result result = LayoutType.prepareSparseDelete(b, edit, this.layoutCode());
@@ -123,7 +127,7 @@ public abstract class LayoutType<T> implements ILayoutType {
return result; return result;
} }
b.get().deleteSparse(edit); b.deleteSparse(edit);
return Result.Success; return Result.Success;
} }
@@ -133,21 +137,20 @@ public abstract class LayoutType<T> implements ILayoutType {
* If a value exists, then it is removed. The remainder of the row is resized to accommodate a decrease in * If a value exists, then it is removed. The remainder of the row is resized to accommodate a decrease in
* required space. If no value exists this operation is a no-op. * required space. If no value exists this operation is a no-op.
*/ */
public final Result deleteVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col) { public final Result deleteVariable(RowBuffer b, RowCursor scope, LayoutColumn column) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit()); boolean exists = b.readBit(scope.start(), column.nullBit());
if (exists) { if (exists) {
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.computeVariableValueOffset(scope.layout(), scope.start(), column.offset());
col.getOffset()); b.deleteVariable(varOffset, this.isVarint());
b.get().deleteVariable(varOffset, this.isVarint()); b.UnsetBit(scope.start(), column.nullBit());
b.get().UnsetBit(scope.get().start(), col.getNullBit().clone());
} }
return Result.Success; return Result.Success;
@@ -159,8 +162,8 @@ public abstract class LayoutType<T> implements ILayoutType {
return type; return type;
} }
public final Result hasValue(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col) { public final Result hasValue(RowBuffer b, RowCursor scope, LayoutColumn column) {
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.readBit(scope.start(), column.nullBit())) {
return Result.NotFound; return Result.NotFound;
} }
return Result.Success; return Result.Success;
@@ -186,16 +189,17 @@ public abstract class LayoutType<T> implements ILayoutType {
* @param code The expected type of the field. * @param code The expected type of the field.
* @return Success if the delete is permitted, the error code otherwise. * @return Success if the delete is permitted, the error code otherwise.
*/ */
public static Result prepareSparseDelete(Reference<RowBuffer> b, Reference<RowCursor> edit, LayoutCode code) { public static Result prepareSparseDelete(RowBuffer b, RowCursor edit, LayoutCode code) {
if (edit.get().scopeType().isFixedArity()) {
if (edit.scopeType().isFixedArity()) {
return Result.TypeConstraint; return Result.TypeConstraint;
} }
if (edit.get().immutable()) { if (edit.immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
if (edit.get().exists() && LayoutCodeTraits.Canonicalize(edit.get().cellType().layoutCode()) != code) { if (edit.exists() && LayoutCodeTraits.Canonicalize(edit.cellType().layoutCode()) != code) {
return Result.TypeMismatch; return Result.TypeMismatch;
} }
@@ -216,16 +220,16 @@ public abstract class LayoutType<T> implements ILayoutType {
* The source field is delete if the move prepare fails with a destination error. * The source field is delete if the move prepare fails with a destination error.
*/ */
public static Result prepareSparseMove( public static Result prepareSparseMove(
Reference<RowBuffer> b, RowBuffer b,
Reference<RowCursor> destinationScope, RowCursor destinationScope,
LayoutScope destinationCode, LayoutScope destinationCode,
TypeArgument elementType, TypeArgument elementType,
Reference<RowCursor> srcEdit, RowCursor srcEdit,
UpdateOptions options, UpdateOptions options,
Out<RowCursor> dstEdit Out<RowCursor> dstEdit
) { ) {
checkArgument(destinationScope.get().scopeType() == destinationCode); checkArgument(destinationScope.scopeType() == destinationCode);
checkArgument(destinationScope.get().index() == 0, "Can only insert into a edit at the root"); checkArgument(destinationScope.index() == 0, "Can only insert into a edit at the root");
// Prepare the delete of the source // Prepare the delete of the source
Result result = LayoutType.prepareSparseDelete(b, srcEdit, elementType.type().layoutCode()); Result result = LayoutType.prepareSparseDelete(b, srcEdit, elementType.type().layoutCode());
@@ -235,39 +239,39 @@ public abstract class LayoutType<T> implements ILayoutType {
return result; return result;
} }
if (!srcEdit.get().exists()) { if (!srcEdit.exists()) {
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
if (destinationScope.get().immutable()) { if (destinationScope.immutable()) {
b.get().deleteSparse(srcEdit); b.deleteSparse(srcEdit);
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
if (!srcEdit.get().cellTypeArgs().equals(elementType.typeArgs())) { if (!srcEdit.cellTypeArgs().equals(elementType.typeArgs())) {
b.get().deleteSparse(srcEdit); b.deleteSparse(srcEdit);
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.TypeConstraint; return Result.TypeConstraint;
} }
if (options == UpdateOptions.InsertAt) { if (options == UpdateOptions.InsertAt) {
b.get().deleteSparse(srcEdit); b.deleteSparse(srcEdit);
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.TypeConstraint; return Result.TypeConstraint;
} }
// Prepare the insertion at the destination. // Prepare the insertion at the destination.
dstEdit.setAndGet(b.get().PrepareSparseMove(destinationScope, srcEdit)); dstEdit.setAndGet(b.prepareSparseMove(destinationScope, srcEdit));
if ((options == UpdateOptions.Update) && (!dstEdit.get().exists())) { if ((options == UpdateOptions.Update) && (!dstEdit.get().exists())) {
b.get().deleteSparse(srcEdit); b.deleteSparse(srcEdit);
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
if ((options == UpdateOptions.Insert) && dstEdit.get().exists()) { if ((options == UpdateOptions.Insert) && dstEdit.get().exists()) {
b.get().deleteSparse(srcEdit); b.deleteSparse(srcEdit);
dstEdit.setAndGet(null); dstEdit.setAndGet(null);
return Result.Exists; return Result.Exists;
} }
@@ -306,8 +310,9 @@ public abstract class LayoutType<T> implements ILayoutType {
* @return Success if the write is permitted, the error code otherwise. * @return Success if the write is permitted, the error code otherwise.
*/ */
public static Result prepareSparseWrite( public static Result prepareSparseWrite(
RowBuffer b, RowCursor edit, TypeArgument typeArg, UpdateOptions options @Nonnull final RowBuffer b, @Nonnull final RowCursor edit, @Nonnull final TypeArgument typeArg,
) { @Nonnull final UpdateOptions options) {
if (edit.immutable() || (edit.scopeType().isUniqueScope() && !edit.deferUniqueIndex())) { if (edit.immutable() || (edit.scopeType().isUniqueScope() && !edit.deferUniqueIndex())) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
@@ -343,12 +348,12 @@ public abstract class LayoutType<T> implements ILayoutType {
return Result.Success; return Result.Success;
} }
public abstract Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<T> value); public abstract Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out<T> value);
public abstract Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<T> value); public abstract Result readSparse(RowBuffer b, RowCursor edit, Out<T> value);
public static TypeArgument readTypeArgument(Reference<RowBuffer> row, int offset, Out<Integer> lenInBytes) { public static TypeArgument readTypeArgument(RowBuffer row, int offset, Out<Integer> lenInBytes) {
LayoutType itemCode = row.get().ReadSparseTypeCode(offset); LayoutType itemCode = row.readSparseTypeCode(offset);
int argsLenInBytes; int argsLenInBytes;
Out<Integer> tempOut_argsLenInBytes = new Out<Integer>(); Out<Integer> tempOut_argsLenInBytes = new Out<Integer>();
TypeArgumentList itemTypeArgs = itemCode.readTypeArgumentList(row, offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), tempOut_argsLenInBytes); TypeArgumentList itemTypeArgs = itemCode.readTypeArgumentList(row, offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), tempOut_argsLenInBytes);
@@ -357,12 +362,12 @@ public abstract class LayoutType<T> implements ILayoutType {
return new TypeArgument(itemCode, itemTypeArgs); return new TypeArgument(itemCode, itemTypeArgs);
} }
public TypeArgumentList readTypeArgumentList(Reference<RowBuffer> row, int offset, Out<Integer> lenInBytes) { public TypeArgumentList readTypeArgumentList(RowBuffer row, int offset, Out<Integer> lenInBytes) {
lenInBytes.setAndGet(0); lenInBytes.setAndGet(0);
return TypeArgumentList.EMPTY; return TypeArgumentList.EMPTY;
} }
public Result readVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<T> value) { public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out<T> value) {
value.setAndGet(null); value.setAndGet(null);
return Result.Failure; return Result.Failure;
} }
@@ -382,15 +387,15 @@ public abstract class LayoutType<T> implements ILayoutType {
return (Value)this; return (Value)this;
} }
public abstract Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, T value); public abstract Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, T value);
public abstract Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, T value); public abstract Result writeSparse(RowBuffer b, RowCursor edit, T value);
public abstract Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, T value, UpdateOptions options); public abstract Result writeSparse(RowBuffer b, RowCursor edit, T value, UpdateOptions options);
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(RowBuffer row, int offset, TypeArgumentList value) {
row.get().WriteSparseTypeCode(offset, this.layoutCode()); row.writeSparseTypeCode(offset, this.layoutCode());
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); return com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE;
} }
public Result writeVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, T value) { public Result writeVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, T value) {

View File

@@ -68,7 +68,7 @@ public final class LayoutTypedArray extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkState(value.count() == 1); checkState(value.count() == 1);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes,
value.get(0).typeArgs().clone()); value.get(0).typeArgs().clone());

View File

@@ -89,7 +89,7 @@ public final class LayoutTypedMap extends LayoutUniqueScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkState(value.count() == 2); checkState(value.count() == 2);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
for (TypeArgument arg : value) { for (TypeArgument arg : value) {
lenInBytes += arg.type().writeTypeArgument(row, offset + lenInBytes, arg.typeArgs().clone()); lenInBytes += arg.type().writeTypeArgument(row, offset + lenInBytes, arg.typeArgs().clone());

View File

@@ -75,7 +75,7 @@ public final class LayoutTypedSet extends LayoutUniqueScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
checkArgument(value.count() == 1); checkArgument(value.count() == 1);
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes,
value.get(0).typeArgs().clone()); value.get(0).typeArgs().clone());

View File

@@ -86,7 +86,7 @@ public final class LayoutTypedTuple extends LayoutIndexedScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE);
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count); //ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count);

View File

@@ -57,7 +57,7 @@ public final class LayoutUDT extends LayoutPropertyScope {
@Override @Override
public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) { public int writeTypeArgument(Reference<RowBuffer> row, int offset, TypeArgumentList value) {
row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().writeSparseTypeCode(offset, this.LayoutCode);
row.get().WriteSchemaId(offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), value.schemaId().clone()); row.get().WriteSchemaId(offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), value.schemaId().clone());
return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + SchemaId.SIZE; return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + SchemaId.SIZE;
} }

View File

@@ -30,22 +30,22 @@ public final class LayoutUInt16 extends LayoutType<Short> {
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// ushort value) // ushort value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Short> value) { Out<Short> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadUInt16(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadUInt16(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ushort value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ushort value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Short> value) { Out<Short> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -30,22 +30,22 @@ public final class LayoutUInt32 extends LayoutType<Integer> {
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// uint value) // uint value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Integer> value) { Out<Integer> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadUInt32(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadUInt32(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out uint value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out uint value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Integer> value) { Out<Integer> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -30,22 +30,22 @@ public final class LayoutUInt64 extends LayoutType<Long> {
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// ulong value) // ulong value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Long> value) { Out<Long> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadUInt64(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadUInt64(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Long> value) { Out<Long> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -30,22 +30,22 @@ public final class LayoutUInt8 extends LayoutType<Byte> {
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// byte value) // byte value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Byte> value) { Out<Byte> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadUInt8(scope.get().start() + col.getOffset())); value.setAndGet(b.get().ReadUInt8(scope.get().start() + column.getOffset()));
return Result.Success; return Result.Success;
} }
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out byte value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<Byte> value) { Out<Byte> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {

View File

@@ -123,7 +123,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success; r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success;
childScope = tempReference_childScope.get(); childScope = tempReference_childScope.get();
if (r != Result.Success) { if (r != Result.Success) {
this.DeleteScope(b, scope); this.deleteScope(b, scope);
return r; return r;
} }
@@ -133,7 +133,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope {
r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope); r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope);
uniqueScope = tempReference_uniqueScope.get(); uniqueScope = tempReference_uniqueScope.get();
if (r != Result.Success) { if (r != Result.Success) {
this.DeleteScope(b, scope); this.deleteScope(b, scope);
return r; return r;
} }

View File

@@ -4,7 +4,6 @@
package com.azure.data.cosmos.serialization.hybridrow.layouts; package com.azure.data.cosmos.serialization.hybridrow.layouts;
import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.core.Out;
import com.azure.data.cosmos.core.Reference;
import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.Result;
import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer;
import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.RowCursor;
@@ -27,20 +26,20 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<UnixDateTime> value) { Out<UnixDateTime> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
value.setAndGet(b.get().ReadUnixDateTime(scope.get().start() + col.getOffset()).clone()); value.setAndGet(b.get().ReadUnixDateTime(scope.get().start() + column.getOffset()).clone());
return Result.Success; return Result.Success;
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<UnixDateTime> value) { Out<UnixDateTime> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
@@ -53,15 +52,15 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
UnixDateTime value) { UnixDateTime value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (scope.get().immutable()) { if (scope.get().immutable()) {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
b.get().WriteUnixDateTime(scope.get().start() + col.getOffset(), value.clone()); b.get().WriteUnixDateTime(scope.get().start() + column.getOffset(), value.clone());
b.get().SetBit(scope.get().start(), col.getNullBit().clone()); b.get().SetBit(scope.get().start(), column.getNullBit().clone());
return Result.Success; return Result.Success;
} }
@@ -69,7 +68,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, UnixDateTime value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, UnixDateTime value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UnixDateTime value public Result writeSparse(RowBuffer b, RowCursor edit, UnixDateTime value
, UpdateOptions options) { , UpdateOptions options) {
Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options);
if (result != Result.Success) { if (result != Result.Success) {
@@ -81,7 +80,7 @@ public final class LayoutUnixDateTime extends LayoutType<com.azure.data.cosmos.s
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, UnixDateTime value) { public Result writeSparse(RowBuffer b, RowCursor edit, UnixDateTime value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
} }

View File

@@ -25,12 +25,12 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<String> value) { Out<String> value) {
Utf8Span span; Utf8Span span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
Result r = this.ReadFixed(b, scope, col, out span); Result r = this.ReadFixed(b, scope, column, out span);
value.setAndGet((r == Result.Success) ? span.toString() :) value.setAndGet((r == Result.Success) ? span.toString() :)
default default
return r; return r;
@@ -40,7 +40,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
Out<Utf8Span> value) { Out<Utf8Span> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
checkArgument(col.getSize() >= 0); checkArgument(col.getSize() >= 0);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), col.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
@@ -50,7 +50,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, public Result readSparse(RowBuffer b, RowCursor edit,
Out<String> value) { Out<String> value) {
Utf8Span span; Utf8Span span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
@@ -73,12 +73,12 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
} }
@Override @Override
public Result readVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column
, Out<String> value) { , Out<String> value) {
Utf8Span span; Utf8Span span;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
Result r = this.ReadVariable(b, scope, col, out span); Result r = this.ReadVariable(b, scope, column, out span);
value.setAndGet((r == Result.Success) ? span.toString() :) value.setAndGet((r == Result.Success) ? span.toString() :)
default default
return r; return r;
@@ -87,7 +87,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col public Result ReadVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col
, Out<Utf8Span> value) { , Out<Utf8Span> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), col.getNullBit().clone())) {
value.setAndGet(null); value.setAndGet(null);
return Result.NotFound; return Result.NotFound;
} }
@@ -99,10 +99,10 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
} }
@Override @Override
public Result writeFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
String value) { String value) {
checkArgument(value != null); checkArgument(value != null);
return this.WriteFixed(b, scope, col, Utf8Span.TranscodeUtf16(value)); return this.WriteFixed(b, scope, column, Utf8Span.TranscodeUtf16(value));
} }
public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result WriteFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col,
@@ -120,7 +120,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
} }
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, String value) { public Result writeSparse(RowBuffer b, RowCursor edit, String value) {
return writeSparse(b, edit, value, UpdateOptions.Upsert); return writeSparse(b, edit, value, UpdateOptions.Upsert);
} }
@@ -128,7 +128,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
//ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, string value, //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, string value,
// UpdateOptions options = UpdateOptions.Upsert) // UpdateOptions options = UpdateOptions.Upsert)
@Override @Override
public Result writeSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, String value, public Result writeSparse(RowBuffer b, RowCursor edit, String value,
UpdateOptions options) { UpdateOptions options) {
checkArgument(value != null); checkArgument(value != null);
return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options); return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options);
@@ -172,7 +172,7 @@ public final class LayoutUtf8 extends LayoutType<String> implements ILayoutUtf8S
return Result.TooBig; return Result.TooBig;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit().clone()); boolean exists = b.get().readBit(scope.get().start(), col.getNullBit().clone());
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); col.getOffset());
int shift; int shift;

View File

@@ -29,7 +29,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
} }
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Long> value) { Out<Long> value) {
Contract.Fail("Not Implemented"); Contract.Fail("Not Implemented");
value.setAndGet(0); value.setAndGet(0);
@@ -37,7 +37,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
} }
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<Long> value) { public Result readSparse(RowBuffer b, RowCursor edit, Out<Long> value) {
Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
value.setAndGet(0); value.setAndGet(0);
@@ -49,15 +49,15 @@ public final class LayoutVarInt extends LayoutType<Long> {
} }
@Override @Override
public Result readVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Long> value) { public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out<Long> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); column.getOffset());
value.setAndGet(b.get().ReadVariableInt(varOffset)); value.setAndGet(b.get().ReadVariableInt(varOffset));
return Result.Success; return Result.Success;
} }
@@ -97,7 +97,7 @@ public final class LayoutVarInt extends LayoutType<Long> {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit().clone()); boolean exists = b.get().readBit(scope.get().start(), col.getNullBit().clone());
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); col.getOffset());
int shift; int shift;

View File

@@ -34,7 +34,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
//ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// ulong value) // ulong value)
@Override @Override
public Result readFixed(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column,
Out<Long> value) { Out<Long> value) {
Contract.Fail("Not Implemented"); Contract.Fail("Not Implemented");
value.setAndGet(0); value.setAndGet(0);
@@ -44,7 +44,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value) //ORIGINAL LINE: public override Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ulong value)
@Override @Override
public Result readSparse(Reference<RowBuffer> b, Reference<RowCursor> edit, Out<Long> value) { public Result readSparse(RowBuffer b, RowCursor edit, Out<Long> value) {
Result result = prepareSparseRead(b, edit, this.LayoutCode); Result result = prepareSparseRead(b, edit, this.LayoutCode);
if (result != Result.Success) { if (result != Result.Success) {
value.setAndGet(0); value.setAndGet(0);
@@ -59,15 +59,15 @@ public final class LayoutVarUInt extends LayoutType<Long> {
//ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out //ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out
// ulong value) // ulong value)
@Override @Override
public Result readVariable(Reference<RowBuffer> b, Reference<RowCursor> scope, LayoutColumn col, Out<Long> value) { public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out<Long> value) {
checkArgument(scope.get().scopeType() instanceof LayoutUDT); checkArgument(scope.get().scopeType() instanceof LayoutUDT);
if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { if (!b.get().readBit(scope.get().start(), column.getNullBit().clone())) {
value.setAndGet(0); value.setAndGet(0);
return Result.NotFound; return Result.NotFound;
} }
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); column.getOffset());
value.setAndGet(b.get().ReadVariableUInt(varOffset)); value.setAndGet(b.get().ReadVariableUInt(varOffset));
return Result.Success; return Result.Success;
} }
@@ -114,7 +114,7 @@ public final class LayoutVarUInt extends LayoutType<Long> {
return Result.InsufficientPermissions; return Result.InsufficientPermissions;
} }
boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit().clone()); boolean exists = b.get().readBit(scope.get().start(), col.getNullBit().clone());
int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(),
col.getOffset()); col.getOffset());
int shift; int shift;

View File

@@ -60,7 +60,7 @@ public final class BsonRowGenerator implements Closeable {
public void WriteBuffer(HashMap<Utf8String, Object> dict) { public void WriteBuffer(HashMap<Utf8String, Object> dict) {
this.writer.writeStartDocument(); this.writer.writeStartDocument();
for (LayoutColumn c : this.layout.columns()) { for (LayoutColumn c : this.layout.columns()) {
this.LayoutCodeSwitch(c.getPath(), c.getTypeArg().clone(), dict.get(c.getPath())); this.LayoutCodeSwitch(c.path(), c.typeArg().clone(), dict.get(c.path()));
} }
this.writer.writeEndDocument(); this.writer.writeEndDocument();
@@ -141,7 +141,7 @@ public final class BsonRowGenerator implements Closeable {
HashMap<Utf8String, Object> dict = (HashMap<Utf8String, Object>)value; HashMap<Utf8String, Object> dict = (HashMap<Utf8String, Object>)value;
Layout udt = this.resolver.resolve(typeArg.typeArgs().schemaId().clone()); Layout udt = this.resolver.resolve(typeArg.typeArgs().schemaId().clone());
for (LayoutColumn c : udt.columns()) { for (LayoutColumn c : udt.columns()) {
this.LayoutCodeSwitch(c.getPath(), c.getTypeArg().clone(), dict.get(c.getPath())); this.LayoutCodeSwitch(c.path(), c.typeArg().clone(), dict.get(c.path()));
} }
this.writer.WriteEndDocument(); this.writer.WriteEndDocument();

View File

@@ -154,9 +154,9 @@ public final class CodeGenRowGenerator {
layout.TryFind(AddressHybridRowSerializer.PostalCodeName, tempOut_postalCode); layout.TryFind(AddressHybridRowSerializer.PostalCodeName, tempOut_postalCode);
this.postalCode = tempOut_postalCode.get(); this.postalCode = tempOut_postalCode.get();
Out<StringToken> tempOut_postalCodeToken = new Out<StringToken>(); Out<StringToken> tempOut_postalCodeToken = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.postalCode.getPath(), tempOut_postalCodeToken); layout.getTokenizer().TryFindToken(this.postalCode.path(), tempOut_postalCodeToken);
this.postalCodeToken = tempOut_postalCodeToken.get(); this.postalCodeToken = tempOut_postalCodeToken.get();
this.postalCodeSerializer = new PostalCodeHybridRowSerializer(resolver.resolve(this.postalCode.getTypeArgs().schemaId().clone()), resolver); this.postalCodeSerializer = new PostalCodeHybridRowSerializer(resolver.resolve(this.postalCode.typeArgs().schemaId().clone()), resolver);
} }
@Override @Override
@@ -253,7 +253,7 @@ public final class CodeGenRowGenerator {
root.get().Find(row, this.postalCodeToken.clone()); root.get().Find(row, this.postalCodeToken.clone());
RowCursor childScope; RowCursor childScope;
Out<RowCursor> tempOut_childScope = new Out<RowCursor>(); Out<RowCursor> tempOut_childScope = new Out<RowCursor>();
r = LayoutType.UDT.WriteScope(row, root, this.postalCode.getTypeArgs().clone(), tempOut_childScope); r = LayoutType.UDT.WriteScope(row, root, this.postalCode.typeArgs().clone(), tempOut_childScope);
childScope = tempOut_childScope.get(); childScope = tempOut_childScope.get();
if (r != Result.Success) { if (r != Result.Success) {
@@ -338,21 +338,21 @@ public final class CodeGenRowGenerator {
layout.TryFind(GuestsHybridRowSerializer.ConfirmNumberName, tempOut_confirmNumber); layout.TryFind(GuestsHybridRowSerializer.ConfirmNumberName, tempOut_confirmNumber);
this.confirmNumber = tempOut_confirmNumber.get(); this.confirmNumber = tempOut_confirmNumber.get();
Out<StringToken> tempOut_emailsToken = new Out<StringToken>(); Out<StringToken> tempOut_emailsToken = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.emails.getPath(), tempOut_emailsToken); layout.getTokenizer().TryFindToken(this.emails.path(), tempOut_emailsToken);
this.emailsToken = tempOut_emailsToken.get(); this.emailsToken = tempOut_emailsToken.get();
Out<StringToken> tempOut_phoneNumbersToken = new Out<StringToken>(); Out<StringToken> tempOut_phoneNumbersToken = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.phoneNumbers.getPath(), tempOut_phoneNumbersToken); layout.getTokenizer().TryFindToken(this.phoneNumbers.path(), tempOut_phoneNumbersToken);
this.phoneNumbersToken = tempOut_phoneNumbersToken.get(); this.phoneNumbersToken = tempOut_phoneNumbersToken.get();
Out<StringToken> tempOut_addressesToken = new Out<StringToken>(); Out<StringToken> tempOut_addressesToken = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.addresses.getPath(), tempOut_addressesToken); layout.getTokenizer().TryFindToken(this.addresses.path(), tempOut_addressesToken);
this.addressesToken = tempOut_addressesToken.get(); this.addressesToken = tempOut_addressesToken.get();
this.addressesFieldType = this.addressesFieldType =
new TypeArgumentList(new TypeArgument[] { new TypeArgument(LayoutType.TypedTuple, new TypeArgumentList(new TypeArgument[] { new TypeArgument(LayoutType.TypedTuple,
this.addresses.getTypeArgs().clone()) }); this.addresses.typeArgs().clone()) });
this.addressSerializer = this.addressSerializer =
new AddressHybridRowSerializer(resolver.resolve(this.addresses.getTypeArgs().get(1).typeArgs().schemaId().clone()), resolver); new AddressHybridRowSerializer(resolver.resolve(this.addresses.typeArgs().get(1).typeArgs().schemaId().clone()), resolver);
this.addressSerializerWriter = (Reference<RowBuffer> b, Reference<RowCursor> scope, this.addressSerializerWriter = (Reference<RowBuffer> b, Reference<RowCursor> scope,
HashMap<Utf8String, Object> context) -> addressSerializer.WriteBuffer(b, HashMap<Utf8String, Object> context) -> addressSerializer.WriteBuffer(b,
scope, context); scope, context);
@@ -604,7 +604,7 @@ public final class CodeGenRowGenerator {
root.get().Find(row, this.emailsToken.clone()); root.get().Find(row, this.emailsToken.clone());
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref'
// keyword - these are not converted by C# to Java Converter: // keyword - these are not converted by C# to Java Converter:
r = LayoutType.TypedArray.WriteScope(row, root, this.emails.getTypeArgs().clone(), r = LayoutType.TypedArray.WriteScope(row, root, this.emails.typeArgs().clone(),
(ArrayList<Object>)value, (ref RowBuffer row2, ref RowCursor childScope, (ArrayList<Object>)value, (ref RowBuffer row2, ref RowCursor childScope,
ArrayList<Object> context) -> ArrayList<Object> context) ->
{ {
@@ -644,7 +644,7 @@ public final class CodeGenRowGenerator {
root.get().Find(row, this.phoneNumbersToken.clone()); root.get().Find(row, this.phoneNumbersToken.clone());
RowCursor childScope; RowCursor childScope;
Out<RowCursor> tempOut_childScope = new Out<RowCursor>(); Out<RowCursor> tempOut_childScope = new Out<RowCursor>();
r = LayoutType.TypedArray.WriteScope(row, root, this.phoneNumbers.getTypeArgs().clone(), r = LayoutType.TypedArray.WriteScope(row, root, this.phoneNumbers.typeArgs().clone(),
tempOut_childScope); tempOut_childScope);
childScope = tempOut_childScope.get(); childScope = tempOut_childScope.get();
if (r != Result.Success) { if (r != Result.Success) {
@@ -678,7 +678,7 @@ public final class CodeGenRowGenerator {
root.get().Find(row, this.addressesToken.clone()); root.get().Find(row, this.addressesToken.clone());
// TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref'
// keyword - these are not converted by C# to Java Converter: // keyword - these are not converted by C# to Java Converter:
r = LayoutType.TypedMap.WriteScope(row, root, this.addresses.getTypeArgs().clone(), (this r = LayoutType.TypedMap.WriteScope(row, root, this.addresses.typeArgs().clone(), (this
, (ArrayList<Object>)value), (ref , (ArrayList<Object>)value), (ref
RowBuffer row2, ref RowCursor childScope, (GuestsHybridRowSerializer RowBuffer row2, ref RowCursor childScope, (GuestsHybridRowSerializer
_this, ArrayList < Object > value)ctx) -> _this, ArrayList < Object > value)ctx) ->
@@ -792,10 +792,10 @@ public final class CodeGenRowGenerator {
layout.TryFind(HotelsHybridRowSerializer.AddressName, tempOut_address); layout.TryFind(HotelsHybridRowSerializer.AddressName, tempOut_address);
this.address = tempOut_address.get(); this.address = tempOut_address.get();
Out<StringToken> tempOut_addressToken = new Out<StringToken>(); Out<StringToken> tempOut_addressToken = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.address.getPath(), tempOut_addressToken); layout.getTokenizer().TryFindToken(this.address.path(), tempOut_addressToken);
this.addressToken = tempOut_addressToken.get(); this.addressToken = tempOut_addressToken.get();
this.addressSerializer = this.addressSerializer =
new AddressHybridRowSerializer(resolver.resolve(this.address.getTypeArgs().schemaId().clone()), new AddressHybridRowSerializer(resolver.resolve(this.address.typeArgs().schemaId().clone()),
resolver); resolver);
} }
@@ -908,7 +908,7 @@ public final class CodeGenRowGenerator {
root.get().Find(row, this.addressToken.clone()); root.get().Find(row, this.addressToken.clone());
RowCursor childScope; RowCursor childScope;
Out<RowCursor> tempOut_childScope = new Out<RowCursor>(); Out<RowCursor> tempOut_childScope = new Out<RowCursor>();
r = LayoutType.UDT.WriteScope(row, root, this.address.getTypeArgs().clone(), r = LayoutType.UDT.WriteScope(row, root, this.address.typeArgs().clone(),
tempOut_childScope); tempOut_childScope);
childScope = tempOut_childScope.get(); childScope = tempOut_childScope.get();
if (r != Result.Success) { if (r != Result.Success) {
@@ -965,7 +965,7 @@ public final class CodeGenRowGenerator {
layout.TryFind(PostalCodeHybridRowSerializer.Plus4Name, tempOut_plus4); layout.TryFind(PostalCodeHybridRowSerializer.Plus4Name, tempOut_plus4);
this.plus4 = tempOut_plus4.get(); this.plus4 = tempOut_plus4.get();
Out<StringToken> tempOut_plus4Token = new Out<StringToken>(); Out<StringToken> tempOut_plus4Token = new Out<StringToken>();
layout.getTokenizer().TryFindToken(this.plus4.getPath(), tempOut_plus4Token); layout.getTokenizer().TryFindToken(this.plus4.path(), tempOut_plus4Token);
this.plus4Token = tempOut_plus4Token.get(); this.plus4Token = tempOut_plus4Token.get();
} }

View File

@@ -59,7 +59,7 @@ public class LayoutCompilerUnitTests {
Namespace tempVar3 = new Namespace(); Namespace tempVar3 = new Namespace();
tempVar3.setSchemas(new ArrayList<Schema>(Arrays.asList(s))); tempVar3.setSchemas(new ArrayList<Schema>(Arrays.asList(s)));
Layout layout = s.Compile(tempVar3); Layout layout = s.Compile(tempVar3);
Assert.IsTrue(layout.getSize() == LayoutBit.DivCeiling((i + 1) * 2, LayoutType.BitsPerByte), "Size: {0}, " + Assert.IsTrue(layout.getSize() == LayoutBit.divCeiling((i + 1) * 2, LayoutType.BitsPerByte), "Size: {0}, " +
"i: {1}", layout.getSize(), i); "i: {1}", layout.getSize(), i);
} }
} }
@@ -1606,9 +1606,9 @@ private final static class RoundTripFixed extends TestActionDispatcher<RoundTrip
TValue value; TValue value;
System.out.printf("%1$s" + "\r\n", expected.Json); System.out.printf("%1$s" + "\r\n", expected.Json);
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
if (LayoutBit.opNotEquals(col.getNullBit().clone(), if (LayoutBit.opNotEquals(col.getNullBit().clone(),
LayoutBit.Invalid)) { LayoutBit.INVALID)) {
Out<TValue> tempOut_value = new Out<TValue>(); Out<TValue> tempOut_value = new Out<TValue>();
r = t.ReadFixed(row, root, col, tempOut_value); r = t.ReadFixed(row, root, col, tempOut_value);
value = tempOut_value.get(); value = tempOut_value.get();
@@ -1653,7 +1653,7 @@ private final static class RoundTripFixed extends TestActionDispatcher<RoundTrip
ResultAssert.InsufficientPermissions(t.DeleteFixed(row, ref roRoot, col)); ResultAssert.InsufficientPermissions(t.DeleteFixed(row, ref roRoot, col));
if (LayoutBit.opNotEquals(col.getNullBit().clone(), if (LayoutBit.opNotEquals(col.getNullBit().clone(),
LayoutBit.Invalid)) { LayoutBit.INVALID)) {
ResultAssert.IsSuccess(t.DeleteFixed(row, root, col)); ResultAssert.IsSuccess(t.DeleteFixed(row, root, col));
} else { } else {
ResultAssert.TypeMismatch(t.DeleteFixed(row, root, col)); ResultAssert.TypeMismatch(t.DeleteFixed(row, root, col));
@@ -1706,10 +1706,10 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root, public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root,
Closure closure) { Closure closure) {
LayoutColumn arrCol = closure.ArrCol; LayoutColumn arrCol = closure.ArrCol;
LayoutType tempVar = arrCol.getType(); LayoutType tempVar = arrCol.type();
LayoutIndexedScope arrT = tempVar instanceof LayoutIndexedScope ? (LayoutIndexedScope)tempVar : null; LayoutIndexedScope arrT = tempVar instanceof LayoutIndexedScope ? (LayoutIndexedScope)tempVar : null;
Expected expected = closure.Expected.clone(); Expected expected = closure.Expected.clone();
String tag = String.format("Json: %1$s, Array: %2$s", expected.Json, arrCol.getType().getName()); String tag = String.format("Json: %1$s, Array: %2$s", expected.Json, arrCol.type().getName());
System.out.println(tag); System.out.println(tag);
Assert.IsNotNull(arrT, tag); Assert.IsNotNull(arrT, tag);
@@ -1720,7 +1720,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
RowCursor field; RowCursor field;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().Clone(out field).Find(row, arrCol.getPath()); root.get().Clone(out field).Find(row, arrCol.path());
Reference<RowCursor> tempReference_field = Reference<RowCursor> tempReference_field =
new Reference<RowCursor>(field); new Reference<RowCursor>(field);
RowCursor scope; RowCursor scope;
@@ -1736,7 +1736,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
r = arrT.WriteScope(row, ref field, arrCol.getTypeArgs().clone(), out scope); r = arrT.WriteScope(row, ref field, arrCol.typeArgs().clone(), out scope);
ResultAssert.IsSuccess(r, tag); ResultAssert.IsSuccess(r, tag);
// Verify the nested field doesn't yet appear within the new scope. // Verify the nested field doesn't yet appear within the new scope.
@@ -1843,7 +1843,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
RowCursor roRoot; RowCursor roRoot;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().AsReadOnly(out roRoot).Find(row, arrCol.getPath()); root.get().AsReadOnly(out roRoot).Find(row, arrCol.path());
Reference<RowCursor> tempReference_roRoot = Reference<RowCursor> tempReference_roRoot =
new Reference<RowCursor>(roRoot); new Reference<RowCursor>(roRoot);
ResultAssert.InsufficientPermissions(arrT.DeleteScope(row, tempReference_roRoot)); ResultAssert.InsufficientPermissions(arrT.DeleteScope(row, tempReference_roRoot));
@@ -1852,7 +1852,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.InsufficientPermissions(arrT.WriteScope(row, ref roRoot, arrCol.getTypeArgs().clone(), ResultAssert.InsufficientPermissions(arrT.WriteScope(row, ref roRoot, arrCol.typeArgs().clone(),
out scope2)); out scope2));
// Overwrite the whole scope. // Overwrite the whole scope.
@@ -1882,7 +1882,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher<Rou
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
r = arrT.WriteScope(row, ref field, arrCol.getTypeArgs().clone(), out _, UpdateOptions.Update); r = arrT.WriteScope(row, ref field, arrCol.typeArgs().clone(), out _, UpdateOptions.Update);
ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json);
Reference<RowCursor> tempReference_field6 = Reference<RowCursor> tempReference_field6 =
new Reference<RowCursor>(field); new Reference<RowCursor>(field);
@@ -1942,22 +1942,22 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root, public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root,
Closure closure) { Closure closure) {
LayoutColumn objCol = closure.ObjCol; LayoutColumn objCol = closure.ObjCol;
LayoutType tempVar = objCol.getType(); LayoutType tempVar = objCol.type();
LayoutObject objT = tempVar instanceof LayoutObject ? (LayoutObject)tempVar : null; LayoutObject objT = tempVar instanceof LayoutObject ? (LayoutObject)tempVar : null;
LayoutColumn col = closure.Col; LayoutColumn col = closure.Col;
Expected expected = closure.Expected.clone(); Expected expected = closure.Expected.clone();
System.out.printf("%1$s" + "\r\n", col.getType().getName()); System.out.printf("%1$s" + "\r\n", col.type().getName());
Assert.IsNotNull(objT, "Json: {0}", expected.Json); Assert.IsNotNull(objT, "Json: {0}", expected.Json);
Assert.AreEqual(objCol, col.getParent(), "Json: {0}", expected.Json); Assert.AreEqual(objCol, col.parent(), "Json: {0}", expected.Json);
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
// Attempt to read the object and the nested column. // Attempt to read the object and the nested column.
RowCursor field; RowCursor field;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().Clone(out field).Find(row, objCol.getPath()); root.get().Clone(out field).Find(row, objCol.path());
Reference<RowCursor> tempReference_field = Reference<RowCursor> tempReference_field =
new Reference<RowCursor>(field); new Reference<RowCursor>(field);
RowCursor scope; RowCursor scope;
@@ -1973,7 +1973,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
new Reference<RowCursor>(field); new Reference<RowCursor>(field);
Out<RowCursor> tempOut_scope2 = Out<RowCursor> tempOut_scope2 =
new Out<RowCursor>(); new Out<RowCursor>();
r = objT.WriteScope(row, tempReference_field2, objCol.getTypeArgs().clone(), tempOut_scope2); r = objT.WriteScope(row, tempReference_field2, objCol.typeArgs().clone(), tempOut_scope2);
scope = tempOut_scope2.get(); scope = tempOut_scope2.get();
field = tempReference_field2.get(); field = tempReference_field2.get();
ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json);
@@ -1982,7 +1982,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
RowCursor nestedField; RowCursor nestedField;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope.Clone(out nestedField).Find(row, col.getPath()); scope.Clone(out nestedField).Find(row, col.path());
TValue value; TValue value;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
@@ -2014,7 +2014,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
// Read the nested field // Read the nested field
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope2.Clone(out nestedField).Find(row, col.getPath()); scope2.Clone(out nestedField).Find(row, col.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
@@ -2032,7 +2032,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
RowCursor roRoot; RowCursor roRoot;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().AsReadOnly(out roRoot).Find(row, objCol.getPath()); root.get().AsReadOnly(out roRoot).Find(row, objCol.path());
Reference<RowCursor> tempReference_roRoot = Reference<RowCursor> tempReference_roRoot =
new Reference<RowCursor>(roRoot); new Reference<RowCursor>(roRoot);
ResultAssert.InsufficientPermissions(objT.DeleteScope(row, tempReference_roRoot)); ResultAssert.InsufficientPermissions(objT.DeleteScope(row, tempReference_roRoot));
@@ -2041,7 +2041,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
new Reference<RowCursor>(roRoot); new Reference<RowCursor>(roRoot);
Out<RowCursor> tempOut_scope22 = Out<RowCursor> tempOut_scope22 =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempReference_roRoot2, objCol.getTypeArgs().clone(), ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempReference_roRoot2, objCol.typeArgs().clone(),
tempOut_scope22)); tempOut_scope22));
scope2 = tempOut_scope22.get(); scope2 = tempOut_scope22.get();
roRoot = tempReference_roRoot2.get(); roRoot = tempReference_roRoot2.get();
@@ -2073,7 +2073,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher<Ro
RowCursor _; RowCursor _;
Out<RowCursor> tempOut__2 = Out<RowCursor> tempOut__2 =
new Out<RowCursor>(); new Out<RowCursor>();
r = objT.WriteScope(row, tempReference_field7, objCol.getTypeArgs().clone(), tempOut__2, UpdateOptions.Update); r = objT.WriteScope(row, tempReference_field7, objCol.typeArgs().clone(), tempOut__2, UpdateOptions.Update);
_ = tempOut__2.get(); _ = tempOut__2.get();
field = tempReference_field7.get(); field = tempReference_field7.get();
ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json);
@@ -2141,13 +2141,13 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch
System.out.println(tag); System.out.println(tag);
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
// Verify the nested field doesn't yet appear within the new scope. // Verify the nested field doesn't yet appear within the new scope.
RowCursor nestedField; RowCursor nestedField;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope.get().Clone(out nestedField).Find(row, col.getPath()); scope.get().Clone(out nestedField).Find(row, col.path());
TValue value; TValue value;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
@@ -2211,13 +2211,13 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch
System.out.println(tag); System.out.println(tag);
LayoutObject t = (LayoutObject)col.getType(); LayoutObject t = (LayoutObject)col.type();
// Verify the nested field doesn't yet appear within the new scope. // Verify the nested field doesn't yet appear within the new scope.
RowCursor nestedField; RowCursor nestedField;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope.get().Clone(out nestedField).Find(row, col.getPath()); scope.get().Clone(out nestedField).Find(row, col.path());
Reference<RowCursor> tempReference_nestedField = Reference<RowCursor> tempReference_nestedField =
new Reference<RowCursor>(nestedField); new Reference<RowCursor>(nestedField);
RowCursor scope2; RowCursor scope2;
@@ -2233,7 +2233,7 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch
new Reference<RowCursor>(nestedField); new Reference<RowCursor>(nestedField);
Out<RowCursor> tempOut_scope22 = Out<RowCursor> tempOut_scope22 =
new Out<RowCursor>(); new Out<RowCursor>();
r = t.WriteScope(row, tempReference_nestedField2, col.getTypeArgs().clone(), tempOut_scope22); r = t.WriteScope(row, tempReference_nestedField2, col.typeArgs().clone(), tempOut_scope22);
scope2 = tempOut_scope22.get(); scope2 = tempOut_scope22.get();
nestedField = tempReference_nestedField2.get(); nestedField = tempReference_nestedField2.get();
ResultAssert.IsSuccess(r, tag); ResultAssert.IsSuccess(r, tag);
@@ -2340,16 +2340,16 @@ private final static class RoundTripSparseObjectNested extends TestActionDispatc
System.out.println(tag); System.out.println(tag);
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
// Ensure scope exists. // Ensure scope exists.
RowCursor scope = LayoutCompilerUnitTests.EnsureScope(row, root, col.getParent(), tag); RowCursor scope = LayoutCompilerUnitTests.EnsureScope(row, root, col.parent(), tag);
// Write the nested field. // Write the nested field.
RowCursor field; RowCursor field;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
scope.Clone(out field).Find(row, col.getPath()); scope.Clone(out field).Find(row, col.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
Result r = t.WriteSparse(row, ref field, (TValue)prop.Value); Result r = t.WriteSparse(row, ref field, (TValue)prop.Value);
@@ -2575,10 +2575,10 @@ private final static class RoundTripSparseSet extends TestActionDispatcher<Round
public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root, public <TLayout, TValue> void Dispatch(Reference<RowBuffer> row, Reference<RowCursor> root,
Closure closure) { Closure closure) {
LayoutColumn setCol = closure.SetCol; LayoutColumn setCol = closure.SetCol;
LayoutType tempVar = setCol.getType(); LayoutType tempVar = setCol.type();
LayoutUniqueScope setT = tempVar instanceof LayoutUniqueScope ? (LayoutUniqueScope)tempVar : null; LayoutUniqueScope setT = tempVar instanceof LayoutUniqueScope ? (LayoutUniqueScope)tempVar : null;
Expected expected = closure.Expected.clone(); Expected expected = closure.Expected.clone();
String tag = String.format("Json: %1$s, Set: %2$s", expected.Json, setCol.getType().getName()); String tag = String.format("Json: %1$s, Set: %2$s", expected.Json, setCol.type().getName());
System.out.println(tag); System.out.println(tag);
Assert.IsNotNull(setT, tag); Assert.IsNotNull(setT, tag);
@@ -2589,7 +2589,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher<Round
RowCursor field; RowCursor field;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().Clone(out field).Find(row, setCol.getPath()); root.get().Clone(out field).Find(row, setCol.path());
Reference<RowCursor> tempReference_field = Reference<RowCursor> tempReference_field =
new Reference<RowCursor>(field); new Reference<RowCursor>(field);
RowCursor scope; RowCursor scope;
@@ -2605,7 +2605,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher<Round
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
r = setT.WriteScope(row, ref field, setCol.getTypeArgs().clone(), out scope); r = setT.WriteScope(row, ref field, setCol.typeArgs().clone(), out scope);
ResultAssert.IsSuccess(r, tag); ResultAssert.IsSuccess(r, tag);
// Verify the nested field doesn't yet appear within the new scope. // Verify the nested field doesn't yet appear within the new scope.
@@ -2825,13 +2825,13 @@ private final static class RoundTripSparseSet extends TestActionDispatcher<Round
RowCursor roRoot; RowCursor roRoot;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().AsReadOnly(out roRoot).Find(row, setCol.getPath()); root.get().AsReadOnly(out roRoot).Find(row, setCol.path());
Reference<RowCursor> tempReference_roRoot = new Reference<RowCursor>(roRoot); Reference<RowCursor> tempReference_roRoot = new Reference<RowCursor>(roRoot);
ResultAssert.InsufficientPermissions(setT.DeleteScope(row, tempReference_roRoot)); ResultAssert.InsufficientPermissions(setT.DeleteScope(row, tempReference_roRoot));
roRoot = tempReference_roRoot.get(); roRoot = tempReference_roRoot.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.InsufficientPermissions(setT.WriteScope(row, ref roRoot, setCol.getTypeArgs().clone(), out _)); ResultAssert.InsufficientPermissions(setT.WriteScope(row, ref roRoot, setCol.typeArgs().clone(), out _));
// Overwrite the whole scope. // Overwrite the whole scope.
Reference<RowCursor> tempReference_field9 = new Reference<RowCursor>(field); Reference<RowCursor> tempReference_field9 = new Reference<RowCursor>(field);
@@ -2854,7 +2854,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher<Round
Reference<RowCursor> tempReference_field12 = new Reference<RowCursor>(field); Reference<RowCursor> tempReference_field12 = new Reference<RowCursor>(field);
RowCursor _; RowCursor _;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
r = setT.WriteScope(row, tempReference_field12, setCol.getTypeArgs().clone(), out _, UpdateOptions.Update); r = setT.WriteScope(row, tempReference_field12, setCol.typeArgs().clone(), out _, UpdateOptions.Update);
field = tempReference_field12.get(); field = tempReference_field12.get();
ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json);
Reference<RowCursor> tempReference_field13 = new Reference<RowCursor>(field); Reference<RowCursor> tempReference_field13 = new Reference<RowCursor>(field);
@@ -2914,12 +2914,12 @@ private final static class RoundTripSparseSimple extends TestActionDispatcher<Ro
LayoutColumn col = closure.Col; LayoutColumn col = closure.Col;
Expected expected = closure.Expected.clone(); Expected expected = closure.Expected.clone();
System.out.printf("%1$s" + "\r\n", col.getType().getName()); System.out.printf("%1$s" + "\r\n", col.type().getName());
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
RowCursor field; RowCursor field;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().Clone(out field).Find(row, col.getPath()); root.get().Clone(out field).Find(row, col.path());
TValue value; TValue value;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
@@ -2956,7 +2956,7 @@ private final static class RoundTripSparseSimple extends TestActionDispatcher<Ro
RowCursor roRoot; RowCursor roRoot;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
root.get().AsReadOnly(out roRoot).Find(row, col.getPath()); root.get().AsReadOnly(out roRoot).Find(row, col.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.InsufficientPermissions(t.DeleteSparse(row, ref roRoot)); ResultAssert.InsufficientPermissions(t.DeleteSparse(row, ref roRoot));
@@ -3066,7 +3066,7 @@ private static class RoundTripVariable extends TestActionDispatcher<RoundTripVar
protected final <TLayout extends LayoutType<TValue>, TValue> void Compare(Reference<RowBuffer> row, protected final <TLayout extends LayoutType<TValue>, TValue> void Compare(Reference<RowBuffer> row,
Reference<RowCursor> root, LayoutColumn col, Object exValue, Expected expected) { Reference<RowCursor> root, LayoutColumn col, Object exValue, Expected expected) {
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
TValue value; TValue value;
Out<TValue> tempOut_value = new Out<TValue>(); Out<TValue> tempOut_value = new Out<TValue>();
Result r = t.readVariable(row, root, col, tempOut_value); Result r = t.readVariable(row, root, col, tempOut_value);
@@ -3083,7 +3083,7 @@ private static class RoundTripVariable extends TestActionDispatcher<RoundTripVar
protected final <TLayout extends LayoutType<TValue>, TValue> void RoundTrip(Reference<RowBuffer> row, protected final <TLayout extends LayoutType<TValue>, TValue> void RoundTrip(Reference<RowBuffer> row,
Reference<RowCursor> root, LayoutColumn col, Object exValue, Expected expected) { Reference<RowCursor> root, LayoutColumn col, Object exValue, Expected expected) {
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
Result r = t.writeVariable(row, root, col, (TValue)exValue); Result r = t.writeVariable(row, root, col, (TValue)exValue);
ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json);
this.<TLayout, TValue>Compare(row, root, col, exValue, expected.clone()); this.<TLayout, TValue>Compare(row, root, col, exValue, expected.clone());
@@ -3193,7 +3193,7 @@ private final static class VariableInterleaving extends RoundTripVariable {
private <TLayout extends LayoutType<TValue>, TValue> void Delete(Reference<RowBuffer> row, private <TLayout extends LayoutType<TValue>, TValue> void Delete(Reference<RowBuffer> row,
Reference<RowCursor> root, LayoutColumn col, Expected expected) { Reference<RowCursor> root, LayoutColumn col, Expected expected) {
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
RowCursor roRoot; RowCursor roRoot;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
@@ -3213,7 +3213,7 @@ private final static class VariableInterleaving extends RoundTripVariable {
private <TLayout extends LayoutType<TValue>, TValue> void TooBig(Reference<RowBuffer> row, private <TLayout extends LayoutType<TValue>, TValue> void TooBig(Reference<RowBuffer> row,
Reference<RowCursor> root, LayoutColumn col, Expected expected) { Reference<RowCursor> root, LayoutColumn col, Expected expected) {
TLayout t = (TLayout)col.getType(); TLayout t = (TLayout)col.type();
Result r = t.writeVariable(row, root, col, (TValue)expected.TooBig); Result r = t.writeVariable(row, root, col, (TValue)expected.TooBig);
Assert.AreEqual(Result.TooBig, r, "Json: {0}", expected.Json); Assert.AreEqual(Result.TooBig, r, "Json: {0}", expected.Json);
} }

View File

@@ -150,7 +150,7 @@ public final class NullableUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutTypedArray>TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { if (c.<LayoutTypedArray>typeAs().ReadScope(row, ref scope, out scope) == Result.Success) {
value.NullBool = new ArrayList<Boolean>(); value.NullBool = new ArrayList<Boolean>();
RowCursor nullableScope = null; RowCursor nullableScope = null;
Reference<RowCursor> tempReference_nullableScope = Reference<RowCursor> tempReference_nullableScope =
@@ -183,7 +183,7 @@ public final class NullableUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutTypedArray>TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { if (c.<LayoutTypedArray>typeAs().ReadScope(row, ref scope, out scope) == Result.Success) {
value.NullArray = new ArrayList<Float>(); value.NullArray = new ArrayList<Float>();
RowCursor nullableScope = null; RowCursor nullableScope = null;
Reference<RowCursor> tempReference_nullableScope2 = Reference<RowCursor> tempReference_nullableScope2 =
@@ -216,7 +216,7 @@ public final class NullableUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutTypedSet>TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { if (c.<LayoutTypedSet>typeAs().ReadScope(row, ref scope, out scope) == Result.Success) {
value.NullSet = new ArrayList<String>(); value.NullSet = new ArrayList<String>();
RowCursor nullableScope = null; RowCursor nullableScope = null;
Reference<RowCursor> tempReference_nullableScope3 = Reference<RowCursor> tempReference_nullableScope3 =
@@ -249,7 +249,7 @@ public final class NullableUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutTypedArray>TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { if (c.<LayoutTypedArray>typeAs().ReadScope(row, ref scope, out scope) == Result.Success) {
value.NullTuple = new ArrayList<(Integer, Long) > (); value.NullTuple = new ArrayList<(Integer, Long) > ();
RowCursor tupleScope = null; RowCursor tupleScope = null;
TypeArgument tupleType = c.TypeArgs[0]; TypeArgument tupleType = c.TypeArgs[0];
@@ -316,7 +316,7 @@ public final class NullableUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref scope, out scope) == Result.Success) {
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: value.NullMap = new Dictionary<Guid, Nullable<byte>>(); //ORIGINAL LINE: value.NullMap = new Dictionary<Guid, Nullable<byte>>();
value.NullMap = new HashMap<UUID, Byte>(); value.NullMap = new HashMap<UUID, Byte>();
@@ -324,7 +324,7 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
TypeArgument tupleType = c.<LayoutUniqueScope>TypeAs().FieldType(ref scope); TypeArgument tupleType = c.<LayoutUniqueScope>typeAs().FieldType(ref scope);
Reference<RowCursor> tempReference_tupleScope4 = Reference<RowCursor> tempReference_tupleScope4 =
new Reference<RowCursor>(tupleScope); new Reference<RowCursor>(tupleScope);
while (scope.MoveNext(row, tempReference_tupleScope4)) { while (scope.MoveNext(row, tempReference_tupleScope4)) {
@@ -432,13 +432,13 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out outerScope).Find(row, c.getPath()); root.get().Clone(out outerScope).Find(row, c.path());
Reference<RowCursor> tempReference_outerScope = Reference<RowCursor> tempReference_outerScope =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Out<RowCursor> tempOut_outerScope = Out<RowCursor> tempOut_outerScope =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(c.<LayoutTypedArray>TypeAs().WriteScope(row, tempReference_outerScope, ResultAssert.IsSuccess(c.<LayoutTypedArray>typeAs().WriteScope(row, tempReference_outerScope,
c.getTypeArgs().clone(), tempOut_outerScope)); c.typeArgs().clone(), tempOut_outerScope));
outerScope = tempOut_outerScope.get(); outerScope = tempOut_outerScope.get();
outerScope = tempReference_outerScope.get(); outerScope = tempReference_outerScope.get();
for (Boolean item : value.NullBool) { for (Boolean item : value.NullBool) {
@@ -448,7 +448,7 @@ public final class NullableUnitTests {
Out<RowCursor> tempOut_innerScope = Out<RowCursor> tempOut_innerScope =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope2, ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope2,
c.getTypeArgs().get(0).clone(), item, tempOut_innerScope)); c.typeArgs().get(0).clone(), item, tempOut_innerScope));
innerScope = tempOut_innerScope.get(); innerScope = tempOut_innerScope.get();
outerScope = tempReference_outerScope2.get(); outerScope = tempReference_outerScope2.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
@@ -467,13 +467,13 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out outerScope).Find(row, c.getPath()); root.get().Clone(out outerScope).Find(row, c.path());
Reference<RowCursor> tempReference_outerScope3 = Reference<RowCursor> tempReference_outerScope3 =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Out<RowCursor> tempOut_outerScope2 = Out<RowCursor> tempOut_outerScope2 =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(c.<LayoutTypedArray>TypeAs().WriteScope(row, tempReference_outerScope3, ResultAssert.IsSuccess(c.<LayoutTypedArray>typeAs().WriteScope(row, tempReference_outerScope3,
c.getTypeArgs().clone(), tempOut_outerScope2)); c.typeArgs().clone(), tempOut_outerScope2));
outerScope = tempOut_outerScope2.get(); outerScope = tempOut_outerScope2.get();
outerScope = tempReference_outerScope3.get(); outerScope = tempReference_outerScope3.get();
for (Float item : value.NullArray) { for (Float item : value.NullArray) {
@@ -483,7 +483,7 @@ public final class NullableUnitTests {
Out<RowCursor> tempOut_innerScope2 = Out<RowCursor> tempOut_innerScope2 =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope4, ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope4,
c.getTypeArgs().get(0).clone(), item, tempOut_innerScope2)); c.typeArgs().get(0).clone(), item, tempOut_innerScope2));
innerScope = tempOut_innerScope2.get(); innerScope = tempOut_innerScope2.get();
outerScope = tempReference_outerScope4.get(); outerScope = tempReference_outerScope4.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
@@ -502,13 +502,13 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out outerScope).Find(row, c.getPath()); root.get().Clone(out outerScope).Find(row, c.path());
Reference<RowCursor> tempReference_outerScope5 = Reference<RowCursor> tempReference_outerScope5 =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Out<RowCursor> tempOut_outerScope3 = Out<RowCursor> tempOut_outerScope3 =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(c.<LayoutTypedSet>TypeAs().WriteScope(row, tempReference_outerScope5, ResultAssert.IsSuccess(c.<LayoutTypedSet>typeAs().WriteScope(row, tempReference_outerScope5,
c.getTypeArgs().clone(), tempOut_outerScope3)); c.typeArgs().clone(), tempOut_outerScope3));
outerScope = tempOut_outerScope3.get(); outerScope = tempOut_outerScope3.get();
outerScope = tempReference_outerScope5.get(); outerScope = tempReference_outerScope5.get();
for (String item : value.NullSet) { for (String item : value.NullSet) {
@@ -523,14 +523,14 @@ public final class NullableUnitTests {
Out<RowCursor> tempOut__ = Out<RowCursor> tempOut__ =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_temp, ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_temp,
c.getTypeArgs().get(0).clone(), item, tempOut__)); c.typeArgs().get(0).clone(), item, tempOut__));
_ = tempOut__.get(); _ = tempOut__.get();
temp = tempReference_temp.get(); temp = tempReference_temp.get();
Reference<RowCursor> tempReference_outerScope6 = Reference<RowCursor> tempReference_outerScope6 =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Reference<RowCursor> tempReference_temp2 = Reference<RowCursor> tempReference_temp2 =
new Reference<RowCursor>(temp); new Reference<RowCursor>(temp);
ResultAssert.IsSuccess(c.<LayoutTypedSet>TypeAs().MoveField(row, tempReference_outerScope6, ResultAssert.IsSuccess(c.<LayoutTypedSet>typeAs().MoveField(row, tempReference_outerScope6,
tempReference_temp2)); tempReference_temp2));
temp = tempReference_temp2.get(); temp = tempReference_temp2.get();
outerScope = tempReference_outerScope6.get(); outerScope = tempReference_outerScope6.get();
@@ -546,18 +546,18 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out outerScope).Find(row, c.getPath()); root.get().Clone(out outerScope).Find(row, c.path());
Reference<RowCursor> tempReference_outerScope7 = Reference<RowCursor> tempReference_outerScope7 =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Out<RowCursor> tempOut_outerScope4 = Out<RowCursor> tempOut_outerScope4 =
new Out<RowCursor>(); new Out<RowCursor>();
ResultAssert.IsSuccess(c.<LayoutTypedArray>TypeAs().WriteScope(row, tempReference_outerScope7, ResultAssert.IsSuccess(c.<LayoutTypedArray>typeAs().WriteScope(row, tempReference_outerScope7,
c.getTypeArgs().clone(), tempOut_outerScope4)); c.typeArgs().clone(), tempOut_outerScope4));
outerScope = tempOut_outerScope4.get(); outerScope = tempOut_outerScope4.get();
outerScope = tempReference_outerScope7.get(); outerScope = tempReference_outerScope7.get();
for ((Integer item1,Long item2) :value.NullTuple) for ((Integer item1,Long item2) :value.NullTuple)
{ {
TypeArgument tupleType = c.getTypeArgs().get(0).clone(); TypeArgument tupleType = c.typeArgs().get(0).clone();
RowCursor tupleScope; RowCursor tupleScope;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
// these cannot be converted using the 'Out' helper class unless the method is within the code // these cannot be converted using the 'Out' helper class unless the method is within the code
@@ -611,22 +611,22 @@ public final class NullableUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out outerScope).Find(row, c.getPath()); root.get().Clone(out outerScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref outerScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref outerScope,
c.getTypeArgs().clone(), out outerScope)); c.typeArgs().clone(), out outerScope));
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: foreach ((Guid key, Nullable<byte> itemValue) in value.NullMap) //ORIGINAL LINE: foreach ((Guid key, Nullable<byte> itemValue) in value.NullMap)
for ((UUID key,Byte itemValue) :value.NullMap) for ((UUID key,Byte itemValue) :value.NullMap)
{ {
Reference<RowCursor> tempReference_outerScope8 = Reference<RowCursor> tempReference_outerScope8 =
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
TypeArgument tupleType = c.<LayoutUniqueScope>TypeAs().FieldType(tempReference_outerScope8).clone(); TypeArgument tupleType = c.<LayoutUniqueScope>typeAs().FieldType(tempReference_outerScope8).clone();
outerScope = tempReference_outerScope8.get(); outerScope = tempReference_outerScope8.get();
RowCursor temp; RowCursor temp;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -676,7 +676,7 @@ public final class NullableUnitTests {
new Reference<RowCursor>(outerScope); new Reference<RowCursor>(outerScope);
Reference<RowCursor> tempReference_temp3 = Reference<RowCursor> tempReference_temp3 =
new Reference<RowCursor>(temp); new Reference<RowCursor>(temp);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_outerScope9, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_outerScope9,
tempReference_temp3)); tempReference_temp3));
temp = tempReference_temp3.get(); temp = tempReference_temp3.get();
outerScope = tempReference_outerScope9.get(); outerScope = tempReference_outerScope9.get();

View File

@@ -160,11 +160,11 @@ public final class RowOperationDispatcher {
assert scope.get().getLayout().TryFind(path, tempOut_col); assert scope.get().getLayout().TryFind(path, tempOut_col);
col = tempOut_col.get(); col = tempOut_col.get();
assert col != null; assert col != null;
type = col.getType(); type = col.type();
typeArgs = col.getTypeArgs().clone(); typeArgs = col.typeArgs().clone();
} }
if ((path != null) && (col == null || col.getStorage() == StorageKind.Sparse)) { if ((path != null) && (col == null || col.storage() == StorageKind.Sparse)) {
Reference<RowBuffer> tempReference_Row = Reference<RowBuffer> tempReference_Row =
new Reference<RowBuffer>(this.Row); new Reference<RowBuffer>(this.Row);
scope.get().Find(tempReference_Row, path); scope.get().Find(tempReference_Row, path);

View File

@@ -130,7 +130,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("array_t<int8>", tempOut_col); assert layout.TryFind("array_t<int8>", tempOut_col);
col = tempOut_col.get(); col = tempOut_col.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new byte[] { -86, -87, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new byte[] { -86, -87,
-88 }, (ref RowWriter writer2, TypeArgument typeArg, byte[] values) -> -88 }, (ref RowWriter writer2, TypeArgument typeArg, byte[] values) ->
{ {
for (byte value : values) { for (byte value : values) {
@@ -144,7 +144,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("array_t<array_t<float32>>", tempOut_col2); assert layout.TryFind("array_t<array_t<float32>>", tempOut_col2);
col = tempOut_col2.get(); col = tempOut_col2.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new float[][] ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new float[][]
{ {
new float[] { 1, 2, 3 }, new float[] { 1, 2, 3 },
new float[] { 1, 2, 3 } new float[] { 1, 2, 3 }
@@ -169,7 +169,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("array_t<utf8>", tempOut_col3); assert layout.TryFind("array_t<utf8>", tempOut_col3);
col = tempOut_col3.get(); col = tempOut_col3.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new String[] { "abc", ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new String[] { "abc",
"def", "hij" }, (ref RowWriter writer2, TypeArgument typeArg, String[] values) -> "def", "hij" }, (ref RowWriter writer2, TypeArgument typeArg, String[] values) ->
{ {
for (String value : values) { for (String value : values) {
@@ -183,7 +183,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("tuple<varint,int64>", tempOut_col4); assert layout.TryFind("tuple<varint,int64>", tempOut_col4);
col = tempOut_col4.get(); col = tempOut_col4.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(),
Tuple.Create(-6148914691236517206L, -6148914691236517206L), (ref RowWriter writer2, Tuple.Create(-6148914691236517206L, -6148914691236517206L), (ref RowWriter writer2,
TypeArgument typeArg, TypeArgument typeArg,
Tuple<Long, Long> values) -> Tuple<Long, Long> values) ->
@@ -197,7 +197,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("tuple<null,tuple<int8,int8>>", tempOut_col5); assert layout.TryFind("tuple<null,tuple<int8,int8>>", tempOut_col5);
col = tempOut_col5.get(); col = tempOut_col5.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(),
Tuple.Create(NullValue.Default, Tuple.Create((byte)-86, (byte)-86)), (ref RowWriter writer2, Tuple.Create(NullValue.Default, Tuple.Create((byte)-86, (byte)-86)), (ref RowWriter writer2,
TypeArgument typeArg, TypeArgument typeArg,
Tuple<NullValue, Tuple<Byte, Tuple<NullValue, Tuple<Byte,
@@ -219,7 +219,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("tuple<bool,udt>", tempOut_col6); assert layout.TryFind("tuple<bool,udt>", tempOut_col6);
col = tempOut_col6.get(); col = tempOut_col6.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create(false, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), Tuple.Create(false,
new RowReaderUnitTests.Point(1, 2)), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Boolean, new RowReaderUnitTests.Point(1, 2)), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Boolean,
RowReaderUnitTests.Point> values) -> RowReaderUnitTests.Point> values) ->
{ {
@@ -237,7 +237,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("nullable<int32,int64>", tempOut_col7); assert layout.TryFind("nullable<int32,int64>", tempOut_col7);
col = tempOut_col7.get(); col = tempOut_col7.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create(null, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), Tuple.Create(null,
(Long)123L), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Integer, Long> values) -> (Long)123L), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Integer, Long> values) ->
{ {
RowWriter.WriterFunc<Integer> f0 = (Reference<RowWriter> writer, TypeArgument typeArg, RowWriter.WriterFunc<Integer> f0 = (Reference<RowWriter> writer, TypeArgument typeArg,
@@ -266,7 +266,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("tagged<utf8>", tempOut_col8); assert layout.TryFind("tagged<utf8>", tempOut_col8);
col = tempOut_col8.get(); col = tempOut_col8.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create((byte)3, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), Tuple.Create((byte)3,
"hello"), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Byte, String> values) -> "hello"), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Byte, String> values) ->
{ {
ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1)); ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1));
@@ -278,7 +278,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("tagged<bool,utf8>", tempOut_col9); assert layout.TryFind("tagged<bool,utf8>", tempOut_col9);
col = tempOut_col9.get(); col = tempOut_col9.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create((byte)5, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), Tuple.Create((byte)5,
true, "bye"), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Byte, Boolean, String> values) -> true, "bye"), (ref RowWriter writer2, TypeArgument typeArg, Tuple<Byte, Boolean, String> values) ->
{ {
ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1)); ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1));
@@ -291,7 +291,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("set_t<utf8>", tempOut_col10); assert layout.TryFind("set_t<utf8>", tempOut_col10);
col = tempOut_col10.get(); col = tempOut_col10.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new String[] { "abc", ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new String[] { "abc",
"xzy", "efg" }, (ref RowWriter writer2, TypeArgument typeArg, String[] values) -> "xzy", "efg" }, (ref RowWriter writer2, TypeArgument typeArg, String[] values) ->
{ {
for (String value : values) { for (String value : values) {
@@ -305,7 +305,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("set_t<array_t<int8>>", tempOut_col11); assert layout.TryFind("set_t<array_t<int8>>", tempOut_col11);
col = tempOut_col11.get(); col = tempOut_col11.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new byte[][] ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new byte[][]
{ {
new byte[] { 7, 8, 9 }, new byte[] { 7, 8, 9 },
new byte[] { 4, 5, 6 }, new byte[] { 4, 5, 6 },
@@ -331,7 +331,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("set_t<set_t<int32>>", tempOut_col12); assert layout.TryFind("set_t<set_t<int32>>", tempOut_col12);
col = tempOut_col12.get(); col = tempOut_col12.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new int[][] ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new int[][]
{ {
new int[] { 4, 5, 6 }, new int[] { 4, 5, 6 },
new int[] { 7, 8, 9 }, new int[] { 7, 8, 9 },
@@ -357,7 +357,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("set_t<udt>", tempOut_col13); assert layout.TryFind("set_t<udt>", tempOut_col13);
col = tempOut_col13.get(); col = tempOut_col13.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(),
new RowReaderUnitTests.Point[] new RowReaderUnitTests.Point[]
{ {
new RowReaderUnitTests.Point(1, 2), new RowReaderUnitTests.Point(1, 2),
@@ -380,7 +380,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("map_t<utf8,utf8>", tempOut_col14); assert layout.TryFind("map_t<utf8,utf8>", tempOut_col14);
col = tempOut_col14.get(); col = tempOut_col14.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple<T1, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new System.Tuple<T1,
T2>[] { Tuple.Create("Harrison", "Han"), Tuple.Create("Mark", "Luke") }, (ref RowWriter writer2, T2>[] { Tuple.Create("Harrison", "Han"), Tuple.Create("Mark", "Luke") }, (ref RowWriter writer2,
TypeArgument typeArg, TypeArgument typeArg,
Tuple<String, String>[] values) -> Tuple<String, String>[] values) ->
@@ -403,7 +403,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("map_t<int8,array_t<int8>>", tempOut_col15); assert layout.TryFind("map_t<int8,array_t<int8>>", tempOut_col15);
col = tempOut_col15.get(); col = tempOut_col15.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple<T1, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new System.Tuple<T1,
T2>[] { Tuple.Create((byte)2, new byte[] { 4, 5, 6 }), T2>[] { Tuple.Create((byte)2, new byte[] { 4, 5, 6 }),
Tuple.Create((byte)1, new byte[] { 1, 2, 3 }) }, (ref RowWriter writer2, TypeArgument typeArg, Tuple.Create((byte)1, new byte[] { 1, 2, 3 }) }, (ref RowWriter writer2, TypeArgument typeArg,
Tuple<Byte, byte[]>[] values) -> Tuple<Byte, byte[]>[] values) ->
@@ -435,7 +435,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("map_t<int16,map_t<int32,int32>>", tempOut_col16); assert layout.TryFind("map_t<int16,map_t<int32,int32>>", tempOut_col16);
col = tempOut_col16.get(); col = tempOut_col16.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple<T1, ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new System.Tuple<T1,
T2>[] { Tuple.Create((short)2, new System.Tuple<T1, T2>[] { Tuple.Create(7, 8), Tuple.Create(5, 6) }) T2>[] { Tuple.Create((short)2, new System.Tuple<T1, T2>[] { Tuple.Create(7, 8), Tuple.Create(5, 6) })
, Tuple.Create((short)1, new System.Tuple<T1, T2>[] { Tuple.Create(3, 4), Tuple.Create(1, 2) }) }, , Tuple.Create((short)1, new System.Tuple<T1, T2>[] { Tuple.Create(3, 4), Tuple.Create(1, 2) }) },
(ref RowWriter writer2, TypeArgument typeArg, Tuple<Short, Tuple<Integer, Integer>[]>[] values) -> (ref RowWriter writer2, TypeArgument typeArg, Tuple<Short, Tuple<Integer, Integer>[]>[] values) ->
@@ -475,7 +475,7 @@ public final class RowWriterUnitTests {
new Out<LayoutColumn>(); new Out<LayoutColumn>();
assert layout.TryFind("map_t<float64,udt>", tempOut_col17); assert layout.TryFind("map_t<float64,udt>", tempOut_col17);
col = tempOut_col17.get(); col = tempOut_col17.get();
ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple<T1, T2>[] { Tuple.Create(1.0, new RowReaderUnitTests.Point(1, 2)), Tuple.Create(2.0, new RowReaderUnitTests.Point(3, 4)), Tuple.Create(3.0, new RowReaderUnitTests.Point(5, 6)) }, (ref RowWriter writer2, TypeArgument typeArg, Tuple<Double, RowReaderUnitTests.Point>[] values) -> ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new System.Tuple<T1, T2>[] { Tuple.Create(1.0, new RowReaderUnitTests.Point(1, 2)), Tuple.Create(2.0, new RowReaderUnitTests.Point(3, 4)), Tuple.Create(3.0, new RowReaderUnitTests.Point(5, 6)) }, (ref RowWriter writer2, TypeArgument typeArg, Tuple<Double, RowReaderUnitTests.Point>[] values) ->
{ {
for (Tuple<Double, RowReaderUnitTests.Point> value : values) { for (Tuple<Double, RowReaderUnitTests.Point> value : values) {
ResultAssert.IsSuccess(writer2.WriteScope(null, new TypeArgument(LayoutType.TypedTuple, typeArg.getTypeArgs().clone()), value, (ref RowWriter writer3, TypeArgument typeArg2, Tuple<Double, RowReaderUnitTests.Point> values2) -> ResultAssert.IsSuccess(writer2.WriteScope(null, new TypeArgument(LayoutType.TypedTuple, typeArg.getTypeArgs().clone()), value, (ref RowWriter writer3, TypeArgument typeArg2, Tuple<Double, RowReaderUnitTests.Point> values2) ->

View File

@@ -130,7 +130,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope));
row = tempReference_row4.get(); row = tempReference_row4.get();
for (String key : permutation) { for (String key : permutation) {
KeyValuePair<String, String> pair = new KeyValuePair<String, String>(key, "map lookup matches only on" + KeyValuePair<String, String> pair = new KeyValuePair<String, String>(key, "map lookup matches only on" +
@@ -160,13 +160,13 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row7, ref mapScope, ref tempCursor,
out findScope)); out findScope));
row = tempReference_row7.get(); row = tempReference_row7.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
TypeArgument tupleType = c.<LayoutUniqueScope>TypeAs().FieldType(ref mapScope); TypeArgument tupleType = c.<LayoutUniqueScope>typeAs().FieldType(ref mapScope);
Reference<RowBuffer> tempReference_row8 = Reference<RowBuffer> tempReference_row8 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
Reference<RowCursor> tempReference_findScope = Reference<RowCursor> tempReference_findScope =
@@ -222,7 +222,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
for (String key : t1.Cast.keySet()) { for (String key : t1.Cast.keySet()) {
KeyValuePair<String, String> pair = new KeyValuePair<String, String>(key, "map lookup matches only on key"); KeyValuePair<String, String> pair = new KeyValuePair<String, String>(key, "map lookup matches only on key");
@@ -250,7 +250,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row8, ref mapScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row8, ref mapScope, ref tempCursor,
out findScope)); out findScope));
row = tempReference_row8.get(); row = tempReference_row8.get();
Reference<RowBuffer> tempReference_row9 = Reference<RowBuffer> tempReference_row9 =
@@ -331,7 +331,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
Reference<RowBuffer> tempReference_row6 = Reference<RowBuffer> tempReference_row6 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -352,7 +352,7 @@ public final class TypedMapUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row8, ref mapScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row8, ref mapScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row8.get(); row = tempReference_row8.get();
Reference<RowBuffer> tempReference_row9 = Reference<RowBuffer> tempReference_row9 =
@@ -390,7 +390,7 @@ public final class TypedMapUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row13, ref mapScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row13, ref mapScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row13.get(); row = tempReference_row13.get();
Reference<RowBuffer> tempReference_row14 = Reference<RowBuffer> tempReference_row14 =
@@ -427,7 +427,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row17, ref mapScope, out mapScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row17, ref mapScope, out mapScope));
row = tempReference_row17.get(); row = tempReference_row17.get();
KeyValuePair<UUID, Double> pair = KeyValuePair.Create(UUID.fromString("{4674962B-CE11-4916-81C5-0421EE36F168" + KeyValuePair<UUID, Double> pair = KeyValuePair.Create(UUID.fromString("{4674962B-CE11-4916-81C5-0421EE36F168" +
"}"), 11000000.00); "}"), 11000000.00);
@@ -448,7 +448,7 @@ public final class TypedMapUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row20, ref mapScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row20, ref mapScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row20.get(); row = tempReference_row20.get();
Reference<RowBuffer> tempReference_row21 = Reference<RowBuffer> tempReference_row21 =
@@ -498,7 +498,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(tempReference_row3, ref mapScope, c.TypeArgs, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(tempReference_row3, ref mapScope, c.TypeArgs,
out mapScope)); out mapScope));
row = tempReference_row3.get(); row = tempReference_row3.get();
Reference<RowBuffer> tempReference_row4 = Reference<RowBuffer> tempReference_row4 =
@@ -528,7 +528,7 @@ public final class TypedMapUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row7, ref mapScope, ref tempCursor)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row7, ref mapScope, ref tempCursor));
row = tempReference_row7.get(); row = tempReference_row7.get();
Reference<RowBuffer> tempReference_row8 = Reference<RowBuffer> tempReference_row8 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -564,13 +564,13 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(tempReference_row11, ref mapScope, c.TypeArgs, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(tempReference_row11, ref mapScope, c.TypeArgs,
out mapScope)); out mapScope));
row = tempReference_row11.get(); row = tempReference_row11.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
LayoutIndexedScope tupleLayout = LayoutIndexedScope tupleLayout =
c.<LayoutUniqueScope>TypeAs().FieldType(ref mapScope).<LayoutIndexedScope>TypeAs(); c.<LayoutUniqueScope>typeAs().FieldType(ref mapScope).<LayoutIndexedScope>TypeAs();
Reference<RowBuffer> tempReference_row12 = Reference<RowBuffer> tempReference_row12 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
@@ -613,7 +613,7 @@ public final class TypedMapUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor));
row = tempReference_row17.get(); row = tempReference_row17.get();
Reference<RowBuffer> tempReference_row18 = Reference<RowBuffer> tempReference_row18 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -719,7 +719,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope));
row = tempReference_row4.get(); row = tempReference_row4.get();
for (String key : permutation) { for (String key : permutation) {
// Verify it is already there. // Verify it is already there.
@@ -750,7 +750,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row7, ref mapScope, ref tempCursor,
out findScope)); out findScope));
row = tempReference_row7.get(); row = tempReference_row7.get();
@@ -776,7 +776,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row10, ref mapScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row10, ref mapScope,
ref tempCursor, UpdateOptions.Update)); ref tempCursor, UpdateOptions.Update));
row = tempReference_row10.get(); row = tempReference_row10.get();
@@ -804,7 +804,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row13, ref mapScope, ref tempCursor ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row13, ref mapScope, ref tempCursor
, out findScope)); , out findScope));
row = tempReference_row13.get(); row = tempReference_row13.get();
Reference<RowBuffer> tempReference_row14 = Reference<RowBuffer> tempReference_row14 =
@@ -846,7 +846,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row17, ref mapScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row17, ref mapScope,
ref tempCursor, UpdateOptions.Upsert)); ref tempCursor, UpdateOptions.Upsert));
row = tempReference_row17.get(); row = tempReference_row17.get();
@@ -874,7 +874,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row20, ref mapScope, ref tempCursor ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row20, ref mapScope, ref tempCursor
, out findScope)); , out findScope));
row = tempReference_row20.get(); row = tempReference_row20.get();
Reference<RowBuffer> tempReference_row21 = Reference<RowBuffer> tempReference_row21 =
@@ -913,7 +913,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row24, ref mapScope, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row24, ref mapScope,
ref tempCursor, UpdateOptions.Insert)); ref tempCursor, UpdateOptions.Insert));
row = tempReference_row24.get(); row = tempReference_row24.get();
@@ -939,7 +939,7 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.TypeConstraint(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row27, ref mapScope, ResultAssert.TypeConstraint(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row27, ref mapScope,
ref tempCursor, UpdateOptions.InsertAt)); ref tempCursor, UpdateOptions.InsertAt));
row = tempReference_row27.get(); row = tempReference_row27.get();
} }
@@ -953,12 +953,12 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert udt.TryFind("domestic", out c); assert udt.TryFind("domestic", out c);
Out<BigDecimal> tempOut_Domestic = new Out<BigDecimal>(); Out<BigDecimal> tempOut_Domestic = new Out<BigDecimal>();
ResultAssert.IsSuccess(c.<LayoutDecimal>TypeAs().ReadFixed(row, udtScope, c, tempOut_Domestic)); ResultAssert.IsSuccess(c.<LayoutDecimal>typeAs().ReadFixed(row, udtScope, c, tempOut_Domestic));
m.Domestic = tempOut_Domestic.get(); m.Domestic = tempOut_Domestic.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert udt.TryFind("worldwide", out c); assert udt.TryFind("worldwide", out c);
Out<BigDecimal> tempOut_Worldwide = new Out<BigDecimal>(); Out<BigDecimal> tempOut_Worldwide = new Out<BigDecimal>();
ResultAssert.IsSuccess(c.<LayoutDecimal>TypeAs().ReadFixed(row, udtScope, c, tempOut_Worldwide)); ResultAssert.IsSuccess(c.<LayoutDecimal>typeAs().ReadFixed(row, udtScope, c, tempOut_Worldwide));
m.Worldwide = tempOut_Worldwide.get(); m.Worldwide = tempOut_Worldwide.get();
return m; return m;
} }
@@ -1020,7 +1020,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref castScope, out castScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref castScope, out castScope) == Result.Success) {
value.Cast = new HashMap<String, String>(); value.Cast = new HashMap<String, String>();
while (castScope.MoveNext(row)) { while (castScope.MoveNext(row)) {
Reference<RowCursor> tempReference_castScope = Reference<RowCursor> tempReference_castScope =
@@ -1047,7 +1047,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref statsScope, out statsScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref statsScope, out statsScope) == Result.Success) {
value.Stats = new HashMap<UUID, Double>(); value.Stats = new HashMap<UUID, Double>();
while (statsScope.MoveNext(row)) { while (statsScope.MoveNext(row)) {
Reference<RowCursor> tempReference_statsScope = Reference<RowCursor> tempReference_statsScope =
@@ -1074,7 +1074,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref relatedScope, out relatedScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref relatedScope, out relatedScope) == Result.Success) {
value.Related = new HashMap<String, HashMap<Long, String>>(); value.Related = new HashMap<String, HashMap<Long, String>>();
TypeArgument keyType = c.TypeArgs[0]; TypeArgument keyType = c.TypeArgs[0];
TypeArgument valueType = c.TypeArgs[1]; TypeArgument valueType = c.TypeArgs[1];
@@ -1136,7 +1136,7 @@ public final class TypedMapUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref revenueScope, out revenueScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref revenueScope, out revenueScope) == Result.Success) {
value.Revenue = new HashMap<LocalDateTime, Earnings>(); value.Revenue = new HashMap<LocalDateTime, Earnings>();
TypeArgument keyType = c.TypeArgs[0]; TypeArgument keyType = c.TypeArgs[0];
TypeArgument valueType = c.TypeArgs[1]; TypeArgument valueType = c.TypeArgs[1];
@@ -1182,10 +1182,10 @@ public final class TypedMapUnitTests {
LayoutColumn c; LayoutColumn c;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert udt.TryFind("domestic", out c); assert udt.TryFind("domestic", out c);
ResultAssert.IsSuccess(c.<LayoutDecimal>TypeAs().WriteFixed(row, udtScope, c, m.Domestic)); ResultAssert.IsSuccess(c.<LayoutDecimal>typeAs().WriteFixed(row, udtScope, c, m.Domestic));
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert udt.TryFind("worldwide", out c); assert udt.TryFind("worldwide", out c);
ResultAssert.IsSuccess(c.<LayoutDecimal>TypeAs().WriteFixed(row, udtScope, c, m.Worldwide)); ResultAssert.IsSuccess(c.<LayoutDecimal>typeAs().WriteFixed(row, udtScope, c, m.Worldwide));
} }
private static <TKey, TValue> Result WriteKeyValue(Reference<RowBuffer> row, private static <TKey, TValue> Result WriteKeyValue(Reference<RowBuffer> row,
@@ -1227,15 +1227,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out castScope).Find(row, c.getPath()); root.get().Clone(out castScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref castScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref castScope,
c.getTypeArgs().clone(), out castScope)); c.typeArgs().clone(), out castScope));
for (KeyValuePair<String, String> item : value.Cast) { for (KeyValuePair<String, String> item : value.Cast) {
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1245,13 +1245,13 @@ public final class TypedMapUnitTests {
Reference<RowCursor> tempReference_tempCursor = Reference<RowCursor> tempReference_tempCursor =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor, ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor,
c.getTypeArgs().clone(), item)); c.typeArgs().clone(), item));
tempCursor = tempReference_tempCursor.get(); tempCursor = tempReference_tempCursor.get();
Reference<RowCursor> tempReference_castScope = Reference<RowCursor> tempReference_castScope =
new Reference<RowCursor>(castScope); new Reference<RowCursor>(castScope);
Reference<RowCursor> tempReference_tempCursor2 = Reference<RowCursor> tempReference_tempCursor2 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_castScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_castScope,
tempReference_tempCursor2)); tempReference_tempCursor2));
tempCursor = tempReference_tempCursor2.get(); tempCursor = tempReference_tempCursor2.get();
castScope = tempReference_castScope.get(); castScope = tempReference_castScope.get();
@@ -1267,15 +1267,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out statsScope).Find(row, c.getPath()); root.get().Clone(out statsScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref statsScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref statsScope,
c.getTypeArgs().clone(), out statsScope)); c.typeArgs().clone(), out statsScope));
for (KeyValuePair<UUID, Double> item : value.Stats) { for (KeyValuePair<UUID, Double> item : value.Stats) {
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1285,13 +1285,13 @@ public final class TypedMapUnitTests {
Reference<RowCursor> tempReference_tempCursor3 = Reference<RowCursor> tempReference_tempCursor3 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor3, ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor3,
c.getTypeArgs().clone(), item)); c.typeArgs().clone(), item));
tempCursor = tempReference_tempCursor3.get(); tempCursor = tempReference_tempCursor3.get();
Reference<RowCursor> tempReference_statsScope = Reference<RowCursor> tempReference_statsScope =
new Reference<RowCursor>(statsScope); new Reference<RowCursor>(statsScope);
Reference<RowCursor> tempReference_tempCursor4 = Reference<RowCursor> tempReference_tempCursor4 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_statsScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_statsScope,
tempReference_tempCursor4)); tempReference_tempCursor4));
tempCursor = tempReference_tempCursor4.get(); tempCursor = tempReference_tempCursor4.get();
statsScope = tempReference_statsScope.get(); statsScope = tempReference_statsScope.get();
@@ -1307,15 +1307,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out relatedScoped).Find(row, c.getPath()); root.get().Clone(out relatedScoped).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref relatedScoped, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref relatedScoped,
c.getTypeArgs().clone(), out relatedScoped)); c.typeArgs().clone(), out relatedScoped));
for (KeyValuePair<String, HashMap<Long, String>> item : value.Related) { for (KeyValuePair<String, HashMap<Long, String>> item : value.Related) {
assert item.Value != null; assert item.Value != null;
@@ -1332,15 +1332,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.typeArgs().clone(),
out tupleScope)); out tupleScope));
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().<LayoutUtf8>typeAs().WriteSparse(row, ResultAssert.IsSuccess(c.typeArgs().get(0).type().<LayoutUtf8>typeAs().WriteSparse(row,
ref tupleScope, item.Key)); ref tupleScope, item.Key));
assert tupleScope.MoveNext(row); assert tupleScope.MoveNext(row);
TypeArgument valueType = c.getTypeArgs().get(1).clone(); TypeArgument valueType = c.typeArgs().get(1).clone();
LayoutUniqueScope valueLayout = valueType.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope valueLayout = valueType.getType().<LayoutUniqueScope>TypeAs();
RowCursor innerScope; RowCursor innerScope;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1375,7 +1375,7 @@ public final class TypedMapUnitTests {
new Reference<RowCursor>(relatedScoped); new Reference<RowCursor>(relatedScoped);
Reference<RowCursor> tempReference_tempCursor1 = Reference<RowCursor> tempReference_tempCursor1 =
new Reference<RowCursor>(tempCursor1); new Reference<RowCursor>(tempCursor1);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_relatedScoped, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_relatedScoped,
tempReference_tempCursor1)); tempReference_tempCursor1));
tempCursor1 = tempReference_tempCursor1.get(); tempCursor1 = tempReference_tempCursor1.get();
relatedScoped = tempReference_relatedScoped.get(); relatedScoped = tempReference_relatedScoped.get();
@@ -1391,15 +1391,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out revenueScope).Find(row, c.getPath()); root.get().Clone(out revenueScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref revenueScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref revenueScope,
c.getTypeArgs().clone(), out revenueScope)); c.typeArgs().clone(), out revenueScope));
for (KeyValuePair<LocalDateTime, Earnings> item : value.Revenue) { for (KeyValuePair<LocalDateTime, Earnings> item : value.Revenue) {
assert item.Value != null; assert item.Value != null;
@@ -1416,15 +1416,15 @@ public final class TypedMapUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.typeArgs().clone(),
out tupleScope)); out tupleScope));
Reference<RowCursor> tempReference_tupleScope = Reference<RowCursor> tempReference_tupleScope =
new Reference<RowCursor>(tupleScope); new Reference<RowCursor>(tupleScope);
ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().<LayoutDateTime>typeAs().WriteSparse(row, ResultAssert.IsSuccess(c.typeArgs().get(0).type().<LayoutDateTime>typeAs().WriteSparse(row,
tempReference_tupleScope, item.Key)); tempReference_tupleScope, item.Key));
tupleScope = tempReference_tupleScope.get(); tupleScope = tempReference_tupleScope.get();
assert tupleScope.MoveNext(row); assert tupleScope.MoveNext(row);
TypeArgument valueType = c.getTypeArgs().get(1).clone(); TypeArgument valueType = c.typeArgs().get(1).clone();
LayoutUDT valueLayout = valueType.getType().<LayoutUDT>TypeAs(); LayoutUDT valueLayout = valueType.getType().<LayoutUDT>TypeAs();
Reference<RowCursor> tempReference_tupleScope2 = Reference<RowCursor> tempReference_tupleScope2 =
new Reference<RowCursor>(tupleScope); new Reference<RowCursor>(tupleScope);
@@ -1444,7 +1444,7 @@ public final class TypedMapUnitTests {
new Reference<RowCursor>(revenueScope); new Reference<RowCursor>(revenueScope);
Reference<RowCursor> tempReference_tempCursor12 = Reference<RowCursor> tempReference_tempCursor12 =
new Reference<RowCursor>(tempCursor1); new Reference<RowCursor>(tempCursor1);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_revenueScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_revenueScope,
tempReference_tempCursor12)); tempReference_tempCursor12));
tempCursor1 = tempReference_tempCursor12.get(); tempCursor1 = tempReference_tempCursor12.get();
revenueScope = tempReference_revenueScope.get(); revenueScope = tempReference_revenueScope.get();

View File

@@ -133,7 +133,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref setScope, out setScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
for (UUID p : t1.Projects) { for (UUID p : t1.Projects) {
Reference<RowBuffer> tempReference_row6 = Reference<RowBuffer> tempReference_row6 =
@@ -161,7 +161,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row8, ref setScope, ref tempCursor,
out findScope)); out findScope));
row = tempReference_row8.get(); row = tempReference_row8.get();
Reference<RowBuffer> tempReference_row9 = Reference<RowBuffer> tempReference_row9 =
@@ -221,7 +221,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref setScope, out setScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
for (int i = 0; i < t1.Attendees.size(); i++) { for (int i = 0; i < t1.Attendees.size(); i++) {
Reference<RowBuffer> tempReference_row6 = Reference<RowBuffer> tempReference_row6 =
@@ -249,7 +249,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row8, ref setScope, ref tempCursor,
out findScope)); out findScope));
row = tempReference_row8.get(); row = tempReference_row8.get();
Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Attendees[%1$s]", i)); Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Attendees[%1$s]", i));
@@ -270,7 +270,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row10, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row10, ref setScope, out setScope));
row = tempReference_row10.get(); row = tempReference_row10.get();
TypeArgument innerType = c.TypeArgs[0]; TypeArgument innerType = c.TypeArgs[0];
TypeArgument itemType = innerType.getTypeArgs().get(0).clone(); TypeArgument itemType = innerType.getTypeArgs().get(0).clone();
@@ -335,7 +335,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row16, ref setScope, ref tempCursor1, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row16, ref setScope, ref tempCursor1,
out findScope)); out findScope));
row = tempReference_row16.get(); row = tempReference_row16.get();
Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Prices[%1$s]", i)); Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Prices[%1$s]", i));
@@ -403,7 +403,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref setScope, out setScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
Reference<RowBuffer> tempReference_row6 = Reference<RowBuffer> tempReference_row6 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -423,7 +423,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row8.get(); row = tempReference_row8.get();
Reference<RowBuffer> tempReference_row9 = Reference<RowBuffer> tempReference_row9 =
@@ -446,7 +446,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row11, ref setScope, ref tempCursor, out _)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row11, ref setScope, ref tempCursor, out _));
row = tempReference_row11.get(); row = tempReference_row11.get();
Reference<RowBuffer> tempReference_row12 = Reference<RowBuffer> tempReference_row12 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -479,7 +479,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row15, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row15, ref setScope, out setScope));
row = tempReference_row15.get(); row = tempReference_row15.get();
Reference<RowBuffer> tempReference_row16 = Reference<RowBuffer> tempReference_row16 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -498,7 +498,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row18, ref setScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row18, ref setScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row18.get(); row = tempReference_row18.get();
@@ -518,7 +518,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row20, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row20, ref setScope, out setScope));
row = tempReference_row20.get(); row = tempReference_row20.get();
TypeArgument innerType = c.TypeArgs[0]; TypeArgument innerType = c.TypeArgs[0];
LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs();
@@ -572,7 +572,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row26, ref setScope, ref tempCursor1, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row26, ref setScope, ref tempCursor1,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row26.get(); row = tempReference_row26.get();
@@ -592,7 +592,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row28, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row28, ref setScope, out setScope));
row = tempReference_row28.get(); row = tempReference_row28.get();
LayoutUDT udtLayout = c.TypeArgs[0].Type.<LayoutUDT>TypeAs(); LayoutUDT udtLayout = c.TypeArgs[0].Type.<LayoutUDT>TypeAs();
Reference<RowBuffer> tempReference_row29 = Reference<RowBuffer> tempReference_row29 =
@@ -625,7 +625,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row32, ref setScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row32, ref setScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row32.get(); row = tempReference_row32.get();
@@ -645,7 +645,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row34, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row34, ref setScope, out setScope));
row = tempReference_row34.get(); row = tempReference_row34.get();
innerType = c.TypeArgs[0]; innerType = c.TypeArgs[0];
LayoutIndexedScope tupleLayout = innerType.getType().<LayoutIndexedScope>TypeAs(); LayoutIndexedScope tupleLayout = innerType.getType().<LayoutIndexedScope>TypeAs();
@@ -687,7 +687,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row40, ref setScope, ref tempCursor, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row40, ref setScope, ref tempCursor,
UpdateOptions.Insert)); UpdateOptions.Insert));
row = tempReference_row40.get(); row = tempReference_row40.get();
} }
@@ -719,7 +719,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(tempReference_row3, ref setScope, c.TypeArgs, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(tempReference_row3, ref setScope, c.TypeArgs,
out setScope)); out setScope));
row = tempReference_row3.get(); row = tempReference_row3.get();
Reference<RowBuffer> tempReference_row4 = Reference<RowBuffer> tempReference_row4 =
@@ -750,7 +750,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor));
row = tempReference_row8.get(); row = tempReference_row8.get();
Reference<RowBuffer> tempReference_row9 = Reference<RowBuffer> tempReference_row9 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -786,7 +786,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(tempReference_row13, ref setScope, c.TypeArgs, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(tempReference_row13, ref setScope, c.TypeArgs,
out setScope)); out setScope));
row = tempReference_row13.get(); row = tempReference_row13.get();
TypeArgument innerType = c.TypeArgs[0]; TypeArgument innerType = c.TypeArgs[0];
@@ -844,7 +844,7 @@ public final class TypedSetUnitTests {
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row21, ref setScope, ref tempCursor1)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row21, ref setScope, ref tempCursor1));
row = tempReference_row21.get(); row = tempReference_row21.get();
Reference<RowBuffer> tempReference_row22 = Reference<RowBuffer> tempReference_row22 =
new Reference<RowBuffer>(row); new Reference<RowBuffer>(row);
@@ -928,7 +928,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row4, ref projScope, out projScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row4, ref projScope, out projScope));
row = tempReference_row4.get(); row = tempReference_row4.get();
for (UUID item : t1.Projects) { for (UUID item : t1.Projects) {
Reference<RowBuffer> tempReference_row5 = Reference<RowBuffer> tempReference_row5 =
@@ -952,7 +952,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row7, ref projScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row7, ref projScope,
ref tempCursor)); ref tempCursor));
row = tempReference_row7.get(); row = tempReference_row7.get();
} }
@@ -1024,7 +1024,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().ReadScope(tempReference_row5, ref setScope, out setScope));
row = tempReference_row5.get(); row = tempReference_row5.get();
for (UUID elm : t1.Projects) { for (UUID elm : t1.Projects) {
// Verify it is already there. // Verify it is already there.
@@ -1053,7 +1053,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().Find(tempReference_row8, ref setScope, ref tempCursor,
value: value:
out RowCursor _)) out RowCursor _))
row = tempReference_row8.get(); row = tempReference_row8.get();
@@ -1079,7 +1079,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row11, ref setScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row11, ref setScope,
ref tempCursor, UpdateOptions.Update)); ref tempCursor, UpdateOptions.Update));
row = tempReference_row11.get(); row = tempReference_row11.get();
@@ -1104,7 +1104,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row14, ref setScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row14, ref setScope,
ref tempCursor)); ref tempCursor));
row = tempReference_row14.get(); row = tempReference_row14.get();
@@ -1129,7 +1129,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.Exists(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row17, ref setScope, ResultAssert.Exists(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row17, ref setScope,
ref tempCursor, UpdateOptions.Insert)); ref tempCursor, UpdateOptions.Insert));
row = tempReference_row17.get(); row = tempReference_row17.get();
@@ -1154,7 +1154,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.TypeConstraint(c.<LayoutUniqueScope>TypeAs().MoveField(tempReference_row20, ref setScope, ResultAssert.TypeConstraint(c.<LayoutUniqueScope>typeAs().MoveField(tempReference_row20, ref setScope,
ref tempCursor, UpdateOptions.InsertAt)); ref tempCursor, UpdateOptions.InsertAt));
row = tempReference_row20.get(); row = tempReference_row20.get();
} }
@@ -1168,14 +1168,14 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert matchLayout.TryFind("label", out c); assert matchLayout.TryFind("label", out c);
Out<String> tempOut_Label = new Out<String>(); Out<String> tempOut_Label = new Out<String>();
ResultAssert.IsSuccess(c.<LayoutUtf8>TypeAs().ReadVariable(row, matchScope, c, tempOut_Label)); ResultAssert.IsSuccess(c.<LayoutUtf8>typeAs().ReadVariable(row, matchScope, c, tempOut_Label));
m.Label = tempOut_Label.get(); m.Label = tempOut_Label.get();
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert matchLayout.TryFind("count", out c); assert matchLayout.TryFind("count", out c);
Out<Byte> tempOut_Count = new Out<Byte>(); Out<Byte> tempOut_Count = new Out<Byte>();
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeAs<LayoutUInt8>().ReadFixed(ref row, ref matchScope, c, out m.Count)); //ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeAs<LayoutUInt8>().ReadFixed(ref row, ref matchScope, c, out m.Count));
ResultAssert.IsSuccess(c.<LayoutUInt8>TypeAs().ReadFixed(row, matchScope, c, tempOut_Count)); ResultAssert.IsSuccess(c.<LayoutUInt8>typeAs().ReadFixed(row, matchScope, c, tempOut_Count));
m.Count = tempOut_Count.get(); m.Count = tempOut_Count.get();
return m; return m;
} }
@@ -1195,7 +1195,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) {
value.Attendees = new ArrayList<String>(); value.Attendees = new ArrayList<String>();
while (tagsScope.MoveNext(row)) { while (tagsScope.MoveNext(row)) {
String item; String item;
@@ -1222,7 +1222,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref projScope, out projScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref projScope, out projScope) == Result.Success) {
value.Projects = new ArrayList<UUID>(); value.Projects = new ArrayList<UUID>();
while (projScope.MoveNext(row)) { while (projScope.MoveNext(row)) {
java.util.UUID item; java.util.UUID item;
@@ -1249,7 +1249,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref checkboxScope, out checkboxScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref checkboxScope, out checkboxScope) == Result.Success) {
value.Checkboxes = new ArrayList<Boolean>(); value.Checkboxes = new ArrayList<Boolean>();
while (checkboxScope.MoveNext(row)) { while (checkboxScope.MoveNext(row)) {
boolean item; boolean item;
@@ -1276,7 +1276,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref pricesScope, out pricesScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref pricesScope, out pricesScope) == Result.Success) {
value.Prices = new ArrayList<ArrayList<Float>>(); value.Prices = new ArrayList<ArrayList<Float>>();
TypeArgument innerType = c.TypeArgs[0]; TypeArgument innerType = c.TypeArgs[0];
LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs();
@@ -1317,7 +1317,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref nestedScope, out nestedScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref nestedScope, out nestedScope) == Result.Success) {
value.Nested = new ArrayList<ArrayList<ArrayList<Integer>>>(); value.Nested = new ArrayList<ArrayList<ArrayList<Integer>>>();
TypeArgument in2Type = c.TypeArgs[0]; TypeArgument in2Type = c.TypeArgs[0];
LayoutUniqueScope in2Layout = in2Type.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope in2Layout = in2Type.getType().<LayoutUniqueScope>TypeAs();
@@ -1372,7 +1372,7 @@ public final class TypedSetUnitTests {
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref shoppingScope, out shoppingScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref shoppingScope, out shoppingScope) == Result.Success) {
value.Shopping = new ArrayList<ShoppingItem>(); value.Shopping = new ArrayList<ShoppingItem>();
while (shoppingScope.MoveNext(row)) { while (shoppingScope.MoveNext(row)) {
TypeArgument innerType = c.TypeArgs[0]; TypeArgument innerType = c.TypeArgs[0];
@@ -1403,7 +1403,7 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being modified: // cannot be converted using the 'Out' helper class unless the method is within the code being modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified:
if (c.<LayoutUniqueScope>TypeAs().ReadScope(row, ref workScope, out workScope) == Result.Success) { if (c.<LayoutUniqueScope>typeAs().ReadScope(row, ref workScope, out workScope) == Result.Success) {
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: value.Work = new List<Tuple<bool, ulong>>(); //ORIGINAL LINE: value.Work = new List<Tuple<bool, ulong>>();
value.Work = new ArrayList<Tuple<Boolean, Long>>(); value.Work = new ArrayList<Tuple<Boolean, Long>>();
@@ -1469,10 +1469,10 @@ public final class TypedSetUnitTests {
LayoutColumn c; LayoutColumn c;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert matchLayout.TryFind("label", out c); assert matchLayout.TryFind("label", out c);
ResultAssert.IsSuccess(c.<LayoutUtf8>TypeAs().WriteVariable(row, matchScope, c, m.Label)); ResultAssert.IsSuccess(c.<LayoutUtf8>typeAs().WriteVariable(row, matchScope, c, m.Label));
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified:
assert matchLayout.TryFind("count", out c); assert matchLayout.TryFind("count", out c);
ResultAssert.IsSuccess(c.<LayoutUInt8>TypeAs().WriteFixed(row, matchScope, c, m.Count)); ResultAssert.IsSuccess(c.<LayoutUInt8>typeAs().WriteFixed(row, matchScope, c, m.Count));
} }
private void WriteTodo(Reference<RowBuffer> row, Reference<RowCursor> root, Todo value) { private void WriteTodo(Reference<RowBuffer> row, Reference<RowCursor> root, Todo value) {
@@ -1487,15 +1487,15 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out attendScope).Find(row, c.getPath()); root.get().Clone(out attendScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref attendScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref attendScope,
c.getTypeArgs().clone(), out attendScope)); c.typeArgs().clone(), out attendScope));
for (String item : value.Attendees) { for (String item : value.Attendees) {
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1505,13 +1505,13 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword -
// these cannot be converted using the 'Ref' helper class unless the method is within the code // these cannot be converted using the 'Ref' helper class unless the method is within the code
// being modified: // being modified:
ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().<LayoutUtf8>typeAs().WriteSparse(row, ResultAssert.IsSuccess(c.typeArgs().get(0).type().<LayoutUtf8>typeAs().WriteSparse(row,
ref tempCursor, item)); ref tempCursor, item));
Reference<RowCursor> tempReference_attendScope = Reference<RowCursor> tempReference_attendScope =
new Reference<RowCursor>(attendScope); new Reference<RowCursor>(attendScope);
Reference<RowCursor> tempReference_tempCursor = Reference<RowCursor> tempReference_tempCursor =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_attendScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_attendScope,
tempReference_tempCursor)); tempReference_tempCursor));
tempCursor = tempReference_tempCursor.get(); tempCursor = tempReference_tempCursor.get();
attendScope = tempReference_attendScope.get(); attendScope = tempReference_attendScope.get();
@@ -1527,15 +1527,15 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out projScope).Find(row, c.getPath()); root.get().Clone(out projScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref projScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref projScope,
c.getTypeArgs().clone(), out projScope)); c.typeArgs().clone(), out projScope));
for (UUID item : value.Projects) { for (UUID item : value.Projects) {
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1544,14 +1544,14 @@ public final class TypedSetUnitTests {
root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); root.get().Clone(out tempCursor).Find(row, Utf8String.Empty);
Reference<RowCursor> tempReference_tempCursor2 = Reference<RowCursor> tempReference_tempCursor2 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().<LayoutGuid>typeAs().WriteSparse(row, ResultAssert.IsSuccess(c.typeArgs().get(0).type().<LayoutGuid>typeAs().WriteSparse(row,
tempReference_tempCursor2, item)); tempReference_tempCursor2, item));
tempCursor = tempReference_tempCursor2.get(); tempCursor = tempReference_tempCursor2.get();
Reference<RowCursor> tempReference_projScope = Reference<RowCursor> tempReference_projScope =
new Reference<RowCursor>(projScope); new Reference<RowCursor>(projScope);
Reference<RowCursor> tempReference_tempCursor3 = Reference<RowCursor> tempReference_tempCursor3 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_projScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_projScope,
tempReference_tempCursor3)); tempReference_tempCursor3));
tempCursor = tempReference_tempCursor3.get(); tempCursor = tempReference_tempCursor3.get();
projScope = tempReference_projScope.get(); projScope = tempReference_projScope.get();
@@ -1567,15 +1567,15 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out checkboxScope).Find(row, c.getPath()); root.get().Clone(out checkboxScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref checkboxScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref checkboxScope,
c.getTypeArgs().clone(), out checkboxScope)); c.typeArgs().clone(), out checkboxScope));
for (boolean item : value.Checkboxes) { for (boolean item : value.Checkboxes) {
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1584,14 +1584,14 @@ public final class TypedSetUnitTests {
root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); root.get().Clone(out tempCursor).Find(row, Utf8String.Empty);
Reference<RowCursor> tempReference_tempCursor4 = Reference<RowCursor> tempReference_tempCursor4 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().<LayoutBoolean>typeAs().WriteSparse(row, ResultAssert.IsSuccess(c.typeArgs().get(0).type().<LayoutBoolean>typeAs().WriteSparse(row,
tempReference_tempCursor4, item)); tempReference_tempCursor4, item));
tempCursor = tempReference_tempCursor4.get(); tempCursor = tempReference_tempCursor4.get();
Reference<RowCursor> tempReference_checkboxScope = Reference<RowCursor> tempReference_checkboxScope =
new Reference<RowCursor>(checkboxScope); new Reference<RowCursor>(checkboxScope);
Reference<RowCursor> tempReference_tempCursor5 = Reference<RowCursor> tempReference_tempCursor5 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_checkboxScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_checkboxScope,
tempReference_tempCursor5)); tempReference_tempCursor5));
tempCursor = tempReference_tempCursor5.get(); tempCursor = tempReference_tempCursor5.get();
checkboxScope = tempReference_checkboxScope.get(); checkboxScope = tempReference_checkboxScope.get();
@@ -1607,18 +1607,18 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out pricesScope).Find(row, c.getPath()); root.get().Clone(out pricesScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref pricesScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref pricesScope,
c.getTypeArgs().clone(), out pricesScope)); c.typeArgs().clone(), out pricesScope));
for (ArrayList<Float> item : value.Prices) { for (ArrayList<Float> item : value.Prices) {
assert item != null; assert item != null;
TypeArgument innerType = c.getTypeArgs().get(0).clone(); TypeArgument innerType = c.typeArgs().get(0).clone();
LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope innerLayout = innerType.getType().<LayoutUniqueScope>TypeAs();
RowCursor tempCursor1; RowCursor tempCursor1;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1657,7 +1657,7 @@ public final class TypedSetUnitTests {
new Reference<RowCursor>(pricesScope); new Reference<RowCursor>(pricesScope);
Reference<RowCursor> tempReference_tempCursor1 = Reference<RowCursor> tempReference_tempCursor1 =
new Reference<RowCursor>(tempCursor1); new Reference<RowCursor>(tempCursor1);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_pricesScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_pricesScope,
tempReference_tempCursor1)); tempReference_tempCursor1));
tempCursor1 = tempReference_tempCursor1.get(); tempCursor1 = tempReference_tempCursor1.get();
pricesScope = tempReference_pricesScope.get(); pricesScope = tempReference_pricesScope.get();
@@ -1673,18 +1673,18 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out nestedScope).Find(row, c.getPath()); root.get().Clone(out nestedScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref nestedScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref nestedScope,
c.getTypeArgs().clone(), out nestedScope)); c.typeArgs().clone(), out nestedScope));
for (ArrayList<ArrayList<Integer>> item : value.Nested) { for (ArrayList<ArrayList<Integer>> item : value.Nested) {
assert item != null; assert item != null;
TypeArgument in2Type = c.getTypeArgs().get(0).clone(); TypeArgument in2Type = c.typeArgs().get(0).clone();
LayoutUniqueScope in2Layout = in2Type.getType().<LayoutUniqueScope>TypeAs(); LayoutUniqueScope in2Layout = in2Type.getType().<LayoutUniqueScope>TypeAs();
RowCursor tempCursor1; RowCursor tempCursor1;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1747,7 +1747,7 @@ public final class TypedSetUnitTests {
new Reference<RowCursor>(nestedScope); new Reference<RowCursor>(nestedScope);
Reference<RowCursor> tempReference_tempCursor12 = Reference<RowCursor> tempReference_tempCursor12 =
new Reference<RowCursor>(tempCursor1); new Reference<RowCursor>(tempCursor1);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_nestedScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_nestedScope,
tempReference_tempCursor12)); tempReference_tempCursor12));
tempCursor1 = tempReference_tempCursor12.get(); tempCursor1 = tempReference_tempCursor12.get();
nestedScope = tempReference_nestedScope.get(); nestedScope = tempReference_nestedScope.get();
@@ -1763,17 +1763,17 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out shoppingScope).Find(row, c.getPath()); root.get().Clone(out shoppingScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref shoppingScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref shoppingScope,
c.getTypeArgs().clone(), out shoppingScope)); c.typeArgs().clone(), out shoppingScope));
for (ShoppingItem item : value.Shopping) { for (ShoppingItem item : value.Shopping) {
TypeArgument innerType = c.getTypeArgs().get(0).clone(); TypeArgument innerType = c.typeArgs().get(0).clone();
LayoutUDT innerLayout = innerType.getType().<LayoutUDT>TypeAs(); LayoutUDT innerLayout = innerType.getType().<LayoutUDT>TypeAs();
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1797,7 +1797,7 @@ public final class TypedSetUnitTests {
new Reference<RowCursor>(shoppingScope); new Reference<RowCursor>(shoppingScope);
Reference<RowCursor> tempReference_tempCursor7 = Reference<RowCursor> tempReference_tempCursor7 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_shoppingScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_shoppingScope,
tempReference_tempCursor7)); tempReference_tempCursor7));
tempCursor = tempReference_tempCursor7.get(); tempCursor = tempReference_tempCursor7.get();
shoppingScope = tempReference_shoppingScope.get(); shoppingScope = tempReference_shoppingScope.get();
@@ -1813,19 +1813,19 @@ public final class TypedSetUnitTests {
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
root.get().Clone(out workScope).Find(row, c.getPath()); root.get().Clone(out workScope).Find(row, c.path());
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these
// cannot be converted using the 'Out' helper class unless the method is within the code being // cannot be converted using the 'Out' helper class unless the method is within the code being
// modified: // modified:
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these
// cannot be converted using the 'Ref' helper class unless the method is within the code being // cannot be converted using the 'Ref' helper class unless the method is within the code being
// modified: // modified:
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().WriteScope(row, ref workScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().WriteScope(row, ref workScope,
c.getTypeArgs().clone(), out workScope)); c.typeArgs().clone(), out workScope));
//C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java:
//ORIGINAL LINE: foreach (Tuple<bool, ulong> item in value.Work) //ORIGINAL LINE: foreach (Tuple<bool, ulong> item in value.Work)
for (Tuple<Boolean, Long> item : value.Work) { for (Tuple<Boolean, Long> item : value.Work) {
TypeArgument innerType = c.getTypeArgs().get(0).clone(); TypeArgument innerType = c.typeArgs().get(0).clone();
LayoutIndexedScope innerLayout = innerType.getType().<LayoutIndexedScope>TypeAs(); LayoutIndexedScope innerLayout = innerType.getType().<LayoutIndexedScope>TypeAs();
RowCursor tempCursor; RowCursor tempCursor;
// TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword -
@@ -1854,7 +1854,7 @@ public final class TypedSetUnitTests {
new Reference<RowCursor>(workScope); new Reference<RowCursor>(workScope);
Reference<RowCursor> tempReference_tempCursor8 = Reference<RowCursor> tempReference_tempCursor8 =
new Reference<RowCursor>(tempCursor); new Reference<RowCursor>(tempCursor);
ResultAssert.IsSuccess(c.<LayoutUniqueScope>TypeAs().MoveField(row, tempReference_workScope, ResultAssert.IsSuccess(c.<LayoutUniqueScope>typeAs().MoveField(row, tempReference_workScope,
tempReference_tempCursor8)); tempReference_tempCursor8));
tempCursor = tempReference_tempCursor8.get(); tempCursor = tempReference_tempCursor8.get();
workScope = tempReference_workScope.get(); workScope = tempReference_workScope.get();