From ab82943fe0059ff08eaa667d0d80ee4dbc8feaea Mon Sep 17 00:00:00 2001 From: David Noble Date: Fri, 30 Aug 2019 23:06:32 -0700 Subject: [PATCH] Progressed on port from dotnet to java --- jre/pom.xml | 7 + .../hybridrow/DefaultSpanResizer.java | 36 --- .../serialization/hybridrow/RowBuffer.java | 62 ++-- .../serialization/hybridrow/SchemaId.java | 38 +-- .../serialization/hybridrow/io/RowReader.java | 8 +- .../hybridrow/layouts/Layout.java | 76 ++--- .../hybridrow/layouts/LayoutBinary.java | 26 +- .../hybridrow/layouts/LayoutBit.java | 89 ++---- .../hybridrow/layouts/LayoutBoolean.java | 12 +- .../hybridrow/layouts/LayoutBuilder.java | 125 ++++---- .../hybridrow/layouts/LayoutColumn.java | 278 ++++++++---------- .../hybridrow/layouts/LayoutCompiler.java | 12 +- .../hybridrow/layouts/LayoutDateTime.java | 4 +- .../hybridrow/layouts/LayoutDecimal.java | 21 +- .../hybridrow/layouts/LayoutFloat128.java | 19 +- .../hybridrow/layouts/LayoutFloat32.java | 8 +- .../hybridrow/layouts/LayoutFloat64.java | 8 +- .../hybridrow/layouts/LayoutGuid.java | 21 +- .../hybridrow/layouts/LayoutIndexedScope.java | 4 - .../hybridrow/layouts/LayoutInt16.java | 8 +- .../hybridrow/layouts/LayoutInt32.java | 8 +- .../hybridrow/layouts/LayoutInt64.java | 8 +- .../hybridrow/layouts/LayoutInt8.java | 8 +- .../layouts/LayoutMongoDbObjectId.java | 19 +- .../hybridrow/layouts/LayoutNull.java | 15 +- .../hybridrow/layouts/LayoutNullable.java | 2 +- .../hybridrow/layouts/LayoutScope.java | 8 +- .../hybridrow/layouts/LayoutTagged.java | 2 +- .../hybridrow/layouts/LayoutTagged2.java | 2 +- .../hybridrow/layouts/LayoutTuple.java | 2 +- .../hybridrow/layouts/LayoutType.java | 103 ++++--- .../hybridrow/layouts/LayoutTypedArray.java | 2 +- .../hybridrow/layouts/LayoutTypedMap.java | 2 +- .../hybridrow/layouts/LayoutTypedSet.java | 2 +- .../hybridrow/layouts/LayoutTypedTuple.java | 2 +- .../hybridrow/layouts/LayoutUDT.java | 2 +- .../hybridrow/layouts/LayoutUInt16.java | 8 +- .../hybridrow/layouts/LayoutUInt32.java | 8 +- .../hybridrow/layouts/LayoutUInt64.java | 8 +- .../hybridrow/layouts/LayoutUInt8.java | 8 +- .../hybridrow/layouts/LayoutUniqueScope.java | 4 +- .../hybridrow/layouts/LayoutUnixDateTime.java | 19 +- .../hybridrow/layouts/LayoutUtf8.java | 24 +- .../hybridrow/layouts/LayoutVarInt.java | 12 +- .../hybridrow/layouts/LayoutVarUInt.java | 12 +- .../hybridrow/perf/BsonRowGenerator.java | 4 +- .../hybridrow/perf/CodeGenRowGenerator.java | 30 +- .../unit/LayoutCompilerUnitTests.java | 90 +++--- .../hybridrow/unit/NullableUnitTests.java | 56 ++-- .../unit/RowOperationDispatcher.java | 6 +- .../hybridrow/unit/RowWriterUnitTests.java | 34 +-- .../hybridrow/unit/TypedMapUnitTests.java | 110 +++---- .../hybridrow/unit/TypedSetUnitTests.java | 150 +++++----- 53 files changed, 764 insertions(+), 868 deletions(-) delete mode 100644 jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/DefaultSpanResizer.java diff --git a/jre/pom.xml b/jre/pom.xml index 667fd75..504db4c 100644 --- a/jre/pom.xml +++ b/jre/pom.xml @@ -36,6 +36,7 @@ Licensed under the MIT License. unit + 8.3.0 28.0-jre 2.9.9 1.10.19 @@ -79,6 +80,12 @@ Licensed under the MIT License. ${netty.version} + + it.unimi.dsi + fastutil + ${fastutil.version} + + org.mockito mockito-core diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/DefaultSpanResizer.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/DefaultSpanResizer.java deleted file mode 100644 index ce1a4d7..0000000 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/DefaultSpanResizer.java +++ /dev/null @@ -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 implements ISpanResizer { - // 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 Default = new - // DefaultSpanResizer(); - public static final DefaultSpanResizer Default = new DefaultSpanResizer(); - - private DefaultSpanResizer() { - } - - /** - * - */ - - public final Span 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 Resize(int minimumLength, Span buffer = default) - public final Span Resize(int minimumLength, Span buffer) { - //C# TO JAVA CONVERTER WARNING: Java does not allow direct instantiation of arrays of generic type parameters: - //ORIGINAL LINE: Span next = new Memory(new T[Math.Max(minimumLength, buffer.Length)]).Span; - Span next = (new Memory((T[])new Object[Math.max(minimumLength, buffer.Length)])).Span; - if (!buffer.IsEmpty && next.Slice(0, buffer.Length) != buffer) { - buffer.CopyTo(next); - } - - return next; - } -} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowBuffer.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowBuffer.java index 0b73ecf..fa73aed 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowBuffer.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowBuffer.java @@ -216,18 +216,18 @@ public final class RowBuffer { * @param srcEdit The field to move into the set/map. * @return The prepared edit context. */ - public RowCursor PrepareSparseMove(Reference scope, Reference srcEdit) { - checkArgument(scope.get().scopeType().isUniqueScope()); + public RowCursor prepareSparseMove(RowCursor scope, RowCursor srcEdit) { + checkArgument(scope.scopeType().isUniqueScope()); - checkArgument(scope.get().index() == 0); + checkArgument(scope.index() == 0); RowCursor dstEdit; // 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: - scope.get().Clone(out dstEdit); + scope.Clone(out dstEdit); - dstEdit.metaOffset(scope.get().valueOffset()); + dstEdit.metaOffset(scope.valueOffset()); 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()) { Reference tempReference_dstEdit = new Reference(dstEdit); @@ -368,7 +368,7 @@ public final class RowBuffer { return result; } - public boolean ReadBit(int offset, LayoutBit bit) { + public boolean readBit(int offset, LayoutBit bit) { if (bit.getIsInvalid()) { 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: //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: - 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) { @@ -557,7 +557,7 @@ public final class RowBuffer { // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal LayoutType ReadSparseTypeCode(int // offset) - public LayoutType ReadSparseTypeCode(int offset) { + public LayoutType readSparseTypeCode(int offset) { return LayoutType.FromCode(LayoutCode.forValue(this.ReadUInt8(offset))); } @@ -1002,7 +1002,7 @@ public final class RowBuffer { spaceNeeded = tempOut_spaceNeeded.get(); metaBytes = tempOut_metaBytes.get(); 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); newScope.setAndGet(new RowCursor()); 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: //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: - this.buffer[bit.GetOffset(offset)] |= (byte)(1 << bit.GetBit()); + this.buffer[bit.offset(offset)] |= (byte)(1 << bit.bit()); } public void WriteSparseString(Reference edit, Utf8Span value, UpdateOptions options) { @@ -1123,11 +1123,11 @@ public final class RowBuffer { } 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: //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: - 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 shift) { @@ -1567,7 +1567,7 @@ public final class RowBuffer { spaceNeeded = tempOut_spaceNeeded.get(); metaBytes = tempOut_metaBytes.get(); 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); newScope.setAndGet(new RowCursor()); newScope.get().scopeType(scopeType); @@ -1601,11 +1601,11 @@ public final class RowBuffer { this.WriteSparseMetadata(edit, scopeType, typeArgs.clone(), metaBytes); int valueOffset = edit.get().valueOffset(); for (int i = 0; i < typeArgs.count(); i++) { - this.WriteSparseTypeCode(valueOffset, LayoutCode.NULL); + this.writeSparseTypeCode(valueOffset, LayoutCode.NULL); valueOffset += (LayoutCode.SIZE / Byte.SIZE); } - this.WriteSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); + this.writeSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); checkState(spaceNeeded == metaBytes + numBytes); newScope.setAndGet(new RowCursor()); newScope.get().scopeType(scopeType); @@ -1641,7 +1641,7 @@ public final class RowBuffer { // Write scope terminator. int valueOffset = edit.get().valueOffset() + udt.size(); - this.WriteSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); + this.writeSparseTypeCode(valueOffset, LayoutCode.END_SCOPE); checkState(spaceNeeded == metaBytes + numBytes); newScope.setAndGet(new RowCursor()); 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: //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void WriteSparseTypeCode(int offset, // 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: //ORIGINAL LINE: this.WriteUInt8(offset, (byte)code); this.WriteUInt8(offset, (byte) code.value()); @@ -1955,9 +1955,9 @@ public final class RowBuffer { * * @param edit The field to delete. */ - public void deleteSparse(Reference edit) { + public void deleteSparse(RowCursor edit) { // If the field doesn't exist, then nothing to do. - if (!edit.get().exists()) { + if (!edit.exists()) { return; } @@ -2010,14 +2010,14 @@ public final class RowBuffer { int offset = scopeOffset + layout.size(); for (int i = layout.numFixed(); i < index; i++) { LayoutColumn col = columns[i]; - if (this.ReadBit(scopeOffset, col.getNullBit().clone())) { + if (this.readBit(scopeOffset, col.getNullBit().clone())) { int lengthSizeInBytes; Out tempOut_lengthSizeInBytes = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ulong valueSizeInBytes = this.Read7BitEncodedUInt(offset, out int lengthSizeInBytes); long valueSizeInBytes = this.read7BitEncodedUInt(offset, tempOut_lengthSizeInBytes); lengthSizeInBytes = tempOut_lengthSizeInBytes.get(); - if (col.getType().getIsVarint()) { + if (col.type().getIsVarint()) { offset += lengthSizeInBytes; } else { offset += (int) valueSizeInBytes + lengthSizeInBytes; @@ -2510,14 +2510,14 @@ public final class RowBuffer { //ORIGINAL LINE: case LayoutNull _: case LayoutNull _: - this.WriteSparseTypeCode(offset, code.LayoutCode); + this.writeSparseTypeCode(offset, code.LayoutCode); return 1; // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: //ORIGINAL LINE: case LayoutBoolean _: case LayoutBoolean _: - this.WriteSparseTypeCode(offset, LayoutCode.BOOLEAN_FALSE); + this.writeSparseTypeCode(offset, LayoutCode.BOOLEAN_FALSE); return 1; // 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 _: // 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); // 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. 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()); // 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); // 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); default: @@ -3117,7 +3117,7 @@ public final class RowBuffer { edit.get().scopeType().SetImplicitTypeCode(edit); edit.get().valueOffset(edit.get().metaOffset()); } 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().cellTypeArgs = TypeArgumentList.EMPTY; if (edit.get().cellType() instanceof LayoutEndScope) { @@ -3202,10 +3202,10 @@ public final class RowBuffer { } } else { if (code == LayoutTypes.Boolean) { - code = this.ReadSparseTypeCode(edit.metaOffset()); + code = this.readSparseTypeCode(edit.metaOffset()); checkState(code == LayoutTypes.Boolean || code == LayoutTypes.BooleanFalse); } else { - checkState(this.ReadSparseTypeCode(edit.metaOffset()) == code); + checkState(this.readSparseTypeCode(edit.metaOffset()) == code); } } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/SchemaId.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/SchemaId.java index 6eb8687..964e50d 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/SchemaId.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/SchemaId.java @@ -13,6 +13,8 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.exc.MismatchedInputException; 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; @@ -26,13 +28,13 @@ import static com.google.common.base.Strings.lenientFormat; @JsonSerialize(using = SchemaId.JsonSerializer.class) public final class SchemaId { - // TODO: DANOBLE: Consider caching SchemaId instances to reduce memory footprint - public static final SchemaId INVALID = null; 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 cache = new Int2ReferenceOpenHashMap<>(); - private static long MAX_VALUE = 0x00000000FFFFFFFFL; private final int value; /** @@ -62,11 +64,25 @@ public final class SchemaId { 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 public int hashCode() { return Integer.valueOf(this.value()).hashCode(); } + @Override + public String toString() { + return String.valueOf(this.value()); + } + /** * The underlying integer value of this {@link SchemaId} * @@ -76,20 +92,6 @@ public final class SchemaId { 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 { private JsonDeserializer() { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReader.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReader.java index 313120e..d62a132 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReader.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReader.java @@ -298,7 +298,7 @@ public final class RowReader { checkState(this.cursor.scopeType() instanceof LayoutUDT); 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. // TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java: // goto case States.Schematized; @@ -1104,7 +1104,7 @@ public final class RowReader { return Result.TypeMismatch; } - switch (col == null ? null : col.getStorage()) { + switch (col == null ? null : col.storage()) { case Fixed: Reference tempReference_row = new Reference(this.row); @@ -1142,7 +1142,7 @@ public final class RowReader { return Result.TypeMismatch; } - switch (col == null ? null : col.getStorage()) { + switch (col == null ? null : col.storage()) { case Fixed: Reference tempReference_row = new Reference(this.row); Reference tempReference_cursor = new Reference(this.cursor); @@ -1180,7 +1180,7 @@ public final class RowReader { return Result.TypeMismatch; } - switch (col == null ? null : col.getStorage()) { + switch (col == null ? null : col.storage()) { case Fixed: Reference tempReference_row = new Reference(this.row); Reference tempReference_cursor = new Reference(this.cursor); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/Layout.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/Layout.java index e6acd60..ee2ab85 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/Layout.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/Layout.java @@ -3,7 +3,6 @@ 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.UtfAnyString; 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.StorageKind; +import javax.annotation.Nonnull; import java.util.ArrayList; 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 @@ -36,39 +39,45 @@ public final class Layout { private final int numVariable; private final HashMap pathMap; private final HashMap pathStringMap; - private final SchemaId schemaId = new SchemaId(); + private final SchemaId schemaId; private final int size; private final StringTokenizer tokenizer; private final LayoutColumn[] topColumns; - public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, ArrayList columns) { + public Layout( + @Nonnull final String name, @Nonnull final SchemaId schemaId, final int numBitmaskBytes, + final int minRequiredSize, @Nonnull final ArrayList columns + ) { + checkNotNull(name); + checkNotNull(schemaId); + checkNotNull(columns); this.name = name; - this.schemaId = schemaId.clone(); + this.schemaId = schemaId; this.numBitmaskBytes = numBitmaskBytes; this.size = minRequiredSize; this.tokenizer = new StringTokenizer(); - this.pathMap = new HashMap(columns.size(), SamplingUtf8StringComparer.Default); - this.pathStringMap = new HashMap(columns.size()); + this.pathMap = new HashMap<>(columns.size()); + this.pathStringMap = new HashMap<>(columns.size()); - final ArrayList top = new ArrayList(columns.size()); + final ArrayList top = new ArrayList<>(columns.size()); int numFixed = 0; int numVariable = 0; - for (LayoutColumn c : columns) { + for (LayoutColumn column : columns) { - this.tokenizer().add(c.getPath()); - this.pathMap.put(c.getFullPath(), c); - this.pathStringMap.put(c.getFullPath().toString(), c); + this.tokenizer().add(column.path()); + this.pathMap.put(column.fullPath(), column); + this.pathStringMap.put(column.fullPath().toString(), column); - if (c.getStorage() == StorageKind.Fixed) { + if (column.storage() == StorageKind.Fixed) { numFixed++; - } else if (c.getStorage() == StorageKind.Variable) { + } else if (column.storage() == StorageKind.Variable) { numVariable++; } - if (c.getParent() == null) { - top.add(c); + if (column.parent() == null) { + 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 column If found, the column specification, otherwise {@code null}. - * @return {@code true} if a column with the path is found, otherwise {@code false}. + * @param path path of the column to find + * @return {@link LayoutColumn}, if a column with the {@code path} is found, {@link Optional#empty()} */ - public boolean TryFind(UtfAnyString path, Out column) { + public Optional tryFind(@Nonnull UtfAnyString path) { + + checkNotNull(path); if (path.isNull()) { - column.setAndGet(null); - return false; + return Optional.empty(); } 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 (this.pathStringMap.containsKey(value) && (column.setAndGet(this.pathStringMap.get(value))) == column.get()); + return Optional.ofNullable(this.pathStringMap.get(path.toUtf16())); } /** * Finds a column specification for a column with a matching path. * * @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. */ - public boolean TryFind(String path, Out column) { - return (this.pathStringMap.containsKey(path) && (column.setAndGet(this.pathStringMap.get(path))) == column.get()); + public Optional tryFind(@Nonnull String path) { + 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("\tFixedSize: %1$s\n", this.size())); - for (LayoutColumn c : this.topColumns) { - if (c.getType().getIsFixed()) { - if (c.getType().getIsBool()) { - 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())); + for (LayoutColumn column : this.topColumns) { + if (column.type().isFixed()) { + if (column.type().isBoolean()) { + 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 { - 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 { - 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())); } } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBinary.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBinary.java index 7edc7cc..4c332ae 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBinary.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBinary.java @@ -32,14 +32,14 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // byte[] value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { ReadOnlySpan 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: //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 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() :) default return r; @@ -52,7 +52,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa Out> value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); 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); return Result.NotFound; } @@ -64,7 +64,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //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) @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { ReadOnlySpan 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: @@ -93,14 +93,14 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // byte[] value) @Override - public Result readVariable(Reference b, Reference scope, LayoutColumn col + public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column , Out value) { ReadOnlySpan 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: //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 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() :) default return r; @@ -112,7 +112,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa public Result ReadVariable(Reference b, Reference scope, LayoutColumn col , Out> value) { 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); return Result.NotFound; } @@ -127,12 +127,12 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte[] // value) @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, byte[] value) { checkArgument(value != null); //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(value)); - return this.WriteFixed(b, scope, col, new ReadOnlySpan(value)); + return this.WriteFixed(b, scope, column, new ReadOnlySpan(value)); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -170,7 +170,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa } @Override - public Result writeSparse(Reference b, Reference edit, byte[] value) { + public Result writeSparse(RowBuffer b, RowCursor edit, byte[] value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } @@ -179,7 +179,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result writeSparse(Reference b, Reference edit, byte[] value, + public Result writeSparse(RowBuffer b, RowCursor edit, byte[] value, UpdateOptions options) { checkArgument(value != null); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -254,7 +254,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa 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(), col.getOffset()); int shift; @@ -282,7 +282,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa 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(), col.getOffset()); int shift; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBit.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBit.java index 94bc1ef..4f320a4 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBit.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBit.java @@ -5,19 +5,12 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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 -// from the original: -//ORIGINAL LINE: public readonly struct LayoutBit : IEquatable -//C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# readonly struct: -public final class LayoutBit implements IEquatable { +public final class LayoutBit { /** * 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; /** @@ -25,58 +18,50 @@ public final class LayoutBit implements IEquatable { * * @param index The 0-based offset into the layout bitmask. */ - public LayoutBit() { - } - public LayoutBit(int index) { checkArgument(index >= -1); 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 divisor The divisor to divide by. * @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; } /** - * Returns the 0-based bit from the beginning of the byte that contains this bit. - * Also see {@link GetOffset} to identify relevant byte. + * Zero-based bit from the beginning of the byte that contains this bit + *

+ * Also see {@link #offset} to identify relevant byte. * * @return The bit of the byte within the bitmask. */ - // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetBit() - public int GetBit() { - return this.index % LayoutType.BitsPerByte; + public int bit() { + return this.index() % LayoutTypes.BitsPerByte; } /** - * Returns the 0-based byte offset from the beginning of the row or scope that contains the - * bit from the bitmask. + * Zero-based offset into the layout 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 *

- * 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. * @return The byte offset containing this bit. */ - // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] public int GetOffset(int offset) - public int GetOffset(int offset) { - return offset + (this.index / LayoutType.BitsPerByte); - } - - public LayoutBit clone() { - LayoutBit varCopy = new LayoutBit(); - - varCopy.index = this.index; - - return varCopy; + public int offset(int offset) { + return offset + (this.index() / LayoutTypes.BitsPerByte); } @Override @@ -84,45 +69,19 @@ public final class LayoutBit implements IEquatable { 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) { - return this.index == other.index; + return other != null && this.index() == other.index(); } @Override 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. */ - public static class Allocator { + static class Allocator { /** * The next bit to allocate. */ @@ -139,7 +98,7 @@ public final class LayoutBit implements IEquatable { * The number of bytes needed to hold all bits so far allocated. */ public final int getNumBytes() { - return LayoutBit.DivCeiling(this.next, LayoutType.BitsPerByte); + return LayoutBit.divCeiling(this.next, LayoutTypes.BitsPerByte); } /** diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBoolean.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBoolean.java index b3abac0..fed0fac 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBoolean.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBoolean.java @@ -29,20 +29,20 @@ public final class LayoutBoolean extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -63,9 +63,9 @@ public final class LayoutBoolean extends LayoutType { } if (value) { - b.get().SetBit(scope.get().start(), col.getBoolBit().clone()); + b.get().SetBit(scope.get().start(), col.getBooleanBit().clone()); } 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()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBuilder.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBuilder.java index a7c1d7d..4faad48 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBuilder.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutBuilder.java @@ -12,12 +12,12 @@ import java.util.Stack; import static com.google.common.base.Preconditions.checkArgument; public final class LayoutBuilder { - private LayoutBit.Allocator bitallocator; + private LayoutBit.Allocator bitAllocator; private ArrayList fixedColumns; private int fixedCount; private int fixedSize; private String name; - private SchemaId schemaId = new SchemaId(); + private SchemaId schemaId; private Stack scope; private ArrayList sparseColumns; private int sparseCount; @@ -32,112 +32,103 @@ public final class LayoutBuilder { // ] public LayoutBuilder(String name, SchemaId schemaId) { this.name = name; - this.schemaId = schemaId.clone(); - this.Reset(); + this.schemaId = schemaId; + this.reset(); } - public void AddFixedColumn(String path, LayoutType type, boolean nullable) { - AddFixedColumn(path, type, nullable, 0); - } + public void addFixedColumn(String path, LayoutType type, boolean nullable, int length) { - //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(!type.getIsVarint()); + checkArgument(!type.isVarint()); - LayoutColumn col; - if (type.getIsNull()) { + LayoutColumn column; + if (type.isNull()) { checkArgument(nullable); - LayoutBit nullbit = this.bitallocator.Allocate().clone(); - col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), - this.fixedCount, 0, nullbit.clone(), LayoutBit.Invalid, 0); - } else if (type.getIsBool()) { - LayoutBit nullbit = nullable ? this.bitallocator.Allocate() : LayoutBit.Invalid; - LayoutBit boolbit = this.bitallocator.Allocate().clone(); - col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), - this.fixedCount, 0, nullbit.clone(), boolbit.clone(), 0); + LayoutBit nullBit = this.bitAllocator.Allocate(); + column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(), + this.fixedCount, 0, nullBit, LayoutBit.INVALID, 0); + } else if (type.isBoolean()) { + LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID; + LayoutBit boolbit = this.bitAllocator.Allocate(); + column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(), + this.fixedCount, 0, nullBit, boolbit, 0); } else { - LayoutBit nullBit = nullable ? this.bitallocator.Allocate() : LayoutBit.Invalid; - col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.getParent(), - this.fixedCount, this.fixedSize, nullBit.clone(), LayoutBit.Invalid, length); + LayoutBit nullBit = nullable ? this.bitAllocator.Allocate() : LayoutBit.INVALID; + column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Fixed, this.parent(), + 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.fixedColumns.add(col); + this.fixedColumns.add(column); } - 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); + public void addObjectScope(String path, LayoutType type) { + + 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(col); - this.scope.push(col); + this.sparseColumns.add(column); + this.scope.push(column); } - 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); + public void addSparseColumn(String path, LayoutType type) { + + 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.sparseColumns.add(col); } - public void AddTypedScope(String path, LayoutType type, TypeArgumentList typeArgs) { - 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) { + public void addVariableColumn(String path, LayoutType type, int length) { checkArgument(length >= 0); - checkArgument(type.getAllowVariable()); + checkArgument(type.allowVariable()); - LayoutColumn col = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Variable, - this.getParent(), this.varCount, this.varCount, this.bitallocator.Allocate().clone(), LayoutBit.Invalid, - length); + LayoutColumn column = new LayoutColumn(path, type, TypeArgumentList.EMPTY, StorageKind.Variable, this.parent(), + this.varCount, this.varCount, this.bitAllocator.Allocate(), LayoutBit.INVALID, length); this.varCount++; - this.varColumns.add(col); + this.varColumns.add(column); } - public void AddVariableColumn(String path, LayoutType type) { - AddVariableColumn(path, type, 0); - } - - public Layout Build() { + public Layout build() { // Compute offset deltas. Offset bools by the present byte count, and fixed fields by the sum of the present // and bool count. - int fixedDelta = this.bitallocator.getNumBytes(); + int fixedDelta = this.bitAllocator.getNumBytes(); int varIndexDelta = this.fixedCount; // Update the fixedColumns with the delta before freezing them. ArrayList updatedColumns = new ArrayList(this.fixedColumns.size() + this.varColumns.size()); - for (LayoutColumn c : this.fixedColumns) { - c.SetOffset(c.getOffset() + fixedDelta); - updatedColumns.add(c); + for (LayoutColumn column : this.fixedColumns) { + column.offset(column.offset() + fixedDelta); + 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. - c.SetIndex(c.getIndex() + varIndexDelta); - updatedColumns.add(c); + column.index(column.index() + varIndexDelta); + updatedColumns.add(column); } updatedColumns.addAll(this.sparseColumns); - Layout layout = new Layout(this.name, this.schemaId.clone(), this.bitallocator.getNumBytes(), this.fixedSize + fixedDelta, updatedColumns); - this.Reset(); + Layout layout = new Layout(this.name, this.schemaId, this.bitAllocator.getNumBytes(), this.fixedSize + fixedDelta, updatedColumns); + this.reset(); return layout; } @@ -146,7 +137,7 @@ public final class LayoutBuilder { this.scope.pop(); } - private LayoutColumn getParent() { + private LayoutColumn parent() { if (this.scope.empty()) { return null; } @@ -154,8 +145,8 @@ public final class LayoutBuilder { return this.scope.peek(); } - private void Reset() { - this.bitallocator = new LayoutBit.Allocator(); + private void reset() { + this.bitAllocator = new LayoutBit.Allocator(); this.fixedSize = 0; this.fixedCount = 0; this.fixedColumns = new ArrayList(); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutColumn.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutColumn.java index c622aae..84df3be 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutColumn.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutColumn.java @@ -6,235 +6,205 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; import com.azure.data.cosmos.core.Utf8String; 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 { - /** - * For bool fields, 0-based index into the bit mask for the bool value. - */ - private LayoutBit boolBit = new LayoutBit(); - /** - * The full logical path of the field within the row. - */ - private Utf8String fullPath; - /** - * 0-based index of the column within the structure. Also indicates which presence bit - * controls this column. - */ + + private final LayoutBit booleanBit; + private final Utf8String fullPath; + private final LayoutBit nullBit; + private final LayoutColumn parent; + private final Utf8String path; + private final int size; + private final StorageKind storage; + private final LayoutType type; + private final TypeArgument typeArg; + private final TypeArgumentList typeArgs; + 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. - * - * If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the - * field from the beginning of the variable length segment. - * - * For all other values of {@link storage}, {@link Offset} is ignored. - */ 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 type Type of the field. - * @param storage Storage encoding of the field. - * @param parent The layout of the parent scope, if a nested column. - * @param index 0-based column index. - * @param offset 0-based Offset from beginning of serialization. - * @param nullBit 0-based index into the bit mask for the null bit. - * @param boolBit For bool fields, 0-based index into the bit mask for the bool value. - * @param length For variable length types the length, otherwise 0. - * @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type - * parameters. + * @param path The path to the field relative to parent scope. + * @param type Type of the field. + * @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. + * @param storage Storage encoding of the field. + * @param parent The layout of the parent scope, if a nested column. + * @param index zero-based column index. + * @param offset zero-based Offset from beginning of serialization. + * @param nullBit zero-based index into the bit mask for the null bit. + * @param booleanBit For bool fields, zero-based index into the bit mask for the boolean value. + * @param length For variable length types the length, otherwise {@code 0}. */ + 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, - LayoutColumn parent, int index, int offset, LayoutBit nullBit, LayoutBit boolBit) { - this(path, type, typeArgs, storage, parent, index, offset, nullBit, boolBit, 0); - } + checkNotNull(path); + checkNotNull(type); + 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: - //ORIGINAL LINE: internal LayoutColumn(string path, LayoutType type, TypeArgumentList typeArgs, StorageKind - // 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.path = Utf8String.transcodeUtf16(path); + this.fullPath = Utf8String.transcodeUtf16(fullPath(parent, path)); this.type = type; - this.typeArgs = typeArgs.clone(); - this.typeArg = new TypeArgument(type, typeArgs.clone()); + this.typeArgs = typeArgs; + this.typeArg = new TypeArgument(type, typeArgs); this.storage = storage; this.parent = parent; this.index = index; this.offset = offset; - this.nullBit = nullBit.clone(); - this.boolBit = boolBit.clone(); - this.size = this.typeArg.type().getIsFixed() ? type.Size : length; + this.nullBit = nullBit; + this.booleanBit = booleanBit; + this.size = this.typeArg().type().isFixed() ? type.size() : length; } /** - * The full logical path of the field within the row. - *

- * 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'. + * For bool fields, zero-based index into the bit mask for the bool value. */ - public Utf8String getFullPath() { + public @Nonnull LayoutBit booleanBit() { + return this.booleanBit; + } + + /** + * Full logical path of the field within the row + *

+ * 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; } /** - * 0-based index of the column within the structure. Also indicates which presence bit - * controls this column. + * Zero-based index of the column within the structure + *

+ * This value also indicates which presence bit controls this column. */ - public int getIndex() { + public int 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. + *

+ * If {@link #storage} equals {@link StorageKind#Variable} then the zero-based index of the field from the + * beginning of the variable length segment. + *

+ * 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; } /** * The relative path of the field within its parent scope. *

- * 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'. + * 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 getPath() { + public @Nonnull Utf8String 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. */ - public StorageKind getStorage() { + public @Nonnull StorageKind storage() { return this.storage; } /** * The physical layout type of the field. */ - public LayoutType getType() { + public @Nonnull LayoutType type() { return this.type; } /** - * The full logical type. + * The full logical type */ - public TypeArgument getTypeArg() { - return this.typeArg.clone(); + public @Nonnull TypeArgument typeArg() { + return this.typeArg; } /** * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. */ - public TypeArgumentList getTypeArgs() { - return this.typeArgs.clone(); - } - - public void SetIndex(int index) { - this.index = index; - } - - public void SetOffset(int offset) { - this.offset = offset; + public @Nonnull TypeArgumentList typeArgs() { + return this.typeArgs; } /** * 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: - //ORIGINAL LINE: [DebuggerHidden] public T TypeAs() where T : ILayoutType - public T TypeAs() { - return this.type.typeAs(); + @SuppressWarnings("unchecked") + public @Nonnull T typeAs() { + return (T) 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. - */ - 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. - * - * If {@link storage} equals {@link StorageKind.Variable} then the 0-based index of the - * field from the beginning of the variable length segment. - * - * 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. - * - * 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. + * Computes the full logical path to the column * - * @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. - * @return The full logical path. + * @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 + * @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) { - switch (LayoutCodeTraits.ClearImmutableBit(parent.type.LayoutCode)) { + switch (LayoutCodeTraits.ClearImmutableBit(parent.type().layoutCode())) { case OBJECT_SCOPE: case SCHEMA: - return parent.getFullPath().toString() + "." + path; + return parent.fullPath().toString() + "." + path; case ARRAY_SCOPE: case TYPED_ARRAY_SCOPE: case TYPED_SET_SCOPE: case TYPED_MAP_SCOPE: - return parent.getFullPath().toString() + "[]" + path; + return parent.fullPath().toString() + "[]" + path; default: - throw new IllegalStateException(lenientFormat("Parent scope type not supported: %s", parent.type.LayoutCode)); - return null; + final String message = lenientFormat("Parent scope type not supported: %s", parent.type().layoutCode()); + throw new IllegalStateException(message); } } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCompiler.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCompiler.java index d8d3225..386ed12 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCompiler.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCompiler.java @@ -45,7 +45,7 @@ public final class LayoutCompiler { LayoutBuilder builder = new LayoutBuilder(schema.getName(), schema.getSchemaId().clone()); LayoutCompiler.AddProperties(builder, ns, LayoutCode.SCHEMA, schema.getProperties()); - return builder.Build(); + return builder.build(); } private static void AddProperties(LayoutBuilder builder, Namespace ns, LayoutCode scope, @@ -63,7 +63,7 @@ public final class LayoutCompiler { } ObjectPropertyType op = (ObjectPropertyType)p.getPropertyType(); - builder.AddObjectScope(p.getPath(), type); + builder.addObjectScope(p.getPath(), type); LayoutCompiler.AddProperties(builder, ns, type.LayoutCode, op.getProperties()); builder.EndObjectScope(); break; @@ -84,7 +84,7 @@ public final class LayoutCompiler { 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; } @@ -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; case Variable: if (LayoutCodeTraits.ClearImmutableBit(scope) != LayoutCode.SCHEMA) { @@ -122,7 +122,7 @@ public final class LayoutCompiler { "supported."); } - builder.AddVariableColumn(p.getPath(), type, pp.getLength()); + builder.addVariableColumn(p.getPath(), type, pp.getLength()); break; case Sparse: if (!pp.getNullable()) { @@ -130,7 +130,7 @@ public final class LayoutCompiler { "supported."); } - builder.AddSparseColumn(p.getPath(), type); + builder.addSparseColumn(p.getPath(), type); break; default: throw new LayoutCompilationException(String.format("Unknown storage specification: " + diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDateTime.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDateTime.java index 43b0089..84957dc 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDateTime.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDateTime.java @@ -30,7 +30,7 @@ public final class LayoutDateTime extends LayoutType { public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, Out value) { 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); return Result.NotFound; } @@ -80,7 +80,7 @@ public final class LayoutDateTime extends LayoutType { } @Override - public Result writeSparse(Reference b, Reference edit, DateTime value) { + public Result writeSparse(RowBuffer b, RowCursor edit, DateTime value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDecimal.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDecimal.java index d1fdab3..aa5dc81 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDecimal.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutDecimal.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -28,20 +27,20 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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)); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -54,15 +53,15 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, BigDecimal value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().WriteDecimal(scope.get().start() + col.getOffset(), value); - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().WriteDecimal(scope.get().start() + column.getOffset(), value); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -70,7 +69,7 @@ public final class LayoutDecimal extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, decimal value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result writeSparse(Reference b, Reference edit, BigDecimal value, + public Result writeSparse(RowBuffer b, RowCursor edit, BigDecimal value, UpdateOptions options) { Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -82,8 +81,8 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result writeSparse(Reference b, Reference edit, - java.math.BigDecimal value) { + public Result writeSparse(RowBuffer b, RowCursor edit, + BigDecimal value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat128.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat128.java index 45c4089..ceae32e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat128.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat128.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -26,20 +25,20 @@ public final class LayoutFloat128 extends LayoutType b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -52,15 +51,15 @@ public final class LayoutFloat128 extends LayoutType b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Float128 value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().writeFloat128(scope.get().start() + col.getOffset(), value); - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().writeFloat128(scope.get().start() + column.getOffset(), value); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -68,7 +67,7 @@ public final class LayoutFloat128 extends LayoutType b, Reference edit, Float128 value, + public Result writeSparse(RowBuffer b, RowCursor edit, Float128 value, UpdateOptions options) { Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -80,7 +79,7 @@ public final class LayoutFloat128 extends LayoutType b, Reference edit, Float128 value) { + public Result writeSparse(RowBuffer b, RowCursor edit, Float128 value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat32.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat32.java index 53bb811..3959e67 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat32.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat32.java @@ -25,20 +25,20 @@ public final class LayoutFloat32 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat64.java index 2220f9c..48e827f 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat64.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat64.java @@ -25,20 +25,20 @@ public final class LayoutFloat64 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutGuid.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutGuid.java index 46a6d63..6e14fa6 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutGuid.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutGuid.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -27,20 +26,20 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -53,15 +52,15 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, UUID value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().WriteGuid(scope.get().start() + col.getOffset(), value); - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().WriteGuid(scope.get().start() + column.getOffset(), value); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -69,7 +68,7 @@ public final class LayoutGuid extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Guid value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result writeSparse(Reference b, Reference edit, UUID value, + public Result writeSparse(RowBuffer b, RowCursor edit, UUID value, UpdateOptions options) { Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -81,8 +80,8 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result writeSparse(Reference b, Reference edit, - java.util.UUID value) { + public Result writeSparse(RowBuffer b, RowCursor edit, + UUID value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutIndexedScope.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutIndexedScope.java index 44690fa..a31ed56 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutIndexedScope.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutIndexedScope.java @@ -14,10 +14,6 @@ public abstract class LayoutIndexedScope extends LayoutScope { LayoutCode code, boolean immutable, boolean isSizedScope, boolean isFixedArity, boolean isUniqueScope, 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); } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt16.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt16.java index 3ebc13b..b40e669 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt16.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt16.java @@ -25,20 +25,20 @@ public final class LayoutInt16 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt32.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt32.java index 4dbe8c3..1b128ed 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt32.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt32.java @@ -25,20 +25,20 @@ public final class LayoutInt32 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt64.java index 959e41d..02c8c4e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt64.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt64.java @@ -25,20 +25,20 @@ public final class LayoutInt64 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt8.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt8.java index 99880c8..2281c5f 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt8.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt8.java @@ -25,20 +25,20 @@ public final class LayoutInt8 extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutMongoDbObjectId.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutMongoDbObjectId.java index fa426c7..c066e01 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutMongoDbObjectId.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutMongoDbObjectId.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -26,20 +25,20 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -52,15 +51,15 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, MongoDbObjectId value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().WriteMongoDbObjectId(scope.get().start() + col.getOffset(), value.clone()); - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().WriteMongoDbObjectId(scope.get().start() + column.getOffset(), value.clone()); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -68,7 +67,7 @@ public final class LayoutMongoDbObjectId extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, MongoDbObjectId value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result writeSparse(Reference b, Reference edit, + public Result writeSparse(RowBuffer b, RowCursor edit, MongoDbObjectId value, UpdateOptions options) { Result result = LayoutType.prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -80,7 +79,7 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result writeSparse(Reference b, Reference edit, + public Result writeSparse(RowBuffer b, RowCursor edit, MongoDbObjectId value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNull.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNull.java index 4a495c3..ebb5421 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNull.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNull.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -30,11 +29,11 @@ public final class LayoutNull extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); 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; } @@ -42,7 +41,7 @@ public final class LayoutNull extends LayoutType { } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -55,14 +54,14 @@ public final class LayoutNull extends LayoutType { } @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, NullValue value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -70,7 +69,7 @@ public final class LayoutNull extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, NullValue value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result writeSparse(Reference b, Reference edit, NullValue value, + public Result writeSparse(RowBuffer b, RowCursor edit, NullValue value, UpdateOptions options) { Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +81,7 @@ public final class LayoutNull extends LayoutType { } @Override - public Result writeSparse(Reference b, Reference edit, NullValue value) { + public Result writeSparse(RowBuffer b, RowCursor edit, NullValue value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNullable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNullable.java index 403a1ca..f201cd8 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNullable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutNullable.java @@ -95,7 +95,7 @@ public final class LayoutNullable extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, value.get(0).typeArgs().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutScope.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutScope.java index 4fc41d4..34f48ac 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutScope.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutScope.java @@ -71,15 +71,15 @@ public abstract class LayoutScope extends LayoutType { return this.isUniqueScope; } - public final Result DeleteScope(Reference b, Reference 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) { return result; } - b.get().deleteSparse(edit); + b.deleteSparse(edit); 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; childScope = tempReference_childScope.get(); if (r != Result.Success) { - this.DeleteScope(b, scope); + this.deleteScope(b, scope); return r; } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged.java index 912bb19..405acfb 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged.java @@ -73,7 +73,7 @@ public final class LayoutTagged extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); lenInBytes += value.get(1).type().writeTypeArgument(row, offset + lenInBytes, value.get(1).typeArgs().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged2.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged2.java index 0ce15ae..df7e304 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged2.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTagged2.java @@ -86,7 +86,7 @@ public final class LayoutTagged2 extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); for (int i = 1; i < value.count(); i++) { TypeArgument arg = value.get(i).clone(); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTuple.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTuple.java index 9293cd8..187d40e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTuple.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTuple.java @@ -73,7 +73,7 @@ public final class LayoutTuple extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference 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); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType.java index 6e7ebdc..d2d2b6e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType.java @@ -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.RowCursor; +import javax.annotation.Nonnull; + import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Strings.lenientFormat; @@ -92,20 +94,20 @@ public abstract class LayoutType implements ILayoutType { return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); } - public final Result deleteFixed(Reference b, Reference 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; } - if (col.getNullBit().getIsInvalid()) { + if (column.nullBit().isInvalid()) { // Cannot delete a non-nullable fixed column. return Result.TypeMismatch; } - b.get().UnsetBit(scope.get().start(), col.getNullBit().clone()); + b.UnsetBit(scope.start(), column.nullBit()); return Result.Success; } @@ -114,8 +116,10 @@ public abstract class LayoutType implements ILayoutType { *

* 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. + * @param b + * @param edit */ - public final Result deleteSparse(Reference b, Reference edit) { + public final Result deleteSparse(RowBuffer b, RowCursor edit) { Result result = LayoutType.prepareSparseDelete(b, edit, this.layoutCode()); @@ -123,7 +127,7 @@ public abstract class LayoutType implements ILayoutType { return result; } - b.get().deleteSparse(edit); + b.deleteSparse(edit); return Result.Success; } @@ -133,21 +137,20 @@ public abstract class LayoutType implements ILayoutType { * 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. */ - public final Result deleteVariable(Reference b, Reference 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; } - boolean exists = b.get().ReadBit(scope.get().start(), col.getNullBit()); + boolean exists = b.readBit(scope.start(), column.nullBit()); if (exists) { - int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), - col.getOffset()); - b.get().deleteVariable(varOffset, this.isVarint()); - b.get().UnsetBit(scope.get().start(), col.getNullBit().clone()); + int varOffset = b.computeVariableValueOffset(scope.layout(), scope.start(), column.offset()); + b.deleteVariable(varOffset, this.isVarint()); + b.UnsetBit(scope.start(), column.nullBit()); } return Result.Success; @@ -159,8 +162,8 @@ public abstract class LayoutType implements ILayoutType { return type; } - public final Result hasValue(Reference b, Reference scope, LayoutColumn col) { - if (!b.get().ReadBit(scope.get().start(), col.getNullBit().clone())) { + public final Result hasValue(RowBuffer b, RowCursor scope, LayoutColumn column) { + if (!b.readBit(scope.start(), column.nullBit())) { return Result.NotFound; } return Result.Success; @@ -186,16 +189,17 @@ public abstract class LayoutType implements ILayoutType { * @param code The expected type of the field. * @return Success if the delete is permitted, the error code otherwise. */ - public static Result prepareSparseDelete(Reference b, Reference edit, LayoutCode code) { - if (edit.get().scopeType().isFixedArity()) { + public static Result prepareSparseDelete(RowBuffer b, RowCursor edit, LayoutCode code) { + + if (edit.scopeType().isFixedArity()) { return Result.TypeConstraint; } - if (edit.get().immutable()) { + if (edit.immutable()) { 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; } @@ -216,16 +220,16 @@ public abstract class LayoutType implements ILayoutType { * The source field is delete if the move prepare fails with a destination error. */ public static Result prepareSparseMove( - Reference b, - Reference destinationScope, + RowBuffer b, + RowCursor destinationScope, LayoutScope destinationCode, TypeArgument elementType, - Reference srcEdit, + RowCursor srcEdit, UpdateOptions options, Out dstEdit ) { - checkArgument(destinationScope.get().scopeType() == destinationCode); - checkArgument(destinationScope.get().index() == 0, "Can only insert into a edit at the root"); + checkArgument(destinationScope.scopeType() == destinationCode); + checkArgument(destinationScope.index() == 0, "Can only insert into a edit at the root"); // Prepare the delete of the source Result result = LayoutType.prepareSparseDelete(b, srcEdit, elementType.type().layoutCode()); @@ -235,39 +239,39 @@ public abstract class LayoutType implements ILayoutType { return result; } - if (!srcEdit.get().exists()) { + if (!srcEdit.exists()) { dstEdit.setAndGet(null); return Result.NotFound; } - if (destinationScope.get().immutable()) { - b.get().deleteSparse(srcEdit); + if (destinationScope.immutable()) { + b.deleteSparse(srcEdit); dstEdit.setAndGet(null); return Result.InsufficientPermissions; } - if (!srcEdit.get().cellTypeArgs().equals(elementType.typeArgs())) { - b.get().deleteSparse(srcEdit); + if (!srcEdit.cellTypeArgs().equals(elementType.typeArgs())) { + b.deleteSparse(srcEdit); dstEdit.setAndGet(null); return Result.TypeConstraint; } if (options == UpdateOptions.InsertAt) { - b.get().deleteSparse(srcEdit); + b.deleteSparse(srcEdit); dstEdit.setAndGet(null); return Result.TypeConstraint; } // 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())) { - b.get().deleteSparse(srcEdit); + b.deleteSparse(srcEdit); dstEdit.setAndGet(null); return Result.NotFound; } if ((options == UpdateOptions.Insert) && dstEdit.get().exists()) { - b.get().deleteSparse(srcEdit); + b.deleteSparse(srcEdit); dstEdit.setAndGet(null); return Result.Exists; } @@ -306,8 +310,9 @@ public abstract class LayoutType implements ILayoutType { * @return Success if the write is permitted, the error code otherwise. */ 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())) { return Result.InsufficientPermissions; } @@ -343,12 +348,12 @@ public abstract class LayoutType implements ILayoutType { return Result.Success; } - public abstract Result readFixed(Reference b, Reference scope, LayoutColumn col, Out value); + public abstract Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value); - public abstract Result readSparse(Reference b, Reference edit, Out value); + public abstract Result readSparse(RowBuffer b, RowCursor edit, Out value); - public static TypeArgument readTypeArgument(Reference row, int offset, Out lenInBytes) { - LayoutType itemCode = row.get().ReadSparseTypeCode(offset); + public static TypeArgument readTypeArgument(RowBuffer row, int offset, Out lenInBytes) { + LayoutType itemCode = row.readSparseTypeCode(offset); int argsLenInBytes; Out tempOut_argsLenInBytes = new Out(); 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 implements ILayoutType { return new TypeArgument(itemCode, itemTypeArgs); } - public TypeArgumentList readTypeArgumentList(Reference row, int offset, Out lenInBytes) { + public TypeArgumentList readTypeArgumentList(RowBuffer row, int offset, Out lenInBytes) { lenInBytes.setAndGet(0); return TypeArgumentList.EMPTY; } - public Result readVariable(Reference b, Reference scope, LayoutColumn col, Out value) { + public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { value.setAndGet(null); return Result.Failure; } @@ -382,15 +387,15 @@ public abstract class LayoutType implements ILayoutType { return (Value)this; } - public abstract Result writeFixed(Reference b, Reference scope, LayoutColumn col, T value); + public abstract Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, T value); - public abstract Result writeSparse(Reference b, Reference edit, T value); + public abstract Result writeSparse(RowBuffer b, RowCursor edit, T value); - public abstract Result writeSparse(Reference b, Reference edit, T value, UpdateOptions options); + public abstract Result writeSparse(RowBuffer b, RowCursor edit, T value, UpdateOptions options); - public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { - row.get().WriteSparseTypeCode(offset, this.layoutCode()); - return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); + public int writeTypeArgument(RowBuffer row, int offset, TypeArgumentList value) { + row.writeSparseTypeCode(offset, this.layoutCode()); + return com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE; } public Result writeVariable(Reference b, Reference scope, LayoutColumn col, T value) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedArray.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedArray.java index b19f004..e28983c 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedArray.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedArray.java @@ -68,7 +68,7 @@ public final class LayoutTypedArray extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, value.get(0).typeArgs().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedMap.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedMap.java index c031a6b..7be8397 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedMap.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedMap.java @@ -89,7 +89,7 @@ public final class LayoutTypedMap extends LayoutUniqueScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); for (TypeArgument arg : value) { lenInBytes += arg.type().writeTypeArgument(row, offset + lenInBytes, arg.typeArgs().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedSet.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedSet.java index a28a8fe..d67d256 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedSet.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedSet.java @@ -75,7 +75,7 @@ public final class LayoutTypedSet extends LayoutUniqueScope { @Override public int writeTypeArgument(Reference row, int offset, TypeArgumentList value) { 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); lenInBytes += value.get(0).type().writeTypeArgument(row, offset + lenInBytes, value.get(0).typeArgs().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedTuple.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedTuple.java index 16a586b..a84bf80 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedTuple.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutTypedTuple.java @@ -86,7 +86,7 @@ public final class LayoutTypedTuple extends LayoutIndexedScope { @Override public int writeTypeArgument(Reference 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); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: lenInBytes += row.Write7BitEncodedUInt(offset + lenInBytes, (ulong)value.Count); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUDT.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUDT.java index 86300b0..20834f2 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUDT.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUDT.java @@ -57,7 +57,7 @@ public final class LayoutUDT extends LayoutPropertyScope { @Override public int writeTypeArgument(Reference 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()); return (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + SchemaId.SIZE; } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt16.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt16.java index 5e5f7ae..1ae224b 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt16.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt16.java @@ -30,22 +30,22 @@ public final class LayoutUInt16 extends LayoutType { //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ushort value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } //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) @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt32.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt32.java index 7a62489..bfc0658 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt32.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt32.java @@ -30,22 +30,22 @@ public final class LayoutUInt32 extends LayoutType { //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // uint value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } //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) @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt64.java index 58cf55f..a649886 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt64.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt64.java @@ -30,22 +30,22 @@ public final class LayoutUInt64 extends LayoutType { //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ulong value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } //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) @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt8.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt8.java index 5c4dcf6..9812f80 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt8.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt8.java @@ -30,22 +30,22 @@ public final class LayoutUInt8 extends LayoutType { //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // byte value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } //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) @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUniqueScope.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUniqueScope.java index e4a634f..f983774 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUniqueScope.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUniqueScope.java @@ -123,7 +123,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success; childScope = tempReference_childScope.get(); if (r != Result.Success) { - this.DeleteScope(b, scope); + this.deleteScope(b, scope); return r; } @@ -133,7 +133,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope); uniqueScope = tempReference_uniqueScope.get(); if (r != Result.Success) { - this.DeleteScope(b, scope); + this.deleteScope(b, scope); return r; } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUnixDateTime.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUnixDateTime.java index 20912c8..ad015bd 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUnixDateTime.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUnixDateTime.java @@ -4,7 +4,6 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; 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.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -27,20 +26,20 @@ public final class LayoutUnixDateTime extends LayoutType b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); 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; } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { @@ -53,15 +52,15 @@ public final class LayoutUnixDateTime extends LayoutType b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, UnixDateTime value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); if (scope.get().immutable()) { return Result.InsufficientPermissions; } - b.get().WriteUnixDateTime(scope.get().start() + col.getOffset(), value.clone()); - b.get().SetBit(scope.get().start(), col.getNullBit().clone()); + b.get().WriteUnixDateTime(scope.get().start() + column.getOffset(), value.clone()); + b.get().SetBit(scope.get().start(), column.getNullBit().clone()); return Result.Success; } @@ -69,7 +68,7 @@ public final class LayoutUnixDateTime extends LayoutType b, Reference edit, UnixDateTime value + public Result writeSparse(RowBuffer b, RowCursor edit, UnixDateTime value , UpdateOptions options) { Result result = prepareSparseWrite(b, edit, this.typeArg().clone(), options); if (result != Result.Success) { @@ -81,7 +80,7 @@ public final class LayoutUnixDateTime extends LayoutType b, Reference edit, UnixDateTime value) { + public Result writeSparse(RowBuffer b, RowCursor edit, UnixDateTime value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUtf8.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUtf8.java index c62d9a9..25455d7 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUtf8.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUtf8.java @@ -25,12 +25,12 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { Utf8Span 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: - 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() :) default return r; @@ -40,7 +40,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S Out value) { checkArgument(scope.get().scopeType() instanceof LayoutUDT); 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); return Result.NotFound; } @@ -50,7 +50,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result readSparse(Reference b, Reference edit, + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Utf8Span span; // 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 implements ILayoutUtf8S } @Override - public Result readVariable(Reference b, Reference scope, LayoutColumn col + public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column , Out value) { Utf8Span 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: - 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() :) default return r; @@ -87,7 +87,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S public Result ReadVariable(Reference b, Reference scope, LayoutColumn col , Out value) { 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); return Result.NotFound; } @@ -99,10 +99,10 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result writeFixed(Reference b, Reference scope, LayoutColumn col, + public Result writeFixed(RowBuffer b, RowCursor scope, LayoutColumn column, String value) { 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 b, Reference scope, LayoutColumn col, @@ -120,7 +120,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result writeSparse(Reference b, Reference edit, String value) { + public Result writeSparse(RowBuffer b, RowCursor edit, String value) { return writeSparse(b, edit, value, UpdateOptions.Upsert); } @@ -128,7 +128,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, string value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result writeSparse(Reference b, Reference edit, String value, + public Result writeSparse(RowBuffer b, RowCursor edit, String value, UpdateOptions options) { checkArgument(value != null); return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options); @@ -172,7 +172,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S 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(), col.getOffset()); int shift; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarInt.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarInt.java index 4c041d6..ca8ef89 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarInt.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarInt.java @@ -29,7 +29,7 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { Contract.Fail("Not Implemented"); value.setAndGet(0); @@ -37,7 +37,7 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result readSparse(Reference b, Reference edit, Out value) { + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = LayoutType.prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.setAndGet(0); @@ -49,15 +49,15 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result readVariable(Reference b, Reference scope, LayoutColumn col, Out value) { + public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); return Result.NotFound; } int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), - col.getOffset()); + column.getOffset()); value.setAndGet(b.get().ReadVariableInt(varOffset)); return Result.Success; } @@ -97,7 +97,7 @@ public final class LayoutVarInt extends LayoutType { 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(), col.getOffset()); int shift; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarUInt.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarUInt.java index 2ffc78b..54d77fe 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarUInt.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutVarUInt.java @@ -34,7 +34,7 @@ public final class LayoutVarUInt extends LayoutType { //ORIGINAL LINE: public override Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ulong value) @Override - public Result readFixed(Reference b, Reference scope, LayoutColumn col, + public Result readFixed(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { Contract.Fail("Not Implemented"); value.setAndGet(0); @@ -44,7 +44,7 @@ public final class LayoutVarUInt extends LayoutType { //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) @Override - public Result readSparse(Reference b, Reference edit, Out value) { + public Result readSparse(RowBuffer b, RowCursor edit, Out value) { Result result = prepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.setAndGet(0); @@ -59,15 +59,15 @@ public final class LayoutVarUInt extends LayoutType { //ORIGINAL LINE: public override Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ulong value) @Override - public Result readVariable(Reference b, Reference scope, LayoutColumn col, Out value) { + public Result readVariable(RowBuffer b, RowCursor scope, LayoutColumn column, Out value) { 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); return Result.NotFound; } int varOffset = b.get().computeVariableValueOffset(scope.get().layout(), scope.get().start(), - col.getOffset()); + column.getOffset()); value.setAndGet(b.get().ReadVariableUInt(varOffset)); return Result.Success; } @@ -114,7 +114,7 @@ public final class LayoutVarUInt extends LayoutType { 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(), col.getOffset()); int shift; diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BsonRowGenerator.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BsonRowGenerator.java index 6456294..9ec4853 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BsonRowGenerator.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BsonRowGenerator.java @@ -60,7 +60,7 @@ public final class BsonRowGenerator implements Closeable { public void WriteBuffer(HashMap dict) { this.writer.writeStartDocument(); 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(); @@ -141,7 +141,7 @@ public final class BsonRowGenerator implements Closeable { HashMap dict = (HashMap)value; Layout udt = this.resolver.resolve(typeArg.typeArgs().schemaId().clone()); 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(); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenRowGenerator.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenRowGenerator.java index 6f6de7e..4cc4b11 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenRowGenerator.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenRowGenerator.java @@ -154,9 +154,9 @@ public final class CodeGenRowGenerator { layout.TryFind(AddressHybridRowSerializer.PostalCodeName, tempOut_postalCode); this.postalCode = tempOut_postalCode.get(); Out tempOut_postalCodeToken = new Out(); - layout.getTokenizer().TryFindToken(this.postalCode.getPath(), tempOut_postalCodeToken); + layout.getTokenizer().TryFindToken(this.postalCode.path(), tempOut_postalCodeToken); 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 @@ -253,7 +253,7 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.postalCodeToken.clone()); RowCursor childScope; Out tempOut_childScope = new Out(); - 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(); if (r != Result.Success) { @@ -338,21 +338,21 @@ public final class CodeGenRowGenerator { layout.TryFind(GuestsHybridRowSerializer.ConfirmNumberName, tempOut_confirmNumber); this.confirmNumber = tempOut_confirmNumber.get(); Out tempOut_emailsToken = new Out(); - layout.getTokenizer().TryFindToken(this.emails.getPath(), tempOut_emailsToken); + layout.getTokenizer().TryFindToken(this.emails.path(), tempOut_emailsToken); this.emailsToken = tempOut_emailsToken.get(); Out tempOut_phoneNumbersToken = new Out(); - layout.getTokenizer().TryFindToken(this.phoneNumbers.getPath(), tempOut_phoneNumbersToken); + layout.getTokenizer().TryFindToken(this.phoneNumbers.path(), tempOut_phoneNumbersToken); this.phoneNumbersToken = tempOut_phoneNumbersToken.get(); Out tempOut_addressesToken = new Out(); - layout.getTokenizer().TryFindToken(this.addresses.getPath(), tempOut_addressesToken); + layout.getTokenizer().TryFindToken(this.addresses.path(), tempOut_addressesToken); this.addressesToken = tempOut_addressesToken.get(); this.addressesFieldType = new TypeArgumentList(new TypeArgument[] { new TypeArgument(LayoutType.TypedTuple, - this.addresses.getTypeArgs().clone()) }); + this.addresses.typeArgs().clone()) }); 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 b, Reference scope, HashMap context) -> addressSerializer.WriteBuffer(b, scope, context); @@ -604,7 +604,7 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.emailsToken.clone()); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' // 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)value, (ref RowBuffer row2, ref RowCursor childScope, ArrayList context) -> { @@ -644,7 +644,7 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.phoneNumbersToken.clone()); RowCursor childScope; Out tempOut_childScope = new Out(); - r = LayoutType.TypedArray.WriteScope(row, root, this.phoneNumbers.getTypeArgs().clone(), + r = LayoutType.TypedArray.WriteScope(row, root, this.phoneNumbers.typeArgs().clone(), tempOut_childScope); childScope = tempOut_childScope.get(); if (r != Result.Success) { @@ -678,7 +678,7 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.addressesToken.clone()); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' // 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)value), (ref RowBuffer row2, ref RowCursor childScope, (GuestsHybridRowSerializer _this, ArrayList < Object > value)ctx) -> @@ -792,10 +792,10 @@ public final class CodeGenRowGenerator { layout.TryFind(HotelsHybridRowSerializer.AddressName, tempOut_address); this.address = tempOut_address.get(); Out tempOut_addressToken = new Out(); - layout.getTokenizer().TryFindToken(this.address.getPath(), tempOut_addressToken); + layout.getTokenizer().TryFindToken(this.address.path(), tempOut_addressToken); this.addressToken = tempOut_addressToken.get(); this.addressSerializer = - new AddressHybridRowSerializer(resolver.resolve(this.address.getTypeArgs().schemaId().clone()), + new AddressHybridRowSerializer(resolver.resolve(this.address.typeArgs().schemaId().clone()), resolver); } @@ -908,7 +908,7 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.addressToken.clone()); RowCursor childScope; Out tempOut_childScope = new Out(); - r = LayoutType.UDT.WriteScope(row, root, this.address.getTypeArgs().clone(), + r = LayoutType.UDT.WriteScope(row, root, this.address.typeArgs().clone(), tempOut_childScope); childScope = tempOut_childScope.get(); if (r != Result.Success) { @@ -965,7 +965,7 @@ public final class CodeGenRowGenerator { layout.TryFind(PostalCodeHybridRowSerializer.Plus4Name, tempOut_plus4); this.plus4 = tempOut_plus4.get(); Out tempOut_plus4Token = new Out(); - layout.getTokenizer().TryFindToken(this.plus4.getPath(), tempOut_plus4Token); + layout.getTokenizer().TryFindToken(this.plus4.path(), tempOut_plus4Token); this.plus4Token = tempOut_plus4Token.get(); } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/LayoutCompilerUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/LayoutCompilerUnitTests.java index 6579e24..34bfc14 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/LayoutCompilerUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/LayoutCompilerUnitTests.java @@ -59,7 +59,7 @@ public class LayoutCompilerUnitTests { Namespace tempVar3 = new Namespace(); tempVar3.setSchemas(new ArrayList(Arrays.asList(s))); 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); } } @@ -1606,9 +1606,9 @@ private final static class RoundTripFixed extends TestActionDispatcher tempOut_value = new Out(); r = t.ReadFixed(row, root, col, tempOut_value); value = tempOut_value.get(); @@ -1653,7 +1653,7 @@ private final static class RoundTripFixed extends TestActionDispatcher void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn arrCol = closure.ArrCol; - LayoutType tempVar = arrCol.getType(); + LayoutType tempVar = arrCol.type(); LayoutIndexedScope arrT = tempVar instanceof LayoutIndexedScope ? (LayoutIndexedScope)tempVar : null; 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); Assert.IsNotNull(arrT, tag); @@ -1720,7 +1720,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempReference_field = new Reference(field); RowCursor scope; @@ -1736,7 +1736,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempReference_roRoot = new Reference(roRoot); ResultAssert.InsufficientPermissions(arrT.DeleteScope(row, tempReference_roRoot)); @@ -1852,7 +1852,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempReference_field6 = new Reference(field); @@ -1942,22 +1942,22 @@ private final static class RoundTripSparseObject extends TestActionDispatcher void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn objCol = closure.ObjCol; - LayoutType tempVar = objCol.getType(); + LayoutType tempVar = objCol.type(); LayoutObject objT = tempVar instanceof LayoutObject ? (LayoutObject)tempVar : null; LayoutColumn col = closure.Col; 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.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. RowCursor field; // 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().Clone(out field).Find(row, objCol.getPath()); + root.get().Clone(out field).Find(row, objCol.path()); Reference tempReference_field = new Reference(field); RowCursor scope; @@ -1973,7 +1973,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher(field); Out tempOut_scope2 = new Out(); - 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(); field = tempReference_field2.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -1982,7 +1982,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher tempReference_roRoot = new Reference(roRoot); ResultAssert.InsufficientPermissions(objT.DeleteScope(row, tempReference_roRoot)); @@ -2041,7 +2041,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher(roRoot); Out tempOut_scope22 = new Out(); - ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempReference_roRoot2, objCol.getTypeArgs().clone(), + ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempReference_roRoot2, objCol.typeArgs().clone(), tempOut_scope22)); scope2 = tempOut_scope22.get(); roRoot = tempReference_roRoot2.get(); @@ -2073,7 +2073,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher tempOut__2 = new Out(); - 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(); field = tempReference_field7.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -2141,13 +2141,13 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch 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. RowCursor nestedField; // 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: - scope.get().Clone(out nestedField).Find(row, col.getPath()); + scope.get().Clone(out nestedField).Find(row, col.path()); TValue value; // 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: @@ -2211,13 +2211,13 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch 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. RowCursor nestedField; // 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: - scope.get().Clone(out nestedField).Find(row, col.getPath()); + scope.get().Clone(out nestedField).Find(row, col.path()); Reference tempReference_nestedField = new Reference(nestedField); RowCursor scope2; @@ -2233,7 +2233,7 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch new Reference(nestedField); Out tempOut_scope22 = new Out(); - 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(); nestedField = tempReference_nestedField2.get(); ResultAssert.IsSuccess(r, tag); @@ -2340,16 +2340,16 @@ private final static class RoundTripSparseObjectNested extends TestActionDispatc System.out.println(tag); - TLayout t = (TLayout)col.getType(); + TLayout t = (TLayout)col.type(); // 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. RowCursor field; // 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: - 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 // 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); @@ -2575,10 +2575,10 @@ private final static class RoundTripSparseSet extends TestActionDispatcher void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn setCol = closure.SetCol; - LayoutType tempVar = setCol.getType(); + LayoutType tempVar = setCol.type(); LayoutUniqueScope setT = tempVar instanceof LayoutUniqueScope ? (LayoutUniqueScope)tempVar : null; 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); Assert.IsNotNull(setT, tag); @@ -2589,7 +2589,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempReference_field = new Reference(field); RowCursor scope; @@ -2605,7 +2605,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempReference_roRoot = new Reference(roRoot); ResultAssert.InsufficientPermissions(setT.DeleteScope(row, tempReference_roRoot)); 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 '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. Reference tempReference_field9 = new Reference(field); @@ -2854,7 +2854,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempReference_field12 = new Reference(field); 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: - 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(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); Reference tempReference_field13 = new Reference(field); @@ -2914,12 +2914,12 @@ private final static class RoundTripSparseSimple extends TestActionDispatcher, TValue> void Compare(Reference row, Reference root, LayoutColumn col, Object exValue, Expected expected) { - TLayout t = (TLayout)col.getType(); + TLayout t = (TLayout)col.type(); TValue value; Out tempOut_value = new Out(); Result r = t.readVariable(row, root, col, tempOut_value); @@ -3083,7 +3083,7 @@ private static class RoundTripVariable extends TestActionDispatcher, TValue> void RoundTrip(Reference row, Reference 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); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); this.Compare(row, root, col, exValue, expected.clone()); @@ -3193,7 +3193,7 @@ private final static class VariableInterleaving extends RoundTripVariable { private , TValue> void Delete(Reference row, Reference root, LayoutColumn col, Expected expected) { - TLayout t = (TLayout)col.getType(); + TLayout t = (TLayout)col.type(); 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: @@ -3213,7 +3213,7 @@ private final static class VariableInterleaving extends RoundTripVariable { private , TValue> void TooBig(Reference row, Reference 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); Assert.AreEqual(Result.TooBig, r, "Json: {0}", expected.Json); } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullableUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullableUnitTests.java index b447555..4eb831b 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullableUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullableUnitTests.java @@ -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: // 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.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullBool = new ArrayList(); RowCursor nullableScope = null; Reference 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: // 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.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullArray = new ArrayList(); RowCursor nullableScope = null; Reference 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: // 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.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullSet = new ArrayList(); RowCursor nullableScope = null; Reference 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: // 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.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullTuple = new ArrayList<(Integer, Long) > (); RowCursor tupleScope = null; 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: // 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.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref scope, out scope) == Result.Success) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: value.NullMap = new Dictionary>(); value.NullMap = new HashMap(); @@ -324,7 +324,7 @@ public final class NullableUnitTests { // 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: - TypeArgument tupleType = c.TypeAs().FieldType(ref scope); + TypeArgument tupleType = c.typeAs().FieldType(ref scope); Reference tempReference_tupleScope4 = new Reference(tupleScope); 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 // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.get().Clone(out outerScope).Find(row, c.getPath()); + root.get().Clone(out outerScope).Find(row, c.path()); Reference tempReference_outerScope = new Reference(outerScope); Out tempOut_outerScope = new Out(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope, - c.getTypeArgs().clone(), tempOut_outerScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, tempReference_outerScope, + c.typeArgs().clone(), tempOut_outerScope)); outerScope = tempOut_outerScope.get(); outerScope = tempReference_outerScope.get(); for (Boolean item : value.NullBool) { @@ -448,7 +448,7 @@ public final class NullableUnitTests { Out tempOut_innerScope = new Out(); 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(); outerScope = tempReference_outerScope2.get(); // 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 // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.get().Clone(out outerScope).Find(row, c.getPath()); + root.get().Clone(out outerScope).Find(row, c.path()); Reference tempReference_outerScope3 = new Reference(outerScope); Out tempOut_outerScope2 = new Out(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope3, - c.getTypeArgs().clone(), tempOut_outerScope2)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, tempReference_outerScope3, + c.typeArgs().clone(), tempOut_outerScope2)); outerScope = tempOut_outerScope2.get(); outerScope = tempReference_outerScope3.get(); for (Float item : value.NullArray) { @@ -483,7 +483,7 @@ public final class NullableUnitTests { Out tempOut_innerScope2 = new Out(); 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(); outerScope = tempReference_outerScope4.get(); // 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 // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.get().Clone(out outerScope).Find(row, c.getPath()); + root.get().Clone(out outerScope).Find(row, c.path()); Reference tempReference_outerScope5 = new Reference(outerScope); Out tempOut_outerScope3 = new Out(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope5, - c.getTypeArgs().clone(), tempOut_outerScope3)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, tempReference_outerScope5, + c.typeArgs().clone(), tempOut_outerScope3)); outerScope = tempOut_outerScope3.get(); outerScope = tempReference_outerScope5.get(); for (String item : value.NullSet) { @@ -523,14 +523,14 @@ public final class NullableUnitTests { Out tempOut__ = new Out(); ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_temp, - c.getTypeArgs().get(0).clone(), item, tempOut__)); + c.typeArgs().get(0).clone(), item, tempOut__)); _ = tempOut__.get(); temp = tempReference_temp.get(); Reference tempReference_outerScope6 = new Reference(outerScope); Reference tempReference_temp2 = new Reference(temp); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_outerScope6, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_outerScope6, tempReference_temp2)); temp = tempReference_temp2.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.get().Clone(out outerScope).Find(row, c.getPath()); + root.get().Clone(out outerScope).Find(row, c.path()); Reference tempReference_outerScope7 = new Reference(outerScope); Out tempOut_outerScope4 = new Out(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope7, - c.getTypeArgs().clone(), tempOut_outerScope4)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, tempReference_outerScope7, + c.typeArgs().clone(), tempOut_outerScope4)); outerScope = tempOut_outerScope4.get(); outerScope = tempReference_outerScope7.get(); for ((Integer item1,Long item2) :value.NullTuple) { - TypeArgument tupleType = c.getTypeArgs().get(0).clone(); + TypeArgument tupleType = c.typeArgs().get(0).clone(); RowCursor tupleScope; // 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 @@ -611,22 +611,22 @@ public final class NullableUnitTests { // 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().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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref outerScope, - c.getTypeArgs().clone(), out outerScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref outerScope, + c.typeArgs().clone(), out outerScope)); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: foreach ((Guid key, Nullable itemValue) in value.NullMap) for ((UUID key,Byte itemValue) :value.NullMap) { Reference tempReference_outerScope8 = new Reference(outerScope); - TypeArgument tupleType = c.TypeAs().FieldType(tempReference_outerScope8).clone(); + TypeArgument tupleType = c.typeAs().FieldType(tempReference_outerScope8).clone(); outerScope = tempReference_outerScope8.get(); RowCursor temp; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -676,7 +676,7 @@ public final class NullableUnitTests { new Reference(outerScope); Reference tempReference_temp3 = new Reference(temp); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_outerScope9, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_outerScope9, tempReference_temp3)); temp = tempReference_temp3.get(); outerScope = tempReference_outerScope9.get(); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowOperationDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowOperationDispatcher.java index b1804dc..8838e53 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowOperationDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowOperationDispatcher.java @@ -160,11 +160,11 @@ public final class RowOperationDispatcher { assert scope.get().getLayout().TryFind(path, tempOut_col); col = tempOut_col.get(); assert col != null; - type = col.getType(); - typeArgs = col.getTypeArgs().clone(); + type = col.type(); + typeArgs = col.typeArgs().clone(); } - if ((path != null) && (col == null || col.getStorage() == StorageKind.Sparse)) { + if ((path != null) && (col == null || col.storage() == StorageKind.Sparse)) { Reference tempReference_Row = new Reference(this.Row); scope.get().Find(tempReference_Row, path); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowWriterUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowWriterUnitTests.java index 261ac6f..a6c8ce3 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowWriterUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowWriterUnitTests.java @@ -130,7 +130,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("array_t", tempOut_col); 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) -> { for (byte value : values) { @@ -144,7 +144,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("array_t>", tempOut_col2); 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 } @@ -169,7 +169,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("array_t", tempOut_col3); 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) -> { for (String value : values) { @@ -183,7 +183,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("tuple", tempOut_col4); 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, TypeArgument typeArg, Tuple values) -> @@ -197,7 +197,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("tuple>", tempOut_col5); 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, TypeArgument typeArg, Tuple(); assert layout.TryFind("tuple", tempOut_col6); 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 values) -> { @@ -237,7 +237,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("nullable", tempOut_col7); 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 values) -> { RowWriter.WriterFunc f0 = (Reference writer, TypeArgument typeArg, @@ -266,7 +266,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("tagged", tempOut_col8); 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 values) -> { ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1)); @@ -278,7 +278,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("tagged", tempOut_col9); 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 values) -> { ResultAssert.IsSuccess(writer2.WriteUInt8(null, values.Item1)); @@ -291,7 +291,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("set_t", tempOut_col10); 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) -> { for (String value : values) { @@ -305,7 +305,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("set_t>", tempOut_col11); 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[] { 4, 5, 6 }, @@ -331,7 +331,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("set_t>", tempOut_col12); 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[] { 7, 8, 9 }, @@ -357,7 +357,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("set_t", tempOut_col13); 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(1, 2), @@ -380,7 +380,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("map_t", tempOut_col14); col = tempOut_col14.get(); - ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple[] { Tuple.Create("Harrison", "Han"), Tuple.Create("Mark", "Luke") }, (ref RowWriter writer2, TypeArgument typeArg, Tuple[] values) -> @@ -403,7 +403,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("map_t>", tempOut_col15); col = tempOut_col15.get(); - ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple[] { Tuple.Create((byte)2, new byte[] { 4, 5, 6 }), Tuple.Create((byte)1, new byte[] { 1, 2, 3 }) }, (ref RowWriter writer2, TypeArgument typeArg, Tuple[] values) -> @@ -435,7 +435,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("map_t>", tempOut_col16); col = tempOut_col16.get(); - ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple[] { Tuple.Create((short)2, new System.Tuple[] { Tuple.Create(7, 8), Tuple.Create(5, 6) }) , Tuple.Create((short)1, new System.Tuple[] { Tuple.Create(3, 4), Tuple.Create(1, 2) }) }, (ref RowWriter writer2, TypeArgument typeArg, Tuple[]>[] values) -> @@ -475,7 +475,7 @@ public final class RowWriterUnitTests { new Out(); assert layout.TryFind("map_t", tempOut_col17); col = tempOut_col17.get(); - ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new System.Tuple[] { 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[] values) -> + ResultAssert.IsSuccess(writer.WriteScope(col.path(), col.typeArg().clone(), new System.Tuple[] { 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[] values) -> { for (Tuple value : values) { ResultAssert.IsSuccess(writer2.WriteScope(null, new TypeArgument(LayoutType.TypedTuple, typeArg.getTypeArgs().clone()), value, (ref RowWriter writer3, TypeArgument typeArg2, Tuple values2) -> diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedMapUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedMapUnitTests.java index fc672c0..ee1537a 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedMapUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedMapUnitTests.java @@ -130,7 +130,7 @@ public final class TypedMapUnitTests { // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); row = tempReference_row4.get(); for (String key : permutation) { KeyValuePair pair = new KeyValuePair(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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, out findScope)); row = tempReference_row7.get(); // 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: - TypeArgument tupleType = c.TypeAs().FieldType(ref mapScope); + TypeArgument tupleType = c.typeAs().FieldType(ref mapScope); Reference tempReference_row8 = new Reference(row); Reference 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); row = tempReference_row5.get(); for (String key : t1.Cast.keySet()) { KeyValuePair pair = new KeyValuePair(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 // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row8, ref mapScope, ref tempCursor, out findScope)); row = tempReference_row8.get(); Reference 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref mapScope, out mapScope)); row = tempReference_row5.get(); Reference tempReference_row6 = new Reference(row); @@ -352,7 +352,7 @@ public final class TypedMapUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row8, ref mapScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row8, ref mapScope, ref tempCursor, UpdateOptions.Insert)); row = tempReference_row8.get(); Reference tempReference_row9 = @@ -390,7 +390,7 @@ public final class TypedMapUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row13, ref mapScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row13, ref mapScope, ref tempCursor, UpdateOptions.Insert)); row = tempReference_row13.get(); Reference 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row17, ref mapScope, out mapScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row17, ref mapScope, out mapScope)); row = tempReference_row17.get(); KeyValuePair pair = KeyValuePair.Create(UUID.fromString("{4674962B-CE11-4916-81C5-0421EE36F168" + "}"), 11000000.00); @@ -448,7 +448,7 @@ public final class TypedMapUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row20, ref mapScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row20, ref mapScope, ref tempCursor, UpdateOptions.Insert)); row = tempReference_row20.get(); Reference 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: // 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.IsSuccess(c.TypeAs().WriteScope(tempReference_row3, ref mapScope, c.TypeArgs, + ResultAssert.IsSuccess(c.typeAs().WriteScope(tempReference_row3, ref mapScope, c.TypeArgs, out mapScope)); row = tempReference_row3.get(); Reference tempReference_row4 = @@ -528,7 +528,7 @@ public final class TypedMapUnitTests { new Reference(row); // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row7, ref mapScope, ref tempCursor)); + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row7, ref mapScope, ref tempCursor)); row = tempReference_row7.get(); Reference tempReference_row8 = new Reference(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: // 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.IsSuccess(c.TypeAs().WriteScope(tempReference_row11, ref mapScope, c.TypeArgs, + ResultAssert.IsSuccess(c.typeAs().WriteScope(tempReference_row11, ref mapScope, c.TypeArgs, out mapScope)); row = tempReference_row11.get(); // 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: LayoutIndexedScope tupleLayout = - c.TypeAs().FieldType(ref mapScope).TypeAs(); + c.typeAs().FieldType(ref mapScope).TypeAs(); Reference tempReference_row12 = new Reference(row); // 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(row); // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor)); + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor)); row = tempReference_row17.get(); Reference tempReference_row18 = new Reference(row); @@ -719,7 +719,7 @@ public final class TypedMapUnitTests { // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); row = tempReference_row4.get(); for (String key : permutation) { // 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, out findScope)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row10, ref mapScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row10, ref mapScope, ref tempCursor, UpdateOptions.Update)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row13, ref mapScope, ref tempCursor + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row13, ref mapScope, ref tempCursor , out findScope)); row = tempReference_row13.get(); Reference tempReference_row14 = @@ -846,7 +846,7 @@ public final class TypedMapUnitTests { // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row17, ref mapScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor, UpdateOptions.Upsert)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row20, ref mapScope, ref tempCursor + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row20, ref mapScope, ref tempCursor , out findScope)); row = tempReference_row20.get(); Reference tempReference_row21 = @@ -913,7 +913,7 @@ public final class TypedMapUnitTests { // 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.Exists(c.TypeAs().MoveField(tempReference_row24, ref mapScope, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row24, ref mapScope, ref tempCursor, UpdateOptions.Insert)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempReference_row27, ref mapScope, + ResultAssert.TypeConstraint(c.typeAs().MoveField(tempReference_row27, ref mapScope, ref tempCursor, UpdateOptions.InsertAt)); 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: assert udt.TryFind("domestic", out c); Out tempOut_Domestic = new Out(); - ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, udtScope, c, tempOut_Domestic)); + ResultAssert.IsSuccess(c.typeAs().ReadFixed(row, udtScope, c, tempOut_Domestic)); 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: assert udt.TryFind("worldwide", out c); Out tempOut_Worldwide = new Out(); - ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, udtScope, c, tempOut_Worldwide)); + ResultAssert.IsSuccess(c.typeAs().ReadFixed(row, udtScope, c, tempOut_Worldwide)); m.Worldwide = tempOut_Worldwide.get(); 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: // 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.TypeAs().ReadScope(row, ref castScope, out castScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref castScope, out castScope) == Result.Success) { value.Cast = new HashMap(); while (castScope.MoveNext(row)) { Reference 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: // 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.TypeAs().ReadScope(row, ref statsScope, out statsScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref statsScope, out statsScope) == Result.Success) { value.Stats = new HashMap(); while (statsScope.MoveNext(row)) { Reference 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: // 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.TypeAs().ReadScope(row, ref relatedScope, out relatedScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref relatedScope, out relatedScope) == Result.Success) { value.Related = new HashMap>(); TypeArgument keyType = c.TypeArgs[0]; 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: // 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.TypeAs().ReadScope(row, ref revenueScope, out revenueScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref revenueScope, out revenueScope) == Result.Success) { value.Revenue = new HashMap(); TypeArgument keyType = c.TypeArgs[0]; TypeArgument valueType = c.TypeArgs[1]; @@ -1182,10 +1182,10 @@ public final class TypedMapUnitTests { 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: assert udt.TryFind("domestic", out c); - ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, udtScope, c, m.Domestic)); + ResultAssert.IsSuccess(c.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: assert udt.TryFind("worldwide", out c); - ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, udtScope, c, m.Worldwide)); + ResultAssert.IsSuccess(c.typeAs().WriteFixed(row, udtScope, c, m.Worldwide)); } private static Result WriteKeyValue(Reference row, @@ -1227,15 +1227,15 @@ 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: - 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref castScope, - c.getTypeArgs().clone(), out castScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref castScope, + c.typeArgs().clone(), out castScope)); for (KeyValuePair item : value.Cast) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1245,13 +1245,13 @@ public final class TypedMapUnitTests { Reference tempReference_tempCursor = new Reference(tempCursor); ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor, - c.getTypeArgs().clone(), item)); + c.typeArgs().clone(), item)); tempCursor = tempReference_tempCursor.get(); Reference tempReference_castScope = new Reference(castScope); Reference tempReference_tempCursor2 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_castScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_castScope, tempReference_tempCursor2)); tempCursor = tempReference_tempCursor2.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref statsScope, - c.getTypeArgs().clone(), out statsScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref statsScope, + c.typeArgs().clone(), out statsScope)); for (KeyValuePair item : value.Stats) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1285,13 +1285,13 @@ public final class TypedMapUnitTests { Reference tempReference_tempCursor3 = new Reference(tempCursor); ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor3, - c.getTypeArgs().clone(), item)); + c.typeArgs().clone(), item)); tempCursor = tempReference_tempCursor3.get(); Reference tempReference_statsScope = new Reference(statsScope); Reference tempReference_tempCursor4 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_statsScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_statsScope, tempReference_tempCursor4)); tempCursor = tempReference_tempCursor4.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref relatedScoped, - c.getTypeArgs().clone(), out relatedScoped)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref relatedScoped, + c.typeArgs().clone(), out relatedScoped)); for (KeyValuePair> item : value.Related) { 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), + ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.typeArgs().clone(), out tupleScope)); // 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.IsSuccess(c.getTypeArgs().get(0).type().typeAs().WriteSparse(row, + ResultAssert.IsSuccess(c.typeArgs().get(0).type().typeAs().WriteSparse(row, ref tupleScope, item.Key)); assert tupleScope.MoveNext(row); - TypeArgument valueType = c.getTypeArgs().get(1).clone(); + TypeArgument valueType = c.typeArgs().get(1).clone(); LayoutUniqueScope valueLayout = valueType.getType().TypeAs(); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1375,7 +1375,7 @@ public final class TypedMapUnitTests { new Reference(relatedScoped); Reference tempReference_tempCursor1 = new Reference(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_relatedScoped, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_relatedScoped, tempReference_tempCursor1)); tempCursor1 = tempReference_tempCursor1.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref revenueScope, - c.getTypeArgs().clone(), out revenueScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref revenueScope, + c.typeArgs().clone(), out revenueScope)); for (KeyValuePair item : value.Revenue) { 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), + ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.typeArgs().clone(), out tupleScope)); Reference tempReference_tupleScope = new Reference(tupleScope); - ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().typeAs().WriteSparse(row, + ResultAssert.IsSuccess(c.typeArgs().get(0).type().typeAs().WriteSparse(row, tempReference_tupleScope, item.Key)); tupleScope = tempReference_tupleScope.get(); assert tupleScope.MoveNext(row); - TypeArgument valueType = c.getTypeArgs().get(1).clone(); + TypeArgument valueType = c.typeArgs().get(1).clone(); LayoutUDT valueLayout = valueType.getType().TypeAs(); Reference tempReference_tupleScope2 = new Reference(tupleScope); @@ -1444,7 +1444,7 @@ public final class TypedMapUnitTests { new Reference(revenueScope); Reference tempReference_tempCursor12 = new Reference(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_revenueScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_revenueScope, tempReference_tempCursor12)); tempCursor1 = tempReference_tempCursor12.get(); revenueScope = tempReference_revenueScope.get(); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedSetUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedSetUnitTests.java index d820f36..920f05b 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedSetUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedSetUnitTests.java @@ -133,7 +133,7 @@ public final class TypedSetUnitTests { // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); row = tempReference_row5.get(); for (UUID p : t1.Projects) { Reference tempReference_row6 = @@ -161,7 +161,7 @@ public final class TypedSetUnitTests { // 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.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row8, ref setScope, ref tempCursor, out findScope)); row = tempReference_row8.get(); Reference 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); row = tempReference_row5.get(); for (int i = 0; i < t1.Attendees.size(); i++) { Reference 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 // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row8, ref setScope, ref tempCursor, out findScope)); row = tempReference_row8.get(); 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row10, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row10, ref setScope, out setScope)); row = tempReference_row10.get(); TypeArgument innerType = c.TypeArgs[0]; 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 // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row16, ref setScope, ref tempCursor1, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row16, ref setScope, ref tempCursor1, out findScope)); row = tempReference_row16.get(); 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); row = tempReference_row5.get(); Reference tempReference_row6 = new Reference(row); @@ -423,7 +423,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor, UpdateOptions.Insert)); row = tempReference_row8.get(); Reference 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: // 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.IsSuccess(c.TypeAs().Find(tempReference_row11, ref setScope, ref tempCursor, out _)); + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row11, ref setScope, ref tempCursor, out _)); row = tempReference_row11.get(); Reference tempReference_row12 = new Reference(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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row15, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row15, ref setScope, out setScope)); row = tempReference_row15.get(); Reference tempReference_row16 = new Reference(row); @@ -498,7 +498,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row18, ref setScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row18, ref setScope, ref tempCursor, UpdateOptions.Insert)); 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row20, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row20, ref setScope, out setScope)); row = tempReference_row20.get(); TypeArgument innerType = c.TypeArgs[0]; LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); @@ -572,7 +572,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row26, ref setScope, ref tempCursor1, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row26, ref setScope, ref tempCursor1, UpdateOptions.Insert)); 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row28, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row28, ref setScope, out setScope)); row = tempReference_row28.get(); LayoutUDT udtLayout = c.TypeArgs[0].Type.TypeAs(); Reference tempReference_row29 = @@ -625,7 +625,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row32, ref setScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row32, ref setScope, ref tempCursor, UpdateOptions.Insert)); 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: // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row34, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row34, ref setScope, out setScope)); row = tempReference_row34.get(); innerType = c.TypeArgs[0]; LayoutIndexedScope tupleLayout = innerType.getType().TypeAs(); @@ -687,7 +687,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.Exists(c.TypeAs().MoveField(tempReference_row40, ref setScope, ref tempCursor, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row40, ref setScope, ref tempCursor, UpdateOptions.Insert)); 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: // 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.IsSuccess(c.TypeAs().WriteScope(tempReference_row3, ref setScope, c.TypeArgs, + ResultAssert.IsSuccess(c.typeAs().WriteScope(tempReference_row3, ref setScope, c.TypeArgs, out setScope)); row = tempReference_row3.get(); Reference tempReference_row4 = @@ -750,7 +750,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor)); + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row8, ref setScope, ref tempCursor)); row = tempReference_row8.get(); Reference tempReference_row9 = new Reference(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: // 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.IsSuccess(c.TypeAs().WriteScope(tempReference_row13, ref setScope, c.TypeArgs, + ResultAssert.IsSuccess(c.typeAs().WriteScope(tempReference_row13, ref setScope, c.TypeArgs, out setScope)); row = tempReference_row13.get(); TypeArgument innerType = c.TypeArgs[0]; @@ -844,7 +844,7 @@ public final class TypedSetUnitTests { new Reference(row); // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row21, ref setScope, ref tempCursor1)); + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row21, ref setScope, ref tempCursor1)); row = tempReference_row21.get(); Reference tempReference_row22 = new Reference(row); @@ -928,7 +928,7 @@ public final class TypedSetUnitTests { // 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.IsSuccess(c.TypeAs().ReadScope(tempReference_row4, ref projScope, out projScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row4, ref projScope, out projScope)); row = tempReference_row4.get(); for (UUID item : t1.Projects) { Reference tempReference_row5 = @@ -952,7 +952,7 @@ public final class TypedSetUnitTests { // 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.IsSuccess(c.TypeAs().MoveField(tempReference_row7, ref projScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row7, ref projScope, ref tempCursor)); 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 // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); + ResultAssert.IsSuccess(c.typeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); row = tempReference_row5.get(); for (UUID elm : t1.Projects) { // 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.typeAs().Find(tempReference_row8, ref setScope, ref tempCursor, value: out RowCursor _)) 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row11, ref setScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row11, ref setScope, ref tempCursor, UpdateOptions.Update)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row14, ref setScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(tempReference_row14, ref setScope, ref tempCursor)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempReference_row17, ref setScope, + ResultAssert.Exists(c.typeAs().MoveField(tempReference_row17, ref setScope, ref tempCursor, UpdateOptions.Insert)); 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempReference_row20, ref setScope, + ResultAssert.TypeConstraint(c.typeAs().MoveField(tempReference_row20, ref setScope, ref tempCursor, UpdateOptions.InsertAt)); 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: assert matchLayout.TryFind("label", out c); Out tempOut_Label = new Out(); - ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, matchScope, c, tempOut_Label)); + ResultAssert.IsSuccess(c.typeAs().ReadVariable(row, matchScope, c, tempOut_Label)); 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: assert matchLayout.TryFind("count", out c); Out tempOut_Count = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeAs().ReadFixed(ref row, ref matchScope, c, out m.Count)); - ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, matchScope, c, tempOut_Count)); + ResultAssert.IsSuccess(c.typeAs().ReadFixed(row, matchScope, c, tempOut_Count)); m.Count = tempOut_Count.get(); 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: // 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.TypeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) { value.Attendees = new ArrayList(); while (tagsScope.MoveNext(row)) { 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: // 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.TypeAs().ReadScope(row, ref projScope, out projScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref projScope, out projScope) == Result.Success) { value.Projects = new ArrayList(); while (projScope.MoveNext(row)) { 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: // 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.TypeAs().ReadScope(row, ref checkboxScope, out checkboxScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref checkboxScope, out checkboxScope) == Result.Success) { value.Checkboxes = new ArrayList(); while (checkboxScope.MoveNext(row)) { 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: // 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.TypeAs().ReadScope(row, ref pricesScope, out pricesScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref pricesScope, out pricesScope) == Result.Success) { value.Prices = new ArrayList>(); TypeArgument innerType = c.TypeArgs[0]; LayoutUniqueScope innerLayout = innerType.getType().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: // 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.TypeAs().ReadScope(row, ref nestedScope, out nestedScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref nestedScope, out nestedScope) == Result.Success) { value.Nested = new ArrayList>>(); TypeArgument in2Type = c.TypeArgs[0]; LayoutUniqueScope in2Layout = in2Type.getType().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: // 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.TypeAs().ReadScope(row, ref shoppingScope, out shoppingScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref shoppingScope, out shoppingScope) == Result.Success) { value.Shopping = new ArrayList(); while (shoppingScope.MoveNext(row)) { 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 // 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: - if (c.TypeAs().ReadScope(row, ref workScope, out workScope) == Result.Success) { + if (c.typeAs().ReadScope(row, ref workScope, out workScope) == Result.Success) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: value.Work = new List>(); value.Work = new ArrayList>(); @@ -1469,10 +1469,10 @@ public final class TypedSetUnitTests { 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: assert matchLayout.TryFind("label", out c); - ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, matchScope, c, m.Label)); + ResultAssert.IsSuccess(c.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: assert matchLayout.TryFind("count", out c); - ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, matchScope, c, m.Count)); + ResultAssert.IsSuccess(c.typeAs().WriteFixed(row, matchScope, c, m.Count)); } private void WriteTodo(Reference row, Reference 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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref attendScope, - c.getTypeArgs().clone(), out attendScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref attendScope, + c.typeArgs().clone(), out attendScope)); for (String item : value.Attendees) { RowCursor tempCursor; // 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 - // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().typeAs().WriteSparse(row, + ResultAssert.IsSuccess(c.typeArgs().get(0).type().typeAs().WriteSparse(row, ref tempCursor, item)); Reference tempReference_attendScope = new Reference(attendScope); Reference tempReference_tempCursor = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_attendScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_attendScope, tempReference_tempCursor)); tempCursor = tempReference_tempCursor.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref projScope, - c.getTypeArgs().clone(), out projScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref projScope, + c.typeArgs().clone(), out projScope)); for (UUID item : value.Projects) { RowCursor tempCursor; // 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); Reference tempReference_tempCursor2 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().typeAs().WriteSparse(row, + ResultAssert.IsSuccess(c.typeArgs().get(0).type().typeAs().WriteSparse(row, tempReference_tempCursor2, item)); tempCursor = tempReference_tempCursor2.get(); Reference tempReference_projScope = new Reference(projScope); Reference tempReference_tempCursor3 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_projScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_projScope, tempReference_tempCursor3)); tempCursor = tempReference_tempCursor3.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref checkboxScope, - c.getTypeArgs().clone(), out checkboxScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref checkboxScope, + c.typeArgs().clone(), out checkboxScope)); for (boolean item : value.Checkboxes) { RowCursor tempCursor; // 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); Reference tempReference_tempCursor4 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.getTypeArgs().get(0).type().typeAs().WriteSparse(row, + ResultAssert.IsSuccess(c.typeArgs().get(0).type().typeAs().WriteSparse(row, tempReference_tempCursor4, item)); tempCursor = tempReference_tempCursor4.get(); Reference tempReference_checkboxScope = new Reference(checkboxScope); Reference tempReference_tempCursor5 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_checkboxScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_checkboxScope, tempReference_tempCursor5)); tempCursor = tempReference_tempCursor5.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref pricesScope, - c.getTypeArgs().clone(), out pricesScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref pricesScope, + c.typeArgs().clone(), out pricesScope)); for (ArrayList item : value.Prices) { assert item != null; - TypeArgument innerType = c.getTypeArgs().get(0).clone(); + TypeArgument innerType = c.typeArgs().get(0).clone(); LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1657,7 +1657,7 @@ public final class TypedSetUnitTests { new Reference(pricesScope); Reference tempReference_tempCursor1 = new Reference(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_pricesScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_pricesScope, tempReference_tempCursor1)); tempCursor1 = tempReference_tempCursor1.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref nestedScope, - c.getTypeArgs().clone(), out nestedScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref nestedScope, + c.typeArgs().clone(), out nestedScope)); for (ArrayList> item : value.Nested) { assert item != null; - TypeArgument in2Type = c.getTypeArgs().get(0).clone(); + TypeArgument in2Type = c.typeArgs().get(0).clone(); LayoutUniqueScope in2Layout = in2Type.getType().TypeAs(); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1747,7 +1747,7 @@ public final class TypedSetUnitTests { new Reference(nestedScope); Reference tempReference_tempCursor12 = new Reference(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_nestedScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_nestedScope, tempReference_tempCursor12)); tempCursor1 = tempReference_tempCursor12.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref shoppingScope, - c.getTypeArgs().clone(), out shoppingScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref shoppingScope, + c.typeArgs().clone(), out shoppingScope)); for (ShoppingItem item : value.Shopping) { - TypeArgument innerType = c.getTypeArgs().get(0).clone(); + TypeArgument innerType = c.typeArgs().get(0).clone(); LayoutUDT innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1797,7 +1797,7 @@ public final class TypedSetUnitTests { new Reference(shoppingScope); Reference tempReference_tempCursor7 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_shoppingScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_shoppingScope, tempReference_tempCursor7)); tempCursor = tempReference_tempCursor7.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 // cannot be converted using the 'Out' helper class unless the method is within the code being // 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 // 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: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref workScope, - c.getTypeArgs().clone(), out workScope)); + ResultAssert.IsSuccess(c.typeAs().WriteScope(row, ref workScope, + c.typeArgs().clone(), out workScope)); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: foreach (Tuple item in value.Work) for (Tuple item : value.Work) { - TypeArgument innerType = c.getTypeArgs().get(0).clone(); + TypeArgument innerType = c.typeArgs().get(0).clone(); LayoutIndexedScope innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - @@ -1854,7 +1854,7 @@ public final class TypedSetUnitTests { new Reference(workScope); Reference tempReference_tempCursor8 = new Reference(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_workScope, + ResultAssert.IsSuccess(c.typeAs().MoveField(row, tempReference_workScope, tempReference_tempCursor8)); tempCursor = tempReference_tempCursor8.get(); workScope = tempReference_workScope.get();