diff --git a/dotnet/src/Core/UtfAnyString.cs b/dotnet/src/Core/UtfAnyString.cs new file mode 100644 index 0000000..34ebd40 --- /dev/null +++ b/dotnet/src/Core/UtfAnyString.cs @@ -0,0 +1,480 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------ + +#pragma warning disable CA2225 // Operator overloads have named alternates + +// ReSharper disable once UseNameofExpression +namespace Microsoft.Azure.Cosmos.Core.Utf8 +{ + using System; + using System.Diagnostics; + using System.Runtime.CompilerServices; + + /// A string whose memory representation may be either UTF8 or UTF16. + /// + /// This type supports polymorphic use of and + /// when equality, hashing, and comparison are needed against either encoding. An API leveraging + /// can avoid separate method overloads while still accepting either + /// encoding without imposing additional allocations. + /// + [DebuggerDisplay("{ToString()}")] + public readonly struct UtfAnyString : + IEquatable, IComparable, + IEquatable, IComparable, + IEquatable, IComparable + { + public static UtfAnyString Empty => string.Empty; + + private readonly object buffer; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UtfAnyString(string utf16String) + { + this.buffer = utf16String; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UtfAnyString(Utf8String utf8String) + { + this.buffer = utf8String; + } + + public bool IsUtf8 => this.buffer is Utf8String; + + public bool IsUtf16 => this.buffer is string; + + /// True if the length is empty. + public bool IsNull => object.ReferenceEquals(null, this.buffer); + + /// True if the length is empty. + public bool IsEmpty + { + get + { + if (object.ReferenceEquals(null, this.buffer)) + { + return false; + } + + switch (this.buffer) + { + case string s: + return s.Length == 0; + default: + return ((Utf8String)this.buffer).IsEmpty; + } + } + } + + public static implicit operator UtfAnyString(string utf16String) + { + return new UtfAnyString(utf16String); + } + + public static implicit operator string(UtfAnyString str) + { + return str.buffer?.ToString(); + } + + public override string ToString() + { + // ReSharper disable once AssignNullToNotNullAttribute + return this.buffer?.ToString(); + } + + public Utf8String ToUtf8String() + { + if (object.ReferenceEquals(null, this.buffer)) + { + return null; + } + + switch (this.buffer) + { + case string s: + return Utf8String.TranscodeUtf16(s); + default: + return (Utf8String)this.buffer; + } + } + + public bool ReferenceEquals(UtfAnyString other) + { + return this.buffer == other.buffer; + } + + public bool Equals(UtfAnyString other) + { + if (object.ReferenceEquals(null, this.buffer)) + { + return object.ReferenceEquals(null, other.buffer); + } + + switch (this.buffer) + { + case string s: + return other.Equals(s); + default: + return other.Equals((Utf8String)this.buffer); + } + } + + public bool Equals(Utf8Span other) + { + return other.Equals(this.buffer); + } + + public override bool Equals(object obj) + { + switch (obj) + { + case string s: + return this.Equals(s); + case Utf8String s: + return this.Equals(s); + case UtfAnyString s: + return this.Equals(s); + } + + return false; + } + + public bool Equals(Utf8String other) + { + if (object.ReferenceEquals(null, other)) + { + return object.ReferenceEquals(null, this.buffer); + } + + return other.Equals(this.buffer); + } + + public bool Equals(string other) + { + if (object.ReferenceEquals(null, this.buffer)) + { + return object.ReferenceEquals(null, other); + } + + switch (this.buffer) + { + case string s: + return string.Equals(s, other, StringComparison.Ordinal); + default: + return ((Utf8String)this.buffer).Equals(other); + } + } + + public static bool operator ==(UtfAnyString left, UtfAnyString right) + { + return left.Equals(right); + } + + public static bool operator !=(UtfAnyString left, UtfAnyString right) + { + return !left.Equals(right); + } + + public static bool operator ==(UtfAnyString left, string right) + { + return left.Equals(right); + } + + public static bool operator !=(UtfAnyString left, string right) + { + return !left.Equals(right); + } + + public static bool operator ==(string left, UtfAnyString right) + { + return right.Equals(left); + } + + public static bool operator !=(string left, UtfAnyString right) + { + return !right.Equals(left); + } + + public static bool operator ==(UtfAnyString left, Utf8String right) + { + return left.Equals(right); + } + + public static bool operator !=(UtfAnyString left, Utf8String right) + { + return !left.Equals(right); + } + + public static bool operator ==(Utf8String left, UtfAnyString right) + { + return right.Equals(left); + } + + public static bool operator !=(Utf8String left, UtfAnyString right) + { + return !right.Equals(left); + } + + public static bool operator ==(UtfAnyString left, Utf8Span right) + { + return left.Equals(right); + } + + public static bool operator !=(UtfAnyString left, Utf8Span right) + { + return !left.Equals(right); + } + + public static bool operator ==(Utf8Span left, UtfAnyString right) + { + return right.Equals(left); + } + + public static bool operator !=(Utf8Span left, UtfAnyString right) + { + return !right.Equals(left); + } + + public override int GetHashCode() + { + uint hash1 = 5381; + uint hash2 = hash1; + + if (object.ReferenceEquals(null, this.buffer)) + { + return unchecked((int)(hash1 + (hash2 * 1566083941))); + } + + switch (this.buffer) + { + case string s: + unchecked + { + Utf16LittleEndianCodePointEnumerator thisEnumerator = new Utf16LittleEndianCodePointEnumerator(s); + for (int i = 0; thisEnumerator.MoveNext(); i++) + { + uint c = thisEnumerator.Current; + if (i % 2 == 0) + { + hash1 = ((hash1 << 5) + hash1) ^ c; + } + else + { + hash2 = ((hash2 << 5) + hash2) ^ c; + } + } + + return (int)(hash1 + (hash2 * 1566083941)); + } + + default: + return this.buffer.GetHashCode(); + } + } + + public static bool operator <(UtfAnyString left, UtfAnyString right) + { + return left.CompareTo(right) < 0; + } + + public static bool operator <=(UtfAnyString left, UtfAnyString right) + { + return left.CompareTo(right) <= 0; + } + + public static bool operator >(UtfAnyString left, UtfAnyString right) + { + return left.CompareTo(right) > 0; + } + + public static bool operator >=(UtfAnyString left, UtfAnyString right) + { + return left.CompareTo(right) >= 0; + } + + public static bool operator <(UtfAnyString left, string right) + { + return left.CompareTo(right) < 0; + } + + public static bool operator <=(UtfAnyString left, string right) + { + return left.CompareTo(right) <= 0; + } + + public static bool operator >(UtfAnyString left, string right) + { + return left.CompareTo(right) > 0; + } + + public static bool operator >=(UtfAnyString left, string right) + { + return left.CompareTo(right) >= 0; + } + + public static bool operator <(string left, UtfAnyString right) + { + return right.CompareTo(left) >= 0; + } + + public static bool operator <=(string left, UtfAnyString right) + { + return right.CompareTo(left) > 0; + } + + public static bool operator >(string left, UtfAnyString right) + { + return right.CompareTo(left) <= 0; + } + + public static bool operator >=(string left, UtfAnyString right) + { + return right.CompareTo(left) < 0; + } + + public static bool operator <(UtfAnyString left, Utf8String right) + { + return left.CompareTo(right) < 0; + } + + public static bool operator <=(UtfAnyString left, Utf8String right) + { + return left.CompareTo(right) <= 0; + } + + public static bool operator >(UtfAnyString left, Utf8String right) + { + return left.CompareTo(right) > 0; + } + + public static bool operator >=(UtfAnyString left, Utf8String right) + { + return left.CompareTo(right) >= 0; + } + + public static bool operator <(Utf8String left, UtfAnyString right) + { + return right.CompareTo(left) >= 0; + } + + public static bool operator <=(Utf8String left, UtfAnyString right) + { + return right.CompareTo(left) > 0; + } + + public static bool operator >(Utf8String left, UtfAnyString right) + { + return right.CompareTo(left) <= 0; + } + + public static bool operator >=(Utf8String left, UtfAnyString right) + { + return right.CompareTo(left) < 0; + } + + public static bool operator <(UtfAnyString left, Utf8Span right) + { + return left.CompareTo(right) < 0; + } + + public static bool operator <=(UtfAnyString left, Utf8Span right) + { + return left.CompareTo(right) <= 0; + } + + public static bool operator >(UtfAnyString left, Utf8Span right) + { + return left.CompareTo(right) > 0; + } + + public static bool operator >=(UtfAnyString left, Utf8Span right) + { + return left.CompareTo(right) >= 0; + } + + public static bool operator <(Utf8Span left, UtfAnyString right) + { + return right.CompareTo(left) >= 0; + } + + public static bool operator <=(Utf8Span left, UtfAnyString right) + { + return right.CompareTo(left) > 0; + } + + public static bool operator >(Utf8Span left, UtfAnyString right) + { + return right.CompareTo(left) <= 0; + } + + public static bool operator >=(Utf8Span left, UtfAnyString right) + { + return right.CompareTo(left) < 0; + } + + public int CompareTo(UtfAnyString other) + { + if (object.ReferenceEquals(null, other.buffer)) + { + return object.ReferenceEquals(null, this.buffer) ? 0 : 1; + } + + switch (other.buffer) + { + case string s: + return this.CompareTo(s); + default: + return this.CompareTo((Utf8String)other.buffer); + } + } + + public int CompareTo(Utf8String other) + { + if (object.ReferenceEquals(null, this.buffer)) + { + return object.ReferenceEquals(null, other) ? 0 : -1; + } + + switch (this.buffer) + { + case string s: + return -other.Span.CompareTo(s); + default: + return -other.Span.CompareTo((Utf8String)this.buffer); + } + } + + public int CompareTo(Utf8Span other) + { + if (object.ReferenceEquals(null, this.buffer)) + { + return -1; + } + + switch (this.buffer) + { + case string s: + return -other.CompareTo(s); + default: + return -other.CompareTo((Utf8String)this.buffer); + } + } + + public int CompareTo(string other) + { + if (object.ReferenceEquals(null, this.buffer)) + { + return object.ReferenceEquals(null, other) ? 0 : -1; + } + + switch (this.buffer) + { + case string s: + return string.Compare(s, other, StringComparison.Ordinal); + default: + return ((Utf8String)this.buffer).CompareTo(other); + } + } + } +} diff --git a/jre/pom.xml b/jre/pom.xml index b558cb4..667fd75 100644 --- a/jre/pom.xml +++ b/jre/pom.xml @@ -36,7 +36,7 @@ Licensed under the MIT License. unit - 27.0.1-jre + 28.0-jre 2.9.9 1.10.19 3.11.0 diff --git a/jre/src/main/java/com/azure/data/cosmos/core/Out.java b/jre/src/main/java/com/azure/data/cosmos/core/Out.java new file mode 100644 index 0000000..ac268e7 --- /dev/null +++ b/jre/src/main/java/com/azure/data/cosmos/core/Out.java @@ -0,0 +1,81 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +package com.azure.data.cosmos.core; + +import java.util.Objects; + +/** + * A container object which may or may not contain a non-null value + * + * This is a value-based class and as such use of identity-sensitive operations--including reference equality + * ({@code ==}), identity hash code, or synchronization--on instances of {@Out} may have unpredictable results and + * should be avoided. + * + * @param + */ +public final class Out { + + private volatile T value; + + public T get() { + return value; + } + + public void set(T value) { + this.value = value; + } + + /** + * {@code true} if there is a value present, otherwise {@code false} + *

+ * This is equivalent to evaluating the expression {@code out.get() == null}. + * + * @return {@code true} if there is a value present, otherwise {@code false} + */ + public boolean isPresent() { + return value != null; + } + + /** + * Indicates whether some other object is equal to this {@link Out} value. The other object is considered equal if: + *

    + *
  • it is also an {@link Out} and; + *
  • both instances have no value present or; + *
  • the present values are equal to each other as determined by {@link T#equals(Object)}}. + *
+ * + * @param other an object to be tested for equality + * @return {code true} if the other object is equal to this object; otherwise {@code false} + */ + @Override + public boolean equals(Object other) { + + if (this == other) { + return true; + } + + if (!(other instanceof Out)) { + return false; + } + + return Objects.equals(value, ((Out)other).value); + } + + /** + * Returns the hash code value of the present value, if any, or 0 (zero) if + * no value is present. + * + * @return hash code value of the present value or 0 if no value is present + */ + @Override + public int hashCode() { + return Objects.hashCode(value); + } + + @Override + public String toString() { + return value == null ? "null" : value.toString(); + } +} diff --git a/jre/src/main/java/com/azure/data/cosmos/core/OutObject.java b/jre/src/main/java/com/azure/data/cosmos/core/OutObject.java deleted file mode 100644 index ed309bd..0000000 --- a/jre/src/main/java/com/azure/data/cosmos/core/OutObject.java +++ /dev/null @@ -1,18 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -package com.azure.data.cosmos.core; - -public final class OutObject { - - private T value; - - public T get() { - return value; - } - - public void set(T value) { - this.value = value; - } -} diff --git a/jre/src/main/java/com/azure/data/cosmos/core/RefObject.java b/jre/src/main/java/com/azure/data/cosmos/core/RefObject.java deleted file mode 100644 index e49fbd8..0000000 --- a/jre/src/main/java/com/azure/data/cosmos/core/RefObject.java +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -package com.azure.data.cosmos.core; - -public final class RefObject { - - private T value; - - public RefObject(T value) { - this.set(value); - } - - public T get() { - return value; - } - - public void set(T value) { - this.value = value; - } -} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/core/Reference.java b/jre/src/main/java/com/azure/data/cosmos/core/Reference.java new file mode 100644 index 0000000..18de7eb --- /dev/null +++ b/jre/src/main/java/com/azure/data/cosmos/core/Reference.java @@ -0,0 +1,75 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +package com.azure.data.cosmos.core; + +import java.util.Objects; + +/** + * A container object which may or may not contain a non-null value + * + * This is a value-based class and as such use of identity-sensitive operations--including reference equality + * ({@code ==}), identity hash code, or synchronization--on instances of {@Ref} may have unpredictable results and + * should be avoided. + * + * @param + */ +public final class Reference { + + private volatile T value; + + public Reference(T value) { + this.set(value); + } + + public T get() { + return value; + } + + public void set(T value) { + this.value = value; + } + + /** + * {@code true} if there is a value present, otherwise {@code false} + * + * This is equivalent to evaluating the expression {@code ref.get() == null}. + * + * @return {@code true} if there is a value present, otherwise {@code false} + */ + public boolean isPresent() { + return value != null; + } + + /** + * Indicates whether some other object is equal to this {@link Reference} value. The other object is considered equal if: + *
    + *
  • it is also an {@link Reference} and; + *
  • both instances have no value present or; + *
  • the present values are equal to each other as determined by {@link T#equals(Object)}}. + *
+ * + * @param other an object to be tested for equality + * @return {code true} if the other object is equal to this object; otherwise {@code false} + */ + @Override + public boolean equals(Object other) { + + if (this == other) { + return true; + } + + if (!(other instanceof Reference)) { + return false; + } + + return Objects.equals(value, ((Reference)other).value); + } + + + @Override + public String toString() { + return value == null ? "null" : value.toString(); + } +} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/core/Utf8String.java b/jre/src/main/java/com/azure/data/cosmos/core/Utf8String.java index 41f70db..f983da3 100644 --- a/jre/src/main/java/com/azure/data/cosmos/core/Utf8String.java +++ b/jre/src/main/java/com/azure/data/cosmos/core/Utf8String.java @@ -251,10 +251,10 @@ public final class Utf8String implements CharSequence, Comparable { } /** - * Creates a from a UTF16 encoding string. + * Creates a {@link Utf8String} from a UTF16 encoding string. * * @param string The UTF16 encoding string. - * @return A new . + * @return A new {@link Utf8String}. *

* This method must transcode the UTF-16 into UTF-8 which both requires allocation and is a size of data operation. */ diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/Float128.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/Float128.java index 98cce6e..139afb4 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/Float128.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/Float128.java @@ -36,7 +36,7 @@ package com.azure.data.cosmos.serialization.hybridrow; //C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# readonly struct: public final class Float128 { /** - * The size (in bytes) of a . + * The size (in bytes) of a {@link Float128}. */ public static final int Size = (Long.SIZE / Byte.SIZE) + (Long.SIZE / Byte.SIZE); /** @@ -51,7 +51,7 @@ public final class Float128 { public long Low; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link Float128} struct. * * @param high the high-order 64 bits. * @param low the low-order 64 bits. diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/HybridRowHeader.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/HybridRowHeader.java index e92c0f4..1764757 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/HybridRowHeader.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/HybridRowHeader.java @@ -28,7 +28,7 @@ public final class HybridRowHeader { private HybridRowVersion Version = HybridRowVersion.values()[0]; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link HybridRowHeader} struct. * * @param version The version of the HybridRow library used to write this row. * @param schemaId The unique identifier of the schema whose layout was used to write this row. diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/NullValue.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/NullValue.java index a6456f1..a00af52 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/NullValue.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/NullValue.java @@ -17,12 +17,12 @@ package com.azure.data.cosmos.serialization.hybridrow; public final class NullValue implements IEquatable { /** * The default null literal. - * This is the same value as default(). + * This is the same value as default({@link NullValue}). */ public static final NullValue Default = new NullValue(); /** - * Returns true if this is the same value as . + * Returns true if this is the same value as {@link other}. * * @param other The value to compare against. * @return True if the two values are the same. @@ -32,7 +32,7 @@ public final class NullValue implements IEquatable { } /** - * overload. + * {@link object.Equals(object)} overload. */ @Override public boolean equals(Object obj) { @@ -44,7 +44,7 @@ public final class NullValue implements IEquatable { } /** - * overload. + * {@link object.GetHashCode} overload. */ @Override public int hashCode() { 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 a67315d..1b29692 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.layouts.Layout; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutBit; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode; @@ -37,9 +38,9 @@ import static com.google.common.base.Strings.lenientFormat; //C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# ref struct: public final class RowBuffer { /** - * A sequence of bytes managed by this . + * A sequence of bytes managed by this {@link RowBuffer}. *

- * A Hybrid Row begins in the 0-th byte of the . Remaining byte + * A Hybrid Row begins in the 0-th byte of the {@link RowBuffer}. Remaining byte * sequence is defined by the Hybrid Row grammar. */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -61,7 +62,7 @@ public final class RowBuffer { private LayoutResolver resolver; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link RowBuffer} struct. * * @param capacity Initial buffer capacity. * @param resizer Optional memory resizer. @@ -87,7 +88,7 @@ public final class RowBuffer { } /** - * Initializes a new instance of the struct from an existing buffer. + * Initializes a new instance of the {@link RowBuffer} struct from an existing buffer. * * @param buffer The buffer. The row takes ownership of the buffer and the caller should not * maintain a pointer or mutate the buffer after this call returns. @@ -163,7 +164,7 @@ public final class RowBuffer { LayoutColumn col = columns[i]; if (this.ReadBit(scopeOffset, col.getNullBit().clone())) { int lengthSizeInBytes; - OutObject tempOut_lengthSizeInBytes = new OutObject(); + 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); @@ -184,7 +185,7 @@ public final class RowBuffer { * encoding. * * @param value The value to be encoded. - * @return The number of bytes needed to store the varuint encoding of . + * @return The number of bytes needed to store the varuint encoding of {@link value}. */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal static int Count7BitEncodedUInt(ulong value) @@ -216,7 +217,7 @@ public final class RowBuffer { * * @param edit The field to delete. */ - public void DeleteSparse(RefObject edit) { + public void DeleteSparse(Reference edit) { // If the field doesn't exist, then nothing to do. if (!edit.get().exists) { return; @@ -224,11 +225,11 @@ public final class RowBuffer { int numBytes = 0; int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); int _; - OutObject tempOut__2 = new OutObject(); + Out tempOut__2 = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, edit.get().cellType, edit.get().cellTypeArgs.clone(), numBytes, RowOptions.Delete, tempOut__, tempOut__2, tempOut_shift); shift = tempOut_shift.get(); @@ -239,7 +240,7 @@ public final class RowBuffer { public void DeleteVariable(int offset, boolean isVarint) { int spaceAvailable; - OutObject tempOut_spaceAvailable = new OutObject(); + Out tempOut_spaceAvailable = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ulong existingValueBytes = this.Read7BitEncodedUInt(offset, out int spaceAvailable); long existingValueBytes = this.Read7BitEncodedUInt(offset, tempOut_spaceAvailable); @@ -294,23 +295,23 @@ public final class RowBuffer { * @param srcEdit The field to move into the set/map. * @return The prepared edit context. */ - public RowCursor PrepareSparseMove(RefObject scope, RefObject srcEdit) { + public RowCursor PrepareSparseMove(Reference scope, Reference srcEdit) { checkArgument(scope.get().scopeType.IsUniqueScope); checkArgument(scope.get().index == 0); RowCursor dstEdit; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope.get().Clone(out dstEdit); dstEdit.metaOffset = scope.get().valueOffset; int srcSize = this.SparseComputeSize(srcEdit); int srcBytes = srcSize - (srcEdit.get().valueOffset - srcEdit.get().metaOffset); while (dstEdit.index < dstEdit.count) { - RefObject tempRef_dstEdit = - new RefObject(dstEdit); - this.ReadSparseMetadata(tempRef_dstEdit); - dstEdit = tempRef_dstEdit.get(); + Reference tempReference_dstEdit = + new Reference(dstEdit); + this.ReadSparseMetadata(tempReference_dstEdit); + dstEdit = tempReference_dstEdit.get(); Contract.Assert(dstEdit.pathOffset == default) @@ -319,10 +320,10 @@ public final class RowBuffer { if (scope.get().scopeType instanceof LayoutTypedMap) { cmp = this.CompareKeyValueFieldValue(srcEdit.get().clone(), dstEdit); } else { - RefObject tempRef_dstEdit2 = - new RefObject(dstEdit); - elmSize = this.SparseComputeSize(tempRef_dstEdit2); - dstEdit = tempRef_dstEdit2.get(); + Reference tempReference_dstEdit2 = + new Reference(dstEdit); + elmSize = this.SparseComputeSize(tempReference_dstEdit2); + dstEdit = tempReference_dstEdit2.get(); int elmBytes = elmSize - (dstEdit.valueOffset - dstEdit.metaOffset); cmp = this.CompareFieldValue(srcEdit.get().clone(), srcBytes, dstEdit, elmBytes); } @@ -332,10 +333,10 @@ public final class RowBuffer { return dstEdit; } - RefObject tempRef_dstEdit3 = - new RefObject(dstEdit); - elmSize = (elmSize == -1) ? this.SparseComputeSize(tempRef_dstEdit3) : elmSize; - dstEdit = tempRef_dstEdit3.get(); + Reference tempReference_dstEdit3 = + new Reference(dstEdit); + elmSize = (elmSize == -1) ? this.SparseComputeSize(tempReference_dstEdit3) : elmSize; + dstEdit = tempReference_dstEdit3.get(); dstEdit.index++; dstEdit.metaOffset += elmSize; } @@ -346,13 +347,13 @@ public final class RowBuffer { return dstEdit; } - public long Read7BitEncodedInt(int offset, OutObject lenInBytes) { + public long Read7BitEncodedInt(int offset, Out lenInBytes) { return RowBuffer.RotateSignToMsb(this.Read7BitEncodedUInt(offset, lenInBytes)); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal ulong Read7BitEncodedUInt(int offset, out int lenInBytes) - public long Read7BitEncodedUInt(int offset, OutObject lenInBytes) { + public long Read7BitEncodedUInt(int offset, Out lenInBytes) { // Read out an unsigned long 7 bits at a time. The high bit of the byte, // when set, indicates there are more bytes. //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -509,10 +510,10 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal ReadOnlySpan ReadSparseBinary(ref RowCursor edit) - public ReadOnlySpan ReadSparseBinary(RefObject edit) { + public ReadOnlySpan ReadSparseBinary(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Binary); int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ReadOnlySpan span = this.ReadBinary(edit.valueOffset, out int sizeLenInBytes); ReadOnlySpan span = this.ReadBinary(edit.get().valueOffset, tempOut_sizeLenInBytes); @@ -521,89 +522,89 @@ public final class RowBuffer { return span; } - public boolean ReadSparseBool(RefObject edit) { + public boolean ReadSparseBool(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Boolean); edit.get().endOffset = edit.get().valueOffset; return edit.get().cellType == LayoutType.Boolean; } - public LocalDateTime ReadSparseDateTime(RefObject edit) { + public LocalDateTime ReadSparseDateTime(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.DateTime); edit.get().endOffset = edit.get().valueOffset + 8; return this.ReadDateTime(edit.get().valueOffset); } - public BigDecimal ReadSparseDecimal(RefObject edit) { + public BigDecimal ReadSparseDecimal(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Decimal); // TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'sizeof': edit.get().endOffset = edit.get().valueOffset + sizeof(BigDecimal); return this.ReadDecimal(edit.get().valueOffset); } - public Float128 ReadSparseFloat128(RefObject edit) { + public Float128 ReadSparseFloat128(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Float128); edit.get().endOffset = edit.get().valueOffset + Float128.Size; return this.ReadFloat128(edit.get().valueOffset).clone(); } - public float ReadSparseFloat32(RefObject edit) { + public float ReadSparseFloat32(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Float32); edit.get().endOffset = edit.get().valueOffset + (Float.SIZE / Byte.SIZE); return this.ReadFloat32(edit.get().valueOffset); } - public double ReadSparseFloat64(RefObject edit) { + public double ReadSparseFloat64(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Float64); edit.get().endOffset = edit.get().valueOffset + (Double.SIZE / Byte.SIZE); return this.ReadFloat64(edit.get().valueOffset); } - public UUID ReadSparseGuid(RefObject edit) { + public UUID ReadSparseGuid(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Guid); edit.get().endOffset = edit.get().valueOffset + 16; return this.ReadGuid(edit.get().valueOffset); } - public short ReadSparseInt16(RefObject edit) { + public short ReadSparseInt16(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Int16); edit.get().endOffset = edit.get().valueOffset + (Short.SIZE / Byte.SIZE); return this.ReadInt16(edit.get().valueOffset); } - public int ReadSparseInt32(RefObject edit) { + public int ReadSparseInt32(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Int32); edit.get().endOffset = edit.get().valueOffset + (Integer.SIZE / Byte.SIZE); return this.ReadInt32(edit.get().valueOffset); } - public long ReadSparseInt64(RefObject edit) { + public long ReadSparseInt64(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Int64); edit.get().endOffset = edit.get().valueOffset + (Long.SIZE / Byte.SIZE); return this.ReadInt64(edit.get().valueOffset); } - public byte ReadSparseInt8(RefObject edit) { + public byte ReadSparseInt8(Reference edit) { // TODO: Remove calls to ReadSparsePrimitiveTypeCode once moved to V2 read. this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Int8); edit.get().endOffset = edit.get().valueOffset + (Byte.SIZE / Byte.SIZE); return this.ReadInt8(edit.get().valueOffset); } - public MongoDbObjectId ReadSparseMongoDbObjectId(RefObject edit) { + public MongoDbObjectId ReadSparseMongoDbObjectId(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, MongoDbObjectId); edit.get().endOffset = edit.get().valueOffset + MongoDbObjectId.Size; return this.ReadMongoDbObjectId(edit.get().valueOffset).clone(); } - public NullValue ReadSparseNull(RefObject edit) { + public NullValue ReadSparseNull(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Null); edit.get().endOffset = edit.get().valueOffset; return NullValue.Default; } - public Utf8Span ReadSparsePath(RefObject edit) { + public Utf8Span ReadSparsePath(Reference edit) { Utf8String path; - OutObject tempOut_path = new OutObject(); + Out tempOut_path = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: if (edit.layout.Tokenizer.TryFindString((ulong)edit.pathToken, out Utf8String path)) if (edit.get().layout.getTokenizer().TryFindString(edit.get().longValue().pathToken, tempOut_path)) { @@ -617,10 +618,10 @@ public final class RowBuffer { return Utf8Span.UnsafeFromUtf8BytesNoValidation(this.buffer.Slice(edit.get().pathOffset, numBytes)); } - public int ReadSparsePathLen(Layout layout, int offset, OutObject pathLenInBytes, - OutObject pathOffset) { + public int ReadSparsePathLen(Layout layout, int offset, Out pathLenInBytes, + Out pathOffset) { int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); int token = (int)this.Read7BitEncodedUInt(offset, tempOut_sizeLenInBytes); sizeLenInBytes = tempOut_sizeLenInBytes.get(); if (token < layout.getTokenizer().getCount()) { @@ -635,10 +636,10 @@ public final class RowBuffer { return token; } - public Utf8Span ReadSparseString(RefObject edit) { + public Utf8Span ReadSparseString(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.Utf8); int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); Utf8Span span = this.ReadString(edit.get().valueOffset, tempOut_sizeLenInBytes); sizeLenInBytes = tempOut_sizeLenInBytes.get(); edit.get().endOffset = edit.get().valueOffset + sizeLenInBytes + span.Length; @@ -654,7 +655,7 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal ushort ReadSparseUInt16(ref RowCursor edit) - public short ReadSparseUInt16(RefObject edit) { + public short ReadSparseUInt16(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.UInt16); edit.get().endOffset = edit.get().valueOffset + (Short.SIZE / Byte.SIZE); return this.ReadUInt16(edit.get().valueOffset); @@ -662,7 +663,7 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal uint ReadSparseUInt32(ref RowCursor edit) - public int ReadSparseUInt32(RefObject edit) { + public int ReadSparseUInt32(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.UInt32); edit.get().endOffset = edit.get().valueOffset + (Integer.SIZE / Byte.SIZE); return this.ReadUInt32(edit.get().valueOffset); @@ -670,7 +671,7 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal ulong ReadSparseUInt64(ref RowCursor edit) - public long ReadSparseUInt64(RefObject edit) { + public long ReadSparseUInt64(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.UInt64); edit.get().endOffset = edit.get().valueOffset + (Long.SIZE / Byte.SIZE); return this.ReadUInt64(edit.get().valueOffset); @@ -678,22 +679,22 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal byte ReadSparseUInt8(ref RowCursor edit) - public byte ReadSparseUInt8(RefObject edit) { + public byte ReadSparseUInt8(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.UInt8); edit.get().endOffset = edit.get().valueOffset + 1; return this.ReadUInt8(edit.get().valueOffset); } - public UnixDateTime ReadSparseUnixDateTime(RefObject edit) { + public UnixDateTime ReadSparseUnixDateTime(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.UnixDateTime); edit.get().endOffset = edit.get().valueOffset + 8; return this.ReadUnixDateTime(edit.get().valueOffset).clone(); } - public long ReadSparseVarInt(RefObject edit) { + public long ReadSparseVarInt(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.VarInt); int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); long value = this.Read7BitEncodedInt(edit.get().valueOffset, tempOut_sizeLenInBytes); sizeLenInBytes = tempOut_sizeLenInBytes.get(); edit.get().endOffset = edit.get().valueOffset + sizeLenInBytes; @@ -702,10 +703,10 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal ulong ReadSparseVarUInt(ref RowCursor edit) - public long ReadSparseVarUInt(RefObject edit) { + public long ReadSparseVarUInt(Reference edit) { this.ReadSparsePrimitiveTypeCode(edit, LayoutType.VarUInt); int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ulong value = this.Read7BitEncodedUInt(edit.valueOffset, out int sizeLenInBytes); long value = this.Read7BitEncodedUInt(edit.get().valueOffset, tempOut_sizeLenInBytes); @@ -754,7 +755,7 @@ public final class RowBuffer { //ORIGINAL LINE: internal ReadOnlySpan ReadVariableBinary(int offset) public ReadOnlySpan ReadVariableBinary(int offset) { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.ReadBinary(offset, out int _); ReadOnlySpan tempVar = this.ReadBinary(offset, tempOut__); @@ -764,7 +765,7 @@ public final class RowBuffer { public long ReadVariableInt(int offset) { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); long tempVar = this.Read7BitEncodedInt(offset, tempOut__); _ = tempOut__.get(); return tempVar; @@ -772,7 +773,7 @@ public final class RowBuffer { public Utf8Span ReadVariableString(int offset) { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); Utf8Span tempVar = this.ReadString(offset, tempOut__); _ = tempOut__.get(); return tempVar; @@ -782,7 +783,7 @@ public final class RowBuffer { //ORIGINAL LINE: internal ulong ReadVariableUInt(int offset) public long ReadVariableUInt(int offset) { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.Read7BitEncodedUInt(offset, out int _); long tempVar = this.Read7BitEncodedUInt(offset, tempOut__); @@ -838,7 +839,7 @@ public final class RowBuffer { } /** - * Undoes the rotation introduced by . + * Undoes the rotation introduced by {@link RotateSignToLsb}. * * @param uvalue An unsigned value with the sign bit in the LSB. * @return A signed two's complement value encoding the same value. @@ -893,7 +894,7 @@ public final class RowBuffer { * . * @return True if there is another field, false if there are no more. */ - public boolean SparseIteratorMoveNext(RefObject edit) { + public boolean SparseIteratorMoveNext(Reference edit) { if (edit.get().cellType != null) { // Move to the next element of an indexed scope. if (edit.get().scopeType.IsIndexedScope) { @@ -937,7 +938,7 @@ public final class RowBuffer { * @param immutable True if the new scope should be marked immutable (read-only). * @return A new scope beginning at the current iterator position. */ - public RowCursor SparseIteratorReadScope(RefObject edit, boolean immutable) { + public RowCursor SparseIteratorReadScope(Reference edit, boolean immutable) { LayoutScope scopeType = edit.get().cellType instanceof LayoutScope ? (LayoutScope)edit.get().cellType : null; switch (scopeType) { @@ -1093,18 +1094,18 @@ public final class RowBuffer { return this.buffer.Slice(0, this.length).ToArray(); } - public void TypedCollectionMoveField(RefObject dstEdit, RefObject srcEdit + public void TypedCollectionMoveField(Reference dstEdit, Reference srcEdit , RowOptions options) { int encodedSize = this.SparseComputeSize(srcEdit); int numBytes = encodedSize - (srcEdit.get().valueOffset - srcEdit.get().metaOffset); // Insert the field metadata into its new location. int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shiftInsert; - OutObject tempOut_shiftInsert = new OutObject(); + Out tempOut_shiftInsert = new Out(); this.EnsureSparse(dstEdit, srcEdit.get().cellType, srcEdit.get().cellTypeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shiftInsert); shiftInsert = tempOut_shiftInsert.get(); @@ -1123,10 +1124,10 @@ public final class RowBuffer { this.length += shiftInsert; // Delete the old location. - OutObject tempOut_metaBytes2 = new OutObject(); - OutObject tempOut_spaceNeeded2 = new OutObject(); + Out tempOut_metaBytes2 = new Out(); + Out tempOut_spaceNeeded2 = new Out(); int shiftDelete; - OutObject tempOut_shiftDelete = new OutObject(); + Out tempOut_shiftDelete = new Out(); this.EnsureSparse(srcEdit, srcEdit.get().cellType, srcEdit.get().cellTypeArgs.clone(), numBytes, RowOptions.Delete, tempOut_metaBytes2, tempOut_spaceNeeded2, tempOut_shiftDelete); shiftDelete = tempOut_shiftDelete.get(); @@ -1166,13 +1167,13 @@ public final class RowBuffer { * operation is idempotent. *

*/ - public Result TypedCollectionUniqueIndexRebuild(RefObject scope) { + public Result TypedCollectionUniqueIndexRebuild(Reference scope) { checkArgument(scope.get().scopeType.IsUniqueScope); checkArgument(scope.get().index == 0); RowCursor dstEdit; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these // cannot be - // converted using the 'OutObject' helper class unless the method is within the code being modified: + // converted using the 'Out' helper class unless the method is within the code being modified: scope.get().Clone(out dstEdit); if (dstEdit.count <= 1) { return Result.Success; @@ -1185,16 +1186,16 @@ public final class RowBuffer { new UniqueIndexItem[dstEdit.count]; dstEdit.metaOffset = scope.get().valueOffset; for (; dstEdit.index < dstEdit.count; dstEdit.index++) { - RefObject tempRef_dstEdit = - new RefObject(dstEdit); - this.ReadSparseMetadata(tempRef_dstEdit); - dstEdit = tempRef_dstEdit.get(); + Reference tempReference_dstEdit = + new Reference(dstEdit); + this.ReadSparseMetadata(tempReference_dstEdit); + dstEdit = tempReference_dstEdit.get(); Contract.Assert(dstEdit.pathOffset == default) - RefObject tempRef_dstEdit2 = - new RefObject(dstEdit); - int elmSize = this.SparseComputeSize(tempRef_dstEdit2); - dstEdit = tempRef_dstEdit2.get(); + Reference tempReference_dstEdit2 = + new Reference(dstEdit); + int elmSize = this.SparseComputeSize(tempReference_dstEdit2); + dstEdit = tempReference_dstEdit2.get(); UniqueIndexItem tempVar = new UniqueIndexItem(); tempVar.Code = dstEdit.cellType.LayoutCode; @@ -1286,15 +1287,15 @@ public final class RowBuffer { } public void WriteDateTime(int offset, LocalDateTime value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteDecimal(int offset, BigDecimal value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -1320,53 +1321,53 @@ public final class RowBuffer { } public void WriteFloat128(int offset, Float128 value) { - RefObject tempRef_value = - new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = + new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteFloat32(int offset, float value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteFloat64(int offset, double value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteGuid(int offset, UUID value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteHeader(int offset, HybridRowHeader value) { - RefObject tempRef_value = - new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = + new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteInt16(int offset, short value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteInt32(int offset, int value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteInt64(int offset, long value) { - RefObject tempRef_value = new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } public void WriteInt8(int offset, byte value) { @@ -1377,21 +1378,21 @@ public final class RowBuffer { } public void WriteMongoDbObjectId(int offset, MongoDbObjectId value) { - RefObject tempRef_value = - new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = + new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } - public void WriteNullable(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs, - UpdateOptions options, boolean hasValue, OutObject newScope) { + public void WriteNullable(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs, + UpdateOptions options, boolean hasValue, Out newScope) { int numBytes = this.CountDefaultValue(scopeType, typeArgs.clone()); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1417,26 +1418,26 @@ public final class RowBuffer { newScope.get().index = 1; this.length += shift; - RefObject tempRef_this = - new RefObject(this); - RowCursorExtensions.MoveNext(newScope.get().clone(), tempRef_this); - this = tempRef_this.get(); + Reference tempReference_this = + new Reference(this); + RowCursorExtensions.MoveNext(newScope.get().clone(), tempReference_this); + this = tempReference_this.get(); } public void WriteSchemaId(int offset, SchemaId value) { this.WriteInt32(offset, value.getId()); } - public void WriteSparseArray(RefObject edit, LayoutScope scopeType, UpdateOptions options, - OutObject newScope) { + public void WriteSparseArray(Reference edit, LayoutScope scopeType, UpdateOptions options, + Out newScope) { int numBytes = (LayoutCode.SIZE / Byte.SIZE); // end scope type code. TypeArgumentList typeArgs = TypeArgumentList.Empty; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1459,17 +1460,17 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseBinary(ref RowCursor edit, ReadOnlySpan value, UpdateOptions // options) - public void WriteSparseBinary(RefObject edit, ReadOnlySpan value, UpdateOptions options) { + public void WriteSparseBinary(Reference edit, ReadOnlySpan value, UpdateOptions options) { int len = value.Length; //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: int numBytes = len + RowBuffer.Count7BitEncodedUInt((ulong)len); int numBytes = len + RowBuffer.Count7BitEncodedUInt(len); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Binary, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1485,18 +1486,18 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseBinary(ref RowCursor edit, ReadOnlySequence value, UpdateOptions // options) - public void WriteSparseBinary(RefObject edit, ReadOnlySequence value, + public void WriteSparseBinary(Reference edit, ReadOnlySequence value, UpdateOptions options) { int len = (int)value.Length; //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: int numBytes = len + RowBuffer.Count7BitEncodedUInt((ulong)len); int numBytes = len + RowBuffer.Count7BitEncodedUInt(len); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Binary, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1509,14 +1510,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseBool(RefObject edit, boolean value, UpdateOptions options) { + public void WriteSparseBool(Reference edit, boolean value, UpdateOptions options) { int numBytes = 0; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, value ? LayoutType.Boolean : LayoutType.BooleanFalse, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1529,14 +1530,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseDateTime(RefObject edit, LocalDateTime value, UpdateOptions options) { + public void WriteSparseDateTime(Reference edit, LocalDateTime value, UpdateOptions options) { int numBytes = 8; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.DateTime, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1549,15 +1550,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseDecimal(RefObject edit, BigDecimal value, UpdateOptions options) { + public void WriteSparseDecimal(Reference edit, BigDecimal value, UpdateOptions options) { // TODO: C# TO JAVA CONVERTER: There is no Java equivalent to 'sizeof': int numBytes = sizeof(BigDecimal); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Decimal, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1571,14 +1572,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseFloat128(RefObject edit, Float128 value, UpdateOptions options) { + public void WriteSparseFloat128(Reference edit, Float128 value, UpdateOptions options) { int numBytes = Float128.Size; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Float128, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1591,14 +1592,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseFloat32(RefObject edit, float value, UpdateOptions options) { + public void WriteSparseFloat32(Reference edit, float value, UpdateOptions options) { int numBytes = (Float.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Float32, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1611,14 +1612,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseFloat64(RefObject edit, double value, UpdateOptions options) { + public void WriteSparseFloat64(Reference edit, double value, UpdateOptions options) { int numBytes = (Double.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Float64, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1631,14 +1632,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseGuid(RefObject edit, UUID value, UpdateOptions options) { + public void WriteSparseGuid(Reference edit, UUID value, UpdateOptions options) { int numBytes = 16; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Guid, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1651,14 +1652,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseInt16(RefObject edit, short value, UpdateOptions options) { + public void WriteSparseInt16(Reference edit, short value, UpdateOptions options) { int numBytes = (Short.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Int16, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1671,14 +1672,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseInt32(RefObject edit, int value, UpdateOptions options) { + public void WriteSparseInt32(Reference edit, int value, UpdateOptions options) { int numBytes = (Integer.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Int32, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1691,14 +1692,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseInt64(RefObject edit, long value, UpdateOptions options) { + public void WriteSparseInt64(Reference edit, long value, UpdateOptions options) { int numBytes = (Long.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Int64, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1711,14 +1712,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseInt8(RefObject edit, byte value, UpdateOptions options) { + public void WriteSparseInt8(Reference edit, byte value, UpdateOptions options) { int numBytes = (Byte.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Int8, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1732,15 +1733,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseMongoDbObjectId(RefObject edit, MongoDbObjectId value, + public void WriteSparseMongoDbObjectId(Reference edit, MongoDbObjectId value, UpdateOptions options) { int numBytes = MongoDbObjectId.Size; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, MongoDbObjectId, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1754,14 +1755,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseNull(RefObject edit, NullValue value, UpdateOptions options) { + public void WriteSparseNull(Reference edit, NullValue value, UpdateOptions options) { int numBytes = 0; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Null, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1773,16 +1774,16 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseObject(RefObject edit, LayoutScope scopeType, UpdateOptions options, - OutObject newScope) { + public void WriteSparseObject(Reference edit, LayoutScope scopeType, UpdateOptions options, + Out newScope) { int numBytes = (LayoutCode.SIZE / Byte.SIZE); // end scope type code. TypeArgumentList typeArgs = TypeArgumentList.Empty; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1802,17 +1803,17 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseString(RefObject edit, Utf8Span value, UpdateOptions options) { + public void WriteSparseString(Reference edit, Utf8Span value, UpdateOptions options) { int len = value.Length; //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: int numBytes = len + RowBuffer.Count7BitEncodedUInt((ulong)len); int numBytes = len + RowBuffer.Count7BitEncodedUInt(len); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.Utf8, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1825,15 +1826,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseTuple(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs - , UpdateOptions options, OutObject newScope) { + public void WriteSparseTuple(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs + , UpdateOptions options, Out newScope) { int numBytes = (LayoutCode.SIZE / Byte.SIZE) * (1 + typeArgs.getCount()); // nulls for each element. int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1869,16 +1870,16 @@ public final class RowBuffer { this.WriteUInt8(offset, (byte)code.getValue()); } - public void WriteSparseUDT(RefObject edit, LayoutScope scopeType, Layout udt, - UpdateOptions options, OutObject newScope) { + public void WriteSparseUDT(Reference edit, LayoutScope scopeType, Layout udt, + UpdateOptions options, Out newScope) { TypeArgumentList typeArgs = new TypeArgumentList(udt.getSchemaId().clone()); int numBytes = udt.getSize() + (LayoutCode.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1906,14 +1907,14 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseUInt16(ref RowCursor edit, ushort value, UpdateOptions options) - public void WriteSparseUInt16(RefObject edit, short value, UpdateOptions options) { + public void WriteSparseUInt16(Reference edit, short value, UpdateOptions options) { int numBytes = (Short.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.UInt16, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1928,14 +1929,14 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseUInt32(ref RowCursor edit, uint value, UpdateOptions options) - public void WriteSparseUInt32(RefObject edit, int value, UpdateOptions options) { + public void WriteSparseUInt32(Reference edit, int value, UpdateOptions options) { int numBytes = (Integer.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.UInt32, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1950,14 +1951,14 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseUInt64(ref RowCursor edit, ulong value, UpdateOptions options) - public void WriteSparseUInt64(RefObject edit, long value, UpdateOptions options) { + public void WriteSparseUInt64(Reference edit, long value, UpdateOptions options) { int numBytes = (Long.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.UInt64, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1972,14 +1973,14 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseUInt8(ref RowCursor edit, byte value, UpdateOptions options) - public void WriteSparseUInt8(RefObject edit, byte value, UpdateOptions options) { + public void WriteSparseUInt8(Reference edit, byte value, UpdateOptions options) { int numBytes = 1; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.UInt8, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -1992,14 +1993,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseUnixDateTime(RefObject edit, UnixDateTime value, UpdateOptions options) { + public void WriteSparseUnixDateTime(Reference edit, UnixDateTime value, UpdateOptions options) { int numBytes = 8; int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.UnixDateTime, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes , tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2013,14 +2014,14 @@ public final class RowBuffer { this.length += shift; } - public void WriteSparseVarInt(RefObject edit, long value, UpdateOptions options) { + public void WriteSparseVarInt(Reference edit, long value, UpdateOptions options) { int numBytes = RowBuffer.Count7BitEncodedInt(value); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.VarInt, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2036,14 +2037,14 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteSparseVarUInt(ref RowCursor edit, ulong value, UpdateOptions options) - public void WriteSparseVarUInt(RefObject edit, long value, UpdateOptions options) { + public void WriteSparseVarUInt(Reference edit, long value, UpdateOptions options) { int numBytes = RowBuffer.Count7BitEncodedUInt(value); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, LayoutType.VarUInt, TypeArgumentList.Empty, numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2064,15 +2065,15 @@ public final class RowBuffer { stream.Write(this.buffer.Slice(0, this.length)); } - public void WriteTypedArray(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs, - UpdateOptions options, OutObject newScope) { + public void WriteTypedArray(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs, + UpdateOptions options, Out newScope) { int numBytes = (Integer.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2093,15 +2094,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteTypedMap(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs, - UpdateOptions options, OutObject newScope) { + public void WriteTypedMap(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs, + UpdateOptions options, Out newScope) { int numBytes = (Integer.SIZE / Byte.SIZE); // Sized scope. int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2122,15 +2123,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteTypedSet(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs, - UpdateOptions options, OutObject newScope) { + public void WriteTypedSet(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs, + UpdateOptions options, Out newScope) { int numBytes = (Integer.SIZE / Byte.SIZE); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2151,15 +2152,15 @@ public final class RowBuffer { this.length += shift; } - public void WriteTypedTuple(RefObject edit, LayoutScope scopeType, TypeArgumentList typeArgs, - UpdateOptions options, OutObject newScope) { + public void WriteTypedTuple(Reference edit, LayoutScope scopeType, TypeArgumentList typeArgs, + UpdateOptions options, Out newScope) { int numBytes = this.CountDefaultValue(scopeType, typeArgs.clone()); int metaBytes; - OutObject tempOut_metaBytes = new OutObject(); + Out tempOut_metaBytes = new Out(); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); this.EnsureSparse(edit, scopeType, typeArgs.clone(), numBytes, options, tempOut_metaBytes, tempOut_spaceNeeded, tempOut_shift); shift = tempOut_shift.get(); @@ -2179,40 +2180,40 @@ public final class RowBuffer { newScope.get().count = typeArgs.getCount(); this.length += shift; - RefObject tempRef_this = - new RefObject(this); - RowCursorExtensions.MoveNext(newScope.get().clone(), tempRef_this); - this = tempRef_this.get(); + Reference tempReference_this = + new Reference(this); + RowCursorExtensions.MoveNext(newScope.get().clone(), tempReference_this); + this = tempReference_this.get(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteUInt16(int offset, ushort value) public void WriteUInt16(int offset, short value) { - RefObject tempRef_value = new RefObject(value); + Reference tempReference_value = new Reference(value); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MemoryMarshal.Write(this.buffer.Slice(offset), ref value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteUInt32(int offset, uint value) public void WriteUInt32(int offset, int value) { - RefObject tempRef_value = new RefObject(value); + Reference tempReference_value = new Reference(value); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MemoryMarshal.Write(this.buffer.Slice(offset), ref value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteUInt64(int offset, ulong value) public void WriteUInt64(int offset, long value) { - RefObject tempRef_value = new RefObject(value); + Reference tempReference_value = new Reference(value); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MemoryMarshal.Write(this.buffer.Slice(offset), ref value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -2224,19 +2225,19 @@ public final class RowBuffer { } public void WriteUnixDateTime(int offset, UnixDateTime value) { - RefObject tempRef_value = - new RefObject(value); - MemoryMarshal.Write(this.buffer.Slice(offset), tempRef_value); - value = tempRef_value.get(); + Reference tempReference_value = + new Reference(value); + MemoryMarshal.Write(this.buffer.Slice(offset), tempReference_value); + value = tempReference_value.get(); } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteVariableBinary(int offset, ReadOnlySpan value, bool exists, out int shift) public void WriteVariableBinary(int offset, ReadOnlySpan value, boolean exists, - OutObject shift) { + Out shift) { int numBytes = value.Length; int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); this.EnsureVariable(offset, false, numBytes, exists, tempOut_spaceNeeded, shift); spaceNeeded = tempOut_spaceNeeded.get(); @@ -2249,10 +2250,10 @@ public final class RowBuffer { //ORIGINAL LINE: internal void WriteVariableBinary(int offset, ReadOnlySequence value, bool exists, out int // shift) public void WriteVariableBinary(int offset, ReadOnlySequence value, boolean exists, - OutObject shift) { + Out shift) { int numBytes = (int)value.Length; int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); this.EnsureVariable(offset, false, numBytes, exists, tempOut_spaceNeeded, shift); spaceNeeded = tempOut_spaceNeeded.get(); @@ -2261,10 +2262,10 @@ public final class RowBuffer { this.length += shift.get(); } - public void WriteVariableInt(int offset, long value, boolean exists, OutObject shift) { + public void WriteVariableInt(int offset, long value, boolean exists, Out shift) { int numBytes = RowBuffer.Count7BitEncodedInt(value); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); this.EnsureVariable(offset, true, numBytes, exists, tempOut_spaceNeeded, shift); spaceNeeded = tempOut_spaceNeeded.get(); @@ -2274,10 +2275,10 @@ public final class RowBuffer { this.length += shift.get(); } - public void WriteVariableString(int offset, Utf8Span value, boolean exists, OutObject shift) { + public void WriteVariableString(int offset, Utf8Span value, boolean exists, Out shift) { int numBytes = value.Length; int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); this.EnsureVariable(offset, false, numBytes, exists, tempOut_spaceNeeded, shift); spaceNeeded = tempOut_spaceNeeded.get(); @@ -2288,10 +2289,10 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: internal void WriteVariableUInt(int offset, ulong value, bool exists, out int shift) - public void WriteVariableUInt(int offset, long value, boolean exists, OutObject shift) { + public void WriteVariableUInt(int offset, long value, boolean exists, Out shift) { int numBytes = RowBuffer.Count7BitEncodedUInt(value); int spaceNeeded; - OutObject tempOut_spaceNeeded = new OutObject(); + Out tempOut_spaceNeeded = new Out(); this.EnsureVariable(offset, true, numBytes, exists, tempOut_spaceNeeded, shift); spaceNeeded = tempOut_spaceNeeded.get(); @@ -2384,15 +2385,15 @@ public final class RowBuffer { leftKey.metaOffset = left.valueOffset; leftKey.index = 0; - RefObject tempRef_leftKey = - new RefObject(leftKey); - this.ReadSparseMetadata(tempRef_leftKey); - leftKey = tempRef_leftKey.get(); + Reference tempReference_leftKey = + new Reference(leftKey); + this.ReadSparseMetadata(tempReference_leftKey); + leftKey = tempReference_leftKey.get(); checkState(leftKey.pathOffset == 0); - RefObject tempRef_leftKey2 = - new RefObject(leftKey); - int leftKeyLen = this.SparseComputeSize(tempRef_leftKey2) - (leftKey.valueOffset - leftKey.metaOffset); - leftKey = tempRef_leftKey2.get(); + Reference tempReference_leftKey2 = + new Reference(leftKey); + int leftKeyLen = this.SparseComputeSize(tempReference_leftKey2) - (leftKey.valueOffset - leftKey.metaOffset); + leftKey = tempReference_leftKey2.get(); RowCursor rightKey = new RowCursor(); rightKey.layout = right.layout; @@ -2402,15 +2403,15 @@ public final class RowBuffer { rightKey.metaOffset = right.valueOffset; rightKey.index = 0; - RefObject tempRef_rightKey = - new RefObject(rightKey); - this.ReadSparseMetadata(tempRef_rightKey); - rightKey = tempRef_rightKey.get(); + Reference tempReference_rightKey = + new Reference(rightKey); + this.ReadSparseMetadata(tempReference_rightKey); + rightKey = tempReference_rightKey.get(); checkState(rightKey.pathOffset == 0); - RefObject tempRef_rightKey2 = - new RefObject(rightKey); - int rightKeyLen = this.SparseComputeSize(tempRef_rightKey2) - (rightKey.valueOffset - rightKey.metaOffset); - rightKey = tempRef_rightKey2.get(); + Reference tempReference_rightKey2 = + new Reference(rightKey); + int rightKeyLen = this.SparseComputeSize(tempReference_rightKey2) - (rightKey.valueOffset - rightKey.metaOffset); + rightKey = tempReference_rightKey2.get(); return this.CompareFieldValue(leftKey.clone(), leftKeyLen, rightKey.clone(), rightKeyLen); } @@ -2420,7 +2421,7 @@ public final class RowBuffer { * encoding. * * @param value The value to be encoded. - * @return The number of bytes needed to store the varint encoding of . + * @return The number of bytes needed to store the varint encoding of {@link value}. */ private static int Count7BitEncodedInt(long value) { return RowBuffer.Count7BitEncodedUInt(RowBuffer.RotateSignToLsb(value)); @@ -2630,13 +2631,13 @@ public final class RowBuffer { } } - private static int CountSparsePath(RefObject edit) { + private static int CountSparsePath(Reference edit) { if (!edit.get().writePathToken.getIsNull()) { return edit.get().writePathToken.Varint.length; } - OutObject tempOut_writePathToken = - new OutObject(); + Out tempOut_writePathToken = + new Out(); if (edit.get().layout.getTokenizer().TryFindToken(edit.get().writePath, tempOut_writePathToken)) { edit.get().argValue.writePathToken = tempOut_writePathToken.get(); return edit.get().writePathToken.Varint.length; @@ -2668,9 +2669,9 @@ public final class RowBuffer { //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private void EnsureSparse(ref RowCursor edit, // LayoutType cellType, TypeArgumentList typeArgs, int numBytes, UpdateOptions options, out int metaBytes, out // int spaceNeeded, out int shift) - private void EnsureSparse(RefObject edit, LayoutType cellType, TypeArgumentList typeArgs, - int numBytes, UpdateOptions options, OutObject metaBytes, - OutObject spaceNeeded, OutObject shift) { + private void EnsureSparse(Reference edit, LayoutType cellType, TypeArgumentList typeArgs, + int numBytes, UpdateOptions options, Out metaBytes, + Out spaceNeeded, Out shift) { this.EnsureSparse(edit, cellType, typeArgs.clone(), numBytes, RowOptions.forValue(options), metaBytes, spaceNeeded, shift); } @@ -2691,10 +2692,10 @@ public final class RowBuffer { * @param shift On success, the number of bytes the length of the row buffer was increased * (which may be negative if the row buffer was shrunk). */ - private void EnsureSparse(RefObject edit, LayoutType cellType, TypeArgumentList typeArgs, - int numBytes, RowOptions options, OutObject metaBytes, - OutObject spaceNeeded, - OutObject shift) { + private void EnsureSparse(Reference edit, LayoutType cellType, TypeArgumentList typeArgs, + int numBytes, RowOptions options, Out metaBytes, + Out spaceNeeded, + Out shift) { int metaOffset = edit.get().metaOffset; int spaceAvailable = 0; @@ -2759,13 +2760,13 @@ public final class RowBuffer { } private void EnsureVariable(int offset, boolean isVarint, int numBytes, boolean exists, - OutObject spaceNeeded, OutObject shift) { + Out spaceNeeded, Out shift) { int spaceAvailable = 0; //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ulong existingValueBytes = 0; long existingValueBytes = 0; if (exists) { - OutObject tempOut_spaceAvailable = new OutObject(); + Out tempOut_spaceAvailable = new Out(); existingValueBytes = this.Read7BitEncodedUInt(offset, tempOut_spaceAvailable); spaceAvailable = tempOut_spaceAvailable.get(); } @@ -2827,7 +2828,7 @@ public final class RowBuffer { * best choice. *

*/ - private boolean InsertionSort(RefObject scope, RefObject dstEdit, + private boolean InsertionSort(Reference scope, Reference dstEdit, Span uniqueIndex) { RowCursor leftEdit = dstEdit.get().clone(); RowCursor rightEdit = dstEdit.get().clone(); @@ -2877,7 +2878,7 @@ public final class RowBuffer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: private ReadOnlySpan ReadBinary(int offset, out int sizeLenInBytes) - private ReadOnlySpan ReadBinary(int offset, OutObject sizeLenInBytes) { + private ReadOnlySpan ReadBinary(int offset, Out sizeLenInBytes) { int numBytes = (int)this.Read7BitEncodedUInt(offset, sizeLenInBytes); return this.buffer.Slice(offset + sizeLenInBytes.get(), numBytes); } @@ -2908,7 +2909,7 @@ public final class RowBuffer { * undefined. * . */ - private void ReadSparseMetadata(RefObject edit) { + private void ReadSparseMetadata(Reference edit) { if (edit.get().scopeType.HasImplicitTypeCode(edit)) { edit.get().scopeType.SetImplicitTypeCode(edit); edit.get().valueOffset = edit.get().metaOffset; @@ -2924,27 +2925,27 @@ public final class RowBuffer { return; } - RefObject tempRef_this = - new RefObject(this); + Reference tempReference_this = + new Reference(this); int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); - edit.get().cellTypeArgs = edit.get().cellType.ReadTypeArgumentList(tempRef_this, + Out tempOut_sizeLenInBytes = new Out(); + edit.get().cellTypeArgs = edit.get().cellType.ReadTypeArgumentList(tempReference_this, edit.get().valueOffset, tempOut_sizeLenInBytes).clone(); sizeLenInBytes = tempOut_sizeLenInBytes.get(); - this = tempRef_this.get(); + this = tempReference_this.get(); edit.get().valueOffset += sizeLenInBytes; } - RefObject tempRef_this2 = - new RefObject(this); - edit.get().scopeType.ReadSparsePath(tempRef_this2, edit); - this = tempRef_this2.get(); + Reference tempReference_this2 = + new Reference(this); + edit.get().scopeType.ReadSparsePath(tempReference_this2, edit); + this = tempReference_this2.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [Conditional("DEBUG")] private void ReadSparsePrimitiveTypeCode(ref RowCursor edit, LayoutType // code) - private void ReadSparsePrimitiveTypeCode(RefObject edit, LayoutType code) { + private void ReadSparsePrimitiveTypeCode(Reference edit, LayoutType code) { checkState(edit.get().exists); if (edit.get().scopeType.HasImplicitTypeCode(edit)) { @@ -2976,9 +2977,9 @@ public final class RowBuffer { checkState(edit.get().pathToken == 0); } else { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); int pathOffset; - OutObject tempOut_pathOffset = new OutObject(); + Out tempOut_pathOffset = new Out(); int token = this.ReadSparsePathLen(edit.get().layout, edit.get().metaOffset + (LayoutCode.SIZE / Byte.SIZE), tempOut__, tempOut_pathOffset); pathOffset = tempOut_pathOffset.get(); @@ -2988,7 +2989,7 @@ public final class RowBuffer { } } - private Utf8Span ReadString(int offset, OutObject sizeLenInBytes) { + private Utf8Span ReadString(int offset, Out sizeLenInBytes) { int numBytes = (int)this.Read7BitEncodedUInt(offset, sizeLenInBytes); return Utf8Span.UnsafeFromUtf8BytesNoValidation(this.buffer.Slice(offset + sizeLenInBytes.get(), numBytes)); } @@ -2999,7 +3000,7 @@ public final class RowBuffer { * @param edit The sparse scope to search. * @return The 0-based byte offset immediately following the scope end marker. */ - private int SkipScope(RefObject edit) { + private int SkipScope(Reference edit) { while (this.SparseIteratorMoveNext(edit)) { } @@ -3087,7 +3088,7 @@ public final class RowBuffer { ///#pragma warning disable SA1137 // Elements should have the same indentation { int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes = new OutObject(); + Out tempOut_sizeLenInBytes = new Out(); int numBytes = (int)this.Read7BitEncodedUInt(metaOffset + metaBytes, tempOut_sizeLenInBytes); sizeLenInBytes = tempOut_sizeLenInBytes.get(); return metaBytes + sizeLenInBytes + numBytes; @@ -3096,7 +3097,7 @@ public final class RowBuffer { case VarInt: case VarUInt: { int sizeLenInBytes; - OutObject tempOut_sizeLenInBytes2 = new OutObject(); + Out tempOut_sizeLenInBytes2 = new Out(); this.Read7BitEncodedUInt(metaOffset + metaBytes, tempOut_sizeLenInBytes2); sizeLenInBytes = tempOut_sizeLenInBytes2.get(); return metaBytes + sizeLenInBytes; @@ -3116,7 +3117,7 @@ public final class RowBuffer { * @param edit The edit structure describing the field to measure. * @return The length (in bytes) of the encoded field including the metadata and the value. */ - private int SparseComputeSize(RefObject edit) { + private int SparseComputeSize(Reference edit) { if (!(edit.get().cellType instanceof LayoutScope)) { return this.SparseComputePrimitiveSize(edit.get().cellType, edit.get().metaOffset, edit.get().valueOffset); @@ -3124,10 +3125,10 @@ public final class RowBuffer { // Compute offset to end of value for current value. RowCursor newScope = this.SparseIteratorReadScope(edit, true).clone(); - RefObject tempRef_newScope = - new RefObject(newScope); - int tempVar = this.SkipScope(tempRef_newScope) - edit.get().metaOffset; - newScope = tempRef_newScope.get(); + Reference tempReference_newScope = + new Reference(newScope); + int tempVar = this.SkipScope(tempReference_newScope) - edit.get().metaOffset; + newScope = tempReference_newScope.get(); return tempVar; } @@ -3384,14 +3385,14 @@ public final class RowBuffer { } } - private void WriteSparseMetadata(RefObject edit, LayoutType cellType, + private void WriteSparseMetadata(Reference edit, LayoutType cellType, TypeArgumentList typeArgs, int metaBytes) { int metaOffset = edit.get().metaOffset; if (!edit.get().scopeType.HasImplicitTypeCode(edit)) { - RefObject tempRef_this = - new RefObject(this); - metaOffset += cellType.WriteTypeArgument(tempRef_this, metaOffset, typeArgs.clone()); - this = tempRef_this.get(); + Reference tempReference_this = + new Reference(this); + metaOffset += cellType.WriteTypeArgument(tempReference_this, metaOffset, typeArgs.clone()); + this = tempReference_this.get(); } this.WriteSparsePath(edit, metaOffset); @@ -3399,7 +3400,7 @@ public final class RowBuffer { checkState(edit.get().valueOffset == edit.get().metaOffset + metaBytes); } - private void WriteSparsePath(RefObject edit, int offset) { + private void WriteSparsePath(Reference edit, int offset) { // Some scopes don't encode paths, therefore the cost is always zero. if (edit.get().scopeType.IsIndexedScope) { edit.get().pathToken = 0; @@ -3408,8 +3409,8 @@ public final class RowBuffer { } StringToken _; - OutObject tempOut__ = - new OutObject(); + Out tempOut__ = + new Out(); checkState(!edit.get().layout.getTokenizer().TryFindToken(edit.get().writePath, tempOut__) || !edit.get().writePathToken.getIsNull()); _ = tempOut__.get(); if (!edit.get().writePathToken.getIsNull()) { @@ -3437,12 +3438,12 @@ public final class RowBuffer { } /** - * represents a single item within a set/map scope that needs + * {@link UniqueIndexItem} represents a single item within a set/map scope that needs * to be indexed. *

*

* This structure is used when rebuilding a set/map index during row streaming via - * . + * {@link IO.RowWriter}. * * Each item encodes its offsets and length within the row. */ diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursor.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursor.java index 0767d9c..a76de77 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursor.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursor.java @@ -9,7 +9,8 @@ package com.azure.data.cosmos.serialization.hybridrow; // ReSharper disable InconsistentNaming -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.layouts.Layout; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutScope; @@ -30,7 +31,7 @@ public final class RowCursor { */ public LayoutType cellType; /** - * For types with generic parameters (e.g. , the type parameters. + * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. */ public TypeArgumentList cellTypeArgs = new TypeArgumentList(); /** @@ -102,7 +103,7 @@ public final class RowCursor { */ public StringToken writePathToken = new StringToken(); - public static RowCursor Create(RefObject row) { + public static RowCursor Create(Reference row) { SchemaId schemaId = row.get().ReadSchemaId(1).clone(); Layout layout = row.get().getResolver().Resolve(schemaId.clone()); int sparseSegmentOffset = row.get().ComputeVariableValueOffset(layout, HybridRowHeader.Size, @@ -221,7 +222,7 @@ public final class RowCursor { LayoutType getScopeType() /** - * For types with generic parameters (e.g. , the type parameters. + * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [DebuggerBrowsable(DebuggerBrowsableState.Never)] public TypeArgumentList ScopeTypeArgs diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursorExtensions.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursorExtensions.java index 78bbb8a..4ac75f7 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursorExtensions.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowCursorExtensions.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutEndScope; @@ -14,7 +15,7 @@ public final class RowCursorExtensions { /** Makes a copy of the current cursor. The two cursors will have independent and unconnected lifetimes after cloning. However, - mutations to a can invalidate any active cursors over the same row. + mutations to a {@link RowBuffer} can invalidate any active cursors over the same row. */ // TODO: C# TO JAVA CONVERTER: 'ref return' methods are not converted by C# to Java Converter: @@ -78,14 +79,14 @@ public final class RowCursorExtensions { // edit.writePathToken = pathToken; // return ref edit; // } - public static boolean MoveNext(RefObject edit, RefObject row) { + public static boolean MoveNext(Reference edit, Reference row) { edit.get().writePath = null; edit.get().writePathToken = null; return row.get().SparseIteratorMoveNext(edit); } - public static boolean MoveNext(RefObject edit, RefObject row, - RefObject childScope) { + public static boolean MoveNext(Reference edit, Reference row, + Reference childScope) { if (childScope.get().scopeType != null) { RowCursorExtensions.Skip(edit.get().clone(), row, childScope); } @@ -93,7 +94,7 @@ public final class RowCursorExtensions { return RowCursorExtensions.MoveNext(edit.get().clone(), row); } - public static boolean MoveTo(RefObject edit, RefObject row, int index) { + public static boolean MoveTo(Reference edit, Reference row, int index) { checkState(edit.get().index <= index); edit.get().writePath = null; edit.get().writePathToken = null; @@ -106,8 +107,8 @@ public final class RowCursorExtensions { return true; } - public static void Skip(RefObject edit, RefObject row, - RefObject childScope) { + public static void Skip(Reference edit, Reference row, + Reference childScope) { checkArgument(childScope.get().start == edit.get().valueOffset); if (!(childScope.get().cellType instanceof LayoutEndScope)) { while (row.get().SparseIteratorMoveNext(childScope)) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowOptions.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowOptions.java index 007df69..4915c0c 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowOptions.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/RowOptions.java @@ -31,8 +31,8 @@ public enum RowOptions { /** * Update an existing value or insert a new value, if no value exists. *

- * If a value exists, then this operation becomes , otherwise it - * becomes . + * If a value exists, then this operation becomes {@link Update}, otherwise it + * becomes {@link Insert}. */ Upsert(3), @@ -40,7 +40,7 @@ public enum RowOptions { * Insert a new value moving existing values to the right. *

* Within an array scope, inserts a new value immediately at the index moving all subsequent - * items to the right. In any other scope behaves the same as . + * items to the right. In any other scope behaves the same as {@link Upsert}. */ InsertAt(4), 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 45a489f..d515442 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 @@ -29,7 +29,7 @@ public final class SchemaId implements IEquatable { private int Id; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link SchemaId} struct. * * @param id The underlying globally unique identifier of the schema. */ @@ -45,7 +45,7 @@ public final class SchemaId implements IEquatable { } /** - * overload. + * {@link object.Equals(object)} overload. */ @Override public boolean equals(Object obj) { @@ -57,7 +57,7 @@ public final class SchemaId implements IEquatable { } /** - * Returns true if this is the same as . + * Returns true if this is the same {@link SchemaId} as {@link other}. * * @param other The value to compare against. * @return True if the two values are the same. @@ -67,7 +67,7 @@ public final class SchemaId implements IEquatable { } /** - * overload. + * {@link object.GetHashCode} overload. */ @Override public int hashCode() { @@ -89,7 +89,7 @@ public final class SchemaId implements IEquatable { } /** - * overload. + * {@link object.ToString} overload. */ @Override public String toString() { @@ -97,7 +97,7 @@ public final class SchemaId implements IEquatable { } /** - * Helper class for parsing from JSON. + * Helper class for parsing {@link SchemaId} from JSON. */ public static class SchemaIdConverter extends JsonConverter { @Override diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/UnixDateTime.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/UnixDateTime.java index 01c0b49..6f6dce5 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/UnixDateTime.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/UnixDateTime.java @@ -7,7 +7,7 @@ package com.azure.data.cosmos.serialization.hybridrow; /** * A wall clock time expressed in milliseconds since the Unix Epoch. *

- * A is a fixed length value-type providing millisecond + * A {@link UnixDateTime} is a fixed length value-type providing millisecond * granularity as a signed offset from the Unix Epoch (midnight, January 1, 1970 UTC). */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -21,9 +21,9 @@ package com.azure.data.cosmos.serialization.hybridrow; public final class UnixDateTime implements IEquatable { /** * The unix epoch. - * values are signed values centered on . + * {@link UnixDateTime} values are signed values centered on {@link Epoch}. * - * This is the same value as default(). + * This is the same value as default({@link UnixDateTime}). */ public static final UnixDateTime Epoch = new UnixDateTime(); /** @@ -31,15 +31,15 @@ public final class UnixDateTime implements IEquatable { */ public static final int Size = (Long.SIZE / Byte.SIZE); /** - * The number of milliseconds since . + * The number of milliseconds since {@link Epoch}. * This value may be negative. */ private long Milliseconds; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link UnixDateTime} struct. * - * @param milliseconds The number of milliseconds since . + * @param milliseconds The number of milliseconds since {@link Epoch}. */ public UnixDateTime() { } @@ -53,7 +53,7 @@ public final class UnixDateTime implements IEquatable { } /** - * Returns true if this is the same value as . + * Returns true if this is the same value as {@link other}. * * @param other The value to compare against. * @return True if the two values are the same. @@ -63,7 +63,7 @@ public final class UnixDateTime implements IEquatable { } /** - * overload. + * {@link object.Equals(object)} overload. */ @Override public boolean equals(Object obj) { @@ -75,7 +75,7 @@ public final class UnixDateTime implements IEquatable { } /** - * overload. + * {@link object.GetHashCode} overload. */ @Override public int hashCode() { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Murmur3Hash.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Murmur3Hash.java new file mode 100644 index 0000000..6d90089 --- /dev/null +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Murmur3Hash.java @@ -0,0 +1,134 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +package com.azure.data.cosmos.serialization.hybridrow.internal; + +import com.google.common.base.Utf8; +import com.google.common.hash.HashCode; +import com.google.common.hash.HashFunction; +import com.google.common.hash.Hashing; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.netty.buffer.Unpooled; + +import javax.annotation.Nonnull; +import javax.annotation.concurrent.Immutable; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Strings.lenientFormat; +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Murmur3Hash for x64 (Little Endian). + *

Reference: https: //en.wikipedia.org/wiki/MurmurHash

+ *

+ * This implementation provides span-based access for hashing content not available in a + * {@link T:byte[]} + *

+ */ +@SuppressWarnings("UnstableApiUsage") +@Immutable +public final class Murmur3Hash { + + private static final ByteBufAllocator allocator = ByteBufAllocator.DEFAULT; + private static final ByteBuf FALSE = Constant.add(false); + private static final ByteBuf TRUE = Constant.add(true); + private static final ByteBuf EMPTY_STRING = Constant.add(""); + + /** + * Computes a 128-bit Murmur3Hash 128-bit value for a data item + * + * @param item The data to hash + * @param seed The seed with which to initialize + * @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance + */ + public static Code Hash128(@Nonnull final String item, @Nonnull final Code seed) { + + checkNotNull(item, "value: null, seed: %s", seed); + checkNotNull(seed, "value: %s, seed: null", item); + + if (item.isEmpty()) { + Hash128(EMPTY_STRING, seed); + } + + final int encodedLength = Utf8.encodedLength(item); + ByteBuf buffer = allocator.buffer(encodedLength, encodedLength); + + try { + final int count = buffer.writeCharSequence(item, UTF_8); + assert count == encodedLength : lenientFormat("count: %s, encodedLength: %s"); + return Hash128(buffer, seed); + } finally { + buffer.release(); + } + } + + /** + * Computes a 128-bit Murmur3Hash 128-bit value for a {@link boolean} data item + * + * @param item The data to hash + * @param seed The seed with which to initialize + * @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance + */ + public static Code Hash128(boolean item, Code seed) { + return Murmur3Hash.Hash128(item ? TRUE : FALSE, seed); + } + + /** + * Computes a 128-bit Murmur3Hash 128-bit value for a {@link ByteBuf} data item + * + * @param item The data to hash + * @param seed The seed with which to initialize + * @return The 128-bit hash represented as two 64-bit words encapsulated by a {@link Code} instance + */ + public static Code Hash128(ByteBuf item, Code seed) { + // TODO: DANOBLE: Fork and update or hack murmur3_128 to support a 128-bit seed value or push for a 32-bit seed + HashFunction hashFunction = Hashing.murmur3_128(Long.valueOf(seed.high | 0xFFFFFFFFL).intValue()); + HashCode hashCode = hashFunction.hashBytes(item.array()); + return new Code(hashCode); + } + + @Immutable + public static final class Code { + + public final long low, high; + + public Code(long low, long high) { + this.low = low; + this.high = high; + } + + private Code(HashCode hashCode) { + ByteBuf buffer = Unpooled.wrappedBuffer(hashCode.asBytes()); + this.low = buffer.readLongLE(); + this.high = buffer.readLongLE(); + } + } + + private static final class Constant { + + private static ByteBuf constants = allocator.heapBuffer(); + + private Constant() { + } + + static ByteBuf add(final boolean value) { + final int start = constants.writerIndex(); + constants.writeByte(value ? 1 : 0); + return constants.slice(start, Byte.BYTES).asReadOnly(); + } + + static ByteBuf add(final String value) { + + final int start = constants.writerIndex(); + final int encodedLength = Utf8.encodedLength(value); + final ByteBuf buffer = allocator.buffer(encodedLength, encodedLength); + + final int count = buffer.writeCharSequence(value, UTF_8); + assert count == encodedLength : lenientFormat("count: %s, encodedLength: %s"); + + return constants.slice(start, encodedLength); + } + } +} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/MurmurHash3.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/MurmurHash3.java deleted file mode 100644 index eba9c5a..0000000 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/MurmurHash3.java +++ /dev/null @@ -1,255 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -package com.azure.data.cosmos.serialization.hybridrow.internal; - -import static com.google.common.base.Preconditions.checkArgument; - -/** - * MurmurHash3 for x64 (Little Endian). - *

Reference: https: //en.wikipedia.org/wiki/MurmurHash

- *

- * This implementation provides span-based access for hashing content not available in a - * - *

- */ -public final class MurmurHash3 { - /** MurmurHash3 128-bit implementation. - @param value The data to hash. - @param seed The seed to initialize with. - @return The 128-bit hash represented as two 64-bit words. - */ - // TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter: - public static Value Hash128(String value, Value seed) { - checkArgument(value != null); - int size = Encoding.UTF8.GetMaxByteCount(value.length()); - Span span = size <= 256 ? stackalloc byte[size] :new byte[size]; - int len = Encoding.UTF8.GetBytes(value.AsSpan(), span); - return MurmurHash3.Hash128(span.Slice(0, len), seed); - } - - /** MurmurHash3 128-bit implementation. - @param value The data to hash. - @param seed The seed to initialize with. - @return The 128-bit hash represented as two 64-bit words. - */ - // TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter: - public static Value Hash128(boolean value, Value seed) { - // Ensure that a bool is ALWAYS a single byte encoding with 1 for true and 0 for false. - return MurmurHash3.Hash128((byte)(value ? 1 : 0), seed); - } - - /** MurmurHash3 128-bit implementation. - @param value The data to hash. - @param seed The seed to initialize with. - @return The 128-bit hash represented as two 64-bit words. - */ - // TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter: - // public static unsafe(ulong low, ulong high) Hash128(T value, (ulong high, ulong low) seed) where T : - // unmanaged - // { - // ReadOnlySpan span = new ReadOnlySpan(&value, 1); - // return MurmurHash3.Hash128(MemoryMarshal.AsBytes(span), seed); - // } - - /** - * MurmurHash3 128-bit implementation. - * - * @param span The data to hash. - * @param seed The seed to initialize with. - * @return The 128-bit hash represented as two 64-bit words. - */ - // TODO: C# TO JAVA CONVERTER: Methods returning tuples are not converted by C# to Java Converter: - // public static unsafe(ulong low, ulong high) Hash128(ReadOnlySpan span, (ulong high, ulong low) seed) - // { - // Contract.Assert(BitConverter.IsLittleEndian, "Little Endian expected"); - // const ulong c1 = 0x87c37b91114253d5; - // const ulong c2 = 0x4cf5ad432745937f; - // - // (ulong h1, ulong h2) = seed; - // - // // body - // unchecked - // { - // fixed (byte* words = span) - // { - // int position; - // for (position = 0; position < span.Length - 15; position += 16) - // { - // ulong k1 = *(ulong*)(words + position); - // ulong k2 = *(ulong*)(words + position + 8); - // - // // k1, h1 - // k1 *= c1; - // k1 = MurmurHash3.RotateLeft64(k1, 31); - // k1 *= c2; - // - // h1 ^= k1; - // h1 = MurmurHash3.RotateLeft64(h1, 27); - // h1 += h2; - // h1 = (h1 * 5) + 0x52dce729; - // - // // k2, h2 - // k2 *= c2; - // k2 = MurmurHash3.RotateLeft64(k2, 33); - // k2 *= c1; - // - // h2 ^= k2; - // h2 = MurmurHash3.RotateLeft64(h2, 31); - // h2 += h1; - // h2 = (h2 * 5) + 0x38495ab5; - // } - // - // { - // // tail - // ulong k1 = 0; - // ulong k2 = 0; - // - // int n = span.Length & 15; - // if (n >= 15) - // { - // k2 ^= (ulong)words[position + 14] << 48; - // } - // - // if (n >= 14) - // { - // k2 ^= (ulong)words[position + 13] << 40; - // } - // - // if (n >= 13) - // { - // k2 ^= (ulong)words[position + 12] << 32; - // } - // - // if (n >= 12) - // { - // k2 ^= (ulong)words[position + 11] << 24; - // } - // - // if (n >= 11) - // { - // k2 ^= (ulong)words[position + 10] << 16; - // } - // - // if (n >= 10) - // { - // k2 ^= (ulong)words[position + 09] << 8; - // } - // - // if (n >= 9) - // { - // k2 ^= (ulong)words[position + 08] << 0; - // } - // - // k2 *= c2; - // k2 = MurmurHash3.RotateLeft64(k2, 33); - // k2 *= c1; - // h2 ^= k2; - // - // if (n >= 8) - // { - // k1 ^= (ulong)words[position + 7] << 56; - // } - // - // if (n >= 7) - // { - // k1 ^= (ulong)words[position + 6] << 48; - // } - // - // if (n >= 6) - // { - // k1 ^= (ulong)words[position + 5] << 40; - // } - // - // if (n >= 5) - // { - // k1 ^= (ulong)words[position + 4] << 32; - // } - // - // if (n >= 4) - // { - // k1 ^= (ulong)words[position + 3] << 24; - // } - // - // if (n >= 3) - // { - // k1 ^= (ulong)words[position + 2] << 16; - // } - // - // if (n >= 2) - // { - // k1 ^= (ulong)words[position + 1] << 8; - // } - // - // if (n >= 1) - // { - // k1 ^= (ulong)words[position + 0] << 0; - // } - // - // k1 *= c1; - // k1 = MurmurHash3.RotateLeft64(k1, 31); - // k1 *= c2; - // h1 ^= k1; - // } - // } - // - // // finalization - // h1 ^= (ulong)span.Length; - // h2 ^= (ulong)span.Length; - // h1 += h2; - // h2 += h1; - // h1 = MurmurHash3.Mix(h1); - // h2 = MurmurHash3.Mix(h2); - // h1 += h2; - // h2 += h1; - // } - // - // return (h1, h2); - // } - - // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong Mix(ulong h) - //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong Mix(ulong h) - private static long Mix(long h) { - // TODO: C# TO JAVA CONVERTER: There is no equivalent to an 'unchecked' block in Java: - //C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift - // operator since the left operand was originally of an unsigned type, but you should confirm this - // replacement: - h ^= h >>> 33; - h *= 0xff51afd7ed558ccdL; - //C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift - // operator since the left operand was originally of an unsigned type, but you should confirm this - // replacement: - h ^= h >>> 33; - h *= 0xc4ceb9fe1a85ec53L; - //C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift - // operator since the left operand was originally of an unsigned type, but you should confirm this replacement: - h ^= h >>> 33; - return h; - } - - // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong RotateLeft64(ulong n, - // int numBits) - //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] private static ulong RotateLeft64(ulong n, - // int numBits) - private static long RotateLeft64(long n, int numBits) { - checkArgument(numBits < 64, "numBits < 64"); - //C# TO JAVA CONVERTER WARNING: The right shift operator was replaced by Java's logical right shift operator - // since the left operand was originally of an unsigned type, but you should confirm this replacement: - return (n << numBits) | (n >>> (64 - numBits)); - } - - public static final class Value { - - public final long low, high; - - public Value(long low, long high) { - this.low = low; - this.high = high; - } - } -} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Utf8StringJsonConverter.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Utf8StringJsonConverter.java deleted file mode 100644 index 02823f4..0000000 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/internal/Utf8StringJsonConverter.java +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -package com.azure.data.cosmos.serialization.hybridrow.internal; - - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import io.netty.buffer.ByteBuf; - -import static com.google.common.base.Preconditions.checkArgument; - -/** - * Helper class for parsing from JSON. - */ -public class Utf8StringJsonConverter extends StdSerializer { - - public Utf8StringJsonConverter() { - this(ByteBuf.class); - } - - public Utf8StringJsonConverter(Class type) { - super(type); - } - - @Override - public boolean canWrite() { - return true; - } - - @Override - public boolean CanConvert(Class type) { - return type.isAssignableFrom(ByteBuf); - } - - @Override - public Object ReadJson( - JsonReader reader, java.lang.Class objectType, Object existingValue, JsonSerializer serializer) { - checkArgument(reader.TokenType == JsonToken.String); - return Utf8String.TranscodeUtf16((String)reader.Value); - } - - @Override - public void WriteJson(JsonWriter writer, Object value, JsonSerializer serializer) { - writer.WriteValue(((Utf8String)value).toString()); - } -} \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/IRowSerializable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/IRowSerializable.java index 217dfb3..be99639 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/IRowSerializable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/IRowSerializable.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.io; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.layouts.TypeArgument; @@ -19,5 +20,5 @@ public interface IRowSerializable { * @param typeArg The schematized layout type, if a schema is available. * @return Success if the write is successful, the error code otherwise. */ - Result write(RefObject writer, TypeArgument typeArg); + Result write(Reference writer, TypeArgument typeArg); } \ No newline at end of file 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 ab4bcf8..bf8e172 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.io; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -55,21 +56,22 @@ import static com.google.common.base.Preconditions.checkState; /** - * A forward-only, streaming, field reader for . + * A forward-only, streaming, field reader for {@link RowBuffer}. *

- * A allows the traversal in a streaming, left to right fashion, of + * A {@link RowReader} allows the traversal in a streaming, left to right fashion, of * an entire HybridRow. The row's layout provides decoding for any schematized portion of the row. * However, unschematized sparse fields are read directly from the sparse segment with or without * schematization allowing all fields within the row, both known and unknown, to be read. * - * Modifying a invalidates any reader or child reader associated with it. In - * general 's should not be mutated while being enumerated. + * Modifying a {@link RowBuffer} invalidates any reader or child reader associated with it. In + * general {@link RowBuffer}'s should not be mutated while being enumerated. */ //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 ref struct RowReader //C# TO JAVA CONVERTER WARNING: Java has no equivalent to the C# ref struct: public final class RowReader { + private int columnIndex; private ReadOnlySpan columns; private RowCursor cursor = new RowCursor(); @@ -79,35 +81,35 @@ public final class RowReader { private States state = States.values()[0]; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link RowReader} struct. * * @param row The row to be read. * @param scope The scope whose fields should be enumerated. *

- * A instance traverses all of the top-level fields of a given + * A {@link RowReader} instance traverses all of the top-level fields of a given * scope. If the root scope is provided then all top-level fields in the row are enumerated. Nested - * child instances can be access through the method + * child {@link RowReader} instances can be access through the {@link ReadScope} method * to process nested content. */ public RowReader() { } /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link RowReader} struct. * * @param row The row to be read. * @param scope The scope whose fields should be enumerated. *

- * A instance traverses all of the top-level fields of a given + * A {@link RowReader} instance traverses all of the top-level fields of a given * scope. If the root scope is provided then all top-level fields in the row are enumerated. Nested - * child instances can be access through the method + * child {@link RowReader} instances can be access through the {@link ReadScope} method * to process nested content. */ - public RowReader(RefObject row) { + public RowReader(Reference row) { this(row, RowCursor.Create(row)); } - public RowReader(RefObject row, final Checkpoint checkpoint) { + public RowReader(Reference row, final Checkpoint checkpoint) { this.row = row.get().clone(); this.columns = checkpoint.Cursor.layout.getColumns(); this.schematizedCount = checkpoint.Cursor.layout.getNumFixed() + checkpoint.Cursor.layout.getNumVariable(); @@ -117,7 +119,7 @@ public final class RowReader { this.columnIndex = checkpoint.ColumnIndex; } - private RowReader(RefObject row, final RowCursor scope) { + private RowReader(Reference row, final RowCursor scope) { this.cursor = scope.clone(); this.row = row.get().clone(); this.columns = this.cursor.layout.getColumns(); @@ -140,16 +142,16 @@ public final class RowReader { return true; case Sparse: if (this.cursor.cellType instanceof LayoutNullable) { - RefObject tempRef_cursor = - new RefObject(this.cursor); - RowCursor nullableScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone(); - this.cursor = tempRef_cursor.get(); - RefObject tempRef_row = - new RefObject(this.row); - RefObject tempRef_nullableScope = new RefObject(nullableScope); - boolean tempVar = LayoutNullable.HasValue(tempRef_row, tempRef_nullableScope) == Result.Success; - nullableScope = tempRef_nullableScope.get(); - this.row = tempRef_row.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + RowCursor nullableScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone(); + this.cursor = tempReference_cursor.get(); + Reference tempReference_row = + new Reference(this.row); + Reference tempReference_nullableScope = new Reference(nullableScope); + boolean tempVar = LayoutNullable.HasValue(tempReference_row, tempReference_nullableScope) == Result.Success; + nullableScope = tempReference_nullableScope.get(); + this.row = tempReference_row.get(); return tempVar; } @@ -163,7 +165,7 @@ public final class RowReader { * The 0-based index, relative to the start of the scope, of the field (if positioned on a * field, undefined otherwise). *

- * When enumerating a non-indexed scope, this value is always 0 (see ). + * When enumerating a non-indexed scope, this value is always 0 (see {@link Path}). */ public int getIndex() { switch (this.state) { @@ -187,7 +189,7 @@ public final class RowReader { * The path, relative to the scope, of the field (if positioned on a field, undefined * otherwise). *

- * When enumerating an indexed scope, this value is always null (see ). + * When enumerating an indexed scope, this value is always null (see {@link Index}). */ public UtfAnyString getPath() { switch (this.state) { @@ -198,10 +200,10 @@ public final class RowReader { return null; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - Utf8Span span = this.row.ReadSparsePath(tempRef_cursor); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + Utf8Span span = this.row.ReadSparsePath(tempReference_cursor); + this.cursor = tempReference_cursor.get(); return Utf8String.CopyFrom(span); default: return null; @@ -212,17 +214,17 @@ public final class RowReader { * The path, relative to the scope, of the field (if positioned on a field, undefined * otherwise). *

- * When enumerating an indexed scope, this value is always null (see ). + * When enumerating an indexed scope, this value is always null (see {@link Index}). */ public Utf8Span getPathSpan() { switch (this.state) { case Schematized: return this.columns[this.columnIndex].Path.Span; case Sparse: - RefObject tempRef_cursor = - new RefObject(this.cursor); - Utf8Span tempVar = this.row.ReadSparsePath(tempRef_cursor); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + Utf8Span tempVar = this.row.ReadSparsePath(tempReference_cursor); + this.cursor = tempReference_cursor.get(); return tempVar; default: return null; @@ -314,16 +316,16 @@ public final class RowReader { case Sparse: { - RefObject tempRef_row = new RefObject(this.row); + Reference tempReference_row = new Reference(this.row); if (!RowCursorExtensions.MoveNext(this.cursor.clone(), - tempRef_row)) { - this.row = tempRef_row.get(); + tempReference_row)) { + this.row = tempReference_row.get(); this.state = States.Done; // TODO: C# TO JAVA CONVERTER: There is no 'goto' in Java: // goto case States.Done; } else { - this.row = tempRef_row.get(); + this.row = tempReference_row.get(); } return true; @@ -345,10 +347,10 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadBinary(out byte[] value) - public Result ReadBinary(OutObject value) { + public Result ReadBinary(Out value) { ReadOnlySpan span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = this.ReadBinary(out ReadOnlySpan span); Result r = this.ReadBinary(out span); @@ -365,7 +367,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadBinary(out ReadOnlySpan value) - public Result ReadBinary(OutObject> value) { + public Result ReadBinary(Out> value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -375,10 +377,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseBinary(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseBinary(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -387,12 +389,12 @@ public final class RowReader { } /** - * Read the current field as a . + * Read the current field as a {@link bool}. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadBool(OutObject value) { + public Result ReadBool(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -402,10 +404,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseBool(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseBool(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(false); @@ -414,12 +416,12 @@ public final class RowReader { } /** - * Read the current field as a fixed length value. + * Read the current field as a fixed length {@link DateTime} value. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadDateTime(OutObject value) { + public Result ReadDateTime(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -429,10 +431,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseDateTime(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseDateTime(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(LocalDateTime.MIN); @@ -441,12 +443,12 @@ public final class RowReader { } /** - * Read the current field as a fixed length value. + * Read the current field as a fixed length {@link decimal} value. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadDecimal(OutObject value) { + public Result ReadDecimal(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -456,10 +458,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseDecimal(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseDecimal(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(new BigDecimal(0)); @@ -473,7 +475,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadFloat128(OutObject value) { + public Result ReadFloat128(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value.clone()); @@ -483,10 +485,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseFloat128(tempRef_cursor).clone()); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseFloat128(tempReference_cursor).clone()); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -500,7 +502,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadFloat32(OutObject value) { + public Result ReadFloat32(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -510,10 +512,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseFloat32(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseFloat32(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -527,7 +529,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadFloat64(OutObject value) { + public Result ReadFloat64(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -537,10 +539,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseFloat64(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseFloat64(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -549,12 +551,12 @@ public final class RowReader { } /** - * Read the current field as a fixed length value. + * Read the current field as a fixed length {@link Guid} value. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadGuid(OutObject value) { + public Result ReadGuid(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -564,10 +566,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseGuid(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseGuid(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -581,7 +583,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadInt16(OutObject value) { + public Result ReadInt16(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -591,10 +593,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseInt16(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseInt16(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -608,7 +610,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadInt32(OutObject value) { + public Result ReadInt32(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -618,10 +620,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseInt32(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseInt32(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -635,7 +637,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadInt64(OutObject value) { + public Result ReadInt64(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -645,10 +647,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseInt64(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseInt64(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -662,7 +664,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadInt8(OutObject value) { + public Result ReadInt8(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -672,10 +674,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseInt8(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseInt8(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -684,12 +686,12 @@ public final class RowReader { } /** - * Read the current field as a fixed length value. + * Read the current field as a fixed length {@link MongoDbObjectId} value. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadMongoDbObjectId(OutObject value) { + public Result ReadMongoDbObjectId(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value.clone()); @@ -699,10 +701,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseMongoDbObjectId(tempRef_cursor).clone()); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseMongoDbObjectId(tempReference_cursor).clone()); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -716,7 +718,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadNull(OutObject value) { + public Result ReadNull(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value.clone()); @@ -726,10 +728,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseNull(tempRef_cursor).clone()); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseNull(tempReference_cursor).clone()); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -746,15 +748,15 @@ public final class RowReader { * Nested child readers are independent of their parent. */ public RowReader ReadScope() { - RefObject tempRef_cursor = - new RefObject(this.cursor); - RowCursor newScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone(); - this.cursor = tempRef_cursor.get(); - RefObject tempRef_row = - new RefObject(this.row); + Reference tempReference_cursor = + new Reference(this.cursor); + RowCursor newScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone(); + this.cursor = tempReference_cursor.get(); + Reference tempReference_row = + new Reference(this.row); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: return new RowReader(ref this.row, newScope) - this.row = tempRef_row.get(); + this.row = tempReference_row.get(); return tempVar; } @@ -765,32 +767,32 @@ public final class RowReader { * objects, arrays, tuples, set, and maps. */ public Result ReadScope(TContext context, ReaderFunc func) { - RefObject tempRef_cursor = - new RefObject(this.cursor); - RowCursor childScope = this.row.SparseIteratorReadScope(tempRef_cursor, true).clone(); - this.cursor = tempRef_cursor.get(); - RefObject tempRef_row = - new RefObject(this.row); - RowReader nestedReader = new RowReader(tempRef_row, childScope.clone()); - this.row = tempRef_row.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + RowCursor childScope = this.row.SparseIteratorReadScope(tempReference_cursor, true).clone(); + this.cursor = tempReference_cursor.get(); + Reference tempReference_row = + new Reference(this.row); + RowReader nestedReader = new RowReader(tempReference_row, childScope.clone()); + this.row = tempReference_row.get(); - RefObject tempRef_nestedReader = - new RefObject(nestedReader); + Reference tempReference_nestedReader = + new Reference(nestedReader); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: Result result = func == null ? null : func.Invoke(ref nestedReader, context) ??Result.Success; - nestedReader = tempRef_nestedReader.get(); + nestedReader = tempReference_nestedReader.get(); if (result != Result.Success) { return result; } - RefObject tempRef_row2 = - new RefObject(this.row); - RefObject tempRef_cursor2 = - new RefObject(nestedReader.cursor); - RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row2, - tempRef_cursor2); - nestedReader.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = + new Reference(this.row); + Reference tempReference_cursor2 = + new Reference(nestedReader.cursor); + RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row2, + tempReference_cursor2); + nestedReader.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return Result.Success; } @@ -800,10 +802,10 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadString(OutObject value) { + public Result ReadString(Out value) { Utf8Span span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.ReadString(out span); value.set((r == Result.Success) ? span.toString() :) default @@ -816,10 +818,10 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadString(OutObject value) { + public Result ReadString(Out value) { Utf8Span span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.ReadString(out span); value.set((r == Result.Success) ? Utf8String.CopyFrom(span) :) default @@ -832,7 +834,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadString(OutObject value) { + public Result ReadString(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -842,10 +844,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseString(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseString(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -861,7 +863,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadUInt16(out ushort value) - public Result ReadUInt16(OutObject value) { + public Result ReadUInt16(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -871,10 +873,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseUInt16(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseUInt16(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -890,7 +892,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadUInt32(out uint value) - public Result ReadUInt32(OutObject value) { + public Result ReadUInt32(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -900,10 +902,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseUInt32(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseUInt32(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -919,7 +921,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadUInt64(out ulong value) - public Result ReadUInt64(OutObject value) { + public Result ReadUInt64(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -929,10 +931,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseUInt64(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseUInt64(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -948,7 +950,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadUInt8(out byte value) - public Result ReadUInt8(OutObject value) { + public Result ReadUInt8(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -958,10 +960,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseUInt8(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseUInt8(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -970,12 +972,12 @@ public final class RowReader { } /** - * Read the current field as a fixed length value. + * Read the current field as a fixed length {@link UnixDateTime} value. * * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadUnixDateTime(OutObject value) { + public Result ReadUnixDateTime(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value.clone()); @@ -985,10 +987,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseUnixDateTime(tempRef_cursor).clone()); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseUnixDateTime(tempReference_cursor).clone()); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(null); @@ -1002,7 +1004,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - public Result ReadVarInt(OutObject value) { + public Result ReadVarInt(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -1012,10 +1014,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseVarInt(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseVarInt(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -1031,7 +1033,7 @@ public final class RowReader { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result ReadVarUInt(out ulong value) - public Result ReadVarUInt(OutObject value) { + public Result ReadVarUInt(Out value) { switch (this.state) { case Schematized: return this.ReadPrimitiveValue(value); @@ -1041,10 +1043,10 @@ public final class RowReader { return Result.TypeMismatch; } - RefObject tempRef_cursor = - new RefObject(this.cursor); - value.set(this.row.ReadSparseVarUInt(tempRef_cursor)); - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + value.set(this.row.ReadSparseVarUInt(tempReference_cursor)); + this.cursor = tempReference_cursor.get(); return Result.Success; default: value.set(0); @@ -1062,22 +1064,22 @@ public final class RowReader { *

*

* The reader must not have been advanced since the child reader was created with ReadScope. - * This method can be used when the overload of that takes a - * is not an option, such as when TContext is a ref struct. + * This method can be used when the overload of {@link ReadScope} that takes a + * {@link ReaderFunc{TContext}} is not an option, such as when TContext is a ref struct. */ - public Result SkipScope(RefObject nestedReader) { + public Result SkipScope(Reference nestedReader) { if (nestedReader.get().cursor.start != this.cursor.valueOffset) { return Result.Failure; } - RefObject tempRef_row = - new RefObject(this.row); - RefObject tempRef_cursor = - new RefObject(nestedReader.get().cursor); - RowCursorExtensions.Skip(this.cursor.clone(), tempRef_row, - tempRef_cursor); - nestedReader.get().argValue.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = + new Reference(this.row); + Reference tempReference_cursor = + new Reference(nestedReader.get().cursor); + RowCursorExtensions.Skip(this.cursor.clone(), tempReference_row, + tempReference_cursor); + nestedReader.get().argValue.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return Result.Success; } @@ -1101,7 +1103,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - private Result ReadPrimitiveValue(OutObject value) { + private Result ReadPrimitiveValue(Out value) { LayoutColumn col = this.columns[this.columnIndex]; LayoutType t = this.columns[this.columnIndex].Type; if (!(t instanceof LayoutType)) { @@ -1111,20 +1113,20 @@ public final class RowReader { switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_row = - new RefObject(this.row); - RefObject tempRef_cursor = - new RefObject(this.cursor); - Result tempVar = t.>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = + new Reference(this.row); + Reference tempReference_cursor = + new Reference(this.cursor); + Result tempVar = t.>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case Variable: - RefObject tempRef_row2 = new RefObject(this.row); - RefObject tempRef_cursor2 = new RefObject(this.cursor); - Result tempVar2 = t.>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(this.row); + Reference tempReference_cursor2 = new Reference(this.cursor); + Result tempVar2 = t.>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: throw new IllegalStateException(); @@ -1139,7 +1141,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - private Result ReadPrimitiveValue(OutObject value) { + private Result ReadPrimitiveValue(Out value) { LayoutColumn col = this.columns[this.columnIndex]; LayoutType t = this.columns[this.columnIndex].Type; if (!(t instanceof ILayoutUtf8SpanReadable)) { @@ -1149,18 +1151,19 @@ public final class RowReader { switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_row = new RefObject(this.row); - RefObject tempRef_cursor = new RefObject(this.cursor); - Result tempVar = t.TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = new Reference(this.row); + Reference tempReference_cursor = new Reference(this.cursor); + Result tempVar = t.TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case Variable: - RefObject tempRef_row2 = new RefObject(this.row); - RefObject tempRef_cursor2 = new RefObject(this.cursor); - Result tempVar2 = t.TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(this.row); + Reference tempReference_cursor2 = new Reference(this.cursor); + Result tempVar2 = t.TypeAs().ReadVariable(tempReference_row2, + tempReference_cursor2, col, value); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: throw new IllegalStateException(); @@ -1176,7 +1179,7 @@ public final class RowReader { * @param value On success, receives the value, undefined otherwise. * @return Success if the read is successful, an error code otherwise. */ - private Result ReadPrimitiveValue(OutObject> value) { + private Result ReadPrimitiveValue(Out> value) { LayoutColumn col = this.columns[this.columnIndex]; LayoutType t = this.columns[this.columnIndex].Type; if (!(t instanceof ILayoutSpanReadable)) { @@ -1186,18 +1189,18 @@ public final class RowReader { switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_row = new RefObject(this.row); - RefObject tempRef_cursor = new RefObject(this.cursor); - Result tempVar = t.>TypeAs().ReadFixed(tempRef_row, tempRef_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = new Reference(this.row); + Reference tempReference_cursor = new Reference(this.cursor); + Result tempVar = t.>TypeAs().ReadFixed(tempReference_row, tempReference_cursor, col, value); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case Variable: - RefObject tempRef_row2 = new RefObject(this.row); - RefObject tempRef_cursor2 = new RefObject(this.cursor); - Result tempVar2 = t.>TypeAs().ReadVariable(tempRef_row2, tempRef_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(this.row); + Reference tempReference_cursor2 = new Reference(this.cursor); + Result tempVar2 = t.>TypeAs().ReadVariable(tempReference_row2, tempReference_cursor2, col, value); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: throw new IllegalStateException(); @@ -1244,7 +1247,7 @@ public final class RowReader { } /** - * A function to reader content from a . + * A function to reader content from a {@link RowBuffer}. * The type of the context value passed by the caller. * * @param reader A forward-only cursor for writing content. @@ -1253,12 +1256,12 @@ public final class RowReader { */ @FunctionalInterface public interface ReaderFunc { - Result invoke(RefObject reader, TContext context); + Result invoke(Reference reader, TContext context); } /** - * An encapsulation of the current state of a that can be used to - * recreate the in the same logical position. + * An encapsulation of the current state of a {@link RowReader} that can be used to + * recreate the {@link RowReader} in the same logical position. */ //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 Checkpoint diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReaderExtensions.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReaderExtensions.java index 87be9cf..08c91ff 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReaderExtensions.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowReaderExtensions.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.io; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import java.util.ArrayList; @@ -21,13 +22,13 @@ public final class RowReaderExtensions { * @param list On success, the collection of materialized items. * @return The result. */ - public static Result ReadList(RefObject reader, DeserializerFunc deserializer, - OutObject> list) { + public static Result ReadList(Reference reader, DeserializerFunc deserializer, + Out> list) { // Pass the context as a struct by value to avoid allocations. ListContext ctx = new ListContext(); ctx.List = new ArrayList<>(); ctx.Deserializer = - (RefObject reader.argValue, OutObject item) -> deserializer.invoke(reader.get().clone(), item); + (Reference reader.argValue, Out item) -> deserializer.invoke(reader.get().clone(), item); // All lambda's here are static. // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not @@ -37,12 +38,12 @@ public final class RowReaderExtensions { while (arrayReader.Read()) { Result r2 = arrayReader.ReadScope(ctx1.clone(), (ref RowReader itemReader, ListContext ctx2) -> { - RefObject tempRef_itemReader = new RefObject(itemReader); + Reference tempReference_itemReader = new Reference(itemReader); TItem op; - OutObject tempOut_op = new OutObject(); - Result r3 = ctx2.Deserializer.invoke(tempRef_itemReader, tempOut_op); + Out tempOut_op = new Out(); + Result r3 = ctx2.Deserializer.invoke(tempReference_itemReader, tempOut_op); op = tempOut_op.get(); - itemReader = tempRef_itemReader.get(); + itemReader = tempReference_itemReader.get(); if (r3 != Result.Success) { return r3; } @@ -69,7 +70,7 @@ public final class RowReaderExtensions { } /** - * A function to read content from a . + * A function to read content from a {@link RowReader}. * The type of the item to read. * * @param reader A forward-only cursor for reading the item. @@ -78,7 +79,7 @@ public final class RowReaderExtensions { */ @FunctionalInterface public interface DeserializerFunc { - Result invoke(RefObject reader, OutObject item); + Result invoke(Reference reader, Out item); } //C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowWriter.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowWriter.java index f32e935..14902dd 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowWriter.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/io/RowWriter.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.io; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -33,19 +34,19 @@ public final class RowWriter { private RowBuffer row = new RowBuffer(); /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link RowWriter} struct. * * @param row The row to be read. * @param scope The scope into which items should be written. *

- * A instance writes the fields of a given scope from left to right + * A {@link RowWriter} instance writes the fields of a given scope from left to right * in a forward only manner. If the root scope is provided then all top-level fields in the row can be * written. */ public RowWriter() { } - private RowWriter(RefObject row, RefObject scope) { + private RowWriter(Reference row, Reference scope) { this.row = row.get().clone(); this.cursor = scope.get().clone(); } @@ -84,7 +85,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w, byte[] v) => w // .row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert)); @@ -105,7 +106,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w, // ReadOnlySpan v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert)); @@ -126,7 +127,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.Binary, (ref RowWriter w, // ReadOnlySequence v) => w.row.WriteSparseBinary(ref w.cursor, v, UpdateOptions.Upsert)); @@ -136,7 +137,7 @@ public final class RowWriter { } /** - * Write a field as a . + * Write a field as a {@link bool}. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -146,7 +147,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Boolean, (ref RowWriter w, boolean v) -> w.row.WriteSparseBool(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -160,26 +161,26 @@ public final class RowWriter { * @param func A function to write the entire row. * @return Success if the write is successful, an error code otherwise. */ - public static Result WriteBuffer(RefObject row, TContext context, + public static Result WriteBuffer(Reference row, TContext context, WriterFunc func) { RowCursor scope = RowCursor.Create(row); - RefObject tempRef_scope = - new RefObject(scope); - RowWriter writer = new RowWriter(row, tempRef_scope); - scope = tempRef_scope.get(); + Reference tempReference_scope = + new Reference(scope); + RowWriter writer = new RowWriter(row, tempReference_scope); + scope = tempReference_scope.get(); TypeArgument typeArg = new TypeArgument(LayoutType.UDT, new TypeArgumentList(scope.layout.getSchemaId().clone())); - RefObject tempRef_writer = - new RefObject(writer); + Reference tempReference_writer = + new Reference(writer); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: Result result = func(ref writer, typeArg, context); - writer = tempRef_writer.get(); + writer = tempReference_writer.get(); row.set(writer.row.clone()); return result; } /** - * Write a field as a fixed length value. + * Write a field as a fixed length {@link DateTime} value. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -189,13 +190,13 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.DateTime, (ref RowWriter w, LocalDateTime v) -> w.row.WriteSparseDateTime(ref w.cursor, v, UpdateOptions.Upsert)); } /** - * Write a field as a fixed length value. + * Write a field as a fixed length {@link decimal} value. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -205,7 +206,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Decimal, (ref RowWriter w, BigDecimal v) -> w.row.WriteSparseDecimal(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -221,7 +222,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value.clone(), LayoutType.Float128, (ref RowWriter w, Float128 v) -> w.row.WriteSparseFloat128(ref w.cursor, v.clone(), UpdateOptions.Upsert)); } @@ -237,7 +238,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Float32, (ref RowWriter w, float v) -> w.row.WriteSparseFloat32(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -253,13 +254,13 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Float64, (ref RowWriter w, double v) -> w.row.WriteSparseFloat64(ref w.cursor, v, UpdateOptions.Upsert)); } /** - * Write a field as a fixed length value. + * Write a field as a fixed length {@link Guid} value. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -269,7 +270,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Guid, (ref RowWriter w, UUID v) -> w.row.WriteSparseGuid(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -285,7 +286,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Int16, (ref RowWriter w, short v) -> w.row.WriteSparseInt16(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -301,7 +302,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Int32, (ref RowWriter w, int v) -> w.row.WriteSparseInt32(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -317,7 +318,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Int64, (ref RowWriter w, long v) -> w.row.WriteSparseInt64(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -333,13 +334,13 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Int8, (ref RowWriter w, byte v) -> w.row.WriteSparseInt8(ref w.cursor, v, UpdateOptions.Upsert)); } /** - * Write a field as a fixed length value. + * Write a field as a fixed length {@link MongoDbObjectId} value. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -349,13 +350,13 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value.clone(), LayoutType.MongoDbObjectId, (ref RowWriter w, MongoDbObjectId v) -> w.row.WriteSparseMongoDbObjectId(ref w.cursor, v.clone(), UpdateOptions.Upsert)); } /** - * Write a field as a . + * Write a field as a {@link t:null}. * * @param path The scope-relative path of the field to write. * @return Success if the write is successful, an error code otherwise. @@ -364,7 +365,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, NullValue.Default, LayoutType.Null, (ref RowWriter w, NullValue v) -> w.row.WriteSparseNull(ref w.cursor, v.clone(), UpdateOptions.Upsert)); } @@ -383,10 +384,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutObject scopeType: case LayoutObject scopeType: - RefObject tempRef_cursor = - new RefObject(this.cursor); - OutObject tempOut_nestedScope = - new OutObject(); + Reference tempReference_cursor = + new Reference(this.cursor); + Out tempOut_nestedScope = + new Out(); this.row.WriteSparseObject(tempRef_cursor, scopeType, UpdateOptions.Upsert, tempOut_nestedScope); nestedScope = tempOut_nestedScope.get(); this.cursor = tempRef_cursor.argValue; @@ -395,10 +396,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutArray scopeType: case LayoutArray scopeType: - RefObject tempRef_cursor2 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope2 = - new OutObject(); + Reference tempReference_cursor2 = + new Reference(this.cursor); + Out tempOut_nestedScope2 = + new Out(); this.row.WriteSparseArray(tempRef_cursor2, scopeType, UpdateOptions.Upsert, tempOut_nestedScope2); nestedScope = tempOut_nestedScope2.get(); this.cursor = tempRef_cursor2.argValue; @@ -407,10 +408,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTypedArray scopeType: case LayoutTypedArray scopeType: - RefObject tempRef_cursor3 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope3 = - new OutObject(); + Reference tempReference_cursor3 = + new Reference(this.cursor); + Out tempOut_nestedScope3 = + new Out(); this.row.WriteTypedArray(tempRef_cursor3, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope3); nestedScope = tempOut_nestedScope3.get(); @@ -421,10 +422,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTuple scopeType: case LayoutTuple scopeType: - RefObject tempRef_cursor4 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope4 = - new OutObject(); + Reference tempReference_cursor4 = + new Reference(this.cursor); + Out tempOut_nestedScope4 = + new Out(); this.row.WriteSparseTuple(tempRef_cursor4, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope4); nestedScope = tempOut_nestedScope4.get(); @@ -435,10 +436,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTypedTuple scopeType: case LayoutTypedTuple scopeType: - RefObject tempRef_cursor5 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope5 = - new OutObject(); + Reference tempReference_cursor5 = + new Reference(this.cursor); + Out tempOut_nestedScope5 = + new Out(); this.row.WriteTypedTuple(tempRef_cursor5, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope5); nestedScope = tempOut_nestedScope5.get(); @@ -449,10 +450,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTagged scopeType: case LayoutTagged scopeType: - RefObject tempRef_cursor6 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope6 = - new OutObject(); + Reference tempReference_cursor6 = + new Reference(this.cursor); + Out tempOut_nestedScope6 = + new Out(); this.row.WriteTypedTuple(tempRef_cursor6, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope6); nestedScope = tempOut_nestedScope6.get(); @@ -463,10 +464,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTagged2 scopeType: case LayoutTagged2 scopeType: - RefObject tempRef_cursor7 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope7 = - new OutObject(); + Reference tempReference_cursor7 = + new Reference(this.cursor); + Out tempOut_nestedScope7 = + new Out(); this.row.WriteTypedTuple(tempRef_cursor7, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope7); nestedScope = tempOut_nestedScope7.get(); @@ -477,10 +478,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutNullable scopeType: case LayoutNullable scopeType: - RefObject tempRef_cursor8 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope8 = - new OutObject(); + Reference tempReference_cursor8 = + new Reference(this.cursor); + Out tempOut_nestedScope8 = + new Out(); this.row.WriteNullable(tempRef_cursor8, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, func != null, tempOut_nestedScope8); nestedScope = tempOut_nestedScope8.get(); @@ -492,23 +493,23 @@ public final class RowWriter { case LayoutUDT scopeType: Layout udt = this.row.getResolver().Resolve(typeArg.getTypeArgs().getSchemaId().clone()); - RefObject tempRef_cursor9 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope9 = - new OutObject(); - this.row.WriteSparseUDT(tempRef_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9); + Reference tempReference_cursor9 = + new Reference(this.cursor); + Out tempOut_nestedScope9 = + new Out(); + this.row.WriteSparseUDT(tempReference_cursor9, scopeType, udt, UpdateOptions.Upsert, tempOut_nestedScope9); nestedScope = tempOut_nestedScope9.get(); - this.cursor = tempRef_cursor9.get(); + this.cursor = tempReference_cursor9.get(); break; // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# pattern variables in 'case' statements: //ORIGINAL LINE: case LayoutTypedSet scopeType: case LayoutTypedSet scopeType: - RefObject tempRef_cursor10 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope10 = - new OutObject(); + Reference tempReference_cursor10 = + new Reference(this.cursor); + Out tempOut_nestedScope10 = + new Out(); this.row.WriteTypedSet(tempRef_cursor10, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope10); nestedScope = tempOut_nestedScope10.get(); @@ -519,10 +520,10 @@ public final class RowWriter { //ORIGINAL LINE: case LayoutTypedMap scopeType: case LayoutTypedMap scopeType: - RefObject tempRef_cursor11 = - new RefObject(this.cursor); - OutObject tempOut_nestedScope11 = - new OutObject(); + Reference tempReference_cursor11 = + new Reference(this.cursor); + Out tempOut_nestedScope11 = + new Out(); this.row.WriteTypedMap(tempRef_cursor11, scopeType, typeArg.getTypeArgs().clone(), UpdateOptions.Upsert, tempOut_nestedScope11); nestedScope = tempOut_nestedScope11.get(); @@ -534,18 +535,18 @@ public final class RowWriter { return Result.Failure; } - RefObject tempRef_row = - new RefObject(this.row); - RefObject tempRef_nestedScope = - new RefObject(nestedScope); - RowWriter nestedWriter = new RowWriter(tempRef_row, tempRef_nestedScope); - nestedScope = tempRef_nestedScope.get(); - this.row = tempRef_row.get(); - RefObject tempRef_nestedWriter = - new RefObject(nestedWriter); + Reference tempReference_row = + new Reference(this.row); + Reference tempReference_nestedScope = + new Reference(nestedScope); + RowWriter nestedWriter = new RowWriter(tempReference_row, tempReference_nestedScope); + nestedScope = tempReference_nestedScope.get(); + this.row = tempReference_row.get(); + Reference tempReference_nestedWriter = + new Reference(nestedWriter); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: result = func == null ? null : func.Invoke(ref nestedWriter, typeArg, context) ??Result.Success; - nestedWriter = tempRef_nestedWriter.get(); + nestedWriter = tempReference_nestedWriter.get(); this.row = nestedWriter.row.clone(); nestedScope.count = nestedWriter.cursor.count; @@ -555,24 +556,24 @@ public final class RowWriter { } if (type instanceof LayoutUniqueScope) { - RefObject tempRef_nestedScope2 = - new RefObject(nestedScope); - result = this.row.TypedCollectionUniqueIndexRebuild(tempRef_nestedScope2); - nestedScope = tempRef_nestedScope2.get(); + Reference tempReference_nestedScope2 = + new Reference(nestedScope); + result = this.row.TypedCollectionUniqueIndexRebuild(tempReference_nestedScope2); + nestedScope = tempReference_nestedScope2.get(); if (result != Result.Success) { // TODO: If the index rebuild fails then the row is corrupted. Should we automatically clean up here? return result; } } - RefObject tempRef_row2 = - new RefObject(this.row); - RefObject tempRef_cursor12 = - new RefObject(nestedWriter.cursor); - RowCursorExtensions.MoveNext(this.cursor.clone(), tempRef_row2 - , tempRef_cursor12); - nestedWriter.cursor = tempRef_cursor12.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = + new Reference(this.row); + Reference tempReference_cursor12 = + new Reference(nestedWriter.cursor); + RowCursorExtensions.MoveNext(this.cursor.clone(), tempReference_row2 + , tempReference_cursor12); + nestedWriter.cursor = tempReference_cursor12.get(); + this.row = tempReference_row2.get(); return Result.Success; } @@ -587,7 +588,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Utf8, (ref RowWriter w, String v) -> w.row.WriteSparseString(ref w.cursor, Utf8Span.TranscodeUtf16(v), UpdateOptions.Upsert)); @@ -604,7 +605,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.Utf8, (ref RowWriter w, Utf8Span v) -> w.row.WriteSparseString(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -622,7 +623,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt16, (ref RowWriter w, ushort v) => w // .row.WriteSparseUInt16(ref w.cursor, v, UpdateOptions.Upsert)); @@ -643,7 +644,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt32, (ref RowWriter w, uint v) => w // .row.WriteSparseUInt32(ref w.cursor, v, UpdateOptions.Upsert)); @@ -664,7 +665,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt64, (ref RowWriter w, ulong v) => w // .row.WriteSparseUInt64(ref w.cursor, v, UpdateOptions.Upsert)); @@ -685,7 +686,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.UInt8, (ref RowWriter w, byte v) => w.row // .WriteSparseUInt8(ref w.cursor, v, UpdateOptions.Upsert)); @@ -694,7 +695,7 @@ public final class RowWriter { } /** - * Write a field as a fixed length value. + * Write a field as a fixed length {@link UnixDateTime} value. * * @param path The scope-relative path of the field to write. * @param value The value to write. @@ -704,7 +705,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value.clone(), LayoutType.UnixDateTime, (ref RowWriter w, UnixDateTime v) -> w.row.WriteSparseUnixDateTime(ref w.cursor, v.clone(), UpdateOptions.Upsert)); @@ -721,7 +722,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: return this.WritePrimitive(path, value, LayoutType.VarInt, (ref RowWriter w, long v) -> w.row.WriteSparseVarInt(ref w.cursor, v, UpdateOptions.Upsert)); } @@ -739,7 +740,7 @@ public final class RowWriter { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: return this.WritePrimitive(path, value, LayoutType.VarUInt, (ref RowWriter w, ulong v) => w // .row.WriteSparseVarUInt(ref w.cursor, v, UpdateOptions.Upsert)); @@ -769,13 +770,13 @@ public final class RowWriter { return Result.TypeConstraint; } } else if (this.cursor.scopeType instanceof LayoutTypedMap) { - RefObject tempRef_cursor = - new RefObject(this.cursor); - if (!typeArg.equals(this.cursor.scopeType.TypeAs().FieldType(tempRef_cursor).clone())) { - this.cursor = tempRef_cursor.get(); + Reference tempReference_cursor = + new Reference(this.cursor); + if (!typeArg.equals(this.cursor.scopeType.TypeAs().FieldType(tempReference_cursor).clone())) { + this.cursor = tempReference_cursor.get(); return Result.TypeConstraint; } else { - this.cursor = tempRef_cursor.get(); + this.cursor = tempReference_cursor.get(); } } else if (this.cursor.scopeType.IsTypedScope && !typeArg.equals(this.cursor.scopeTypeArgs.get(0).clone())) { return Result.TypeConstraint; @@ -792,7 +793,7 @@ public final class RowWriter { * @param path The scope-relative path of the field to write. * @param value The value to write. * @param type The layout type. - * @param sparse The access method for . + * @param sparse The {@link RowBuffer} access method for . * @return Success if the write is successful, an error code otherwise. */ private & ILayoutUtf8SpanWritable> Result WritePrimitive(UtfAnyString path, Utf8Span value, TLayoutType type, AccessUtf8SpanMethod sparse) { @@ -808,16 +809,16 @@ public final class RowWriter { return result; } - RefObject tempRef_this = - new RefObject(this); + Reference tempReference_this = + new Reference(this); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: sparse(ref this, value) - this = tempRef_this.get(); - RefObject tempRef_row = - new RefObject(this.row); + this = tempReference_this.get(); + Reference tempReference_row = + new Reference(this.row); RowCursorExtensions.MoveNext(this.cursor.clone(), - tempRef_row); - this.row = tempRef_row.get(); + tempReference_row); + this.row = tempReference_row.get(); } return result; @@ -831,7 +832,7 @@ public final class RowWriter { * @param path The scope-relative path of the field to write. * @param value The value to write. * @param type The layout type. - * @param sparse The access method for . + * @param sparse The {@link RowBuffer} access method for . * @return Success if the write is successful, an error code otherwise. */ private & ILayoutSpanWritable, TElement> Result WritePrimitive(UtfAnyString path, ReadOnlySpan value, TLayoutType type, AccessReadOnlySpanMethod sparse) { @@ -847,16 +848,16 @@ public final class RowWriter { return result; } - RefObject tempRef_this = - new RefObject(this); + Reference tempReference_this = + new Reference(this); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: sparse(ref this, value) - this = tempRef_this.get(); - RefObject tempRef_row = - new RefObject(this.row); + this = tempReference_this.get(); + Reference tempReference_row = + new Reference(this.row); RowCursorExtensions.MoveNext(this.cursor.clone(), - tempRef_row); - this.row = tempRef_row.get(); + tempReference_row); + this.row = tempReference_row.get(); } return result; @@ -870,7 +871,7 @@ public final class RowWriter { * @param path The scope-relative path of the field to write. * @param value The value to write. * @param type The layout type. - * @param sparse The access method for . + * @param sparse The {@link RowBuffer} access method for . * @return Success if the write is successful, an error code otherwise. */ private & ILayoutSequenceWritable, TElement> Result WritePrimitive(UtfAnyString path, ReadOnlySequence value, TLayoutType type, AccessMethod> sparse) { @@ -886,16 +887,16 @@ public final class RowWriter { return result; } - RefObject tempRef_this = - new RefObject(this); + Reference tempReference_this = + new Reference(this); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: sparse(ref this, value) - this = tempRef_this.get(); - RefObject tempRef_row = - new RefObject(this.row); + this = tempReference_this.get(); + Reference tempReference_row = + new Reference(this.row); RowCursorExtensions.MoveNext(this.cursor.clone(), - tempRef_row); - this.row = tempRef_row.get(); + tempReference_row); + this.row = tempReference_row.get(); } return result; @@ -908,7 +909,7 @@ public final class RowWriter { * @param path The scope-relative path of the field to write. * @param value The value to write. * @param type The layout type. - * @param sparse The access method for . + * @param sparse The {@link RowBuffer} access method for . * @return Success if the write is successful, an error code otherwise. */ private Result WritePrimitive(UtfAnyString path, TValue value, LayoutType type, @@ -926,16 +927,16 @@ public final class RowWriter { return result; } - RefObject tempRef_this = - new RefObject(this); + Reference tempReference_this = + new Reference(this); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: sparse(ref this, value) - this = tempRef_this.get(); - RefObject tempRef_row = - new RefObject(this.row); + this = tempReference_this.get(); + Reference tempReference_row = + new Reference(this.row); RowCursorExtensions.MoveNext(this.cursor.clone(), - tempRef_row); - this.row = tempRef_row.get(); + tempReference_row); + this.row = tempReference_row.get(); } return result; @@ -952,7 +953,7 @@ public final class RowWriter { private Result WriteSchematizedValue(UtfAnyString path, TValue value) { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (!this.cursor.layout.TryFind(path, out col)) { return Result.NotFound; } @@ -965,17 +966,17 @@ public final class RowWriter { switch (col.Storage) { case StorageKind.Fixed: - RefObject tempRef_row = - new RefObject(this.row); + Reference tempReference_row = + new Reference(this.row); Result tempVar2 = t.WriteFixed(ref this.row, ref this.cursor, col, value) - this.row = tempRef_row.get(); + this.row = tempReference_row.get(); return tempVar2; case StorageKind.Variable: - RefObject tempRef_row2 = - new RefObject(this.row); + Reference tempReference_row2 = + new Reference(this.row); Result tempVar3 = t.WriteVariable(ref this.row, ref this.cursor, col, value) - this.row = tempRef_row2.get(); + this.row = tempReference_row2.get(); return tempVar3; default: @@ -995,7 +996,7 @@ public final class RowWriter { private Result WriteSchematizedValue(UtfAnyString path, Utf8Span value) { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (!this.cursor.layout.TryFind(path, out col)) { return Result.NotFound; } @@ -1007,24 +1008,25 @@ public final class RowWriter { switch (col.Storage) { case StorageKind.Fixed: - RefObject tempRef_row = - new RefObject(this.row); - RefObject tempRef_cursor = - new RefObject(this.cursor); - Result tempVar = t.TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, + Reference tempReference_row = + new Reference(this.row); + Reference tempReference_cursor = + new Reference(this.cursor); + Result tempVar = t.TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case StorageKind.Variable: - RefObject tempRef_row2 = - new RefObject(this.row); - RefObject tempRef_cursor2 = - new RefObject(this.cursor); - Result tempVar2 = t.TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, + Reference tempReference_row2 = + new Reference(this.row); + Reference tempReference_cursor2 = + new Reference(this.cursor); + Result tempVar2 = t.TypeAs().WriteVariable(tempReference_row2, + tempReference_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: return Result.NotFound; @@ -1041,7 +1043,7 @@ public final class RowWriter { */ private Result WriteSchematizedValue(UtfAnyString path, ReadOnlySpan value) { LayoutColumn col; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (!this.cursor.layout.TryFind(path, out col)) { return Result.NotFound; } @@ -1053,18 +1055,18 @@ public final class RowWriter { switch (col.Storage) { case StorageKind.Fixed: - RefObject tempRef_row = new RefObject(this.row); - RefObject tempRef_cursor = new RefObject(this.cursor); - Result tempVar = t.>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = new Reference(this.row); + Reference tempReference_cursor = new Reference(this.cursor); + Result tempVar = t.>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case StorageKind.Variable: - RefObject tempRef_row2 = new RefObject(this.row); - RefObject tempRef_cursor2 = new RefObject(this.cursor); - Result tempVar2 = t.>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(this.row); + Reference tempReference_cursor2 = new Reference(this.cursor); + Result tempVar2 = t.>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: return Result.NotFound; @@ -1081,7 +1083,7 @@ public final class RowWriter { */ private Result WriteSchematizedValue(UtfAnyString path, ReadOnlySequence value) { LayoutColumn col; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (!this.cursor.layout.TryFind(path, out col)) { return Result.NotFound; } @@ -1093,18 +1095,18 @@ public final class RowWriter { switch (col.Storage) { case StorageKind.Fixed: - RefObject tempRef_row = new RefObject(this.row); - RefObject tempRef_cursor = new RefObject(this.cursor); - Result tempVar = t.>TypeAs().WriteFixed(tempRef_row, tempRef_cursor, col, value); - this.cursor = tempRef_cursor.get(); - this.row = tempRef_row.get(); + Reference tempReference_row = new Reference(this.row); + Reference tempReference_cursor = new Reference(this.cursor); + Result tempVar = t.>TypeAs().WriteFixed(tempReference_row, tempReference_cursor, col, value); + this.cursor = tempReference_cursor.get(); + this.row = tempReference_row.get(); return tempVar; case StorageKind.Variable: - RefObject tempRef_row2 = new RefObject(this.row); - RefObject tempRef_cursor2 = new RefObject(this.cursor); - Result tempVar2 = t.>TypeAs().WriteVariable(tempRef_row2, tempRef_cursor2, col, value); - this.cursor = tempRef_cursor2.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(this.row); + Reference tempReference_cursor2 = new Reference(this.cursor); + Result tempVar2 = t.>TypeAs().WriteVariable(tempReference_row2, tempReference_cursor2, col, value); + this.cursor = tempReference_cursor2.get(); + this.row = tempReference_row2.get(); return tempVar2; default: return Result.NotFound; @@ -1113,21 +1115,21 @@ public final class RowWriter { @FunctionalInterface private interface AccessMethod { - void invoke(RefObject writer, TValue value); + void invoke(Reference writer, TValue value); } @FunctionalInterface private interface AccessReadOnlySpanMethod { - void invoke(RefObject writer, ReadOnlySpan value); + void invoke(Reference writer, ReadOnlySpan value); } @FunctionalInterface private interface AccessUtf8SpanMethod { - void invoke(RefObject writer, Utf8Span value); + void invoke(Reference writer, Utf8Span value); } /** - * A function to write content into a . + * A function to write content into a {@link RowBuffer}. * The type of the context value passed by the caller. * * @param writer A forward-only cursor for writing content. @@ -1137,6 +1139,6 @@ public final class RowWriter { */ @FunctionalInterface public interface WriterFunc { - Result invoke(RefObject writer, TypeArgument typeArg, TContext context); + Result invoke(Reference writer, TypeArgument typeArg, TContext context); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonExtensions.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonExtensions.java index b966239..eaee737 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonExtensions.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonExtensions.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.json; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -16,26 +17,26 @@ import java.util.UUID; public final class RowReaderJsonExtensions { /** - * Project a JSON document from a HybridRow . + * Project a JSON document from a HybridRow {@link RowReader}. * * @param reader The reader to project to JSON. * @param str If successful, the JSON document that corresponds to the . * @return The result. */ - public static Result ToJson(RefObject reader, OutObject str) { + public static Result ToJson(Reference reader, Out str) { return RowReaderJsonExtensions.ToJson(reader.get().clone(), new RowReaderJsonSettings(" "), str); } /** - * Project a JSON document from a HybridRow . + * Project a JSON document from a HybridRow {@link RowReader}. * * @param reader The reader to project to JSON. * @param settings Settings that control how the JSON document is formatted. * @param str If successful, the JSON document that corresponds to the . * @return The result. */ - public static Result ToJson(RefObject reader, RowReaderJsonSettings settings, - OutObject str) { + public static Result ToJson(Reference reader, RowReaderJsonSettings settings, + Out str) { ReaderStringContext ctx = new ReaderStringContext(new StringBuilder(), new RowReaderJsonSettings(settings.IndentChars, settings.QuoteChar == '\'' ? '\'' : '"'), 1); @@ -52,7 +53,7 @@ public final class RowReaderJsonExtensions { return Result.Success; } - private static Result ToJson(RefObject reader, ReaderStringContext ctx) { + private static Result ToJson(Reference reader, ReaderStringContext ctx) { int index = 0; while (reader.get().Read()) { String path = !reader.get().getPath().IsNull ? String.format("%1$s%2$s%3$s:", ctx.Settings.QuoteChar, @@ -75,8 +76,8 @@ public final class RowReaderJsonExtensions { switch (reader.get().getType().LayoutCode) { case Null: { NullValue _; - OutObject tempOut__ = - new OutObject(); + Out tempOut__ = + new Out(); r = reader.get().ReadNull(tempOut__); _ = tempOut__.get(); if (r != Result.Success) { @@ -89,7 +90,7 @@ public final class RowReaderJsonExtensions { case Boolean: { boolean value; - OutObject tempOut_value = new OutObject(); + Out tempOut_value = new Out(); r = reader.get().ReadBool(tempOut_value); value = tempOut_value.get(); if (r != Result.Success) { @@ -102,7 +103,7 @@ public final class RowReaderJsonExtensions { case Int8: { byte value; - OutObject tempOut_value2 = new OutObject(); + Out tempOut_value2 = new Out(); r = reader.get().ReadInt8(tempOut_value2); value = tempOut_value2.get(); if (r != Result.Success) { @@ -115,7 +116,7 @@ public final class RowReaderJsonExtensions { case Int16: { short value; - OutObject tempOut_value3 = new OutObject(); + Out tempOut_value3 = new Out(); r = reader.get().ReadInt16(tempOut_value3); value = tempOut_value3.get(); if (r != Result.Success) { @@ -128,7 +129,7 @@ public final class RowReaderJsonExtensions { case Int32: { int value; - OutObject tempOut_value4 = new OutObject(); + Out tempOut_value4 = new Out(); r = reader.get().ReadInt32(tempOut_value4); value = tempOut_value4.get(); if (r != Result.Success) { @@ -141,7 +142,7 @@ public final class RowReaderJsonExtensions { case Int64: { long value; - OutObject tempOut_value5 = new OutObject(); + Out tempOut_value5 = new Out(); r = reader.get().ReadInt64(tempOut_value5); value = tempOut_value5.get(); if (r != Result.Success) { @@ -154,7 +155,7 @@ public final class RowReaderJsonExtensions { case UInt8: { byte value; - OutObject tempOut_value6 = new OutObject(); + Out tempOut_value6 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadUInt8(out byte value); r = reader.get().ReadUInt8(tempOut_value6); @@ -169,7 +170,7 @@ public final class RowReaderJsonExtensions { case UInt16: { short value; - OutObject tempOut_value7 = new OutObject(); + Out tempOut_value7 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadUInt16(out ushort value); r = reader.get().ReadUInt16(tempOut_value7); @@ -184,7 +185,7 @@ public final class RowReaderJsonExtensions { case UInt32: { int value; - OutObject tempOut_value8 = new OutObject(); + Out tempOut_value8 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadUInt32(out uint value); r = reader.get().ReadUInt32(tempOut_value8); @@ -199,7 +200,7 @@ public final class RowReaderJsonExtensions { case UInt64: { long value; - OutObject tempOut_value9 = new OutObject(); + Out tempOut_value9 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadUInt64(out ulong value); r = reader.get().ReadUInt64(tempOut_value9); @@ -214,7 +215,7 @@ public final class RowReaderJsonExtensions { case VarInt: { long value; - OutObject tempOut_value10 = new OutObject(); + Out tempOut_value10 = new Out(); r = reader.get().ReadVarInt(tempOut_value10); value = tempOut_value10.get(); if (r != Result.Success) { @@ -227,7 +228,7 @@ public final class RowReaderJsonExtensions { case VarUInt: { long value; - OutObject tempOut_value11 = new OutObject(); + Out tempOut_value11 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadVarUInt(out ulong value); r = reader.get().ReadVarUInt(tempOut_value11); @@ -242,7 +243,7 @@ public final class RowReaderJsonExtensions { case Float32: { float value; - OutObject tempOut_value12 = new OutObject(); + Out tempOut_value12 = new Out(); r = reader.get().ReadFloat32(tempOut_value12); value = tempOut_value12.get(); if (r != Result.Success) { @@ -255,7 +256,7 @@ public final class RowReaderJsonExtensions { case Float64: { double value; - OutObject tempOut_value13 = new OutObject(); + Out tempOut_value13 = new Out(); r = reader.get().ReadFloat64(tempOut_value13); value = tempOut_value13.get(); if (r != Result.Success) { @@ -268,8 +269,8 @@ public final class RowReaderJsonExtensions { case Float128: { Float128 _; - OutObject tempOut__2 = - new OutObject(); + Out tempOut__2 = + new Out(); r = reader.get().ReadFloat128(tempOut__2); _ = tempOut__2.get(); if (r != Result.Success) { @@ -283,7 +284,7 @@ public final class RowReaderJsonExtensions { case Decimal: { java.math.BigDecimal value; - OutObject tempOut_value14 = new OutObject(); + Out tempOut_value14 = new Out(); r = reader.get().ReadDecimal(tempOut_value14); value = tempOut_value14.get(); if (r != Result.Success) { @@ -296,7 +297,7 @@ public final class RowReaderJsonExtensions { case DateTime: { java.time.LocalDateTime value; - OutObject tempOut_value15 = new OutObject(); + Out tempOut_value15 = new Out(); r = reader.get().ReadDateTime(tempOut_value15); value = tempOut_value15.get(); if (r != Result.Success) { @@ -311,8 +312,8 @@ public final class RowReaderJsonExtensions { case UnixDateTime: { UnixDateTime value; - OutObject tempOut_value16 = - new OutObject(); + Out tempOut_value16 = + new Out(); r = reader.get().ReadUnixDateTime(tempOut_value16); value = tempOut_value16.get(); if (r != Result.Success) { @@ -325,7 +326,7 @@ public final class RowReaderJsonExtensions { case Guid: { java.util.UUID value; - OutObject tempOut_value17 = new OutObject(); + Out tempOut_value17 = new Out(); r = reader.get().ReadGuid(tempOut_value17); value = tempOut_value17.get(); if (r != Result.Success) { @@ -340,7 +341,7 @@ public final class RowReaderJsonExtensions { case MongoDbObjectId: { MongoDbObjectId value; - OutObject tempOut_value18 = new OutObject(); + Out tempOut_value18 = new Out(); r = reader.get().ReadMongoDbObjectId(tempOut_value18); value = tempOut_value18.get(); if (r != Result.Success) { @@ -359,7 +360,7 @@ public final class RowReaderJsonExtensions { case Utf8: { Utf8Span value; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // - these cannot be converted using the 'OutObject' helper class unless the method is within the + // - these cannot be converted using the 'Out' helper class unless the method is within the // code being modified: r = reader.get().ReadString(out value); if (r != Result.Success) { @@ -374,7 +375,7 @@ public final class RowReaderJsonExtensions { case Binary: { ReadOnlySpan value; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadBinary(out ReadOnlySpan value); r = reader.get().ReadBinary(out value); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonSettings.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonSettings.java index a1e6fd8..2303e24 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonSettings.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/json/RowReaderJsonSettings.java @@ -20,7 +20,7 @@ public final class RowReaderJsonSettings { /** * The quote character to use. - * May be or . + * May be or {@link '}. */ public char QuoteChar; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSequenceWritable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSequenceWritable.java index 76e4dba..0351bad 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSequenceWritable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSequenceWritable.java @@ -4,30 +4,33 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.RefObject; +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; /** - * An optional interface that indicates a can also write using a - * . + * An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link ReadOnlySequence{T}}. * * The sub-element type to be written. */ public interface ILayoutSequenceWritable extends ILayoutType { - Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, - ReadOnlySequence value); - Result WriteSparse(RefObject b, RefObject edit, - ReadOnlySequence value); + Result WriteFixed( + Reference b, Reference scope, LayoutColumn col, ReadOnlySequence value); - //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: - //ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence value, - // UpdateOptions options = UpdateOptions.Upsert); - Result WriteSparse(RefObject b, RefObject edit, - ReadOnlySequence value, UpdateOptions options); + Result WriteSparse( + Reference b, Reference edit, ReadOnlySequence value); - Result WriteVariable(RefObject b, RefObject scope, LayoutColumn col, - ReadOnlySequence value); + // C# TO JAVA CONVERTER NOTE: + // Java does not support optional parameters, hence overloaded method(s) are created + // ORIGINAL LINE: + // Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence value, UpdateOptions + // options = UpdateOptions.Upsert); + + Result WriteSparse( + Reference b, Reference edit, ReadOnlySequence value, UpdateOptions options); + + Result WriteVariable( + Reference b, Reference scope, LayoutColumn col, ReadOnlySequence value); } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanReadable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanReadable.java index e986610..d39c829 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanReadable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanReadable.java @@ -4,25 +4,24 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; /** - * An optional interface that indicates a can also read using a - * . + * An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link ReadOnlySpan{T}} * * The sub-element type to be written. */ public interface ILayoutSpanReadable extends ILayoutType { - Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject> value); + Result ReadFixed( + Reference b, Reference scope, LayoutColumn col, Out> value); - Result ReadSparse(RefObject b, RefObject scope, - OutObject> value); + Result ReadSparse( + Reference b, Reference scope, Out> value); - Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col, - OutObject> value); + Result ReadVariable( + Reference b, Reference scope, LayoutColumn col, Out> value); } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanWritable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanWritable.java index 8ddeb54..028c4a8 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanWritable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutSpanWritable.java @@ -4,30 +4,32 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.RefObject; +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; /** - * An optional interface that indicates a can also write using a - * . + * An optional interface that indicates a {@link LayoutType{T}} can also write using a + * {@link ReadOnlySpan{T}}. * * The sub-element type to be written. */ public interface ILayoutSpanWritable extends ILayoutType { - Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, - ReadOnlySpan value); - Result WriteSparse(RefObject b, RefObject edit, - ReadOnlySpan value); + Result WriteFixed( + Reference b, Reference scope, LayoutColumn col, ReadOnlySpan value); - //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: - //ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan value, - // UpdateOptions options = UpdateOptions.Upsert); - Result WriteSparse(RefObject b, RefObject edit, - ReadOnlySpan value, UpdateOptions options); + Result WriteSparse(Reference b, Reference edit, ReadOnlySpan value); - Result WriteVariable(RefObject b, RefObject scope, LayoutColumn col, - ReadOnlySpan value); + // C# TO JAVA CONVERTER NOTE: + // Java does not support optional parameters, hence overloaded method(s) are created. + // ORIGINAL LINE: + // Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan value, UpdateOptions options = UpdateOptions.Upsert); + + Result WriteSparse( + Reference b, Reference edit, ReadOnlySpan value, UpdateOptions options); + + Result WriteVariable( + Reference b, Reference scope, LayoutColumn col, ReadOnlySpan value); } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanReadable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanReadable.java index 013d09b..615b67d 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanReadable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanReadable.java @@ -4,22 +4,20 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; /** - * An optional interface that indicates a can also read using a - * . + * An optional interface that indicates a {@link LayoutType{T}} can also read using a {@link Utf8Span}. */ public interface ILayoutUtf8SpanReadable extends ILayoutType { - Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value); - Result ReadSparse(RefObject b, RefObject scope, OutObject value); + Result ReadFixed(Reference b, Reference scope, LayoutColumn col, Out value); - Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col, - OutObject value); + Result ReadSparse(Reference b, Reference scope, Out value); + + Result ReadVariable(Reference b, Reference scope, LayoutColumn col, Out value); } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanWritable.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanWritable.java index cf6e979..b234a08 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanWritable.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/ILayoutUtf8SpanWritable.java @@ -4,26 +4,26 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.RefObject; +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; /** - * An optional interface that indicates a can also write using a - * . + * An optional interface that indicates a {@link LayoutType{T}} can also write using a {@link Utf8Span}. */ public interface ILayoutUtf8SpanWritable extends ILayoutType { - Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, - Utf8Span value); - Result WriteSparse(RefObject b, RefObject edit, Utf8Span value); + Result WriteFixed(Reference b, Reference scope, LayoutColumn col, Utf8Span value); - //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: - //ORIGINAL LINE: Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions options = - // UpdateOptions.Upsert); - Result WriteSparse(RefObject b, RefObject edit, Utf8Span value, UpdateOptions options); + Result WriteSparse(Reference b, Reference edit, Utf8Span value); - Result WriteVariable(RefObject b, RefObject scope, LayoutColumn col, - Utf8Span value); + // C# TO JAVA CONVERTER NOTE: + // Java does not support optional parameters, hence overloaded method(s) are created. + // ORIGINAL LINE: + // Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions options = UpdateOptions.Upsert); + + Result WriteSparse(Reference b, Reference edit, Utf8Span value, UpdateOptions options); + + Result WriteVariable(Reference b, Reference scope, LayoutColumn col, Utf8Span value); } \ No newline at end of file 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 465dc05..b376bb2 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 @@ -4,40 +4,44 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Utf8String; import com.azure.data.cosmos.serialization.hybridrow.SchemaId; +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 java.util.ArrayList; import java.util.HashMap; /** - * A Layout describes the structure of a Hybrd Row. + * A Layout describes the structure of a Hybrid Row *

- * A layout indicates the number, order, and type of all schematized columns to be stored - * within a hybrid row. The order and type of columns defines the physical ordering of bytes used to - * encode the row and impacts the cost of updating the row. - * - * A layout is created by compiling a through or - * by constructor through a . - * - * is immutable. + * A layout indicates the number, order, and type of all schematized columns to be stored within a hybrid row. The + * order and type of columns defines the physical ordering of bytes used to encode the row and impacts the cost of + * updating the row. + *

+ * A layout is created by compiling a {@link Schema} through {@link Schema#Compile(Namespace)} or by constructor through + * a {@link LayoutBuilder}. + * + * {@link Layout} is immutable. */ public final class Layout { - // 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 Layout Empty = SystemSchema.LayoutResolver - // .Resolve(SystemSchema.EmptySchemaId); + + // 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 Layout Empty = SystemSchema.LayoutResolver.Resolve(SystemSchema.EmptySchemaId); + public static final Layout Empty = SystemSchema.LayoutResolver.Resolve(SystemSchema.EmptySchemaId); /** * Name of the layout. *

- * Usually this is the name of the from which this - * was generated. + * Usually this is the name of the {@link Schema} from which this {@link Layout} was generated. */ private String Name; /** - * The number of bitmask bytes allocated within the layout. + * The number of bit mask bytes allocated within the layout. *

* A presence bit is allocated for each fixed and variable-length field. Sparse columns * never have presence bits. Fixed boolean allocate an additional bit from the bitmask to store their @@ -53,7 +57,7 @@ public final class Layout { */ private int NumVariable; /** - * Unique identifier of the schema from which this was generated. + * Unique identifier of the schema from which this {@link Layout} was generated. */ private com.azure.data.cosmos.serialization.hybridrow.SchemaId SchemaId = new SchemaId(); /** @@ -67,8 +71,7 @@ public final class Layout { private HashMap pathStringMap; private LayoutColumn[] topColumns; - public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, - ArrayList columns) { + public Layout(String name, SchemaId schemaId, int numBitmaskBytes, int minRequiredSize, ArrayList columns) { this.Name = name; this.SchemaId = schemaId.clone(); this.NumBitmaskBytes = numBitmaskBytes; @@ -133,10 +136,11 @@ public final class Layout { * 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. + * @param column If found, the column specification, otherwise {@code null}. + * @return {@code true} if a column with the path is found, otherwise {@code false}. */ - public boolean TryFind(UtfAnyString path, OutObject column) { + public boolean TryFind(UtfAnyString path, Out column) { + if (path.IsNull) { column.set(null); return false; @@ -156,12 +160,12 @@ public final class Layout { * @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, OutObject column) { + public boolean TryFind(String path, Out column) { return (this.pathStringMap.containsKey(path) && (column.set(this.pathStringMap.get(path))) == column.get()); } /** - * Returns a human readable diagnostic string representation of this . + * Returns a human readable diagnostic string representation of this {@link Layout}. * This representation should only be used for debugging and diagnostic purposes. */ @Override diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutArray.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutArray.java index e7f4a7b..6cf610a 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutArray.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutArray.java @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; @@ -32,10 +32,10 @@ public final class LayoutArray extends LayoutIndexedScope { @Override public Result WriteScope( - RefObject b, - RefObject edit, + Reference b, + Reference edit, TypeArgumentList typeArgs, - OutObject value + Out value ) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -44,8 +44,8 @@ public final class LayoutArray extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { value.set(null); 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 5582eab..e7d8f65 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -35,11 +36,11 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { ReadOnlySpan span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = this.ReadFixed(ref b, ref scope, col, out ReadOnlySpan span); Result r = this.ReadFixed(b, scope, col, out span); @@ -51,8 +52,8 @@ 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 Result ReadFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ReadOnlySpan value) - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject> value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out> value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); checkArgument(col.getSize() >= 0); if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) { @@ -67,10 +68,10 @@ 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(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference 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 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = this.ReadSparse(ref b, ref edit, out ReadOnlySpan span); Result r = this.ReadSparse(b, edit, out span); @@ -81,7 +82,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 Result ReadSparse(ref RowBuffer b, ref RowCursor edit, out ReadOnlySpan value) - public Result ReadSparse(RefObject b, RefObject edit, OutObject> value) { + public Result ReadSparse(Reference b, Reference edit, Out> value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -96,11 +97,11 @@ 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(RefObject b, RefObject scope, LayoutColumn col - , OutObject value) { + public Result ReadVariable(Reference b, Reference scope, LayoutColumn col + , Out value) { ReadOnlySpan span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = this.ReadVariable(ref b, ref scope, col, out ReadOnlySpan span); Result r = this.ReadVariable(b, scope, col, out span); @@ -112,8 +113,8 @@ 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 Result ReadVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, out // ReadOnlySpan value) - public Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col - , OutObject> value) { + 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())) { value.set(null); @@ -130,7 +131,7 @@ 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(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, byte[] value) { checkArgument(value != null); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -141,7 +142,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 Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // ReadOnlySpan value) - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, ReadOnlySpan value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); checkArgument(col.getSize() >= 0); @@ -158,7 +159,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 Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // ReadOnlySequence value) - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, ReadOnlySequence value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); checkArgument(col.getSize() >= 0); @@ -173,7 +174,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa } @Override - public Result WriteSparse(RefObject b, RefObject edit, byte[] value) { + public Result WriteSparse(Reference b, Reference edit, byte[] value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @@ -182,7 +183,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(RefObject b, RefObject edit, byte[] value, + public Result WriteSparse(Reference b, Reference edit, byte[] value, UpdateOptions options) { checkArgument(value != null); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -190,7 +191,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa return this.WriteSparse(b, edit, new ReadOnlySpan(value), options); } - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, ReadOnlySpan value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @@ -199,7 +200,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySpan value, // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, ReadOnlySpan value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -210,7 +211,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa return Result.Success; } - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, ReadOnlySequence value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @@ -219,7 +220,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, ReadOnlySequence value, // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, ReadOnlySequence value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -234,7 +235,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa //ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // byte[] value) @Override - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, byte[] value) { checkArgument(value != null); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -245,7 +246,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 Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // ReadOnlySpan value) - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, ReadOnlySpan value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -261,7 +262,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start, col.getOffset()); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift); shift = tempOut_shift.get(); b.get().SetBit(scope.get().start, col.getNullBit().clone()); @@ -273,7 +274,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 Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // ReadOnlySequence value) - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, ReadOnlySequence value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -289,7 +290,7 @@ public final class LayoutBinary extends LayoutType implements ILayoutSpa int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start, col.getOffset()); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); b.get().WriteVariableBinary(varOffset, value, exists, tempOut_shift); shift = tempOut_shift.get(); b.get().SetBit(scope.get().start, col.getNullBit().clone()); 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 42fbb47..2a5c4a3 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 @@ -22,7 +22,7 @@ public final class LayoutBit implements IEquatable { private int index; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link LayoutBit} struct. * * @param index The 0-based offset into the layout bitmask. */ @@ -47,7 +47,7 @@ public final class LayoutBit implements IEquatable { /** * Returns the 0-based bit from the beginning of the byte that contains this bit. - * Also see to identify relevant byte. + * Also see {@link GetOffset} to identify relevant byte. * * @return The bit of the byte within the bitmask. */ @@ -61,7 +61,7 @@ public final class LayoutBit implements IEquatable { * Returns the 0-based byte offset from the beginning of the row or scope that contains the * bit from the bitmask. *

- * Also see to identify. + * Also see {@link GetBit} to identify. * * @param offset The byte offset from the beginning of the row where the scope begins. * @return The byte offset containing this bit. @@ -130,7 +130,7 @@ public final class LayoutBit implements IEquatable { private int next; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link Allocator} class. */ public Allocator() { this.next = 0; 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 da2d04b..dd55122 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -33,8 +34,8 @@ public final class LayoutBoolean extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(false); @@ -46,8 +47,8 @@ public final class LayoutBoolean extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(false); @@ -59,7 +60,7 @@ public final class LayoutBoolean extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, boolean value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -80,7 +81,7 @@ public final class LayoutBoolean extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, bool value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, boolean value, + public Result WriteSparse(Reference b, Reference edit, boolean value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -92,7 +93,7 @@ public final class LayoutBoolean extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, boolean value) { + public Result WriteSparse(Reference b, Reference edit, boolean 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/LayoutCodeTraits.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCodeTraits.java index 06e5993..a5ea7f9 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCodeTraits.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutCodeTraits.java @@ -18,7 +18,7 @@ public final class LayoutCodeTraits { /** * Returns a canonicalized version of the layout code. *

- * Some codes (e.g. use multiple type codes to also encode + * Some codes (e.g. {@link LayoutCode.Boolean} use multiple type codes to also encode * values. This function converts actual value based code into the canonicalized type code for schema * comparisons. * 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 0ae9efe..040bf60 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 @@ -4,6 +4,7 @@ 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 static com.google.common.base.Strings.lenientFormat; @@ -30,13 +31,13 @@ public final class LayoutColumn { */ private LayoutBit nullBit = new LayoutBit(); /** - * If equals then the byte offset to + * If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to * the field location. * - * If equals then the 0-based index of the + * 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 , is ignored. + * For all other values of {@link storage}, {@link Offset} is ignored. */ private int offset; /** @@ -48,7 +49,7 @@ public final class LayoutColumn { */ private Utf8String path; /** - * If then the 0-based extra index within the bool byte + * 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; @@ -65,12 +66,12 @@ public final class LayoutColumn { */ private TypeArgument typeArg = new TypeArgument(); /** - * For types with generic parameters (e.g. , the type parameters. + * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. */ private TypeArgumentList typeArgs = new TypeArgumentList(); /** - * Initializes a new instance of the 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. @@ -81,7 +82,7 @@ public final class LayoutColumn { * @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. , the type + * @param typeArgs For types with generic parameters (e.g. {@link LayoutTuple}, the type * parameters. */ @@ -112,8 +113,8 @@ public final class LayoutColumn { /** * The full logical path of the field within the row. *

- * Paths are expressed in dotted notation: e.g. a relative of 'b.c' - * within the scope 'a' yields a 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 getFullPath() { return this.fullPath; @@ -137,8 +138,8 @@ public final class LayoutColumn { /** * The relative path of the field within its parent scope. *

- * Paths are expressed in dotted notation: e.g. a relative of 'b.c' - * within the scope 'a' yields a 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() { return this.path; @@ -166,7 +167,7 @@ public final class LayoutColumn { } /** - * For types with generic parameters (e.g. , the type parameters. + * For types with generic parameters (e.g. {@link LayoutTuple}, the type parameters. */ public TypeArgumentList getTypeArgs() { return this.typeArgs.clone(); @@ -200,21 +201,21 @@ public final class LayoutColumn { LayoutBit getNullBit() /** - * If equals then the byte offset to + * If {@link storage} equals {@link StorageKind.Fixed} then the byte offset to * the field location. * - * If equals then the 0-based index of the + * 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 , is ignored. + * For all other values of {@link storage}, {@link Offset} is ignored. */ int getOffset() /** - * If equals then the fixed number of + * If {@link storage} equals {@link StorageKind.Fixed} then the fixed number of * bytes reserved for the value. * - * If equals then the maximum number of + * If {@link storage} equals {@link StorageKind.Variable} then the maximum number of * bytes allowed for the value. */ int getSize() 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 ae4c1d3..dddda74 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 @@ -4,7 +4,7 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.serialization.hybridrow.SchemaId; import com.azure.data.cosmos.serialization.hybridrow.schemas.ArrayPropertyType; import com.azure.data.cosmos.serialization.hybridrow.schemas.MapPropertyType; @@ -53,8 +53,8 @@ public final class LayoutCompiler { ArrayList properties) { for (Property p : properties) { TypeArgumentList typeArgs = new TypeArgumentList(); - OutObject tempOut_typeArgs = - new OutObject(); + Out tempOut_typeArgs = + new Out(); LayoutType type = LayoutCompiler.LogicalToPhysicalType(ns, p.getPropertyType(), tempOut_typeArgs); typeArgs = tempOut_typeArgs.get(); switch (LayoutCodeTraits.ClearImmutableBit(type.LayoutCode)) { @@ -149,7 +149,7 @@ public final class LayoutCompiler { } private static LayoutType LogicalToPhysicalType(Namespace ns, PropertyType logicalType, - OutObject typeArgs) { + Out typeArgs) { typeArgs.set(TypeArgumentList.Empty); boolean tempVar = (logicalType instanceof ScopePropertyType ? (ScopePropertyType)logicalType : null).getImmutable(); @@ -209,7 +209,7 @@ public final class LayoutCompiler { ArrayPropertyType ap = (ArrayPropertyType)logicalType; if ((ap.getItems() != null) && (ap.getItems().getType() != TypeKind.Any)) { TypeArgumentList itemTypeArgs = new TypeArgumentList(); - OutObject tempOut_itemTypeArgs = new OutObject(); + Out tempOut_itemTypeArgs = new Out(); LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, ap.getItems(), tempOut_itemTypeArgs); itemTypeArgs = tempOut_itemTypeArgs.get(); if (ap.getItems().getNullable()) { @@ -228,7 +228,7 @@ public final class LayoutCompiler { SetPropertyType sp = (SetPropertyType)logicalType; if ((sp.getItems() != null) && (sp.getItems().getType() != TypeKind.Any)) { TypeArgumentList itemTypeArgs = new TypeArgumentList(); - OutObject tempOut_itemTypeArgs2 = new OutObject(); + Out tempOut_itemTypeArgs2 = new Out(); LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, sp.getItems(), tempOut_itemTypeArgs2); itemTypeArgs = tempOut_itemTypeArgs2.get(); @@ -251,7 +251,7 @@ public final class LayoutCompiler { MapPropertyType mp = (MapPropertyType)logicalType; if ((mp.getKeys() != null) && (mp.getKeys().getType() != TypeKind.Any) && (mp.getValues() != null) && (mp.getValues().getType() != TypeKind.Any)) { TypeArgumentList keyTypeArgs = new TypeArgumentList(); - OutObject tempOut_keyTypeArgs = new OutObject(); + Out tempOut_keyTypeArgs = new Out(); LayoutType keyType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getKeys(), tempOut_keyTypeArgs); keyTypeArgs = tempOut_keyTypeArgs.get(); if (mp.getKeys().getNullable()) { @@ -261,7 +261,7 @@ public final class LayoutCompiler { } TypeArgumentList valueTypeArgs = new TypeArgumentList(); - OutObject tempOut_valueTypeArgs = new OutObject(); + Out tempOut_valueTypeArgs = new Out(); LayoutType valueType = LayoutCompiler.LogicalToPhysicalType(ns, mp.getValues(), tempOut_valueTypeArgs); valueTypeArgs = tempOut_valueTypeArgs.get(); @@ -288,7 +288,7 @@ public final class LayoutCompiler { TypeArgument[] args = new TypeArgument[tp.getItems().size()]; for (int i = 0; i < tp.getItems().size(); i++) { TypeArgumentList itemTypeArgs = new TypeArgumentList(); - OutObject tempOut_itemTypeArgs3 = new OutObject(); + Out tempOut_itemTypeArgs3 = new Out(); LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tp.getItems().get(i), tempOut_itemTypeArgs3); itemTypeArgs = tempOut_itemTypeArgs3.get(); @@ -316,7 +316,7 @@ public final class LayoutCompiler { tgArgs[0] = new TypeArgument(LayoutType.UInt8, TypeArgumentList.Empty); for (int i = 0; i < tg.getItems().size(); i++) { TypeArgumentList itemTypeArgs = new TypeArgumentList(); - OutObject tempOut_itemTypeArgs4 = new OutObject(); + Out tempOut_itemTypeArgs4 = new Out(); LayoutType itemType = LayoutCompiler.LogicalToPhysicalType(ns, tg.getItems().get(i), tempOut_itemTypeArgs4); itemTypeArgs = tempOut_itemTypeArgs4.get(); 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 90dbb68..baa5e5f 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,8 +31,8 @@ public final class LayoutDateTime extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(LocalDateTime.MIN); @@ -43,8 +44,8 @@ public final class LayoutDateTime extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(LocalDateTime.MIN); @@ -56,7 +57,7 @@ public final class LayoutDateTime extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, LocalDateTime value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -72,7 +73,7 @@ public final class LayoutDateTime extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, DateTime value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, LocalDateTime value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -84,7 +85,7 @@ public final class LayoutDateTime extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, DateTime value) { + public Result WriteSparse(Reference b, Reference 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 b9a38b5..70e7da1 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -31,8 +32,8 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(new BigDecimal(0)); @@ -44,8 +45,8 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(new BigDecimal(0)); @@ -57,7 +58,7 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, BigDecimal value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -73,7 +74,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(RefObject b, RefObject edit, BigDecimal value, + public Result WriteSparse(Reference b, Reference edit, BigDecimal value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -85,7 +86,7 @@ public final class LayoutDecimal extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, java.math.BigDecimal value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutEndScope.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutEndScope.java index 67156d7..dbd8a72 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutEndScope.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutEndScope.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +28,8 @@ public final class LayoutEndScope extends LayoutScope { @Override - public Result WriteScope(RefObject b, RefObject scope, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference scope, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, scope, typeArgs, value, UpdateOptions.Upsert); } @@ -36,8 +37,8 @@ public final class LayoutEndScope extends LayoutScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject scope, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference scope, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Contract.Fail("Cannot write an EndScope directly"); value.set(null); return Result.Failure; 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 8996269..1ce47bb 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -29,8 +30,8 @@ public final class LayoutFloat128 extends LayoutType b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(null); @@ -42,8 +43,8 @@ public final class LayoutFloat128 extends LayoutType b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -55,7 +56,7 @@ public final class LayoutFloat128 extends LayoutType b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, Float128 value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -71,7 +72,7 @@ public final class LayoutFloat128 extends LayoutType b, RefObject edit, Float128 value, + public Result WriteSparse(Reference b, Reference edit, Float128 value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -83,7 +84,7 @@ public final class LayoutFloat128 extends LayoutType b, RefObject edit, Float128 value) { + public Result WriteSparse(Reference b, Reference 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 7cc31c3..10aadfc 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutFloat32 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutFloat32 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutFloat32 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, float value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutFloat32 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, float value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, float value, + public Result WriteSparse(Reference b, Reference edit, float value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutFloat32 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, float value) { + public Result WriteSparse(Reference b, Reference edit, float 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/LayoutFloat64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutFloat64.java index 0dcc8c6..5aedf2a 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutFloat64 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutFloat64 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutFloat64 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, double value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutFloat64 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, double value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, double value, + public Result WriteSparse(Reference b, Reference edit, double value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutFloat64 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, double value) { + public Result WriteSparse(Reference b, Reference edit, double 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/LayoutGuid.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutGuid.java index ffc1913..7ee1aae 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,8 +31,8 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(null); @@ -43,8 +44,8 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -56,7 +57,7 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, UUID value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -72,7 +73,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(RefObject b, RefObject edit, UUID value, + public Result WriteSparse(Reference b, Reference edit, UUID value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -84,7 +85,7 @@ public final class LayoutGuid extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, java.util.UUID value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } 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 4919540..78c0ad0 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 @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -22,7 +23,7 @@ public abstract class LayoutIndexedScope extends LayoutScope { } @Override - public void ReadSparsePath(RefObject row, RefObject edit) { + public void ReadSparsePath(Reference row, Reference edit) { edit.get().pathToken = 0; edit.get().pathOffset = 0; } 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 51ea736..5e8d4c6 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutInt16 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutInt16 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutInt16 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, short value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutInt16 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, short value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, short value, + public Result WriteSparse(Reference b, Reference edit, short value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutInt16 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, short value) { + public Result WriteSparse(Reference b, Reference edit, short 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/LayoutInt32.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt32.java index 237e14b..f758cc2 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutInt32 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutInt32 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutInt32 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, int value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutInt32 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, int value, UpdateOptions // options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, int value, + public Result WriteSparse(Reference b, Reference edit, int value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutInt32 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, int value) { + public Result WriteSparse(Reference b, Reference edit, int 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/LayoutInt64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt64.java index fffd7dc..3e33066 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutInt64 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutInt64 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutInt64 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, long value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutInt64 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, long value, + public Result WriteSparse(Reference b, Reference edit, long value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutInt64 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, long value) { + public Result WriteSparse(Reference b, Reference edit, long 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/LayoutInt8.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutInt8.java index d6102ea..7640053 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,8 +29,8 @@ public final class LayoutInt8 extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -41,8 +42,8 @@ public final class LayoutInt8 extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -54,7 +55,7 @@ public final class LayoutInt8 extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, byte value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -70,7 +71,7 @@ public final class LayoutInt8 extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, sbyte value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, byte value, + public Result WriteSparse(Reference b, Reference edit, byte value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -82,7 +83,7 @@ public final class LayoutInt8 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, byte value) { + public Result WriteSparse(Reference b, Reference edit, byte 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/LayoutMongoDbObjectId.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutMongoDbObjectId.java index 7e862f1..1d01aad 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -29,8 +30,8 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(null); @@ -42,8 +43,8 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -55,7 +56,7 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, MongoDbObjectId value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -71,7 +72,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(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference edit, MongoDbObjectId value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -83,7 +84,7 @@ public final class LayoutMongoDbObjectId extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, + public Result WriteSparse(Reference b, Reference 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 adaefd6..5907f5a 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -34,8 +35,8 @@ public final class LayoutNull extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); value.set(NullValue.Default); if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) { @@ -46,8 +47,8 @@ public final class LayoutNull extends LayoutType { } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -59,7 +60,7 @@ public final class LayoutNull extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, NullValue value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -74,7 +75,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(RefObject b, RefObject edit, NullValue value, + public Result WriteSparse(Reference b, Reference edit, NullValue value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -86,7 +87,7 @@ public final class LayoutNull extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, NullValue value) { + public Result WriteSparse(Reference b, Reference 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 a348457..735b325 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -31,14 +32,14 @@ public final class LayoutNullable extends LayoutIndexedScope { } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkState(edit.get().index >= 0); checkState(edit.get().scopeTypeArgs.getCount() == 1); checkState(edit.get().index == 1); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode); } - public static Result HasValue(RefObject b, RefObject scope) { + public static Result HasValue(Reference b, Reference scope) { checkArgument(scope.get().scopeType instanceof LayoutNullable); checkState(scope.get().index == 1 || scope.get().index == 2, "Nullable scopes always point at the value"); checkState(scope.get().scopeTypeArgs.getCount() == 1); @@ -47,28 +48,28 @@ public final class LayoutNullable extends LayoutIndexedScope { } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) }); } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { checkState(edit.get().index == 1); edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone(); } - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, boolean hasValue, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, boolean hasValue, Out value) { return WriteScope(b, edit, typeArgs, hasValue, value, UpdateOptions.Upsert); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList typeArgs, bool // hasValue, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, boolean hasValue, OutObject value, + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, boolean hasValue, Out value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { @@ -81,8 +82,8 @@ public final class LayoutNullable extends LayoutIndexedScope { } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -90,13 +91,13 @@ public final class LayoutNullable extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { return this.WriteScope(b, edit, typeArgs.clone(), true, value, options); } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkState(value.getCount() == 1); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutObject.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutObject.java index 0ab2362..385e56d 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutObject.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutObject.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,8 +31,8 @@ public final class LayoutObject extends LayoutPropertyScope { @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -39,8 +40,8 @@ public final class LayoutObject extends LayoutPropertyScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { value.set(null); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutResolverNamespace.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutResolverNamespace.java index 2247dac..e043b6b 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutResolverNamespace.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutResolverNamespace.java @@ -12,12 +12,12 @@ import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Strings.lenientFormat; /** - * An implementation of which dynamically compiles schema from - * a . + * An implementation of {@link LayoutResolver} which dynamically compiles schema from + * a {@link Namespace}. *

*

- * This resolver assumes that within the have - * their properly populated. The resolver caches compiled schema. + * This resolver assumes that {@link Schema} within the {@link Namespace} have + * their {@link Schema.SchemaId} properly populated. The resolver caches compiled schema. *

* All members of this class are multi-thread safe. */ @@ -49,7 +49,7 @@ public final class LayoutResolverNamespace extends LayoutResolver { // TODO: C# TO JAVA CONVERTER: There is no Java ConcurrentHashMap equivalent to this .NET // ConcurrentDictionary method: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (this.layoutCache.TryGetValue(schemaId.getId(), out layout)) { return layout; } 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 690f329..9eeacd3 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -51,7 +52,7 @@ public abstract class LayoutScope extends LayoutType { return false; } - public final Result DeleteScope(RefObject b, RefObject edit) { + public final Result DeleteScope(Reference b, Reference edit) { Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode); if (result != Result.Success) { return result; @@ -68,12 +69,12 @@ public abstract class LayoutScope extends LayoutType { * @param edit * @return True if the type code is implied (not written), false otherwise. */ - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { return false; } - public final Result ReadScope(RefObject b, RefObject edit, - OutObject value) { + public final Result ReadScope(Reference b, Reference edit, + Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -85,32 +86,32 @@ public abstract class LayoutScope extends LayoutType { return Result.Success; } - public void ReadSparsePath(RefObject row, RefObject edit) { + public void ReadSparsePath(Reference row, Reference edit) { int pathLenInBytes; - OutObject tempOut_pathLenInBytes = new OutObject(); - OutObject tempOut_pathOffset = new OutObject(); + Out tempOut_pathLenInBytes = new Out(); + Out tempOut_pathOffset = new Out(); edit.get().pathToken = row.get().ReadSparsePathLen(edit.get().layout, edit.get().valueOffset, tempOut_pathLenInBytes, tempOut_pathOffset); edit.get().argValue.pathOffset = tempOut_pathOffset.get(); pathLenInBytes = tempOut_pathLenInBytes.get(); edit.get().valueOffset += pathLenInBytes; } - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { throw new NotImplementedException(); } public abstract Result WriteScope( - RefObject b, RefObject scope, TypeArgumentList typeArgs, - OutObject value); + Reference b, Reference scope, TypeArgumentList typeArgs, + Out value); //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public abstract Result WriteScope(ref RowBuffer b, ref RowCursor scope, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert); - public abstract Result WriteScope(RefObject b, RefObject scope, - TypeArgumentList typeArgs, OutObject value, + public abstract Result WriteScope(Reference b, Reference scope, + TypeArgumentList typeArgs, Out value, UpdateOptions options); - public Result WriteScope(RefObject b, RefObject scope, + public Result WriteScope(Reference b, Reference scope, TypeArgumentList typeArgs, TContext context, WriterFunc func) { return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert); } @@ -119,37 +120,37 @@ public abstract class LayoutScope extends LayoutType { //ORIGINAL LINE: public virtual Result WriteScope(ref RowBuffer b, ref RowCursor scope, // TypeArgumentList typeArgs, TContext context, WriterFunc func, UpdateOptions options = UpdateOptions // .Upsert) - public Result WriteScope(RefObject b, RefObject scope, + public Result WriteScope(Reference b, Reference scope, TypeArgumentList typeArgs, TContext context, WriterFunc func, UpdateOptions options) { RowCursor childScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.WriteScope(b, scope, typeArgs.clone(), out childScope, options); if (r != Result.Success) { return r; } - RefObject tempRef_childScope = - new RefObject(childScope); + Reference tempReference_childScope = + new Reference(childScope); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success; - childScope = tempRef_childScope.get(); + childScope = tempReference_childScope.get(); if (r != Result.Success) { this.DeleteScope(b, scope); return r; } - RefObject tempRef_childScope2 = - new RefObject(childScope); + Reference tempReference_childScope2 = + new Reference(childScope); RowCursorExtensions.Skip(scope.get().clone(), b, - tempRef_childScope2); - childScope = tempRef_childScope2.get(); + tempReference_childScope2); + childScope = tempReference_childScope2.get(); return Result.Success; } /** - * A function to write content into a . + * A function to write content into a {@link RowBuffer}. * The type of the context value passed by the caller. * * @param b The row to write to. @@ -159,6 +160,6 @@ public abstract class LayoutScope extends LayoutType { */ @FunctionalInterface public interface WriterFunc { - Result invoke(RefObject b, RefObject scope, TContext context); + Result invoke(Reference b, Reference scope, TContext context); } } \ No newline at end of file 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 bd83053..84125e5 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,15 +31,15 @@ public final class LayoutTagged extends LayoutIndexedScope { } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkArgument(edit.get().index >= 0); checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode); } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { TypeArgument[] retval = new TypeArgument[2]; retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty); retval[1] = ReadTypeArgument(row, offset, lenInBytes); @@ -46,14 +47,14 @@ public final class LayoutTagged extends LayoutIndexedScope { } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -61,8 +62,8 @@ public final class LayoutTagged extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -74,7 +75,7 @@ public final class LayoutTagged extends LayoutIndexedScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkArgument(value.getCount() == 2); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); 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 2422be3..7e6c781 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 @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; @@ -35,21 +35,21 @@ public final class LayoutTagged2 extends LayoutIndexedScope { } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkState(edit.get().index >= 0); checkState(edit.get().scopeTypeArgs.getCount() > edit.get().index); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode); } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { lenInBytes.set(0); TypeArgument[] retval = new TypeArgument[3]; retval[0] = new TypeArgument(UInt8, TypeArgumentList.Empty); for (int i = 1; i < 3; i++) { int itemLenInBytes; - OutObject tempOut_itemLenInBytes = new OutObject(); + Out tempOut_itemLenInBytes = new Out(); retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes); itemLenInBytes = tempOut_itemLenInBytes.get(); lenInBytes.set(lenInBytes.get() + itemLenInBytes); @@ -59,14 +59,14 @@ public final class LayoutTagged2 extends LayoutIndexedScope { } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -74,8 +74,8 @@ public final class LayoutTagged2 extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -87,7 +87,7 @@ public final class LayoutTagged2 extends LayoutIndexedScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkState(value.getCount() == 3); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); 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 0b96666..6c25cf1 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -37,13 +38,13 @@ public final class LayoutTuple extends LayoutIndexedScope { } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes); TypeArgument[] retval = new TypeArgument[numTypeArgs]; for (int i = 0; i < numTypeArgs; i++) { int itemLenInBytes; - OutObject tempOut_itemLenInBytes = new OutObject(); + Out tempOut_itemLenInBytes = new Out(); retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes); itemLenInBytes = tempOut_itemLenInBytes.get(); lenInBytes.set(lenInBytes.get() + itemLenInBytes); @@ -53,8 +54,8 @@ public final class LayoutTuple extends LayoutIndexedScope { } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -62,8 +63,8 @@ public final class LayoutTuple extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -75,7 +76,7 @@ public final class LayoutTuple extends LayoutIndexedScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { 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: 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 2824d8d..b44a561 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,7 +28,7 @@ import static com.google.common.base.Strings.lenientFormat; /** * The abstract base class for typed hybrid row field descriptors. - * is immutable. + * {@link LayoutType} is immutable. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [DebuggerDisplay("{" + nameof(LayoutType.Name) + "}")] public abstract class LayoutType : ILayoutType @@ -269,7 +270,7 @@ public abstract class LayoutType implements ILayoutType { public int Size; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link LayoutType} class. */ public LayoutType(LayoutCode code, boolean immutable, int size) { this.LayoutCode = code; @@ -343,7 +344,7 @@ 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(RefObject b, RefObject edit, + public static Result PrepareSparseDelete(Reference b, Reference edit, LayoutCode code) { if (edit.get().scopeType.IsFixedArity) { return Result.TypeConstraint; @@ -373,11 +374,11 @@ public abstract class LayoutType implements ILayoutType { * @return Success if the move is permitted, the error code otherwise. * The source field is delete if the move prepare fails with a destination error. */ - public static Result PrepareSparseMove(RefObject b, - RefObject destinationScope, + public static Result PrepareSparseMove(Reference b, + Reference destinationScope, LayoutScope destinationCode, TypeArgument elementType, - RefObject srcEdit, UpdateOptions options, - OutObject dstEdit) { + Reference srcEdit, UpdateOptions options, + Out dstEdit) { checkArgument(destinationScope.get().scopeType == destinationCode); checkArgument(destinationScope.get().index == 0, "Can only insert into a edit at the root"); @@ -436,7 +437,7 @@ public abstract class LayoutType implements ILayoutType { * @param code The expected type of the field. * @return Success if the read is permitted, the error code otherwise. */ - public static Result PrepareSparseRead(RefObject b, RefObject edit, + public static Result PrepareSparseRead(Reference b, Reference edit, LayoutCode code) { if (!edit.get().exists) { return Result.NotFound; @@ -458,7 +459,7 @@ public abstract class LayoutType implements ILayoutType { * @param options The write options. * @return Success if the write is permitted, the error code otherwise. */ - public static Result PrepareSparseWrite(RefObject b, RefObject edit, + public static Result PrepareSparseWrite(Reference b, Reference edit, TypeArgument typeArg, UpdateOptions options) { if (edit.get().immutable || (edit.get().scopeType.IsUniqueScope && !edit.get().deferUniqueIndex)) { return Result.InsufficientPermissions; @@ -497,17 +498,17 @@ public abstract class LayoutType implements ILayoutType { // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static TypeArgument ReadTypeArgument(ref RowBuffer row, int offset, out int lenInBytes) - public static TypeArgument ReadTypeArgument(RefObject row, int offset, OutObject lenInBytes) { + public static TypeArgument ReadTypeArgument(Reference row, int offset, Out lenInBytes) { LayoutType itemCode = row.get().ReadSparseTypeCode(offset); int argsLenInBytes; - OutObject tempOut_argsLenInBytes = new OutObject(); + Out tempOut_argsLenInBytes = new Out(); TypeArgumentList itemTypeArgs = itemCode.ReadTypeArgumentList(row, offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), tempOut_argsLenInBytes).clone(); argsLenInBytes = tempOut_argsLenInBytes.get(); lenInBytes.set((com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE) + argsLenInBytes); return new TypeArgument(itemCode, itemTypeArgs.clone()); } - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, Out lenInBytes) { lenInBytes.set(0); return TypeArgumentList.Empty; } @@ -521,7 +522,7 @@ public abstract class LayoutType implements ILayoutType { return (T)this; } - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + 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); } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType1.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType1.java index 3741f0a..6233464 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType1.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutType1.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -17,11 +18,11 @@ import static com.google.common.base.Preconditions.checkArgument; * . * * - * is an immutable, stateless, helper class. It provides + * {@link LayoutType{T}} is an immutable, stateless, helper class. It provides * methods for manipulating hybrid row fields of a particular type, and properties that describe the * layout of fields of that type. * - * is immutable. + * {@link LayoutType{T}} is immutable. */ public abstract class LayoutType extends LayoutType { private TypeArgument typeArg = new TypeArgument(); @@ -31,7 +32,7 @@ public abstract class LayoutType extends LayoutType { this.typeArg = new TypeArgument(this); } - public final Result DeleteFixed(RefObject b, RefObject scope, + public final Result DeleteFixed(Reference b, Reference scope, LayoutColumn col) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -53,7 +54,7 @@ public abstract class LayoutType extends LayoutType { * 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. */ - public final Result DeleteSparse(RefObject b, RefObject edit) { + public final Result DeleteSparse(Reference b, Reference edit) { Result result = LayoutType.PrepareSparseDelete(b, edit, this.LayoutCode); if (result != Result.Success) { return result; @@ -69,7 +70,7 @@ public abstract class LayoutType extends LayoutType { * 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. */ - public final Result DeleteVariable(RefObject b, RefObject scope, + public final Result DeleteVariable(Reference b, Reference scope, LayoutColumn col) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -87,7 +88,7 @@ public abstract class LayoutType extends LayoutType { return Result.Success; } - public final Result HasValue(RefObject b, RefObject scope, + public final Result HasValue(Reference b, Reference scope, LayoutColumn col) { if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) { return Result.NotFound; @@ -96,28 +97,28 @@ public abstract class LayoutType extends LayoutType { return Result.Success; } - public abstract Result ReadFixed(RefObject b, RefObject scope, - LayoutColumn col, OutObject value); + public abstract Result ReadFixed(Reference b, Reference scope, + LayoutColumn col, Out value); - public abstract Result ReadSparse(RefObject b, RefObject edit, OutObject value); + public abstract Result ReadSparse(Reference b, Reference edit, Out value); - public Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col - , OutObject value) { + public Result ReadVariable(Reference b, Reference scope, LayoutColumn col + , Out value) { value.set(null); return Result.Failure; } - public abstract Result WriteFixed(RefObject b, RefObject scope, + public abstract Result WriteFixed(Reference b, Reference scope, LayoutColumn col, T value); - public abstract Result WriteSparse(RefObject b, RefObject edit, T value); + public abstract Result WriteSparse(Reference b, Reference edit, T value); //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public abstract Result WriteSparse(ref RowBuffer b, ref RowCursor edit, T value, UpdateOptions // options = UpdateOptions.Upsert); - public abstract Result WriteSparse(RefObject b, RefObject edit, T value, UpdateOptions options); + public abstract Result WriteSparse(Reference b, Reference edit, T value, UpdateOptions options); - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, T value) { return Result.Failure; } 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 fe8766c..0f6470c 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,27 +29,27 @@ public final class LayoutTypedArray extends LayoutIndexedScope { } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkState(edit.get().index >= 0); checkState(edit.get().scopeTypeArgs.getCount() == 1); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode); } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { return new TypeArgumentList(new TypeArgument[] { LayoutType.ReadTypeArgument(row, offset, lenInBytes) }); } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -56,8 +57,8 @@ public final class LayoutTypedArray extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -69,7 +70,7 @@ public final class LayoutTypedArray extends LayoutIndexedScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkState(value.getCount() == 1); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); 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 38f56cf..b67a985 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -34,24 +35,24 @@ public final class LayoutTypedMap extends LayoutUniqueScope { } @Override - public TypeArgument FieldType(RefObject scope) { + public TypeArgument FieldType(Reference scope) { return new TypeArgument(scope.get().scopeType.Immutable ? ImmutableTypedTuple : TypedTuple, scope.get().scopeTypeArgs.clone()); } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { return true; } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { lenInBytes.set(0); TypeArgument[] retval = new TypeArgument[2]; for (int i = 0; i < 2; i++) { int itemLenInBytes; - OutObject tempOut_itemLenInBytes = new OutObject(); + Out tempOut_itemLenInBytes = new Out(); retval[i] = ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes); itemLenInBytes = tempOut_itemLenInBytes.get(); lenInBytes.set(lenInBytes.get() + itemLenInBytes); @@ -61,15 +62,15 @@ public final class LayoutTypedMap extends LayoutUniqueScope { } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeType.Immutable ? ImmutableTypedTuple : TypedTuple; edit.get().cellTypeArgs = edit.get().scopeTypeArgs.clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -77,8 +78,8 @@ public final class LayoutTypedMap extends LayoutUniqueScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -90,7 +91,7 @@ public final class LayoutTypedMap extends LayoutUniqueScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkState(value.getCount() == 2); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); 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 6af4744..611de6f 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,32 +31,32 @@ public final class LayoutTypedSet extends LayoutUniqueScope { } @Override - public TypeArgument FieldType(RefObject scope) { + public TypeArgument FieldType(Reference scope) { return scope.get().scopeTypeArgs.get(0).clone(); } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkState(edit.get().index >= 0); checkState(edit.get().scopeTypeArgs.getCount() == 1); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(0).getType().LayoutCode); } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { return new TypeArgumentList(new TypeArgument[] { ReadTypeArgument(row, offset, lenInBytes) }); } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeTypeArgs.get(0).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(0).getTypeArgs().clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -63,8 +64,8 @@ public final class LayoutTypedSet extends LayoutUniqueScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -76,7 +77,7 @@ public final class LayoutTypedSet extends LayoutUniqueScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { checkArgument(value.getCount() == 1); row.get().WriteSparseTypeCode(offset, this.LayoutCode); int lenInBytes = (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE); 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 804a903..e649655 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 @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; @@ -37,20 +37,20 @@ public final class LayoutTypedTuple extends LayoutIndexedScope { } @Override - public boolean HasImplicitTypeCode(RefObject edit) { + public boolean HasImplicitTypeCode(Reference edit) { checkArgument(edit.get().index >= 0); checkArgument(edit.get().scopeTypeArgs.getCount() > edit.get().index); return !LayoutCodeTraits.AlwaysRequiresTypeCode(edit.get().scopeTypeArgs.get(edit.get().index).getType().LayoutCode); } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { int numTypeArgs = row.get().intValue().Read7BitEncodedUInt(offset, lenInBytes); TypeArgument[] retval = new TypeArgument[numTypeArgs]; for (int i = 0; i < numTypeArgs; i++) { int itemLenInBytes; - OutObject tempOut_itemLenInBytes = new OutObject(); + Out tempOut_itemLenInBytes = new Out(); retval[i] = LayoutType.ReadTypeArgument(row, offset + lenInBytes.get(), tempOut_itemLenInBytes); itemLenInBytes = tempOut_itemLenInBytes.get(); lenInBytes.set(lenInBytes.get() + itemLenInBytes); @@ -60,14 +60,14 @@ public final class LayoutTypedTuple extends LayoutIndexedScope { } @Override - public void SetImplicitTypeCode(RefObject edit) { + public void SetImplicitTypeCode(Reference edit) { edit.get().cellType = edit.get().scopeTypeArgs.get(edit.get().index).getType(); edit.get().cellTypeArgs = edit.get().scopeTypeArgs.get(edit.get().index).getTypeArgs().clone(); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -75,8 +75,8 @@ public final class LayoutTypedTuple extends LayoutIndexedScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { value.set(null); @@ -88,7 +88,7 @@ public final class LayoutTypedTuple extends LayoutIndexedScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { 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: 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 24f5020..b0caeff 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,16 +29,16 @@ public final class LayoutUDT extends LayoutPropertyScope { } @Override - public TypeArgumentList ReadTypeArgumentList(RefObject row, int offset, - OutObject lenInBytes) { + public TypeArgumentList ReadTypeArgumentList(Reference row, int offset, + Out lenInBytes) { SchemaId schemaId = row.get().ReadSchemaId(offset).clone(); lenInBytes.set(SchemaId.Size); return new TypeArgumentList(schemaId.clone()); } @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value) { return WriteScope(b, edit, typeArgs, value, UpdateOptions.Upsert); } @@ -45,8 +46,8 @@ public final class LayoutUDT extends LayoutPropertyScope { //ORIGINAL LINE: public override Result WriteScope(ref RowBuffer b, ref RowCursor edit, TypeArgumentList // typeArgs, out RowCursor value, UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteScope(RefObject b, RefObject edit, - TypeArgumentList typeArgs, OutObject value, UpdateOptions options) { + public Result WriteScope(Reference b, Reference edit, + TypeArgumentList typeArgs, Out value, UpdateOptions options) { Layout udt = b.get().getResolver().Resolve(typeArgs.getSchemaId().clone()); Result result = PrepareSparseWrite(b, edit, new TypeArgument(this, typeArgs.clone()), options); if (result != Result.Success) { @@ -59,7 +60,7 @@ public final class LayoutUDT extends LayoutPropertyScope { } @Override - public int WriteTypeArgument(RefObject row, int offset, TypeArgumentList value) { + public int WriteTypeArgument(Reference row, int offset, TypeArgumentList value) { row.get().WriteSparseTypeCode(offset, this.LayoutCode); row.get().WriteSchemaId(offset + (com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.SIZE / Byte.SIZE), value.getSchemaId().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 6d02079..9d6d291 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -33,8 +34,8 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -48,8 +49,8 @@ public final class LayoutUInt16 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 ushort value) @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -64,7 +65,7 @@ public final class LayoutUInt16 extends LayoutType { //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ushort // value) @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, short value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -81,7 +82,7 @@ public final class LayoutUInt16 extends LayoutType { // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result WriteSparse(RefObject b, RefObject edit, short value, + public Result WriteSparse(Reference b, Reference edit, short value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -93,7 +94,7 @@ public final class LayoutUInt16 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, short value) { + public Result WriteSparse(Reference b, Reference edit, short 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/LayoutUInt32.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt32.java index d9b90b4..78ee192 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -33,8 +34,8 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -48,8 +49,8 @@ public final class LayoutUInt32 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 uint value) @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -64,7 +65,7 @@ public final class LayoutUInt32 extends LayoutType { //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, uint // value) @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, int value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -81,7 +82,7 @@ public final class LayoutUInt32 extends LayoutType { // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result WriteSparse(RefObject b, RefObject edit, int value, + public Result WriteSparse(Reference b, Reference edit, int value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -93,7 +94,7 @@ public final class LayoutUInt32 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, int value) { + public Result WriteSparse(Reference b, Reference edit, int 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/LayoutUInt64.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt64.java index 5ecfe88..7c0ab31 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -33,8 +34,8 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -48,8 +49,8 @@ public final class LayoutUInt64 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(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -64,7 +65,7 @@ public final class LayoutUInt64 extends LayoutType { //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong // value) @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, long value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -81,7 +82,7 @@ public final class LayoutUInt64 extends LayoutType { // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result WriteSparse(RefObject b, RefObject edit, long value, + public Result WriteSparse(Reference b, Reference edit, long value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -93,7 +94,7 @@ public final class LayoutUInt64 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, long value) { + public Result WriteSparse(Reference b, Reference edit, long 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/LayoutUInt8.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUInt8.java index 15ac870..214f7dd 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -33,8 +34,8 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(0); @@ -48,8 +49,8 @@ public final class LayoutUInt8 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 byte value) @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -64,7 +65,7 @@ public final class LayoutUInt8 extends LayoutType { //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, byte // value) @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, byte value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -81,7 +82,7 @@ public final class LayoutUInt8 extends LayoutType { // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result WriteSparse(RefObject b, RefObject edit, byte value, + public Result WriteSparse(Reference b, Reference edit, byte value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -93,7 +94,7 @@ public final class LayoutUInt8 extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, byte value) { + public Result WriteSparse(Reference b, Reference edit, byte 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/LayoutUniqueScope.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/LayoutUniqueScope.java index b0cbe55..6e035f8 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -21,7 +22,7 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { super(code, immutable, isSizedScope, false, true, isTypedScope); } - public abstract TypeArgument FieldType(RefObject scope); + public abstract TypeArgument FieldType(Reference scope); /** * Search for a matching field within a unique index. @@ -35,8 +36,8 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { *

* The pattern field is delete whether the find succeeds or fails. */ - public final Result Find(RefObject b, RefObject scope, - RefObject patternScope, OutObject value) { + public final Result Find(Reference b, Reference scope, + Reference patternScope, Out value) { Result result = LayoutType.PrepareSparseMove(b, scope, this, this.FieldType(scope).clone(), patternScope, UpdateOptions.Update, value.clone()); if (result != Result.Success) { @@ -52,11 +53,11 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public Result MoveField(ref RowBuffer b, ref RowCursor destinationScope, ref RowCursor // sourceEdit, UpdateOptions options = UpdateOptions.Upsert) - public final Result MoveField(RefObject b, RefObject destinationScope, - RefObject sourceEdit, UpdateOptions options) { + public final Result MoveField(Reference b, Reference destinationScope, + Reference sourceEdit, UpdateOptions options) { RowCursor dstEdit; - OutObject tempOut_dstEdit = - new OutObject(); + Out tempOut_dstEdit = + new Out(); Result result = LayoutType.PrepareSparseMove(b, destinationScope, this, this.FieldType(destinationScope).clone(), sourceEdit, options, tempOut_dstEdit); dstEdit = tempOut_dstEdit.get(); @@ -66,10 +67,10 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { } // Perform the move. - RefObject tempRef_dstEdit = - new RefObject(dstEdit); - b.get().TypedCollectionMoveField(tempRef_dstEdit, sourceEdit, RowOptions.forValue(options)); - dstEdit = tempRef_dstEdit.get(); + Reference tempReference_dstEdit = + new Reference(dstEdit); + b.get().TypedCollectionMoveField(tempReference_dstEdit, sourceEdit, RowOptions.forValue(options)); + dstEdit = tempReference_dstEdit.get(); // TODO: it would be "better" if the destinationScope were updated to point to the // highest item seen. Then we would avoid the maximum reparse. @@ -92,8 +93,8 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { * The source field is delete whether the move succeeds or fails. */ - public final Result MoveField(RefObject b, RefObject destinationScope, - RefObject sourceEdit) { + public final Result MoveField(Reference b, Reference destinationScope, + Reference sourceEdit) { return MoveField(b, destinationScope, sourceEdit, UpdateOptions.Upsert); } @@ -102,12 +103,12 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { // TypeArgumentList typeArgs, TContext context, WriterFunc func, UpdateOptions options = UpdateOptions // .Upsert) @Override - public Result WriteScope(RefObject b, RefObject scope, + public Result WriteScope(Reference b, Reference scope, TypeArgumentList typeArgs, TContext context, WriterFunc func, UpdateOptions options) { RowCursor uniqueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.WriteScope(b, scope, typeArgs.clone(), out uniqueScope, options); if (r != Result.Success) { return r; @@ -115,39 +116,39 @@ public abstract class LayoutUniqueScope extends LayoutIndexedScope { RowCursor childScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: uniqueScope.Clone(out childScope); childScope.deferUniqueIndex = true; - RefObject tempRef_childScope = - new RefObject(childScope); + Reference tempReference_childScope = + new Reference(childScope); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: r = func == null ? null : func.Invoke(ref b, ref childScope, context) ??Result.Success; - childScope = tempRef_childScope.get(); + childScope = tempReference_childScope.get(); if (r != Result.Success) { this.DeleteScope(b, scope); return r; } uniqueScope.count = childScope.count; - RefObject tempRef_uniqueScope = - new RefObject(uniqueScope); - r = b.get().TypedCollectionUniqueIndexRebuild(tempRef_uniqueScope); - uniqueScope = tempRef_uniqueScope.get(); + Reference tempReference_uniqueScope = + new Reference(uniqueScope); + r = b.get().TypedCollectionUniqueIndexRebuild(tempReference_uniqueScope); + uniqueScope = tempReference_uniqueScope.get(); if (r != Result.Success) { this.DeleteScope(b, scope); return r; } - RefObject tempRef_childScope2 = - new RefObject(childScope); + Reference tempReference_childScope2 = + new Reference(childScope); RowCursorExtensions.Skip(scope.get().clone(), b, - tempRef_childScope2); - childScope = tempRef_childScope2.get(); + tempReference_childScope2); + childScope = tempReference_childScope2.get(); return Result.Success; } @Override - public Result WriteScope(RefObject b, RefObject scope, + public Result WriteScope(Reference b, Reference scope, TypeArgumentList typeArgs, TContext context, WriterFunc func) { return WriteScope(b, scope, typeArgs, context, func, UpdateOptions.Upsert); } 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 437e537..aaada2e 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,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -30,8 +31,8 @@ public final class LayoutUnixDateTime extends LayoutType b, RefObject scope, LayoutColumn col, - OutObject value) { + 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())) { value.set(null); @@ -43,8 +44,8 @@ public final class LayoutUnixDateTime extends LayoutType b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -56,7 +57,7 @@ public final class LayoutUnixDateTime extends LayoutType b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, UnixDateTime value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -72,7 +73,7 @@ public final class LayoutUnixDateTime extends LayoutType b, RefObject edit, UnixDateTime value + public Result WriteSparse(Reference b, Reference edit, UnixDateTime value , UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -84,7 +85,7 @@ public final class LayoutUnixDateTime extends LayoutType b, RefObject edit, UnixDateTime value) { + public Result WriteSparse(Reference b, Reference 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 24bcf25..1e72ee6 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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,19 +29,19 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { Utf8Span span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.ReadFixed(b, scope, col, out span); value.set((r == Result.Success) ? span.toString() :) default return r; } - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); checkArgument(col.getSize() >= 0); if (!b.get().ReadBit(scope.get().start, col.getNullBit().clone())) { @@ -53,18 +54,18 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result ReadSparse(RefObject b, RefObject edit, - OutObject value) { + public Result ReadSparse(Reference b, Reference edit, + Out value) { Utf8Span span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.ReadSparse(b, edit, out span); value.set((r == Result.Success) ? span.toString() :) default return r; } - public Result ReadSparse(RefObject b, RefObject edit, OutObject value) { + public Result ReadSparse(Reference b, Reference edit, Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(null); @@ -76,19 +77,19 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col - , OutObject value) { + public Result ReadVariable(Reference b, Reference scope, LayoutColumn col + , Out value) { Utf8Span span; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = this.ReadVariable(b, scope, col, out span); value.set((r == Result.Success) ? span.toString() :) default return r; } - public Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col - , OutObject value) { + 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())) { value.set(null); @@ -102,13 +103,13 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, String value) { checkArgument(value != null); return this.WriteFixed(b, scope, col, Utf8Span.TranscodeUtf16(value)); } - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, Utf8Span value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); checkArgument(col.getSize() >= 0); @@ -123,7 +124,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result WriteSparse(RefObject b, RefObject edit, String value) { + public Result WriteSparse(Reference b, Reference edit, String value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @@ -131,21 +132,21 @@ 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(RefObject b, RefObject edit, String value, + public Result WriteSparse(Reference b, Reference edit, String value, UpdateOptions options) { checkArgument(value != null); return this.WriteSparse(b, edit, Utf8Span.TranscodeUtf16(value), options); } - public Result WriteSparse(RefObject b, RefObject edit, Utf8Span value) { + public Result WriteSparse(Reference b, Reference edit, Utf8Span value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public Result WriteSparse(ref RowBuffer b, ref RowCursor edit, Utf8Span value, UpdateOptions // options = UpdateOptions.Upsert) - public Result WriteSparse(RefObject b, RefObject edit, Utf8Span value, + public Result WriteSparse(Reference b, Reference edit, Utf8Span value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -157,13 +158,13 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S } @Override - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, String value) { checkArgument(value != null); return this.WriteVariable(b, scope, col, Utf8Span.TranscodeUtf16(value)); } - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, Utf8Span value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -179,7 +180,7 @@ public final class LayoutUtf8 extends LayoutType implements ILayoutUtf8S int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start, col.getOffset()); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); b.get().WriteVariableString(varOffset, value, exists, tempOut_shift); shift = tempOut_shift.get(); b.get().SetBit(scope.get().start, col.getNullBit().clone()); 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 5cf49e7..9ad5957 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 @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +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; @@ -33,15 +33,15 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result ReadFixed(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { Contract.Fail("Not Implemented"); value.set(0); return Result.Failure; } @Override - public Result ReadSparse(RefObject b, RefObject edit, OutObject value) { + public Result ReadSparse(Reference b, Reference edit, Out value) { Result result = LayoutType.PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -53,7 +53,7 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result ReadVariable(RefObject b, RefObject scope, LayoutColumn col, OutObject value) { + 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())) { value.set(0); @@ -67,7 +67,7 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, long value) { Contract.Fail("Not Implemented"); return Result.Failure; @@ -77,7 +77,7 @@ public final class LayoutVarInt extends LayoutType { //ORIGINAL LINE: public override Result WriteSparse(ref RowBuffer b, ref RowCursor edit, long value, // UpdateOptions options = UpdateOptions.Upsert) @Override - public Result WriteSparse(RefObject b, RefObject edit, long value, + public Result WriteSparse(Reference b, Reference edit, long value, UpdateOptions options) { Result result = LayoutType.PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -89,12 +89,12 @@ public final class LayoutVarInt extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, long value) { + public Result WriteSparse(Reference b, Reference edit, long value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @Override - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, long value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -105,7 +105,7 @@ public final class LayoutVarInt extends LayoutType { int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start, col.getOffset()); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); b.get().WriteVariableInt(varOffset, value, exists, tempOut_shift); shift = tempOut_shift.get(); b.get().SetBit(scope.get().start, col.getNullBit().clone()); 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 32d6fd0..0b482d2 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +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; @@ -38,8 +39,8 @@ 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(RefObject b, RefObject scope, LayoutColumn col, - OutObject value) { + public Result ReadFixed(Reference b, Reference scope, LayoutColumn col, + Out value) { Contract.Fail("Not Implemented"); value.set(0); return Result.Failure; @@ -48,7 +49,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(RefObject b, RefObject edit, OutObject value) { + public Result ReadSparse(Reference b, Reference edit, Out value) { Result result = PrepareSparseRead(b, edit, this.LayoutCode); if (result != Result.Success) { value.set(0); @@ -63,7 +64,7 @@ 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(RefObject b, RefObject scope, LayoutColumn col, OutObject value) { + 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())) { value.set(0); @@ -80,7 +81,7 @@ public final class LayoutVarUInt extends LayoutType { //ORIGINAL LINE: public override Result WriteFixed(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, ulong // value) @Override - public Result WriteFixed(RefObject b, RefObject scope, LayoutColumn col, + public Result WriteFixed(Reference b, Reference scope, LayoutColumn col, long value) { Contract.Fail("Not Implemented"); return Result.Failure; @@ -91,7 +92,7 @@ public final class LayoutVarUInt extends LayoutType { // UpdateOptions options = UpdateOptions.Upsert) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @Override - public Result WriteSparse(RefObject b, RefObject edit, long value, + public Result WriteSparse(Reference b, Reference edit, long value, UpdateOptions options) { Result result = PrepareSparseWrite(b, edit, this.getTypeArg().clone(), options); if (result != Result.Success) { @@ -103,7 +104,7 @@ public final class LayoutVarUInt extends LayoutType { } @Override - public Result WriteSparse(RefObject b, RefObject edit, long value) { + public Result WriteSparse(Reference b, Reference edit, long value) { return WriteSparse(b, edit, value, UpdateOptions.Upsert); } @@ -111,7 +112,7 @@ public final class LayoutVarUInt extends LayoutType { //ORIGINAL LINE: public override Result WriteVariable(ref RowBuffer b, ref RowCursor scope, LayoutColumn col, // ulong value) @Override - public Result WriteVariable(RefObject b, RefObject scope, + public Result WriteVariable(Reference b, Reference scope, LayoutColumn col, long value) { checkArgument(scope.get().scopeType instanceof LayoutUDT); if (scope.get().immutable) { @@ -122,7 +123,7 @@ public final class LayoutVarUInt extends LayoutType { int varOffset = b.get().ComputeVariableValueOffset(scope.get().layout, scope.get().start, col.getOffset()); int shift; - OutObject tempOut_shift = new OutObject(); + Out tempOut_shift = new Out(); b.get().WriteVariableUInt(varOffset, value, exists, tempOut_shift); shift = tempOut_shift.get(); b.get().SetBit(scope.get().start, col.getNullBit().clone()); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/StringTokenizer.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/StringTokenizer.java index 48b5edc..464539e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/StringTokenizer.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/StringTokenizer.java @@ -4,7 +4,7 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; import java.util.ArrayList; import java.util.Arrays; @@ -21,7 +21,7 @@ public final class StringTokenizer { private HashMap tokens; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link StringTokenizer} class. */ public StringTokenizer() { this.tokens = new HashMap(Map.ofEntries(Map.entry(Utf8String.Empty, @@ -68,7 +68,7 @@ public final class StringTokenizer { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public bool TryFindString(ulong token, out Utf8String path) - public boolean TryFindString(long token, OutObject path) { + public boolean TryFindString(long token, Out path) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: if (token >= (ulong)this.strings.Count) if (token >= (long)this.strings.size()) { @@ -87,7 +87,7 @@ public final class StringTokenizer { * @param token If successful, the string's assigned token. * @return True if successful, false otherwise. */ - public boolean TryFindToken(UtfAnyString path, OutObject token) { + public boolean TryFindToken(UtfAnyString path, Out token) { if (path.IsNull) { token.set(null); return false; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgument.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgument.java index 8cb7b45..9044aff 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgument.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgument.java @@ -19,7 +19,7 @@ public final class TypeArgument implements IEquatable { private TypeArgumentList typeArgs = new TypeArgumentList(); /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link TypeArgument} struct. * * @param type The type of the constraint. */ @@ -34,7 +34,7 @@ public final class TypeArgument implements IEquatable { } /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link TypeArgument} struct. * * @param type The type of the constraint. * @param typeArgs For generic types the type parameters. diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgumentList.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgumentList.java index 1439b7a..c448f23 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgumentList.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/TypeArgumentList.java @@ -41,7 +41,7 @@ public final class TypeArgumentList implements IEquatable { } /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link TypeArgumentList} struct. * * @param schemaId For UDT fields, the schema id of the nested layout. */ @@ -141,7 +141,7 @@ public final class TypeArgumentList implements IEquatable { } /** - * Enumerates the elements of a . + * Enumerates the elements of a {@link TypeArgumentList}. */ //C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may // differ from the original: @@ -157,7 +157,7 @@ public final class TypeArgumentList implements IEquatable { private TypeArgument[] list; /** - * Initializes a new instance of the struct. + * Initializes a new instance of the {@link Enumerator} struct. * * @param list The list to enumerate. */ diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/UpdateOptions.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/UpdateOptions.java index 412d559..6f89610 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/UpdateOptions.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/layouts/UpdateOptions.java @@ -5,7 +5,7 @@ package com.azure.data.cosmos.serialization.hybridrow.layouts; /** - * Describes the desired behavior when writing a . + * Describes the desired behavior when writing a {@link LayoutType}. */ public enum UpdateOptions { None(0), @@ -31,8 +31,8 @@ public enum UpdateOptions { /** * Update an existing value or insert a new value, if no value exists. *

- * If a value exists, then this operation becomes , otherwise it becomes - * . + * If a value exists, then this operation becomes {@link Update}, otherwise it becomes + * {@link Insert}. */ Upsert(3), @@ -40,7 +40,7 @@ public enum UpdateOptions { * Insert a new value moving existing values to the right. *

* Within an array scope, inserts a new value immediately at the index moving all subsequent - * items to the right. In any other scope behaves the same as . + * items to the right. In any other scope behaves the same as {@link Upsert}. */ InsertAt(4); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOFormatter.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOFormatter.java index 6245a57..73c4e84 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOFormatter.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOFormatter.java @@ -4,7 +4,7 @@ package com.azure.data.cosmos.serialization.hybridrow.recordio; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.serialization.hybridrow.HybridRowHeader; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.ISpanResizer; @@ -15,7 +15,7 @@ public final class RecordIOFormatter { public static final Layout RecordLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.RecordSchemaId); public static final Layout SegmentLayout = SystemSchema.LayoutResolver.Resolve(SystemSchema.SegmentSchemaId); - public static Result FormatRecord(ReadOnlyMemory body, OutObject row) { + public static Result FormatRecord(ReadOnlyMemory body, Out row) { return FormatRecord(body, row, null); } @@ -23,7 +23,7 @@ public final class RecordIOFormatter { //ORIGINAL LINE: public static Result FormatRecord(ReadOnlyMemory body, out RowBuffer row, // ISpanResizer resizer = default) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - public static Result FormatRecord(ReadOnlyMemory body, OutObject row, + public static Result FormatRecord(ReadOnlyMemory body, Out row, ISpanResizer resizer) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer.Default; @@ -37,7 +37,7 @@ public final class RecordIOFormatter { RecordSerializer.Write, row.clone()); } - public static Result FormatSegment(Segment segment, OutObject row) { + public static Result FormatSegment(Segment segment, Out row) { return FormatSegment(segment, row, null); } @@ -45,7 +45,7 @@ public final class RecordIOFormatter { //ORIGINAL LINE: public static Result FormatSegment(Segment segment, out RowBuffer row, ISpanResizer // resizer = default) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: - public static Result FormatSegment(Segment segment, OutObject row, ISpanResizer resizer) { + public static Result FormatSegment(Segment segment, Out row, ISpanResizer resizer) { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: resizer = resizer != null ? resizer : DefaultSpanResizer.Default; resizer = resizer != null ? resizer : DefaultSpanResizer < Byte >.Default; @@ -62,7 +62,7 @@ public final class RecordIOFormatter { //ORIGINAL LINE: private static Result FormatObject(ISpanResizer resizer, int initialCapacity, Layout // layout, T obj, RowWriter.WriterFunc writer, out RowBuffer row) private static Result FormatObject(ISpanResizer resizer, int initialCapacity, Layout layout, T obj, - RowWriter.WriterFunc writer, OutObject row) { + RowWriter.WriterFunc writer, Out row) { row.set(new RowBuffer(initialCapacity, resizer)); row.get().InitLayout(HybridRowVersion.V1, layout, SystemSchema.LayoutResolver); Result r = RowWriter.WriteBuffer(row.clone(), obj, writer); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOParser.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOParser.java index c4ca04f..3e0a99e 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOParser.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOParser.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.recordio; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowHeader; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -47,9 +48,9 @@ public final class RecordIOParser { * recommended that Process not be called again until at least this number of bytes are available. * @param consumed The number of bytes consumed from the input buffer. This number may be less * than the total buffer size if the parser moved to a new state. - * @return if no error + * @return {@link azure.data.cosmos.serialization.hybridrow.Result.Success} if no error * has occurred, otherwise a valid - * of the last error encountered + * {@link azure.data.cosmos.serialization.hybridrow.Result} of the last error encountered * during parsing. *

* > @@ -57,9 +58,9 @@ public final class RecordIOParser { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public Result Process(Memory buffer, out ProductionType type, out Memory record, out // int need, out int consumed) - public Result Process(Memory buffer, OutObject type, - OutObject> record, OutObject need, - OutObject consumed) { + public Result Process(Memory buffer, Out type, + Out> record, Out need, + Out consumed) { Result r = Result.Failure; //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Memory b = buffer; @@ -82,17 +83,17 @@ public final class RecordIOParser { //ORIGINAL LINE: Span span = b.Span.Slice(0, minimalSegmentRowSize); Span span = b.Span.Slice(0, minimalSegmentRowSize); RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_reader = - new RefObject(reader); - OutObject tempOut_segment = - new OutObject(); - r = SegmentSerializer.Read(tempRef_reader, tempOut_segment); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_reader = + new Reference(reader); + Out tempOut_segment = + new Out(); + r = SegmentSerializer.Read(tempReference_reader, tempOut_segment); this.segment = tempOut_segment.get(); - reader = tempRef_reader.get(); + reader = tempReference_reader.get(); if (r != Result.Success) { break; } @@ -113,17 +114,17 @@ public final class RecordIOParser { //ORIGINAL LINE: Span span = b.Span.Slice(0, this.segment.Length); Span span = b.Span.Slice(0, this.segment.Length); RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver); - RefObject tempRef_row2 = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_reader2 = - new RefObject(reader); - OutObject tempOut_segment2 - = new OutObject(); - r = SegmentSerializer.Read(tempRef_reader2, tempOut_segment2); + Reference tempReference_row2 = + new Reference(row); + RowReader reader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_reader2 = + new Reference(reader); + Out tempOut_segment2 + = new Out(); + r = SegmentSerializer.Read(tempReference_reader2, tempOut_segment2); this.segment = tempOut_segment2.get(); - reader = tempRef_reader2.get(); + reader = tempReference_reader2.get(); if (r != Result.Success) { break; } @@ -146,7 +147,7 @@ public final class RecordIOParser { HybridRowHeader header; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: MemoryMarshal.TryRead(b.Span, out header); if (header.Version != HybridRowVersion.V1) { @@ -182,15 +183,15 @@ public final class RecordIOParser { //ORIGINAL LINE: Span span = b.Span.Slice(0, minimalRecordRowSize); Span span = b.Span.Slice(0, minimalRecordRowSize); RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, SystemSchema.LayoutResolver); - RefObject tempRef_row3 = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row3); - row = tempRef_row3.get(); - RefObject tempRef_reader3 = new RefObject(reader); - OutObject tempOut_record = new OutObject(); - r = RecordSerializer.Read(tempRef_reader3, tempOut_record); + Reference tempReference_row3 = + new Reference(row); + RowReader reader = new RowReader(tempReference_row3); + row = tempReference_row3.get(); + Reference tempReference_reader3 = new Reference(reader); + Out tempOut_record = new Out(); + r = RecordSerializer.Read(tempReference_reader3, tempOut_record); this.record = tempOut_record.get(); - reader = tempRef_reader3.get(); + reader = tempReference_reader3.get(); if (r != Result.Success) { break; } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOStream.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOStream.java index f0866bd..b990d74 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOStream.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordIOStream.java @@ -4,7 +4,7 @@ package com.azure.data.cosmos.serialization.hybridrow.recordio; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -33,7 +33,7 @@ public final class RecordIOStream { * @param stm The stream to read from. * @param visitRecord A (required) delegate that is called once for each record. *

- * is passed a of the byte sequence + * is passed a {@link Memory{T}} of the byte sequence * of the * record body's row buffer. *

@@ -45,7 +45,7 @@ public final class RecordIOStream { * over. *

*

- * is passed a of the byte sequence of + * is passed a {@link Memory{T}} of the byte sequence of * the segment header's row buffer. *

*

If returns an error then the sequence is aborted.

@@ -109,12 +109,12 @@ public final class RecordIOStream { while (avail.Length > 0) { // Loop around processing available data until we don't have anymore RecordIOParser.ProductionType prodType; - OutObject tempOut_prodType = new OutObject(); + Out tempOut_prodType = new Out(); Memory record; - OutObject> tempOut_record = new OutObject>(); - OutObject tempOut_need = new OutObject(); + Out> tempOut_record = new Out>(); + Out tempOut_need = new Out(); int consumed; - OutObject tempOut_consumed = new OutObject(); + Out tempOut_consumed = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = parser.Process(avail, out RecordIOParser.ProductionType prodType, out // Memory record, out need, out int consumed); @@ -207,7 +207,7 @@ public final class RecordIOStream { segment.clone(), index -> { ReadOnlyMemory buffer; - OutObject> tempOut_buffer = new OutObject>(); + Out> tempOut_buffer = new Out>(); buffer = tempOut_buffer.get(); return new ValueTask<(Result, ReadOnlyMemory < Byte >) > ((r,buffer)) }, resizer); @@ -250,7 +250,7 @@ public final class RecordIOStream { // Write a RecordIO stream. Memory metadata; - OutObject> tempOut_metadata = new OutObject>(); + Out> tempOut_metadata = new Out>(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: Result r = RecordIOStream.FormatSegment(segment, resizer, out Memory metadata); Result r = RecordIOStream.FormatSegment(segment.clone(), resizer, tempOut_metadata); @@ -277,7 +277,7 @@ public final class RecordIOStream { break; } - OutObject> tempOut_metadata2 = new OutObject>(); + Out> tempOut_metadata2 = new Out>(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = RecordIOStream.FormatRow(body, resizer, out metadata); r = RecordIOStream.FormatRow(body, resizer, tempOut_metadata2); @@ -311,9 +311,9 @@ public final class RecordIOStream { */ //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: private static Result FormatRow(ReadOnlyMemory body, MemorySpanResizer resizer, out Memory block) - private static Result FormatRow(ReadOnlyMemory body, MemorySpanResizer resizer, OutObject> block) { + private static Result FormatRow(ReadOnlyMemory body, MemorySpanResizer resizer, Out> block) { RowBuffer row; - OutObject tempOut_row = new OutObject(); + Out tempOut_row = new Out(); Result r = RecordIOFormatter.FormatRecord(body, tempOut_row, resizer); row = tempOut_row.get(); if (r != Result.Success) { @@ -337,10 +337,10 @@ public final class RecordIOStream { //ORIGINAL LINE: private static Result FormatSegment(Segment segment, MemorySpanResizer resizer, out // Memory block) private static Result FormatSegment(Segment segment, MemorySpanResizer resizer, - OutObject> block) { + Out> block) { RowBuffer row; - OutObject tempOut_row = - new OutObject(); + Out tempOut_row = + new Out(); Result r = RecordIOFormatter.FormatSegment(segment.clone(), tempOut_row, resizer); row = tempOut_row.get(); if (r != Result.Success) { @@ -364,6 +364,6 @@ public final class RecordIOStream { */ @FunctionalInterface public interface ProduceFunc { - Result invoke(long index, OutObject> buffer); + Result invoke(long index, Out> buffer); } } \ No newline at end of file diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordSerializer.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordSerializer.java index c3f5ae4..663dd42 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordSerializer.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/RecordSerializer.java @@ -4,12 +4,13 @@ package com.azure.data.cosmos.serialization.hybridrow.recordio; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; public final class RecordSerializer { - public static Result Read(RefObject reader, OutObject obj) { + public static Result Read(Reference reader, Out obj) { obj.set(null); while (reader.get().Read()) { Result r; @@ -17,7 +18,7 @@ public final class RecordSerializer { // TODO: use Path tokens here. switch (reader.get().getPath().toString()) { case "length": - OutObject tempOut_Length = new OutObject(); + Out tempOut_Length = new Out(); r = reader.get().ReadInt32(tempOut_Length); obj.get().argValue.Length = tempOut_Length.get(); if (r != Result.Success) { @@ -26,7 +27,7 @@ public final class RecordSerializer { break; case "crc32": - OutObject tempOut_Crc32 = new OutObject(); + Out tempOut_Crc32 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadUInt32(out obj.Crc32); r = reader.get().ReadUInt32(tempOut_Crc32); @@ -42,7 +43,7 @@ public final class RecordSerializer { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, Record obj) { + public static Result Write(Reference writer, TypeArgument typeArg, Record obj) { Result r; r = writer.get().WriteInt32("length", obj.Length); if (r != Result.Success) { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/SegmentSerializer.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/SegmentSerializer.java index ec41de7..02fb0fc 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/SegmentSerializer.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/recordio/SegmentSerializer.java @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.recordio; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -14,20 +14,20 @@ import com.azure.data.cosmos.serialization.hybridrow.io.RowReader; public final class SegmentSerializer { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: public static Result Read(Span span, LayoutResolver resolver, out Segment obj) - public static Result Read(Span span, LayoutResolver resolver, OutObject obj) { + public static Result Read(Span span, LayoutResolver resolver, Out obj) { RowBuffer row = new RowBuffer(span, HybridRowVersion.V1, resolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_reader = - new RefObject(reader); - Result tempVar = SegmentSerializer.Read(tempRef_reader, obj.clone()); - reader = tempRef_reader.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_reader = + new Reference(reader); + Result tempVar = SegmentSerializer.Read(tempReference_reader, obj.clone()); + reader = tempReference_reader.get(); return tempVar; } - public static Result Read(RefObject reader, OutObject obj) { + public static Result Read(Reference reader, Out obj) { obj.set(null); while (reader.get().Read()) { Result r; @@ -35,7 +35,7 @@ public final class SegmentSerializer { // TODO: use Path tokens here. switch (reader.get().getPath().toString()) { case "length": - OutObject tempOut_Length = new OutObject(); + Out tempOut_Length = new Out(); r = reader.get().ReadInt32(tempOut_Length); obj.get().argValue.Length = tempOut_Length.get(); if (r != Result.Success) { @@ -50,7 +50,7 @@ public final class SegmentSerializer { break; case "comment": - OutObject tempOut_Comment = new OutObject(); + Out tempOut_Comment = new Out(); r = reader.get().ReadString(tempOut_Comment); obj.get().argValue.Comment = tempOut_Comment.get(); if (r != Result.Success) { @@ -59,7 +59,7 @@ public final class SegmentSerializer { break; case "sdl": - OutObject tempOut_SDL = new OutObject(); + Out tempOut_SDL = new Out(); r = reader.get().ReadString(tempOut_SDL); obj.get().argValue.SDL = tempOut_SDL.get(); if (r != Result.Success) { @@ -73,7 +73,7 @@ public final class SegmentSerializer { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, Segment obj) { + public static Result Write(Reference writer, TypeArgument typeArg, Segment obj) { Result r; if (obj.Comment != null) { r = writer.get().WriteString("comment", obj.Comment); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ArrayPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ArrayPropertyType.java index e876a4b..dd8d7d1 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ArrayPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ArrayPropertyType.java @@ -8,8 +8,8 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; * Array properties represent an unbounded set of zero or more items. *

* Arrays may be typed or untyped. Within typed arrays, all items MUST be the same type. The - * type of items is specified via . Typed arrays may be stored more efficiently - * than untyped arrays. When is unspecified, the array is untyped and its items + * type of items is specified via {@link Items}. Typed arrays may be stored more efficiently + * than untyped arrays. When {@link Items} is unspecified, the array is untyped and its items * may be heterogeneous. */ public class ArrayPropertyType extends ScopePropertyType { diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/MapPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/MapPropertyType.java index a091416..6ae4c78 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/MapPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/MapPropertyType.java @@ -10,10 +10,10 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; *

*

* Maps are typed or untyped. Within typed maps, all key MUST be the same type, and all - * values MUST be the same type. The type of both key and values is specified via - * and respectively. Typed maps may be stored more efficiently than untyped - * maps. When or is unspecified or marked - * , the map is untyped and its key and/or values may be heterogeneous. + * values MUST be the same type. The type of both key and values is specified via {@link Keys} + * and {@link Values} respectively. Typed maps may be stored more efficiently than untyped + * maps. When {@link Keys} or {@link Values} is unspecified or marked + * {@link TypeKind.Any}, the map is untyped and its key and/or values may be heterogeneous. */ public class MapPropertyType extends ScopePropertyType { /** diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Namespace.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Namespace.java index b9dd81a..5274567 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Namespace.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Namespace.java @@ -16,7 +16,7 @@ import java.util.ArrayList; //ORIGINAL LINE: [JsonObject] public class Namespace public class Namespace { /** - * The standard settings used by the JSON parser for interpreting + * The standard settings used by the JSON parser for interpreting {@link Namespace} * documents. */ private static final JsonSerializerSettings NamespaceParseSettings = new JsonSerializerSettings() { @@ -35,12 +35,12 @@ public class Namespace { //ORIGINAL LINE: [JsonProperty(PropertyName = "version")] public SchemaLanguageVersion Version {get;set;} private SchemaLanguageVersion Version = SchemaLanguageVersion.values()[0]; /** - * The set of schemas that make up the . + * The set of schemas that make up the {@link Namespace}. */ private ArrayList schemas; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link Namespace} class. */ public Namespace() { this.setSchemas(new ArrayList()); @@ -55,7 +55,7 @@ public class Namespace { } /** - * The set of schemas that make up the . + * The set of schemas that make up the {@link Namespace}. *

* Namespaces may consist of zero or more table schemas along with zero or more UDT schemas. * Table schemas can only reference UDT schemas defined in the same namespace. UDT schemas can diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ObjectPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ObjectPropertyType.java index 6130b75..fbb98ca 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ObjectPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/ObjectPropertyType.java @@ -12,7 +12,7 @@ import java.util.ArrayList; * Object properties map to multiple columns depending on the number of internal properties * within the defined object structure. Object properties are provided as a convince in schema * design. They are effectively equivalent to defining the same properties explicitly via - * with nested property paths. + * {@link PrimitivePropertyType} with nested property paths. */ public class ObjectPropertyType extends ScopePropertyType { /** @@ -21,7 +21,7 @@ public class ObjectPropertyType extends ScopePropertyType { private ArrayList properties; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link ObjectPropertyType} class. */ public ObjectPropertyType() { this.properties = new ArrayList(); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PartitionKey.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PartitionKey.java index 14c2d56..5a9c002 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PartitionKey.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PartitionKey.java @@ -10,7 +10,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; public class PartitionKey { /** * The logical path of the referenced property. - * Partition keys MUST refer to properties defined within the same . + * Partition keys MUST refer to properties defined within the same {@link Schema}. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;} diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PrimarySortKey.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PrimarySortKey.java index 29018a3..7536313 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PrimarySortKey.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PrimarySortKey.java @@ -11,7 +11,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; public class PrimarySortKey { /** * The logical path of the referenced property. - * Primary keys MUST refer to properties defined within the same . + * Primary keys MUST refer to properties defined within the same {@link Schema}. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [JsonProperty(PropertyName = "direction", Required = Required.DisallowNull)] public @@ -19,7 +19,7 @@ public class PrimarySortKey { private SortDirection Direction = SortDirection.values()[0]; /** * The logical path of the referenced property. - * Primary keys MUST refer to properties defined within the same . + * Primary keys MUST refer to properties defined within the same {@link Schema}. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;} diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PropertySchemaConverter.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PropertySchemaConverter.java index 609bf27..01b9e8c 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PropertySchemaConverter.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/PropertySchemaConverter.java @@ -9,7 +9,7 @@ import Newtonsoft.Json.Converters.*; import Newtonsoft.Json.Linq.*; /** - * Helper class for parsing the polymorphic subclasses from JSON. + * Helper class for parsing the polymorphic {@link PropertyType} subclasses from JSON. */ public class PropertySchemaConverter extends JsonConverter { @Override @@ -35,7 +35,7 @@ public class PropertySchemaConverter extends JsonConverter { JToken value; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (!propSchema.TryGetValue("type", out value)) { throw new JsonSerializationException("Required \"type\" property missing."); } diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Schema.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Schema.java index 8d95c4a..cd6cd74 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Schema.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/Schema.java @@ -55,7 +55,7 @@ public class Schema { //ORIGINAL LINE: [JsonProperty(PropertyName = "id", Required = Required.Always)] public SchemaId SchemaId {get;set;} private com.azure.data.cosmos.serialization.hybridrow.SchemaId SchemaId = new SchemaId(); /** - * The type of this schema. This value MUST be . + * The type of this schema. This value MUST be {@link TypeKind.Schema}. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [DefaultValue(TypeKind.Schema)][JsonProperty(PropertyName = "type", Required = Required @@ -86,7 +86,7 @@ public class Schema { private ArrayList staticKeys; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link Schema} class. */ public Schema() { this.setType(TypeKind.Schema); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaHash.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaHash.java index 455a6ae..1b7924d 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaHash.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaHash.java @@ -16,8 +16,8 @@ public final class SchemaHash { // default) // { // (ulong low, ulong high) hash = seed; - // hash = MurmurHash3.Hash128(schema.SchemaId, hash); - // hash = MurmurHash3.Hash128(schema.Type, hash); + // hash = Murmur3Hash.Hash128(schema.SchemaId, hash); + // hash = Murmur3Hash.Hash128(schema.Type, hash); // hash = SchemaHash.ComputeHash(ns, schema.Options, hash); // if (schema.PartitionKeys != null) // { @@ -59,12 +59,12 @@ public final class SchemaHash { // seed = default) // { // (ulong low, ulong high) hash = seed; - // hash = MurmurHash3.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash); - // hash = MurmurHash3.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false, + // hash = Murmur3Hash.Hash128(options == null ? null : options.DisallowUnschematized ?? false, hash); + // hash = Murmur3Hash.Hash128(options == null ? null : options.EnablePropertyLevelTimestamp ?? false, // hash); // if (options == null ? null : options.DisableSystemPrefix ?? false) // { - // hash = MurmurHash3.Hash128(true, hash); + // hash = Murmur3Hash.Hash128(true, hash); // } // // return hash; @@ -76,7 +76,7 @@ public final class SchemaHash { // { // Contract.Requires(p != null); // (ulong low, ulong high) hash = seed; - // hash = MurmurHash3.Hash128(p.Path, hash); + // hash = Murmur3Hash.Hash128(p.Path, hash); // hash = SchemaHash.ComputeHash(ns, p.PropertyType, hash); // return hash; // } @@ -87,21 +87,21 @@ public final class SchemaHash { // { // Contract.Requires(p != null); // (ulong low, ulong high) hash = seed; - // hash = MurmurHash3.Hash128(p.Type, hash); - // hash = MurmurHash3.Hash128(p.Nullable, hash); + // hash = Murmur3Hash.Hash128(p.Type, hash); + // hash = Murmur3Hash.Hash128(p.Nullable, hash); // if (p.ApiType != null) // { - // hash = MurmurHash3.Hash128(p.ApiType, hash); + // hash = Murmur3Hash.Hash128(p.ApiType, hash); // } // // switch (p) // { // case PrimitivePropertyType pp: - // hash = MurmurHash3.Hash128(pp.Storage, hash); - // hash = MurmurHash3.Hash128(pp.Length, hash); + // hash = Murmur3Hash.Hash128(pp.Storage, hash); + // hash = Murmur3Hash.Hash128(pp.Length, hash); // break; // case ScopePropertyType pp: - // hash = MurmurHash3.Hash128(pp.Immutable, hash); + // hash = Murmur3Hash.Hash128(pp.Immutable, hash); // switch (p) // { // case ArrayPropertyType spp: @@ -199,7 +199,7 @@ public final class SchemaHash { // (ulong low, ulong high) hash = seed; // if (key != null) // { - // hash = MurmurHash3.Hash128(key.Path, hash); + // hash = Murmur3Hash.Hash128(key.Path, hash); // } // // return hash; @@ -211,8 +211,8 @@ public final class SchemaHash { // (ulong low, ulong high) hash = seed; // if (key != null) // { - // hash = MurmurHash3.Hash128(key.Path, hash); - // hash = MurmurHash3.Hash128(key.Direction, hash); + // hash = Murmur3Hash.Hash128(key.Path, hash); + // hash = Murmur3Hash.Hash128(key.Direction, hash); // } // // return hash; @@ -224,7 +224,7 @@ public final class SchemaHash { // (ulong low, ulong high) hash = seed; // if (key != null) // { - // hash = MurmurHash3.Hash128(key.Path, hash); + // hash = Murmur3Hash.Hash128(key.Path, hash); // } // // return hash; diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaValidator.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaValidator.java index 623c6ce..4889fd5 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaValidator.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SchemaValidator.java @@ -165,7 +165,7 @@ HashMap ids /** * Visit an entire namespace and validate its constraints. * - * @param ns The to validate. + * @param ns The {@link Namespace} to validate. * @param schemas A map from schema names within the namespace to their schemas. * @param ids A map from schema ids within the namespace to their schemas. */ @@ -174,7 +174,7 @@ HashMap ids /** * Visit a single schema and validate its constraints. * - * @param s The to validate. + * @param s The {@link Schema} to validate. * @param schemas A map from schema names within the namespace to their schemas. * @param ids A map from schema ids within the namespace to their schemas. */ @@ -263,7 +263,7 @@ private static void Visit(PropertyType p, PropertyType parent, HashMap<(String, } /** - * Validate is a valid . + * Validate is a valid {@link SchemaId}. * * @param id The id to check. * @param label Diagnostic label describing . diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SetPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SetPropertyType.java index c53bca6..9a8a459 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SetPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/SetPropertyType.java @@ -8,8 +8,8 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; * Set properties represent an unbounded set of zero or more unique items. *

* Sets may be typed or untyped. Within typed sets, all items MUST be the same type. The - * type of items is specified via . Typed sets may be stored more efficiently - * than untyped sets. When is unspecified, the set is untyped and its items + * type of items is specified via {@link Items}. Typed sets may be stored more efficiently + * than untyped sets. When {@link Items} is unspecified, the set is untyped and its items * may be heterogeneous. *

* Each item within a set must be unique. Uniqueness is defined by the HybridRow encoded sequence diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StaticKey.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StaticKey.java index eebe1b5..79eb5db 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StaticKey.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StaticKey.java @@ -11,7 +11,7 @@ package com.azure.data.cosmos.serialization.hybridrow.schemas; public class StaticKey { /** * The logical path of the referenced property. - * Static path MUST refer to properties defined within the same . + * Static path MUST refer to properties defined within the same {@link Schema}. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [JsonProperty(PropertyName = "path", Required = Required.Always)] public string Path {get;set;} diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StorageKind.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StorageKind.java index 3b98261..e4dea36 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StorageKind.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/StorageKind.java @@ -13,9 +13,9 @@ public enum StorageKind { /** * The property defines a sparse column. *

- * Columns marked consume no space in the row when not present. When + * Columns marked {@link Sparse} consume no space in the row when not present. When * present they appear in an unordered linked list at the end of the row. Access time for - * columns is proportional to the number of columns in the + * {@link Sparse} columns is proportional to the number of {@link Sparse} columns in the * row. */ Sparse(0), @@ -35,9 +35,9 @@ public enum StorageKind { * present it will also consume a variable number of bytes to encode the length preceding the actual * value. *

- * When a long value is marked then a null-bit is reserved and - * the value is optionally encoded as if small enough to fit, otherwise the - * null-bit is set and the value is encoded as . + * When a long value is marked {@link Variable} then a null-bit is reserved and + * the value is optionally encoded as {@link Variable} if small enough to fit, otherwise the + * null-bit is set and the value is encoded as {@link Sparse}. *

*/ Variable(2); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TaggedPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TaggedPropertyType.java index 80767fc..3e86a2f 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TaggedPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TaggedPropertyType.java @@ -10,7 +10,7 @@ import java.util.ArrayList; * Tagged properties pair one or more typed values with an API-specific uint8 type code. *

* The uint8 type code is implicitly in position 0 within the resulting tagged and should not - * be specified in . + * be specified in {@link Items}. */ public class TaggedPropertyType extends ScopePropertyType { public static final int MaxTaggedArguments = 2; @@ -21,7 +21,7 @@ public class TaggedPropertyType extends ScopePropertyType { private ArrayList items; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link TaggedPropertyType} class. */ public TaggedPropertyType() { this.items = new ArrayList(); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TuplePropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TuplePropertyType.java index cca95a4..a2d6324 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TuplePropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TuplePropertyType.java @@ -16,7 +16,7 @@ public class TuplePropertyType extends ScopePropertyType { private ArrayList items; /** - * Initializes a new instance of the class. + * Initializes a new instance of the {@link TuplePropertyType} class. */ public TuplePropertyType() { this.items = new ArrayList(); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TypeKind.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TypeKind.java index 24a93dc..79b4df6 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TypeKind.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/TypeKind.java @@ -115,19 +115,19 @@ public enum TypeKind { Float128(15), /** - * 128-bit floating point value. See + * 128-bit floating point value. See {@link decimal} */ Decimal(16), /** - * 64-bit date/time value in 100ns increments from C# epoch. See + * 64-bit date/time value in 100ns increments from C# epoch. See {@link System.DateTime} */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [EnumMember(Value = "datetime")] DateTime, DateTime(17), /** - * 64-bit date/time value in milliseconds increments from Unix epoch. See + * 64-bit date/time value in milliseconds increments from Unix epoch. See {@link UnixDateTime} */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: //ORIGINAL LINE: [EnumMember(Value = "unixdatetime")] UnixDateTime, @@ -193,7 +193,7 @@ public enum TypeKind { /** * An untyped sparse field. - * May only be used to define the type within a nested scope (e.g. or . + * May only be used to define the type within a nested scope (e.g. {@link Object} or {@link Array}. */ Any(30); diff --git a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/UdtPropertyType.java b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/UdtPropertyType.java index 57be696..0f7f285 100644 --- a/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/UdtPropertyType.java +++ b/jre/src/main/java/com/azure/data/cosmos/serialization/hybridrow/schemas/UdtPropertyType.java @@ -17,7 +17,7 @@ public class UdtPropertyType extends ScopePropertyType { /** * The identifier of the UDT schema defining the structure for the nested row. *

- * The UDT schema MUST be defined within the same as the schema that + * The UDT schema MUST be defined within the same {@link Namespace} as the schema that * references it. */ // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -26,9 +26,9 @@ public class UdtPropertyType extends ScopePropertyType { /** * The unique identifier for a schema. *

- * Optional uniquifier if multiple versions of appears within the Namespace. + * Optional uniquifier if multiple versions of {@link Name} appears within the Namespace. *

- * If multiple versions of a UDT are defined within the then the globally + * If multiple versions of a UDT are defined within the {@link Namespace} then the globally * unique identifier of the specific version referenced MUST be provided. *

*/ diff --git a/jre/src/main/java/tangible/TryParseHelper.java b/jre/src/main/java/tangible/TryParseHelper.java index a95fa0d..9dff830 100644 --- a/jre/src/main/java/tangible/TryParseHelper.java +++ b/jre/src/main/java/tangible/TryParseHelper.java @@ -4,7 +4,7 @@ package tangible; -import com.azure.data.cosmos.core.OutObject; +import com.azure.data.cosmos.core.Out; //---------------------------------------------------------------------------------------- // Copyright © 2007 - 2019 Tangible Software Solutions, Inc. @@ -13,7 +13,7 @@ import com.azure.data.cosmos.core.OutObject; // This class is used to convert some of the C# TryParse methods to Java. //---------------------------------------------------------------------------------------- public final class TryParseHelper { - public static boolean tryParseBoolean(String s, OutObject result) { + public static boolean tryParseBoolean(String s, Out result) { try { result.set(Boolean.parseBoolean(s)); return true; @@ -22,7 +22,7 @@ public final class TryParseHelper { } } - public static boolean tryParseByte(String s, OutObject result) { + public static boolean tryParseByte(String s, Out result) { try { result.set(Byte.parseByte(s)); return true; @@ -31,7 +31,7 @@ public final class TryParseHelper { } } - public static boolean tryParseDouble(String s, OutObject result) { + public static boolean tryParseDouble(String s, Out result) { try { result.set(Double.parseDouble(s)); return true; @@ -40,7 +40,7 @@ public final class TryParseHelper { } } - public static boolean tryParseFloat(String s, OutObject result) { + public static boolean tryParseFloat(String s, Out result) { try { result.set(Float.parseFloat(s)); return true; @@ -49,7 +49,7 @@ public final class TryParseHelper { } } - public static boolean tryParseInt(String s, OutObject result) { + public static boolean tryParseInt(String s, Out result) { try { result.set(Integer.parseInt(s)); return true; @@ -58,7 +58,7 @@ public final class TryParseHelper { } } - public static boolean tryParseLong(String s, OutObject result) { + public static boolean tryParseLong(String s, Out result) { try { result.set(Long.parseLong(s)); return true; @@ -67,7 +67,7 @@ public final class TryParseHelper { } } - public static boolean tryParseShort(String s, OutObject result) { + public static boolean tryParseShort(String s, Out result) { try { result.set(Short.parseShort(s)); return true; diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BenchmarkSuiteBase.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BenchmarkSuiteBase.java index d5a238f..9762259 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BenchmarkSuiteBase.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/BenchmarkSuiteBase.java @@ -4,8 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -74,16 +74,16 @@ public class BenchmarkSuiteBase { // Dictionary rowValue) //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: protected static Result LoadOneRow(Memory buffer, LayoutResolver resolver, - OutObject> rowValue) { + Out> rowValue) { RowBuffer row = new RowBuffer(buffer.Span, HybridRowVersion.V1, resolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_reader = - new RefObject(reader); - Result tempVar = DiagnosticConverter.ReaderToDynamic(tempRef_reader, rowValue); - reader = tempRef_reader.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_reader = + new Reference(reader); + Result tempVar = DiagnosticConverter.ReaderToDynamic(tempReference_reader, rowValue); + reader = tempReference_reader.get(); return tempVar; } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenMicroBenchmarkSuite.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenMicroBenchmarkSuite.java index f6f9760..f89952f 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenMicroBenchmarkSuite.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/CodeGenMicroBenchmarkSuite.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import java.util.ArrayList; @@ -14,7 +15,7 @@ import java.util.HashMap; * Tests involving generated (early bound) code compiled from schema based on a partial implementation * of Cassandra Hotel Schema described here: https: //www.oreilly.com/ideas/cassandra-data-modeling . *

- * The tests here differ from in that they rely on + * The tests here differ from {@link SchematizedMicroBenchmarkSuite} in that they rely on * the schema being known at compile time instead of runtime. This allows code to be generated that * directly addresses the schema structure instead of dynamically discovering schema structure at * runtime. @@ -228,16 +229,17 @@ public final class CodeGenMicroBenchmarkSuite extends MicroBenchmarkSuiteBase { expectedSerialized.add(context.CodeGenWriter.ToArray()); } - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Read", dataSetName, "HybridRowGen", innerLoopIterations, ref context, (ref BenchmarkContext ctx, byte[] tableValue) => - MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Read", dataSetName, "HybridRowGen", innerLoopIterations, tempRef_context, (ref BenchmarkContext ctx, byte[] tableValue) -> + MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Read", dataSetName, "HybridRowGen", innerLoopIterations, + tempReference_context, (ref BenchmarkContext ctx, byte[] tableValue) -> { Result r = ctx.CodeGenWriter.ReadBuffer(tableValue); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, byte[] tableValue) -> tableValue.length, expectedSerialized); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void CodeGenWriteBenchmark(LayoutResolverNamespace resolver, String schemaName, String dataSetName @@ -247,18 +249,18 @@ public final class CodeGenMicroBenchmarkSuite extends MicroBenchmarkSuiteBase { BenchmarkContext context = new BenchmarkContext(); context.CodeGenWriter = new CodeGenRowGenerator(BenchmarkSuiteBase.InitialCapacity, layout, resolver); - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Write", dataSetName, "HybridRowGen", innerLoopIterations, - tempRef_context, (ref BenchmarkContext ctx, HashMap tableValue) -> + tempReference_context, (ref BenchmarkContext ctx, HashMap tableValue) -> { ctx.CodeGenWriter.Reset(); Result r = ctx.CodeGenWriter.WriteBuffer(tableValue); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, HashMap tableValue) -> ctx.CodeGenWriter.Length, expected); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void ProtobufReadBenchmark(String schemaName, String dataSetName, int innerLoopIterations, @@ -277,7 +279,7 @@ public final class CodeGenMicroBenchmarkSuite extends MicroBenchmarkSuiteBase { expectedSerialized.add(context.ProtobufWriter.ToArray()); } - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: @@ -286,10 +288,10 @@ public final class CodeGenMicroBenchmarkSuite extends MicroBenchmarkSuiteBase { // .ReadBuffer(tableValue), (ref BenchmarkContext ctx, byte[] tableValue) => tableValue.Length, // expectedSerialized); MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Read", dataSetName, "Protobuf", innerLoopIterations, - tempRef_context, + tempReference_context, (ref BenchmarkContext ctx, byte[] tableValue) -> ctx.ProtobufWriter.ReadBuffer(tableValue), (ref BenchmarkContext ctx, byte[] tableValue) -> tableValue.length, expectedSerialized); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void ProtobufWriteBenchmark(String schemaName, String dataSetName, int innerLoopIterations, @@ -297,14 +299,14 @@ public final class CodeGenMicroBenchmarkSuite extends MicroBenchmarkSuiteBase { BenchmarkContext context = new BenchmarkContext(); context.ProtobufWriter = new ProtobufRowGenerator(schemaName, BenchmarkSuiteBase.InitialCapacity); - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("CodeGen", "Write", dataSetName, "Protobuf", innerLoopIterations, - tempRef_context, (ref BenchmarkContext ctx, HashMap tableValue) -> + tempReference_context, (ref BenchmarkContext ctx, HashMap tableValue) -> { ctx.ProtobufWriter.WriteBuffer(tableValue); }, (ref BenchmarkContext ctx, HashMap tableValue) -> ctx.ProtobufWriter.Length, expected); - context = tempRef_context.get(); + context = tempReference_context.get(); } } \ No newline at end of file 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 a315244..7c0c2b7 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.ISpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -80,17 +81,17 @@ public final class CodeGenRowGenerator { //ORIGINAL LINE: public Result ReadBuffer(byte[] buffer) public Result ReadBuffer(byte[] buffer) { this.row = new RowBuffer(buffer.AsSpan(), HybridRowVersion.V1, this.row.getResolver()); - RefObject tempRef_row = - new RefObject(this.row); - RowCursor root = RowCursor.Create(tempRef_row); - this.row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(this.row); - RefObject tempRef_root = - new RefObject(root); - Result tempVar = this.dispatcher.ReadBuffer(tempRef_row2, tempRef_root); - root = tempRef_root.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row = + new Reference(this.row); + RowCursor root = RowCursor.Create(tempReference_row); + this.row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(this.row); + Reference tempReference_root = + new Reference(root); + Result tempVar = this.dispatcher.ReadBuffer(tempReference_row2, tempReference_root); + root = tempReference_root.get(); + this.row = tempReference_row2.get(); return tempVar; } @@ -106,17 +107,17 @@ public final class CodeGenRowGenerator { } public Result WriteBuffer(HashMap tableValue) { - RefObject tempRef_row = - new RefObject(this.row); - RowCursor root = RowCursor.Create(tempRef_row); - this.row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(this.row); - RefObject tempRef_root = - new RefObject(root); - Result tempVar = this.dispatcher.WriteBuffer(tempRef_row2, tempRef_root, tableValue); - root = tempRef_root.get(); - this.row = tempRef_row2.get(); + Reference tempReference_row = + new Reference(this.row); + RowCursor root = RowCursor.Create(tempReference_row); + this.row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(this.row); + Reference tempReference_root = + new Reference(root); + Result tempVar = this.dispatcher.WriteBuffer(tempReference_row2, tempReference_root, tableValue); + root = tempReference_root.get(); + this.row = tempReference_row2.get(); return tempVar; } @@ -142,42 +143,42 @@ public final class CodeGenRowGenerator { private LayoutColumn street; public AddressHybridRowSerializer(Layout layout, LayoutResolver resolver) { - OutObject tempOut_street = new OutObject(); + Out tempOut_street = new Out(); layout.TryFind(AddressHybridRowSerializer.StreetName, tempOut_street); this.street = tempOut_street.get(); - OutObject tempOut_city = new OutObject(); + Out tempOut_city = new Out(); layout.TryFind(AddressHybridRowSerializer.CityName, tempOut_city); this.city = tempOut_city.get(); - OutObject tempOut_state = new OutObject(); + Out tempOut_state = new Out(); layout.TryFind(AddressHybridRowSerializer.StateName, tempOut_state); this.state = tempOut_state.get(); - OutObject tempOut_postalCode = new OutObject(); + Out tempOut_postalCode = new Out(); layout.TryFind(AddressHybridRowSerializer.PostalCodeName, tempOut_postalCode); this.postalCode = tempOut_postalCode.get(); - OutObject tempOut_postalCodeToken = new OutObject(); + Out tempOut_postalCodeToken = new Out(); layout.getTokenizer().TryFindToken(this.postalCode.getPath(), tempOut_postalCodeToken); this.postalCodeToken = tempOut_postalCodeToken.get(); this.postalCodeSerializer = new PostalCodeHybridRowSerializer(resolver.Resolve(this.postalCode.getTypeArgs().getSchemaId().clone()), resolver); } @Override - public Result ReadBuffer(RefObject row, RefObject root) { + public Result ReadBuffer(Reference row, Reference root) { Utf8Span _; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = LayoutType.Utf8.ReadVariable(row, root, this.street, out _); if (r != Result.Success) { return r; } Utf8Span _; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: r = LayoutType.Utf8.ReadVariable(row, root, this.city, out _); if (r != Result.Success) { return r; } Utf8Span _; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: r = LayoutType.Utf8.ReadFixed(row, root, this.state, out _); if (r != Result.Success) { return r; @@ -185,28 +186,28 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.postalCodeToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = new OutObject(); + Out tempOut_childScope = new Out(); r = LayoutType.UDT.ReadScope(row, root, tempOut_childScope); childScope = tempOut_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope = new RefObject(childScope); - r = this.postalCodeSerializer.ReadBuffer(row, tempRef_childScope); - childScope = tempRef_childScope.get(); + Reference tempReference_childScope = new Reference(childScope); + r = this.postalCodeSerializer.ReadBuffer(row, tempReference_childScope); + childScope = tempReference_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope2 = new RefObject(childScope); - RowCursorExtensions.Skip(root.get().clone(), row, tempRef_childScope2); - childScope = tempRef_childScope2.get(); + Reference tempReference_childScope2 = new Reference(childScope); + RowCursorExtensions.Skip(root.get().clone(), row, tempReference_childScope2); + childScope = tempReference_childScope2.get(); return Result.Success; } @Override - public Result WriteBuffer(RefObject row, RefObject root, HashMap tableValue) { + public Result WriteBuffer(Reference row, Reference root, HashMap tableValue) { for ((Utf8String key,Object value) :tableValue) { Result r; @@ -253,7 +254,7 @@ public final class CodeGenRowGenerator { if (value != null) { root.get().Find(row, this.postalCodeToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = new OutObject(); + Out tempOut_childScope = new Out(); r = LayoutType.UDT.WriteScope(row, root, this.postalCode.getTypeArgs().clone(), tempOut_childScope); childScope = tempOut_childScope.get(); @@ -261,16 +262,16 @@ public final class CodeGenRowGenerator { return r; } - RefObject tempRef_childScope = new RefObject(childScope); - r = this.postalCodeSerializer.WriteBuffer(row, tempRef_childScope, (HashMap)value); - childScope = tempRef_childScope.get(); + Reference tempReference_childScope = new Reference(childScope); + r = this.postalCodeSerializer.WriteBuffer(row, tempReference_childScope, (HashMap)value); + childScope = tempReference_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope2 = new RefObject(childScope); - RowCursorExtensions.Skip(root.get().clone(), row, tempRef_childScope2); - childScope = tempRef_childScope2.get(); + Reference tempReference_childScope2 = new Reference(childScope); + RowCursorExtensions.Skip(root.get().clone(), row, tempReference_childScope2); + childScope = tempReference_childScope2.get(); } break; @@ -310,41 +311,41 @@ public final class CodeGenRowGenerator { private LayoutColumn title; public GuestsHybridRowSerializer(Layout layout, LayoutResolver resolver) { - OutObject tempOut_guestId = - new OutObject(); + Out tempOut_guestId = + new Out(); layout.TryFind(GuestsHybridRowSerializer.GuestIdName, tempOut_guestId); this.guestId = tempOut_guestId.get(); - OutObject tempOut_firstName = new OutObject(); + Out tempOut_firstName = new Out(); layout.TryFind(GuestsHybridRowSerializer.FirstNameName, tempOut_firstName); this.firstName = tempOut_firstName.get(); - OutObject tempOut_lastName - = new OutObject(); + Out tempOut_lastName + = new Out(); layout.TryFind(GuestsHybridRowSerializer.LastNameName, tempOut_lastName); this.lastName = tempOut_lastName.get(); - OutObject tempOut_title = - new OutObject(); + Out tempOut_title = + new Out(); layout.TryFind(GuestsHybridRowSerializer.TitleName, tempOut_title); this.title = tempOut_title.get(); - OutObject tempOut_emails = - new OutObject(); + Out tempOut_emails = + new Out(); layout.TryFind(GuestsHybridRowSerializer.EmailsName, tempOut_emails); this.emails = tempOut_emails.get(); - OutObject tempOut_phoneNumbers = new OutObject(); + Out tempOut_phoneNumbers = new Out(); layout.TryFind(GuestsHybridRowSerializer.PhoneNumbersName, tempOut_phoneNumbers); this.phoneNumbers = tempOut_phoneNumbers.get(); - OutObject tempOut_addresses = new OutObject(); + Out tempOut_addresses = new Out(); layout.TryFind(GuestsHybridRowSerializer.AddressesName, tempOut_addresses); this.addresses = tempOut_addresses.get(); - OutObject tempOut_confirmNumber = new OutObject(); + Out tempOut_confirmNumber = new Out(); layout.TryFind(GuestsHybridRowSerializer.ConfirmNumberName, tempOut_confirmNumber); this.confirmNumber = tempOut_confirmNumber.get(); - OutObject tempOut_emailsToken = new OutObject(); + Out tempOut_emailsToken = new Out(); layout.getTokenizer().TryFindToken(this.emails.getPath(), tempOut_emailsToken); this.emailsToken = tempOut_emailsToken.get(); - OutObject tempOut_phoneNumbersToken = new OutObject(); + Out tempOut_phoneNumbersToken = new Out(); layout.getTokenizer().TryFindToken(this.phoneNumbers.getPath(), tempOut_phoneNumbersToken); this.phoneNumbersToken = tempOut_phoneNumbersToken.get(); - OutObject tempOut_addressesToken = new OutObject(); + Out tempOut_addressesToken = new Out(); layout.getTokenizer().TryFindToken(this.addresses.getPath(), tempOut_addressesToken); this.addressesToken = tempOut_addressesToken.get(); @@ -354,15 +355,15 @@ public final class CodeGenRowGenerator { this.addressSerializer = new AddressHybridRowSerializer(resolver.Resolve(this.addresses.getTypeArgs().get(1).getTypeArgs().getSchemaId().clone()), resolver); - this.addressSerializerWriter = (RefObject b, RefObject scope, + this.addressSerializerWriter = (Reference b, Reference scope, HashMap context) -> addressSerializer.WriteBuffer(b, scope, context); } @Override - public Result ReadBuffer(RefObject row, RefObject root) { + public Result ReadBuffer(Reference row, Reference root) { java.util.UUID _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); Result r = LayoutType.Guid.ReadFixed(row, root, this.guestId, tempOut__); _ = tempOut__.get(); if (r != Result.Success) { @@ -371,7 +372,7 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: r = LayoutType.Utf8.ReadVariable(row, root, this.firstName, out _); if (r != Result.Success) { @@ -380,7 +381,7 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: r = LayoutType.Utf8.ReadVariable(row, root, this.lastName, out _); if (r != Result.Success) { @@ -389,7 +390,7 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: r = LayoutType.Utf8.ReadVariable(row, root, this.title, out _); if (r != Result.Success) { @@ -398,8 +399,8 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.emailsToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = - new OutObject(); + Out tempOut_childScope = + new Out(); r = LayoutType.TypedArray.ReadScope(row, root, tempOut_childScope); childScope = tempOut_childScope.get(); if (r != Result.Success) { @@ -409,10 +410,10 @@ public final class CodeGenRowGenerator { while (childScope.MoveNext(row)) { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: r = LayoutType.Utf8.ReadSparse(row, ref childScope, out _); if (r != Result.Success) { @@ -420,14 +421,14 @@ public final class CodeGenRowGenerator { } } - RefObject tempRef_childScope = - new RefObject(childScope); + Reference tempReference_childScope = + new Reference(childScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_childScope); - childScope = tempRef_childScope.get(); + tempReference_childScope); + childScope = tempReference_childScope.get(); root.get().Find(row, this.phoneNumbersToken.clone()); - OutObject tempOut_childScope2 = - new OutObject(); + Out tempOut_childScope2 = + new Out(); r = LayoutType.TypedArray.ReadScope(row, root, tempOut_childScope2); childScope = tempOut_childScope2.get(); if (r != Result.Success) { @@ -437,10 +438,10 @@ public final class CodeGenRowGenerator { while (childScope.MoveNext(row)) { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: r = LayoutType.Utf8.ReadSparse(row, ref childScope, out _); if (r != Result.Success) { @@ -448,14 +449,14 @@ public final class CodeGenRowGenerator { } } - RefObject tempRef_childScope2 = - new RefObject(childScope); + Reference tempReference_childScope2 = + new Reference(childScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_childScope2); - childScope = tempRef_childScope2.get(); + tempReference_childScope2); + childScope = tempReference_childScope2.get(); root.get().Find(row, this.addressesToken.clone()); - OutObject tempOut_childScope3 = - new OutObject(); + Out tempOut_childScope3 = + new Out(); r = LayoutType.TypedMap.ReadScope(row, root, tempOut_childScope3); childScope = tempOut_childScope3.get(); if (r != Result.Success) { @@ -463,14 +464,14 @@ public final class CodeGenRowGenerator { } while (childScope.MoveNext(row)) { - RefObject tempRef_childScope3 = - new RefObject(childScope); + Reference tempReference_childScope3 = + new Reference(childScope); RowCursor tupleScope; - OutObject tempOut_tupleScope = - new OutObject(); - r = LayoutType.TypedTuple.ReadScope(row, tempRef_childScope3, tempOut_tupleScope); + Out tempOut_tupleScope = + new Out(); + r = LayoutType.TypedTuple.ReadScope(row, tempReference_childScope3, tempOut_tupleScope); tupleScope = tempOut_tupleScope.get(); - childScope = tempRef_childScope3.get(); + childScope = tempReference_childScope3.get(); if (r != Result.Success) { return r; } @@ -481,10 +482,10 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: r = LayoutType.Utf8.ReadSparse(row, ref tupleScope, out _); if (r != Result.Success) { @@ -495,51 +496,51 @@ public final class CodeGenRowGenerator { return Result.InvalidRow; } - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); RowCursor valueScope; - OutObject tempOut_valueScope = - new OutObject(); - r = LayoutType.ImmutableUDT.ReadScope(row, tempRef_tupleScope, tempOut_valueScope); + Out tempOut_valueScope = + new Out(); + r = LayoutType.ImmutableUDT.ReadScope(row, tempReference_tupleScope, tempOut_valueScope); valueScope = tempOut_valueScope.get(); - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_valueScope = - new RefObject(valueScope); - r = this.addressSerializer.ReadBuffer(row, tempRef_valueScope); - valueScope = tempRef_valueScope.get(); + Reference tempReference_valueScope = + new Reference(valueScope); + r = this.addressSerializer.ReadBuffer(row, tempReference_valueScope); + valueScope = tempReference_valueScope.get(); if (r != Result.Success) { return r; } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: tupleScope.Skip(row, ref valueScope); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: childScope.Skip(row, ref tupleScope); } - RefObject tempRef_childScope4 = - new RefObject(childScope); + Reference tempReference_childScope4 = + new Reference(childScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_childScope4); - childScope = tempRef_childScope4.get(); + tempReference_childScope4); + childScope = tempReference_childScope4.get(); Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: return LayoutType.Utf8.ReadVariable(row, root, this.confirmNumber, out _); } @Override - public Result WriteBuffer(RefObject row, RefObject root, + public Result WriteBuffer(Reference row, Reference root, HashMap tableValue) { for ((Utf8String key,Object value) :tableValue) { @@ -610,9 +611,9 @@ public final class CodeGenRowGenerator { ArrayList context) -> { for (Object item : context) { - RefObjecttempRef_row2 = new RefObjecttempRef_row2 = new Reference (row2); - RefObjecttempRef_childScope = new RefObjecttempRef_childScope = new Reference (childScope); Result r2 = LayoutType.Utf8.WriteSparse(tempRef_row2, tempRef_childScope, (Utf8String)item); @@ -622,7 +623,7 @@ public final class CodeGenRowGenerator { return r2; } - RefObjecttempRef_row22 = new RefObjecttempRef_row22 = new Reference (row2); childScope.MoveNext(tempRef_row22); row2 = tempRef_row22.argValue; @@ -644,7 +645,7 @@ public final class CodeGenRowGenerator { if (value != null) { root.get().Find(row, this.phoneNumbersToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = new OutObject(); + Out tempOut_childScope = new Out(); r = LayoutType.TypedArray.WriteScope(row, root, this.phoneNumbers.getTypeArgs().clone(), tempOut_childScope); childScope = tempOut_childScope.get(); @@ -654,7 +655,7 @@ public final class CodeGenRowGenerator { for (Object item : (ArrayList)value) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved - // 'ref' keyword - these cannot be converted using the 'RefObject' helper class + // 'ref' keyword - these cannot be converted using the 'Ref' helper class // unless the method is within the code being modified: r = LayoutType.Utf8.WriteSparse(row, ref childScope, (Utf8String)item); if (r != Result.Success) { @@ -664,9 +665,9 @@ public final class CodeGenRowGenerator { childScope.MoveNext(row); } - RefObject tempRef_childScope = new RefObject(childScope); - RowCursorExtensions.Skip(root.get().clone(), row, tempRef_childScope); - childScope = tempRef_childScope.get(); + Reference tempReference_childScope = new Reference(childScope); + RowCursorExtensions.Skip(root.get().clone(), row, tempReference_childScope); + childScope = tempReference_childScope.get(); } break; @@ -685,16 +686,17 @@ public final class CodeGenRowGenerator { _this, ArrayList < Object > value)ctx) -> { for (Object item : ctx.value) { - RefObject tempRef_row2 = new RefObject(row2); - RefObject tempRef_childScope = new RefObject(childScope); - Result r2 = LayoutType.TypedTuple.WriteScope(tempRef_row2, tempRef_childScope, + Reference tempReference_row2 = new Reference(row2); + Reference tempReference_childScope = new Reference(childScope); + Result r2 = LayoutType.TypedTuple.WriteScope(tempReference_row2, + tempReference_childScope, ctx._this.addresses.TypeArgs, (ctx._this, (ArrayList)item), (ref RowBuffer row3, ref RowCursor tupleScope, (GuestsHybridRowSerializer _this, ArrayList < Object > value)ctx2) -> { - RefObjecttempRef_row3 = new RefObjecttempRef_row3 = new Reference (row3); - RefObjecttempRef_tupleScope = new RefObjecttempRef_tupleScope = new Reference (tupleScope); Result r3 = LayoutType.Utf8.WriteSparse(tempRef_row3, tempRef_tupleScope, (Utf8String)ctx2.value[0]); @@ -704,27 +706,27 @@ public final class CodeGenRowGenerator { return r3; } - RefObjecttempRef_row32 = new RefObjecttempRef_row32 = new Reference (row3); tupleScope.MoveNext(tempRef_row32); row3 = tempRef_row32.argValue; - RefObject tempRef_row33 = new RefObject(row3); - RefObject tempRef_tupleScope2 = new RefObject(tupleScope); - Result tempVar = LayoutType.ImmutableUDT.WriteScope(tempRef_row33, - tempRef_tupleScope2, ctx2._this.addresses.TypeArgs[1].TypeArgs, + Reference tempReference_row33 = new Reference(row3); + Reference tempReference_tupleScope2 = new Reference(tupleScope); + Result tempVar = LayoutType.ImmutableUDT.WriteScope(tempReference_row33, + tempReference_tupleScope2, ctx2._this.addresses.TypeArgs[1].TypeArgs, (HashMap)ctx2.value[1], ctx2._this.addressSerializerWriter); - tupleScope = tempRef_tupleScope2.get(); - row3 = tempRef_row33.get(); + tupleScope = tempReference_tupleScope2.get(); + row3 = tempReference_row33.get(); return tempVar; }) - childScope = tempRef_childScope.get(); - row2 = tempRef_row2.get(); + childScope = tempReference_childScope.get(); + row2 = tempReference_row2.get(); if (r2 != Result.Success) { return r2; } - RefObjecttempRef_row22 = new RefObjecttempRef_row22 = new Reference (row2); childScope.MoveNext(tempRef_row22); row2 = tempRef_row22.argValue; @@ -775,23 +777,23 @@ public final class CodeGenRowGenerator { private LayoutColumn phone; public HotelsHybridRowSerializer(Layout layout, LayoutResolver resolver) { - OutObject tempOut_hotelId = - new OutObject(); + Out tempOut_hotelId = + new Out(); layout.TryFind(HotelsHybridRowSerializer.HotelIdName, tempOut_hotelId); this.hotelId = tempOut_hotelId.get(); - OutObject tempOut_name = - new OutObject(); + Out tempOut_name = + new Out(); layout.TryFind(HotelsHybridRowSerializer.NameName, tempOut_name); this.name = tempOut_name.get(); - OutObject tempOut_phone = - new OutObject(); + Out tempOut_phone = + new Out(); layout.TryFind(HotelsHybridRowSerializer.PhoneName, tempOut_phone); this.phone = tempOut_phone.get(); - OutObject tempOut_address = - new OutObject(); + Out tempOut_address = + new Out(); layout.TryFind(HotelsHybridRowSerializer.AddressName, tempOut_address); this.address = tempOut_address.get(); - OutObject tempOut_addressToken = new OutObject(); + Out tempOut_addressToken = new Out(); layout.getTokenizer().TryFindToken(this.address.getPath(), tempOut_addressToken); this.addressToken = tempOut_addressToken.get(); this.addressSerializer = @@ -800,10 +802,10 @@ public final class CodeGenRowGenerator { } @Override - public Result ReadBuffer(RefObject row, RefObject root) { + public Result ReadBuffer(Reference row, Reference root) { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: Result r = LayoutType.Utf8.ReadFixed(row, root, this.hotelId, out _); if (r != Result.Success) { @@ -812,7 +814,7 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: r = LayoutType.Utf8.ReadVariable(row, root, this.name, out _); if (r != Result.Success) { @@ -821,7 +823,7 @@ public final class CodeGenRowGenerator { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: r = LayoutType.Utf8.ReadVariable(row, root, this.phone, out _); if (r != Result.Success) { @@ -830,32 +832,32 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.addressToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = - new OutObject(); + Out tempOut_childScope = + new Out(); r = LayoutType.UDT.ReadScope(row, root, tempOut_childScope); childScope = tempOut_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope = - new RefObject(childScope); - r = this.addressSerializer.ReadBuffer(row, tempRef_childScope); - childScope = tempRef_childScope.get(); + Reference tempReference_childScope = + new Reference(childScope); + r = this.addressSerializer.ReadBuffer(row, tempReference_childScope); + childScope = tempReference_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope2 = - new RefObject(childScope); + Reference tempReference_childScope2 = + new Reference(childScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_childScope2); - childScope = tempRef_childScope2.get(); + tempReference_childScope2); + childScope = tempReference_childScope2.get(); return Result.Success; } @Override - public Result WriteBuffer(RefObject row, RefObject root, + public Result WriteBuffer(Reference row, Reference root, HashMap tableValue) { for ((Utf8String key,Object value) :tableValue) { @@ -907,7 +909,7 @@ public final class CodeGenRowGenerator { if (value != null) { root.get().Find(row, this.addressToken.clone()); RowCursor childScope; - OutObject tempOut_childScope = new OutObject(); + Out tempOut_childScope = new Out(); r = LayoutType.UDT.WriteScope(row, root, this.address.getTypeArgs().clone(), tempOut_childScope); childScope = tempOut_childScope.get(); @@ -915,17 +917,17 @@ public final class CodeGenRowGenerator { return r; } - RefObject tempRef_childScope = new RefObject(childScope); - r = this.addressSerializer.WriteBuffer(row, tempRef_childScope, (HashMap tempReference_childScope = new Reference(childScope); + r = this.addressSerializer.WriteBuffer(row, tempReference_childScope, (HashMap)value); - childScope = tempRef_childScope.get(); + childScope = tempReference_childScope.get(); if (r != Result.Success) { return r; } - RefObject tempRef_childScope2 = new RefObject(childScope); - RowCursorExtensions.Skip(root.get().clone(), row, tempRef_childScope2); - childScope = tempRef_childScope2.get(); + Reference tempReference_childScope2 = new Reference(childScope); + RowCursorExtensions.Skip(root.get().clone(), row, tempReference_childScope2); + childScope = tempReference_childScope2.get(); } break; @@ -941,9 +943,9 @@ public final class CodeGenRowGenerator { } private abstract static class HybridRowSerializer { - public abstract Result ReadBuffer(RefObject row, RefObject root); + public abstract Result ReadBuffer(Reference row, Reference root); - public abstract Result WriteBuffer(RefObject row, RefObject root, + public abstract Result WriteBuffer(Reference row, Reference root, HashMap tableValue); } @@ -956,23 +958,23 @@ public final class CodeGenRowGenerator { // ReSharper disable once UnusedParameter.Local public PostalCodeHybridRowSerializer(Layout layout, LayoutResolver resolver) { - OutObject tempOut_zip = - new OutObject(); + Out tempOut_zip = + new Out(); layout.TryFind(PostalCodeHybridRowSerializer.ZipName, tempOut_zip); this.zip = tempOut_zip.get(); - OutObject tempOut_plus4 = - new OutObject(); + Out tempOut_plus4 = + new Out(); layout.TryFind(PostalCodeHybridRowSerializer.Plus4Name, tempOut_plus4); this.plus4 = tempOut_plus4.get(); - OutObject tempOut_plus4Token = new OutObject(); + Out tempOut_plus4Token = new Out(); layout.getTokenizer().TryFindToken(this.plus4.getPath(), tempOut_plus4Token); this.plus4Token = tempOut_plus4Token.get(); } @Override - public Result ReadBuffer(RefObject row, RefObject root) { + public Result ReadBuffer(Reference row, Reference root) { int _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); Result r = LayoutType.Int32.ReadFixed(row, root, this.zip, tempOut__); _ = tempOut__.get(); if (r != Result.Success) { @@ -981,14 +983,14 @@ public final class CodeGenRowGenerator { root.get().Find(row, this.plus4Token.clone()); short _; - OutObject tempOut__2 = new OutObject(); + Out tempOut__2 = new Out(); Result tempVar = LayoutType.Int16.ReadSparse(row, root, tempOut__2); _ = tempOut__2.get(); return tempVar; } @Override - public Result WriteBuffer(RefObject row, RefObject root, + public Result WriteBuffer(Reference row, Reference root, HashMap tableValue) { for ((Utf8String key,Object value) :tableValue) { @@ -1043,27 +1045,27 @@ public final class CodeGenRowGenerator { // ReSharper disable once UnusedParameter.Local public RoomsHybridRowSerializer(Layout layout, LayoutResolver resolver) { - OutObject tempOut_hotelId = - new OutObject(); + Out tempOut_hotelId = + new Out(); layout.TryFind(RoomsHybridRowSerializer.HotelIdName, tempOut_hotelId); this.hotelId = tempOut_hotelId.get(); - OutObject tempOut_date = - new OutObject(); + Out tempOut_date = + new Out(); layout.TryFind(RoomsHybridRowSerializer.DateName, tempOut_date); this.date = tempOut_date.get(); - OutObject tempOut_roomNumber = new OutObject(); + Out tempOut_roomNumber = new Out(); layout.TryFind(RoomsHybridRowSerializer.RoomNumberName, tempOut_roomNumber); this.roomNumber = tempOut_roomNumber.get(); - OutObject tempOut_isAvailable = new OutObject(); + Out tempOut_isAvailable = new Out(); layout.TryFind(RoomsHybridRowSerializer.IsAvailableName, tempOut_isAvailable); this.isAvailable = tempOut_isAvailable.get(); } @Override - public Result ReadBuffer(RefObject row, RefObject root) { + public Result ReadBuffer(Reference row, Reference root) { Utf8Span _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: Result r = LayoutType.Utf8.ReadFixed(row, root, this.hotelId, out _); if (r != Result.Success) { @@ -1071,7 +1073,7 @@ public final class CodeGenRowGenerator { } java.time.LocalDateTime _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); r = LayoutType.DateTime.ReadFixed(row, root, this.date, tempOut__); _ = tempOut__.get(); if (r != Result.Success) { @@ -1079,7 +1081,7 @@ public final class CodeGenRowGenerator { } byte _; - OutObject tempOut__2 = new OutObject(); + Out tempOut__2 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = LayoutType.UInt8.ReadFixed(ref row, ref root, this.roomNumber, out byte _); r = LayoutType.UInt8.ReadFixed(row, root, this.roomNumber, tempOut__2); @@ -1089,14 +1091,14 @@ public final class CodeGenRowGenerator { } boolean _; - OutObject tempOut__3 = new OutObject(); + Out tempOut__3 = new Out(); Result tempVar = LayoutType.Boolean.ReadFixed(row, root, this.isAvailable, tempOut__3); _ = tempOut__3.get(); return tempVar; } @Override - public Result WriteBuffer(RefObject row, RefObject root, + public Result WriteBuffer(Reference row, Reference root, HashMap tableValue) { for ((Utf8String key,Object value) :tableValue) { diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/JsonModelRowGenerator.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/JsonModelRowGenerator.java index 4101d48..2485fc9 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/JsonModelRowGenerator.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/JsonModelRowGenerator.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.ISpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -52,10 +53,10 @@ public final class JsonModelRowGenerator { } public RowReader GetReader() { - RefObject tempRef_row = new RefObject(this.row); + Reference tempReference_row = new Reference(this.row); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: return new RowReader(ref this.row) - this.row = tempRef_row.get(); + this.row = tempReference_row.get(); return tempVar; } @@ -77,25 +78,25 @@ public final class JsonModelRowGenerator { } public Result WriteBuffer(HashMap value) { - RefObject tempRef_row = - new RefObject(this.row); + Reference tempReference_row = + new Reference(this.row); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: - Result tempVar = RowWriter.WriteBuffer(tempRef_row, value, (ref RowWriter writer, TypeArgument typeArg, - HashMap dict) -> + Result tempVar = RowWriter.WriteBuffer(tempReference_row, value, (ref RowWriter writer, TypeArgument typeArg, + HashMap dict) -> { for ((Utf8String propPath,Object propValue) :dict) { - RefObject tempRef_writer = - new RefObject(writer); - Result result = JsonModelRowGenerator.JsonModelSwitch(tempRef_writer, propPath, propValue); - writer = tempRef_writer.get(); + Reference tempReference_writer = + new Reference(writer); + Result result = JsonModelRowGenerator.JsonModelSwitch(tempReference_writer, propPath, propValue); + writer = tempReference_writer.get(); return result; } return Result.Success; }); - this.row = tempRef_row.get(); + this.row = tempReference_row.get(); return tempVar; } @@ -111,7 +112,7 @@ public final class JsonModelRowGenerator { return varCopy; } - private static Result JsonModelSwitch(RefObject writer, Utf8String path, Object value) { + private static Result JsonModelSwitch(Reference writer, Utf8String path, Object value) { switch (value) { case null: return writer.get().WriteNull(path); @@ -161,9 +162,9 @@ public final class JsonModelRowGenerator { { for ((Utf8String propPath,Object propValue) :dict) { - RefObject tempRef_writer2 = new RefObject(writer2); - Result result = JsonModelRowGenerator.JsonModelSwitch(tempRef_writer2, propPath, propValue); - writer2 = tempRef_writer2.get(); + Reference tempReference_writer2 = new Reference(writer2); + Result result = JsonModelRowGenerator.JsonModelSwitch(tempReference_writer2, propPath, propValue); + writer2 = tempReference_writer2.get(); return result; } @@ -176,9 +177,9 @@ public final class JsonModelRowGenerator { return writer.get().WriteScope(path, new TypeArgument(LayoutType.Array), x, (ref RowWriter writer2, TypeArgument typeArg, ArrayList list) -> { for (Object elm : list) { - RefObject tempRef_writer2 = new RefObject(writer2); - Result result = JsonModelRowGenerator.JsonModelSwitch(tempRef_writer2, null, elm); - writer2 = tempRef_writer2.get(); + Reference tempReference_writer2 = new Reference(writer2); + Result result = JsonModelRowGenerator.JsonModelSwitch(tempReference_writer2, null, elm); + writer2 = tempReference_writer2.get(); if (result != Result.Success) { return result; } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/MicroBenchmarkSuiteBase.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/MicroBenchmarkSuiteBase.java index 683aef8..662e7bf 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/MicroBenchmarkSuiteBase.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/MicroBenchmarkSuiteBase.java @@ -5,7 +5,8 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; import JetBrains.Profiler.Api.*; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import java.util.ArrayList; @@ -27,7 +28,7 @@ public class MicroBenchmarkSuiteBase extends BenchmarkSuiteBase { // operation, string schema, string api, int innerLoopIterations, ref BenchmarkContext context, // BenchmarkBody loopBody, BenchmarkMeasure measure, List expected) protected static void Benchmark(String model, String operation, String schema, String api, - int innerLoopIterations, RefObject context, + int innerLoopIterations, Reference context, BenchmarkBody loopBody, BenchmarkMeasure measure, ArrayList expected) { Stopwatch sw = new Stopwatch(); @@ -83,7 +84,7 @@ public class MicroBenchmarkSuiteBase extends BenchmarkSuiteBase { //ORIGINAL LINE: [MethodImpl(MethodImplOptions.NoInlining)] private static void BenchmarkInnerLoop(int // innerLoopIterations, TValue tableValue, ref BenchmarkContext context, BenchmarkBody loopBody) private static void BenchmarkInnerLoop(int innerLoopIterations, TValue tableValue, - RefObject context, + Reference context, BenchmarkBody loopBody) { for (int innerLoop = 0; innerLoop < innerLoopIterations; innerLoop++) { loopBody.invoke(context, tableValue); @@ -92,12 +93,12 @@ public class MicroBenchmarkSuiteBase extends BenchmarkSuiteBase { @FunctionalInterface public interface BenchmarkBody { - void invoke(RefObject context, TValue value); + void invoke(Reference context, TValue value); } @FunctionalInterface public interface BenchmarkMeasure { - long invoke(RefObject context, TValue value); + long invoke(Reference context, TValue value); } //C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/ReaderBenchmark.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/ReaderBenchmark.java index 11eb463..2c4ee95 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/ReaderBenchmark.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/ReaderBenchmark.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -133,8 +134,8 @@ public final class ReaderBenchmark { }, segment -> { Segment _; - OutObject tempOut__ = - new OutObject(); + Out tempOut__ = + new Out(); r = SegmentSerializer.Read(segment.Span, context.getResolver(), tempOut__); _ = tempOut__.get(); assert Result.Success == r; @@ -150,10 +151,10 @@ public final class ReaderBenchmark { //ORIGINAL LINE: private static Result VisitOneRow(Memory buffer, LayoutResolver resolver) private static Result VisitOneRow(Memory buffer, LayoutResolver resolver) { RowBuffer row = new RowBuffer(buffer.Span, HybridRowVersion.V1, resolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); return RowReaderExtensions.VisitReader(reader.clone()); } @@ -304,7 +305,7 @@ public final class ReaderBenchmark { private void DoWork() { while (!this.cancel.IsCancellationRequested) { Task item; - OutObject tempOut_item = new OutObject(); + Out tempOut_item = new Out(); if (this.tasks.TryDequeue(tempOut_item)) { item = tempOut_item.get(); this.TryExecuteTask(item); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/RowReaderExtensions.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/RowReaderExtensions.java index a6687fe..c588522 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/RowReaderExtensions.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/RowReaderExtensions.java @@ -4,13 +4,14 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import static com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutCode.ImmutableTagged2Scope; public final class RowReaderExtensions { - public static Result VisitReader(RefObject reader) { + public static Result VisitReader(Reference reader) { while (reader.get().Read()) { Utf8Span path = reader.get().getPathSpan(); switch (reader.get().getType().LayoutCode) { diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/SchematizedMicroBenchmarkSuite.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/SchematizedMicroBenchmarkSuite.java index c48c329..4c6f638 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/SchematizedMicroBenchmarkSuite.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/SchematizedMicroBenchmarkSuite.java @@ -6,7 +6,8 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; import MongoDB.Bson.IO.*; import Newtonsoft.Json.*; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -408,14 +409,14 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas } BenchmarkContext ignoredContext = null; - RefObject tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "BSON", // innerLoopIterations, ref ignoredContext, (ref BenchmarkContext _, byte[] tableValue) => MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "BSON", innerLoopIterations, - tempRef_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> + tempReference_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> { try (MemoryStream stm = new MemoryStream(tableValue)) { try (BsonBinaryReader bsonReader = new BsonBinaryReader(stm)) { @@ -423,7 +424,7 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas } } }, (ref BenchmarkContext _, byte[] tableValue) -> tableValue.length, expectedSerialized); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } private static void BsonWriteBenchmark(LayoutResolverNamespace resolver, String schemaName, String dataSetName, @@ -433,16 +434,16 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas try (BsonRowGenerator writer = new BsonRowGenerator(BenchmarkSuiteBase.InitialCapacity, layout, resolver)) { BenchmarkContext ignoredContext = null; - RefObject tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are // not converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Write", dataSetName, "BSON", innerLoopIterations, - tempRef_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> + tempReference_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> { writer.Reset(); writer.WriteBuffer(tableValue); }, (ref BenchmarkContext _, HashMap tableValue) -> writer.getLength(), expected); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } } @@ -474,14 +475,14 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas BenchmarkContext ignoredContext = null; jsonSerializer.Converters.Add(new Utf8StringJsonConverter()); - RefObject tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "JSON", // innerLoopIterations, ref ignoredContext, (ref BenchmarkContext _, byte[] tableValue) => MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "JSON", innerLoopIterations, - tempRef_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> + tempReference_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> { try (MemoryStream jsonStream = new MemoryStream(tableValue)) { try (InputStreamReader textReader = new InputStreamReader(jsonStream)) { @@ -493,7 +494,7 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas } } }, (ref BenchmarkContext _, byte[] tableValue) -> tableValue.length, expectedSerialized); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } private static void JsonWriteBenchmark(String dataSetName, int innerLoopIterations, ArrayList tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - // these are not converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Write", dataSetName, "JSON", - innerLoopIterations, tempRef_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> { jsonStream.SetLength(0); jsonSerializer.Serialize(jsonWriter, tableValue); jsonWriter.Flush(); }, (ref BenchmarkContext _, HashMap value) -> jsonStream.Length, expected); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } } } @@ -544,20 +545,20 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas expectedSerialized.add((Byte)context.StreamingWriter.ToArray()); } - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "Layout", // innerLoopIterations, ref context, (ref BenchmarkContext ctx, byte[] tableValue) => MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "Layout", innerLoopIterations, - tempRef_context, (ref BenchmarkContext ctx, byte[] tableValue) -> + tempReference_context, (ref BenchmarkContext ctx, byte[] tableValue) -> { VisitRowGenerator visitor = new VisitRowGenerator(tableValue.AsSpan(), resolver); Result r = visitor.DispatchLayout(layout); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, byte[] tableValue) -> tableValue.length, expectedSerialized); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void LayoutWriteBenchmark(LayoutResolverNamespace resolver, String schemaName, String dataSetName, @@ -567,17 +568,17 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas BenchmarkContext context = new BenchmarkContext(); context.PatchWriter = new WriteRowGenerator(BenchmarkSuiteBase.InitialCapacity, layout, resolver); - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Write", dataSetName, "Layout", innerLoopIterations, - tempRef_context, (ref BenchmarkContext ctx, HashMap dict) -> + tempReference_context, (ref BenchmarkContext ctx, HashMap dict) -> { ctx.PatchWriter.Reset(); Result r = ctx.PatchWriter.DispatchLayout(layout, dict); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, HashMap _) -> ctx.PatchWriter.Length, expected); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void StreamingReadBenchmark(LayoutResolverNamespace resolver, String schemaName, String dataSetName, int innerLoopIterations, ArrayList> expected) { @@ -599,19 +600,20 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas expectedSerialized.add((Byte)context.StreamingWriter.ToArray()); } - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "HybridRow", innerLoopIterations, ref context, (ref BenchmarkContext ctx, byte[] tableValue) => - MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "HybridRow", innerLoopIterations, tempRef_context, (ref BenchmarkContext ctx, byte[] tableValue) -> + MicroBenchmarkSuiteBase.Benchmark("Schematized", "Read", dataSetName, "HybridRow", innerLoopIterations, + tempReference_context, (ref BenchmarkContext ctx, byte[] tableValue) -> { RowBuffer row = new RowBuffer(tableValue.AsSpan(), HybridRowVersion.V1, resolver); - RefObject tempRef_row = new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); RowReaderExtensions.VisitReader(reader.clone()); }, (ref BenchmarkContext ctx, byte[] tableValue) -> tableValue.length, expectedSerialized); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void StreamingWriteBenchmark(LayoutResolverNamespace resolver, String schemaName, @@ -622,17 +624,17 @@ public final class SchematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteBas BenchmarkContext context = new BenchmarkContext(); context.StreamingWriter = new StreamingRowGenerator(BenchmarkSuiteBase.InitialCapacity, layout, resolver); - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: MicroBenchmarkSuiteBase.Benchmark("Schematized", "Write", dataSetName, "HybridRow", innerLoopIterations, - tempRef_context, (ref BenchmarkContext ctx, HashMap tableValue) -> + tempReference_context, (ref BenchmarkContext ctx, HashMap tableValue) -> { ctx.StreamingWriter.Reset(); Result r = ctx.StreamingWriter.WriteBuffer(tableValue); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, HashMap _) -> ctx.StreamingWriter.Length, expected); - context = tempRef_context.get(); + context = tempReference_context.get(); } } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/UnschematizedMicroBenchmarkSuite.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/UnschematizedMicroBenchmarkSuite.java index 098d2de..d003332 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/UnschematizedMicroBenchmarkSuite.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/perf/UnschematizedMicroBenchmarkSuite.java @@ -6,7 +6,7 @@ package com.azure.data.cosmos.serialization.hybridrow.perf; import MongoDB.Bson.IO.*; import Newtonsoft.Json.*; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -165,11 +165,11 @@ public final class UnschematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteB } BenchmarkContext ignoredContext = null; - RefObject tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Unschematized", "Read", dataSetName, "BSON", innerLoopIterations, ref ignoredContext, (ref BenchmarkContext _, byte[] tableValue) => - Benchmark("Unschematized", "Read", dataSetName, "BSON", innerLoopIterations, tempRef_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> + Benchmark("Unschematized", "Read", dataSetName, "BSON", innerLoopIterations, tempReference_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> { try (MemoryStream stm = new MemoryStream(tableValue)) { try (BsonBinaryReader bsonReader = new BsonBinaryReader(stm)) { @@ -177,7 +177,7 @@ public final class UnschematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteB } } }, (ref BenchmarkContext _, byte[] tableValue) -> tableValue.length, expectedSerialized); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } private static void BsonWriteBenchmark(String dataSetName, int innerLoopIterations, ArrayList tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are // not converted by C# to Java Converter: Benchmark("Unschematized", "Write", dataSetName, "BSON", innerLoopIterations, - tempRef_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> + tempReference_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> { writer.Reset(); writer.WriteBuffer(tableValue); }, (ref BenchmarkContext _, HashMap tableValue) -> writer.getLength(), expected); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } } @@ -220,23 +220,23 @@ public final class UnschematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteB expectedSerialized.add(context.JsonModelWriter.ToArray()); } - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Unschematized", "Read", dataSetName, "HybridRowSparse", // innerLoopIterations, ref context, (ref BenchmarkContext ctx, byte[] tableValue) => Benchmark("Unschematized", "Read", dataSetName, "HybridRowSparse", - innerLoopIterations, tempRef_context, (ref BenchmarkContext ctx, byte[] tableValue) -> + innerLoopIterations, tempReference_context, (ref BenchmarkContext ctx, byte[] tableValue) -> { RowBuffer row = new RowBuffer(tableValue.AsSpan(), HybridRowVersion.V1, resolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); RowReaderExtensions.VisitReader(reader.clone()); }, (ref BenchmarkContext ctx, byte[] tableValue) -> tableValue.length, expectedSerialized); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void JsonModelWriteBenchmark(LayoutResolverNamespace resolver, String schemaName, @@ -247,18 +247,18 @@ public final class UnschematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteB BenchmarkContext context = new BenchmarkContext(); context.JsonModelWriter = new JsonModelRowGenerator(InitialCapacity, layout, resolver); - RefObject tempRef_context = new RefObject(context); + Reference tempReference_context = new Reference(context); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: Benchmark("Unschematized", "Write", dataSetName, "HybridRowSparse", - innerLoopIterations, tempRef_context, (ref BenchmarkContext ctx, HashMap tableValue) -> + innerLoopIterations, tempReference_context, (ref BenchmarkContext ctx, HashMap tableValue) -> { ctx.JsonModelWriter.Reset(); Result r = ctx.JsonModelWriter.WriteBuffer(tableValue); ResultAssert.IsSuccess(r); }, (ref BenchmarkContext ctx, HashMap tableValue) -> ctx.JsonModelWriter.Length, expected); - context = tempRef_context.get(); + context = tempReference_context.get(); } private static void JsonReadBenchmark(String dataSetName, int innerLoopIterations, ArrayList tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: MicroBenchmarkSuiteBase.Benchmark("Unschematized", "Read", dataSetName, "JSON", // innerLoopIterations, ref ignoredContext, (ref BenchmarkContext _, byte[] tableValue) => Benchmark("Unschematized", "Read", dataSetName, "JSON", innerLoopIterations, - tempRef_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> + tempReference_ignoredContext, (ref BenchmarkContext _, byte[] tableValue) -> { try (MemoryStream jsonStream = new MemoryStream(tableValue)) { try (InputStreamReader textReader = new InputStreamReader(jsonStream)) { @@ -308,7 +308,7 @@ public final class UnschematizedMicroBenchmarkSuite extends MicroBenchmarkSuiteB } } }, (ref BenchmarkContext _, byte[] tableValue) -> tableValue.length, expectedSerialized); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } private static void JsonWriteBenchmark(String dataSetName, int innerLoopIterations, ArrayList tempRef_ignoredContext = new RefObject(ignoredContext); + Reference tempReference_ignoredContext = new Reference(ignoredContext); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - // these are not converted by C# to Java Converter: Benchmark("Unschematized", "Write", dataSetName, "JSON", - innerLoopIterations, tempRef_ignoredContext, (ref BenchmarkContext _, HashMap tableValue) -> { jsonStream.SetLength(0); jsonSerializer.Serialize(jsonWriter, tableValue); jsonWriter.Flush(); }, (ref BenchmarkContext _, HashMap value) -> jsonStream.Length, expected); - ignoredContext = tempRef_ignoredContext.get(); + ignoredContext = tempReference_ignoredContext.get(); } } } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CrossVersioningUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CrossVersioningUnitTests.java index 5525df0..751ebb3 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CrossVersioningUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CrossVersioningUnitTests.java @@ -5,7 +5,8 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; import Newtonsoft.Json.*; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -578,7 +579,7 @@ public final class CrossVersioningUnitTests { this.Y = y; } - public void Dispatch(RefObject dispatcher, RefObject scope) { + public void Dispatch(Reference dispatcher, Reference scope) { dispatcher.get().LayoutCodeSwitch(scope, "x", value:this.X) dispatcher.get().LayoutCodeSwitch(scope, "y", value:this.Y) } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CustomerExampleUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CustomerExampleUnitTests.java index 42ec77f..5ff7c7d 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CustomerExampleUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/CustomerExampleUnitTests.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -67,115 +68,115 @@ public final class CustomerExampleUnitTests { tempVar.setPostalCode(tempVar2); g1.Addresses = new HashMap(Map.ofEntries(Map.entry("home", tempVar))); - RefObject tempRef_row = - new RefObject(row); - RowCursor rc1 = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(row); - RefObject tempRef_rc1 = - new RefObject(rc1); - this.WriteGuest(tempRef_row2, tempRef_rc1, g1); - rc1 = tempRef_rc1.get(); - row = tempRef_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); - RowCursor rc2 = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); - RefObject tempRef_rc2 = - new RefObject(rc2); - Guest g2 = this.ReadGuest(tempRef_row4, tempRef_rc2); - rc2 = tempRef_rc2.get(); - row = tempRef_row4.get(); + Reference tempReference_row = + new Reference(row); + RowCursor rc1 = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(row); + Reference tempReference_rc1 = + new Reference(rc1); + this.WriteGuest(tempReference_row2, tempReference_rc1, g1); + rc1 = tempReference_rc1.get(); + row = tempReference_row2.get(); + Reference tempReference_row3 = + new Reference(row); + RowCursor rc2 = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); + Reference tempReference_rc2 = + new Reference(rc2); + Guest g2 = this.ReadGuest(tempReference_row4, tempReference_rc2); + rc2 = tempReference_rc2.get(); + row = tempReference_row4.get(); assert g1 == g2; // Append an item to an existing list. - RefObject tempRef_row5 = - new RefObject(row); - RowCursor rc3 = RowCursor.Create(tempRef_row5); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_rc3 = - new RefObject(rc3); - int index = this.AppendGuestEmail(tempRef_row6, tempRef_rc3, "vice_president@whitehouse.gov"); - rc3 = tempRef_rc3.get(); - row = tempRef_row6.get(); + Reference tempReference_row5 = + new Reference(row); + RowCursor rc3 = RowCursor.Create(tempReference_row5); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_rc3 = + new Reference(rc3); + int index = this.AppendGuestEmail(tempReference_row6, tempReference_rc3, "vice_president@whitehouse.gov"); + rc3 = tempReference_rc3.get(); + row = tempReference_row6.get(); assert 1 == index; g1.Emails.add("vice_president@whitehouse.gov"); - RefObject tempRef_row7 = - new RefObject(row); - RowCursor rc4 = RowCursor.Create(tempRef_row7); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); - RefObject tempRef_rc4 = - new RefObject(rc4); - g2 = this.ReadGuest(tempRef_row8, tempRef_rc4); - rc4 = tempRef_rc4.get(); - row = tempRef_row8.get(); + Reference tempReference_row7 = + new Reference(row); + RowCursor rc4 = RowCursor.Create(tempReference_row7); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); + Reference tempReference_rc4 = + new Reference(rc4); + g2 = this.ReadGuest(tempReference_row8, tempReference_rc4); + rc4 = tempReference_rc4.get(); + row = tempReference_row8.get(); assert g1 == g2; // Prepend an item to an existing list. - RefObject tempRef_row9 = - new RefObject(row); - RowCursor rc5 = RowCursor.Create(tempRef_row9); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); - RefObject tempRef_rc5 = - new RefObject(rc5); - index = this.PrependGuestEmail(tempRef_row10, tempRef_rc5, "ex_president@whitehouse.gov"); - rc5 = tempRef_rc5.get(); - row = tempRef_row10.get(); + Reference tempReference_row9 = + new Reference(row); + RowCursor rc5 = RowCursor.Create(tempReference_row9); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); + Reference tempReference_rc5 = + new Reference(rc5); + index = this.PrependGuestEmail(tempReference_row10, tempReference_rc5, "ex_president@whitehouse.gov"); + rc5 = tempReference_rc5.get(); + row = tempReference_row10.get(); assert 0 == index; g1.Emails = new TreeSet { "ex_president@whitehouse.gov", "president@whitehouse.gov", "vice_president@whitehouse.gov" } - RefObject tempRef_row11 = - new RefObject(row); - RowCursor rc6 = RowCursor.Create(tempRef_row11); - row = tempRef_row11.get(); - RefObject tempRef_row12 = - new RefObject(row); - RefObject tempRef_rc6 = - new RefObject(rc6); - g2 = this.ReadGuest(tempRef_row12, tempRef_rc6); - rc6 = tempRef_rc6.get(); - row = tempRef_row12.get(); + Reference tempReference_row11 = + new Reference(row); + RowCursor rc6 = RowCursor.Create(tempReference_row11); + row = tempReference_row11.get(); + Reference tempReference_row12 = + new Reference(row); + Reference tempReference_rc6 = + new Reference(rc6); + g2 = this.ReadGuest(tempReference_row12, tempReference_rc6); + rc6 = tempReference_rc6.get(); + row = tempReference_row12.get(); assert g1 == g2; // InsertAt an item to an existing list. - RefObject tempRef_row13 = - new RefObject(row); - RowCursor rc7 = RowCursor.Create(tempRef_row13); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); - RefObject tempRef_rc7 = - new RefObject(rc7); - index = this.InsertAtGuestEmail(tempRef_row14, tempRef_rc7, 1, "future_president@whitehouse.gov"); - rc7 = tempRef_rc7.get(); - row = tempRef_row14.get(); + Reference tempReference_row13 = + new Reference(row); + RowCursor rc7 = RowCursor.Create(tempReference_row13); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); + Reference tempReference_rc7 = + new Reference(rc7); + index = this.InsertAtGuestEmail(tempReference_row14, tempReference_rc7, 1, "future_president@whitehouse.gov"); + rc7 = tempReference_rc7.get(); + row = tempReference_row14.get(); assert 1 == index; g1.Emails = new TreeSet { "ex_president@whitehouse.gov", "future_president@whitehouse.gov", "president@whitehouse.gov", "vice_president@whitehouse.gov" } - RefObject tempRef_row15 = - new RefObject(row); - RowCursor rc8 = RowCursor.Create(tempRef_row15); - row = tempRef_row15.get(); - RefObject tempRef_row16 = - new RefObject(row); - RefObject tempRef_rc8 = - new RefObject(rc8); - g2 = this.ReadGuest(tempRef_row16, tempRef_rc8); - rc8 = tempRef_rc8.get(); - row = tempRef_row16.get(); + Reference tempReference_row15 = + new Reference(row); + RowCursor rc8 = RowCursor.Create(tempReference_row15); + row = tempReference_row15.get(); + Reference tempReference_row16 = + new Reference(row); + Reference tempReference_rc8 = + new Reference(rc8); + g2 = this.ReadGuest(tempReference_row16, tempReference_rc8); + rc8 = tempReference_rc8.get(); + row = tempReference_row16.get(); assert g1 == g2; } @@ -186,29 +187,29 @@ public final class CustomerExampleUnitTests { row.InitLayout(HybridRowVersion.V1, this.hotelLayout, this.customerResolver); Hotel h1 = this.hotelExample; - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(row); - RefObject tempRef_root = - new RefObject(root); - this.WriteHotel(tempRef_row2, tempRef_root, h1); - root = tempRef_root.get(); - row = tempRef_row2.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(row); + Reference tempReference_root = + new Reference(root); + this.WriteHotel(tempReference_row2, tempReference_root, h1); + root = tempReference_root.get(); + row = tempReference_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); - root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); - RefObject tempRef_root2 = - new RefObject(root); - Hotel h2 = this.ReadHotel(tempRef_row4, tempRef_root2); - root = tempRef_root2.get(); - row = tempRef_row4.get(); + Reference tempReference_row3 = + new Reference(row); + root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); + Reference tempReference_root2 = + new Reference(root); + Hotel h2 = this.ReadHotel(tempReference_row4, tempReference_root2); + root = tempReference_root2.get(); + row = tempReference_row4.get(); assert h1 == h2; } @@ -220,31 +221,31 @@ public final class CustomerExampleUnitTests { row.InitLayout(HybridRowVersion.V1, this.hotelLayout, this.customerResolver); Hotel h1 = this.hotelExample; - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(row); - RefObject tempRef_root = - new RefObject(root); - this.WriteHotel(tempRef_row2, tempRef_root, h1); - root = tempRef_root.get(); - row = tempRef_row2.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(row); + Reference tempReference_root = + new Reference(root); + this.WriteHotel(tempReference_row2, tempReference_root, h1); + root = tempReference_root.get(); + row = tempReference_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); - root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); + Reference tempReference_row3 = + new Reference(row); + root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); Address tempVar = new Address(); tempVar.setStreet("300B Brownie Way"); - RefObject tempRef_row4 = - new RefObject(row); - RefObject tempRef_root2 = - new RefObject(root); - ResultAssert.InsufficientPermissions(this.PartialUpdateHotelAddress(tempRef_row4, tempRef_root2, tempVar)); - root = tempRef_root2.get(); - row = tempRef_row4.get(); + Reference tempReference_row4 = + new Reference(row); + Reference tempReference_root2 = + new Reference(root); + ResultAssert.InsufficientPermissions(this.PartialUpdateHotelAddress(tempReference_row4, tempReference_root2, tempVar)); + root = tempReference_root2.get(); + row = tempReference_row4.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -259,52 +260,52 @@ public final class CustomerExampleUnitTests { x -> x.Name.equals("Guests")).SchemaId); } - private int AppendGuestEmail(RefObject row, RefObject root, String email) { + private int AppendGuestEmail(Reference row, Reference root, String email) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("emails", out c); root.get().Find(row, c.Path); RowCursor emailScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().ReadScope(row, root, out emailScope)); assert !emailScope.MoveTo(row, Integer.MAX_VALUE); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref emailScope, email)); return emailScope.Index; } - private int InsertAtGuestEmail(RefObject row, RefObject root, int i, + private int InsertAtGuestEmail(Reference row, Reference root, int i, String email) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("emails", out c); root.get().Find(row, c.Path); RowCursor emailScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().ReadScope(row, root, out emailScope)); assert emailScope.MoveTo(row, i); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref emailScope, email, UpdateOptions.InsertAt)); return emailScope.Index; } - private Result PartialUpdateHotelAddress(RefObject row, RefObject root, + private Result PartialUpdateHotelAddress(Reference row, Reference root, Address a) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("address", out c); root.get().Find(row, c.Path); RowCursor addressScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = c.TypeAs().ReadScope(row, root, out addressScope); if (r != Result.Success) { return r; @@ -313,11 +314,11 @@ public final class CustomerExampleUnitTests { Layout addressLayout = addressScope.Layout; if (a.Street != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert addressLayout.TryFind("street", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = c.TypeAs().WriteVariable(row, ref addressScope, c, a.Street); if (r != Result.Success) { @@ -327,11 +328,11 @@ public final class CustomerExampleUnitTests { if (a.City != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert addressLayout.TryFind("city", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = c.TypeAs().WriteVariable(row, ref addressScope, c, a.City); if (r != Result.Success) { @@ -341,11 +342,11 @@ public final class CustomerExampleUnitTests { if (a.State != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert addressLayout.TryFind("state", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = c.TypeAs().WriteFixed(row, ref addressScope, c, a.State); if (r != Result.Success) { @@ -355,145 +356,145 @@ public final class CustomerExampleUnitTests { if (a.PostalCode != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert addressLayout.TryFind("postal_code", out c); addressScope.Find(row, c.Path); RowCursor postalCodeScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = c.TypeAs().WriteScope(row, ref addressScope, c.TypeArgs, out postalCodeScope); if (r != Result.Success) { return r; } - RefObject tempRef_postalCodeScope = - new RefObject(postalCodeScope); - this.WritePostalCode(row, tempRef_postalCodeScope, c.TypeArgs, a.PostalCode); - postalCodeScope = tempRef_postalCodeScope.get(); + Reference tempReference_postalCodeScope = + new Reference(postalCodeScope); + this.WritePostalCode(row, tempReference_postalCodeScope, c.TypeArgs, a.PostalCode); + postalCodeScope = tempReference_postalCodeScope.get(); } return Result.Success; } - private int PrependGuestEmail(RefObject row, RefObject root, String email) { + private int PrependGuestEmail(Reference row, Reference root, String email) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("emails", out c); root.get().Find(row, c.Path); RowCursor emailScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().ReadScope(row, root, out emailScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref emailScope, email, UpdateOptions.InsertAt)); return emailScope.Index; } - private static Address ReadAddress(RefObject row, RefObject addressScope) { + private static Address ReadAddress(Reference row, Reference addressScope) { Address a = new Address(); Layout addressLayout = addressScope.get().getLayout(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("street", out c); - OutObject tempOut_Street = new OutObject(); + Out tempOut_Street = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, addressScope, c, tempOut_Street)); a.Street = tempOut_Street.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("city", out c); - OutObject tempOut_City = new OutObject(); + Out tempOut_City = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, addressScope, c, tempOut_City)); a.City = tempOut_City.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("state", out c); - OutObject tempOut_State = new OutObject(); + Out tempOut_State = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, addressScope, c, tempOut_State)); a.State = tempOut_State.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("postal_code", out c); addressScope.get().Find(row, c.Path); RowCursor postalCodeScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().ReadScope(row, addressScope, out postalCodeScope)); - RefObject tempRef_postalCodeScope = - new RefObject(postalCodeScope); - a.PostalCode = CustomerExampleUnitTests.ReadPostalCode(row, tempRef_postalCodeScope); - postalCodeScope = tempRef_postalCodeScope.get(); - RefObject tempRef_postalCodeScope2 = - new RefObject(postalCodeScope); + Reference tempReference_postalCodeScope = + new Reference(postalCodeScope); + a.PostalCode = CustomerExampleUnitTests.ReadPostalCode(row, tempReference_postalCodeScope); + postalCodeScope = tempReference_postalCodeScope.get(); + Reference tempReference_postalCodeScope2 = + new Reference(postalCodeScope); RowCursorExtensions.Skip(addressScope.get().clone(), row, - tempRef_postalCodeScope2); - postalCodeScope = tempRef_postalCodeScope2.get(); + tempReference_postalCodeScope2); + postalCodeScope = tempReference_postalCodeScope2.get(); return a; } - private Guest ReadGuest(RefObject row, RefObject root) { + private Guest ReadGuest(Reference row, Reference root) { Guest g = new Guest(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("guest_id", out c); - OutObject tempOut_Id = new OutObject(); + Out tempOut_Id = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, root, c, tempOut_Id)); g.Id = tempOut_Id.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("first_name", out c); - OutObject tempOut_FirstName = new OutObject(); + Out tempOut_FirstName = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_FirstName)); g.FirstName = tempOut_FirstName.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("last_name", out c); - OutObject tempOut_LastName = new OutObject(); + Out tempOut_LastName = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_LastName)); g.LastName = tempOut_LastName.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("title", out c); - OutObject tempOut_Title = new OutObject(); + Out tempOut_Title = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Title)); g.Title = tempOut_Title.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("confirm_number", out c); - OutObject tempOut_ConfirmNumber = new OutObject(); + Out tempOut_ConfirmNumber = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_ConfirmNumber)); g.ConfirmNumber = tempOut_ConfirmNumber.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("emails", out c); RowCursor emailScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out emailScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref emailScope, out emailScope) == Result.Success) { g.Emails = new TreeSet(); while (emailScope.MoveNext(row)) { String item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref emailScope, out item)); @@ -502,25 +503,25 @@ public final class CustomerExampleUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("phone_numbers", out c); RowCursor phoneNumbersScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out phoneNumbersScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref phoneNumbersScope, out phoneNumbersScope) == Result.Success) { g.PhoneNumbers = new ArrayList(); while (phoneNumbersScope.MoveNext(row)) { String item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref phoneNumbersScope, out item)); @@ -529,121 +530,122 @@ public final class CustomerExampleUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("addresses", out c); RowCursor addressesScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out addressesScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' 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 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref addressesScope, out addressesScope) == Result.Success) { - RefObject tempRef_addressesScope = new RefObject(addressesScope); - TypeArgument tupleType = LayoutType.TypedMap.FieldType(tempRef_addressesScope).clone(); - addressesScope = tempRef_addressesScope.get(); + Reference tempReference_addressesScope = new Reference(addressesScope); + TypeArgument tupleType = LayoutType.TypedMap.FieldType(tempReference_addressesScope).clone(); + addressesScope = tempReference_addressesScope.get(); TypeArgument t0 = tupleType.getTypeArgs().get(0).clone(); TypeArgument t1 = tupleType.getTypeArgs().get(1).clone(); g.Addresses = new HashMap(); RowCursor pairScope = null; - RefObject tempRef_pairScope = new RefObject(pairScope); - while (addressesScope.MoveNext(row, tempRef_pairScope)) { - pairScope = tempRef_pairScope.get(); - RefObject tempRef_addressesScope2 = new RefObject(addressesScope); - OutObject tempOut_pairScope = new OutObject(); - ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, tempRef_addressesScope2, tempOut_pairScope)); + Reference tempReference_pairScope = new Reference(pairScope); + while (addressesScope.MoveNext(row, tempReference_pairScope)) { + pairScope = tempReference_pairScope.get(); + Reference tempReference_addressesScope2 = new Reference(addressesScope); + Out tempOut_pairScope = new Out(); + ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, + tempReference_addressesScope2, tempOut_pairScope)); pairScope = tempOut_pairScope.get(); - addressesScope = tempRef_addressesScope2.get(); + addressesScope = tempReference_addressesScope2.get(); assert RowCursorExtensions.MoveNext(pairScope.clone(), row); - RefObject tempRef_pairScope2 = new RefObject(pairScope); + Reference tempReference_pairScope2 = new Reference(pairScope); String key; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(t0.TypeAs().ReadSparse(row, tempRef_pairScope2, out key)); - pairScope = tempRef_pairScope2.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: + ResultAssert.IsSuccess(t0.TypeAs().ReadSparse(row, tempReference_pairScope2, out key)); + pairScope = tempReference_pairScope2.get(); assert RowCursorExtensions.MoveNext(pairScope.clone(), row); - RefObject tempRef_pairScope3 = new RefObject(pairScope); + Reference tempReference_pairScope3 = new Reference(pairScope); RowCursor addressScope; - OutObject tempOut_addressScope = new OutObject(); - ResultAssert.IsSuccess(t1.TypeAs().ReadScope(row, tempRef_pairScope3, tempOut_addressScope)); + Out tempOut_addressScope = new Out(); + ResultAssert.IsSuccess(t1.TypeAs().ReadScope(row, tempReference_pairScope3, tempOut_addressScope)); addressScope = tempOut_addressScope.get(); - pairScope = tempRef_pairScope3.get(); - RefObject tempRef_addressScope = new RefObject(addressScope); - Address value = CustomerExampleUnitTests.ReadAddress(row, tempRef_addressScope); - addressScope = tempRef_addressScope.get(); + pairScope = tempReference_pairScope3.get(); + Reference tempReference_addressScope = new Reference(addressScope); + Address value = CustomerExampleUnitTests.ReadAddress(row, tempReference_addressScope); + addressScope = tempReference_addressScope.get(); g.Addresses.put(key, value); - RefObject tempRef_addressScope2 = new RefObject(addressScope); - assert !RowCursorExtensions.MoveNext(pairScope.clone(), row, tempRef_addressScope2); - addressScope = tempRef_addressScope2.get(); + Reference tempReference_addressScope2 = new Reference(addressScope); + assert !RowCursorExtensions.MoveNext(pairScope.clone(), row, tempReference_addressScope2); + addressScope = tempReference_addressScope2.get(); } - pairScope = tempRef_pairScope.get(); + pairScope = tempReference_pairScope.get(); } return g; } - private Hotel ReadHotel(RefObject row, RefObject root) { + private Hotel ReadHotel(Reference row, Reference root) { Hotel h = new Hotel(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("hotel_id", out c); - OutObject tempOut_Id = new OutObject(); + Out tempOut_Id = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Id)); h.Id = tempOut_Id.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("name", out c); - OutObject tempOut_Name = new OutObject(); + Out tempOut_Name = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Name)); h.Name = tempOut_Name.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("phone", out c); - OutObject tempOut_Phone = new OutObject(); + Out tempOut_Phone = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Phone)); h.Phone = tempOut_Phone.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("address", out c); assert c.Type.Immutable; root.get().Find(row, c.Path); RowCursor addressScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().ReadScope(row, root, out addressScope)); assert addressScope.Immutable; - RefObject tempRef_addressScope = - new RefObject(addressScope); - h.Address = CustomerExampleUnitTests.ReadAddress(row, tempRef_addressScope); - addressScope = tempRef_addressScope.get(); - RefObject tempRef_addressScope2 = - new RefObject(addressScope); + Reference tempReference_addressScope = + new Reference(addressScope); + h.Address = CustomerExampleUnitTests.ReadAddress(row, tempReference_addressScope); + addressScope = tempReference_addressScope.get(); + Reference tempReference_addressScope2 = + new Reference(addressScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_addressScope2); - addressScope = tempRef_addressScope2.get(); + tempReference_addressScope2); + addressScope = tempReference_addressScope2.get(); return h; } - private static PostalCode ReadPostalCode(RefObject row, - RefObject postalCodeScope) { + private static PostalCode ReadPostalCode(Reference row, + Reference postalCodeScope) { Layout postalCodeLayout = postalCodeScope.get().getLayout(); PostalCode pc = new PostalCode(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert postalCodeLayout.TryFind("zip", out c); - OutObject tempOut_Zip = new OutObject(); + Out tempOut_Zip = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, postalCodeScope, c, tempOut_Zip)); pc.Zip = tempOut_Zip.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert postalCodeLayout.TryFind("plus4", out c); postalCodeScope.get().Find(row, c.Path); short plus4; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: if (c.TypeAs().ReadSparse(row, postalCodeScope, out plus4) == Result.Success) { pc.Plus4 = plus4; } @@ -651,132 +653,132 @@ public final class CustomerExampleUnitTests { return pc; } - private void WriteAddress(RefObject row, RefObject addressScope, + private void WriteAddress(Reference row, Reference addressScope, TypeArgumentList typeArgs, Address a) { Layout addressLayout = this.customerResolver.Resolve(typeArgs.getSchemaId().clone()); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("street", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, addressScope, c, a.Street)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("city", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, addressScope, c, a.City)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("state", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, addressScope, c, a.State)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert addressLayout.TryFind("postal_code", out c); addressScope.get().Find(row, c.Path); RowCursor postalCodeScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, addressScope, c.TypeArgs, out postalCodeScope)); - RefObject tempRef_postalCodeScope = - new RefObject(postalCodeScope); - this.WritePostalCode(row, tempRef_postalCodeScope, c.TypeArgs, a.PostalCode); - postalCodeScope = tempRef_postalCodeScope.get(); - RefObject tempRef_postalCodeScope2 = - new RefObject(postalCodeScope); + Reference tempReference_postalCodeScope = + new Reference(postalCodeScope); + this.WritePostalCode(row, tempReference_postalCodeScope, c.TypeArgs, a.PostalCode); + postalCodeScope = tempReference_postalCodeScope.get(); + Reference tempReference_postalCodeScope2 = + new Reference(postalCodeScope); RowCursorExtensions.Skip(addressScope.get().clone(), row, - tempRef_postalCodeScope2); - postalCodeScope = tempRef_postalCodeScope2.get(); + tempReference_postalCodeScope2); + postalCodeScope = tempReference_postalCodeScope2.get(); } - private void WriteGuest(RefObject row, RefObject root, Guest g) { + private void WriteGuest(Reference row, Reference root, Guest g) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("guest_id", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, root, c, g.Id)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("first_name", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, g.FirstName)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("last_name", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, g.LastName)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("title", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, g.Title)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.guestLayout.TryFind("confirm_number", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, g.ConfirmNumber)); if (g.Emails != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.guestLayout.TryFind("emails", out c); root.get().Find(row, c.Path); RowCursor emailScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, root, c.TypeArgs, out emailScope)); for (String email : g.Emails) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref emailScope, email)); assert !emailScope.MoveNext(row); } - RefObject tempRef_emailScope = - new RefObject(emailScope); + Reference tempReference_emailScope = + new Reference(emailScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_emailScope); - emailScope = tempRef_emailScope.get(); + tempReference_emailScope); + emailScope = tempReference_emailScope.get(); } if (g.PhoneNumbers != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.guestLayout.TryFind("phone_numbers", out c); root.get().Find(row, c.Path); RowCursor phoneNumbersScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, root, c.TypeArgs, out phoneNumbersScope)); for (String phone : g.PhoneNumbers) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref phoneNumbersScope , phone)); assert !phoneNumbersScope.MoveNext(row); } - RefObject tempRef_phoneNumbersScope = - new RefObject(phoneNumbersScope); + Reference tempReference_phoneNumbersScope = + new Reference(phoneNumbersScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_phoneNumbersScope); - phoneNumbersScope = tempRef_phoneNumbersScope.get(); + tempReference_phoneNumbersScope); + phoneNumbersScope = tempReference_phoneNumbersScope.get(); } if (g.Addresses != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.guestLayout.TryFind("addresses", out c); root.get().Find(row, c.Path); RowCursor addressesScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, root, c.TypeArgs, out addressesScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: TypeArgument tupleType = c.TypeAs().FieldType(ref addressesScope); TypeArgument t0 = tupleType.getTypeArgs().get(0).clone(); @@ -784,102 +786,102 @@ public final class CustomerExampleUnitTests { for (Map.Entry pair : g.Addresses.entrySet()) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(tupleType.TypeAs().WriteScope(row, ref tempCursor, c.TypeArgs, out tupleScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(t0.TypeAs().WriteSparse(row, ref tupleScope, pair.getKey())); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); RowCursor addressScope; - OutObject tempOut_addressScope = - new OutObject(); - ResultAssert.IsSuccess(t1.TypeAs().WriteScope(row, tempRef_tupleScope, + Out tempOut_addressScope = + new Out(); + ResultAssert.IsSuccess(t1.TypeAs().WriteScope(row, tempReference_tupleScope, t1.getTypeArgs().clone(), tempOut_addressScope)); addressScope = tempOut_addressScope.get(); - tupleScope = tempRef_tupleScope.get(); - RefObject tempRef_addressScope = - new RefObject(addressScope); - this.WriteAddress(row, tempRef_addressScope, t1.getTypeArgs().clone(), pair.getValue()); - addressScope = tempRef_addressScope.get(); + tupleScope = tempReference_tupleScope.get(); + Reference tempReference_addressScope = + new Reference(addressScope); + this.WriteAddress(row, tempReference_addressScope, t1.getTypeArgs().clone(), pair.getValue()); + addressScope = tempReference_addressScope.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !tupleScope.MoveNext(row, ref addressScope); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeAs().MoveField(row, ref addressesScope, ref tempCursor)); } - RefObject tempRef_addressesScope = - new RefObject(addressesScope); + Reference tempReference_addressesScope = + new Reference(addressesScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_addressesScope); - addressesScope = tempRef_addressesScope.get(); + tempReference_addressesScope); + addressesScope = tempReference_addressesScope.get(); } } - private void WriteHotel(RefObject row, RefObject root, Hotel h) { + private void WriteHotel(Reference row, Reference root, Hotel h) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("hotel_id", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, h.Id)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("name", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, h.Name)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("phone", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, h.Phone)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.hotelLayout.TryFind("address", out c); root.get().Find(row, c.Path); RowCursor addressScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, root, c.TypeArgs, out addressScope)); - RefObject tempRef_addressScope = - new RefObject(addressScope); - this.WriteAddress(row, tempRef_addressScope, c.TypeArgs, h.Address); - addressScope = tempRef_addressScope.get(); - RefObject tempRef_addressScope2 = - new RefObject(addressScope); + Reference tempReference_addressScope = + new Reference(addressScope); + this.WriteAddress(row, tempReference_addressScope, c.TypeArgs, h.Address); + addressScope = tempReference_addressScope.get(); + Reference tempReference_addressScope2 = + new Reference(addressScope); RowCursorExtensions.Skip(root.get().clone(), row, - tempRef_addressScope2); - addressScope = tempRef_addressScope2.get(); + tempReference_addressScope2); + addressScope = tempReference_addressScope2.get(); } - private void WritePostalCode(RefObject row, RefObject postalCodeScope, + private void WritePostalCode(Reference row, Reference postalCodeScope, TypeArgumentList typeArgs, PostalCode pc) { Layout postalCodeLayout = this.customerResolver.Resolve(typeArgs.getSchemaId().clone()); assert postalCodeLayout != null; LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert postalCodeLayout.TryFind("zip", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, postalCodeScope, c, pc.Zip)); if (pc.Plus4.HasValue) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert postalCodeLayout.TryFind("plus4", out c); postalCodeScope.get().Find(row, c.Path); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/DeleteRowDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/DeleteRowDispatcher.java index d078154..df71922 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/DeleteRowDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/DeleteRowDispatcher.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutIndexedScope; @@ -20,149 +21,149 @@ import java.util.List; //ORIGINAL LINE: internal struct DeleteRowDispatcher : IDispatcher public final class DeleteRowDispatcher implements IDispatcher { - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t) { + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t) { Dispatch(dispatcher, root, col, t, null); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public void Dispatch(ref RowOperationDispatcher dispatcher, ref RowCursor root, // LayoutColumn col, LayoutType t, TValue value = default) where TLayout : LayoutType - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t, TValue value) { - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteSparse(tempRef_Row, root)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t, TValue value) { + Reference tempReference_Row = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteSparse(tempReference_Row, root)); + dispatcher.get().argValue.Row = tempReference_Row.get(); } - public void DispatchArray(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchArray(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor arrayScope; - OutObject tempOut_arrayScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_arrayScope)); + Out tempOut_arrayScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_arrayScope)); arrayScope = tempOut_arrayScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); if (!arrayScope.Immutable) { List items = (List)value; for (Object item : items) { - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - assert arrayScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + assert arrayScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: dispatcher.get().LayoutCodeSwitch(ref arrayScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), item); } } - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row3, scope)); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row3, scope)); + dispatcher.get().argValue.Row = tempReference_Row3.get(); } - public void DispatchMap(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchMap(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor mapScope; - OutObject tempOut_mapScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_mapScope)); + Out tempOut_mapScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_mapScope)); mapScope = tempOut_mapScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); if (!mapScope.Immutable) { List items = (List)value; for (Object item : items) { - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - assert mapScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + assert mapScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: dispatcher.get().LayoutCodeSwitch(ref mapScope, null, LayoutType.TypedTuple, typeArgs.clone(), item); } } - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row3, scope)); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row3, scope)); + dispatcher.get().argValue.Row = tempReference_Row3.get(); } - public void DispatchNullable(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchNullable(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row, scope)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row, scope)); + dispatcher.get().argValue.Row = tempReference_Row.get(); } - public void DispatchObject(RefObject dispatcher, - RefObject scope) { + public void DispatchObject(Reference dispatcher, + Reference scope) { } - public void DispatchSet(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchSet(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor setScope; - OutObject tempOut_setScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_setScope)); + Out tempOut_setScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_setScope)); setScope = tempOut_setScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); if (!setScope.Immutable) { List items = (List)value; for (Object item : items) { - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - assert setScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + assert setScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: dispatcher.get().LayoutCodeSwitch(ref setScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), item); } } - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row3, scope)); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row3, scope)); + dispatcher.get().argValue.Row = tempReference_Row3.get(); } - public void DispatchTuple(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchTuple(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() >= 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row, scope)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row, scope)); + dispatcher.get().argValue.Row = tempReference_Row.get(); } - public void DispatchUDT(RefObject dispatcher, RefObject scope, LayoutType t, TypeArgumentList typeArgs, Object value) { - RefObject tempRef_Row = new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempRef_Row, scope)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + public void DispatchUDT(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { + Reference tempReference_Row = new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().DeleteScope(tempReference_Row, scope)); + dispatcher.get().argValue.Row = tempReference_Row.get(); } } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatchable.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatchable.java index a493f8a..de71fca 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatchable.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatchable.java @@ -4,9 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; public interface IDispatchable { - void Dispatch(RefObject dispatcher, RefObject scope); + void Dispatch(Reference dispatcher, Reference scope); } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatcher.java index 1dc81cc..6e222a8 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/IDispatcher.java @@ -4,39 +4,40 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; public interface IDispatcher { - , TValue> void Dispatch(RefObject dispatcher, - RefObject scope, LayoutColumn col, + , TValue> void Dispatch(Reference dispatcher, + Reference scope, LayoutColumn col, LayoutType t); //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: void Dispatch(ref RowOperationDispatcher dispatcher, ref RowCursor scope, // LayoutColumn col, LayoutType t, TValue value = default) where TLayout : LayoutType; - , TValue> void Dispatch(RefObject dispatcher, - RefObject scope, LayoutColumn col, + , TValue> void Dispatch(Reference dispatcher, + Reference scope, LayoutColumn col, LayoutType t, TValue value); - void DispatchArray(RefObject dispatcher, RefObject scope, + void DispatchArray(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value); - void DispatchMap(RefObject dispatcher, RefObject scope, + void DispatchMap(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value); - void DispatchNullable(RefObject dispatcher, RefObject scope, + void DispatchNullable(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value); - void DispatchObject(RefObject dispatcher, RefObject scope); + void DispatchObject(Reference dispatcher, Reference scope); - void DispatchSet(RefObject dispatcher, RefObject scope, + void DispatchSet(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value); - void DispatchTuple(RefObject dispatcher, RefObject scope, + void DispatchTuple(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value); - void DispatchUDT(RefObject dispatcher, RefObject scope, + void DispatchUDT(Reference dispatcher, Reference scope, LayoutType type, TypeArgumentList typeArgs, Object value); } \ No newline at end of file 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 dad6e31..9aa064d 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.NullValue; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -187,7 +188,7 @@ public class LayoutCompilerUnitTests { Assert.IsTrue(layout.toString().length()>0,"Json: {0}",expected.Json); LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out col); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Fixed,col.Storage,"Json: {0}",expected.Json); @@ -295,7 +296,7 @@ public final void ParseSchemaVariable() Layout layout=resolver.Resolve(new SchemaId(-1)); LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out col); Assert.IsTrue(found,"Json: {0}",expected.Json); assert col.Type.AllowVariable; @@ -496,7 +497,7 @@ public final void ParseSchemaSparseSimple() Assert.AreEqual(1,layout.getColumns().Length,"Json: {0}",expected.Json); LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out col); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,col.Storage,"Json: {0}",expected.Json); @@ -561,7 +562,7 @@ public final void ParseSchemaUDT() Layout layout=s.Compile(n1); LayoutColumn udtACol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("u",out udtACol); Assert.IsTrue(found,tag); Assert.AreEqual(StorageKind.Sparse,udtACol.Storage,tag); @@ -573,7 +574,7 @@ public final void ParseSchemaUDT() // Verify that UDT versioning works through schema references. LayoutColumn udtBCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=layout.TryFind("v",out udtBCol); Assert.IsTrue(found,tag); Assert.AreEqual(StorageKind.Sparse,udtBCol.Storage,tag); @@ -596,7 +597,7 @@ public final void ParseSchemaUDT() tangible.RefObjecttempRef_row2=new tangible.RefObject(row); RowCursor scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row,out scope).Find(tempRef_row2,udtACol.Path); row=tempRef_row2.argValue; row=tempRef_row.argValue; @@ -645,7 +646,7 @@ public final void ParseSchemaUDT() { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=udtLayout.TryFind(expected.Path,out col); Assert.IsTrue(found,"Path: {0}",expected.Path); StorageKind storage=expected.Storage; @@ -683,20 +684,20 @@ public final void ParseSchemaUDT() tangible.RefObjecttempRef_row9=new tangible.RefObject(row); RowCursor roRoot; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row8).AsReadOnly(out roRoot).Find(tempRef_row9,udtACol.Path); row=tempRef_row9.argValue; row=tempRef_row8.argValue; tangible.RefObjecttempRef_row10=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot - // be converted using the 'RefObject' helper class unless the method is within the code being modified: + // be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.InsufficientPermissions(udtACol.TypeAs().DeleteScope(tempRef_row10,ref roRoot)); row=tempRef_row10.argValue; tangible.RefObjecttempRef_row11=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // 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 'RefObject' helper class unless the method is within the code being modified: + // be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.InsufficientPermissions(udtACol.TypeAs().WriteScope(tempRef_row11,ref roRoot, udtACol.TypeArgs,out udtScope2)); row=tempRef_row11.argValue; @@ -705,7 +706,7 @@ public final void ParseSchemaUDT() tangible.RefObjecttempRef_row12=new tangible.RefObject(row); tangible.RefObjecttempRef_row13=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row12,out scope).Find(tempRef_row13,udtACol.Path); row=tempRef_row13.argValue; row=tempRef_row12.argValue; @@ -735,7 +736,7 @@ public final void ParseSchemaUDT() tangible.RefObjecttempRef_row17=new tangible.RefObject(row); tangible.RefObjecttempRef_row18=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row17,out scope).Find(tempRef_row18,udtACol.Path); row=tempRef_row18.argValue; row=tempRef_row17.argValue; @@ -757,7 +758,7 @@ public final void ParseSchemaUDT() tangible.RefObjecttempRef_row21=new tangible.RefObject(row); tangible.RefObjecttempRef_row22=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row21,out scope).Find(tempRef_row22,udtACol.Path); row=tempRef_row22.argValue; row=tempRef_row21.argValue; @@ -798,13 +799,13 @@ public final void ParseSchemaSparseObject() Assert.AreEqual(1,layout.getColumns().Length,"Json: {0}",expected.Json); LayoutColumn objCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out objCol); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,objCol.Storage,"Json: {0}",expected.Json); LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=layout.TryFind("a.b",out col); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,col.Storage,"Json: {0}",expected.Json); @@ -898,7 +899,7 @@ public final void ParseSchemaSparseObjectMulti() Assert.AreEqual(1,layout.getColumns().Length,"Json: {0}",expected.Json); LayoutColumn objCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out objCol); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,objCol.Storage,"Json: {0}",expected.Json); @@ -918,7 +919,7 @@ public final void ParseSchemaSparseObjectMulti() tangible.RefObjecttempRef_row2=new tangible.RefObject(row); RowCursor field; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: RowCursor.Create(tempRef_row,out field).Find(tempRef_row2,objCol.Path); row=tempRef_row2.argValue; row=tempRef_row.argValue; @@ -948,7 +949,7 @@ public final void ParseSchemaSparseObjectMulti() { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=layout.TryFind(prop.Path,out col); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,col.Storage,"Json: {0}",expected.Json); @@ -971,7 +972,7 @@ public final void ParseSchemaSparseObjectMulti() tangible.RefObjecttempRef_row6=new tangible.RefObject(row); RowCursor otherColumn; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: field.Clone(out otherColumn).Find(tempRef_row6,otherColumnPath); row=tempRef_row6.argValue; tangible.RefObjecttempRef_row7=new tangible.RefObject(row); @@ -1002,7 +1003,7 @@ public final void ParseSchemaSparseObjectMulti() // Read the thing after the scope and verify it is still there. tangible.RefObjecttempRef_row10=new tangible.RefObject(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: field.Clone(out otherColumn).Find(tempRef_row10,otherColumnPath); row=tempRef_row10.argValue; tangible.RefObjecttempRef_row11=new tangible.RefObject(row); @@ -1085,13 +1086,13 @@ public final void ParseSchemaSparseObjectNested() Layout layout=resolver.Resolve(new SchemaId(-1)); LayoutColumn objCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out objCol); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,objCol.Storage,"Json: {0}",expected.Json); LayoutColumn objCol2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=layout.TryFind("a.b",out objCol2); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,objCol2.Storage,"Json: {0}",expected.Json); @@ -1113,7 +1114,7 @@ public final void ParseSchemaSparseObjectNested() tangible.RefObjecttempRef_row2=new tangible.RefObject(row); RowCursor field; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: root.Clone(out field).Find(tempRef_row2,objCol.Path); row=tempRef_row2.argValue; tangible.RefObjecttempRef_row3=new tangible.RefObject(row); @@ -1132,7 +1133,7 @@ public final void ParseSchemaSparseObjectNested() { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: found=layout.TryFind(prop.Path,out col); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,col.Storage,"Json: {0}",expected.Json); @@ -1280,7 +1281,7 @@ public final void ParseSchemaSparseArray() Layout layout=resolver.Resolve(new SchemaId(-1)); LayoutColumn arrCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out arrCol); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,arrCol.Storage,"Json: {0}",expected.Json); @@ -1427,7 +1428,7 @@ public final void ParseSchemaSparseSet() Layout layout=resolver.Resolve(new SchemaId(-1)); LayoutColumn setCol; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: boolean found=layout.TryFind("a",out setCol); Assert.IsTrue(found,"Json: {0}",expected.Json); Assert.AreEqual(StorageKind.Sparse,setCol.Storage,"Json: {0}",expected.Json); @@ -1480,7 +1481,7 @@ private static RowCursor EnsureScope(tangible.RefObject row,tangible. assert pT!=null; RowCursor field; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot - // be converted using the 'OutObject' helper class unless the method is within the code being modified: + // be converted using the 'Out' helper class unless the method is within the code being modified: parentScope.Clone(out field).Find(row,col.getPath()); tangible.RefObjecttempRef_field=new tangible.RefObject(field); RowCursor scope; @@ -1599,7 +1600,7 @@ default: private final static class RoundTripFixed extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn col = closure.Col; Expected expected = closure.Expected.clone(); @@ -1610,12 +1611,12 @@ private final static class RoundTripFixed extends TestActionDispatcher tempOut_value = new OutObject(); + Out tempOut_value = new Out(); r = t.ReadFixed(row, root, col, tempOut_value); value = tempOut_value.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } else { - OutObject tempOut_value2 = new OutObject(); + Out tempOut_value2 = new Out(); r = t.ReadFixed(row, root, col, tempOut_value2); value = tempOut_value2.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -1630,7 +1631,7 @@ private final static class RoundTripFixed extends TestActionDispatcher tempOut_value3 = new OutObject(); + Out tempOut_value3 = new Out(); r = t.ReadFixed(row, root, col, tempOut_value3); value = tempOut_value3.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -1644,13 +1645,13 @@ private final static class RoundTripFixed extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn arrCol = closure.ArrCol; LayoutType tempVar = arrCol.getType(); @@ -1720,23 +1721,23 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempRef_field = - new RefObject(field); + Reference tempReference_field = + new Reference(field); RowCursor scope; - OutObject tempOut_scope = - new OutObject(); - Result r = arrT.ReadScope(row, tempRef_field, tempOut_scope); + Out tempOut_scope = + new Out(); + Result r = arrT.ReadScope(row, tempReference_field, tempOut_scope); scope = tempOut_scope.get(); - field = tempRef_field.get(); + field = tempReference_field.get(); ResultAssert.NotFound(r, tag); // Write the array. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = arrT.WriteScope(row, ref field, arrCol.getTypeArgs().clone(), out scope); ResultAssert.IsSuccess(r, tag); @@ -1744,21 +1745,21 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempRef_field2 = - new RefObject(field); + Reference tempReference_field2 = + new Reference(field); RowCursor scope2; - OutObject tempOut_scope2 = - new OutObject(); - r = arrT.ReadScope(row, tempRef_field2, tempOut_scope2); + Out tempOut_scope2 = + new Out(); + r = arrT.ReadScope(row, tempReference_field2, tempOut_scope2); scope2 = tempOut_scope2.get(); - field = tempRef_field2.get(); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, tag); Assert.AreEqual(scope.ScopeType, scope2.ScopeType, tag); Assert.AreEqual(scope.start, scope2.start, tag); @@ -1783,15 +1784,15 @@ private final static class RoundTripSparseArray extends TestActionDispatcher remainingValues = new ArrayList(expected.Value); remainingValues.remove(indexToDelete); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope2.Clone(out elm); for (Object item : remainingValues) { assert elm.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref elm, out value); ResultAssert.IsSuccess(r, tag); @@ -1838,66 +1839,66 @@ private final static class RoundTripSparseArray extends TestActionDispatcher tempRef_roRoot = - new RefObject(roRoot); - ResultAssert.InsufficientPermissions(arrT.DeleteScope(row, tempRef_roRoot)); - roRoot = tempRef_roRoot.get(); + Reference tempReference_roRoot = + new Reference(roRoot); + ResultAssert.InsufficientPermissions(arrT.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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.InsufficientPermissions(arrT.WriteScope(row, ref roRoot, arrCol.getTypeArgs().clone(), out scope2)); // Overwrite the whole scope. - RefObject tempRef_field3 = - new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field3, NullValue.Default); - field = tempRef_field3.get(); + Reference tempReference_field3 = + new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field3, NullValue.Default); + field = tempReference_field3.get(); ResultAssert.IsSuccess(r, tag); - RefObject tempRef_field4 = - new RefObject(field); + Reference tempReference_field4 = + new Reference(field); RowCursor _; - OutObject tempOut__ = - new OutObject(); - r = arrT.ReadScope(row, tempRef_field4, tempOut__); + Out tempOut__ = + new Out(); + r = arrT.ReadScope(row, tempReference_field4, tempOut__); _ = tempOut__.get(); - field = tempRef_field4.get(); + field = tempReference_field4.get(); ResultAssert.TypeMismatch(r, tag); - RefObject tempRef_field5 = - new RefObject(field); - r = arrT.DeleteScope(row, tempRef_field5); - field = tempRef_field5.get(); + Reference tempReference_field5 = + new Reference(field); + r = arrT.DeleteScope(row, tempReference_field5); + field = tempReference_field5.get(); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); // Overwrite it again, then delete it. RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = arrT.WriteScope(row, ref field, arrCol.getTypeArgs().clone(), out _, UpdateOptions.Update); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field6 = - new RefObject(field); - r = arrT.DeleteScope(row, tempRef_field6); - field = tempRef_field6.get(); + Reference tempReference_field6 = + new Reference(field); + r = arrT.DeleteScope(row, tempReference_field6); + field = tempReference_field6.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field7 = - new RefObject(field); + Reference tempReference_field7 = + new Reference(field); RowCursor _; - OutObject tempOut__2 = - new OutObject(); - r = arrT.ReadScope(row, tempRef_field7, tempOut__2); + Out tempOut__2 = + new Out(); + r = arrT.ReadScope(row, tempReference_field7, tempOut__2); _ = tempOut__2.get(); - field = tempRef_field7.get(); + field = tempReference_field7.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } @@ -1940,7 +1941,7 @@ private final static class RoundTripSparseArray extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn objCol = closure.ObjCol; LayoutType tempVar = objCol.getType(); @@ -1957,56 +1958,56 @@ private final static class RoundTripSparseObject extends TestActionDispatcher tempRef_field = - new RefObject(field); + Reference tempReference_field = + new Reference(field); RowCursor scope; - OutObject tempOut_scope = - new OutObject(); - Result r = objT.ReadScope(row, tempRef_field, tempOut_scope); + Out tempOut_scope = + new Out(); + Result r = objT.ReadScope(row, tempReference_field, tempOut_scope); scope = tempOut_scope.get(); - field = tempRef_field.get(); + field = tempReference_field.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); // Write the object and the nested column. - RefObject tempRef_field2 = - new RefObject(field); - OutObject tempOut_scope2 = - new OutObject(); - r = objT.WriteScope(row, tempRef_field2, objCol.getTypeArgs().clone(), tempOut_scope2); + Reference tempReference_field2 = + new Reference(field); + Out tempOut_scope2 = + new Out(); + r = objT.WriteScope(row, tempReference_field2, objCol.getTypeArgs().clone(), tempOut_scope2); scope = tempOut_scope2.get(); - field = tempRef_field2.get(); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope.Clone(out nestedField).Find(row, col.getPath()); TValue value; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref nestedField, out value); ResultAssert.NotFound(r, "Json: {0}", expected.Json); // Write the nested field. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.WriteSparse(row, ref nestedField, (TValue)expected.Value); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // Read the object and the nested column, validate the nested column has the proper value. - RefObject tempRef_field3 = - new RefObject(field); + Reference tempReference_field3 = + new Reference(field); RowCursor scope2; - OutObject tempOut_scope2 = - new OutObject(); - r = objT.ReadScope(row, tempRef_field3, tempOut_scope2); + Out tempOut_scope2 = + new Out(); + r = objT.ReadScope(row, tempReference_field3, tempOut_scope2); scope2 = tempOut_scope2.get(); - field = tempRef_field3.get(); + field = tempReference_field3.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); Assert.AreEqual(scope.ScopeType, scope2.ScopeType, "Json: {0}", expected.Json); Assert.AreEqual(scope.start, scope2.start, "Json: {0}", expected.Json); @@ -2014,12 +2015,12 @@ private final static class RoundTripSparseObject extends TestActionDispatcher tempRef_roRoot = - new RefObject(roRoot); - ResultAssert.InsufficientPermissions(objT.DeleteScope(row, tempRef_roRoot)); - roRoot = tempRef_roRoot.get(); - RefObject tempRef_roRoot2 = - new RefObject(roRoot); - OutObject tempOut_scope22 = - new OutObject(); - ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempRef_roRoot2, objCol.getTypeArgs().clone(), + Reference tempReference_roRoot = + new Reference(roRoot); + ResultAssert.InsufficientPermissions(objT.DeleteScope(row, tempReference_roRoot)); + roRoot = tempReference_roRoot.get(); + Reference tempReference_roRoot2 = + new Reference(roRoot); + Out tempOut_scope22 = + new Out(); + ResultAssert.InsufficientPermissions(objT.WriteScope(row, tempReference_roRoot2, objCol.getTypeArgs().clone(), tempOut_scope22)); scope2 = tempOut_scope22.get(); - roRoot = tempRef_roRoot2.get(); + roRoot = tempReference_roRoot2.get(); // Overwrite the whole scope. - RefObject tempRef_field4 = - new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field4, NullValue.Default); - field = tempRef_field4.get(); + Reference tempReference_field4 = + new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field4, NullValue.Default); + field = tempReference_field4.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field5 = - new RefObject(field); + Reference tempReference_field5 = + new Reference(field); RowCursor _; - OutObject tempOut__ = - new OutObject(); - r = objT.ReadScope(row, tempRef_field5, tempOut__); + Out tempOut__ = + new Out(); + r = objT.ReadScope(row, tempReference_field5, tempOut__); _ = tempOut__.get(); - field = tempRef_field5.get(); + field = tempReference_field5.get(); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); - RefObject tempRef_field6 = - new RefObject(field); - r = objT.DeleteScope(row, tempRef_field6); - field = tempRef_field6.get(); + Reference tempReference_field6 = + new Reference(field); + r = objT.DeleteScope(row, tempReference_field6); + field = tempReference_field6.get(); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); // Overwrite it again, then delete it. - RefObject tempRef_field7 = - new RefObject(field); + Reference tempReference_field7 = + new Reference(field); RowCursor _; - OutObject tempOut__2 = - new OutObject(); - r = objT.WriteScope(row, tempRef_field7, objCol.getTypeArgs().clone(), tempOut__2, UpdateOptions.Update); + Out tempOut__2 = + new Out(); + r = objT.WriteScope(row, tempReference_field7, objCol.getTypeArgs().clone(), tempOut__2, UpdateOptions.Update); _ = tempOut__2.get(); - field = tempRef_field7.get(); + field = tempReference_field7.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field8 = - new RefObject(field); - r = objT.DeleteScope(row, tempRef_field8); - field = tempRef_field8.get(); + Reference tempReference_field8 = + new Reference(field); + r = objT.DeleteScope(row, tempReference_field8); + field = tempReference_field8.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field9 = - new RefObject(field); + Reference tempReference_field9 = + new Reference(field); RowCursor _; - OutObject tempOut__3 = - new OutObject(); - r = objT.ReadScope(row, tempRef_field9, tempOut__3); + Out tempOut__3 = + new Out(); + r = objT.ReadScope(row, tempReference_field9, tempOut__3); _ = tempOut__3.get(); - field = tempRef_field9.get(); + field = tempReference_field9.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } @@ -2133,7 +2134,7 @@ private final static class RoundTripSparseObject extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject scope, + public void Dispatch(Reference row, Reference scope, Closure closure) { LayoutColumn col = closure.Col; Property prop = closure.Prop.clone(); @@ -2147,27 +2148,27 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch // 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope.get().Clone(out nestedField).Find(row, col.getPath()); TValue value; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: Result r = t.ReadSparse(row, ref nestedField, out value); Assert.IsTrue(r == Result.NotFound || r == Result.TypeMismatch, tag); // Write the nested field. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.WriteSparse(row, ref nestedField, (TValue)prop.Value); ResultAssert.IsSuccess(r, tag); // Read the nested field // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref nestedField, out value); ResultAssert.IsSuccess(r, tag); boolean tempVar = prop.Value instanceof Array; @@ -2180,30 +2181,30 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch // Overwrite the nested field. if (t instanceof LayoutNull) { - RefObject tempRef_nestedField = - new RefObject(nestedField); - r = LayoutType.Boolean.WriteSparse(row, tempRef_nestedField, false); - nestedField = tempRef_nestedField.get(); + Reference tempReference_nestedField = + new Reference(nestedField); + r = LayoutType.Boolean.WriteSparse(row, tempReference_nestedField, false); + nestedField = tempReference_nestedField.get(); ResultAssert.IsSuccess(r, tag); } else { - RefObject tempRef_nestedField2 = - new RefObject(nestedField); - r = LayoutType.Null.WriteSparse(row, tempRef_nestedField2, NullValue.Default); - nestedField = tempRef_nestedField2.get(); + Reference tempReference_nestedField2 = + new Reference(nestedField); + r = LayoutType.Null.WriteSparse(row, tempReference_nestedField2, NullValue.Default); + nestedField = tempReference_nestedField2.get(); ResultAssert.IsSuccess(r, tag); } // Verify nested field no longer there. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref nestedField, out value); ResultAssert.TypeMismatch(r, tag); } @Override - public void DispatchObject(RefObject row, RefObject scope, + public void DispatchObject(Reference row, Reference scope, Closure closure) { LayoutColumn col = closure.Col; Property prop = closure.Prop.clone(); @@ -2217,62 +2218,62 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch // 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope.get().Clone(out nestedField).Find(row, col.getPath()); - RefObject tempRef_nestedField = - new RefObject(nestedField); + Reference tempReference_nestedField = + new Reference(nestedField); RowCursor scope2; - OutObject tempOut_scope2 = - new OutObject(); - Result r = t.ReadScope(row, tempRef_nestedField, tempOut_scope2); + Out tempOut_scope2 = + new Out(); + Result r = t.ReadScope(row, tempReference_nestedField, tempOut_scope2); scope2 = tempOut_scope2.get(); - nestedField = tempRef_nestedField.get(); + nestedField = tempReference_nestedField.get(); ResultAssert.NotFound(r, tag); // Write the nested field. - RefObject tempRef_nestedField2 = - new RefObject(nestedField); - OutObject tempOut_scope22 = - new OutObject(); - r = t.WriteScope(row, tempRef_nestedField2, col.getTypeArgs().clone(), tempOut_scope22); + Reference tempReference_nestedField2 = + new Reference(nestedField); + Out tempOut_scope22 = + new Out(); + r = t.WriteScope(row, tempReference_nestedField2, col.getTypeArgs().clone(), tempOut_scope22); scope2 = tempOut_scope22.get(); - nestedField = tempRef_nestedField2.get(); + nestedField = tempReference_nestedField2.get(); ResultAssert.IsSuccess(r, tag); // Read the nested field - RefObject tempRef_nestedField3 = - new RefObject(nestedField); + Reference tempReference_nestedField3 = + new Reference(nestedField); RowCursor scope3; - OutObject tempOut_scope3 = - new OutObject(); - r = t.ReadScope(row, tempRef_nestedField3, tempOut_scope3); + Out tempOut_scope3 = + new Out(); + r = t.ReadScope(row, tempReference_nestedField3, tempOut_scope3); scope3 = tempOut_scope3.get(); - nestedField = tempRef_nestedField3.get(); + nestedField = tempReference_nestedField3.get(); ResultAssert.IsSuccess(r, tag); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Assert.AreEqual(scope2.AsReadOnly(out _).ScopeType, scope3.ScopeType, tag); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Assert.AreEqual(scope2.AsReadOnly(out _).start, scope3.start, tag); // Overwrite the nested field. - RefObject tempRef_nestedField4 = - new RefObject(nestedField); - r = LayoutType.Null.WriteSparse(row, tempRef_nestedField4, NullValue.Default); - nestedField = tempRef_nestedField4.get(); + Reference tempReference_nestedField4 = + new Reference(nestedField); + r = LayoutType.Null.WriteSparse(row, tempReference_nestedField4, NullValue.Default); + nestedField = tempReference_nestedField4.get(); ResultAssert.IsSuccess(r, tag); // Verify nested field no longer there. - RefObject tempRef_nestedField5 = - new RefObject(nestedField); - OutObject tempOut_scope32 = - new OutObject(); - r = t.ReadScope(row, tempRef_nestedField5, tempOut_scope32); + Reference tempReference_nestedField5 = + new Reference(nestedField); + Out tempOut_scope32 = + new Out(); + r = t.ReadScope(row, tempReference_nestedField5, tempOut_scope32); scope3 = tempOut_scope32.get(); - nestedField = tempRef_nestedField5.get(); + nestedField = tempReference_nestedField5.get(); ResultAssert.TypeMismatch(r, tag); } @@ -2332,7 +2333,7 @@ private final static class RoundTripSparseObjectMulti extends TestActionDispatch private final static class RoundTripSparseObjectNested extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn col = closure.Col; Property prop = closure.Prop.clone(); @@ -2349,19 +2350,19 @@ private final static class RoundTripSparseObjectNested extends TestActionDispatc // 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: scope.Clone(out field).Find(row, col.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: Result r = t.WriteSparse(row, ref field, (TValue)prop.Value); ResultAssert.IsSuccess(r, tag); // Read the nested field TValue value; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref field, out value); ResultAssert.IsSuccess(r, tag); boolean tempVar = prop.Value instanceof Array; @@ -2374,30 +2375,30 @@ private final static class RoundTripSparseObjectNested extends TestActionDispatc // Overwrite the nested field. if (t instanceof LayoutNull) { - RefObject tempRef_field = - new RefObject(field); - r = LayoutType.Boolean.WriteSparse(row, tempRef_field, false); - field = tempRef_field.get(); + Reference tempReference_field = + new Reference(field); + r = LayoutType.Boolean.WriteSparse(row, tempReference_field, false); + field = tempReference_field.get(); ResultAssert.IsSuccess(r, tag); } else { - RefObject tempRef_field2 = - new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field2, NullValue.Default); - field = tempRef_field2.get(); + Reference tempReference_field2 = + new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field2, NullValue.Default); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, tag); } // Verify nested field no longer there. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref field, out value); ResultAssert.TypeMismatch(r, tag); } @Override - public void DispatchObject(RefObject row, RefObject root, Closure closure) { + public void DispatchObject(Reference row, Reference root, Closure closure) { LayoutColumn col = closure.Col; Property prop = closure.Prop.clone(); Expected expected = closure.Expected.clone(); @@ -2466,7 +2467,7 @@ private final static class RoundTripSparseObjectNested extends TestActionDispatc private final static class RoundTripSparseOrdering extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutType type = closure.Expected.Type; String path = closure.Expected.Path; @@ -2477,17 +2478,17 @@ private final static class RoundTripSparseOrdering extends TestActionDispatcher< TValue value = (TValue)exValue; RowCursor field; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out field).Find(row, path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: Result r = t.WriteSparse(row, ref field, value); ResultAssert.IsSuccess(r, "Json: {0}", json); - OutObject tempOut_value = new OutObject(); + Out tempOut_value = new Out(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref field, tempOut_value); value = tempOut_value.get(); ResultAssert.IsSuccess(r, "Json: {0}", json); @@ -2500,33 +2501,33 @@ private final static class RoundTripSparseOrdering extends TestActionDispatcher< } if (t instanceof LayoutNull) { - RefObject tempRef_field = - new RefObject(field); - r = LayoutType.Boolean.WriteSparse(row, tempRef_field, false); - field = tempRef_field.get(); + Reference tempReference_field = + new Reference(field); + r = LayoutType.Boolean.WriteSparse(row, tempReference_field, false); + field = tempReference_field.get(); ResultAssert.IsSuccess(r, "Json: {0}", json); - OutObject tempOut_value2 = new OutObject(); + Out tempOut_value2 = new Out(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref field, tempOut_value2); value = tempOut_value2.get(); ResultAssert.TypeMismatch(r, "Json: {0}", json); } else { - RefObject tempRef_field2 = - new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field2, NullValue.Default); - field = tempRef_field2.get(); + Reference tempReference_field2 = + new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field2, NullValue.Default); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, "Json: {0}", json); - OutObject tempOut_value3 = new OutObject(); + Out tempOut_value3 = new Out(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref field, tempOut_value3); value = tempOut_value3.get(); @@ -2573,7 +2574,7 @@ private final static class RoundTripSparseOrdering extends TestActionDispatcher< private final static class RoundTripSparseSet extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn setCol = closure.SetCol; LayoutType tempVar = setCol.getType(); @@ -2589,23 +2590,23 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempRef_field = - new RefObject(field); + Reference tempReference_field = + new Reference(field); RowCursor scope; - OutObject tempOut_scope = - new OutObject(); - Result r = setT.ReadScope(row, tempRef_field, tempOut_scope); + Out tempOut_scope = + new Out(); + Result r = setT.ReadScope(row, tempReference_field, tempOut_scope); scope = tempOut_scope.get(); - field = tempRef_field.get(); + field = tempReference_field.get(); ResultAssert.NotFound(r, tag); // Write the Set. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = setT.WriteScope(row, ref field, setCol.getTypeArgs().clone(), out scope); ResultAssert.IsSuccess(r, tag); @@ -2613,9 +2614,9 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempRef_scope = - new RefObject(scope); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - r = setT.MoveField(row, tempRef_scope, tempRef_tempCursor); - tempCursor = tempRef_tempCursor.get(); - scope = tempRef_scope.get(); + Reference tempReference_scope = + new Reference(scope); + Reference tempReference_tempCursor = + new Reference(tempCursor); + r = setT.MoveField(row, tempReference_scope, tempReference_tempCursor); + tempCursor = tempReference_tempCursor.get(); + scope = tempReference_scope.get(); ResultAssert.IsSuccess(r, tag); } @@ -2649,55 +2650,55 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempRef_scope2 = - new RefObject(scope); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); - r = setT.MoveField(row, tempRef_scope2, tempRef_tempCursor2, UpdateOptions.Insert); - tempCursor = tempRef_tempCursor2.get(); - scope = tempRef_scope2.get(); + Reference tempReference_scope2 = + new Reference(scope); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); + r = setT.MoveField(row, tempReference_scope2, tempReference_tempCursor2, UpdateOptions.Insert); + tempCursor = tempReference_tempCursor2.get(); + scope = tempReference_scope2.get(); ResultAssert.Exists(r, tag); } // Read the Set and the nested column, validate the nested column has the proper value. - RefObject tempRef_field2 = - new RefObject(field); + Reference tempReference_field2 = + new Reference(field); RowCursor scope2; - OutObject tempOut_scope2 = - new OutObject(); - r = setT.ReadScope(row, tempRef_field2, tempOut_scope2); + Out tempOut_scope2 = + new Out(); + r = setT.ReadScope(row, tempReference_field2, tempOut_scope2); scope2 = tempOut_scope2.get(); - field = tempRef_field2.get(); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, tag); Assert.AreEqual(scope.ScopeType, scope2.ScopeType, tag); Assert.AreEqual(scope.start, scope2.start, tag); Assert.AreEqual(scope.Immutable, scope2.Immutable, tag); // Read the nested fields - RefObject tempRef_field3 = - new RefObject(field); - OutObject tempOut_scope2 = - new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field3, tempOut_scope2)); + Reference tempReference_field3 = + new Reference(field); + Out tempOut_scope2 = + new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field3, tempOut_scope2)); scope = tempOut_scope2.get(); - field = tempRef_field3.get(); + field = tempReference_field3.get(); for (Object item : expected.Value) { assert scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref scope, out value); ResultAssert.IsSuccess(r, tag); @@ -2711,68 +2712,68 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempRef_field4 = - new RefObject(field); - OutObject tempOut_scope3 = - new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field4, tempOut_scope3)); + Reference tempReference_field4 = + new Reference(field); + Out tempOut_scope3 = + new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field4, tempOut_scope3)); scope = tempOut_scope3.get(); - field = tempRef_field4.get(); + field = tempReference_field4.get(); for (int i = 0; i < expected.Value.size(); i++) { assert scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.DeleteSparse(row, ref scope); ResultAssert.IsSuccess(r, tag); } - RefObject tempRef_field5 = - new RefObject(field); - OutObject tempOut_scope4 = - new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field5, tempOut_scope4)); + Reference tempReference_field5 = + new Reference(field); + Out tempOut_scope4 = + new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field5, tempOut_scope4)); scope = tempOut_scope4.get(); - field = tempRef_field5.get(); + field = tempReference_field5.get(); for (int i = expected.Value.size() - 1; i >= 0; i--) { // Write the ith item into staging storage. RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.WriteSparse(row, ref tempCursor, (TValue)expected.Value.get(i)); ResultAssert.IsSuccess(r, tag); // Move item into the set. - RefObject tempRef_scope3 = - new RefObject(scope); - RefObject tempRef_tempCursor3 = - new RefObject(tempCursor); - r = setT.MoveField(row, tempRef_scope3, tempRef_tempCursor3); - tempCursor = tempRef_tempCursor3.get(); - scope = tempRef_scope3.get(); + Reference tempReference_scope3 = + new Reference(scope); + Reference tempReference_tempCursor3 = + new Reference(tempCursor); + r = setT.MoveField(row, tempReference_scope3, tempReference_tempCursor3); + tempCursor = tempReference_tempCursor3.get(); + scope = tempReference_scope3.get(); ResultAssert.IsSuccess(r, tag); } // Verify they still enumerate in sorted order. - RefObject tempRef_field6 = - new RefObject(field); - OutObject tempOut_scope5 = - new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field6, tempOut_scope5)); + Reference tempReference_field6 = + new Reference(field); + Out tempOut_scope5 = + new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field6, tempOut_scope5)); scope = tempOut_scope5.get(); - field = tempRef_field6.get(); + field = tempReference_field6.get(); for (Object item : expected.Value) { assert scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref scope, out value); ResultAssert.IsSuccess(r, tag); @@ -2788,28 +2789,28 @@ private final static class RoundTripSparseSet extends TestActionDispatcher 1) { int indexToDelete = 1; - RefObject tempRef_field7 = - new RefObject(field); - OutObject tempOut_scope6 = new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field7, tempOut_scope6)); + Reference tempReference_field7 = + new Reference(field); + Out tempOut_scope6 = new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field7, tempOut_scope6)); scope = tempOut_scope6.get(); - field = tempRef_field7.get(); + field = tempReference_field7.get(); assert scope.MoveTo(row, indexToDelete); - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'RefObject' 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: r = t.DeleteSparse(row, ref scope); ResultAssert.IsSuccess(r, tag); ArrayList remainingValues = new ArrayList(expected.Value); remainingValues.remove(indexToDelete); - RefObject tempRef_field8 = new RefObject(field); - OutObject tempOut_scope7 = new OutObject(); - ResultAssert.IsSuccess(setT.ReadScope(row, tempRef_field8, tempOut_scope7)); + Reference tempReference_field8 = new Reference(field); + Out tempOut_scope7 = new Out(); + ResultAssert.IsSuccess(setT.ReadScope(row, tempReference_field8, tempOut_scope7)); scope = tempOut_scope7.get(); - field = tempRef_field8.get(); + field = tempReference_field8.get(); for (Object item : remainingValues) { assert scope.MoveNext(row); - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' 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 'RefObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref scope, out value); ResultAssert.IsSuccess(r, tag); boolean tempVar4 = item instanceof Array; @@ -2825,49 +2826,49 @@ private final static class RoundTripSparseSet extends TestActionDispatcher tempRef_roRoot = new RefObject(roRoot); - ResultAssert.InsufficientPermissions(setT.DeleteScope(row, tempRef_roRoot)); - roRoot = tempRef_roRoot.get(); - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' 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 'RefObject' helper class unless the method is within the code being modified: + Reference 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 _)); // Overwrite the whole scope. - RefObject tempRef_field9 = new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field9, NullValue.Default); - field = tempRef_field9.get(); + Reference tempReference_field9 = new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field9, NullValue.Default); + field = tempReference_field9.get(); ResultAssert.IsSuccess(r, tag); - RefObject tempRef_field10 = new RefObject(field); + Reference tempReference_field10 = new Reference(field); RowCursor _; - OutObject tempOut__ = new OutObject(); - r = setT.ReadScope(row, tempRef_field10, tempOut__); + Out tempOut__ = new Out(); + r = setT.ReadScope(row, tempReference_field10, tempOut__); _ = tempOut__.get(); - field = tempRef_field10.get(); + field = tempReference_field10.get(); ResultAssert.TypeMismatch(r, tag); - RefObject tempRef_field11 = new RefObject(field); - r = setT.DeleteScope(row, tempRef_field11); - field = tempRef_field11.get(); + Reference tempReference_field11 = new Reference(field); + r = setT.DeleteScope(row, tempReference_field11); + field = tempReference_field11.get(); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); // Overwrite it again, then delete it. - RefObject tempRef_field12 = new RefObject(field); + Reference 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 'OutObject' helper class unless the method is within the code being modified: - r = setT.WriteScope(row, tempRef_field12, setCol.getTypeArgs().clone(), out _, UpdateOptions.Update); - field = tempRef_field12.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: + r = setT.WriteScope(row, tempReference_field12, setCol.getTypeArgs().clone(), out _, UpdateOptions.Update); + field = tempReference_field12.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field13 = new RefObject(field); - r = setT.DeleteScope(row, tempRef_field13); - field = tempRef_field13.get(); + Reference tempReference_field13 = new Reference(field); + r = setT.DeleteScope(row, tempReference_field13); + field = tempReference_field13.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); - RefObject tempRef_field14 = new RefObject(field); + Reference tempReference_field14 = new Reference(field); RowCursor _; - OutObject tempOut__2 = new OutObject(); - r = setT.ReadScope(row, tempRef_field14, tempOut__2); + Out tempOut__2 = new Out(); + r = setT.ReadScope(row, tempReference_field14, tempOut__2); _ = tempOut__2.get(); - field = tempRef_field14.get(); + field = tempReference_field14.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } @@ -2910,7 +2911,7 @@ private final static class RoundTripSparseSet extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn col = closure.Col; Expected expected = closure.Expected.clone(); @@ -2919,31 +2920,31 @@ private final static class RoundTripSparseSimple extends TestActionDispatcher tempRef_field = - new RefObject(field); - r = LayoutType.Boolean.WriteSparse(row, tempRef_field, false); - field = tempRef_field.get(); + Reference tempReference_field = + new Reference(field); + r = LayoutType.Boolean.WriteSparse(row, tempReference_field, false); + field = tempReference_field.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref field, out value); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); } else { - RefObject tempRef_field2 = - new RefObject(field); - r = LayoutType.Null.WriteSparse(row, tempRef_field2, NullValue.Default); - field = tempRef_field2.get(); + Reference tempReference_field2 = + new Reference(field); + r = LayoutType.Null.WriteSparse(row, tempReference_field2, NullValue.Default); + field = tempReference_field2.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: r = t.ReadSparse(row, ref field, out value); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.DeleteSparse(row, ref field); ResultAssert.TypeMismatch(r, "Json: {0}", expected.Json); // Overwrite it again, then delete it. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.WriteSparse(row, ref field, (TValue)expected.Value, UpdateOptions.Update); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.DeleteSparse(row, ref field); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: r = t.ReadSparse(row, ref field, out value); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } @@ -3055,7 +3056,7 @@ private final static class RoundTripSparseSimple extends TestActionDispatcher { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { LayoutColumn col = closure.Col; Expected expected = closure.Expected.clone(); @@ -3065,11 +3066,11 @@ private static class RoundTripVariable extends TestActionDispatcherRoundTrip(row, root, col, expected.Value, expected.clone()); } - protected final , TValue> void Compare(RefObject row, - RefObject root, LayoutColumn col, Object exValue, Expected expected) { + protected final , TValue> void Compare(Reference row, + Reference root, LayoutColumn col, Object exValue, Expected expected) { TLayout t = (TLayout)col.getType(); TValue value; - OutObject tempOut_value = new OutObject(); + Out tempOut_value = new Out(); Result r = t.ReadVariable(row, root, col, tempOut_value); value = tempOut_value.get(); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -3082,8 +3083,8 @@ private static class RoundTripVariable extends TestActionDispatcher, TValue> void RoundTrip(RefObject row, - RefObject root, LayoutColumn col, Object exValue, Expected expected) { + protected final , TValue> void RoundTrip(Reference row, + Reference root, LayoutColumn col, Object exValue, Expected expected) { TLayout t = (TLayout)col.getType(); Result r = t.WriteVariable(row, root, col, (TValue)exValue); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); @@ -3091,12 +3092,12 @@ private static class RoundTripVariable extends TestActionDispatcher tempRef_roRoot = - new RefObject(roRoot); - ResultAssert.InsufficientPermissions(t.WriteVariable(row, tempRef_roRoot, col, (TValue)expected.Value)); - roRoot = tempRef_roRoot.get(); + Reference tempReference_roRoot = + new Reference(roRoot); + ResultAssert.InsufficientPermissions(t.WriteVariable(row, tempReference_roRoot, col, (TValue)expected.Value)); + roRoot = tempReference_roRoot.get(); } //C# TO JAVA CONVERTER WARNING: Java does not allow user-defined value types. The behavior of this class may @@ -3143,16 +3144,16 @@ private static class RoundTripVariable extends TestActionDispatcher { - public abstract , TValue> void Dispatch(RefObject row, RefObject scope, TClosure closure); + public abstract , TValue> void Dispatch(Reference row, Reference scope, TClosure closure); - public void DispatchObject(RefObject row, RefObject scope, TClosure closure) { + public void DispatchObject(Reference row, Reference scope, TClosure closure) { Assert.Fail("not implemented"); } } private final static class VariableInterleaving extends RoundTripVariable { @Override - public void Dispatch(RefObject row, RefObject root, + public void Dispatch(Reference row, Reference root, Closure closure) { Layout layout = closure.Layout; Expected expected = closure.Expected.clone(); @@ -3192,44 +3193,44 @@ private final static class VariableInterleaving extends RoundTripVariable { this.Delete(row, root, a, expected.clone()); } - private , TValue> void Delete(RefObject row, - RefObject root, LayoutColumn col, Expected expected) { + private , TValue> void Delete(Reference row, + Reference root, LayoutColumn col, Expected expected) { TLayout t = (TLayout)col.getType(); RowCursor roRoot; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().AsReadOnly(out roRoot); - RefObject tempRef_roRoot = - new RefObject(roRoot); - ResultAssert.InsufficientPermissions(t.DeleteVariable(row, tempRef_roRoot, col)); - roRoot = tempRef_roRoot.get(); + Reference tempReference_roRoot = + new Reference(roRoot); + ResultAssert.InsufficientPermissions(t.DeleteVariable(row, tempReference_roRoot, col)); + roRoot = tempReference_roRoot.get(); Result r = t.DeleteVariable(row, root, col); ResultAssert.IsSuccess(r, "Json: {0}", expected.Json); TValue _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); r = t.ReadVariable(row, root, col, tempOut__); _ = tempOut__.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); } - private , TValue> void TooBig(RefObject row, - RefObject root, LayoutColumn col, Expected expected) { + private , TValue> void TooBig(Reference row, + Reference root, LayoutColumn col, Expected expected) { TLayout t = (TLayout)col.getType(); Result r = t.WriteVariable(row, root, col, (TValue)expected.TooBig); Assert.AreEqual(Result.TooBig, r, "Json: {0}", expected.Json); } - private , TValue> LayoutColumn Verify(RefObject row, - RefObject root, Layout layout, String path, Expected expected) { + private , TValue> LayoutColumn Verify(Reference row, + Reference root, Layout layout, String path, Expected expected) { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: boolean found = layout.TryFind(path, out col); Assert.IsTrue(found, "Json: {0}", expected.Json); assert col.Type.AllowVariable; TLayout t = (TLayout)col.Type; TValue _; - OutObject tempOut__ = new OutObject(); + Out tempOut__ = new Out(); Result r = t.ReadVariable(row, root, col, tempOut__); _ = tempOut__.get(); ResultAssert.NotFound(r, "Json: {0}", expected.Json); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullRowDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullRowDispatcher.java index b7e1a29..ef91ba6 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullRowDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/NullRowDispatcher.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; @@ -13,75 +14,75 @@ import com.azure.data.cosmos.serialization.hybridrow.RowCursor; //ORIGINAL LINE: internal struct NullRowDispatcher : IDispatcher public final class NullRowDispatcher implements IDispatcher { - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t) { + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t) { Dispatch(dispatcher, root, col, t, null); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public void Dispatch(ref RowOperationDispatcher dispatcher, ref RowCursor root, // LayoutColumn col, LayoutType t, TValue expected = default) where TLayout : LayoutType - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t, TValue expected) { + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t, TValue expected) { switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); TValue _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - ResultAssert.NotFound(t.TypeAs().ReadFixed(tempRef_Row, root, col, out _)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + ResultAssert.NotFound(t.TypeAs().ReadFixed(tempReference_Row, root, col, out _)); + dispatcher.get().argValue.Row = tempReference_Row.get(); break; case Variable: - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); TValue _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - ResultAssert.NotFound(t.TypeAs().ReadVariable(tempRef_Row2, root, col, out _)); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + ResultAssert.NotFound(t.TypeAs().ReadVariable(tempReference_Row2, root, col, out _)); + dispatcher.get().argValue.Row = tempReference_Row2.get(); break; default: - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); TValue _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - ResultAssert.NotFound(t.TypeAs().ReadSparse(tempRef_Row3, root, out _)); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + ResultAssert.NotFound(t.TypeAs().ReadSparse(tempReference_Row3, root, out _)); + dispatcher.get().argValue.Row = tempReference_Row3.get(); break; } } - public void DispatchArray(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchArray(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } - public void DispatchMap(RefObject dispatcher, RefObject scope, LayoutType t, TypeArgumentList typeArgs, Object value) { + public void DispatchMap(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } - public void DispatchNullable(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchNullable(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } - public void DispatchObject(RefObject dispatcher, - RefObject scope) { + public void DispatchObject(Reference dispatcher, + Reference scope) { } - public void DispatchSet(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchSet(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } - public void DispatchTuple(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchTuple(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } - public void DispatchUDT(RefObject dispatcher, RefObject scope, LayoutType t, TypeArgumentList typeArgs, Object value) { + public void DispatchUDT(Reference dispatcher, Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { } } \ No newline at end of file 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 80298df..bb073fb 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -53,26 +54,26 @@ public final class NullableUnitTests { "-000000000000}"), 1), Map.entry(UUID.fromString("{4674962B-CE11-4916-81C5-0421EE36F168}"), 20), Map.entry(UUID.fromString("{7499C40E-7077-45C1-AE5F-3E384966B3B9}"), null))); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteNullables(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteNullables(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Nullables t2 = this.ReadNullables(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + Nullables t2 = this.ReadNullables(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert t1 == t2; } @@ -89,12 +90,12 @@ public final class NullableUnitTests { // TODO: C# TO JAVA CONVERTER: The C# 'struct' constraint has no equivalent in Java: //ORIGINAL LINE: private static Result ReadNullable(ref RowBuffer row, ref RowCursor scope, TypeArgument // itemType, out Nullable item, out RowCursor nullableScope) where TValue : struct - private static Result ReadNullable(RefObject row, - RefObject scope, TypeArgument itemType, - OutObject item, - OutObject nullableScope) { + private static Result ReadNullable(Reference row, + Reference scope, TypeArgument itemType, + Out item, + Out nullableScope) { TValue value; - OutObject tempOut_value = new OutObject(); + Out tempOut_value = new Out(); Result r = NullableUnitTests.ReadNullableImpl(row, scope, itemType.clone(), tempOut_value, nullableScope.clone()); value = tempOut_value.get(); @@ -107,18 +108,18 @@ public final class NullableUnitTests { return Result.Success; } - private static Result ReadNullable(RefObject row, - RefObject scope, TypeArgument itemType, - OutObject item, - OutObject nullableScope) { + private static Result ReadNullable(Reference row, + Reference scope, TypeArgument itemType, + Out item, + Out nullableScope) { Result r = NullableUnitTests.ReadNullableImpl(row, scope, itemType.clone(), item, nullableScope.clone()); return (r == Result.NotFound) ? Result.Success : r; } - private static Result ReadNullableImpl(RefObject row, - RefObject scope, TypeArgument itemType, - OutObject item, - OutObject nullableScope) { + private static Result ReadNullableImpl(Reference row, + Reference scope, TypeArgument itemType, + Out item, + Out nullableScope) { Result r = itemType.getType().TypeAs().ReadScope(row, scope, nullableScope.clone()); if (r != Result.Success) { item.set(null); @@ -136,248 +137,248 @@ public final class NullableUnitTests { return Result.NotFound; } - private Nullables ReadNullables(RefObject row, RefObject root) { + private Nullables ReadNullables(Reference row, Reference root) { Nullables value = new Nullables(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nullbool", out c); RowCursor scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullBool = new ArrayList(); RowCursor nullableScope = null; - RefObject tempRef_nullableScope = - new RefObject(nullableScope); - while (scope.MoveNext(row, tempRef_nullableScope)) { - nullableScope = tempRef_nullableScope.get(); - RefObject tempRef_scope = - new RefObject(scope); + Reference tempReference_nullableScope = + new Reference(nullableScope); + while (scope.MoveNext(row, tempReference_nullableScope)) { + nullableScope = tempReference_nullableScope.get(); + Reference tempReference_scope = + new Reference(scope); Nullable item; - OutObject tempOut_item = new OutObject(); - OutObject tempOut_nullableScope = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_scope, c.TypeArgs[0], tempOut_item + Out tempOut_item = new Out(); + Out tempOut_nullableScope = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_scope, c.TypeArgs[0], tempOut_item , tempOut_nullableScope)); nullableScope = tempOut_nullableScope.get(); item = tempOut_item.get(); - scope = tempRef_scope.get(); + scope = tempReference_scope.get(); value.NullBool.add(item); } - nullableScope = tempRef_nullableScope.get(); + nullableScope = tempReference_nullableScope.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nullarray", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullArray = new ArrayList(); RowCursor nullableScope = null; - RefObject tempRef_nullableScope2 = - new RefObject(nullableScope); - while (scope.MoveNext(row, tempRef_nullableScope2)) { - nullableScope = tempRef_nullableScope2.get(); - RefObject tempRef_scope2 = - new RefObject(scope); + Reference tempReference_nullableScope2 = + new Reference(nullableScope); + while (scope.MoveNext(row, tempReference_nullableScope2)) { + nullableScope = tempReference_nullableScope2.get(); + Reference tempReference_scope2 = + new Reference(scope); Nullable item; - OutObject tempOut_item2 = new OutObject(); - OutObject tempOut_nullableScope2 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_scope2, c.TypeArgs[0], + Out tempOut_item2 = new Out(); + Out tempOut_nullableScope2 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_scope2, c.TypeArgs[0], tempOut_item2, tempOut_nullableScope2)); nullableScope = tempOut_nullableScope2.get(); item = tempOut_item2.get(); - scope = tempRef_scope2.get(); + scope = tempReference_scope2.get(); value.NullArray.add(item); } - nullableScope = tempRef_nullableScope2.get(); + nullableScope = tempReference_nullableScope2.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nullset", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullSet = new ArrayList(); RowCursor nullableScope = null; - RefObject tempRef_nullableScope3 = - new RefObject(nullableScope); - while (scope.MoveNext(row, tempRef_nullableScope3)) { - nullableScope = tempRef_nullableScope3.get(); - RefObject tempRef_scope3 = - new RefObject(scope); + Reference tempReference_nullableScope3 = + new Reference(nullableScope); + while (scope.MoveNext(row, tempReference_nullableScope3)) { + nullableScope = tempReference_nullableScope3.get(); + Reference tempReference_scope3 = + new Reference(scope); String item; - OutObject tempOut_item3 = new OutObject(); - OutObject tempOut_nullableScope3 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_scope3, c.TypeArgs[0], + Out tempOut_item3 = new Out(); + Out tempOut_nullableScope3 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_scope3, c.TypeArgs[0], tempOut_item3, tempOut_nullableScope3)); nullableScope = tempOut_nullableScope3.get(); item = tempOut_item3.get(); - scope = tempRef_scope3.get(); + scope = tempReference_scope3.get(); value.NullSet.add(item); } - nullableScope = tempRef_nullableScope3.get(); + nullableScope = tempReference_nullableScope3.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nulltuple", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref scope, out scope) == Result.Success) { value.NullTuple = new ArrayList<(Integer, Long) > (); RowCursor tupleScope = null; TypeArgument tupleType = c.TypeArgs[0]; - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - while (scope.MoveNext(row, tempRef_tupleScope)) { - tupleScope = tempRef_tupleScope.get(); - RefObject tempRef_scope4 = - new RefObject(scope); - OutObject tempOut_tupleScope = - new OutObject(); - ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, tempRef_scope4, + Reference tempReference_tupleScope = + new Reference(tupleScope); + while (scope.MoveNext(row, tempReference_tupleScope)) { + tupleScope = tempReference_tupleScope.get(); + Reference tempReference_scope4 = + new Reference(scope); + Out tempOut_tupleScope = + new Out(); + ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, tempReference_scope4, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - scope = tempRef_scope4.get(); + scope = tempReference_scope4.get(); assert RowCursorExtensions.MoveNext(tupleScope.clone() , row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); Nullable item1; - OutObject tempOut_item1 = new OutObject(); + Out tempOut_item1 = new Out(); RowCursor nullableScope; - OutObject tempOut_nullableScope4 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_tupleScope2, + Out tempOut_nullableScope4 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_tupleScope2, tupleType.getTypeArgs().get(0).clone(), tempOut_item1, tempOut_nullableScope4)); nullableScope = tempOut_nullableScope4.get(); item1 = tempOut_item1.get(); - tupleScope = tempRef_tupleScope2.get(); - RefObject tempRef_nullableScope4 = - new RefObject(nullableScope); + tupleScope = tempReference_tupleScope2.get(); + Reference tempReference_nullableScope4 = + new Reference(nullableScope); assert RowCursorExtensions.MoveNext(tupleScope.clone() - , row, tempRef_nullableScope4); - nullableScope = tempRef_nullableScope4.get(); - RefObject tempRef_tupleScope3 = - new RefObject(tupleScope); + , row, tempReference_nullableScope4); + nullableScope = tempReference_nullableScope4.get(); + Reference tempReference_tupleScope3 = + new Reference(tupleScope); Nullable item2; - OutObject tempOut_item2 = new OutObject(); - OutObject tempOut_nullableScope5 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_tupleScope3, + Out tempOut_item2 = new Out(); + Out tempOut_nullableScope5 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_tupleScope3, tupleType.getTypeArgs().get(1).clone(), tempOut_item2, tempOut_nullableScope5)); nullableScope = tempOut_nullableScope5.get(); item2 = tempOut_item2.get(); - tupleScope = tempRef_tupleScope3.get(); + tupleScope = tempReference_tupleScope3.get(); - RefObject tempRef_nullableScope5 = - new RefObject(nullableScope); - assert !RowCursorExtensions.MoveNext(tupleScope.clone(), row, tempRef_nullableScope5); - nullableScope = tempRef_nullableScope5.get(); + Reference tempReference_nullableScope5 = + new Reference(nullableScope); + assert !RowCursorExtensions.MoveNext(tupleScope.clone(), row, tempReference_nullableScope5); + nullableScope = tempReference_nullableScope5.get(); value.NullTuple.add((item1, item2)) } - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nullmap", out c); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.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(); RowCursor tupleScope = null; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: TypeArgument tupleType = c.TypeAs().FieldType(ref scope); - RefObject tempRef_tupleScope4 = - new RefObject(tupleScope); - while (scope.MoveNext(row, tempRef_tupleScope4)) { - tupleScope = tempRef_tupleScope4.get(); - RefObject tempRef_scope5 = - new RefObject(scope); - OutObject tempOut_tupleScope2 = - new OutObject(); - ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, tempRef_scope5, + Reference tempReference_tupleScope4 = + new Reference(tupleScope); + while (scope.MoveNext(row, tempReference_tupleScope4)) { + tupleScope = tempReference_tupleScope4.get(); + Reference tempReference_scope5 = + new Reference(scope); + Out tempOut_tupleScope2 = + new Out(); + ResultAssert.IsSuccess(tupleType.TypeAs().ReadScope(row, tempReference_scope5, tempOut_tupleScope2)); tupleScope = tempOut_tupleScope2.get(); - scope = tempRef_scope5.get(); + scope = tempReference_scope5.get(); assert RowCursorExtensions.MoveNext(tupleScope.clone() , row); - RefObject tempRef_tupleScope5 = - new RefObject(tupleScope); + Reference tempReference_tupleScope5 = + new Reference(tupleScope); Nullable itemKey; - OutObject tempOut_itemKey = new OutObject(); + Out tempOut_itemKey = new Out(); RowCursor nullableScope; - OutObject tempOut_nullableScope6 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_tupleScope5, + Out tempOut_nullableScope6 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_tupleScope5, tupleType.getTypeArgs().get(0).clone(), tempOut_itemKey, tempOut_nullableScope6)); nullableScope = tempOut_nullableScope6.get(); itemKey = tempOut_itemKey.get(); - tupleScope = tempRef_tupleScope5.get(); + tupleScope = tempReference_tupleScope5.get(); - RefObject tempRef_nullableScope6 = - new RefObject(nullableScope); + Reference tempReference_nullableScope6 = + new Reference(nullableScope); assert RowCursorExtensions.MoveNext(tupleScope.clone() - , row, tempRef_nullableScope6); - nullableScope = tempRef_nullableScope6.get(); - RefObject tempRef_tupleScope6 = - new RefObject(tupleScope); + , row, tempReference_nullableScope6); + nullableScope = tempReference_nullableScope6.get(); + Reference tempReference_tupleScope6 = + new Reference(tupleScope); Nullable itemValue; - OutObject tempOut_itemValue = new OutObject(); - OutObject tempOut_nullableScope7 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempRef_tupleScope6, + Out tempOut_itemValue = new Out(); + Out tempOut_nullableScope7 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.ReadNullable(row, tempReference_tupleScope6, tupleType.getTypeArgs().get(1).clone(), tempOut_itemValue, tempOut_nullableScope7)); nullableScope = tempOut_nullableScope7.get(); itemValue = tempOut_itemValue.get(); - tupleScope = tempRef_tupleScope6.get(); + tupleScope = tempReference_tupleScope6.get(); - RefObject tempRef_nullableScope7 = - new RefObject(nullableScope); - assert !RowCursorExtensions.MoveNext(tupleScope.clone(), row, tempRef_nullableScope7); - nullableScope = tempRef_nullableScope7.get(); + Reference tempReference_nullableScope7 = + new Reference(nullableScope); + assert !RowCursorExtensions.MoveNext(tupleScope.clone(), row, tempReference_nullableScope7); + nullableScope = tempReference_nullableScope7.get(); value.NullMap.put(itemKey != null ? itemKey : UUID.Empty, itemValue); } - tupleScope = tempRef_tupleScope4.get(); + tupleScope = tempReference_tupleScope4.get(); } return value; @@ -386,24 +387,24 @@ public final class NullableUnitTests { // TODO: C# TO JAVA CONVERTER: The C# 'struct' constraint has no equivalent in Java: //ORIGINAL LINE: private static Result WriteNullable(ref RowBuffer row, ref RowCursor scope, TypeArgument // itemType, Nullable item, out RowCursor nullableScope) where TValue : struct - private static Result WriteNullable(RefObject row, - RefObject scope, TypeArgument itemType, - TValue item, OutObject nullableScope) { + private static Result WriteNullable(Reference row, + Reference scope, TypeArgument itemType, + TValue item, Out nullableScope) { return NullableUnitTests.WriteNullableImpl(row, scope, itemType.clone(), item != null, item != null ? item : default,nullableScope.clone()) } - private static Result WriteNullable(RefObject row, - RefObject scope, TypeArgument itemType, - TValue item, OutObject nullableScope) { + private static Result WriteNullable(Reference row, + Reference scope, TypeArgument itemType, + TValue item, Out nullableScope) { return NullableUnitTests.WriteNullableImpl(row, scope, itemType.clone(), item != null, item, nullableScope.clone()); } - private static Result WriteNullableImpl(RefObject row, - RefObject scope, TypeArgument itemType, + private static Result WriteNullableImpl(Reference row, + Reference scope, TypeArgument itemType, boolean hasValue, TValue item, - OutObject nullableScope) { + Out nullableScope) { Result r = itemType.TypeAs().WriteScope(row, scope, itemType.getTypeArgs().clone(), hasValue, nullableScope); @@ -420,203 +421,204 @@ public final class NullableUnitTests { return Result.Success; } - private void WriteNullables(RefObject row, RefObject root, + private void WriteNullables(Reference row, Reference root, Nullables value) { LayoutColumn c; if (value.NullBool != null) { - OutObject tempOut_c = - new OutObject(); + Out tempOut_c = + new Out(); assert this.layout.TryFind("nullbool", tempOut_c); c = tempOut_c.get(); RowCursor outerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out outerScope).Find(row, c.getPath()); - RefObject tempRef_outerScope = - new RefObject(outerScope); - OutObject tempOut_outerScope = - new OutObject(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempRef_outerScope, + Reference tempReference_outerScope = + new Reference(outerScope); + Out tempOut_outerScope = + new Out(); + ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope, c.getTypeArgs().clone(), tempOut_outerScope)); outerScope = tempOut_outerScope.get(); - outerScope = tempRef_outerScope.get(); + outerScope = tempReference_outerScope.get(); for (Boolean item : value.NullBool) { - RefObject tempRef_outerScope2 = - new RefObject(outerScope); + Reference tempReference_outerScope2 = + new Reference(outerScope); RowCursor innerScope; - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_outerScope2, + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope2, c.getTypeArgs().get(0).clone(), item, tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - outerScope = tempRef_outerScope2.get(); + outerScope = tempReference_outerScope2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !outerScope.MoveNext(row, ref innerScope); } } if (value.NullArray != null) { - OutObject tempOut_c2 = - new OutObject(); + Out tempOut_c2 = + new Out(); assert this.layout.TryFind("nullarray", tempOut_c2); c = tempOut_c2.get(); RowCursor outerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out outerScope).Find(row, c.getPath()); - RefObject tempRef_outerScope3 = - new RefObject(outerScope); - OutObject tempOut_outerScope2 = - new OutObject(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempRef_outerScope3, + Reference tempReference_outerScope3 = + new Reference(outerScope); + Out tempOut_outerScope2 = + new Out(); + ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope3, c.getTypeArgs().clone(), tempOut_outerScope2)); outerScope = tempOut_outerScope2.get(); - outerScope = tempRef_outerScope3.get(); + outerScope = tempReference_outerScope3.get(); for (Float item : value.NullArray) { - RefObject tempRef_outerScope4 = - new RefObject(outerScope); + Reference tempReference_outerScope4 = + new Reference(outerScope); RowCursor innerScope; - OutObject tempOut_innerScope2 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_outerScope4, + Out tempOut_innerScope2 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_outerScope4, c.getTypeArgs().get(0).clone(), item, tempOut_innerScope2)); innerScope = tempOut_innerScope2.get(); - outerScope = tempRef_outerScope4.get(); + outerScope = tempReference_outerScope4.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !outerScope.MoveNext(row, ref innerScope); } } if (value.NullSet != null) { - OutObject tempOut_c3 = - new OutObject(); + Out tempOut_c3 = + new Out(); assert this.layout.TryFind("nullset", tempOut_c3); c = tempOut_c3.get(); RowCursor outerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out outerScope).Find(row, c.getPath()); - RefObject tempRef_outerScope5 = - new RefObject(outerScope); - OutObject tempOut_outerScope3 = - new OutObject(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempRef_outerScope5, + Reference tempReference_outerScope5 = + new Reference(outerScope); + Out tempOut_outerScope3 = + new Out(); + ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope5, c.getTypeArgs().clone(), tempOut_outerScope3)); outerScope = tempOut_outerScope3.get(); - outerScope = tempRef_outerScope5.get(); + outerScope = tempReference_outerScope5.get(); for (String item : value.NullSet) { RowCursor temp; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: RowCursor.CreateForAppend(row, out temp).Find(row, ""); - RefObject tempRef_temp = - new RefObject(temp); + Reference tempReference_temp = + new Reference(temp); RowCursor _; - OutObject tempOut__ = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_temp, + Out tempOut__ = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_temp, c.getTypeArgs().get(0).clone(), item, tempOut__)); _ = tempOut__.get(); - temp = tempRef_temp.get(); - RefObject tempRef_outerScope6 = - new RefObject(outerScope); - RefObject tempRef_temp2 = - new RefObject(temp); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_outerScope6, tempRef_temp2)); - temp = tempRef_temp2.get(); - outerScope = tempRef_outerScope6.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, + tempReference_temp2)); + temp = tempReference_temp2.get(); + outerScope = tempReference_outerScope6.get(); } } if (value.NullTuple != null) { - OutObject tempOut_c4 = - new OutObject(); + Out tempOut_c4 = + new Out(); assert this.layout.TryFind("nulltuple", tempOut_c4); c = tempOut_c4.get(); RowCursor outerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out outerScope).Find(row, c.getPath()); - RefObject tempRef_outerScope7 = - new RefObject(outerScope); - OutObject tempOut_outerScope4 = - new OutObject(); - ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempRef_outerScope7, + Reference tempReference_outerScope7 = + new Reference(outerScope); + Out tempOut_outerScope4 = + new Out(); + ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, tempReference_outerScope7, c.getTypeArgs().clone(), tempOut_outerScope4)); outerScope = tempOut_outerScope4.get(); - outerScope = tempRef_outerScope7.get(); + outerScope = tempReference_outerScope7.get(); for ((Integer item1,Long item2) :value.NullTuple) { TypeArgument tupleType = c.getTypeArgs().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 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(tupleType.TypeAs().WriteScope(row, ref outerScope, tupleType.getTypeArgs().clone(), out tupleScope)); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); RowCursor nullableScope; - OutObject tempOut_nullableScope = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_tupleScope, + Out tempOut_nullableScope = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_tupleScope, tupleType.getTypeArgs().get(0).clone(), item1, tempOut_nullableScope)); nullableScope = tempOut_nullableScope.get(); - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert tupleScope.MoveNext(row, ref nullableScope); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); - OutObject tempOut_nullableScope2 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_tupleScope2, + Reference tempReference_tupleScope2 = + new Reference(tupleScope); + Out tempOut_nullableScope2 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_tupleScope2, tupleType.getTypeArgs().get(1).clone(), item2, tempOut_nullableScope2)); nullableScope = tempOut_nullableScope2.get(); - tupleScope = tempRef_tupleScope2.get(); + tupleScope = tempReference_tupleScope2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !tupleScope.MoveNext(row, ref nullableScope); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !outerScope.MoveNext(row, ref tupleScope); } } if (value.NullMap != null) { - OutObject tempOut_c5 = - new OutObject(); + Out tempOut_c5 = + new Out(); assert this.layout.TryFind("nullmap", tempOut_c5); c = tempOut_c5.get(); RowCursor outerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out outerScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref outerScope, c.getTypeArgs().clone(), out outerScope)); @@ -624,62 +626,62 @@ public final class NullableUnitTests { //ORIGINAL LINE: foreach ((Guid key, Nullable itemValue) in value.NullMap) for ((UUID key,Byte itemValue) :value.NullMap) { - RefObject tempRef_outerScope8 = - new RefObject(outerScope); - TypeArgument tupleType = c.TypeAs().FieldType(tempRef_outerScope8).clone(); - outerScope = tempRef_outerScope8.get(); + Reference tempReference_outerScope8 = + new Reference(outerScope); + 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 - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: RowCursor.CreateForAppend(row, out temp).Find(row, ""); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(tupleType.TypeAs().WriteScope(row, ref temp, tupleType.getTypeArgs().clone(), out tupleScope)); UUID itemKey = key.equals(UUID.Empty) ? null : key; - RefObject tempRef_tupleScope3 = - new RefObject(tupleScope); + Reference tempReference_tupleScope3 = + new Reference(tupleScope); RowCursor nullableScope; - OutObject tempOut_nullableScope3 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_tupleScope3, + Out tempOut_nullableScope3 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_tupleScope3, tupleType.getTypeArgs().get(0).clone(), itemKey, tempOut_nullableScope3)); nullableScope = tempOut_nullableScope3.get(); - tupleScope = tempRef_tupleScope3.get(); + tupleScope = tempReference_tupleScope3.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert tupleScope.MoveNext(row, ref nullableScope); - RefObject tempRef_tupleScope4 = - new RefObject(tupleScope); - OutObject tempOut_nullableScope4 = - new OutObject(); - ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempRef_tupleScope4, + Reference tempReference_tupleScope4 = + new Reference(tupleScope); + Out tempOut_nullableScope4 = + new Out(); + ResultAssert.IsSuccess(NullableUnitTests.WriteNullable(row, tempReference_tupleScope4, tupleType.getTypeArgs().get(1).clone(), itemValue, tempOut_nullableScope4)); nullableScope = tempOut_nullableScope4.get(); - tupleScope = tempRef_tupleScope4.get(); + tupleScope = tempReference_tupleScope4.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !tupleScope.MoveNext(row, ref nullableScope); - RefObject tempRef_outerScope9 = - new RefObject(outerScope); - RefObject tempRef_temp3 = - new RefObject(temp); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_outerScope9, - tempRef_temp3)); - temp = tempRef_temp3.get(); - outerScope = tempRef_outerScope9.get(); + Reference tempReference_outerScope9 = + new Reference(outerScope); + Reference tempReference_temp3 = + new Reference(temp); + 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/PermuteExtensions.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/PermuteExtensions.java index 823bafb..7c0e016 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/PermuteExtensions.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/PermuteExtensions.java @@ -5,7 +5,7 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; /** - * Extension methods for computing permutations of . + * Extension methods for computing permutations of {@link IEnumerable{T}}. */ public final class PermuteExtensions { /** diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/ReadRowDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/ReadRowDispatcher.java index 6fe2d7e..9a29464 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/ReadRowDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/ReadRowDispatcher.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutType; @@ -20,39 +21,39 @@ import java.util.List; //ORIGINAL LINE: internal struct ReadRowDispatcher : IDispatcher public final class ReadRowDispatcher implements IDispatcher { - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t) { + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t) { Dispatch(dispatcher, root, col, t, null); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public void Dispatch(ref RowOperationDispatcher dispatcher, ref RowCursor root, // LayoutColumn col, LayoutType t, TValue expected = default) where TLayout : LayoutType - public , TValue> void Dispatch(RefObject dispatcher, RefObject root, LayoutColumn col, LayoutType t, TValue expected) { + public , TValue> void Dispatch(Reference dispatcher, Reference root, LayoutColumn col, LayoutType t, TValue expected) { TValue value; switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); - OutObject tempOut_value = new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadFixed(tempRef_Row, root, col, tempOut_value)); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); + Out tempOut_value = new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadFixed(tempReference_Row, root, col, tempOut_value)); value = tempOut_value.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); break; case Variable: - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - OutObject tempOut_value2 = new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadVariable(tempRef_Row2, root, col, tempOut_value2)); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + Out tempOut_value2 = new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadVariable(tempReference_Row2, root, col, tempOut_value2)); value = tempOut_value2.get(); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + dispatcher.get().argValue.Row = tempReference_Row2.get(); break; default: - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - OutObject tempOut_value3 = new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadSparse(tempRef_Row3, root, tempOut_value3)); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + Out tempOut_value3 = new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadSparse(tempReference_Row3, root, tempOut_value3)); value = tempOut_value3.get(); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + dispatcher.get().argValue.Row = tempReference_Row3.get(); break; } @@ -63,178 +64,178 @@ public final class ReadRowDispatcher implements IDispatcher { } } - public void DispatchArray(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchArray(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor arrayScope; - OutObject tempOut_arrayScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_arrayScope)); + Out tempOut_arrayScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_arrayScope)); arrayScope = tempOut_arrayScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); int i = 0; List items = (List)value; - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - while (arrayScope.MoveNext(tempRef_Row2)) { - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + while (arrayScope.MoveNext(tempReference_Row2)) { + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref arrayScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), items.get(i++)); } - dispatcher.get().argValue.Row = tempRef_Row2.get(); + dispatcher.get().argValue.Row = tempReference_Row2.get(); } - public void DispatchMap(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchMap(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor mapScope; - OutObject tempOut_mapScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_mapScope)); + Out tempOut_mapScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_mapScope)); mapScope = tempOut_mapScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); int i = 0; List items = (List)value; - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - while (mapScope.MoveNext(tempRef_Row2)) { - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + while (mapScope.MoveNext(tempReference_Row2)) { + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref mapScope, null, LayoutType.TypedTuple, typeArgs.clone(), items.get(i++)); } - dispatcher.get().argValue.Row = tempRef_Row2.get(); + dispatcher.get().argValue.Row = tempReference_Row2.get(); } - public void DispatchNullable(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchNullable(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor nullableScope; - OutObject tempOut_nullableScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_nullableScope)); + Out tempOut_nullableScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_nullableScope)); nullableScope = tempOut_nullableScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); if (value != null) { - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - RefObject tempRef_nullableScope = - new RefObject(nullableScope); - ResultAssert.IsSuccess(LayoutNullable.HasValue(tempRef_Row2, tempRef_nullableScope)); - nullableScope = tempRef_nullableScope.get(); - dispatcher.get().argValue.Row = tempRef_Row2.get(); - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - nullableScope.MoveNext(tempRef_Row3); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + Reference tempReference_nullableScope = + new Reference(nullableScope); + ResultAssert.IsSuccess(LayoutNullable.HasValue(tempReference_Row2, tempReference_nullableScope)); + nullableScope = tempReference_nullableScope.get(); + dispatcher.get().argValue.Row = tempReference_Row2.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + nullableScope.MoveNext(tempReference_Row3); + dispatcher.get().argValue.Row = tempReference_Row3.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref nullableScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), value); } else { - RefObject tempRef_Row4 = - new RefObject(dispatcher.get().Row); - RefObject tempRef_nullableScope2 = - new RefObject(nullableScope); - ResultAssert.NotFound(LayoutNullable.HasValue(tempRef_Row4, tempRef_nullableScope2)); - nullableScope = tempRef_nullableScope2.get(); - dispatcher.get().argValue.Row = tempRef_Row4.get(); + Reference tempReference_Row4 = + new Reference(dispatcher.get().Row); + Reference tempReference_nullableScope2 = + new Reference(nullableScope); + ResultAssert.NotFound(LayoutNullable.HasValue(tempReference_Row4, tempReference_nullableScope2)); + nullableScope = tempReference_nullableScope2.get(); + dispatcher.get().argValue.Row = tempReference_Row4.get(); } } - public void DispatchObject(RefObject dispatcher, - RefObject scope) { + public void DispatchObject(Reference dispatcher, + Reference scope) { } - public void DispatchSet(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchSet(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor setScope; - OutObject tempOut_setScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_setScope)); + Out tempOut_setScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_setScope)); setScope = tempOut_setScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); int i = 0; List items = (List)value; - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - while (setScope.MoveNext(tempRef_Row2)) { - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + while (setScope.MoveNext(tempReference_Row2)) { + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref setScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), items.get(i++)); } - dispatcher.get().argValue.Row = tempRef_Row2.get(); + dispatcher.get().argValue.Row = tempReference_Row2.get(); } - public void DispatchTuple(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchTuple(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() >= 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor tupleScope; - OutObject tempOut_tupleScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_tupleScope)); + Out tempOut_tupleScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); for (int i = 0; i < typeArgs.getCount(); i++) { - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - tupleScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + tupleScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); PropertyInfo valueAccessor = value.getClass().GetProperty(String.format("Item%1$s", i + 1)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref tupleScope, null, typeArgs.get(i).getType(), typeArgs.get(i).getTypeArgs().clone(), valueAccessor.GetValue(value)); } } - public void DispatchUDT(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchUDT(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { - RefObject tempRef_Row = new RefObject(dispatcher.get().Row); + Reference tempReference_Row = new Reference(dispatcher.get().Row); RowCursor udtScope; - OutObject tempOut_udtScope = new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempRef_Row, scope, tempOut_udtScope)); + Out tempOut_udtScope = new Out(); + ResultAssert.IsSuccess(t.TypeAs().ReadScope(tempReference_Row, scope, tempOut_udtScope)); udtScope = tempOut_udtScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); IDispatchable valueDispatcher = value instanceof IDispatchable ? (IDispatchable)value : null; assert valueDispatcher != null; - RefObject tempRef_udtScope = new RefObject(udtScope); - valueDispatcher.Dispatch(dispatcher, tempRef_udtScope); - udtScope = tempRef_udtScope.get(); + Reference tempReference_udtScope = new Reference(udtScope); + valueDispatcher.Dispatch(dispatcher, tempReference_udtScope); + udtScope = tempReference_udtScope.get(); } } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RecordIOUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RecordIOUnitTests.java index f51c0cf..af2e4fa 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RecordIOUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RecordIOUnitTests.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer; import com.azure.data.cosmos.serialization.hybridrow.Result; @@ -102,7 +103,7 @@ public class RecordIOUnitTests { return Result.Success; } - OutObject> tempOut_body = new OutObject>(); + Out> tempOut_body = new Out>(); Task tempVar5 = this.WriteAddress(resizer, addresses[index], tempOut_body); body = tempOut_body.get(); return tempVar5; @@ -121,7 +122,7 @@ public class RecordIOUnitTests { assert !record.IsEmpty; Address obj; - OutObject
tempOut_obj = new OutObject
(); + Out
tempOut_obj = new Out
(); r = this.ReadAddress(record, tempOut_obj); obj = tempOut_obj.get(); ResultAssert.IsSuccess(r); @@ -132,8 +133,8 @@ public class RecordIOUnitTests { assert !segment.IsEmpty; Segment obj; - OutObject tempOut_obj = - new OutObject(); + Out tempOut_obj = + new Out(); r = this.ReadSegment(segment, tempOut_obj); obj = tempOut_obj.get(); ResultAssert.IsSuccess(r); @@ -154,21 +155,21 @@ public class RecordIOUnitTests { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: private Result ReadAddress(Memory buffer, out Address obj) - private Result ReadAddress(Memory buffer, OutObject
obj) { + private Result ReadAddress(Memory buffer, Out
obj) { RowBuffer row = new RowBuffer(buffer.Span, HybridRowVersion.V1, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); // Use the reader to dump to the screen. - RefObject tempRef_reader = - new RefObject(reader); + Reference tempReference_reader = + new Reference(reader); String str; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Result r = DiagnosticConverter.ReaderToString(tempRef_reader, out str); - reader = tempRef_reader.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + Result r = DiagnosticConverter.ReaderToString(tempReference_reader, out str); + reader = tempReference_reader.get(); if (r != Result.Success) { obj.set(null); return r; @@ -177,33 +178,33 @@ public class RecordIOUnitTests { System.out.println(str); // Reset the reader and materialize the object. - RefObject tempRef_row2 = - new RefObject(row); - reader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_reader2 = - new RefObject(reader); - Result tempVar = AddressSerializer.Read(tempRef_reader2, obj); - reader = tempRef_reader2.get(); + Reference tempReference_row2 = + new Reference(row); + reader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_reader2 = + new Reference(reader); + Result tempVar = AddressSerializer.Read(tempReference_reader2, obj); + reader = tempReference_reader2.get(); return tempVar; } //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: private Result ReadSegment(Memory buffer, out Segment obj) - private Result ReadSegment(Memory buffer, OutObject obj) { + private Result ReadSegment(Memory buffer, Out obj) { RowBuffer row = new RowBuffer(buffer.Span, HybridRowVersion.V1, SystemSchema.LayoutResolver); - RefObject tempRef_row = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowReader reader = new RowReader(tempReference_row); + row = tempReference_row.get(); // Use the reader to dump to the screen. - RefObject tempRef_reader = - new RefObject(reader); + Reference tempReference_reader = + new Reference(reader); String str; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Result r = DiagnosticConverter.ReaderToString(tempRef_reader, out str); - reader = tempRef_reader.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: + Result r = DiagnosticConverter.ReaderToString(tempReference_reader, out str); + reader = tempReference_reader.get(); if (r != Result.Success) { obj.set(null); return r; @@ -212,12 +213,12 @@ public class RecordIOUnitTests { System.out.println(str); // Reset the reader and materialize the object. - RefObject tempRef_row2 = new RefObject(row); - reader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_reader2 = new RefObject(reader); - Result tempVar = SegmentSerializer.Read(tempRef_reader2, obj.clone()); - reader = tempRef_reader2.get(); + Reference tempReference_row2 = new Reference(row); + reader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_reader2 = new Reference(reader); + Result tempVar = SegmentSerializer.Read(tempReference_reader2, obj.clone()); + reader = tempReference_reader2.get(); return tempVar; } @@ -225,13 +226,13 @@ public class RecordIOUnitTests { //ORIGINAL LINE: private Result WriteAddress(MemorySpanResizer resizer, Address obj, out // ReadOnlyMemory buffer) private Result WriteAddress(MemorySpanResizer resizer, Address obj, - OutObject> buffer) { + Out> buffer) { RowBuffer row = new RowBuffer(RecordIOUnitTests.InitialRowSize, resizer); row.InitLayout(HybridRowVersion.V1, this.addressLayout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - Result r = RowWriter.WriteBuffer(tempRef_row, obj, AddressSerializer.Write); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + Result r = RowWriter.WriteBuffer(tempReference_row, obj, AddressSerializer.Write); + row = tempReference_row.get(); if (r != Result.Success) { buffer.set(null); return r; 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 edfa5c1..3103f8d 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.NullValue; @@ -93,11 +94,11 @@ public final class RowOperationDispatcher { } public RowReader GetReader() { - RefObject tempRef_Row = - new RefObject(this.Row); + Reference tempReference_Row = + new Reference(this.Row); // TODO: C# TO JAVA CONVERTER: The following line could not be converted: return new RowReader(ref this.Row) - this.Row = tempRef_Row.get(); + this.Row = tempReference_Row.get(); return tempVar; } @@ -121,43 +122,43 @@ public final class RowOperationDispatcher { //ORIGINAL LINE: public void LayoutCodeSwitch(string path = null, LayoutType type = null, TypeArgumentList // typeArgs = default, object value = null) public void LayoutCodeSwitch(String path, LayoutType type, TypeArgumentList typeArgs, Object value) { - RefObject tempRef_Row = - new RefObject(this.Row); - RowCursor root = RowCursor.Create(tempRef_Row); - this.Row = tempRef_Row.get(); - RefObject tempRef_root = - new RefObject(root); - this.LayoutCodeSwitch(tempRef_root, path, type, typeArgs.clone(), value); - root = tempRef_root.get(); + Reference tempReference_Row = + new Reference(this.Row); + RowCursor root = RowCursor.Create(tempReference_Row); + this.Row = tempReference_Row.get(); + Reference tempReference_root = + new Reference(root); + this.LayoutCodeSwitch(tempReference_root, path, type, typeArgs.clone(), value); + root = tempReference_root.get(); } - public void LayoutCodeSwitch(RefObject scope, String path, LayoutType type, + public void LayoutCodeSwitch(Reference scope, String path, LayoutType type, TypeArgumentList typeArgs) { LayoutCodeSwitch(scope, path, type, typeArgs, null); } - public void LayoutCodeSwitch(RefObject scope, String path, LayoutType type) { + public void LayoutCodeSwitch(Reference scope, String path, LayoutType type) { LayoutCodeSwitch(scope, path, type, null, null); } - public void LayoutCodeSwitch(RefObject scope, String path) { + public void LayoutCodeSwitch(Reference scope, String path) { LayoutCodeSwitch(scope, path, null, null, null); } - public void LayoutCodeSwitch(RefObject scope) { + public void LayoutCodeSwitch(Reference scope) { LayoutCodeSwitch(scope, null, null, null, null); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public void LayoutCodeSwitch(ref RowCursor scope, string path = null, LayoutType type = null, // TypeArgumentList typeArgs = default, object value = null) - public void LayoutCodeSwitch(RefObject scope, String path, LayoutType type, + public void LayoutCodeSwitch(Reference scope, String path, LayoutType type, TypeArgumentList typeArgs, Object value) { LayoutColumn col = null; if (type == null) { assert path != null; - OutObject tempOut_col = - new OutObject(); + Out tempOut_col = + new Out(); assert scope.get().getLayout().TryFind(path, tempOut_col); col = tempOut_col.get(); assert col != null; @@ -166,217 +167,217 @@ public final class RowOperationDispatcher { } if ((path != null) && (col == null || col.getStorage() == StorageKind.Sparse)) { - RefObject tempRef_Row = - new RefObject(this.Row); - scope.get().Find(tempRef_Row, path); - this.Row = tempRef_Row.get(); + Reference tempReference_Row = + new Reference(this.Row); + scope.get().Find(tempReference_Row, path); + this.Row = tempReference_Row.get(); } switch (type.LayoutCode) { case Null: - RefObject tempRef_this = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this, scope, col, type, NullValue.Default); - this = tempRef_this.get(); + Reference tempReference_this = new Reference(this); + this.dispatcher.Dispatch(tempReference_this, scope, col, type, NullValue.Default); + this = tempReference_this.get(); break; case Boolean: - RefObject tempRef_this2 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this2, scope, col, type, + Reference tempReference_this2 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this2, scope, col, type, value != null ? value : default) - this = tempRef_this2.get(); + this = tempReference_this2.get(); break; case Int8: - RefObject tempRef_this3 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this3, scope, col, type, value != null ? + Reference tempReference_this3 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this3, scope, col, type, value != null ? value : default) - this = tempRef_this3.get(); + this = tempReference_this3.get(); break; case Int16: - RefObject tempRef_this4 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this4, scope, col, type, value != null ? + Reference tempReference_this4 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this4, scope, col, type, value != null ? value : default) - this = tempRef_this4.get(); + this = tempReference_this4.get(); break; case Int32: - RefObject tempRef_this5 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this5, scope, col, type, + Reference tempReference_this5 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this5, scope, col, type, value != null ? value : default) - this = tempRef_this5.get(); + this = tempReference_this5.get(); break; case Int64: - RefObject tempRef_this6 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this6, scope, col, type, value != null ? + Reference tempReference_this6 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this6, scope, col, type, value != null ? value : default) - this = tempRef_this6.get(); + this = tempReference_this6.get(); break; case UInt8: - RefObject tempRef_this7 = new RefObject(this); + Reference tempReference_this7 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(tempRef_this7, scope, col, type, // (Nullable)value != null ? value : default); - this.dispatcher.Dispatch(tempRef_this7, scope, col, type, value != null ? + this.dispatcher.Dispatch(tempReference_this7, scope, col, type, value != null ? value : default) - this = tempRef_this7.get(); + this = tempReference_this7.get(); break; case UInt16: - RefObject tempRef_this8 = new RefObject(this); + Reference tempReference_this8 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(tempRef_this8, scope, col, type, // (Nullable)value != null ? value : default); - this.dispatcher.Dispatch(tempRef_this8, scope, col, type, value != null ? + this.dispatcher.Dispatch(tempReference_this8, scope, col, type, value != null ? value : default) - this = tempRef_this8.get(); + this = tempReference_this8.get(); break; case UInt32: - RefObject tempRef_this9 = new RefObject(this); + Reference tempReference_this9 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(tempRef_this9, scope, col, type, // (Nullable)value != null ? value : default); - this.dispatcher.Dispatch(tempRef_this9, scope, col, type, + this.dispatcher.Dispatch(tempReference_this9, scope, col, type, value != null ? value : default) - this = tempRef_this9.get(); + this = tempReference_this9.get(); break; case UInt64: - RefObject tempRef_this10 = new RefObject(this); + Reference tempReference_this10 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(tempRef_this10, scope, col, type, // (Nullable)value != null ? value : default); - this.dispatcher.Dispatch(tempRef_this10, scope, col, type, value != null ? + this.dispatcher.Dispatch(tempReference_this10, scope, col, type, value != null ? value : default) - this = tempRef_this10.get(); + this = tempReference_this10.get(); break; case VarInt: - RefObject tempRef_this11 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this11, scope, col, type, value != null ? + Reference tempReference_this11 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this11, scope, col, type, value != null ? value : default) - this = tempRef_this11.get(); + this = tempReference_this11.get(); break; case VarUInt: - RefObject tempRef_this12 = new RefObject(this); + Reference tempReference_this12 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(tempRef_this12, scope, col, type, // (Nullable)value != null ? value : default); - this.dispatcher.Dispatch(tempRef_this12, scope, col, type, value != null ? + this.dispatcher.Dispatch(tempReference_this12, scope, col, type, value != null ? value : default) - this = tempRef_this12.get(); + this = tempReference_this12.get(); break; case Float32: - RefObject tempRef_this13 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this13, scope, col, type, + Reference tempReference_this13 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this13, scope, col, type, value != null ? value : default) - this = tempRef_this13.get(); + this = tempReference_this13.get(); break; case Float64: - RefObject tempRef_this14 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this14, scope, col, type, + Reference tempReference_this14 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this14, scope, col, type, value != null ? value : default) - this = tempRef_this14.get(); + this = tempReference_this14.get(); break; case Float128: - RefObject tempRef_this15 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this15, scope, col, type, + Reference tempReference_this15 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this15, scope, col, type, value != null ? value : default) - this = tempRef_this15.get(); + this = tempReference_this15.get(); break; case Decimal: - RefObject tempRef_this16 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this16, scope, col, type, + Reference tempReference_this16 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this16, scope, col, type, value != null ? value : default) - this = tempRef_this16.get(); + this = tempReference_this16.get(); break; case DateTime: - RefObject tempRef_this17 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this17, scope, col, type, + Reference tempReference_this17 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this17, scope, col, type, value != null ? value : default) - this = tempRef_this17.get(); + this = tempReference_this17.get(); break; case UnixDateTime: - RefObject tempRef_this18 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this18, scope, col, type, + Reference tempReference_this18 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this18, scope, col, type, value != null ? value : default) - this = tempRef_this18.get(); + this = tempReference_this18.get(); break; case Guid: - RefObject tempRef_this19 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this19, scope, col, type, value != null ? + Reference tempReference_this19 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this19, scope, col, type, value != null ? value : default) - this = tempRef_this19.get(); + this = tempReference_this19.get(); break; case MongoDbObjectId: - RefObject tempRef_this20 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this20, scope, col, type, + Reference tempReference_this20 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this20, scope, col, type, value != null ? value : default) - this = tempRef_this20.get(); + this = tempReference_this20.get(); break; case Utf8: - RefObject tempRef_this21 = new RefObject(this); - this.dispatcher.Dispatch(tempRef_this21, scope, col, type, (String)value); - this = tempRef_this21.get(); + Reference tempReference_this21 = new Reference(this); + this.dispatcher.Dispatch(tempReference_this21, scope, col, type, (String)value); + this = tempReference_this21.get(); break; case Binary: - RefObject tempRef_this22 = new RefObject(this); + Reference tempReference_this22 = new Reference(this); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: this.dispatcher.Dispatch(ref this, ref scope, col, type, // (byte[])value); - this.dispatcher.Dispatch(tempRef_this22, scope, col, type, (byte[])value); - this = tempRef_this22.get(); + this.dispatcher.Dispatch(tempReference_this22, scope, col, type, (byte[])value); + this = tempReference_this22.get(); break; case ObjectScope: case ImmutableObjectScope: - RefObject tempRef_this23 = new RefObject(this); - this.dispatcher.DispatchObject(tempRef_this23, scope); - this = tempRef_this23.get(); + Reference tempReference_this23 = new Reference(this); + this.dispatcher.DispatchObject(tempReference_this23, scope); + this = tempReference_this23.get(); break; case TypedArrayScope: case ImmutableTypedArrayScope: - RefObject tempRef_this24 = new RefObject(this); - this.dispatcher.DispatchArray(tempRef_this24, scope, type, typeArgs.clone(), value); - this = tempRef_this24.get(); + Reference tempReference_this24 = new Reference(this); + this.dispatcher.DispatchArray(tempReference_this24, scope, type, typeArgs.clone(), value); + this = tempReference_this24.get(); break; case TypedSetScope: case ImmutableTypedSetScope: - RefObject tempRef_this25 = new RefObject(this); - this.dispatcher.DispatchSet(tempRef_this25, scope, type, typeArgs.clone(), value); - this = tempRef_this25.get(); + Reference tempReference_this25 = new Reference(this); + this.dispatcher.DispatchSet(tempReference_this25, scope, type, typeArgs.clone(), value); + this = tempReference_this25.get(); break; case TypedMapScope: case ImmutableTypedMapScope: - RefObject tempRef_this26 = new RefObject(this); - this.dispatcher.DispatchMap(tempRef_this26, scope, type, typeArgs.clone(), value); - this = tempRef_this26.get(); + Reference tempReference_this26 = new Reference(this); + this.dispatcher.DispatchMap(tempReference_this26, scope, type, typeArgs.clone(), value); + this = tempReference_this26.get(); break; case TupleScope: case ImmutableTupleScope: @@ -386,20 +387,20 @@ public final class RowOperationDispatcher { case ImmutableTaggedScope: case Tagged2Scope: case ImmutableTagged2Scope: - RefObject tempRef_this27 = new RefObject(this); - this.dispatcher.DispatchTuple(tempRef_this27, scope, type, typeArgs.clone(), value); - this = tempRef_this27.get(); + Reference tempReference_this27 = new Reference(this); + this.dispatcher.DispatchTuple(tempReference_this27, scope, type, typeArgs.clone(), value); + this = tempReference_this27.get(); break; case NullableScope: - RefObject tempRef_this28 = new RefObject(this); - this.dispatcher.DispatchNullable(tempRef_this28, scope, type, typeArgs.clone(), value); - this = tempRef_this28.get(); + Reference tempReference_this28 = new Reference(this); + this.dispatcher.DispatchNullable(tempReference_this28, scope, type, typeArgs.clone(), value); + this = tempReference_this28.get(); break; case Schema: case ImmutableSchema: - RefObject tempRef_this29 = new RefObject(this); - this.dispatcher.DispatchUDT(tempRef_this29, scope, type, typeArgs.clone(), value); - this = tempRef_this29.get(); + Reference tempReference_this29 = new Reference(this); + this.dispatcher.DispatchUDT(tempReference_this29, scope, type, typeArgs.clone(), value); + this = tempReference_this29.get(); break; default: if (logger.) diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowReaderUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowReaderUnitTests.java index 9147477..7c5471c 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowReaderUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/RowReaderUnitTests.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.MemorySpanResizer; @@ -42,9 +43,9 @@ public final class RowReaderUnitTests { this.resolver = new LayoutResolverNamespace(this.schema); } - public static void PrintReader(RefObject reader, int indent) { + public static void PrintReader(Reference reader, int indent) { String str; - OutObject tempOut_str = new OutObject(); + Out tempOut_str = new Out(); ResultAssert.IsSuccess(DiagnosticConverter.ReaderToString(reader, tempOut_str)); str = tempOut_str.get(); System.out.println(str); @@ -182,10 +183,10 @@ public final class RowReaderUnitTests { RowReader reader = d.GetReader().clone(); assert reader.getLength() == d.Row.getLength(); - RefObject tempRef_reader = - new RefObject(reader); - RowReaderUnitTests.PrintReader(tempRef_reader, 0); - reader = tempRef_reader.get(); + Reference tempReference_reader = + new Reference(reader); + RowReaderUnitTests.PrintReader(tempReference_reader, 0); + reader = tempReference_reader.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -199,59 +200,59 @@ public final class RowReaderUnitTests { "Mixed")).SchemaId); row.InitLayout(HybridRowVersion.V1, layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempRef_row, 2, RowReaderUnitTests.WriteNestedDocument)); - row = tempRef_row.get(); - RefObject tempRef_row2 = - new RefObject(row); - RowReader rowReader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); + Reference tempReference_row = + new Reference(row); + ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempReference_row, 2, RowReaderUnitTests.WriteNestedDocument)); + row = tempReference_row.get(); + Reference tempReference_row2 = + new Reference(row); + RowReader rowReader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); - RefObject tempRef_rowReader = - new RefObject(rowReader); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentDelegate(tempRef_rowReader, 0)); - rowReader = tempRef_rowReader.get(); + Reference tempReference_rowReader = + new Reference(rowReader); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentDelegate(tempReference_rowReader, 0)); + rowReader = tempReference_rowReader.get(); - RefObject tempRef_row3 = - new RefObject(row); - rowReader = new RowReader(tempRef_row3); - row = tempRef_row3.get(); - RefObject tempRef_rowReader2 = - new RefObject(rowReader); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempRef_rowReader2, 0)); - rowReader = tempRef_rowReader2.get(); + Reference tempReference_row3 = + new Reference(row); + rowReader = new RowReader(tempReference_row3); + row = tempReference_row3.get(); + Reference tempReference_rowReader2 = + new Reference(rowReader); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempReference_rowReader2, 0)); + rowReader = tempReference_rowReader2.get(); - RefObject tempRef_row4 = - new RefObject(row); - rowReader = new RowReader(tempRef_row4); - row = tempRef_row4.get(); - RefObject tempRef_rowReader3 = - new RefObject(rowReader); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegateWithSkipScope(tempRef_rowReader3, 0)); - rowReader = tempRef_rowReader3.get(); + Reference tempReference_row4 = + new Reference(row); + rowReader = new RowReader(tempReference_row4); + row = tempReference_row4.get(); + Reference tempReference_rowReader3 = + new Reference(rowReader); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegateWithSkipScope(tempReference_rowReader3, 0)); + rowReader = tempReference_rowReader3.get(); // SkipScope not okay after advancing parent - RefObject tempRef_row5 = - new RefObject(row); - rowReader = new RowReader(tempRef_row5); - row = tempRef_row5.get(); + Reference tempReference_row5 = + new Reference(row); + rowReader = new RowReader(tempReference_row5); + row = tempReference_row5.get(); assert rowReader.Read(); assert rowReader.getType().LayoutCode == LayoutCode.ObjectScope; RowReader nestedScope = rowReader.ReadScope().clone(); - RefObject tempRef_nestedScope = - new RefObject(nestedScope); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentDelegate(tempRef_nestedScope, 0)); - nestedScope = tempRef_nestedScope.get(); + Reference tempReference_nestedScope = + new Reference(nestedScope); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentDelegate(tempReference_nestedScope, 0)); + nestedScope = tempReference_nestedScope.get(); assert rowReader.Read(); - RefObject tempRef_nestedScope2 = - new RefObject(nestedScope); - Result result = rowReader.SkipScope(tempRef_nestedScope2); - nestedScope = tempRef_nestedScope2.get(); + Reference tempReference_nestedScope2 = + new Reference(nestedScope); + Result result = rowReader.SkipScope(tempReference_nestedScope2); + nestedScope = tempReference_nestedScope2.get(); assert Result.Success != result; } - private static Result ReadNestedDocumentDelegate(RefObject reader, int context) { + private static Result ReadNestedDocumentDelegate(Reference reader, int context) { while (reader.get().Read()) { switch (reader.get().getType().LayoutCode) { case TupleScope: { @@ -269,24 +270,24 @@ public final class RowReaderUnitTests { return Result.Success; } - private static Result ReadNestedDocumentNonDelegate(RefObject reader, int context) { + private static Result ReadNestedDocumentNonDelegate(Reference reader, int context) { while (reader.get().Read()) { switch (reader.get().getType().LayoutCode) { case TupleScope: { RowReader nested = reader.get().ReadScope().clone(); - RefObject tempRef_nested = - new RefObject(nested); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadTuplePartial(tempRef_nested, 0)); - nested = tempRef_nested.get(); + Reference tempReference_nested = + new Reference(nested); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadTuplePartial(tempReference_nested, 0)); + nested = tempReference_nested.get(); break; } case ObjectScope: { RowReader nested = reader.get().ReadScope().clone(); - RefObject tempRef_nested2 = - new RefObject(nested); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempRef_nested2, 0)); - nested = tempRef_nested2.get(); + Reference tempReference_nested2 = + new Reference(nested); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempReference_nested2, 0)); + nested = tempReference_nested2.get(); ResultAssert.IsSuccess(reader.get().ReadScope(0, RowReaderUnitTests.ReadNestedDocumentDelegate)); break; } @@ -296,33 +297,33 @@ public final class RowReaderUnitTests { return Result.Success; } - private static Result ReadNestedDocumentNonDelegateWithSkipScope(RefObject reader, + private static Result ReadNestedDocumentNonDelegateWithSkipScope(Reference reader, int context) { while (reader.get().Read()) { switch (reader.get().getType().LayoutCode) { case TupleScope: { RowReader nested = reader.get().ReadScope().clone(); - RefObject tempRef_nested = - new RefObject(nested); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadTuplePartial(tempRef_nested, 0)); - nested = tempRef_nested.get(); - RefObject tempRef_nested2 = - new RefObject(nested); - ResultAssert.IsSuccess(reader.get().SkipScope(tempRef_nested2)); - nested = tempRef_nested2.get(); + Reference tempReference_nested = + new Reference(nested); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadTuplePartial(tempReference_nested, 0)); + nested = tempReference_nested.get(); + Reference tempReference_nested2 = + new Reference(nested); + ResultAssert.IsSuccess(reader.get().SkipScope(tempReference_nested2)); + nested = tempReference_nested2.get(); break; } case ObjectScope: { RowReader nested = reader.get().ReadScope().clone(); - RefObject tempRef_nested3 = - new RefObject(nested); - ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempRef_nested3, 0)); - nested = tempRef_nested3.get(); + Reference tempReference_nested3 = + new Reference(nested); + ResultAssert.IsSuccess(RowReaderUnitTests.ReadNestedDocumentNonDelegate(tempReference_nested3, 0)); + nested = tempReference_nested3.get(); ResultAssert.IsSuccess(reader.get().ReadScope(0, RowReaderUnitTests.ReadNestedDocumentDelegate)); - RefObject tempRef_nested4 = new RefObject(nested); - ResultAssert.IsSuccess(reader.get().SkipScope(tempRef_nested4)); - nested = tempRef_nested4.get(); + Reference tempReference_nested4 = new Reference(nested); + ResultAssert.IsSuccess(reader.get().SkipScope(tempReference_nested4)); + nested = tempReference_nested4.get(); break; } } @@ -331,14 +332,14 @@ public final class RowReaderUnitTests { return Result.Success; } - private static Result ReadTuplePartial(RefObject reader, int unused) { + private static Result ReadTuplePartial(Reference reader, int unused) { // Read only part of our tuple assert reader.get().Read(); assert reader.get().Read(); return Result.Success; } - private static Result WriteNestedDocument(RefObject writer, TypeArgument typeArgument, + private static Result WriteNestedDocument(Reference writer, TypeArgument typeArgument, int level) { TypeArgument tupleArgument = new TypeArgument(LayoutType.Tuple, new TypeArgumentList(new TypeArgument[] { @@ -384,12 +385,12 @@ public final class RowReaderUnitTests { this.Y = y; } - public void Dispatch(RefObject dispatcher, RefObject scope) { + public void Dispatch(Reference dispatcher, Reference scope) { dispatcher.get().LayoutCodeSwitch(scope, "x", value:this.X) dispatcher.get().LayoutCodeSwitch(scope, "y", value:this.Y) } - public Result Write(RefObject writer, TypeArgument typeArg) { + public Result Write(Reference writer, TypeArgument typeArg) { Result result = writer.get().WriteInt32("x", this.X); if (result != Result.Success) { return result; 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 e19565b..81e77ce 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Float128; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.NullValue; @@ -54,12 +55,12 @@ public final class RowWriterUnitTests { row.InitLayout(HybridRowVersion.V1, layout, this.resolver); int writerLength = 0; - RefObject tempRef_row = - new RefObject(row); + Reference tempReference_row = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: - ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempRef_row, null, (ref RowWriter writer, - TypeArgument rootTypeArg, Object ignored) -> + ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempReference_row, null, (ref RowWriter writer, + TypeArgument rootTypeArg, Object ignored) -> { ResultAssert.IsSuccess(writer.WriteNull("null")); ResultAssert.IsSuccess(writer.WriteBool("bool", true)); @@ -127,8 +128,8 @@ public final class RowWriterUnitTests { new ReadOnlySequence(new byte[] { (byte)0, (byte)1, (byte)2 }))); LayoutColumn col; - OutObject tempOut_col = - new OutObject(); + Out tempOut_col = + 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, @@ -141,8 +142,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col2 = - new OutObject(); + Out tempOut_col2 = + new Out(); assert layout.TryFind("array_t>", tempOut_col2); col = tempOut_col2.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new float[][] @@ -166,8 +167,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col3 = - new OutObject(); + Out tempOut_col3 = + 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", @@ -180,8 +181,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col4 = - new OutObject(); + Out tempOut_col4 = + new Out(); assert layout.TryFind("tuple", tempOut_col4); col = tempOut_col4.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), @@ -194,8 +195,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col5 = - new OutObject(); + Out tempOut_col5 = + new Out(); assert layout.TryFind("tuple>", tempOut_col5); col = tempOut_col5.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), @@ -216,8 +217,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col6 = - new OutObject(); + Out tempOut_col6 = + new Out(); assert layout.TryFind("tuple", tempOut_col6); col = tempOut_col6.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create(false, @@ -225,23 +226,23 @@ public final class RowWriterUnitTests { RowReaderUnitTests.Point> values) -> { ResultAssert.IsSuccess(writer2.WriteBool(null, values.Item1)); - RefObject tempRef_writer3 = - new RefObject(writer3); + Reference tempReference_writer3 = + new Reference(writer3); ResultAssert.IsSuccess(writer2.WriteScope(null, typeArg.getTypeArgs().get(1).clone(), values.Item2, - (ref RowWriter writer3, TypeArgument typeArg2, IRowSerializable values2) -> values2.Write(tempRef_writer3, typeArg2.clone()))); - writer3 = tempRef_writer3.get(); + (ref RowWriter writer3, TypeArgument typeArg2, IRowSerializable values2) -> values2.Write(tempReference_writer3, typeArg2.clone()))); + writer3 = tempReference_writer3.get(); return Result.Success; })); - OutObject tempOut_col7 = - new OutObject(); + Out tempOut_col7 = + new Out(); assert layout.TryFind("nullable", tempOut_col7); col = tempOut_col7.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), Tuple.Create(null, (Long)123L), (ref RowWriter writer2, TypeArgument typeArg, Tuple values) -> { - RowWriter.WriterFunc f0 = (RefObject writer, TypeArgument typeArg, + RowWriter.WriterFunc f0 = (Reference writer, TypeArgument typeArg, Integer context) -> null.invoke(writer, typeArg.clone(), context); if (values.Item1 != null) { f0 = (ref RowWriter writer3, TypeArgument typeArg2, Integer value) -> writer3.WriteInt32(null, @@ -251,7 +252,7 @@ public final class RowWriterUnitTests { ResultAssert.IsSuccess(writer2.WriteScope(null, typeArg.getTypeArgs().get(0).clone(), values.Item1, f0)); - RowWriter.WriterFunc f1 = (RefObject writer, TypeArgument typeArg, + RowWriter.WriterFunc f1 = (Reference writer, TypeArgument typeArg, Long context) -> null.invoke(writer, typeArg.clone(), context); if (values.Item2 != null) { f1 = (ref RowWriter writer3, TypeArgument typeArg2, Long value) -> writer3.WriteInt64(null, @@ -263,8 +264,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col8 = - new OutObject(); + Out tempOut_col8 = + 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, @@ -275,8 +276,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col9 = - new OutObject(); + Out tempOut_col9 = + 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, @@ -288,8 +289,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col10 = - new OutObject(); + Out tempOut_col10 = + 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", @@ -302,8 +303,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col11 = - new OutObject(); + Out tempOut_col11 = + new Out(); assert layout.TryFind("set_t>", tempOut_col11); col = tempOut_col11.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new byte[][] @@ -328,8 +329,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col12 = - new OutObject(); + Out tempOut_col12 = + new Out(); assert layout.TryFind("set_t>", tempOut_col12); col = tempOut_col12.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), new int[][] @@ -354,8 +355,8 @@ public final class RowWriterUnitTests { return Result.Success; })); - OutObject tempOut_col13 = - new OutObject(); + Out tempOut_col13 = + new Out(); assert layout.TryFind("set_t", tempOut_col13); col = tempOut_col13.get(); ResultAssert.IsSuccess(writer.WriteScope(col.getPath(), col.getTypeArg().clone(), @@ -367,18 +368,18 @@ public final class RowWriterUnitTests { }, (ref RowWriter writer2, TypeArgument typeArg, RowReaderUnitTests.Point[] values) -> { for (RowReaderUnitTests.Point value : values) { - RefObject tempRef_writer3 = - new RefObject(writer3); + Reference tempReference_writer3 = + new Reference(writer3); ResultAssert.IsSuccess(writer2.WriteScope(null, typeArg.getTypeArgs().get(0).clone(), value, - (ref RowWriter writer3, TypeArgument typeArg2, IRowSerializable values2) -> values2.Write(tempRef_writer3, typeArg2.clone()))); - writer3 = tempRef_writer3.get(); + (ref RowWriter writer3, TypeArgument typeArg2, IRowSerializable values2) -> values2.Write(tempReference_writer3, typeArg2.clone()))); + writer3 = tempReference_writer3.get(); } return Result.Success; })); - OutObject tempOut_col14 = - new OutObject(); + Out tempOut_col14 = + 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 tempOut_col15 = - new OutObject(); + Out tempOut_col15 = + 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 tempOut_col16 = - new OutObject(); + Out tempOut_col16 = + 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 tempOut_col17 = - new OutObject(); + Out tempOut_col17 = + 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) -> @@ -482,9 +483,9 @@ public final class RowWriterUnitTests { ResultAssert.IsSuccess(writer2.WriteScope(null, new TypeArgument(LayoutType.TypedTuple, typeArg.getTypeArgs().clone()), value, (ref RowWriter writer3, TypeArgument typeArg2, Tuple values2) -> { ResultAssert.IsSuccess(writer3.WriteFloat64(null, values2.Item1)); - RefObject tempRef_writer4 = new RefObject(writer4); - ResultAssert.IsSuccess(writer3.WriteScope(null, typeArg2.getTypeArgs().get(1).clone(), values2.Item2, (ref RowWriter writer4, TypeArgument typeArg3, IRowSerializable values3) -> values3.Write(tempRef_writer4, typeArg3.clone()))); - writer4 = tempRef_writer4.get(); + Reference tempReference_writer4 = new Reference(writer4); + ResultAssert.IsSuccess(writer3.WriteScope(null, typeArg2.getTypeArgs().get(1).clone(), values2.Item2, (ref RowWriter writer4, TypeArgument typeArg3, IRowSerializable values3) -> values3.Write(tempReference_writer4, typeArg3.clone()))); + writer4 = tempReference_writer4.get(); return Result.Success; })); @@ -497,14 +498,14 @@ public final class RowWriterUnitTests { writerLength = writer.Length; return Result.Success; })); - row = tempRef_row.get(); + row = tempReference_row.get(); - RefObject tempRef_row2 = new RefObject(row); - RowReader reader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); + Reference tempReference_row2 = new Reference(row); + RowReader reader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); assert reader.getLength() == writerLength; - RefObject tempRef_reader = new RefObject(reader); - RowReaderUnitTests.PrintReader(tempRef_reader, 0); - reader = tempRef_reader.get(); + Reference tempReference_reader = new Reference(reader); + RowReaderUnitTests.PrintReader(tempReference_reader, 0); + reader = tempReference_reader.get(); } } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/SerializerUnitTest.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/SerializerUnitTest.java index 2c6f1aa..58c6a11 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/SerializerUnitTest.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/SerializerUnitTest.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -67,39 +68,39 @@ public final class SerializerUnitTest { // Write the request by serializing it to a row. RowBuffer row = new RowBuffer(SerializerUnitTest.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - Result r = RowWriter.WriteBuffer(tempRef_row, request, BatchRequestSerializer.Write); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + Result r = RowWriter.WriteBuffer(tempReference_row, request, BatchRequestSerializer.Write); + row = tempReference_row.get(); assert Result.Success == r; System.out.printf("Length of serialized row: %1$s" + "\r\n", row.getLength()); // Read the row back again. - RefObject tempRef_row2 = - new RefObject(row); - RowReader reader = new RowReader(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_reader = - new RefObject(reader); + Reference tempReference_row2 = + new Reference(row); + RowReader reader = new RowReader(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_reader = + new Reference(reader); BatchRequest _; - OutObject tempOut__ = new OutObject(); - r = BatchRequestSerializer.Read(tempRef_reader, tempOut__); + Out tempOut__ = new Out(); + r = BatchRequestSerializer.Read(tempReference_reader, tempOut__); _ = tempOut__.get(); - reader = tempRef_reader.get(); + reader = tempReference_reader.get(); assert Result.Success == r; // Dump the materialized request to the console. - RefObject tempRef_row3 = - new RefObject(row); - reader = new RowReader(tempRef_row3); - row = tempRef_row3.get(); - RefObject tempRef_reader2 = - new RefObject(reader); + Reference tempReference_row3 = + new Reference(row); + reader = new RowReader(tempReference_row3); + row = tempReference_row3.get(); + Reference tempReference_reader2 = + new Reference(reader); String dumpStr; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - r = DiagnosticConverter.ReaderToString(tempRef_reader2, out dumpStr); - reader = tempRef_reader2.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + r = DiagnosticConverter.ReaderToString(tempReference_reader2, out dumpStr); + reader = tempReference_reader2.get(); assert Result.Success == r; System.out.println(dumpStr); } @@ -136,14 +137,14 @@ public final class SerializerUnitTest { public static final TypeArgument TypeArg = new TypeArgument(LayoutType.UDT, new TypeArgumentList(new SchemaId(2))); - public static Result Read(RefObject reader, OutObject operation) { + public static Result Read(Reference reader, Out operation) { BatchOperation retval = new BatchOperation(); operation.set(null); while (reader.get().Read()) { Result r; switch (reader.get().getPath()) { case "operationType": - OutObject tempOut_OperationType = new OutObject(); + Out tempOut_OperationType = new Out(); r = reader.get().ReadInt32(tempOut_OperationType); retval.OperationType = tempOut_OperationType.get(); if (r != Result.Success) { @@ -152,21 +153,21 @@ public final class SerializerUnitTest { break; case "headers": - RefObject tempRef_child = new RefObject(child); - OutObject tempOut_Headers = new OutObject(); + Reference tempReference_child = new Reference(child); + Out tempOut_Headers = new Out(); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword // - these are not converted by C# to Java Converter: r = reader.get().ReadScope(retval, - (ref RowReader child, BatchOperation parent) -> BatchRequestHeadersSerializer.Read(tempRef_child, tempOut_Headers)); + (ref RowReader child, BatchOperation parent) -> BatchRequestHeadersSerializer.Read(tempReference_child, tempOut_Headers)); parent.Headers = tempOut_Headers.get(); - child = tempRef_child.get(); + child = tempReference_child.get(); if (r != Result.Success) { return r; } break; case "resourceType": - OutObject tempOut_ResourceType = new OutObject(); + Out tempOut_ResourceType = new Out(); r = reader.get().ReadInt32(tempOut_ResourceType); retval.ResourceType = tempOut_ResourceType.get(); if (r != Result.Success) { @@ -175,7 +176,7 @@ public final class SerializerUnitTest { break; case "resourcePath": - OutObject tempOut_ResourcePath = new OutObject(); + Out tempOut_ResourcePath = new Out(); r = reader.get().ReadString(tempOut_ResourcePath); retval.ResourcePath = tempOut_ResourcePath.get(); if (r != Result.Success) { @@ -184,7 +185,7 @@ public final class SerializerUnitTest { break; case "resourceBody": - OutObject tempOut_ResourceBody = new OutObject(); + Out tempOut_ResourceBody = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: r = reader.ReadBinary(out retval.ResourceBody); r = reader.get().ReadBinary(tempOut_ResourceBody); @@ -201,7 +202,7 @@ public final class SerializerUnitTest { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, + public static Result Write(Reference writer, TypeArgument typeArg, BatchOperation operation) { Result r = writer.get().WriteInt32("operationType", operation.OperationType); if (r != Result.Success) { @@ -241,14 +242,14 @@ public final class SerializerUnitTest { public static final TypeArgument TypeArg = new TypeArgument(LayoutType.UDT, new TypeArgumentList(new SchemaId(1))); - public static Result Read(RefObject reader, - OutObject header) { + public static Result Read(Reference reader, + Out header) { BatchRequestHeaders retval = new BatchRequestHeaders(); header.set(null); while (reader.get().Read()) { switch (reader.get().getPath()) { case "sampleRequestHeader": - OutObject tempOut_SampleRequestHeader = new OutObject(); + Out tempOut_SampleRequestHeader = new Out(); Result r = reader.get().ReadInt64(tempOut_SampleRequestHeader); retval.SampleRequestHeader = tempOut_SampleRequestHeader.get(); if (r != Result.Success) { @@ -263,7 +264,7 @@ public final class SerializerUnitTest { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, + public static Result Write(Reference writer, TypeArgument typeArg, BatchRequestHeaders header) { Result r = writer.get().WriteInt64("sampleRequestHeader", header.SampleRequestHeader); return r; @@ -273,12 +274,12 @@ public final class SerializerUnitTest { public static class BatchRequestSerializer { public static final TypeArgument OperationsTypeArg = new TypeArgument(LayoutType.TypedArray, new TypeArgumentList(new TypeArgument[] { BatchOperationSerializer.TypeArg })); - public static Result Read(RefObject reader, OutObject request) { + public static Result Read(Reference reader, Out request) { assert reader.get().Read(); checkState(reader.get().getPath().equals("operations")); java.util.ArrayList operations; - OutObject> tempOut_operations = new OutObject>(); + Out> tempOut_operations = new Out>(); Result r = RowReaderExtensions.ReadList(reader.get().clone(), BatchOperationSerializer.Read, tempOut_operations); operations = tempOut_operations.get(); if (r != Result.Success) { @@ -292,7 +293,7 @@ public final class SerializerUnitTest { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, BatchRequest request) { + public static Result Write(Reference writer, TypeArgument typeArg, BatchRequest request) { // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not converted by C# to Java Converter: return writer.get().WriteScope("operations", BatchRequestSerializer.OperationsTypeArg, request.Operations, (ref RowWriter writer2, TypeArgument typeArg2, ArrayList operations) -> { diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TaggedUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TaggedUnitTests.java index 63bb36f..cb05446 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TaggedUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TaggedUnitTests.java @@ -4,7 +4,8 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -35,26 +36,26 @@ public final class TaggedUnitTests { //ORIGINAL LINE: c1.Tag2 = ((byte)2, 28, 1974L); c1.Tag2 = ((byte)2, 28, 1974L) - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteTaggedApi(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteTaggedApi(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - TaggedApi c2 = this.ReadTaggedApi(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + TaggedApi c2 = this.ReadTaggedApi(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert c1 == c2; } @@ -68,31 +69,31 @@ public final class TaggedUnitTests { "TaggedApi")).SchemaId); } - private TaggedApi ReadTaggedApi(RefObject row, RefObject root) { + private TaggedApi ReadTaggedApi(Reference row, Reference root) { TaggedApi pc = new TaggedApi(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("tag1", out c); assert c.Type.Immutable; RowCursor tag1Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tag1Scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref tag1Scope, out tag1Scope) == Result.Success) { assert tag1Scope.Immutable; assert tag1Scope.MoveNext(row); byte apiCode; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(ref row, ref @@ -102,36 +103,36 @@ public final class TaggedUnitTests { assert tag1Scope.MoveNext(row); String str; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().ReadSparse(row, ref tag1Scope, out str)); pc.Tag1 = (apiCode, str) } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("tag2", out c); assert !c.Type.Immutable; RowCursor tag2Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tag2Scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref tag2Scope, out tag2Scope) == Result.Success) { assert !tag2Scope.Immutable; assert tag2Scope.MoveNext(row); byte apiCode; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(ref row, ref @@ -141,19 +142,19 @@ public final class TaggedUnitTests { assert tag2Scope.MoveNext(row); int val1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().ReadSparse(row, ref tag2Scope, out val1)); assert tag2Scope.MoveNext(row); long val2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[2].Type.TypeAs().ReadSparse(row, ref tag2Scope, out val2)); pc.Tag2 = (apiCode, val1, val2) @@ -162,52 +163,52 @@ public final class TaggedUnitTests { return pc; } - private void WriteTaggedApi(RefObject row, RefObject root, TaggedApi pc) { + private void WriteTaggedApi(Reference row, Reference root, TaggedApi pc) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("tag1", out c); RowCursor tag1Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tag1Scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref tag1Scope, c.TypeArgs, out tag1Scope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref tag1Scope, pc.Tag1.Item1)); assert tag1Scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().WriteSparse(row, ref tag1Scope, pc.Tag1.Item2)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("tag2", out c); RowCursor tag2Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tag2Scope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref tag2Scope, c.TypeArgs, out tag2Scope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref tag2Scope, pc.Tag2.Item1)); assert tag2Scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().WriteSparse(row, ref tag2Scope, pc.Tag2.Item2)); assert tag2Scope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: ResultAssert.IsSuccess(c.TypeArgs[2].Type.TypeAs().WriteSparse(row, ref tag2Scope, pc.Tag2.Item3)); } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TupleUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TupleUnitTests.java index 8ef5c42..fb650ba 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TupleUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TupleUnitTests.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -43,26 +44,26 @@ public final class TupleUnitTests { tempVar.Lng = 40L; c1.Coord = Tuple.Create("units", tempVar); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - PerfCounter c2 = this.ReadCounter(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + PerfCounter c2 = this.ReadCounter(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert c1 == c2; } @@ -73,26 +74,26 @@ public final class TupleUnitTests { row.InitLayout(HybridRowVersion.V1, this.countersLayout, this.countersResolver); PerfCounter c1 = this.counterExample; - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - PerfCounter c2 = this.ReadCounter(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + PerfCounter c2 = this.ReadCounter(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert c1 == c2; } @@ -106,26 +107,26 @@ public final class TupleUnitTests { c1.Name = "RowInserts"; c1.MinMaxValue = Tuple.Create("units", Tuple.Create(12L, 542L, 12046L)); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - PerfCounter c2 = this.ReadCounter(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + PerfCounter c2 = this.ReadCounter(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert c1 == c2; } @@ -139,53 +140,53 @@ public final class TupleUnitTests { LayoutColumn col; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert layout.TryFind("history", out col); StringToken historyToken; - OutObject tempOut_historyToken = - new OutObject(); + Out tempOut_historyToken = + new Out(); assert layout.getTokenizer().TryFindToken(col.Path, tempOut_historyToken); historyToken = tempOut_historyToken.get(); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor history; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row, out history).Find(tempRef_row2, historyToken); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row, out history).Find(tempReference_row2, historyToken); + row = tempReference_row2.get(); + row = tempReference_row.get(); int ctx = 1; // ignored - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_history = - new RefObject(history); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_history = + new Reference(history); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not // converted by C# to Java Converter: - ResultAssert.IsSuccess(LayoutType.TypedArray.WriteScope(tempRef_row3, tempRef_history, col.TypeArgs, ctx, + ResultAssert.IsSuccess(LayoutType.TypedArray.WriteScope(tempReference_row3, tempReference_history, col.TypeArgs, ctx, (ref RowBuffer row2, ref RowCursor arrCur, int ctx2) -> { for (int i = 0; i < 5; i++) { - RefObject tempRef_row2 = - new RefObject(row2); - RefObject tempRef_arrCur = - new RefObject(arrCur); - ResultAssert.IsSuccess(LayoutType.UDT.WriteScope(tempRef_row2, tempRef_arrCur, + Reference tempReference_row2 = + new Reference(row2); + Reference tempReference_arrCur = + new Reference(arrCur); + ResultAssert.IsSuccess(LayoutType.UDT.WriteScope(tempReference_row2, tempReference_arrCur, arrCur.ScopeTypeArgs[0].TypeArgs, i, (ref RowBuffer row3, ref RowCursor udtCur, int ctx3) -> { LayoutColumn col3; assert udtCur.Layout.TryFind("minmeanmax", out col3); - RefObject tempRef_row3 = - new RefObject(row3); - RefObjecttempRef_row32 = new RefObject (row3); - ResultAssert.IsSuccess(LayoutType.TypedTuple.WriteScope(tempRef_row3, udtCur.Find(tempRef_row32, + Reference tempReference_row3 = + new Reference(row3); + ReferencetempRef_row32 = new Reference (row3); + ResultAssert.IsSuccess(LayoutType.TypedTuple.WriteScope(tempReference_row3, udtCur.Find(tempRef_row32, col3.Path), col3.TypeArgs, ctx3, (ref RowBuffer row4, ref RowCursor tupCur, int ctx4) -> { if (ctx4 > 0) { - RefObjecttempRef_row4 = new RefObjecttempRef_row4 = new Reference (row4); - RefObjecttempRef_tupCur = new RefObjecttempRef_tupCur = new Reference (tupCur); ResultAssert.IsSuccess(LayoutType.Utf8.WriteSparse(tempRef_row4, tempRef_tupCur, "abc")); tupCur = tempRef_tupCur.argValue; @@ -193,76 +194,77 @@ public final class TupleUnitTests { } if (ctx4 > 1) { - RefObjecttempRef_row42 = new RefObjecttempRef_row42 = new Reference (row4); assert tupCur.MoveNext(tempRef_row42); row4 = tempRef_row42.argValue; - RefObject tempRef_row43 = new RefObject(row4); - RefObject tempRef_tupCur2 = new RefObject(tupCur); - ResultAssert.IsSuccess(LayoutType.TypedTuple.WriteScope(tempRef_row43, tempRef_tupCur2, + Reference tempReference_row43 = new Reference(row4); + Reference tempReference_tupCur2 = new Reference(tupCur); + ResultAssert.IsSuccess(LayoutType.TypedTuple.WriteScope(tempReference_row43, + tempReference_tupCur2, tupCur.ScopeTypeArgs[1].TypeArgs, ctx4, (ref RowBuffer row5, ref RowCursor tupCur2, int ctx5) -> { if (ctx5 > 1) { - RefObject tempRef_row5 = new RefObject(row5); - RefObject tempRef_tupCur2 = new RefObject(tupCur2); - ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempRef_row5, tempRef_tupCur2 + Reference tempReference_row5 = new Reference(row5); + Reference tempReference_tupCur2 = new Reference(tupCur2); + ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempReference_row5, tempReference_tupCur2 , ctx5)); - tupCur2 = tempRef_tupCur2.get(); - row5 = tempRef_row5.get(); + tupCur2 = tempReference_tupCur2.get(); + row5 = tempReference_row5.get(); } if (ctx5 > 2) { - RefObjecttempRef_row52 = new RefObjecttempRef_row52 = new Reference (row5); assert tupCur2.MoveNext(tempRef_row52); row5 = tempRef_row52.argValue; - RefObject tempRef_row53 = new RefObject(row5); - RefObject tempRef_tupCur22 = new RefObject(tupCur2); - ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempRef_row53, - tempRef_tupCur22, ctx5)); - tupCur2 = tempRef_tupCur22.get(); - row5 = tempRef_row53.get(); + Reference tempReference_row53 = new Reference(row5); + Reference tempReference_tupCur22 = new Reference(tupCur2); + ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempReference_row53, + tempReference_tupCur22, ctx5)); + tupCur2 = tempReference_tupCur22.get(); + row5 = tempReference_row53.get(); } if (ctx5 > 3) { - RefObjecttempRef_row54 = new RefObjecttempRef_row54 = new Reference (row5); assert tupCur2.MoveNext(tempRef_row54); row5 = tempRef_row54.argValue; - RefObject tempRef_row55 = new RefObject(row5); - RefObject tempRef_tupCur23 = new RefObject(tupCur2); - ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempRef_row55, - tempRef_tupCur23, ctx5)); - tupCur2 = tempRef_tupCur23.get(); - row5 = tempRef_row55.get(); + Reference tempReference_row55 = new Reference(row5); + Reference tempReference_tupCur23 = new Reference(tupCur2); + ResultAssert.IsSuccess(LayoutType.Int64.WriteSparse(tempReference_row55, + tempReference_tupCur23, ctx5)); + tupCur2 = tempReference_tupCur23.get(); + row5 = tempReference_row55.get(); } return Result.Success; })); - tupCur = tempRef_tupCur2.get(); - row4 = tempRef_row43.get(); + tupCur = tempReference_tupCur2.get(); + row4 = tempReference_row43.get(); } return Result.Success; })); row3 = tempRef_row32.argValue; - row3 = tempRef_row3.get(); + row3 = tempReference_row3.get(); return Result.Success; })); - arrCur = tempRef_arrCur.get(); - row2 = tempRef_row2.get(); + arrCur = tempReference_arrCur.get(); + row2 = tempReference_row2.get(); - RefObjecttempRef_row22 = new RefObject (row2); + ReferencetempRef_row22 = new Reference (row2); assert !arrCur.MoveNext(tempRef_row22); row2 = tempRef_row22.argValue; } return Result.Success; })); - history = tempRef_history.get(); - row = tempRef_row3.get(); + history = tempReference_history.get(); + row = tempReference_row3.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -282,90 +284,90 @@ public final class TupleUnitTests { row.InitLayout(HybridRowVersion.V1, this.countersLayout, this.countersResolver); PerfCounter c1 = this.counterExample; - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("value", out c); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row3, out valueScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - row = tempRef_row3.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row3, out valueScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + row = tempReference_row3.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row5, ref valueScope, c.TypeArgs, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempReference_row5, ref valueScope, c.TypeArgs, out valueScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_row7 = - new RefObject(row); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_row7 = + new Reference(row); RowCursor valueScope2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row6, out valueScope2).Find(tempRef_row7, c.Path); - row = tempRef_row7.get(); - row = tempRef_row6.get(); - RefObject tempRef_row8 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row6, out valueScope2).Find(tempReference_row7, c.Path); + row = tempReference_row7.get(); + row = tempReference_row6.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row8, ref valueScope2, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempReference_row8, ref valueScope2, out valueScope2)); - row = tempRef_row8.get(); + row = tempReference_row8.get(); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert valueScope.AsReadOnly(out _).ScopeType == valueScope2.ScopeType; RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert valueScope.AsReadOnly(out _).start == valueScope2.start; RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert valueScope.AsReadOnly(out _).Immutable == valueScope2.Immutable; - RefObject tempRef_row9 = - new RefObject(row); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.TypeConstraint(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row9, ref valueScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.TypeConstraint(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row9, ref valueScope, "millis", UpdateOptions.InsertAt)); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.TypeConstraint(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempRef_row10, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.TypeConstraint(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempReference_row10, ref valueScope)); - row = tempRef_row10.get(); - RefObject tempRef_row11 = - new RefObject(row); - assert !valueScope.MoveTo(tempRef_row11, 2); - row = tempRef_row11.get(); + row = tempReference_row10.get(); + Reference tempReference_row11 = + new Reference(row); + assert !valueScope.MoveTo(tempReference_row11, 2); + row = tempReference_row11.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -381,82 +383,82 @@ public final class TupleUnitTests { tempVar.Lng = 40L; c1.Coord = Tuple.Create("units", tempVar); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("coord", out c); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row3, out valueScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - row = tempRef_row3.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row3, out valueScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + row = tempReference_row3.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row5, ref valueScope, c.TypeArgs, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempReference_row5, ref valueScope, c.TypeArgs, out valueScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_valueScope = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.DateTime.WriteSparse(tempRef_row6, tempRef_valueScope, + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_valueScope = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.DateTime.WriteSparse(tempReference_row6, tempReference_valueScope, LocalDateTime.now())); - valueScope = tempRef_valueScope.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + valueScope = tempReference_valueScope.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref valueScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref valueScope, "mins")); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); - assert valueScope.MoveNext(tempRef_row8); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_valueScope2 = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.Int8.WriteSparse(tempRef_row9, tempRef_valueScope2, (byte)42)); - valueScope = tempRef_valueScope2.get(); - row = tempRef_row9.get(); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); + assert valueScope.MoveNext(tempReference_row8); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_valueScope2 = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.Int8.WriteSparse(tempReference_row9, tempReference_valueScope2, (byte)42)); + valueScope = tempReference_valueScope2.get(); + row = tempReference_row9.get(); TypeArgument coordType = c.TypeArgs[1]; // Invalid because is a UDT but the wrong type. - RefObject tempRef_row10 = - new RefObject(row); - RefObject tempRef_valueScope3 = - new RefObject(valueScope); + Reference tempReference_row10 = + new Reference(row); + Reference tempReference_valueScope3 = + new Reference(valueScope); RowCursor _; - OutObject tempOut__ = - new OutObject(); - ResultAssert.TypeConstraint(coordType.getType().TypeAs().WriteScope(tempRef_row10, - tempRef_valueScope3, new TypeArgumentList(this.countersLayout.getSchemaId().clone()), tempOut__)); + Out tempOut__ = + new Out(); + ResultAssert.TypeConstraint(coordType.getType().TypeAs().WriteScope(tempReference_row10, + tempReference_valueScope3, new TypeArgumentList(this.countersLayout.getSchemaId().clone()), tempOut__)); _ = tempOut__.get(); - valueScope = tempRef_valueScope3.get(); - row = tempRef_row10.get(); + valueScope = tempReference_valueScope3.get(); + row = tempReference_row10.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -466,72 +468,73 @@ public final class TupleUnitTests { row.InitLayout(HybridRowVersion.V1, this.countersLayout, this.countersResolver); PerfCounter c1 = this.counterExample; - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("value", out c); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row3, out valueScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - row = tempRef_row3.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row3, out valueScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + row = tempReference_row3.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row5, ref valueScope, c.TypeArgs, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempReference_row5, ref valueScope, c.TypeArgs, out valueScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_valueScope = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.Boolean.WriteSparse(tempRef_row6, tempRef_valueScope, true)); - valueScope = tempRef_valueScope.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_valueScope = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.Boolean.WriteSparse(tempReference_row6, tempReference_valueScope, true)); + valueScope = tempReference_valueScope.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref valueScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref valueScope, "millis")); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); - assert valueScope.MoveNext(tempRef_row8); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_valueScope2 = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.Float32.WriteSparse(tempRef_row9, tempRef_valueScope2, 0.1F)); - valueScope = tempRef_valueScope2.get(); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); + assert valueScope.MoveNext(tempReference_row8); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_valueScope2 = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.Float32.WriteSparse(tempReference_row9, tempReference_valueScope2, + 0.1F)); + valueScope = tempReference_valueScope2.get(); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().WriteSparse(tempRef_row10, ref valueScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().WriteSparse(tempReference_row10, ref valueScope, 100L)); - row = tempRef_row10.get(); + row = tempReference_row10.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -544,220 +547,221 @@ public final class TupleUnitTests { c1.Name = "RowInserts"; c1.MinMaxValue = Tuple.Create("units", Tuple.Create(12L, 542L, 12046L)); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteCounter(tempRef_row, RowCursor.Create(tempRef_row2, out _), c1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteCounter(tempReference_row, RowCursor.Create(tempReference_row2, out _), c1); + row = tempReference_row2.get(); + row = tempReference_row.get(); // ReSharper disable once StringLiteralTypo LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("minmeanmax", out c); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row3, out valueScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - row = tempRef_row3.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row3, out valueScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + row = tempReference_row3.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row5, ref valueScope, c.TypeArgs, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempReference_row5, ref valueScope, c.TypeArgs, out valueScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_valueScope = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.DateTime.WriteSparse(tempRef_row6, tempRef_valueScope, + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_valueScope = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.DateTime.WriteSparse(tempReference_row6, tempReference_valueScope, LocalDateTime.now())); - valueScope = tempRef_valueScope.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + valueScope = tempReference_valueScope.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref valueScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref valueScope, "secs")); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); - assert valueScope.MoveNext(tempRef_row8); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_valueScope2 = - new RefObject(valueScope); - ResultAssert.TypeConstraint(LayoutType.Decimal.WriteSparse(tempRef_row9, tempRef_valueScope2, 12)); - valueScope = tempRef_valueScope2.get(); - row = tempRef_row9.get(); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); + assert valueScope.MoveNext(tempReference_row8); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_valueScope2 = + new Reference(valueScope); + ResultAssert.TypeConstraint(LayoutType.Decimal.WriteSparse(tempReference_row9, tempReference_valueScope2, 12)); + valueScope = tempReference_valueScope2.get(); + row = tempReference_row9.get(); TypeArgument mmmType = c.TypeArgs[1]; // Invalid because not a tuple type. - RefObject tempRef_row10 = - new RefObject(row); + Reference tempReference_row10 = + new Reference(row); RowCursor mmmScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempRef_row10, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempReference_row10, ref valueScope, TypeArgumentList.Empty, out mmmScope)); - row = tempRef_row10.get(); + row = tempReference_row10.get(); // Invalid because is a tuple type but with the wrong parameters. - RefObject tempRef_row11 = - new RefObject(row); + Reference tempReference_row11 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempRef_row11, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempReference_row11, ref valueScope, new TypeArgumentList(new TypeArgument[] { new TypeArgument(LayoutType.Boolean), new TypeArgument(LayoutType.Int64) }), out mmmScope)); - row = tempRef_row11.get(); + row = tempReference_row11.get(); // Invalid because is a tuple type but with the wrong arity. - RefObject tempRef_row12 = - new RefObject(row); + Reference tempReference_row12 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempRef_row12, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.TypeConstraint(mmmType.getType().TypeAs().WriteScope(tempReference_row12, ref valueScope, new TypeArgumentList(new TypeArgument[] { new TypeArgument(LayoutType.Utf8) }), out mmmScope)); - row = tempRef_row12.get(); + row = tempReference_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + Reference tempReference_row13 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(mmmType.getType().TypeAs().WriteScope(tempRef_row13, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(mmmType.getType().TypeAs().WriteScope(tempReference_row13, ref valueScope, mmmType.getTypeArgs().clone(), out mmmScope)); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ResultAssert.TypeConstraint(LayoutType.Binary.WriteSparse(ref row, ref valueScope, new // byte[] { 1, 2, 3 })); - ResultAssert.TypeConstraint(LayoutType.Binary.WriteSparse(tempRef_row14, ref valueScope, new byte[] { 1, 2, + ResultAssert.TypeConstraint(LayoutType.Binary.WriteSparse(tempReference_row14, ref valueScope, new byte[] { 1 + , 2, 3 })); - row = tempRef_row14.get(); - RefObject tempRef_row15 = - new RefObject(row); - RefObject tempRef_mmmScope = - new RefObject(mmmScope); - ResultAssert.IsSuccess(mmmType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(tempRef_row15 - , tempRef_mmmScope, 1L)); - mmmScope = tempRef_mmmScope.get(); - row = tempRef_row15.get(); - RefObject tempRef_row16 = - new RefObject(row); - assert mmmScope.MoveNext(tempRef_row16); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); - RefObject tempRef_mmmScope2 = - new RefObject(mmmScope); - ResultAssert.IsSuccess(mmmType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(tempRef_row17 - , tempRef_mmmScope2, 2L)); - mmmScope = tempRef_mmmScope2.get(); - row = tempRef_row17.get(); - RefObject tempRef_row18 = - new RefObject(row); - assert mmmScope.MoveNext(tempRef_row18); - row = tempRef_row18.get(); - RefObject tempRef_row19 = - new RefObject(row); - RefObject tempRef_mmmScope3 = - new RefObject(mmmScope); - ResultAssert.IsSuccess(mmmType.getTypeArgs().get(2).getType().TypeAs().WriteSparse(tempRef_row19 - , tempRef_mmmScope3, 3L)); - mmmScope = tempRef_mmmScope3.get(); - row = tempRef_row19.get(); + row = tempReference_row14.get(); + Reference tempReference_row15 = + new Reference(row); + Reference tempReference_mmmScope = + new Reference(mmmScope); + ResultAssert.IsSuccess(mmmType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(tempReference_row15 + , tempReference_mmmScope, 1L)); + mmmScope = tempReference_mmmScope.get(); + row = tempReference_row15.get(); + Reference tempReference_row16 = + new Reference(row); + assert mmmScope.MoveNext(tempReference_row16); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); + Reference tempReference_mmmScope2 = + new Reference(mmmScope); + ResultAssert.IsSuccess(mmmType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(tempReference_row17 + , tempReference_mmmScope2, 2L)); + mmmScope = tempReference_mmmScope2.get(); + row = tempReference_row17.get(); + Reference tempReference_row18 = + new Reference(row); + assert mmmScope.MoveNext(tempReference_row18); + row = tempReference_row18.get(); + Reference tempReference_row19 = + new Reference(row); + Reference tempReference_mmmScope3 = + new Reference(mmmScope); + ResultAssert.IsSuccess(mmmType.getTypeArgs().get(2).getType().TypeAs().WriteSparse(tempReference_row19 + , tempReference_mmmScope3, 3L)); + mmmScope = tempReference_mmmScope3.get(); + row = tempReference_row19.get(); } - private static Coord ReadCoord(RefObject row, RefObject coordScope) { + private static Coord ReadCoord(Reference row, Reference coordScope) { Layout coordLayout = coordScope.get().getLayout(); Coord cd = new Coord(); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert coordLayout.TryFind("lat", out c); - OutObject tempOut_Lat = new OutObject(); + Out tempOut_Lat = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, coordScope, c, tempOut_Lat)); cd.Lat = tempOut_Lat.get(); - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert coordLayout.TryFind("lng", out c); - OutObject tempOut_Lng = new OutObject(); + Out tempOut_Lng = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, coordScope, c, tempOut_Lng)); cd.Lng = tempOut_Lng.get(); return cd; } - private PerfCounter ReadCounter(RefObject row, RefObject root) { + private PerfCounter ReadCounter(Reference row, Reference root) { PerfCounter pc = new PerfCounter(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("name", out c); - OutObject tempOut_Name = new OutObject(); + Out tempOut_Name = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Name)); pc.Name = tempOut_Name.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("value", out c); assert c.Type.Immutable; RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref valueScope, out valueScope) == Result.Success) { assert valueScope.Immutable; assert valueScope.MoveNext(row); String units; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref valueScope, out units)); assert valueScope.MoveNext(row); long metric; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().ReadSparse(row, ref valueScope, out metric)); @@ -766,157 +770,157 @@ public final class TupleUnitTests { // ReSharper disable once StringLiteralTypo // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("minmeanmax", out c); assert c.Type.Immutable; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref valueScope, out valueScope) == Result.Success) { assert valueScope.Immutable; assert valueScope.MoveNext(row); String units; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref valueScope, out units)); assert valueScope.MoveNext(row); TypeArgument mmmType = c.TypeArgs[1]; - RefObject tempRef_valueScope = - new RefObject(valueScope); + Reference tempReference_valueScope = + new Reference(valueScope); RowCursor mmmScope; - OutObject tempOut_mmmScope = - new OutObject(); - ResultAssert.IsSuccess(mmmType.getType().TypeAs().ReadScope(row, tempRef_valueScope, + Out tempOut_mmmScope = + new Out(); + ResultAssert.IsSuccess(mmmType.getType().TypeAs().ReadScope(row, tempReference_valueScope, tempOut_mmmScope)); mmmScope = tempOut_mmmScope.get(); - valueScope = tempRef_valueScope.get(); + valueScope = tempReference_valueScope.get(); assert mmmScope.Immutable; assert mmmScope.MoveNext(row); - RefObject tempRef_mmmScope = - new RefObject(mmmScope); + Reference tempReference_mmmScope = + new Reference(mmmScope); long min; - OutObject tempOut_min = new OutObject(); + Out tempOut_min = new Out(); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, - tempRef_mmmScope, tempOut_min)); + tempReference_mmmScope, tempOut_min)); min = tempOut_min.get(); - mmmScope = tempRef_mmmScope.get(); + mmmScope = tempReference_mmmScope.get(); assert mmmScope.MoveNext(row); - RefObject tempRef_mmmScope2 = - new RefObject(mmmScope); + Reference tempReference_mmmScope2 = + new Reference(mmmScope); long mean; - OutObject tempOut_mean = new OutObject(); + Out tempOut_mean = new Out(); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(1).getType().TypeAs().ReadSparse(row, - tempRef_mmmScope2, tempOut_mean)); + tempReference_mmmScope2, tempOut_mean)); mean = tempOut_mean.get(); - mmmScope = tempRef_mmmScope2.get(); + mmmScope = tempReference_mmmScope2.get(); assert mmmScope.MoveNext(row); - RefObject tempRef_mmmScope3 = - new RefObject(mmmScope); + Reference tempReference_mmmScope3 = + new Reference(mmmScope); long max; - OutObject tempOut_max = new OutObject(); + Out tempOut_max = new Out(); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(2).getType().TypeAs().ReadSparse(row, - tempRef_mmmScope3, tempOut_max)); + tempReference_mmmScope3, tempOut_max)); max = tempOut_max.get(); - mmmScope = tempRef_mmmScope3.get(); + mmmScope = tempReference_mmmScope3.get(); pc.MinMaxValue = Tuple.Create(units, Tuple.Create(min, mean, max)); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("coord", out c); assert c.Type.Immutable; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref valueScope, out valueScope) == Result.Success) { assert valueScope.Immutable; assert valueScope.MoveNext(row); String units; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref valueScope, out units)); assert valueScope.MoveNext(row); RowCursor coordScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().ReadScope(row, ref valueScope, out coordScope)); - RefObject tempRef_coordScope = new RefObject(coordScope); - pc.Coord = Tuple.Create(units, TupleUnitTests.ReadCoord(row, tempRef_coordScope)); - coordScope = tempRef_coordScope.get(); + Reference tempReference_coordScope = new Reference(coordScope); + pc.Coord = Tuple.Create(units, TupleUnitTests.ReadCoord(row, tempReference_coordScope)); + coordScope = tempReference_coordScope.get(); } return pc; } - private static void WriteCoord(RefObject row, RefObject coordScope, TypeArgumentList typeArgs, Coord cd) { + private static void WriteCoord(Reference row, Reference coordScope, TypeArgumentList typeArgs, Coord cd) { Layout coordLayout = row.get().getResolver().Resolve(typeArgs.getSchemaId().clone()); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert coordLayout.TryFind("lat", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, coordScope, c, cd.Lat)); - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert coordLayout.TryFind("lng", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, coordScope, c, cd.Lng)); } - private void WriteCounter(RefObject row, RefObject root, PerfCounter pc) { + private void WriteCounter(Reference row, Reference root, PerfCounter pc) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.countersLayout.TryFind("name", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, pc.Name)); if (pc.Value != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.countersLayout.TryFind("value", out c); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref valueScope, c.TypeArgs, out valueScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref valueScope, pc.Value.Item1)); assert valueScope.MoveNext(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[1].Type.TypeAs().WriteSparse(row, ref valueScope, pc.Value.Item2)); @@ -925,24 +929,24 @@ public final class TupleUnitTests { if (pc.MinMaxValue != null) { // ReSharper disable once StringLiteralTypo // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.countersLayout.TryFind("minmeanmax", out c); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref valueScope, c.TypeArgs, out valueScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref valueScope, pc.MinMaxValue.Item1)); @@ -951,74 +955,74 @@ public final class TupleUnitTests { TypeArgument mmmType = c.TypeArgs[1]; RowCursor mmmScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(mmmType.getType().TypeAs().WriteScope(row, ref valueScope, mmmType.getTypeArgs().clone(), out mmmScope)); - RefObject tempRef_mmmScope = - new RefObject(mmmScope); + Reference tempReference_mmmScope = + new Reference(mmmScope); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, - tempRef_mmmScope, pc.MinMaxValue.Item2.Item1)); - mmmScope = tempRef_mmmScope.get(); + tempReference_mmmScope, pc.MinMaxValue.Item2.Item1)); + mmmScope = tempReference_mmmScope.get(); assert mmmScope.MoveNext(row); - RefObject tempRef_mmmScope2 = - new RefObject(mmmScope); + Reference tempReference_mmmScope2 = + new Reference(mmmScope); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(row, - tempRef_mmmScope2, pc.MinMaxValue.Item2.Item2)); - mmmScope = tempRef_mmmScope2.get(); + tempReference_mmmScope2, pc.MinMaxValue.Item2.Item2)); + mmmScope = tempReference_mmmScope2.get(); assert mmmScope.MoveNext(row); - RefObject tempRef_mmmScope3 = - new RefObject(mmmScope); + Reference tempReference_mmmScope3 = + new Reference(mmmScope); ResultAssert.IsSuccess(mmmType.getTypeArgs().get(2).getType().TypeAs().WriteSparse(row, - tempRef_mmmScope3, pc.MinMaxValue.Item2.Item3)); - mmmScope = tempRef_mmmScope3.get(); + tempReference_mmmScope3, pc.MinMaxValue.Item2.Item3)); + mmmScope = tempReference_mmmScope3.get(); } if (pc.Coord != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.countersLayout.TryFind("coord", out c); RowCursor valueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out valueScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref valueScope, c.TypeArgs, out valueScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref valueScope, pc.Coord.Item1)); assert valueScope.MoveNext(row); TypeArgument mmmType = c.TypeArgs[1]; - RefObject tempRef_valueScope = - new RefObject(valueScope); + Reference tempReference_valueScope = + new Reference(valueScope); RowCursor coordScope; - OutObject tempOut_coordScope = - new OutObject(); - ResultAssert.IsSuccess(mmmType.getType().TypeAs().WriteScope(row, tempRef_valueScope, + Out tempOut_coordScope = + new Out(); + ResultAssert.IsSuccess(mmmType.getType().TypeAs().WriteScope(row, tempReference_valueScope, mmmType.getTypeArgs().clone(), tempOut_coordScope)); coordScope = tempOut_coordScope.get(); - valueScope = tempRef_valueScope.get(); - RefObject tempRef_coordScope = - new RefObject(coordScope); - TupleUnitTests.WriteCoord(row, tempRef_coordScope, mmmType.getTypeArgs().clone(), pc.Coord.Item2); - coordScope = tempRef_coordScope.get(); + valueScope = tempReference_valueScope.get(); + Reference tempReference_coordScope = + new Reference(coordScope); + TupleUnitTests.WriteCoord(row, tempReference_coordScope, mmmType.getTypeArgs().clone(), pc.Coord.Item2); + coordScope = tempReference_coordScope.get(); } } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedArrayUnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedArrayUnitTests.java index 243432a..9d5d85c 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedArrayUnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/TypedArrayUnitTests.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -55,26 +56,26 @@ public final class TypedArrayUnitTests { t1.Priority = new ArrayList>(Arrays.asList(Tuple.Create("80's", 100L), Tuple.Create( "classics", 100L), Tuple.Create("pop", 50L))); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteTagged(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteTagged(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Tagged t2 = this.ReadTagged(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + Tagged t2 = this.ReadTagged(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert t1 == t2; } @@ -88,56 +89,56 @@ public final class TypedArrayUnitTests { x -> x.Name.equals("Tagged")).SchemaId); } - private static SimilarMatch ReadSimilarMatch(RefObject row, - RefObject matchScope) { + private static SimilarMatch ReadSimilarMatch(Reference row, + Reference matchScope) { Layout matchLayout = matchScope.get().getLayout(); SimilarMatch m = new SimilarMatch(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("thumbprint", out c); - OutObject tempOut_Thumbprint = new OutObject(); + Out tempOut_Thumbprint = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, matchScope, c, tempOut_Thumbprint)); m.Thumbprint = tempOut_Thumbprint.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("score", out c); - OutObject tempOut_Score = new OutObject(); + Out tempOut_Score = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, matchScope, c, tempOut_Score)); m.Score = tempOut_Score.get(); return m; } - private Tagged ReadTagged(RefObject row, RefObject root) { + private Tagged ReadTagged(Reference row, Reference root) { Tagged value = new Tagged(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("title", out c); - OutObject tempOut_Title = new OutObject(); + Out tempOut_Title = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadVariable(row, root, c, tempOut_Title)); value.Title = tempOut_Title.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("tags", out c); RowCursor tagsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tagsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) { value.Tags = new ArrayList(); while (tagsScope.MoveNext(row)) { String item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref tagsScope, out item)); @@ -146,47 +147,47 @@ public final class TypedArrayUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("options", out c); RowCursor optionsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out optionsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref optionsScope, out optionsScope) == Result.Success) { value.Options = new ArrayList(); while (optionsScope.MoveNext(row)) { TypeArgument itemType = c.TypeArgs[0]; - RefObject tempRef_optionsScope = - new RefObject(optionsScope); + Reference tempReference_optionsScope = + new Reference(optionsScope); RowCursor nullableScope; - OutObject tempOut_nullableScope = - new OutObject(); + Out tempOut_nullableScope = + new Out(); ResultAssert.IsSuccess(itemType.getType().TypeAs().ReadScope(row, - tempRef_optionsScope, tempOut_nullableScope)); + tempReference_optionsScope, tempOut_nullableScope)); nullableScope = tempOut_nullableScope.get(); - optionsScope = tempRef_optionsScope.get(); + optionsScope = tempReference_optionsScope.get(); if (nullableScope.MoveNext(row)) { - RefObject tempRef_nullableScope = new RefObject(nullableScope); - ResultAssert.IsSuccess(LayoutNullable.HasValue(row, tempRef_nullableScope)); - nullableScope = tempRef_nullableScope.get(); + Reference tempReference_nullableScope = new Reference(nullableScope); + ResultAssert.IsSuccess(LayoutNullable.HasValue(row, tempReference_nullableScope)); + nullableScope = tempReference_nullableScope.get(); - RefObject tempRef_nullableScope2 = new RefObject(nullableScope); + Reference tempReference_nullableScope2 = new Reference(nullableScope); int itemValue; - OutObject tempOut_itemValue = new OutObject(); - ResultAssert.IsSuccess(itemType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, tempRef_nullableScope2, tempOut_itemValue)); + Out tempOut_itemValue = new Out(); + ResultAssert.IsSuccess(itemType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, tempReference_nullableScope2, tempOut_itemValue)); itemValue = tempOut_itemValue.get(); - nullableScope = tempRef_nullableScope2.get(); + nullableScope = tempReference_nullableScope2.get(); value.Options.add(itemValue); } else { - RefObject tempRef_nullableScope3 = new RefObject(nullableScope); - ResultAssert.NotFound(LayoutNullable.HasValue(row, tempRef_nullableScope3)); - nullableScope = tempRef_nullableScope3.get(); + Reference tempReference_nullableScope3 = new Reference(nullableScope); + ResultAssert.NotFound(LayoutNullable.HasValue(row, tempReference_nullableScope3)); + nullableScope = tempReference_nullableScope3.get(); value.Options.add(null); } @@ -194,184 +195,184 @@ public final class TypedArrayUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("ratings", out c); RowCursor ratingsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out ratingsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref ratingsScope, out ratingsScope) == Result.Success) { value.Ratings = new ArrayList>(); TypeArgument innerType = c.TypeArgs[0]; LayoutTypedArray innerLayout = innerType.getType().TypeAs(); RowCursor innerScope = null; - RefObject tempRef_innerScope = - new RefObject(innerScope); - while (ratingsScope.MoveNext(row, tempRef_innerScope)) { - innerScope = tempRef_innerScope.get(); + Reference tempReference_innerScope = + new Reference(innerScope); + while (ratingsScope.MoveNext(row, tempReference_innerScope)) { + innerScope = tempReference_innerScope.get(); ArrayList item = new ArrayList(); - RefObject tempRef_ratingsScope = - new RefObject(ratingsScope); - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_ratingsScope, tempOut_innerScope)); + Reference tempReference_ratingsScope = + new Reference(ratingsScope); + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_ratingsScope, tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - ratingsScope = tempRef_ratingsScope.get(); + ratingsScope = tempReference_ratingsScope.get(); while (RowCursorExtensions.MoveNext(innerScope.clone() , row)) { LayoutFloat64 itemLayout = innerType.getTypeArgs().get(0).getType().TypeAs(); - RefObject tempRef_innerScope2 - = new RefObject(innerScope); + Reference tempReference_innerScope2 + = new Reference(innerScope); double innerItem; - OutObject tempOut_innerItem = new OutObject(); - ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempRef_innerScope2, tempOut_innerItem)); + Out tempOut_innerItem = new Out(); + ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempReference_innerScope2, tempOut_innerItem)); innerItem = tempOut_innerItem.get(); - innerScope = tempRef_innerScope2.get(); + innerScope = tempReference_innerScope2.get(); item.add(innerItem); } value.Ratings.add(item); } - innerScope = tempRef_innerScope.get(); + innerScope = tempReference_innerScope.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("similars", out c); RowCursor similarsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out similarsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref similarsScope, out similarsScope) == Result.Success) { value.Similars = new ArrayList(); while (similarsScope.MoveNext(row)) { TypeArgument innerType = c.TypeArgs[0]; LayoutUDT innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_similarsScope = - new RefObject(similarsScope); + Reference tempReference_similarsScope = + new Reference(similarsScope); RowCursor matchScope; - OutObject tempOut_matchScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_similarsScope, tempOut_matchScope)); + Out tempOut_matchScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_similarsScope, tempOut_matchScope)); matchScope = tempOut_matchScope.get(); - similarsScope = tempRef_similarsScope.get(); - RefObject tempRef_matchScope = - new RefObject(matchScope); - SimilarMatch item = TypedArrayUnitTests.ReadSimilarMatch(row, tempRef_matchScope); - matchScope = tempRef_matchScope.get(); + similarsScope = tempReference_similarsScope.get(); + Reference tempReference_matchScope = + new Reference(matchScope); + SimilarMatch item = TypedArrayUnitTests.ReadSimilarMatch(row, tempReference_matchScope); + matchScope = tempReference_matchScope.get(); value.Similars.add(item); } } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("priority", out c); RowCursor priorityScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out priorityScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref priorityScope, out priorityScope) == Result.Success) { value.Priority = new ArrayList>(); RowCursor tupleScope = null; - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - while (priorityScope.MoveNext(row, tempRef_tupleScope)) { - tupleScope = tempRef_tupleScope.get(); + Reference tempReference_tupleScope = + new Reference(tupleScope); + while (priorityScope.MoveNext(row, tempReference_tupleScope)) { + tupleScope = tempReference_tupleScope.get(); TypeArgument innerType = c.TypeArgs[0]; LayoutIndexedScope innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_priorityScope = - new RefObject(priorityScope); - OutObject tempOut_tupleScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_priorityScope, tempOut_tupleScope)); + Reference tempReference_priorityScope = + new Reference(priorityScope); + Out tempOut_tupleScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_priorityScope, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - priorityScope = tempRef_priorityScope.get(); + priorityScope = tempReference_priorityScope.get(); assert RowCursorExtensions.MoveNext(tupleScope.clone() , row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); String item1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, - tempRef_tupleScope2, out item1)); - tupleScope = tempRef_tupleScope2.get(); + tempReference_tupleScope2, out item1)); + tupleScope = tempReference_tupleScope2.get(); assert RowCursorExtensions.MoveNext(tupleScope.clone() , row); - RefObject tempRef_tupleScope3 = - new RefObject(tupleScope); + Reference tempReference_tupleScope3 = + new Reference(tupleScope); long item2; - OutObject tempOut_item2 = new OutObject(); + Out tempOut_item2 = new Out(); ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().ReadSparse(row, - tempRef_tupleScope3, tempOut_item2)); + tempReference_tupleScope3, tempOut_item2)); item2 = tempOut_item2.get(); - tupleScope = tempRef_tupleScope3.get(); + tupleScope = tempReference_tupleScope3.get(); value.Priority.add(Tuple.Create(item1, item2)); } - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); } return value; } - private static void WriteSimilarMatch(RefObject row, RefObject matchScope + private static void WriteSimilarMatch(Reference row, Reference matchScope , TypeArgumentList typeArgs, SimilarMatch m) { Layout matchLayout = row.get().getResolver().Resolve(typeArgs.getSchemaId().clone()); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("thumbprint", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, matchScope, c, m.Thumbprint)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("score", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, matchScope, c, m.Score)); } - private void WriteTagged(RefObject row, RefObject root, Tagged value) { + private void WriteTagged(Reference row, Reference root, Tagged value) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("title", out c); ResultAssert.IsSuccess(c.TypeAs().WriteVariable(row, root, c, value.Title)); if (value.Tags != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("tags", out c); RowCursor tagsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out tagsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref tagsScope, c.TypeArgs, out tagsScope)); for (String item : value.Tags) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(row, ref tagsScope, item)); assert !tagsScope.MoveNext(row); @@ -380,19 +381,19 @@ public final class TypedArrayUnitTests { if (value.Options != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("options", out c); RowCursor optionsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out optionsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref optionsScope, c.TypeArgs, out optionsScope)); @@ -400,22 +401,22 @@ public final class TypedArrayUnitTests { TypeArgument itemType = c.TypeArgs[0]; RowCursor nullableScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(itemType.getType().TypeAs().WriteScope(row, ref optionsScope, itemType.getTypeArgs().clone(), item != null, out nullableScope)); if (item != null) { - RefObject tempRef_nullableScope = new RefObject(nullableScope); - ResultAssert.IsSuccess(itemType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, tempRef_nullableScope, item.intValue())); - nullableScope = tempRef_nullableScope.get(); + Reference tempReference_nullableScope = new Reference(nullableScope); + ResultAssert.IsSuccess(itemType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, tempReference_nullableScope, item.intValue())); + nullableScope = tempReference_nullableScope.get(); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !optionsScope.MoveNext(row, ref nullableScope); } @@ -423,19 +424,19 @@ public final class TypedArrayUnitTests { if (value.Ratings != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("ratings", out c); RowCursor ratingsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out ratingsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref ratingsScope, c.TypeArgs, out ratingsScope)); @@ -443,26 +444,26 @@ public final class TypedArrayUnitTests { assert item != null; TypeArgument innerType = c.TypeArgs[0]; LayoutTypedArray innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_ratingsScope = - new RefObject(ratingsScope); + Reference tempReference_ratingsScope = + new Reference(ratingsScope); RowCursor innerScope; - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempRef_ratingsScope, + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempReference_ratingsScope, innerType.getTypeArgs().clone(), tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - ratingsScope = tempRef_ratingsScope.get(); + ratingsScope = tempReference_ratingsScope.get(); for (double innerItem : item) { LayoutFloat64 itemLayout = innerType.getTypeArgs().get(0).getType().TypeAs(); - RefObject tempRef_innerScope = - new RefObject(innerScope); - ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempRef_innerScope, innerItem)); - innerScope = tempRef_innerScope.get(); + Reference tempReference_innerScope = + new Reference(innerScope); + ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempReference_innerScope, innerItem)); + innerScope = tempReference_innerScope.get(); assert !innerScope.MoveNext(row); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !ratingsScope.MoveNext(row, ref innerScope); } @@ -470,41 +471,41 @@ public final class TypedArrayUnitTests { if (value.Similars != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("similars", out c); RowCursor similarsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out similarsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref similarsScope, c.TypeArgs, out similarsScope)); for (SimilarMatch item : value.Similars) { TypeArgument innerType = c.TypeArgs[0]; LayoutUDT innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_similarsScope = - new RefObject(similarsScope); + Reference tempReference_similarsScope = + new Reference(similarsScope); RowCursor matchScope; - OutObject tempOut_matchScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempRef_similarsScope, + Out tempOut_matchScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempReference_similarsScope, innerType.getTypeArgs().clone(), tempOut_matchScope)); matchScope = tempOut_matchScope.get(); - similarsScope = tempRef_similarsScope.get(); - RefObject tempRef_matchScope = - new RefObject(matchScope); - TypedArrayUnitTests.WriteSimilarMatch(row, tempRef_matchScope, innerType.getTypeArgs().clone(), item); - matchScope = tempRef_matchScope.get(); + similarsScope = tempReference_similarsScope.get(); + Reference tempReference_matchScope = + new Reference(matchScope); + TypedArrayUnitTests.WriteSimilarMatch(row, tempReference_matchScope, innerType.getTypeArgs().clone(), item); + matchScope = tempReference_matchScope.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !similarsScope.MoveNext(row, ref matchScope); } @@ -512,19 +513,19 @@ public final class TypedArrayUnitTests { if (value.Priority != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("priority", out c); RowCursor priorityScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out priorityScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref priorityScope, c.TypeArgs, out priorityScope)); @@ -533,27 +534,27 @@ public final class TypedArrayUnitTests { LayoutIndexedScope innerLayout = innerType.getType().TypeAs(); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(innerLayout.WriteScope(row, ref priorityScope, innerType.getTypeArgs().clone() , out tupleScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, ref tupleScope, item.Item1)); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(row - , tempRef_tupleScope, item.Item2)); - tupleScope = tempRef_tupleScope.get(); + , tempReference_tupleScope, item.Item2)); + tupleScope = tempReference_tupleScope.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: assert !priorityScope.MoveNext(row, ref tupleScope); } 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 d894beb..d7a06dc 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -61,26 +62,26 @@ public final class TypedMapUnitTests { Map.entry(LocalDateTime.parse("01/31/1997"), tempVar3))); // ReSharper restore StringLiteralTypo - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteMovie(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteMovie(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Movie t2 = this.ReadMovie(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + Movie t2 = this.ReadMovie(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert t1 == t2; } @@ -89,10 +90,10 @@ public final class TypedMapUnitTests { public void FindAndDelete() { RowBuffer row = new RowBuffer(TypedMapUnitTests.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); ArrayList expected = new ArrayList(Arrays.asList("Mark", "Harrison", "Carrie")); @@ -100,82 +101,82 @@ public final class TypedMapUnitTests { Movie t1 = new Movie(); t1.Cast = new HashMap(Map.ofEntries(Map.entry("Mark", "Luke"), Map.entry("Harrison", "Han" ), Map.entry("Carrie", "Leia"))); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - this.WriteMovie(tempRef_row2, root.Clone(out _), t1); - row = tempRef_row2.get(); + this.WriteMovie(tempReference_row2, root.Clone(out _), t1); + row = tempReference_row2.get(); // Attempt to find each item in turn and then delete it. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("cast", out c); - RefObject tempRef_row3 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); RowCursor mapScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out mapScope).Find(tempRef_row3, c.Path); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); + root.Clone(out mapScope).Find(tempReference_row3, c.Path); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row4, ref mapScope, out mapScope)); - row = tempRef_row4.get(); + 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" + " key"); - RefObject tempRef_row5 = - new RefObject(row); + Reference tempReference_row5 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row5, Utf8String.Empty); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row6, tempRef_tempCursor, c.TypeArgs, + root.Clone(out tempCursor).Find(tempReference_row5, Utf8String.Empty); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row6, tempReference_tempCursor, c.TypeArgs, pair)); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row7, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, out findScope)); - row = tempRef_row7.get(); + row = tempReference_row7.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: TypeArgument tupleType = c.TypeAs().FieldType(ref mapScope); - RefObject tempRef_row8 = - new RefObject(row); - RefObject tempRef_findScope = - new RefObject(findScope); - ResultAssert.IsSuccess(tupleType.TypeAs().DeleteScope(tempRef_row8, - tempRef_findScope)); - findScope = tempRef_findScope.get(); - row = tempRef_row8.get(); + Reference tempReference_row8 = + new Reference(row); + Reference tempReference_findScope = + new Reference(findScope); + ResultAssert.IsSuccess(tupleType.TypeAs().DeleteScope(tempReference_row8, + tempReference_findScope)); + findScope = tempReference_findScope.get(); + row = tempReference_row8.get(); } } } @@ -185,87 +186,87 @@ public final class TypedMapUnitTests { public void FindInMap() { RowBuffer row = new RowBuffer(TypedMapUnitTests.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); Movie t1 = new Movie(); t1.Cast = new HashMap(Map.ofEntries(Map.entry("Mark", "Luke"), Map.entry("Harrison", "Han"), Map.entry("Carrie", "Leia"))); - RefObject tempRef_row2 = - new RefObject(row); - RowCursor rc1 = RowCursor.Create(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_rc1 = - new RefObject(rc1); - this.WriteMovie(tempRef_row3, tempRef_rc1, t1); - rc1 = tempRef_rc1.get(); - row = tempRef_row3.get(); + Reference tempReference_row2 = + new Reference(row); + RowCursor rc1 = RowCursor.Create(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_rc1 = + new Reference(rc1); + this.WriteMovie(tempReference_row3, tempReference_rc1, t1); + rc1 = tempReference_rc1.get(); + row = tempReference_row3.get(); // Attempt to find each item in turn. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("cast", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor mapScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out mapScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out mapScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref mapScope, out mapScope)); - row = tempRef_row5.get(); + // 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)); + row = tempReference_row5.get(); for (String key : t1.Cast.keySet()) { KeyValuePair pair = new KeyValuePair(key, "map lookup matches only on key"); - RefObject tempRef_row6 = - new RefObject(row); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row7, tempRef_tempCursor, c.TypeArgs, pair)); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row7, tempReference_tempCursor, c.TypeArgs, pair)); + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row8, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref mapScope, ref tempCursor, out findScope)); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_findScope = - new RefObject(findScope); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_findScope = + new Reference(findScope); KeyValuePair foundPair; - OutObject> tempOut_foundPair = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempRef_row9, tempRef_findScope, c.TypeArgs, + Out> tempOut_foundPair = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempReference_row9, tempReference_findScope, c.TypeArgs, tempOut_foundPair)); foundPair = tempOut_foundPair.get(); - findScope = tempRef_findScope.get(); - row = tempRef_row9.get(); + findScope = tempReference_findScope.get(); + row = tempReference_row9.get(); Assert.AreEqual(key, foundPair.Key, String.format("Failed to find t1.Cast[%1$s]", key)); } } @@ -285,10 +286,10 @@ public final class TypedMapUnitTests { public void PreventUniquenessViolations() { RowBuffer row = new RowBuffer(TypedMapUnitTests.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); Movie t1 = new Movie(); t1.Cast = new HashMap(Map.ofEntries(Map.entry("Mark", "Luke"))); @@ -302,173 +303,173 @@ public final class TypedMapUnitTests { t1.Revenue = new HashMap(Map.ofEntries(Map.entry(LocalDateTime.parse("05/25/1977"), tempVar))); - RefObject tempRef_row2 = - new RefObject(row); - RowCursor rc1 = RowCursor.Create(tempRef_row2); - row = tempRef_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_rc1 = - new RefObject(rc1); - this.WriteMovie(tempRef_row3, tempRef_rc1, t1); - rc1 = tempRef_rc1.get(); - row = tempRef_row3.get(); + Reference tempReference_row2 = + new Reference(row); + RowCursor rc1 = RowCursor.Create(tempReference_row2); + row = tempReference_row2.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_rc1 = + new Reference(rc1); + this.WriteMovie(tempReference_row3, tempReference_rc1, t1); + rc1 = tempReference_rc1.get(); + row = tempReference_row3.get(); // Attempt to insert duplicate items in existing sets. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("cast", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor mapScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out mapScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out mapScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref mapScope, out mapScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); + // 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)); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row7, tempRef_tempCursor, c.TypeArgs, + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row7, tempReference_tempCursor, c.TypeArgs, KeyValuePair.Create("Mark", "Luke"))); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row8, ref mapScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row9, Utf8String.Empty); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row9, Utf8String.Empty); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); KeyValuePair _; - OutObject> tempOut__ = new OutObject>(); - ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempRef_row10, tempRef_tempCursor2, c.TypeArgs, + Out> tempOut__ = new Out>(); + ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempReference_row10, tempReference_tempCursor2, c.TypeArgs, tempOut__)); _ = tempOut__.get(); - tempCursor = tempRef_tempCursor2.get(); - row = tempRef_row10.get(); - RefObject tempRef_row11 = - new RefObject(row); + tempCursor = tempReference_tempCursor2.get(); + row = tempReference_row10.get(); + Reference tempReference_row11 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row11, Utf8String.Empty); - row = tempRef_row11.get(); - RefObject tempRef_row12 = - new RefObject(row); - RefObject tempRef_tempCursor3 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row12, tempRef_tempCursor3, c.TypeArgs, + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row11, Utf8String.Empty); + row = tempReference_row11.get(); + Reference tempReference_row12 = + new Reference(row); + Reference tempReference_tempCursor3 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row12, tempReference_tempCursor3, c.TypeArgs, KeyValuePair.Create("Mark", "Joker"))); - tempCursor = tempRef_tempCursor3.get(); - row = tempRef_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + tempCursor = tempReference_tempCursor3.get(); + row = tempReference_row12.get(); + Reference tempReference_row13 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row13, ref mapScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row14, Utf8String.Empty); - row = tempRef_row14.get(); - RefObject tempRef_row15 = - new RefObject(row); - RefObject tempRef_tempCursor4 = - new RefObject(tempCursor); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row14, Utf8String.Empty); + row = tempReference_row14.get(); + Reference tempReference_row15 = + new Reference(row); + Reference tempReference_tempCursor4 = + new Reference(tempCursor); KeyValuePair _; - OutObject> tempOut__2 = - new OutObject>(); - ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempRef_row15, tempRef_tempCursor4, c.TypeArgs, + Out> tempOut__2 = + new Out>(); + ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempReference_row15, tempReference_tempCursor4, c.TypeArgs, tempOut__2)); _ = tempOut__2.get(); - tempCursor = tempRef_tempCursor4.get(); - row = tempRef_row15.get(); + tempCursor = tempReference_tempCursor4.get(); + row = tempReference_row15.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("stats", out c); - RefObject tempRef_row16 = - new RefObject(row); + Reference tempReference_row16 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out mapScope).Find(tempRef_row16, c.Path); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out mapScope).Find(tempReference_row16, c.Path); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row17, ref mapScope, out mapScope)); - row = tempRef_row17.get(); + // 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)); + row = tempReference_row17.get(); KeyValuePair pair = KeyValuePair.Create(UUID.fromString("{4674962B-CE11-4916-81C5-0421EE36F168" + "}"), 11000000.00); - RefObject tempRef_row18 = - new RefObject(row); + Reference tempReference_row18 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row18, Utf8String.Empty); - row = tempRef_row18.get(); - RefObject tempRef_row19 = - new RefObject(row); - RefObject tempRef_tempCursor5 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row19, tempRef_tempCursor5, c.TypeArgs, pair)); - tempCursor = tempRef_tempCursor5.get(); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row18, Utf8String.Empty); + row = tempReference_row18.get(); + Reference tempReference_row19 = + new Reference(row); + Reference tempReference_tempCursor5 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row19, tempReference_tempCursor5, c.TypeArgs, pair)); + tempCursor = tempReference_tempCursor5.get(); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row20, ref mapScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row20.get(); - RefObject tempRef_row21 = - new RefObject(row); + row = tempReference_row20.get(); + Reference tempReference_row21 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row21, Utf8String.Empty); - row = tempRef_row21.get(); - RefObject tempRef_row22 = - new RefObject(row); - RefObject tempRef_tempCursor6 = - new RefObject(tempCursor); - OutObject> tempOut_pair = new OutObject>(); - ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempRef_row22, tempRef_tempCursor6, c.TypeArgs, + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row21, Utf8String.Empty); + row = tempReference_row21.get(); + Reference tempReference_row22 = + new Reference(row); + Reference tempReference_tempCursor6 = + new Reference(tempCursor); + Out> tempOut_pair = new Out>(); + ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempReference_row22, tempReference_tempCursor6, c.TypeArgs, tempOut_pair)); pair = tempOut_pair.get(); - tempCursor = tempRef_tempCursor6.get(); - row = tempRef_row22.get(); + tempCursor = tempReference_tempCursor6.get(); + row = tempReference_row22.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -476,201 +477,201 @@ public final class TypedMapUnitTests { public void PreventUpdatesInNonUpdatableScope() { RowBuffer row = new RowBuffer(TypedMapUnitTests.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); // Write a map and then try to write directly into it. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("cast", out c); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row2 = + new Reference(row); RowCursor mapScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out mapScope).Find(tempRef_row2, c.Path); - row = tempRef_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out mapScope).Find(tempReference_row2, c.Path); + row = tempReference_row2.get(); + Reference tempReference_row3 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row3, ref mapScope, c.TypeArgs, + // 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, out mapScope)); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); - RefObject tempRef_mapScope = - new RefObject(mapScope); - ResultAssert.InsufficientPermissions(TypedMapUnitTests.WriteKeyValue(tempRef_row4, tempRef_mapScope, + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); + Reference tempReference_mapScope = + new Reference(mapScope); + ResultAssert.InsufficientPermissions(TypedMapUnitTests.WriteKeyValue(tempReference_row4, tempReference_mapScope, c.TypeArgs, KeyValuePair.Create("Mark", "Joker"))); - mapScope = tempRef_mapScope.get(); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + mapScope = tempReference_mapScope.get(); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row5, "cast.0"); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row6, tempRef_tempCursor, c.TypeArgs, + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row5, "cast.0"); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row6, tempReference_tempCursor, c.TypeArgs, KeyValuePair.Create("Mark", "Joker"))); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row7, ref mapScope, ref tempCursor)); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + // 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)); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row8, "cast.0"); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row8, "cast.0"); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); KeyValuePair _; - OutObject> tempOut__ = new OutObject>(); - ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempRef_row9, tempRef_tempCursor2, c.TypeArgs, tempOut__)); + Out> tempOut__ = new Out>(); + ResultAssert.NotFound(TypedMapUnitTests.ReadKeyValue(tempReference_row9, tempReference_tempCursor2, c.TypeArgs, tempOut__)); _ = tempOut__.get(); - tempCursor = tempRef_tempCursor2.get(); - row = tempRef_row9.get(); + tempCursor = tempReference_tempCursor2.get(); + row = tempReference_row9.get(); // Write a map of maps, successfully insert an empty map into it, and then try to write directly to the inner // map. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("related", out c); - RefObject tempRef_row10 = - new RefObject(row); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out mapScope).Find(tempRef_row10, c.Path); - row = tempRef_row10.get(); - RefObject tempRef_row11 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out mapScope).Find(tempReference_row10, c.Path); + row = tempReference_row10.get(); + Reference tempReference_row11 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row11, ref mapScope, c.TypeArgs, + // 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, out mapScope)); - row = tempRef_row11.get(); + row = tempReference_row11.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: LayoutIndexedScope tupleLayout = c.TypeAs().FieldType(ref mapScope).TypeAs(); - RefObject tempRef_row12 = - new RefObject(row); + Reference tempReference_row12 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row12, "related.0"); - row = tempRef_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row12, "related.0"); + row = tempReference_row12.get(); + Reference tempReference_row13 = + new Reference(row); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(tupleLayout.WriteScope(tempRef_row13, ref tempCursor, c.TypeArgs, out tupleScope)); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(tupleLayout.WriteScope(tempReference_row13, ref tempCursor, c.TypeArgs, out tupleScope)); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row14, ref tupleScope, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row14, ref tupleScope, "Mark")); - row = tempRef_row14.get(); - RefObject tempRef_row15 = - new RefObject(row); - assert tupleScope.MoveNext(tempRef_row15); - row = tempRef_row15.get(); + row = tempReference_row14.get(); + Reference tempReference_row15 = + new Reference(row); + assert tupleScope.MoveNext(tempReference_row15); + row = tempReference_row15.get(); TypeArgument valueType = c.TypeArgs[1]; LayoutUniqueScope valueLayout = valueType.getType().TypeAs(); - RefObject tempRef_row16 = - new RefObject(row); + Reference tempReference_row16 = + new Reference(row); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(valueLayout.WriteScope(tempRef_row16, ref tupleScope, valueType.getTypeArgs().clone(), + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(valueLayout.WriteScope(tempReference_row16, ref tupleScope, valueType.getTypeArgs().clone(), out innerScope)); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row17, ref mapScope, ref tempCursor)); - row = tempRef_row17.get(); - RefObject tempRef_row18 = - new RefObject(row); - assert mapScope.MoveNext(tempRef_row18); - row = tempRef_row18.get(); - RefObject tempRef_row19 = - new RefObject(row); - RefObject tempRef_mapScope2 = - new RefObject(mapScope); - OutObject tempOut_tupleScope = - new OutObject(); - ResultAssert.IsSuccess(tupleLayout.ReadScope(tempRef_row19, tempRef_mapScope2, tempOut_tupleScope)); + // 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)); + row = tempReference_row17.get(); + Reference tempReference_row18 = + new Reference(row); + assert mapScope.MoveNext(tempReference_row18); + row = tempReference_row18.get(); + Reference tempReference_row19 = + new Reference(row); + Reference tempReference_mapScope2 = + new Reference(mapScope); + Out tempOut_tupleScope = + new Out(); + ResultAssert.IsSuccess(tupleLayout.ReadScope(tempReference_row19, tempReference_mapScope2, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - mapScope = tempRef_mapScope2.get(); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); - assert tupleScope.MoveNext(tempRef_row20); - row = tempRef_row20.get(); + mapScope = tempReference_mapScope2.get(); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); + assert tupleScope.MoveNext(tempReference_row20); + row = tempReference_row20.get(); // Skip key. - RefObject tempRef_row21 = - new RefObject(row); - assert tupleScope.MoveNext(tempRef_row21); - row = tempRef_row21.get(); - RefObject tempRef_row22 = - new RefObject(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(valueLayout.ReadScope(tempRef_row22, tempRef_tupleScope, tempOut_innerScope)); + Reference tempReference_row21 = + new Reference(row); + assert tupleScope.MoveNext(tempReference_row21); + row = tempReference_row21.get(); + Reference tempReference_row22 = + new Reference(row); + Reference tempReference_tupleScope = + new Reference(tupleScope); + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(valueLayout.ReadScope(tempReference_row22, tempReference_tupleScope, tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - tupleScope = tempRef_tupleScope.get(); - row = tempRef_row22.get(); + tupleScope = tempReference_tupleScope.get(); + row = tempReference_row22.get(); TypeArgument itemType = valueType.getTypeArgs().get(0).clone(); - RefObject tempRef_row23 = - new RefObject(row); - assert !innerScope.MoveNext(tempRef_row23); - row = tempRef_row23.get(); - RefObject tempRef_row24 = - new RefObject(row); - RefObject tempRef_innerScope = - new RefObject(innerScope); - ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().WriteSparse(tempRef_row24, - tempRef_innerScope, 1)); - innerScope = tempRef_innerScope.get(); - row = tempRef_row24.get(); - RefObject tempRef_row25 = - new RefObject(row); - RefObject tempRef_innerScope2 = - new RefObject(innerScope); - ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().DeleteSparse(tempRef_row25, - tempRef_innerScope2)); - innerScope = tempRef_innerScope2.get(); - row = tempRef_row25.get(); + Reference tempReference_row23 = + new Reference(row); + assert !innerScope.MoveNext(tempReference_row23); + row = tempReference_row23.get(); + Reference tempReference_row24 = + new Reference(row); + Reference tempReference_innerScope = + new Reference(innerScope); + ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().WriteSparse(tempReference_row24, + tempReference_innerScope, 1)); + innerScope = tempReference_innerScope.get(); + row = tempReference_row24.get(); + Reference tempReference_row25 = + new Reference(row); + Reference tempReference_innerScope2 = + new Reference(innerScope); + ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().DeleteSparse(tempReference_row25, + tempReference_innerScope2)); + innerScope = tempReference_innerScope2.get(); + row = tempReference_row25.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -678,10 +679,10 @@ public final class TypedMapUnitTests { public void UpdateInMap() { RowBuffer row = new RowBuffer(TypedMapUnitTests.InitialRowSize); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row); + row = tempReference_row.get(); ArrayList expected = new ArrayList(Arrays.asList("Mark", "Harrison", "Carrie")); @@ -689,289 +690,289 @@ public final class TypedMapUnitTests { Movie t1 = new Movie(); t1.Cast = new HashMap(Map.ofEntries(Map.entry("Mark", "Luke"), Map.entry("Harrison", "Han" ), Map.entry("Carrie", "Leia"))); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - this.WriteMovie(tempRef_row2, root.Clone(out _), t1); - row = tempRef_row2.get(); + this.WriteMovie(tempReference_row2, root.Clone(out _), t1); + row = tempReference_row2.get(); // Attempt to find each item in turn and then delete it. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("cast", out c); - RefObject tempRef_row3 = - new RefObject(row); + Reference tempReference_row3 = + new Reference(row); RowCursor mapScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out mapScope).Find(tempRef_row3, c.Path); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); + root.Clone(out mapScope).Find(tempReference_row3, c.Path); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row4, ref mapScope, out mapScope)); - row = tempRef_row4.get(); + ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempReference_row4, ref mapScope, out mapScope)); + row = tempReference_row4.get(); for (String key : permutation) { // Verify it is already there. KeyValuePair pair = new KeyValuePair(key, "map lookup matches only on" + " key"); - RefObject tempRef_row5 = - new RefObject(row); + Reference tempReference_row5 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row5, Utf8String.Empty); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row6, tempRef_tempCursor, c.TypeArgs, + root.Clone(out tempCursor).Find(tempReference_row5, Utf8String.Empty); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row6, tempReference_tempCursor, c.TypeArgs, pair)); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row7, ref mapScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row7, ref mapScope, ref tempCursor, out findScope)); - row = tempRef_row7.get(); + row = tempReference_row7.get(); // Insert it again with update. KeyValuePair updatePair = new KeyValuePair(key, "update value"); - RefObject tempRef_row8 = - new RefObject(row); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row8, Utf8String.Empty); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row9, tempRef_tempCursor2, c.TypeArgs, + root.Clone(out tempCursor).Find(tempReference_row8, Utf8String.Empty); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row9, tempReference_tempCursor2, c.TypeArgs, updatePair)); - tempCursor = tempRef_tempCursor2.get(); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + tempCursor = tempReference_tempCursor2.get(); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row10, ref mapScope, + ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row10, ref mapScope, ref tempCursor, UpdateOptions.Update)); - row = tempRef_row10.get(); + row = tempReference_row10.get(); // Verify that the value was updated. - RefObject tempRef_row11 = - new RefObject(row); + Reference tempReference_row11 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row11, Utf8String.Empty); - row = tempRef_row11.get(); - RefObject tempRef_row12 = - new RefObject(row); - RefObject tempRef_tempCursor3 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row12, tempRef_tempCursor3, c.TypeArgs + root.Clone(out tempCursor).Find(tempReference_row11, Utf8String.Empty); + row = tempReference_row11.get(); + Reference tempReference_row12 = + new Reference(row); + Reference tempReference_tempCursor3 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row12, tempReference_tempCursor3, c.TypeArgs , pair)); - tempCursor = tempRef_tempCursor3.get(); - row = tempRef_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + tempCursor = tempReference_tempCursor3.get(); + row = tempReference_row12.get(); + Reference tempReference_row13 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row13, ref mapScope, ref tempCursor + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row13, ref mapScope, ref tempCursor , out findScope)); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); - RefObject tempRef_findScope = - new RefObject(findScope); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); + Reference tempReference_findScope = + new Reference(findScope); KeyValuePair foundPair; - OutObject> tempOut_foundPair = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempRef_row14, tempRef_findScope, c.TypeArgs, + Out> tempOut_foundPair = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempReference_row14, tempReference_findScope, c.TypeArgs, tempOut_foundPair)); foundPair = tempOut_foundPair.get(); - findScope = tempRef_findScope.get(); - row = tempRef_row14.get(); + findScope = tempReference_findScope.get(); + row = tempReference_row14.get(); assert key == foundPair.Key; assert updatePair.Value == foundPair.Value; // Insert it again with upsert. updatePair = new KeyValuePair(key, "upsert value"); - RefObject tempRef_row15 = - new RefObject(row); + Reference tempReference_row15 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row15, Utf8String.Empty); - row = tempRef_row15.get(); - RefObject tempRef_row16 = - new RefObject(row); - RefObject tempRef_tempCursor4 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row16, tempRef_tempCursor4, c.TypeArgs + root.Clone(out tempCursor).Find(tempReference_row15, Utf8String.Empty); + row = tempReference_row15.get(); + Reference tempReference_row16 = + new Reference(row); + Reference tempReference_tempCursor4 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row16, tempReference_tempCursor4, c.TypeArgs , updatePair)); - tempCursor = tempRef_tempCursor4.get(); - row = tempRef_row16.get(); + tempCursor = tempReference_tempCursor4.get(); + row = tempReference_row16.get(); // ReSharper disable once RedundantArgumentDefaultValue - RefObject tempRef_row17 = - new RefObject(row); + Reference tempReference_row17 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row17, ref mapScope, + ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row17, ref mapScope, ref tempCursor, UpdateOptions.Upsert)); - row = tempRef_row17.get(); + row = tempReference_row17.get(); // Verify that the value was upserted. - RefObject tempRef_row18 = - new RefObject(row); + Reference tempReference_row18 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row18, Utf8String.Empty); - row = tempRef_row18.get(); - RefObject tempRef_row19 = - new RefObject(row); - RefObject tempRef_tempCursor5 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row19, tempRef_tempCursor5, c.TypeArgs + root.Clone(out tempCursor).Find(tempReference_row18, Utf8String.Empty); + row = tempReference_row18.get(); + Reference tempReference_row19 = + new Reference(row); + Reference tempReference_tempCursor5 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row19, tempReference_tempCursor5, c.TypeArgs , pair)); - tempCursor = tempRef_tempCursor5.get(); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); + tempCursor = tempReference_tempCursor5.get(); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row20, ref mapScope, ref tempCursor + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row20, ref mapScope, ref tempCursor , out findScope)); - row = tempRef_row20.get(); - RefObject tempRef_row21 = - new RefObject(row); - RefObject tempRef_findScope2 = - new RefObject(findScope); - OutObject> tempOut_foundPair2 = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempRef_row21, tempRef_findScope2, c.TypeArgs, + row = tempReference_row20.get(); + Reference tempReference_row21 = + new Reference(row); + Reference tempReference_findScope2 = + new Reference(findScope); + Out> tempOut_foundPair2 = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(tempReference_row21, tempReference_findScope2, c.TypeArgs, tempOut_foundPair2)); foundPair = tempOut_foundPair2.get(); - findScope = tempRef_findScope2.get(); - row = tempRef_row21.get(); + findScope = tempReference_findScope2.get(); + row = tempReference_row21.get(); assert key == foundPair.Key; assert updatePair.Value == foundPair.Value; // Insert it again with insert (fail: exists). updatePair = new KeyValuePair(key, "insert value"); - RefObject tempRef_row22 = - new RefObject(row); + Reference tempReference_row22 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row22, Utf8String.Empty); - row = tempRef_row22.get(); - RefObject tempRef_row23 = - new RefObject(row); - RefObject tempRef_tempCursor6 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row23, tempRef_tempCursor6, c.TypeArgs + root.Clone(out tempCursor).Find(tempReference_row22, Utf8String.Empty); + row = tempReference_row22.get(); + Reference tempReference_row23 = + new Reference(row); + Reference tempReference_tempCursor6 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row23, tempReference_tempCursor6, c.TypeArgs , updatePair)); - tempCursor = tempRef_tempCursor6.get(); - row = tempRef_row23.get(); - RefObject tempRef_row24 = - new RefObject(row); + tempCursor = tempReference_tempCursor6.get(); + row = tempReference_row23.get(); + Reference tempReference_row24 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row24, ref mapScope, + ResultAssert.Exists(c.TypeAs().MoveField(tempReference_row24, ref mapScope, ref tempCursor, UpdateOptions.Insert)); - row = tempRef_row24.get(); + row = tempReference_row24.get(); // Insert it again with insert at (fail: disallowed). updatePair = new KeyValuePair(key, "insertAt value"); - RefObject tempRef_row25 = - new RefObject(row); + Reference tempReference_row25 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row25, Utf8String.Empty); - row = tempRef_row25.get(); - RefObject tempRef_row26 = - new RefObject(row); - RefObject tempRef_tempCursor7 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempRef_row26, tempRef_tempCursor7, c.TypeArgs + root.Clone(out tempCursor).Find(tempReference_row25, Utf8String.Empty); + row = tempReference_row25.get(); + Reference tempReference_row26 = + new Reference(row); + Reference tempReference_tempCursor7 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(tempReference_row26, tempReference_tempCursor7, c.TypeArgs , updatePair)); - tempCursor = tempRef_tempCursor7.get(); - row = tempRef_row26.get(); - RefObject tempRef_row27 = - new RefObject(row); + tempCursor = tempReference_tempCursor7.get(); + row = tempReference_row26.get(); + Reference tempReference_row27 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempRef_row27, ref mapScope, + ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempReference_row27, ref mapScope, ref tempCursor, UpdateOptions.InsertAt)); - row = tempRef_row27.get(); + row = tempReference_row27.get(); } } } - private static Earnings ReadEarnings(RefObject row, RefObject udtScope) { + private static Earnings ReadEarnings(Reference row, Reference udtScope) { Layout udt = udtScope.get().getLayout(); Earnings m = new Earnings(); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert udt.TryFind("domestic", out c); - OutObject tempOut_Domestic = new OutObject(); + Out tempOut_Domestic = new Out(); 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 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert udt.TryFind("worldwide", out c); - OutObject tempOut_Worldwide = new OutObject(); + Out tempOut_Worldwide = new Out(); ResultAssert.IsSuccess(c.TypeAs().ReadFixed(row, udtScope, c, tempOut_Worldwide)); m.Worldwide = tempOut_Worldwide.get(); return m; } - private static Result ReadKeyValue(RefObject row, - RefObject scope, TypeArgumentList typeArgs, - OutObject> pair) { + private static Result ReadKeyValue(Reference row, + Reference scope, TypeArgumentList typeArgs, + Out> pair) { pair.set(null); LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; RowCursor tupleScope; - OutObject tempOut_tupleScope = - new OutObject(); + Out tempOut_tupleScope = + new Out(); Result r = tupleLayout.ReadScope(row, scope, tempOut_tupleScope); tupleScope = tempOut_tupleScope.get(); if (r != Result.Success) { @@ -979,25 +980,25 @@ public final class TypedMapUnitTests { } tupleScope.MoveNext(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); TKey key; - OutObject tempOut_key = new OutObject(); - r = typeArgs.get(0).getType().>TypeAs().ReadSparse(row, tempRef_tupleScope, tempOut_key); + Out tempOut_key = new Out(); + r = typeArgs.get(0).getType().>TypeAs().ReadSparse(row, tempReference_tupleScope, tempOut_key); key = tempOut_key.get(); - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); if (r != Result.Success) { return r; } tupleScope.MoveNext(row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); TValue value; - OutObject tempOut_value = new OutObject(); - r = typeArgs.get(1).getType().>TypeAs().ReadSparse(row, tempRef_tupleScope2, tempOut_value); + Out tempOut_value = new Out(); + r = typeArgs.get(1).getType().>TypeAs().ReadSparse(row, tempReference_tupleScope2, tempOut_value); value = tempOut_value.get(); - tupleScope = tempRef_tupleScope2.get(); + tupleScope = tempReference_tupleScope2.get(); if (r != Result.Success) { return r; } @@ -1006,75 +1007,75 @@ public final class TypedMapUnitTests { return Result.Success; } - private Movie ReadMovie(RefObject row, RefObject root) { + private Movie ReadMovie(Reference row, Reference root) { Movie value = new Movie(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("cast", out c); RowCursor castScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref castScope, out castScope) == Result.Success) { value.Cast = new HashMap(); while (castScope.MoveNext(row)) { - RefObject tempRef_castScope = - new RefObject(castScope); + Reference tempReference_castScope = + new Reference(castScope); KeyValuePair item; - OutObject> tempOut_item = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempRef_castScope, c.TypeArgs, + Out> tempOut_item = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempReference_castScope, c.TypeArgs, tempOut_item)); item = tempOut_item.get(); - castScope = tempRef_castScope.get(); + castScope = tempReference_castScope.get(); value.Cast.put(item.Key, item.Value); } } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("stats", out c); RowCursor statsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref statsScope, out statsScope) == Result.Success) { value.Stats = new HashMap(); while (statsScope.MoveNext(row)) { - RefObject tempRef_statsScope = - new RefObject(statsScope); + Reference tempReference_statsScope = + new Reference(statsScope); KeyValuePair item; - OutObject> tempOut_item2 = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempRef_statsScope, c.TypeArgs, + Out> tempOut_item2 = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempReference_statsScope, c.TypeArgs, tempOut_item2)); item = tempOut_item2.get(); - statsScope = tempRef_statsScope.get(); + statsScope = tempReference_statsScope.get(); value.Stats.put(item.Key, item.Value); } } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("related", out c); RowCursor relatedScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out relatedScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref relatedScope, out relatedScope) == Result.Success) { value.Related = new HashMap>(); TypeArgument keyType = c.TypeArgs[0]; @@ -1083,42 +1084,42 @@ public final class TypedMapUnitTests { LayoutUniqueScope valueLayout = valueType.getType().TypeAs(); while (relatedScope.MoveNext(row)) { LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; - RefObject tempRef_relatedScope = - new RefObject(relatedScope); + Reference tempReference_relatedScope = + new Reference(relatedScope); RowCursor tupleScope; - OutObject tempOut_tupleScope = - new OutObject(); - ResultAssert.IsSuccess(tupleLayout.ReadScope(row, tempRef_relatedScope, tempOut_tupleScope)); + Out tempOut_tupleScope = + new Out(); + ResultAssert.IsSuccess(tupleLayout.ReadScope(row, tempReference_relatedScope, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - relatedScope = tempRef_relatedScope.get(); + relatedScope = tempReference_relatedScope.get(); assert tupleScope.MoveNext(row); String itemKey; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(keyLayout.ReadSparse(row, ref tupleScope, out itemKey)); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); RowCursor itemValueScope; - OutObject tempOut_itemValueScope = - new OutObject(); - ResultAssert.IsSuccess(valueLayout.ReadScope(row, tempRef_tupleScope, tempOut_itemValueScope)); + Out tempOut_itemValueScope = + new Out(); + ResultAssert.IsSuccess(valueLayout.ReadScope(row, tempReference_tupleScope, tempOut_itemValueScope)); itemValueScope = tempOut_itemValueScope.get(); - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); HashMap itemValue = new HashMap(); while (itemValueScope.MoveNext(row)) { - RefObject tempRef_itemValueScope = new RefObject(itemValueScope); + Reference tempReference_itemValueScope = new Reference(itemValueScope); KeyValuePair innerItem; - OutObject> tempOut_innerItem = - new OutObject>(); - ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempRef_itemValueScope, + Out> tempOut_innerItem = + new Out>(); + ResultAssert.IsSuccess(TypedMapUnitTests.ReadKeyValue(row, tempReference_itemValueScope, valueType.getTypeArgs().clone(), tempOut_innerItem)); innerItem = tempOut_innerItem.get(); - itemValueScope = tempRef_itemValueScope.get(); + itemValueScope = tempReference_itemValueScope.get(); itemValue.put(innerItem.Key, innerItem.Value); } @@ -1127,16 +1128,16 @@ public final class TypedMapUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("revenue", out c); RowCursor revenueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref revenueScope, out revenueScope) == Result.Success) { value.Revenue = new HashMap(); TypeArgument keyType = c.TypeArgs[0]; @@ -1145,31 +1146,31 @@ public final class TypedMapUnitTests { LayoutUDT valueLayout = valueType.getType().TypeAs(); while (revenueScope.MoveNext(row)) { LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; - RefObject tempRef_revenueScope = - new RefObject(revenueScope); + Reference tempReference_revenueScope = + new Reference(revenueScope); RowCursor tupleScope; - OutObject tempOut_tupleScope2 = - new OutObject(); - ResultAssert.IsSuccess(tupleLayout.ReadScope(row, tempRef_revenueScope, tempOut_tupleScope2)); + Out tempOut_tupleScope2 = + new Out(); + ResultAssert.IsSuccess(tupleLayout.ReadScope(row, tempReference_revenueScope, tempOut_tupleScope2)); tupleScope = tempOut_tupleScope2.get(); - revenueScope = tempRef_revenueScope.get(); + revenueScope = tempReference_revenueScope.get(); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope2 = new RefObject(tupleScope); + Reference tempReference_tupleScope2 = new Reference(tupleScope); java.time.LocalDateTime itemKey; - OutObject tempOut_itemKey = new OutObject(); - ResultAssert.IsSuccess(keyLayout.ReadSparse(row, tempRef_tupleScope2, tempOut_itemKey)); + Out tempOut_itemKey = new Out(); + ResultAssert.IsSuccess(keyLayout.ReadSparse(row, tempReference_tupleScope2, tempOut_itemKey)); itemKey = tempOut_itemKey.get(); - tupleScope = tempRef_tupleScope2.get(); + tupleScope = tempReference_tupleScope2.get(); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope3 = new RefObject(tupleScope); + Reference tempReference_tupleScope3 = new Reference(tupleScope); RowCursor itemValueScope; - OutObject tempOut_itemValueScope2 = new OutObject(); - ResultAssert.IsSuccess(valueLayout.ReadScope(row, tempRef_tupleScope3, tempOut_itemValueScope2)); + Out tempOut_itemValueScope2 = new Out(); + ResultAssert.IsSuccess(valueLayout.ReadScope(row, tempReference_tupleScope3, tempOut_itemValueScope2)); itemValueScope = tempOut_itemValueScope2.get(); - tupleScope = tempRef_tupleScope3.get(); - RefObject tempRef_itemValueScope2 = new RefObject(itemValueScope); - Earnings itemValue = TypedMapUnitTests.ReadEarnings(row, tempRef_itemValueScope2); - itemValueScope = tempRef_itemValueScope2.get(); + tupleScope = tempReference_tupleScope3.get(); + Reference tempReference_itemValueScope2 = new Reference(itemValueScope); + Earnings itemValue = TypedMapUnitTests.ReadEarnings(row, tempReference_itemValueScope2); + itemValueScope = tempReference_itemValueScope2.get(); value.Revenue.put(itemKey, itemValue); } @@ -1178,142 +1179,142 @@ public final class TypedMapUnitTests { return value; } - private static void WriteEarnings(RefObject row, RefObject udtScope, TypeArgumentList typeArgs, Earnings m) { + private static void WriteEarnings(Reference row, Reference udtScope, TypeArgumentList typeArgs, Earnings m) { Layout udt = row.get().getResolver().Resolve(typeArgs.getSchemaId().clone()); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert udt.TryFind("domestic", out c); 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 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert udt.TryFind("worldwide", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, udtScope, c, m.Worldwide)); } - private static Result WriteKeyValue(RefObject row, - RefObject scope, TypeArgumentList typeArgs, KeyValuePair pair) { + private static Result WriteKeyValue(Reference row, + Reference scope, TypeArgumentList typeArgs, KeyValuePair pair) { LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: Result r = tupleLayout.WriteScope(row, scope, typeArgs.clone(), out tupleScope); if (r != Result.Success) { return r; } - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - r = typeArgs.get(0).getType().>TypeAs().WriteSparse(row, tempRef_tupleScope, pair.Key); - tupleScope = tempRef_tupleScope.get(); + Reference tempReference_tupleScope = + new Reference(tupleScope); + r = typeArgs.get(0).getType().>TypeAs().WriteSparse(row, tempReference_tupleScope, pair.Key); + tupleScope = tempReference_tupleScope.get(); if (r != Result.Success) { return r; } tupleScope.MoveNext(row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); - r = typeArgs.get(1).getType().>TypeAs().WriteSparse(row, tempRef_tupleScope2, pair.Value); - tupleScope = tempRef_tupleScope2.get(); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); + r = typeArgs.get(1).getType().>TypeAs().WriteSparse(row, tempReference_tupleScope2, pair.Value); + tupleScope = tempReference_tupleScope2.get(); return r; } - private void WriteMovie(RefObject row, RefObject root, Movie value) { + private void WriteMovie(Reference row, Reference root, Movie value) { LayoutColumn c; if (value.Cast != null) { - OutObject tempOut_c = - new OutObject(); + Out tempOut_c = + new Out(); assert this.layout.TryFind("cast", tempOut_c); c = tempOut_c.get(); RowCursor castScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out castScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref castScope, c.getTypeArgs().clone(), out castScope)); for (KeyValuePair item : value.Cast) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempRef_tempCursor, + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor, c.getTypeArgs().clone(), item)); - tempCursor = tempRef_tempCursor.get(); - RefObject tempRef_castScope = - new RefObject(castScope); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_castScope, - tempRef_tempCursor2)); - tempCursor = tempRef_tempCursor2.get(); - castScope = tempRef_castScope.get(); + tempCursor = tempReference_tempCursor.get(); + Reference tempReference_castScope = + new Reference(castScope); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_castScope, + tempReference_tempCursor2)); + tempCursor = tempReference_tempCursor2.get(); + castScope = tempReference_castScope.get(); } } if (value.Stats != null) { - OutObject tempOut_c2 = - new OutObject(); + Out tempOut_c2 = + new Out(); assert this.layout.TryFind("stats", tempOut_c2); c = tempOut_c2.get(); RowCursor statsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out statsScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref statsScope, c.getTypeArgs().clone(), out statsScope)); for (KeyValuePair item : value.Stats) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); - RefObject tempRef_tempCursor3 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempRef_tempCursor3, + Reference tempReference_tempCursor3 = + new Reference(tempCursor); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor3, c.getTypeArgs().clone(), item)); - tempCursor = tempRef_tempCursor3.get(); - RefObject tempRef_statsScope = - new RefObject(statsScope); - RefObject tempRef_tempCursor4 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_statsScope, - tempRef_tempCursor4)); - tempCursor = tempRef_tempCursor4.get(); - statsScope = tempRef_statsScope.get(); + tempCursor = tempReference_tempCursor3.get(); + Reference tempReference_statsScope = + new Reference(statsScope); + Reference tempReference_tempCursor4 = + new Reference(tempCursor); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_statsScope, + tempReference_tempCursor4)); + tempCursor = tempReference_tempCursor4.get(); + statsScope = tempReference_statsScope.get(); } } if (value.Related != null) { - OutObject tempOut_c3 = - new OutObject(); + Out tempOut_c3 = + new Out(); assert this.layout.TryFind("related", tempOut_c3); c = tempOut_c3.get(); RowCursor relatedScoped; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out relatedScoped).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref relatedScoped, c.getTypeArgs().clone(), out relatedScoped)); @@ -1323,20 +1324,20 @@ public final class TypedMapUnitTests { LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor1).Find(row, "related.0"); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), out tupleScope)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, ref tupleScope, item.Key)); @@ -1345,58 +1346,59 @@ public final class TypedMapUnitTests { LayoutUniqueScope valueLayout = valueType.getType().TypeAs(); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(valueLayout.WriteScope(row, ref tupleScope, valueType.getTypeArgs().clone(), out innerScope)); for (KeyValuePair innerItem : item.Value) { RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // - these cannot be converted using the 'OutObject' helper class unless the method is within the + // - these cannot be converted using the 'Out' helper class unless the method is within the // code being modified: root.get().Clone(out tempCursor2).Find(row, "related.0.0"); - RefObject tempRef_tempCursor2 - = new RefObject(tempCursor2); - ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempRef_tempCursor2, + Reference tempReference_tempCursor2 + = new Reference(tempCursor2); + ResultAssert.IsSuccess(TypedMapUnitTests.WriteKeyValue(row, tempReference_tempCursor2, valueType.getTypeArgs().clone(), innerItem)); - tempCursor2 = tempRef_tempCursor2.get(); - RefObject tempRef_innerScope = - new RefObject(innerScope); - RefObject tempRef_tempCursor22 = new RefObject(tempCursor2); - ResultAssert.IsSuccess(valueLayout.MoveField(row, tempRef_innerScope, tempRef_tempCursor22)); - tempCursor2 = tempRef_tempCursor22.get(); - innerScope = tempRef_innerScope.get(); + tempCursor2 = tempReference_tempCursor2.get(); + Reference tempReference_innerScope = + new Reference(innerScope); + Reference tempReference_tempCursor22 = new Reference(tempCursor2); + ResultAssert.IsSuccess(valueLayout.MoveField(row, tempReference_innerScope, + tempReference_tempCursor22)); + tempCursor2 = tempReference_tempCursor22.get(); + innerScope = tempReference_innerScope.get(); } - RefObject tempRef_relatedScoped = - new RefObject(relatedScoped); - RefObject tempRef_tempCursor1 = - new RefObject(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_relatedScoped, - tempRef_tempCursor1)); - tempCursor1 = tempRef_tempCursor1.get(); - relatedScoped = tempRef_relatedScoped.get(); + Reference tempReference_relatedScoped = + new Reference(relatedScoped); + Reference tempReference_tempCursor1 = + new Reference(tempCursor1); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_relatedScoped, + tempReference_tempCursor1)); + tempCursor1 = tempReference_tempCursor1.get(); + relatedScoped = tempReference_relatedScoped.get(); } } if (value.Revenue != null) { - OutObject tempOut_c4 = - new OutObject(); + Out tempOut_c4 = + new Out(); assert this.layout.TryFind("revenue", tempOut_c4); c = tempOut_c4.get(); RowCursor revenueScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out revenueScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref revenueScope, c.getTypeArgs().clone(), out revenueScope)); @@ -1406,48 +1408,48 @@ public final class TypedMapUnitTests { LayoutIndexedScope tupleLayout = LayoutType.TypedTuple; RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor1).Find(row, "revenue.0"); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(tupleLayout.WriteScope(row, ref tempCursor1, c.getTypeArgs().clone(), out tupleScope)); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); + Reference tempReference_tupleScope = + new Reference(tupleScope); ResultAssert.IsSuccess(c.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, - tempRef_tupleScope, item.Key)); - tupleScope = tempRef_tupleScope.get(); + tempReference_tupleScope, item.Key)); + tupleScope = tempReference_tupleScope.get(); assert tupleScope.MoveNext(row); TypeArgument valueType = c.getTypeArgs().get(1).clone(); LayoutUDT valueLayout = valueType.getType().TypeAs(); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); RowCursor itemScope; - OutObject tempOut_itemScope = - new OutObject(); - ResultAssert.IsSuccess(valueLayout.WriteScope(row, tempRef_tupleScope2, + Out tempOut_itemScope = + new Out(); + ResultAssert.IsSuccess(valueLayout.WriteScope(row, tempReference_tupleScope2, valueType.getTypeArgs().clone(), tempOut_itemScope)); itemScope = tempOut_itemScope.get(); - tupleScope = tempRef_tupleScope2.get(); - RefObject tempRef_itemScope = - new RefObject(itemScope); - TypedMapUnitTests.WriteEarnings(row, tempRef_itemScope, valueType.getTypeArgs().clone(), item.Value); - itemScope = tempRef_itemScope.get(); + tupleScope = tempReference_tupleScope2.get(); + Reference tempReference_itemScope = + new Reference(itemScope); + TypedMapUnitTests.WriteEarnings(row, tempReference_itemScope, valueType.getTypeArgs().clone(), item.Value); + itemScope = tempReference_itemScope.get(); - RefObject tempRef_revenueScope = - new RefObject(revenueScope); - RefObject tempRef_tempCursor12 = - new RefObject(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_revenueScope, - tempRef_tempCursor12)); - tempCursor1 = tempRef_tempCursor12.get(); - revenueScope = tempRef_revenueScope.get(); + Reference tempReference_revenueScope = + new Reference(revenueScope); + Reference tempReference_tempCursor12 = + new Reference(tempCursor1); + 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 57eef83..7913edf 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 @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.HybridRowVersion; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; @@ -59,26 +60,26 @@ public final class TypedSetUnitTests { t1.Work = new ArrayList>(Arrays.asList(Tuple.Create(false, 10000), Tuple.Create(true, 49053), Tuple.Create(false, 53111))); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteTodo(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); - RefObject tempRef_row4 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteTodo(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); + Reference tempReference_row4 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - Todo t2 = this.ReadTodo(tempRef_row3, RowCursor.Create(tempRef_row4, out _)); - row = tempRef_row4.get(); - row = tempRef_row3.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + Todo t2 = this.ReadTodo(tempReference_row3, RowCursor.Create(tempReference_row4, out _)); + row = tempReference_row4.get(); + row = tempReference_row3.get(); assert t1 == t2; } @@ -96,83 +97,83 @@ public final class TypedSetUnitTests { Todo t1 = new Todo(); t1.Projects = new ArrayList(permutation); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - this.WriteTodo(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + this.WriteTodo(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); // Attempt to update each item in turn and then update it with itself. - RefObject tempRef_row3 = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); + Reference tempReference_row3 = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("projects", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor setScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out setScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + root.Clone(out setScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref setScope, out setScope)); - row = tempRef_row5.get(); + ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempReference_row5, ref setScope, out setScope)); + row = tempReference_row5.get(); for (UUID p : t1.Projects) { - RefObject tempRef_row6 = - new RefObject(row); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref tempCursor, p)); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, out findScope)); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempRef_row9, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempReference_row9, ref findScope)); - row = tempRef_row9.get(); + row = tempReference_row9.get(); } } @@ -189,155 +190,156 @@ public final class TypedSetUnitTests { t1.Prices = new ArrayList>(Arrays.asList(new ArrayList(Arrays.asList(1.2F, 3.0F)), new ArrayList(Arrays.asList(4.1F, 5.7F)), new ArrayList(Arrays.asList(7.3F, 8.12F, 9.14F)))); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteTodo(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteTodo(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); // Attempt to find each item in turn. - RefObject tempRef_row3 = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); + Reference tempReference_row3 = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("attendees", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor setScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref setScope, out setScope)); - row = tempRef_row5.get(); + // 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)); + row = tempReference_row5.get(); for (int i = 0; i < t1.Attendees.size(); i++) { - RefObject tempRef_row6 = - new RefObject(row); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref tempCursor, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref tempCursor, t1.Attendees.get(i))); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, out findScope)); - row = tempRef_row8.get(); + row = tempReference_row8.get(); Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Attendees[%1$s]", i)); } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("prices", out c); - RefObject tempRef_row9 = - new RefObject(row); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row9, c.Path); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row9, c.Path); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row10, ref setScope, out setScope)); - row = tempRef_row10.get(); + // 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)); + row = tempReference_row10.get(); TypeArgument innerType = c.TypeArgs[0]; TypeArgument itemType = innerType.getTypeArgs().get(0).clone(); LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); for (int i = 0; i < t1.Prices.size(); i++) { - RefObject tempRef_row11 = - new RefObject(row); + Reference tempReference_row11 = + new Reference(row); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out tempCursor1).Find(tempRef_row11, Utf8String.Empty); - row = tempRef_row11.get(); - RefObject tempRef_row12 = - new RefObject(row); + root.Clone(out tempCursor1).Find(tempReference_row11, Utf8String.Empty); + row = tempReference_row11.get(); + Reference tempReference_row12 = + new Reference(row); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(innerLayout.WriteScope(tempRef_row12, ref tempCursor1, + ResultAssert.IsSuccess(innerLayout.WriteScope(tempReference_row12, ref tempCursor1, innerType.getTypeArgs().clone(), out innerScope)); - row = tempRef_row12.get(); + row = tempReference_row12.get(); for (int j = 0; j < t1.Prices.get(i).size(); j++) { - RefObject tempRef_row13 = - new RefObject(row); + Reference tempReference_row13 = + new Reference(row); RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor2).Find(tempRef_row13, "prices.0.0"); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(itemType.getType().TypeAs().WriteSparse(tempRef_row14, - tempRef_tempCursor2, t1.Prices.get(i).get(j))); - tempCursor2 = tempRef_tempCursor2.get(); - row = tempRef_row14.get(); - RefObject tempRef_row15 = - new RefObject(row); - RefObject tempRef_innerScope = - new RefObject(innerScope); - RefObject tempRef_tempCursor22 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(innerLayout.MoveField(tempRef_row15, tempRef_innerScope, tempRef_tempCursor22)); - tempCursor2 = tempRef_tempCursor22.get(); - innerScope = tempRef_innerScope.get(); - row = tempRef_row15.get(); + root.Clone(out tempCursor2).Find(tempReference_row13, "prices.0.0"); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(itemType.getType().TypeAs().WriteSparse(tempReference_row14, + tempReference_tempCursor2, t1.Prices.get(i).get(j))); + tempCursor2 = tempReference_tempCursor2.get(); + row = tempReference_row14.get(); + Reference tempReference_row15 = + new Reference(row); + Reference tempReference_innerScope = + new Reference(innerScope); + Reference tempReference_tempCursor22 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(innerLayout.MoveField(tempReference_row15, tempReference_innerScope, + tempReference_tempCursor22)); + tempCursor2 = tempReference_tempCursor22.get(); + innerScope = tempReference_innerScope.get(); + row = tempReference_row15.get(); } - RefObject tempRef_row16 = - new RefObject(row); + Reference tempReference_row16 = + new Reference(row); RowCursor findScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row16, ref setScope, ref tempCursor1, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row16, ref setScope, ref tempCursor1, out findScope)); - row = tempRef_row16.get(); + row = tempReference_row16.get(); Assert.AreEqual(i, findScope.Index, String.format("Failed to find t1.Prices[%1$s]", i)); } } @@ -370,326 +372,326 @@ public final class TypedSetUnitTests { //ORIGINAL LINE: t1.Work = new List> { Tuple.Create(false, 10000UL)}; t1.Work = new ArrayList>(Arrays.asList(Tuple.Create(false, 10000))); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - this.WriteTodo(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + this.WriteTodo(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); // Attempt to insert duplicate items in existing sets. - RefObject tempRef_row3 = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); + Reference tempReference_row3 = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("attendees", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor setScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref setScope, out setScope)); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); + // 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)); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref tempCursor, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref tempCursor, t1.Attendees.get(0))); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row8, ref setScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row9, Utf8String.Empty); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row9, Utf8String.Empty); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row10, ref tempCursor, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row10, ref tempCursor, t1.Attendees.get(0))); - row = tempRef_row10.get(); - RefObject tempRef_row11 = - new RefObject(row); + row = tempReference_row10.get(); + Reference tempReference_row11 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row11, ref setScope, ref tempCursor, out _)); - row = tempRef_row11.get(); - RefObject tempRef_row12 = - new RefObject(row); + // 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 _)); + row = tempReference_row11.get(); + Reference tempReference_row12 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row12, Utf8String.Empty); - row = tempRef_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row12, Utf8String.Empty); + row = tempReference_row12.get(); + Reference tempReference_row13 = + new Reference(row); String _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.NotFound(c.TypeArgs[0].Type.TypeAs().ReadSparse(tempRef_row13, ref tempCursor, out _)); - row = tempRef_row13.get(); + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.NotFound(c.TypeArgs[0].Type.TypeAs().ReadSparse(tempReference_row13, ref tempCursor, out _)); + row = tempReference_row13.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("projects", out c); - RefObject tempRef_row14 = - new RefObject(row); + Reference tempReference_row14 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row14, c.Path); - row = tempRef_row14.get(); - RefObject tempRef_row15 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row14, c.Path); + row = tempReference_row14.get(); + Reference tempReference_row15 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row15, ref setScope, out setScope)); - row = tempRef_row15.get(); - RefObject tempRef_row16 = - new RefObject(row); + // 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)); + row = tempReference_row15.get(); + Reference tempReference_row16 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row16, Utf8String.Empty); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row16, Utf8String.Empty); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row17, ref tempCursor, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row17, ref tempCursor, t1.Projects.get(0))); - row = tempRef_row17.get(); - RefObject tempRef_row18 = - new RefObject(row); + row = tempReference_row17.get(); + Reference tempReference_row18 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row18, ref setScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row18.get(); + row = tempReference_row18.get(); // Attempt to move a duplicate set into a set of sets. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("prices", out c); - RefObject tempRef_row19 = - new RefObject(row); + Reference tempReference_row19 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row19, c.Path); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row19, c.Path); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row20, ref setScope, out setScope)); - row = tempRef_row20.get(); + // 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)); + row = tempReference_row20.get(); TypeArgument innerType = c.TypeArgs[0]; LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_row21 = - new RefObject(row); + Reference tempReference_row21 = + new Reference(row); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor1).Find(tempRef_row21, Utf8String.Empty); - row = tempRef_row21.get(); - RefObject tempRef_row22 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor1).Find(tempReference_row21, Utf8String.Empty); + row = tempReference_row21.get(); + Reference tempReference_row22 = + new Reference(row); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(innerLayout.WriteScope(tempRef_row22, ref tempCursor1, innerType.getTypeArgs().clone() + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(innerLayout.WriteScope(tempReference_row22, ref tempCursor1, innerType.getTypeArgs().clone() , out innerScope)); - row = tempRef_row22.get(); + row = tempReference_row22.get(); for (float innerItem : t1.Prices.get(0)) { LayoutFloat32 itemLayout = innerType.getTypeArgs().get(0).getType().TypeAs(); - RefObject tempRef_row23 = - new RefObject(row); + Reference tempReference_row23 = + new Reference(row); RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out tempCursor2).Find(tempRef_row23, "prices.0.0"); - row = tempRef_row23.get(); - RefObject tempRef_row24 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(itemLayout.WriteSparse(tempRef_row24, tempRef_tempCursor2, innerItem)); - tempCursor2 = tempRef_tempCursor2.get(); - row = tempRef_row24.get(); - RefObject tempRef_row25 = - new RefObject(row); - RefObject tempRef_innerScope = - new RefObject(innerScope); - RefObject tempRef_tempCursor22 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(innerLayout.MoveField(tempRef_row25, tempRef_innerScope, tempRef_tempCursor22)); - tempCursor2 = tempRef_tempCursor22.get(); - innerScope = tempRef_innerScope.get(); - row = tempRef_row25.get(); + root.Clone(out tempCursor2).Find(tempReference_row23, "prices.0.0"); + row = tempReference_row23.get(); + Reference tempReference_row24 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(itemLayout.WriteSparse(tempReference_row24, tempReference_tempCursor2, innerItem)); + tempCursor2 = tempReference_tempCursor2.get(); + row = tempReference_row24.get(); + Reference tempReference_row25 = + new Reference(row); + Reference tempReference_innerScope = + new Reference(innerScope); + Reference tempReference_tempCursor22 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(innerLayout.MoveField(tempReference_row25, tempReference_innerScope, tempReference_tempCursor22)); + tempCursor2 = tempReference_tempCursor22.get(); + innerScope = tempReference_innerScope.get(); + row = tempReference_row25.get(); } - RefObject tempRef_row26 = - new RefObject(row); + Reference tempReference_row26 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row26, ref setScope, ref tempCursor1, + // 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, UpdateOptions.Insert)); - row = tempRef_row26.get(); + row = tempReference_row26.get(); // Attempt to move a duplicate UDT into a set of UDT. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("shopping", out c); - RefObject tempRef_row27 = - new RefObject(row); + Reference tempReference_row27 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row27, c.Path); - row = tempRef_row27.get(); - RefObject tempRef_row28 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row27, c.Path); + row = tempReference_row27.get(); + Reference tempReference_row28 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row28, ref setScope, out setScope)); - row = tempRef_row28.get(); + // 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)); + row = tempReference_row28.get(); LayoutUDT udtLayout = c.TypeArgs[0].Type.TypeAs(); - RefObject tempRef_row29 = - new RefObject(row); + Reference tempReference_row29 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row29, Utf8String.Empty); - row = tempRef_row29.get(); - RefObject tempRef_row30 = - new RefObject(row); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row29, Utf8String.Empty); + row = tempReference_row29.get(); + Reference tempReference_row30 = + new Reference(row); + Reference tempReference_tempCursor = + new Reference(tempCursor); RowCursor udtScope; - OutObject tempOut_udtScope = - new OutObject(); - ResultAssert.IsSuccess(udtLayout.WriteScope(tempRef_row30, tempRef_tempCursor, c.TypeArgs[0].TypeArgs, + Out tempOut_udtScope = + new Out(); + ResultAssert.IsSuccess(udtLayout.WriteScope(tempReference_row30, tempReference_tempCursor, c.TypeArgs[0].TypeArgs, tempOut_udtScope)); udtScope = tempOut_udtScope.get(); - tempCursor = tempRef_tempCursor.get(); - row = tempRef_row30.get(); - RefObject tempRef_row31 = - new RefObject(row); - RefObject tempRef_udtScope = - new RefObject(udtScope); - TypedSetUnitTests.WriteShoppingItem(tempRef_row31, tempRef_udtScope, c.TypeArgs[0].TypeArgs, + tempCursor = tempReference_tempCursor.get(); + row = tempReference_row30.get(); + Reference tempReference_row31 = + new Reference(row); + Reference tempReference_udtScope = + new Reference(udtScope); + TypedSetUnitTests.WriteShoppingItem(tempReference_row31, tempReference_udtScope, c.TypeArgs[0].TypeArgs, t1.Shopping.get(0)); - udtScope = tempRef_udtScope.get(); - row = tempRef_row31.get(); - RefObject tempRef_row32 = - new RefObject(row); + udtScope = tempReference_udtScope.get(); + row = tempReference_row31.get(); + Reference tempReference_row32 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row32, ref setScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row32.get(); + row = tempReference_row32.get(); // Attempt to move a duplicate tuple into a set of tuple. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("work", out c); - RefObject tempRef_row33 = - new RefObject(row); + Reference tempReference_row33 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out setScope).Find(tempRef_row33, c.Path); - row = tempRef_row33.get(); - RefObject tempRef_row34 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out setScope).Find(tempReference_row33, c.Path); + row = tempReference_row33.get(); + Reference tempReference_row34 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row34, ref setScope, out setScope)); - row = tempRef_row34.get(); + // 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)); + row = tempReference_row34.get(); innerType = c.TypeArgs[0]; LayoutIndexedScope tupleLayout = innerType.getType().TypeAs(); - RefObject tempRef_row35 = - new RefObject(row); + Reference tempReference_row35 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - root.Clone(out tempCursor).Find(tempRef_row35, Utf8String.Empty); - row = tempRef_row35.get(); - RefObject tempRef_row36 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + root.Clone(out tempCursor).Find(tempReference_row35, Utf8String.Empty); + row = tempReference_row35.get(); + Reference tempReference_row36 = + new Reference(row); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(tupleLayout.WriteScope(tempRef_row36, ref tempCursor, innerType.getTypeArgs().clone(), + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(tupleLayout.WriteScope(tempReference_row36, ref tempCursor, innerType.getTypeArgs().clone(), out tupleScope)); - row = tempRef_row36.get(); - RefObject tempRef_row37 = - new RefObject(row); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(tempRef_row37, tempRef_tupleScope, t1.Work.get(0).Item1)); - tupleScope = tempRef_tupleScope.get(); - row = tempRef_row37.get(); - RefObject tempRef_row38 = - new RefObject(row); - assert tupleScope.MoveNext(tempRef_row38); - row = tempRef_row38.get(); - RefObject tempRef_row39 = - new RefObject(row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(tempRef_row39, tempRef_tupleScope2, t1.Work.get(0).Item2)); - tupleScope = tempRef_tupleScope2.get(); - row = tempRef_row39.get(); - RefObject tempRef_row40 = - new RefObject(row); + row = tempReference_row36.get(); + Reference tempReference_row37 = + new Reference(row); + Reference tempReference_tupleScope = + new Reference(tupleScope); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(tempReference_row37, tempReference_tupleScope, t1.Work.get(0).Item1)); + tupleScope = tempReference_tupleScope.get(); + row = tempReference_row37.get(); + Reference tempReference_row38 = + new Reference(row); + assert tupleScope.MoveNext(tempReference_row38); + row = tempReference_row38.get(); + Reference tempReference_row39 = + new Reference(row); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(tempReference_row39, tempReference_tupleScope2, t1.Work.get(0).Item2)); + tupleScope = tempReference_tupleScope2.get(); + row = tempReference_row39.get(); + Reference tempReference_row40 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row40, ref setScope, ref tempCursor, + // 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, UpdateOptions.Insert)); - row = tempRef_row40.get(); + row = tempReference_row40.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -701,181 +703,181 @@ public final class TypedSetUnitTests { // Write a set and then try to write directly into it. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("attendees", out c); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor setScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row, out setScope).Find(tempRef_row2, c.Path); - row = tempRef_row2.get(); - row = tempRef_row.get(); - RefObject tempRef_row3 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row, out setScope).Find(tempReference_row2, c.Path); + row = tempReference_row2.get(); + row = tempReference_row.get(); + Reference tempReference_row3 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row3, ref setScope, c.TypeArgs, + // 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, out setScope)); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.InsufficientPermissions(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row4, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.InsufficientPermissions(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row4, ref setScope, "foo")); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); - RefObject tempRef_row6 = - new RefObject(row); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row5, out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - row = tempRef_row5.get(); - RefObject tempRef_row7 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row5, out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + row = tempReference_row5.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, ref tempCursor, "foo" + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref tempCursor, "foo" )); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row8, ref setScope, ref tempCursor)); - row = tempRef_row8.get(); - RefObject tempRef_row9 = - new RefObject(row); + // 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)); + row = tempReference_row8.get(); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.InsufficientPermissions(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row9, + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.InsufficientPermissions(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row9, ref setScope, "foo")); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempRef_row10, ref setScope)); - row = tempRef_row10.get(); + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().DeleteSparse(tempReference_row10, ref setScope)); + row = tempReference_row10.get(); // Write a set of sets, successfully insert an empty set into it, and then try to write directly to the inner // set. // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("prices", out c); - RefObject tempRef_row11 = - new RefObject(row); - RefObject tempRef_row12 = - new RefObject(row); + Reference tempReference_row11 = + new Reference(row); + Reference tempReference_row12 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row11, out setScope).Find(tempRef_row12, c.Path); - row = tempRef_row12.get(); - row = tempRef_row11.get(); - RefObject tempRef_row13 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row11, out setScope).Find(tempReference_row12, c.Path); + row = tempReference_row12.get(); + row = tempReference_row11.get(); + Reference tempReference_row13 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().WriteScope(tempRef_row13, ref setScope, c.TypeArgs, + // 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, out setScope)); - row = tempRef_row13.get(); + row = tempReference_row13.get(); TypeArgument innerType = c.TypeArgs[0]; TypeArgument itemType = innerType.getTypeArgs().get(0).clone(); LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_row14 = - new RefObject(row); - RefObject tempRef_row15 = - new RefObject(row); + Reference tempReference_row14 = + new Reference(row); + Reference tempReference_row15 = + new Reference(row); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row14, out tempCursor1).Find(tempRef_row15, "prices.0"); - row = tempRef_row15.get(); - row = tempRef_row14.get(); - RefObject tempRef_row16 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row14, out tempCursor1).Find(tempReference_row15, "prices.0"); + row = tempReference_row15.get(); + row = tempReference_row14.get(); + Reference tempReference_row16 = + new Reference(row); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(innerLayout.WriteScope(tempRef_row16, ref tempCursor1, innerType.getTypeArgs().clone() + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(innerLayout.WriteScope(tempReference_row16, ref tempCursor1, innerType.getTypeArgs().clone() , out innerScope)); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); - RefObject tempRef_row18 = - new RefObject(row); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); + Reference tempReference_row18 = + new Reference(row); RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - RowCursor.Create(tempRef_row17, out tempCursor2).Find(tempRef_row18, "prices.0.0"); - row = tempRef_row18.get(); - row = tempRef_row17.get(); - RefObject tempRef_row19 = - new RefObject(row); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(itemType.getType().TypeAs().WriteSparse(tempRef_row19, - tempRef_tempCursor2, 1.0F)); - tempCursor2 = tempRef_tempCursor2.get(); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); - RefObject tempRef_innerScope = - new RefObject(innerScope); - RefObject tempRef_tempCursor22 = - new RefObject(tempCursor2); - ResultAssert.IsSuccess(innerLayout.MoveField(tempRef_row20, tempRef_innerScope, tempRef_tempCursor22)); - tempCursor2 = tempRef_tempCursor22.get(); - innerScope = tempRef_innerScope.get(); - row = tempRef_row20.get(); - RefObject tempRef_row21 = - new RefObject(row); + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + RowCursor.Create(tempReference_row17, out tempCursor2).Find(tempReference_row18, "prices.0.0"); + row = tempReference_row18.get(); + row = tempReference_row17.get(); + Reference tempReference_row19 = + new Reference(row); + Reference tempReference_tempCursor2 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(itemType.getType().TypeAs().WriteSparse(tempReference_row19, + tempReference_tempCursor2, 1.0F)); + tempCursor2 = tempReference_tempCursor2.get(); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); + Reference tempReference_innerScope = + new Reference(innerScope); + Reference tempReference_tempCursor22 = + new Reference(tempCursor2); + ResultAssert.IsSuccess(innerLayout.MoveField(tempReference_row20, tempReference_innerScope, tempReference_tempCursor22)); + tempCursor2 = tempReference_tempCursor22.get(); + innerScope = tempReference_innerScope.get(); + row = tempReference_row20.get(); + Reference tempReference_row21 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row21, ref setScope, ref tempCursor1)); - row = tempRef_row21.get(); - RefObject tempRef_row22 = - new RefObject(row); - assert setScope.MoveNext(tempRef_row22); - row = tempRef_row22.get(); - RefObject tempRef_row23 = - new RefObject(row); - RefObject tempRef_setScope = - new RefObject(setScope); - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(tempRef_row23, tempRef_setScope, tempOut_innerScope)); + // 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)); + row = tempReference_row21.get(); + Reference tempReference_row22 = + new Reference(row); + assert setScope.MoveNext(tempReference_row22); + row = tempReference_row22.get(); + Reference tempReference_row23 = + new Reference(row); + Reference tempReference_setScope = + new Reference(setScope); + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(tempReference_row23, tempReference_setScope, tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - setScope = tempRef_setScope.get(); - row = tempRef_row23.get(); - RefObject tempRef_row24 = - new RefObject(row); - RefObject tempRef_innerScope2 = - new RefObject(innerScope); - ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().WriteSparse(tempRef_row24, - tempRef_innerScope2, 1.0F)); - innerScope = tempRef_innerScope2.get(); - row = tempRef_row24.get(); - RefObject tempRef_row25 = - new RefObject(row); - RefObject tempRef_innerScope3 = - new RefObject(innerScope); - ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().DeleteSparse(tempRef_row25, - tempRef_innerScope3)); - innerScope = tempRef_innerScope3.get(); - row = tempRef_row25.get(); + setScope = tempReference_setScope.get(); + row = tempReference_row23.get(); + Reference tempReference_row24 = + new Reference(row); + Reference tempReference_innerScope2 = + new Reference(innerScope); + ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().WriteSparse(tempReference_row24, + tempReference_innerScope2, 1.0F)); + innerScope = tempReference_innerScope2.get(); + row = tempReference_row24.get(); + Reference tempReference_row25 = + new Reference(row); + Reference tempReference_innerScope3 = + new Reference(innerScope); + ResultAssert.InsufficientPermissions(itemType.getType().TypeAs().DeleteSparse(tempReference_row25, + tempReference_innerScope3)); + innerScope = tempReference_innerScope3.get(); + row = tempReference_row25.get(); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -892,82 +894,82 @@ public final class TypedSetUnitTests { t1.Projects = new ArrayList(permutation); row.InitLayout(HybridRowVersion.V1, this.layout, this.resolver); - RefObject tempRef_row = - new RefObject(row); - ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempRef_row, t1, TypedSetUnitTests.SerializeTodo)); - row = tempRef_row.get(); + Reference tempReference_row = + new Reference(row); + ResultAssert.IsSuccess(RowWriter.WriteBuffer(tempReference_row, t1, TypedSetUnitTests.SerializeTodo)); + row = tempReference_row.get(); // Update the existing Set by updating each item with itself. This ensures that the RowWriter has // maintained the unique index correctly. LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("projects", out c); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row2 = + new Reference(row); RowCursor root; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - RowCursor.Create(tempRef_row2, out root); - row = tempRef_row2.get(); - RefObject tempRef_row3 = - new RefObject(row); + RowCursor.Create(tempReference_row2, out root); + row = tempReference_row2.get(); + Reference tempReference_row3 = + new Reference(row); RowCursor projScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out projScope).Find(tempRef_row3, c.Path); - row = tempRef_row3.get(); - RefObject tempRef_row4 = - new RefObject(row); + root.Clone(out projScope).Find(tempReference_row3, c.Path); + row = tempReference_row3.get(); + Reference tempReference_row4 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row4, ref projScope, out projScope)); - row = tempRef_row4.get(); + ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempReference_row4, ref projScope, out projScope)); + row = tempReference_row4.get(); for (UUID item : t1.Projects) { - RefObject tempRef_row5 = - new RefObject(row); + Reference tempReference_row5 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row5, Utf8String.Empty); - row = tempRef_row5.get(); - RefObject tempRef_row6 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row5, Utf8String.Empty); + row = tempReference_row5.get(); + Reference tempReference_row6 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row6, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row6, ref tempCursor, item)); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row7, ref projScope, + ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row7, ref projScope, ref tempCursor)); - row = tempRef_row7.get(); + row = tempReference_row7.get(); } - RefObject tempRef_row8 = - new RefObject(row); - RefObject tempRef_row9 = - new RefObject(row); + Reference tempReference_row8 = + new Reference(row); + Reference tempReference_row9 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - Todo t2 = this.ReadTodo(tempRef_row8, RowCursor.Create(tempRef_row9, out _)); - row = tempRef_row9.get(); - row = tempRef_row8.get(); + Todo t2 = this.ReadTodo(tempReference_row8, RowCursor.Create(tempReference_row9, out _)); + row = tempReference_row9.get(); + row = tempReference_row8.get(); assert t1 == t2; } } @@ -986,193 +988,193 @@ public final class TypedSetUnitTests { Todo t1 = new Todo(); t1.Projects = new ArrayList(permutation); - RefObject tempRef_row = - new RefObject(row); - RefObject tempRef_row2 = - new RefObject(row); + Reference tempReference_row = + new Reference(row); + Reference tempReference_row2 = + new Reference(row); RowCursor _; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - this.WriteTodo(tempRef_row, RowCursor.Create(tempRef_row2, out _), t1); - row = tempRef_row2.get(); - row = tempRef_row.get(); + this.WriteTodo(tempReference_row, RowCursor.Create(tempReference_row2, out _), t1); + row = tempReference_row2.get(); + row = tempReference_row.get(); // Attempt to find each item in turn and then delete it. - RefObject tempRef_row3 = - new RefObject(row); - RowCursor root = RowCursor.Create(tempRef_row3); - row = tempRef_row3.get(); + Reference tempReference_row3 = + new Reference(row); + RowCursor root = RowCursor.Create(tempReference_row3); + row = tempReference_row3.get(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert this.layout.TryFind("projects", out c); - RefObject tempRef_row4 = - new RefObject(row); + Reference tempReference_row4 = + new Reference(row); RowCursor setScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - root.Clone(out setScope).Find(tempRef_row4, c.Path); - row = tempRef_row4.get(); - RefObject tempRef_row5 = - new RefObject(row); + root.Clone(out setScope).Find(tempReference_row4, c.Path); + row = tempReference_row4.get(); + Reference tempReference_row5 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: - ResultAssert.IsSuccess(c.TypeAs().ReadScope(tempRef_row5, ref setScope, out setScope)); - row = tempRef_row5.get(); + 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. - RefObject tempRef_row6 = - new RefObject(row); + Reference tempReference_row6 = + new Reference(row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row6, Utf8String.Empty); - row = tempRef_row6.get(); - RefObject tempRef_row7 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row6, Utf8String.Empty); + row = tempReference_row6.get(); + Reference tempReference_row7 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row7, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row7, ref tempCursor, elm)); - row = tempRef_row7.get(); - RefObject tempRef_row8 = - new RefObject(row); + row = tempReference_row7.get(); + Reference tempReference_row8 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: C# to Java Converter could not resolve the named parameters in the // following line: //ORIGINAL LINE: ResultAssert.IsSuccess(c.TypeAs().Find(ref row, ref setScope, ref // tempCursor, value: out RowCursor _)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().Find(tempRef_row8, ref setScope, ref tempCursor, + ResultAssert.IsSuccess(c.TypeAs().Find(tempReference_row8, ref setScope, ref tempCursor, value: out RowCursor _)) - row = tempRef_row8.get(); + row = tempReference_row8.get(); // Insert it again with update. - RefObject tempRef_row9 = - new RefObject(row); + Reference tempReference_row9 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row9, Utf8String.Empty); - row = tempRef_row9.get(); - RefObject tempRef_row10 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row9, Utf8String.Empty); + row = tempReference_row9.get(); + Reference tempReference_row10 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row10, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row10, ref tempCursor, elm)); - row = tempRef_row10.get(); - RefObject tempRef_row11 = - new RefObject(row); + row = tempReference_row10.get(); + Reference tempReference_row11 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row11, ref setScope, + ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row11, ref setScope, ref tempCursor, UpdateOptions.Update)); - row = tempRef_row11.get(); + row = tempReference_row11.get(); // Insert it again with upsert. - RefObject tempRef_row12 = - new RefObject(row); + Reference tempReference_row12 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row12, Utf8String.Empty); - row = tempRef_row12.get(); - RefObject tempRef_row13 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row12, Utf8String.Empty); + row = tempReference_row12.get(); + Reference tempReference_row13 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row13, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row13, ref tempCursor, elm)); - row = tempRef_row13.get(); - RefObject tempRef_row14 = - new RefObject(row); + row = tempReference_row13.get(); + Reference tempReference_row14 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeAs().MoveField(tempRef_row14, ref setScope, + ResultAssert.IsSuccess(c.TypeAs().MoveField(tempReference_row14, ref setScope, ref tempCursor)); - row = tempRef_row14.get(); + row = tempReference_row14.get(); // Insert it again with insert (fail: exists). - RefObject tempRef_row15 = - new RefObject(row); + Reference tempReference_row15 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row15, Utf8String.Empty); - row = tempRef_row15.get(); - RefObject tempRef_row16 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row15, Utf8String.Empty); + row = tempReference_row15.get(); + Reference tempReference_row16 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row16, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row16, ref tempCursor, elm)); - row = tempRef_row16.get(); - RefObject tempRef_row17 = - new RefObject(row); + row = tempReference_row16.get(); + Reference tempReference_row17 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.Exists(c.TypeAs().MoveField(tempRef_row17, ref setScope, + ResultAssert.Exists(c.TypeAs().MoveField(tempReference_row17, ref setScope, ref tempCursor, UpdateOptions.Insert)); - row = tempRef_row17.get(); + row = tempReference_row17.get(); // Insert it again with insert at (fail: disallowed). - RefObject tempRef_row18 = - new RefObject(row); + Reference tempReference_row18 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: - root.Clone(out tempCursor).Find(tempRef_row18, Utf8String.Empty); - row = tempRef_row18.get(); - RefObject tempRef_row19 = - new RefObject(row); + root.Clone(out tempCursor).Find(tempReference_row18, Utf8String.Empty); + row = tempReference_row18.get(); + Reference tempReference_row19 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempRef_row19, + ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().WriteSparse(tempReference_row19, ref tempCursor, elm)); - row = tempRef_row19.get(); - RefObject tempRef_row20 = - new RefObject(row); + row = tempReference_row19.get(); + Reference tempReference_row20 = + new Reference(row); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: - ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempRef_row20, ref setScope, + ResultAssert.TypeConstraint(c.TypeAs().MoveField(tempReference_row20, ref setScope, ref tempCursor, UpdateOptions.InsertAt)); - row = tempRef_row20.get(); + row = tempReference_row20.get(); } } } - private static ShoppingItem ReadShoppingItem(RefObject row, RefObject matchScope) { + private static ShoppingItem ReadShoppingItem(Reference row, Reference matchScope) { Layout matchLayout = matchScope.get().getLayout(); ShoppingItem m = new ShoppingItem(); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("label", out c); - OutObject tempOut_Label = new OutObject(); + Out tempOut_Label = new Out(); 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 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("count", out c); - OutObject tempOut_Count = new OutObject(); + 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)); @@ -1180,30 +1182,30 @@ public final class TypedSetUnitTests { return m; } - private Todo ReadTodo(RefObject row, RefObject root) { + private Todo ReadTodo(Reference row, Reference root) { Todo value = new Todo(); LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("attendees", out c); RowCursor tagsScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out tagsScope).Find(row, c.Path); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref tagsScope, out tagsScope) == Result.Success) { value.Attendees = new ArrayList(); while (tagsScope.MoveNext(row)) { String item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref tagsScope, out item)); @@ -1212,25 +1214,25 @@ public final class TypedSetUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("projects", out c); RowCursor projScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref projScope, out projScope) == Result.Success) { value.Projects = new ArrayList(); while (projScope.MoveNext(row)) { java.util.UUID item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref projScope, out item)); @@ -1239,25 +1241,25 @@ public final class TypedSetUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("checkboxes", out c); RowCursor checkboxScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref checkboxScope, out checkboxScope) == Result.Success) { value.Checkboxes = new ArrayList(); while (checkboxScope.MoveNext(row)) { boolean item; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.TypeArgs[0].Type.TypeAs().ReadSparse(row, ref checkboxScope, out item)); @@ -1266,39 +1268,39 @@ public final class TypedSetUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("prices", out c); RowCursor pricesScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref pricesScope, out pricesScope) == Result.Success) { value.Prices = new ArrayList>(); TypeArgument innerType = c.TypeArgs[0]; LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); while (pricesScope.MoveNext(row)) { ArrayList item = new ArrayList(); - RefObject tempRef_pricesScope = - new RefObject(pricesScope); + Reference tempReference_pricesScope = + new Reference(pricesScope); RowCursor innerScope; - OutObject tempOut_innerScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_pricesScope, tempOut_innerScope)); + Out tempOut_innerScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_pricesScope, tempOut_innerScope)); innerScope = tempOut_innerScope.get(); - pricesScope = tempRef_pricesScope.get(); + pricesScope = tempReference_pricesScope.get(); while (innerScope.MoveNext(row)) { LayoutFloat32 itemLayout = innerType.getTypeArgs().get(0).getType().TypeAs(); - RefObject tempRef_innerScope = - new RefObject(innerScope); + Reference tempReference_innerScope = + new Reference(innerScope); float innerItem; - OutObject tempOut_innerItem = new OutObject(); - ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempRef_innerScope, tempOut_innerItem)); + Out tempOut_innerItem = new Out(); + ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempReference_innerScope, tempOut_innerItem)); innerItem = tempOut_innerItem.get(); - innerScope = tempRef_innerScope.get(); + innerScope = tempReference_innerScope.get(); item.add(innerItem); } @@ -1307,50 +1309,50 @@ public final class TypedSetUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("nested", out c); RowCursor nestedScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref nestedScope, out nestedScope) == Result.Success) { value.Nested = new ArrayList>>(); TypeArgument in2Type = c.TypeArgs[0]; LayoutUniqueScope in2Layout = in2Type.getType().TypeAs(); while (nestedScope.MoveNext(row)) { ArrayList> item = new ArrayList>(); - RefObject tempRef_nestedScope = - new RefObject(nestedScope); + Reference tempReference_nestedScope = + new Reference(nestedScope); RowCursor in2Scope; - OutObject tempOut_in2Scope = - new OutObject(); - ResultAssert.IsSuccess(in2Layout.ReadScope(row, tempRef_nestedScope, tempOut_in2Scope)); + Out tempOut_in2Scope = + new Out(); + ResultAssert.IsSuccess(in2Layout.ReadScope(row, tempReference_nestedScope, tempOut_in2Scope)); in2Scope = tempOut_in2Scope.get(); - nestedScope = tempRef_nestedScope.get(); + nestedScope = tempReference_nestedScope.get(); while (in2Scope.MoveNext(row)) { TypeArgument in3Type = in2Type.getTypeArgs().get(0).clone(); LayoutUniqueScope in3Layout = in3Type.getType().TypeAs(); ArrayList item2 = new ArrayList(); - RefObject tempRef_in2Scope = - new RefObject(in2Scope); + Reference tempReference_in2Scope = + new Reference(in2Scope); RowCursor in3Scope; - OutObject tempOut_in3Scope = - new OutObject(); - ResultAssert.IsSuccess(in3Layout.ReadScope(row, tempRef_in2Scope, tempOut_in3Scope)); + Out tempOut_in3Scope = + new Out(); + ResultAssert.IsSuccess(in3Layout.ReadScope(row, tempReference_in2Scope, tempOut_in3Scope)); in3Scope = tempOut_in3Scope.get(); - in2Scope = tempRef_in2Scope.get(); + in2Scope = tempReference_in2Scope.get(); while (in3Scope.MoveNext(row)) { LayoutInt32 itemLayout = in3Type.getTypeArgs().get(0).getType().TypeAs(); - RefObject tempRef_in3Scope = new RefObject(in3Scope); + Reference tempReference_in3Scope = new Reference(in3Scope); int innerItem; - OutObject tempOut_innerItem2 = new OutObject(); - ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempRef_in3Scope, tempOut_innerItem2)); + Out tempOut_innerItem2 = new Out(); + ResultAssert.IsSuccess(itemLayout.ReadSparse(row, tempReference_in3Scope, tempOut_innerItem2)); innerItem = tempOut_innerItem2.get(); - in3Scope = tempRef_in3Scope.get(); + in3Scope = tempReference_in3Scope.get(); item2.add(innerItem); } @@ -1362,47 +1364,47 @@ public final class TypedSetUnitTests { } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("shopping", out c); RowCursor shoppingScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Ref' helper class unless the method is within the code being modified: if (c.TypeAs().ReadScope(row, ref shoppingScope, out shoppingScope) == Result.Success) { value.Shopping = new ArrayList(); while (shoppingScope.MoveNext(row)) { TypeArgument innerType = c.TypeArgs[0]; LayoutUDT innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_shoppingScope = - new RefObject(shoppingScope); + Reference tempReference_shoppingScope = + new Reference(shoppingScope); RowCursor matchScope; - OutObject tempOut_matchScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_shoppingScope, tempOut_matchScope)); + Out tempOut_matchScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_shoppingScope, tempOut_matchScope)); matchScope = tempOut_matchScope.get(); - shoppingScope = tempRef_shoppingScope.get(); - RefObject tempRef_matchScope = - new RefObject(matchScope); - ShoppingItem item = TypedSetUnitTests.ReadShoppingItem(row, tempRef_matchScope); - matchScope = tempRef_matchScope.get(); + shoppingScope = tempReference_shoppingScope.get(); + Reference tempReference_matchScope = + new Reference(matchScope); + ShoppingItem item = TypedSetUnitTests.ReadShoppingItem(row, tempReference_matchScope); + matchScope = tempReference_matchScope.get(); value.Shopping.add(item); } } // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert this.layout.TryFind("work", out c); RowCursor workScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: root.get().Clone(out 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 'OutObject' 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 'RefObject' helper class unless the method is within the code being modified: + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these cannot be converted using the 'Ref' helper class unless the method is within the code being modified: 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>(); @@ -1411,28 +1413,28 @@ public final class TypedSetUnitTests { TypeArgument innerType = c.TypeArgs[0]; LayoutIndexedScope innerLayout = innerType.getType().TypeAs(); - RefObject tempRef_workScope = new RefObject(workScope); + Reference tempReference_workScope = new Reference(workScope); RowCursor tupleScope; - OutObject tempOut_tupleScope = new OutObject(); - ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempRef_workScope, tempOut_tupleScope)); + Out tempOut_tupleScope = new Out(); + ResultAssert.IsSuccess(innerLayout.ReadScope(row, tempReference_workScope, tempOut_tupleScope)); tupleScope = tempOut_tupleScope.get(); - workScope = tempRef_workScope.get(); + workScope = tempReference_workScope.get(); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope = new RefObject(tupleScope); + Reference tempReference_tupleScope = new Reference(tupleScope); boolean item1; - OutObject tempOut_item1 = new OutObject(); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, tempRef_tupleScope, tempOut_item1)); + Out tempOut_item1 = new Out(); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().ReadSparse(row, tempReference_tupleScope, tempOut_item1)); item1 = tempOut_item1.get(); - tupleScope = tempRef_tupleScope.get(); + tupleScope = tempReference_tupleScope.get(); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope2 = new RefObject(tupleScope); + Reference tempReference_tupleScope2 = new Reference(tupleScope); long item2; - OutObject tempOut_item2 = new OutObject(); + Out tempOut_item2 = new Out(); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: ResultAssert.IsSuccess(innerType.TypeArgs[1].Type.TypeAs().ReadSparse(ref row, ref tupleScope, out ulong item2)); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().ReadSparse(row, tempRef_tupleScope2, tempOut_item2)); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().ReadSparse(row, tempReference_tupleScope2, tempOut_item2)); item2 = tempOut_item2.get(); - tupleScope = tempRef_tupleScope2.get(); + tupleScope = tempReference_tupleScope2.get(); value.Work.add(Tuple.Create(item1, item2)); } } @@ -1440,11 +1442,11 @@ public final class TypedSetUnitTests { return value; } - private static Result SerializeTodo(RefObject writer, TypeArgument typeArg, Todo value) { + private static Result SerializeTodo(Reference writer, TypeArgument typeArg, Todo value) { if (value.Projects != null) { LayoutColumn c; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: assert writer.get().getLayout().TryFind("projects", out c); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are @@ -1464,155 +1466,155 @@ public final class TypedSetUnitTests { return Result.Success; } - private static void WriteShoppingItem(RefObject row, RefObject matchScope, TypeArgumentList typeArgs, ShoppingItem m) { + private static void WriteShoppingItem(Reference row, Reference matchScope, TypeArgumentList typeArgs, ShoppingItem m) { Layout matchLayout = row.get().getResolver().Resolve(typeArgs.getSchemaId().clone()); LayoutColumn c; - // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("label", out c); 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 'OutObject' helper class unless the method is within the code being modified: + // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these cannot be converted using the 'Out' helper class unless the method is within the code being modified: assert matchLayout.TryFind("count", out c); ResultAssert.IsSuccess(c.TypeAs().WriteFixed(row, matchScope, c, m.Count)); } - private void WriteTodo(RefObject row, RefObject root, Todo value) { + private void WriteTodo(Reference row, Reference root, Todo value) { LayoutColumn c; if (value.Attendees != null) { - OutObject tempOut_c = - new OutObject(); + Out tempOut_c = + new Out(); assert this.layout.TryFind("attendees", tempOut_c); c = tempOut_c.get(); RowCursor attendScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out attendScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref attendScope, c.getTypeArgs().clone(), out attendScope)); for (String item : value.Attendees) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(c.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, ref tempCursor, item)); - RefObject tempRef_attendScope = - new RefObject(attendScope); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_attendScope, - tempRef_tempCursor)); - tempCursor = tempRef_tempCursor.get(); - attendScope = tempRef_attendScope.get(); + Reference tempReference_attendScope = + new Reference(attendScope); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_attendScope, + tempReference_tempCursor)); + tempCursor = tempReference_tempCursor.get(); + attendScope = tempReference_attendScope.get(); } } if (value.Projects != null) { - OutObject tempOut_c2 = - new OutObject(); + Out tempOut_c2 = + new Out(); assert this.layout.TryFind("projects", tempOut_c2); c = tempOut_c2.get(); RowCursor projScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out projScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref projScope, c.getTypeArgs().clone(), out projScope)); for (UUID item : value.Projects) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); - RefObject tempRef_tempCursor2 = - new RefObject(tempCursor); + Reference tempReference_tempCursor2 = + new Reference(tempCursor); ResultAssert.IsSuccess(c.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, - tempRef_tempCursor2, item)); - tempCursor = tempRef_tempCursor2.get(); - RefObject tempRef_projScope = - new RefObject(projScope); - RefObject tempRef_tempCursor3 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_projScope, - tempRef_tempCursor3)); - tempCursor = tempRef_tempCursor3.get(); - projScope = tempRef_projScope.get(); + 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, + tempReference_tempCursor3)); + tempCursor = tempReference_tempCursor3.get(); + projScope = tempReference_projScope.get(); } } if (value.Checkboxes != null) { - OutObject tempOut_c3 = - new OutObject(); + Out tempOut_c3 = + new Out(); assert this.layout.TryFind("checkboxes", tempOut_c3); c = tempOut_c3.get(); RowCursor checkboxScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out checkboxScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref checkboxScope, c.getTypeArgs().clone(), out checkboxScope)); for (boolean item : value.Checkboxes) { RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); - RefObject tempRef_tempCursor4 = - new RefObject(tempCursor); + Reference tempReference_tempCursor4 = + new Reference(tempCursor); ResultAssert.IsSuccess(c.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, - tempRef_tempCursor4, item)); - tempCursor = tempRef_tempCursor4.get(); - RefObject tempRef_checkboxScope = - new RefObject(checkboxScope); - RefObject tempRef_tempCursor5 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_checkboxScope, - tempRef_tempCursor5)); - tempCursor = tempRef_tempCursor5.get(); - checkboxScope = tempRef_checkboxScope.get(); + 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, + tempReference_tempCursor5)); + tempCursor = tempReference_tempCursor5.get(); + checkboxScope = tempReference_checkboxScope.get(); } } if (value.Prices != null) { - OutObject tempOut_c4 = - new OutObject(); + Out tempOut_c4 = + new Out(); assert this.layout.TryFind("prices", tempOut_c4); c = tempOut_c4.get(); RowCursor pricesScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out pricesScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref pricesScope, c.getTypeArgs().clone(), out pricesScope)); @@ -1622,15 +1624,15 @@ public final class TypedSetUnitTests { LayoutUniqueScope innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor1).Find(row, "prices.0"); RowCursor innerScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(innerLayout.WriteScope(row, ref tempCursor1, innerType.getTypeArgs().clone(), out innerScope)); @@ -1638,47 +1640,47 @@ public final class TypedSetUnitTests { LayoutFloat32 itemLayout = innerType.getTypeArgs().get(0).getType().TypeAs(); RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // - these cannot be converted using the 'OutObject' helper class unless the method is within the + // - these cannot be converted using the 'Out' helper class unless the method is within the // code being modified: root.get().Clone(out tempCursor2).Find(row, "prices.0.0"); - RefObject tempRef_tempCursor2 - = new RefObject(tempCursor2); - ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempRef_tempCursor2, innerItem)); - tempCursor2 = tempRef_tempCursor2.get(); - RefObject tempRef_innerScope = - new RefObject(innerScope); - RefObject tempRef_tempCursor22 = new RefObject(tempCursor2); - ResultAssert.IsSuccess(innerLayout.MoveField(row, tempRef_innerScope, tempRef_tempCursor22)); - tempCursor2 = tempRef_tempCursor22.get(); - innerScope = tempRef_innerScope.get(); + Reference tempReference_tempCursor2 + = new Reference(tempCursor2); + ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempReference_tempCursor2, innerItem)); + tempCursor2 = tempReference_tempCursor2.get(); + Reference tempReference_innerScope = + new Reference(innerScope); + Reference tempReference_tempCursor22 = new Reference(tempCursor2); + ResultAssert.IsSuccess(innerLayout.MoveField(row, tempReference_innerScope, tempReference_tempCursor22)); + tempCursor2 = tempReference_tempCursor22.get(); + innerScope = tempReference_innerScope.get(); } - RefObject tempRef_pricesScope = - new RefObject(pricesScope); - RefObject tempRef_tempCursor1 = - new RefObject(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_pricesScope, - tempRef_tempCursor1)); - tempCursor1 = tempRef_tempCursor1.get(); - pricesScope = tempRef_pricesScope.get(); + Reference tempReference_pricesScope = + new Reference(pricesScope); + Reference tempReference_tempCursor1 = + new Reference(tempCursor1); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_pricesScope, + tempReference_tempCursor1)); + tempCursor1 = tempReference_tempCursor1.get(); + pricesScope = tempReference_pricesScope.get(); } } if (value.Nested != null) { - OutObject tempOut_c5 = - new OutObject(); + Out tempOut_c5 = + new Out(); assert this.layout.TryFind("nested", tempOut_c5); c = tempOut_c5.get(); RowCursor nestedScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out nestedScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref nestedScope, c.getTypeArgs().clone(), out nestedScope)); @@ -1688,15 +1690,15 @@ public final class TypedSetUnitTests { LayoutUniqueScope in2Layout = in2Type.getType().TypeAs(); RowCursor tempCursor1; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor1).Find(row, "prices.0"); RowCursor in2Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(in2Layout.WriteScope(row, ref tempCursor1, in2Type.getTypeArgs().clone(), out in2Scope)); @@ -1706,15 +1708,15 @@ public final class TypedSetUnitTests { LayoutUniqueScope in3Layout = in3Type.getType().TypeAs(); RowCursor tempCursor2; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // - these cannot be converted using the 'OutObject' helper class unless the method is within the + // - these cannot be converted using the 'Out' helper class unless the method is within the // code being modified: root.get().Clone(out tempCursor2).Find(row, "prices.0.0"); RowCursor in3Scope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - // - these cannot be converted using the 'OutObject' helper class unless the method is within the + // - 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 'RefObject' helper class unless the method is within the + // - these cannot be converted using the 'Ref' helper class unless the method is within the // code being modified: ResultAssert.IsSuccess(in3Layout.WriteScope(row, ref tempCursor2, in3Type.getTypeArgs().clone(), out in3Scope)); @@ -1722,53 +1724,53 @@ public final class TypedSetUnitTests { LayoutInt32 itemLayout = in3Type.getTypeArgs().get(0).getType().TypeAs(); RowCursor tempCursor3; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' - // keyword - these cannot be converted using the 'OutObject' helper class unless the method + // keyword - these cannot be converted using the 'Out' helper class unless the method // is within the code being modified: root.get().Clone(out tempCursor3).Find(row, "prices.0.0.0"); - RefObject tempRef_tempCursor3 = new RefObject(tempCursor3); - ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempRef_tempCursor3, innerItem)); - tempCursor3 = tempRef_tempCursor3.get(); - RefObject tempRef_in3Scope = new RefObject(in3Scope); - RefObject tempRef_tempCursor32 = new RefObject(tempCursor3); - ResultAssert.IsSuccess(in3Layout.MoveField(row, tempRef_in3Scope, tempRef_tempCursor32)); - tempCursor3 = tempRef_tempCursor32.get(); - in3Scope = tempRef_in3Scope.get(); + Reference tempReference_tempCursor3 = new Reference(tempCursor3); + ResultAssert.IsSuccess(itemLayout.WriteSparse(row, tempReference_tempCursor3, innerItem)); + tempCursor3 = tempReference_tempCursor3.get(); + Reference tempReference_in3Scope = new Reference(in3Scope); + Reference tempReference_tempCursor32 = new Reference(tempCursor3); + ResultAssert.IsSuccess(in3Layout.MoveField(row, tempReference_in3Scope, tempReference_tempCursor32)); + tempCursor3 = tempReference_tempCursor32.get(); + in3Scope = tempReference_in3Scope.get(); } - RefObject tempRef_in2Scope = - new RefObject(in2Scope); - RefObject tempRef_tempCursor23 = new RefObject(tempCursor2); - ResultAssert.IsSuccess(in2Layout.MoveField(row, tempRef_in2Scope, tempRef_tempCursor23)); - tempCursor2 = tempRef_tempCursor23.get(); - in2Scope = tempRef_in2Scope.get(); + Reference tempReference_in2Scope = + new Reference(in2Scope); + Reference tempReference_tempCursor23 = new Reference(tempCursor2); + ResultAssert.IsSuccess(in2Layout.MoveField(row, tempReference_in2Scope, tempReference_tempCursor23)); + tempCursor2 = tempReference_tempCursor23.get(); + in2Scope = tempReference_in2Scope.get(); } - RefObject tempRef_nestedScope = - new RefObject(nestedScope); - RefObject tempRef_tempCursor12 = - new RefObject(tempCursor1); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_nestedScope, - tempRef_tempCursor12)); - tempCursor1 = tempRef_tempCursor12.get(); - nestedScope = tempRef_nestedScope.get(); + Reference tempReference_nestedScope = + new Reference(nestedScope); + Reference tempReference_tempCursor12 = + new Reference(tempCursor1); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_nestedScope, + tempReference_tempCursor12)); + tempCursor1 = tempReference_tempCursor12.get(); + nestedScope = tempReference_nestedScope.get(); } } if (value.Shopping != null) { - OutObject tempOut_c6 = - new OutObject(); + Out tempOut_c6 = + new Out(); assert this.layout.TryFind("shopping", tempOut_c6); c = tempOut_c6.get(); RowCursor shoppingScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out shoppingScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref shoppingScope, c.getTypeArgs().clone(), out shoppingScope)); @@ -1777,48 +1779,48 @@ public final class TypedSetUnitTests { LayoutUDT innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); - RefObject tempRef_tempCursor6 = - new RefObject(tempCursor); + Reference tempReference_tempCursor6 = + new Reference(tempCursor); RowCursor itemScope; - OutObject tempOut_itemScope = - new OutObject(); - ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempRef_tempCursor6, + Out tempOut_itemScope = + new Out(); + ResultAssert.IsSuccess(innerLayout.WriteScope(row, tempReference_tempCursor6, innerType.getTypeArgs().clone(), tempOut_itemScope)); itemScope = tempOut_itemScope.get(); - tempCursor = tempRef_tempCursor6.get(); - RefObject tempRef_itemScope = - new RefObject(itemScope); - TypedSetUnitTests.WriteShoppingItem(row, tempRef_itemScope, innerType.getTypeArgs().clone(), item); - itemScope = tempRef_itemScope.get(); - RefObject tempRef_shoppingScope = - new RefObject(shoppingScope); - RefObject tempRef_tempCursor7 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_shoppingScope, - tempRef_tempCursor7)); - tempCursor = tempRef_tempCursor7.get(); - shoppingScope = tempRef_shoppingScope.get(); + tempCursor = tempReference_tempCursor6.get(); + Reference tempReference_itemScope = + new Reference(itemScope); + TypedSetUnitTests.WriteShoppingItem(row, tempReference_itemScope, innerType.getTypeArgs().clone(), item); + itemScope = tempReference_itemScope.get(); + Reference tempReference_shoppingScope = + new Reference(shoppingScope); + Reference tempReference_tempCursor7 = + new Reference(tempCursor); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_shoppingScope, + tempReference_tempCursor7)); + tempCursor = tempReference_tempCursor7.get(); + shoppingScope = tempReference_shoppingScope.get(); } } if (value.Work != null) { - OutObject tempOut_c7 = - new OutObject(); + Out tempOut_c7 = + new Out(); assert this.layout.TryFind("work", tempOut_c7); c = tempOut_c7.get(); RowCursor workScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: root.get().Clone(out workScope).Find(row, c.getPath()); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: ResultAssert.IsSuccess(c.TypeAs().WriteScope(row, ref workScope, c.getTypeArgs().clone(), out workScope)); @@ -1829,35 +1831,35 @@ public final class TypedSetUnitTests { LayoutIndexedScope innerLayout = innerType.getType().TypeAs(); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: root.get().Clone(out tempCursor).Find(row, Utf8String.Empty); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - - // these cannot be converted using the 'OutObject' helper class unless the method is within the code + // these cannot be converted using the 'Out' helper class unless the method is within the code // being modified: // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - - // these cannot be converted using the 'RefObject' helper class unless the method is within the code + // these cannot be converted using the 'Ref' helper class unless the method is within the code // being modified: ResultAssert.IsSuccess(innerLayout.WriteScope(row, ref tempCursor, innerType.getTypeArgs().clone(), out tupleScope)); - RefObject tempRef_tupleScope = - new RefObject(tupleScope); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, tempRef_tupleScope, item.Item1)); - tupleScope = tempRef_tupleScope.get(); + Reference tempReference_tupleScope = + new Reference(tupleScope); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(0).getType().TypeAs().WriteSparse(row, tempReference_tupleScope, item.Item1)); + tupleScope = tempReference_tupleScope.get(); assert tupleScope.MoveNext(row); - RefObject tempRef_tupleScope2 = - new RefObject(tupleScope); - ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(row, tempRef_tupleScope2, item.Item2)); - tupleScope = tempRef_tupleScope2.get(); - RefObject tempRef_workScope = - new RefObject(workScope); - RefObject tempRef_tempCursor8 = - new RefObject(tempCursor); - ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempRef_workScope, - tempRef_tempCursor8)); - tempCursor = tempRef_tempCursor8.get(); - workScope = tempRef_workScope.get(); + Reference tempReference_tupleScope2 = + new Reference(tupleScope); + ResultAssert.IsSuccess(innerType.getTypeArgs().get(1).getType().TypeAs().WriteSparse(row, tempReference_tupleScope2, item.Item2)); + tupleScope = tempReference_tupleScope2.get(); + Reference tempReference_workScope = + new Reference(workScope); + Reference tempReference_tempCursor8 = + new Reference(tempCursor); + ResultAssert.IsSuccess(c.TypeAs().MoveField(row, tempReference_workScope, + tempReference_tempCursor8)); + tempCursor = tempReference_tempCursor8.get(); + workScope = tempReference_workScope.get(); } } } diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/WriteRowDispatcher.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/WriteRowDispatcher.java index 757f378..ed3cc6a 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/WriteRowDispatcher.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/WriteRowDispatcher.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.RowBuffer; import com.azure.data.cosmos.serialization.hybridrow.RowCursor; import com.azure.data.cosmos.serialization.hybridrow.layouts.LayoutType; @@ -20,229 +21,229 @@ import java.util.UUID; //ORIGINAL LINE: internal struct WriteRowDispatcher : IDispatcher public final class WriteRowDispatcher implements IDispatcher { - public , TValue> void Dispatch(RefObject dispatcher, RefObject field, LayoutColumn col, LayoutType t) { + public , TValue> void Dispatch(Reference dispatcher, Reference field, LayoutColumn col, LayoutType t) { Dispatch(dispatcher, field, col, t, null); } //C# TO JAVA CONVERTER NOTE: Java does not support optional parameters. Overloaded method(s) are created above: //ORIGINAL LINE: public void Dispatch(ref RowOperationDispatcher dispatcher, ref RowCursor // field, LayoutColumn col, LayoutType t, TValue value = default) where TLayout : LayoutType - public , TValue> void Dispatch(RefObject dispatcher, RefObject field, LayoutColumn col, LayoutType t, TValue value) { + public , TValue> void Dispatch(Reference dispatcher, Reference field, LayoutColumn col, LayoutType t, TValue value) { switch (col == null ? null : col.getStorage()) { case Fixed: - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().WriteFixed(tempRef_Row, field, col, value)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().WriteFixed(tempReference_Row, field, col, value)); + dispatcher.get().argValue.Row = tempReference_Row.get(); break; case Variable: - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().WriteVariable(tempRef_Row2, field, col, value)); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().WriteVariable(tempReference_Row2, field, col, value)); + dispatcher.get().argValue.Row = tempReference_Row2.get(); break; default: - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - ResultAssert.IsSuccess(t.TypeAs().WriteSparse(tempRef_Row3, field, value)); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + ResultAssert.IsSuccess(t.TypeAs().WriteSparse(tempReference_Row3, field, value)); + dispatcher.get().argValue.Row = tempReference_Row3.get(); break; } } - public void DispatchArray(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchArray(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor arrayScope; - OutObject tempOut_arrayScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), + Out tempOut_arrayScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), tempOut_arrayScope)); arrayScope = tempOut_arrayScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); List items = (List)value; for (Object item : items) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref arrayScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), item); - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - arrayScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + arrayScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); } } - public void DispatchMap(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchMap(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor mapScope; - OutObject tempOut_mapScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), + Out tempOut_mapScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), tempOut_mapScope)); mapScope = tempOut_mapScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); - RefObject tempRef_mapScope = - new RefObject(mapScope); - TypeArgument fieldType = t.TypeAs().FieldType(tempRef_mapScope).clone(); - mapScope = tempRef_mapScope.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); + Reference tempReference_mapScope = + new Reference(mapScope); + TypeArgument fieldType = t.TypeAs().FieldType(tempReference_mapScope).clone(); + mapScope = tempReference_mapScope.get(); List pairs = (List)value; for (Object pair : pairs) { String elmPath = UUID.NewGuid().toString(); - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - RowCursor.CreateForAppend(tempRef_Row2, out tempCursor); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + RowCursor.CreateForAppend(tempReference_Row2, out tempCursor); + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref tempCursor, elmPath, fieldType.getType(), fieldType.getTypeArgs().clone(), pair); // Move item into the map. - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - RefObject tempRef_mapScope2 = - new RefObject(mapScope); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(t.TypeAs().MoveField(tempRef_Row3, tempRef_mapScope2, - tempRef_tempCursor)); - tempCursor = tempRef_tempCursor.get(); - mapScope = tempRef_mapScope2.get(); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + Reference tempReference_mapScope2 = + new Reference(mapScope); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(t.TypeAs().MoveField(tempReference_Row3, tempReference_mapScope2, + tempReference_tempCursor)); + tempCursor = tempReference_tempCursor.get(); + mapScope = tempReference_mapScope2.get(); + dispatcher.get().argValue.Row = tempReference_Row3.get(); } } - public void DispatchNullable(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchNullable(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor nullableScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), value != null, out nullableScope)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); if (value != null) { // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref nullableScope, null, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), value); } } - public void DispatchObject(RefObject dispatcher, - RefObject scope) { + public void DispatchObject(Reference dispatcher, + Reference scope) { } - public void DispatchSet(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchSet(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() == 1); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor setScope; - OutObject tempOut_setScope = - new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), + Out tempOut_setScope = + new Out(); + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), tempOut_setScope)); setScope = tempOut_setScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); List items = (List)value; for (Object item : items) { String elmPath = UUID.NewGuid().toString(); - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); RowCursor tempCursor; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being + // cannot be converted using the 'Out' helper class unless the method is within the code being // modified: - RowCursor.CreateForAppend(tempRef_Row2, out tempCursor); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + RowCursor.CreateForAppend(tempReference_Row2, out tempCursor); + dispatcher.get().argValue.Row = tempReference_Row2.get(); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref tempCursor, elmPath, typeArgs.get(0).getType(), typeArgs.get(0).getTypeArgs().clone(), item); // Move item into the set. - RefObject tempRef_Row3 = - new RefObject(dispatcher.get().Row); - RefObject tempRef_setScope = - new RefObject(setScope); - RefObject tempRef_tempCursor = - new RefObject(tempCursor); - ResultAssert.IsSuccess(t.TypeAs().MoveField(tempRef_Row3, tempRef_setScope, - tempRef_tempCursor)); - tempCursor = tempRef_tempCursor.get(); - setScope = tempRef_setScope.get(); - dispatcher.get().argValue.Row = tempRef_Row3.get(); + Reference tempReference_Row3 = + new Reference(dispatcher.get().Row); + Reference tempReference_setScope = + new Reference(setScope); + Reference tempReference_tempCursor = + new Reference(tempCursor); + ResultAssert.IsSuccess(t.TypeAs().MoveField(tempReference_Row3, tempReference_setScope, + tempReference_tempCursor)); + tempCursor = tempReference_tempCursor.get(); + setScope = tempReference_setScope.get(); + dispatcher.get().argValue.Row = tempReference_Row3.get(); } } - public void DispatchTuple(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchTuple(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { checkArgument(typeArgs.getCount() >= 2); - RefObject tempRef_Row = - new RefObject(dispatcher.get().Row); + Reference tempReference_Row = + new Reference(dispatcher.get().Row); RowCursor tupleScope; // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'out' keyword - these - // cannot be converted using the 'OutObject' helper class unless the method is within the code being modified: - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), + // cannot be converted using the 'Out' helper class unless the method is within the code being modified: + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), out tupleScope)); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); for (int i = 0; i < typeArgs.getCount(); i++) { PropertyInfo valueAccessor = value.getClass().GetProperty(String.format("Item%1$s", i + 1)); // TODO: C# TO JAVA CONVERTER: The following method call contained an unresolved 'ref' keyword - these - // cannot be converted using the 'RefObject' helper class unless the method is within the code being + // cannot be converted using the 'Ref' helper class unless the method is within the code being // modified: dispatcher.get().LayoutCodeSwitch(ref tupleScope, null, typeArgs.get(i).getType(), typeArgs.get(i).getTypeArgs().clone(), valueAccessor.GetValue(value)); - RefObject tempRef_Row2 = - new RefObject(dispatcher.get().Row); - tupleScope.MoveNext(tempRef_Row2); - dispatcher.get().argValue.Row = tempRef_Row2.get(); + Reference tempReference_Row2 = + new Reference(dispatcher.get().Row); + tupleScope.MoveNext(tempReference_Row2); + dispatcher.get().argValue.Row = tempReference_Row2.get(); } } - public void DispatchUDT(RefObject dispatcher, - RefObject scope, LayoutType t, TypeArgumentList typeArgs, + public void DispatchUDT(Reference dispatcher, + Reference scope, LayoutType t, TypeArgumentList typeArgs, Object value) { - RefObject tempRef_Row = new RefObject(dispatcher.get().Row); + Reference tempReference_Row = new Reference(dispatcher.get().Row); RowCursor udtScope; - OutObject tempOut_udtScope = new OutObject(); - ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempRef_Row, scope, typeArgs.clone(), tempOut_udtScope)); + Out tempOut_udtScope = new Out(); + ResultAssert.IsSuccess(t.TypeAs().WriteScope(tempReference_Row, scope, typeArgs.clone(), tempOut_udtScope)); udtScope = tempOut_udtScope.get(); - dispatcher.get().argValue.Row = tempRef_Row.get(); + dispatcher.get().argValue.Row = tempReference_Row.get(); IDispatchable valueDispatcher = value instanceof IDispatchable ? (IDispatchable)value : null; assert valueDispatcher != null; - RefObject tempRef_udtScope = new RefObject(udtScope); - valueDispatcher.Dispatch(dispatcher, tempRef_udtScope); - udtScope = tempRef_udtScope.get(); + Reference tempReference_udtScope = new Reference(udtScope); + valueDispatcher.Dispatch(dispatcher, tempReference_udtScope); + udtScope = tempReference_udtScope.get(); } } \ No newline at end of file diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/AddressSerializer.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/AddressSerializer.java index 7f800c5..5d60bf7 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/AddressSerializer.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/AddressSerializer.java @@ -4,20 +4,21 @@ package com.azure.data.cosmos.serialization.hybridrow.unit.customerschema; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import azure.data.cosmos.serialization.hybridrow.unit.*; import com.azure.data.cosmos.serialization.hybridrow.io.RowReader; public final class AddressSerializer { - public static Result Read(RefObject reader, OutObject
obj) { + public static Result Read(Reference reader, Out
obj) { obj.set(new Address()); while (reader.get().Read()) { Result r; switch (reader.get().getPath()) { case "street": - OutObject tempOut_Street = new OutObject(); + Out tempOut_Street = new Out(); r = reader.get().ReadString(tempOut_Street); obj.get().argValue.Street = tempOut_Street.get(); if (r != Result.Success) { @@ -26,7 +27,7 @@ public final class AddressSerializer { break; case "city": - OutObject tempOut_City = new OutObject(); + Out tempOut_City = new Out(); r = reader.get().ReadString(tempOut_City); obj.get().argValue.City = tempOut_City.get(); if (r != Result.Success) { @@ -35,7 +36,7 @@ public final class AddressSerializer { break; case "state": - OutObject tempOut_State = new OutObject(); + Out tempOut_State = new Out(); r = reader.get().ReadString(tempOut_State); obj.get().argValue.State = tempOut_State.get(); if (r != Result.Success) { @@ -44,13 +45,13 @@ public final class AddressSerializer { break; case "postal_code": - RefObject tempRef_child = - new RefObject(child); - OutObject tempOut_PostalCode = new OutObject(); + Reference tempReference_child = + new Reference(child); + Out tempOut_PostalCode = new Out(); // TODO: C# TO JAVA CONVERTER: The following lambda contained an unresolved 'ref' keyword - these are not converted by C# to Java Converter: - r = reader.get().ReadScope(obj.get(), (ref RowReader child, Address parent) -> PostalCodeSerializer.Read(tempRef_child, tempOut_PostalCode)); + r = reader.get().ReadScope(obj.get(), (ref RowReader child, Address parent) -> PostalCodeSerializer.Read(tempReference_child, tempOut_PostalCode)); parent.PostalCode = tempOut_PostalCode.get(); - child = tempRef_child.get(); + child = tempReference_child.get(); if (r != Result.Success) { return r; @@ -63,7 +64,7 @@ public final class AddressSerializer { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, Address obj) { + public static Result Write(Reference writer, TypeArgument typeArg, Address obj) { Result r; if (obj.Street != null) { r = writer.get().WriteString("street", obj.Street); diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/PostalCodeSerializer.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/PostalCodeSerializer.java index 0fdac89..8ad8821 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/PostalCodeSerializer.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/customerschema/PostalCodeSerializer.java @@ -4,8 +4,9 @@ package com.azure.data.cosmos.serialization.hybridrow.unit.customerschema; -import com.azure.data.cosmos.core.OutObject; -import com.azure.data.cosmos.core.RefObject; +import com.azure.data.cosmos.core.Out; +import com.azure.data.cosmos.core.Reference; +import com.azure.data.cosmos.core.Reference; import com.azure.data.cosmos.serialization.hybridrow.Result; import com.azure.data.cosmos.serialization.hybridrow.SchemaId; import com.azure.data.cosmos.serialization.hybridrow.io.RowReader; @@ -22,13 +23,13 @@ import azure.data.cosmos.serialization.hybridrow.unit.*; public final class PostalCodeSerializer { public static TypeArgument TypeArg = new TypeArgument(LayoutType.UDT, new TypeArgumentList(new SchemaId(1))); - public static Result Read(RefObject reader, OutObject obj) { + public static Result Read(Reference reader, Out obj) { obj.set(new PostalCode()); while (reader.get().Read()) { Result r; switch (reader.get().getPath()) { case "zip": - OutObject tempOut_Zip = new OutObject(); + Out tempOut_Zip = new Out(); r = reader.get().ReadInt32(tempOut_Zip); obj.get().argValue.Zip = tempOut_Zip.get(); if (r != Result.Success) { @@ -38,7 +39,7 @@ public final class PostalCodeSerializer { break; case "plus4": short value; - OutObject tempOut_value = new OutObject(); + Out tempOut_value = new Out(); r = reader.get().ReadInt16(tempOut_value); value = tempOut_value.get(); if (r != Result.Success) { @@ -53,7 +54,7 @@ public final class PostalCodeSerializer { return Result.Success; } - public static Result Write(RefObject writer, TypeArgument typeArg, PostalCode obj) { + public static Result Write(Reference writer, TypeArgument typeArg, PostalCode obj) { Result r; r = writer.get().WriteInt32("zip", obj.Zip); if (r != Result.Success) { diff --git a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/internal/MurmurHash3UnitTests.java b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/internal/MurmurHash3UnitTests.java index e7d2d00..bf0212d 100644 --- a/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/internal/MurmurHash3UnitTests.java +++ b/jre/src/test/java/com/azure/data/cosmos/serialization/hybridrow/unit/internal/MurmurHash3UnitTests.java @@ -4,7 +4,7 @@ package com.azure.data.cosmos.serialization.hybridrow.unit.internal; -import com.azure.data.cosmos.serialization.hybridrow.internal.MurmurHash3; +import com.azure.data.cosmos.serialization.hybridrow.internal.Murmur3Hash; import java.util.Random; @@ -31,45 +31,45 @@ public class MurmurHash3UnitTests { // 0x0EB26F6D1CCEB258UL), (0xA3B6D57EBEB965D1UL, 0xE8078FCC5D8C2E3EUL), (0x91ABF587B38224F6UL, // 0x35899665A8A9252CUL), (0xF05B1AF0487EE2D4UL, 0x5D7496C1665DDE12UL)}; - private static final MurmurHash3.Value[] EXPECTED_VALUES = new MurmurHash3.Value[] { - new MurmurHash3.Value(0x56F1549659CBEE1AL, 0xCEB3EE124C3E3855L), - new MurmurHash3.Value(0xFE84B58886F9D717L, 0xD24C5DE024F5EA6BL), - new MurmurHash3.Value(0x89F6250648BB11BFL, 0x95595FB9D4CF58B0L), - new MurmurHash3.Value(0xC76AFDB39EDC6262L, 0xB9286AF4FADAF497L), - new MurmurHash3.Value(0xC2CB4D9B3C9C247EL, 0xB465D40116B8B7A2L), - new MurmurHash3.Value(0x317178F5B26D0B35L, 0x1D564F53E2E468ADL), - new MurmurHash3.Value(0xE8D75F7C05F43F09L, 0xA81CEA052AE92D6FL), - new MurmurHash3.Value(0x8F837665508C08A8L, 0x2A74E6E47E5497BCL), - new MurmurHash3.Value(0x609778FDA1AFD731L, 0x3EB1A0E3BFC653E4L), - new MurmurHash3.Value(0x0F59B8965FA49D1AL, 0xCB3BC158243A5DEEL), - new MurmurHash3.Value(0x7A6D0AC9C98F5908L, 0xBC93D3042C3E7178L), - new MurmurHash3.Value(0x863FE5AEBA9A3DFAL, 0xDF42416658CB87C5L), - new MurmurHash3.Value(0xDB4C82337C8FB216L, 0xCA7616B64ABF6B3DL), - new MurmurHash3.Value(0x0049223177425B48L, 0x25510D7246BC3C2CL), - new MurmurHash3.Value(0x31AC129B24F82CABL, 0xCD7174C2040E9834L), - new MurmurHash3.Value(0xCE39465288116345L, 0x1CE6A26BA2E9E67DL), - new MurmurHash3.Value(0xD2BE55791E13DB17L, 0xCF30BF3D93B3A9FAL), - new MurmurHash3.Value(0x43E323DD0F079145L, 0xF06721555571ABBAL), - new MurmurHash3.Value(0xB0CE9F170A96F5BCL, 0x18EE95960369D702L), - new MurmurHash3.Value(0xBFFAF6BEBC84A2A9L, 0xE0612B6FC0C9D502L), - new MurmurHash3.Value(0x33E2D699697BC2DAL, 0xB7E9CD6313DE05EEL), - new MurmurHash3.Value(0xCBFD7D8DA2A962BFL, 0xCF4C281A7750E88AL), - new MurmurHash3.Value(0xBD8D863F83863088L, 0x01AFFBDE3D405D35L), - new MurmurHash3.Value(0xBA2E05DF3328C7DBL, 0x9620867ADDFE6579L), - new MurmurHash3.Value(0xC57BD1FB63CA0947L, 0xE1391F8454D4EA9FL), - new MurmurHash3.Value(0x6AB710460A5BF9BAL, 0x11D7E13FBEF63775L), - new MurmurHash3.Value(0x55C2C7C95F41C483L, 0xA4DCC9F547A89563L), - new MurmurHash3.Value(0x8AA5A2031027F216L, 0x1653FC7AD6CC6104L), - new MurmurHash3.Value(0xAD8A899FF093D9A5L, 0x0EB26F6D1CCEB258L), - new MurmurHash3.Value(0xA3B6D57EBEB965D1L, 0xE8078FCC5D8C2E3EL), - new MurmurHash3.Value(0x91ABF587B38224F6L, 0x35899665A8A9252CL), - new MurmurHash3.Value(0xF05B1AF0487EE2D4L, 0x5D7496C1665DDE12L) }; + private static final Murmur3Hash.Code[] EXPECTED_VALUES = new Murmur3Hash.Code[] { + new Murmur3Hash.Code(0x56F1549659CBEE1AL, 0xCEB3EE124C3E3855L), + new Murmur3Hash.Code(0xFE84B58886F9D717L, 0xD24C5DE024F5EA6BL), + new Murmur3Hash.Code(0x89F6250648BB11BFL, 0x95595FB9D4CF58B0L), + new Murmur3Hash.Code(0xC76AFDB39EDC6262L, 0xB9286AF4FADAF497L), + new Murmur3Hash.Code(0xC2CB4D9B3C9C247EL, 0xB465D40116B8B7A2L), + new Murmur3Hash.Code(0x317178F5B26D0B35L, 0x1D564F53E2E468ADL), + new Murmur3Hash.Code(0xE8D75F7C05F43F09L, 0xA81CEA052AE92D6FL), + new Murmur3Hash.Code(0x8F837665508C08A8L, 0x2A74E6E47E5497BCL), + new Murmur3Hash.Code(0x609778FDA1AFD731L, 0x3EB1A0E3BFC653E4L), + new Murmur3Hash.Code(0x0F59B8965FA49D1AL, 0xCB3BC158243A5DEEL), + new Murmur3Hash.Code(0x7A6D0AC9C98F5908L, 0xBC93D3042C3E7178L), + new Murmur3Hash.Code(0x863FE5AEBA9A3DFAL, 0xDF42416658CB87C5L), + new Murmur3Hash.Code(0xDB4C82337C8FB216L, 0xCA7616B64ABF6B3DL), + new Murmur3Hash.Code(0x0049223177425B48L, 0x25510D7246BC3C2CL), + new Murmur3Hash.Code(0x31AC129B24F82CABL, 0xCD7174C2040E9834L), + new Murmur3Hash.Code(0xCE39465288116345L, 0x1CE6A26BA2E9E67DL), + new Murmur3Hash.Code(0xD2BE55791E13DB17L, 0xCF30BF3D93B3A9FAL), + new Murmur3Hash.Code(0x43E323DD0F079145L, 0xF06721555571ABBAL), + new Murmur3Hash.Code(0xB0CE9F170A96F5BCL, 0x18EE95960369D702L), + new Murmur3Hash.Code(0xBFFAF6BEBC84A2A9L, 0xE0612B6FC0C9D502L), + new Murmur3Hash.Code(0x33E2D699697BC2DAL, 0xB7E9CD6313DE05EEL), + new Murmur3Hash.Code(0xCBFD7D8DA2A962BFL, 0xCF4C281A7750E88AL), + new Murmur3Hash.Code(0xBD8D863F83863088L, 0x01AFFBDE3D405D35L), + new Murmur3Hash.Code(0xBA2E05DF3328C7DBL, 0x9620867ADDFE6579L), + new Murmur3Hash.Code(0xC57BD1FB63CA0947L, 0xE1391F8454D4EA9FL), + new Murmur3Hash.Code(0x6AB710460A5BF9BAL, 0x11D7E13FBEF63775L), + new Murmur3Hash.Code(0x55C2C7C95F41C483L, 0xA4DCC9F547A89563L), + new Murmur3Hash.Code(0x8AA5A2031027F216L, 0x1653FC7AD6CC6104L), + new Murmur3Hash.Code(0xAD8A899FF093D9A5L, 0x0EB26F6D1CCEB258L), + new Murmur3Hash.Code(0xA3B6D57EBEB965D1L, 0xE8078FCC5D8C2E3EL), + new Murmur3Hash.Code(0x91ABF587B38224F6L, 0x35899665A8A9252CL), + new Murmur3Hash.Code(0xF05B1AF0487EE2D4L, 0x5D7496C1665DDE12L) }; // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: // ORIGINAL LINE: // [TestMethod][Owner("jthunter")] public void Hash128Check() public final void Hash128Check() { - // Generate deterministic data for which the MurmurHash3 is known (see Expected). + // Generate deterministic data for which the Murmur3Hash is known (see Expected). Random rand = new Random(42); //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: byte[][] samples = new byte[MurmurHash3UnitTests.Expected.Length][]; @@ -88,7 +88,7 @@ public class MurmurHash3UnitTests { //ORIGINAL LINE: byte[] sample = samples[i]; byte[] sample = samples[i]; // TODO: C# TO JAVA CONVERTER: Java has no equivalent to C# deconstruction declarations: - ( long low, long high) = MurmurHash3.Hash128(sample, (0, 0)) + ( long low, long high) = Murmur3Hash.Hash128(sample, (0, 0)) System.out.println(String.format("(0x%016XUL, 0x%1.16XUL),", high, low)); assert MurmurHash3UnitTests.EXPECTED_VALUES[i].high == high; assert MurmurHash3UnitTests.EXPECTED_VALUES[i].low == low; @@ -96,7 +96,7 @@ public class MurmurHash3UnitTests { // Measure performance. long ticks = MurmurHash3UnitTests.MeasureLoop(samples); - System.out.println(String.format("MurmurHash3: %1$s", ticks)); + System.out.println(String.format("Murmur3Hash: %1$s", ticks)); } // TODO: C# TO JAVA CONVERTER: Java annotations will not correspond to .NET attributes: @@ -117,7 +117,7 @@ public class MurmurHash3UnitTests { //C# TO JAVA CONVERTER WARNING: Unsigned integer types have no direct equivalent in Java: //ORIGINAL LINE: foreach (byte[] sample in samples) for (byte[] sample : samples) { - MurmurHash3.Hash128(sample, (0, 0)) + Murmur3Hash.Hash128(sample, (0, 0)) } }