Context:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.

//
// This file was autogenerated by a tool.
// Do not modify it.
//

namespace Microsoft.Azure.Batch
{
    using Models = Microsoft.Azure.Batch.Protocol.Models;
    using System;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// A pool in the Azure Batch service.
    /// </summary>
    public partial class CloudPool : ITransportObjectProvider<Models.PoolAddParameter>, IInheritedBehaviors, IPropertyMetadata
    {
        private class PropertyContainer : PropertyCollection
        {
            public readonly PropertyAccessor<Common.AllocationState?> AllocationStateProperty;
            public readonly PropertyAccessor<DateTime?> AllocationStateTransitionTimeProperty;
            public readonly PropertyAccessor<IList<string>> ApplicationLicensesProperty;
            public readonly PropertyAccessor<IList<ApplicationPackageReference>> ApplicationPackageReferencesProperty;
            public readonly PropertyAccessor<bool?> AutoScaleEnabledProperty;
            public readonly PropertyAccessor<TimeSpan?> AutoScaleEvaluationIntervalProperty;
            public readonly PropertyAccessor<string> AutoScaleFormulaProperty;
            public readonly PropertyAccessor<AutoScaleRun> AutoScaleRunProperty;
            public readonly PropertyAccessor<IList<CertificateReference>> CertificateReferencesProperty;
            public readonly PropertyAccessor<CloudServiceConfiguration> CloudServiceConfigurationProperty;
            public readonly PropertyAccessor<DateTime?> CreationTimeProperty;
            public readonly PropertyAccessor<int?> CurrentDedicatedComputeNodesProperty;
            public readonly PropertyAccessor<int?> CurrentLowPriorityComputeNodesProperty;
            public readonly PropertyAccessor<string> DisplayNameProperty;
            public readonly PropertyAccessor<string> ETagProperty;
            public readonly PropertyAccessor<string> IdProperty;
            public readonly PropertyAccessor<BatchPoolIdentity> IdentityProperty;
            public readonly PropertyAccessor<bool?> InterComputeNodeCommunicationEnabledProperty;
            public readonly PropertyAccessor<DateTime?> LastModifiedProperty;
            public readonly PropertyAccessor<IList<MetadataItem>> MetadataProperty;
            public readonly PropertyAccessor<IList<MountConfiguration>> MountConfigurationProperty;
            public readonly PropertyAccessor<NetworkConfiguration> NetworkConfigurationProperty;
            public readonly PropertyAccessor<IReadOnlyList<ResizeError>> ResizeErrorsProperty;
            public readonly PropertyAccessor<TimeSpan?> ResizeTimeoutProperty;
            public readonly PropertyAccessor<StartTask> StartTaskProperty;
            public readonly PropertyAccessor<Common.PoolState?> StateProperty;
            public readonly PropertyAccessor<DateTime?> StateTransitionTimeProperty;
            public readonly PropertyAccessor<PoolStatistics> StatisticsProperty;
            public readonly PropertyAccessor<int?> TargetDedicatedComputeNodesProperty;
            public readonly PropertyAccessor<int?> TargetLowPriorityComputeNodesProperty;
            public readonly PropertyAccessor<TaskSchedulingPolicy> TaskSchedulingPolicyProperty;
            public readonly PropertyAccessor<int?> TaskSlotsPerNodeProperty;
            public readonly PropertyAccessor<string> UrlProperty;
            public readonly PropertyAccessor<IList<UserAccount>> UserAccountsProperty;
            public readonly PropertyAccessor<VirtualMachineConfiguration> VirtualMachineConfigurationProperty;
            public readonly PropertyAccessor<string> VirtualMachineSizeProperty;

            public PropertyContainer() : base(BindingState.Unbound)
            {
                this.AllocationStateProperty = this.CreatePropertyAccessor<Common.AllocationState?>(nameof(AllocationState), BindingAccess.None);
                this.AllocationStateTransitionTimeProperty = this.CreatePropertyAccessor<DateTime?>(nameof(AllocationStateTransitionTime), BindingAccess.None);
                this.ApplicationLicensesProperty = this.CreatePropertyAccessor<IList<string>>(nameof(ApplicationLicenses), BindingAccess.Read | BindingAccess.Write);
                this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor<IList<ApplicationPackageReference>>(nameof(ApplicationPackageReferences), BindingAccess.Read | BindingAccess.Write);
                this.AutoScaleEnabledProperty = this.CreatePropertyAccessor<bool?>(nameof(AutoScaleEnabled), BindingAccess.Read | BindingAccess.Write);
                this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(AutoScaleEvaluationInterval), BindingAccess.Read | BindingAccess.Write);
                this.AutoScaleFormulaProperty = this.CreatePropertyAccessor<string>(nameof(AutoScaleFormula), BindingAccess.Read | BindingAccess.Write);
                this.AutoScaleRunProperty = this.CreatePropertyAccessor<AutoScaleRun>(nameof(AutoScaleRun), BindingAccess.None);
                this.CertificateReferencesProperty = this.CreatePropertyAccessor<IList<CertificateReference>>(nameof(CertificateReferences), BindingAccess.Read | BindingAccess.Write);
                this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor<CloudServiceConfiguration>(nameof(CloudServiceConfiguration), BindingAccess.Read | BindingAccess.Write);
                this.CreationTimeProperty = this.CreatePropertyAccessor<DateTime?>(nameof(CreationTime), BindingAccess.None);
                this.CurrentDedicatedComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(CurrentDedicatedComputeNodes), BindingAccess.None);
                this.CurrentLowPriorityComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(CurrentLowPriorityComputeNodes), BindingAccess.None);
                this.DisplayNameProperty = this.CreatePropertyAccessor<string>(nameof(DisplayName), BindingAccess.Read | BindingAccess.Write);
                this.ETagProperty = this.CreatePropertyAccessor<string>(nameof(ETag), BindingAccess.None);
                this.IdProperty = this.CreatePropertyAccessor<string>(nameof(Id), BindingAccess.Read | BindingAccess.Write);
                this.IdentityProperty = this.CreatePropertyAccessor<BatchPoolIdentity>(nameof(Identity), BindingAccess.Read | BindingAccess.Write);
                this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor<bool?>(nameof(InterComputeNodeCommunicationEnabled), BindingAccess.Read | BindingAccess.Write);
                this.LastModifiedProperty = this.CreatePropertyAccessor<DateTime?>(nameof(LastModified), BindingAccess.None);
                this.MetadataProperty = this.CreatePropertyAccessor<IList<MetadataItem>>(nameof(Metadata), BindingAccess.Read | BindingAccess.Write);
                this.MountConfigurationProperty = this.CreatePropertyAccessor<IList<MountConfiguration>>(nameof(MountConfiguration), BindingAccess.Read | BindingAccess.Write);
                this.NetworkConfigurationProperty = this.CreatePropertyAccessor<NetworkConfiguration>(nameof(NetworkConfiguration), BindingAccess.Read | BindingAccess.Write);
                this.ResizeErrorsProperty = this.CreatePropertyAccessor<IReadOnlyList<ResizeError>>(nameof(ResizeErrors), BindingAccess.None);
                this.ResizeTimeoutProperty = this.CreatePropertyAccessor<TimeSpan?>(nameof(ResizeTimeout), BindingAccess.Read | BindingAccess.Write);
                this.StartTaskProperty = this.CreatePropertyAccessor<StartTask>(nameof(StartTask), BindingAccess.Read | BindingAccess.Write);
                this.StateProperty = this.CreatePropertyAccessor<Common.PoolState?>(nameof(State), BindingAccess.None);
                this.StateTransitionTimeProperty = this.CreatePropertyAccessor<DateTime?>(nameof(StateTransitionTime), BindingAccess.None);
                this.StatisticsProperty = this.CreatePropertyAccessor<PoolStatistics>(nameof(Statistics), BindingAccess.None);
                this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(TargetDedicatedComputeNodes), BindingAccess.Read | BindingAccess.Write);
                this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor<int?>(nameof(TargetLowPriorityComputeNodes), BindingAccess.Read | BindingAccess.Write);
                this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor<TaskSchedulingPolicy>(nameof(TaskSchedulingPolicy), BindingAccess.Read | BindingAccess.Write);
                this.TaskSlotsPerNodeProperty = this.CreatePropertyAccessor<int?>(nameof(TaskSlotsPerNode), BindingAccess.Read | BindingAccess.Write);
                this.UrlProperty = this.CreatePropertyAccessor<string>(nameof(Url), BindingAccess.None);
                this.UserAccountsProperty = this.CreatePropertyAccessor<IList<UserAccount>>(nameof(UserAccounts), BindingAccess.Read | BindingAccess.Write);
                this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor<VirtualMachineConfiguration>(nameof(VirtualMachineConfiguration), BindingAccess.Read | BindingAccess.Write);
                this.VirtualMachineSizeProperty = this.CreatePropertyAccessor<string>(nameof(VirtualMachineSize), BindingAccess.Read | BindingAccess.Write);
            }

            public PropertyContainer(Models.CloudPool protocolObject) : base(BindingState.Bound)
            {
                this.AllocationStateProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.MapNullableEnum<Models.AllocationState, Common.AllocationState>(protocolObject.AllocationState),
                    nameof(AllocationState),
                    BindingAccess.Read);
                this.AllocationStateTransitionTimeProperty = this.CreatePropertyAccessor(
                    protocolObject.AllocationStateTransitionTime,
                    nameof(AllocationStateTransitionTime),
                    BindingAccess.Read);
                this.ApplicationLicensesProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CollectionToThreadSafeCollection(protocolObject.ApplicationLicenses, o => o),
                    nameof(ApplicationLicenses),
                    BindingAccess.Read);
                this.ApplicationPackageReferencesProperty = this.CreatePropertyAccessor(
                    ApplicationPackageReference.ConvertFromProtocolCollection(protocolObject.ApplicationPackageReferences),
                    nameof(ApplicationPackageReferences),
                    BindingAccess.Read | BindingAccess.Write);
                this.AutoScaleEnabledProperty = this.CreatePropertyAccessor(
                    protocolObject.EnableAutoScale,
                    nameof(AutoScaleEnabled),
                    BindingAccess.Read);
                this.AutoScaleEvaluationIntervalProperty = this.CreatePropertyAccessor(
                    protocolObject.AutoScaleEvaluationInterval,
                    nameof(AutoScaleEvaluationInterval),
                    BindingAccess.Read);
                this.AutoScaleFormulaProperty = this.CreatePropertyAccessor(
                    protocolObject.AutoScaleFormula,
                    nameof(AutoScaleFormula),
                    BindingAccess.Read);
                this.AutoScaleRunProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.AutoScaleRun, o => new AutoScaleRun(o).Freeze()),
                    nameof(AutoScaleRun),
                    BindingAccess.Read);
                this.CertificateReferencesProperty = this.CreatePropertyAccessor(
                    CertificateReference.ConvertFromProtocolCollection(protocolObject.CertificateReferences),
                    nameof(CertificateReferences),
                    BindingAccess.Read | BindingAccess.Write);
                this.CloudServiceConfigurationProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.CloudServiceConfiguration, o => new CloudServiceConfiguration(o).Freeze()),
                    nameof(CloudServiceConfiguration),
                    BindingAccess.Read);
                this.CreationTimeProperty = this.CreatePropertyAccessor(
                    protocolObject.CreationTime,
                    nameof(CreationTime),
                    BindingAccess.Read);
                this.CurrentDedicatedComputeNodesProperty = this.CreatePropertyAccessor(
                    protocolObject.CurrentDedicatedNodes,
                    nameof(CurrentDedicatedComputeNodes),
                    BindingAccess.Read);
                this.CurrentLowPriorityComputeNodesProperty = this.CreatePropertyAccessor(
                    protocolObject.CurrentLowPriorityNodes,
                    nameof(CurrentLowPriorityComputeNodes),
                    BindingAccess.Read);
                this.DisplayNameProperty = this.CreatePropertyAccessor(
                    protocolObject.DisplayName,
                    nameof(DisplayName),
                    BindingAccess.Read);
                this.ETagProperty = this.CreatePropertyAccessor(
                    protocolObject.ETag,
                    nameof(ETag),
                    BindingAccess.Read);
                this.IdProperty = this.CreatePropertyAccessor(
                    protocolObject.Id,
                    nameof(Id),
                    BindingAccess.Read);
                this.IdentityProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Identity, o => new BatchPoolIdentity(o)),
                    nameof(Identity),
                    BindingAccess.Read | BindingAccess.Write);
                this.InterComputeNodeCommunicationEnabledProperty = this.CreatePropertyAccessor(
                    protocolObject.EnableInterNodeCommunication,
                    nameof(InterComputeNodeCommunicationEnabled),
                    BindingAccess.Read);
                this.LastModifiedProperty = this.CreatePropertyAccessor(
                    protocolObject.LastModified,
                    nameof(LastModified),
                    BindingAccess.Read);
                this.MetadataProperty = this.CreatePropertyAccessor(
                    MetadataItem.ConvertFromProtocolCollection(protocolObject.Metadata),
                    nameof(Metadata),
                    BindingAccess.Read | BindingAccess.Write);
                this.MountConfigurationProperty = this.CreatePropertyAccessor(
                    Batch.MountConfiguration.ConvertFromProtocolCollectionAndFreeze(protocolObject.MountConfiguration),
                    nameof(MountConfiguration),
                    BindingAccess.Read);
                this.NetworkConfigurationProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.NetworkConfiguration, o => new NetworkConfiguration(o).Freeze()),
                    nameof(NetworkConfiguration),
                    BindingAccess.Read);
                this.ResizeErrorsProperty = this.CreatePropertyAccessor(
                    ResizeError.ConvertFromProtocolCollectionReadOnly(protocolObject.ResizeErrors),
                    nameof(ResizeErrors),
                    BindingAccess.Read);
                this.ResizeTimeoutProperty = this.CreatePropertyAccessor(
                    protocolObject.ResizeTimeout,
                    nameof(ResizeTimeout),
                    BindingAccess.Read);
                this.StartTaskProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.StartTask, o => new StartTask(o)),
                    nameof(StartTask),
                    BindingAccess.Read | BindingAccess.Write);
                this.StateProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.MapNullableEnum<Models.PoolState, Common.PoolState>(protocolObject.State),
                    nameof(State),
                    BindingAccess.Read);
                this.StateTransitionTimeProperty = this.CreatePropertyAccessor(
                    protocolObject.StateTransitionTime,
                    nameof(StateTransitionTime),
                    BindingAccess.Read);
                this.StatisticsProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.Stats, o => new PoolStatistics(o).Freeze()),
                    nameof(Statistics),
                    BindingAccess.Read);
                this.TargetDedicatedComputeNodesProperty = this.CreatePropertyAccessor(
                    protocolObject.TargetDedicatedNodes,
                    nameof(TargetDedicatedComputeNodes),
                    BindingAccess.Read);
                this.TargetLowPriorityComputeNodesProperty = this.CreatePropertyAccessor(
                    protocolObject.TargetLowPriorityNodes,
                    nameof(TargetLowPriorityComputeNodes),
                    BindingAccess.Read);
                this.TaskSchedulingPolicyProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.TaskSchedulingPolicy, o => new TaskSchedulingPolicy(o).Freeze()),
                    nameof(TaskSchedulingPolicy),
                    BindingAccess.Read);
                this.TaskSlotsPerNodeProperty = this.CreatePropertyAccessor(
                    protocolObject.TaskSlotsPerNode,
                    nameof(TaskSlotsPerNode),
                    BindingAccess.Read);
                this.UrlProperty = this.CreatePropertyAccessor(
                    protocolObject.Url,
                    nameof(Url),
                    BindingAccess.Read);
                this.UserAccountsProperty = this.CreatePropertyAccessor(
                    UserAccount.ConvertFromProtocolCollectionAndFreeze(protocolObject.UserAccounts),
                    nameof(UserAccounts),
                    BindingAccess.Read);
                this.VirtualMachineConfigurationProperty = this.CreatePropertyAccessor(
                    UtilitiesInternal.CreateObjectWithNullCheck(protocolObject.VirtualMachineConfiguration, o => new VirtualMachineConfiguration(o).Freeze()),
                    nameof(VirtualMachineConfiguration),
                    BindingAccess.Read);
                this.VirtualMachineSizeProperty = this.CreatePropertyAccessor(
                    protocolObject.VmSize,
                    nameof(VirtualMachineSize),
                    BindingAccess.Read);
            }
        }

        private PropertyContainer propertyContainer;

        private readonly BatchClient parentBatchClient;

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CloudPool"/> class.
        /// </summary>
        /// <param name='parentBatchClient'>The parent <see cref="BatchClient"/> to use.</param>
        /// <param name='baseBehaviors'>The base behaviors to use.</param>
        internal CloudPool(
            BatchClient parentBatchClient,
            IEnumerable<BatchClientBehavior> baseBehaviors)
        {
            this.propertyContainer = new PropertyContainer();
            this.parentBatchClient = parentBatchClient;
            InheritUtil.InheritClientBehaviorsAndSetPublicProperty(this, baseBehaviors);
        }

        internal CloudPool(
            BatchClient parentBatchClient,
            Models.CloudPool protocolObject,
            IEnumerable<BatchClientBehavior> baseBehaviors)
        {
            this.parentBatchClient = parentBatchClient;
            InheritUtil.InheritClientBehaviorsAndSetPublicProperty(this, baseBehaviors);
            this.propertyContainer = new PropertyContainer(protocolObject);
        }

        #endregion Constructors

        #region IInheritedBehaviors

        /// <summary>
        /// Gets or sets a list of behaviors that modify or customize requests to the Batch service
        /// made via this <see cref="CloudPool"/>.
        /// </summary>
        /// <remarks>
        /// <para>These behaviors are inherited by child objects.</para>
        /// <para>Modifications are applied in the order of the collection. The last write wins.</para>
        /// </remarks>
        public IList<BatchClientBehavior> CustomBehaviors { get; set; }

        #endregion IInheritedBehaviors

        #region CloudPool

        /// <summary>
        /// Gets an <see cref="Common.AllocationState"/> which indicates what node allocation activity is occurring on the
        /// pool.
        /// </summary>
        public Common.AllocationState? AllocationState
        {
            get { return this.propertyContainer.AllocationStateProperty.Value; }
        }

        /// <summary>
        /// Gets the time at which the pool entered its current <see cref="AllocationState"/>.
        /// </summary>
        public DateTime? AllocationStateTransitionTime
        {
            get { return this.propertyContainer.AllocationStateTransitionTimeProperty.Value; }
        }

        /// <summary>
        /// Gets or sets the list of application licenses the Batch service will make available on each compute node in the
        /// pool.
        /// </summary>
        /// <remarks>
        /// <para>The list of application licenses must be a subset of available Batch service application licenses.</para><para>The
        /// permitted licenses available on the pool are 'maya', 'vray', '3dsmax', 'arnold'. An additional charge applies
        /// for each application license added to the pool.</para>
        /// </remarks>
        public IList<string> ApplicationLicenses
        {
            get { return this.propertyContainer.ApplicationLicensesProperty.Value; }
            set
            {
                this.propertyContainer.ApplicationLicensesProperty.Value = ConcurrentChangeTrackedList<string>.TransformEnumerableToConcurrentList(value);
            }
        }

        /// <summary>
        /// Gets or sets a list of application packages to be installed on each compute node in the pool.
        /// </summary>
        /// <remarks>
        /// Changes to application package references affect all new compute nodes joining the pool, but do not affect compute
        /// nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application
        /// package references on any given pool.
        /// </remarks>
        public IList<ApplicationPackageReference> ApplicationPackageReferences
        {
            get { return this.propertyContainer.ApplicationPackageReferencesProperty.Value; }
            set
            {
                this.propertyContainer.ApplicationPackageReferencesProperty.Value = ConcurrentChangeTrackedModifiableList<ApplicationPackageReference>.TransformEnumerableToConcurrentModifiableList(value);
            }
        }

        /// <summary>
        /// Gets or sets whether the pool size should automatically adjust according to the <see cref="AutoScaleFormula"/>.
        /// </summary>
        /// <remarks>
        /// <para>If true, the <see cref="AutoScaleFormula"/> property is required, the pool automatically resizes according
        /// to the formula, and <see cref="TargetDedicatedComputeNodes"/> and <see cref="TargetLowPriorityComputeNodes"/>
        /// must be null.</para> <para>If false, one of the <see cref="TargetDedicatedComputeNodes"/> or <see cref="TargetLowPriorityComputeNodes"/>
        /// properties is required.</para><para>The default value is false.</para>
        /// </remarks>
        public bool? AutoScaleEnabled
        {
            get { return this.propertyContainer.AutoScaleEnabledProperty.Value; }
            set { this.propertyContainer.AutoScaleEnabledProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets a time interval at which to automatically adjust the pool size according to the <see cref="AutoScaleFormula"/>.
        /// </summary>
        /// <remarks>
        /// The default value is 15 minutes. The minimum allowed value is 5 minutes.
        /// </remarks>
        public TimeSpan? AutoScaleEvaluationInterval
        {
            get { return this.propertyContainer.AutoScaleEvaluationIntervalProperty.Value; }
            set { this.propertyContainer.AutoScaleEvaluationIntervalProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets a formula for the desired number of compute nodes in the pool.
        /// </summary>
        /// <remarks>
        /// <para>For how to write autoscale formulas, see https://azure.microsoft.com/documentation/articles/batch-automatic-scaling/.
        /// This property is required if <see cref="AutoScaleEnabled"/> is set to true. It must be null if AutoScaleEnabled
        /// is false.</para><para>The formula is checked for validity before the pool is created. If the formula is not valid,
        /// an exception is thrown when you try to commit the <see cref="CloudPool"/>.</para>
        /// </remarks>
        public string AutoScaleFormula
        {
            get { return this.propertyContainer.AutoScaleFormulaProperty.Value; }
            set { this.propertyContainer.AutoScaleFormulaProperty.Value = value; }
        }

        /// <summary>
        /// Gets the results and errors from the last execution of the <see cref="AutoScaleFormula"/>.
        /// </summary>
        public AutoScaleRun AutoScaleRun
        {
            get { return this.propertyContainer.AutoScaleRunProperty.Value; }
        }

        /// <summary>
        /// Gets or sets a list of certificates to be installed on each compute node in the pool.
        /// </summary>
        public IList<CertificateReference> CertificateReferences
        {
            get { return this.propertyContainer.CertificateReferencesProperty.Value; }
            set
            {
                this.propertyContainer.CertificateReferencesProperty.Value = ConcurrentChangeTrackedModifiableList<CertificateReference>.TransformEnumerableToConcurrentModifiableList(value);
            }
        }

        /// <summary>
        /// Gets or sets the <see cref="CloudServiceConfiguration"/> for the pool.
        /// </summary>
        public CloudServiceConfiguration CloudServiceConfiguration
        {
            get { return this.propertyContainer.CloudServiceConfigurationProperty.Value; }
            set { this.propertyContainer.CloudServiceConfigurationProperty.Value = value; }
        }

        /// <summary>
        /// Gets the creation time for the pool.
        /// </summary>
        public DateTime? CreationTime
        {
            get { return this.propertyContainer.CreationTimeProperty.Value; }
        }

        /// <summary>
        /// Gets the number of dedicated compute nodes currently in the pool.
        /// </summary>
        public int? CurrentDedicatedComputeNodes
        {
            get { return this.propertyContainer.CurrentDedicatedComputeNodesProperty.Value; }
        }

        /// <summary>
        /// Gets the number of low-priority compute nodes currently in the pool.
        /// </summary>
        /// <remarks>
        /// Low-priority compute nodes which have been preempted are included in this count.
        /// </remarks>
        public int? CurrentLowPriorityComputeNodes
        {
            get { return this.propertyContainer.CurrentLowPriorityComputeNodesProperty.Value; }
        }

        /// <summary>
        /// Gets or sets the display name of the pool.
        /// </summary>
        public string DisplayName
        {
            get { return this.propertyContainer.DisplayNameProperty.Value; }
            set { this.propertyContainer.DisplayNameProperty.Value = value; }
        }

        /// <summary>
        /// Gets the ETag for the pool.
        /// </summary>
        public string ETag
        {
            get { return this.propertyContainer.ETagProperty.Value; }
        }

        /// <summary>
        /// Gets or sets the id of the pool.
        /// </summary>
        public string Id
        {
            get { return this.propertyContainer.IdProperty.Value; }
            set { this.propertyContainer.IdProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets the identity of the Batch pool, if configured.
        /// </summary>
        /// <remarks>
        /// The list of user identities associated with the Batch pool. The user identity dictionary key references will
        /// be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
        /// </remarks>
        public BatchPoolIdentity Identity
        {
            get { return this.propertyContainer.IdentityProperty.Value; }
            set { this.propertyContainer.IdentityProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets whether the pool permits direct communication between its compute nodes.
        /// </summary>
        /// <remarks>
        /// Enabling inter-node communication limits the maximum size of the pool due to deployment restrictions on the nodes
        /// of the pool. This may result in the pool not reaching its desired size.
        /// </remarks>
        public bool? InterComputeNodeCommunicationEnabled
        {
            get { return this.propertyContainer.InterComputeNodeCommunicationEnabledProperty.Value; }
            set { this.propertyContainer.InterComputeNodeCommunicationEnabledProperty.Value = value; }
        }

        /// <summary>
        /// Gets the last modified time of the pool.
        /// </summary>
        public DateTime? LastModified
        {
            get { return this.propertyContainer.LastModifiedProperty.Value; }
        }

        /// <summary>
        /// Gets or sets a list of name-value pairs associated with the pool as metadata.
        /// </summary>
        public IList<MetadataItem> Metadata
        {
            get { return this.propertyContainer.MetadataProperty.Value; }
            set
            {
                this.propertyContainer.MetadataProperty.Value = ConcurrentChangeTrackedModifiableList<MetadataItem>.TransformEnumerableToConcurrentModifiableList(value);
            }
        }

        /// <summary>
        /// Gets or sets a list of file systems to mount on each node in the pool.
        /// </summary>
        /// <remarks>
        /// This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
        /// </remarks>
        public IList<MountConfiguration> MountConfiguration
        {
            get { return this.propertyContainer.MountConfigurationProperty.Value; }
            set
            {
                this.propertyContainer.MountConfigurationProperty.Value = ConcurrentChangeTrackedModifiableList<MountConfiguration>.TransformEnumerableToConcurrentModifiableList(value);
            }
        }

        /// <summary>
        /// Gets or sets the network configuration of the pool.
        /// </summary>
        public NetworkConfiguration NetworkConfiguration
        {
            get { return this.propertyContainer.NetworkConfigurationProperty.Value; }
            set { this.propertyContainer.NetworkConfigurationProperty.Value = value; }
        }

        /// <summary>
        /// Gets a list of errors encountered while performing the last resize on the <see cref="CloudPool"/>. Errors are
        /// returned only when the Batch service encountered an error while resizing the pool, and when the pool's <see cref="CloudPool.AllocationState"/>
        /// is <see cref="Common.AllocationState.Steady">Steady</see>.
        /// </summary>
        public IReadOnlyList<ResizeError> ResizeErrors
        {
            get { return this.propertyContainer.ResizeErrorsProperty.Value; }
        }

        /// <summary>
        /// Gets or sets the timeout for allocation of compute nodes to the pool.
        /// </summary>
        public TimeSpan? ResizeTimeout
        {
            get { return this.propertyContainer.ResizeTimeoutProperty.Value; }
            set { this.propertyContainer.ResizeTimeoutProperty.Value = value; }
        }

        /// <summary>
        /// Gets or sets a task to run on each compute node as it joins the pool. The task runs when the node is added to
        /// the pool or when the node is restarted.
        /// </summary>
        public StartTask StartTask
        {
            get { return this.propertyContainer.StartTaskProperty.Value; }
            set { this.propertyContainer.StartTaskProperty.Value = value; }
        }

        /// <summary>
        /// Gets the current state of the pool.
        /// </summary>
        public Common.PoolState? State
        {
            get { return this.propertyContainer.StateProperty.Value; }
        }

        /// <summary>
        /// Gets the time at which the pool entered its current state.
        /// </summary>
        public DateTime? StateTransitionTime
        {
            get { return this.propertyContainer.StateTransitionTimeProperty.Value; }
        }

        /// <summary>
        /// Gets the resource usage statistics for the pool.
        /// </summary>
        /// <remarks>
        /// This property is populated only if the <see cref="CloudPool"/> was retrieved with an <see cref="ODATADetailLevel.ExpandClause"/>
        /// including the 'stats' attribute; otherwise it is null. The statistics may not be immediately available. The Batch
        /// service performs periodic roll-up of statistics. The typical delay is about 30 minutes.
        /// </remarks>
        public PoolStatistics Statistics
        {
            get { return this.propertyContainer.StatisticsProperty.Value; }
        }

        /// <summary>
        /// Gets or sets the desired number of dedicated compute nodes in the pool.
        /// </summary>
        /// <remarks>
        /// This setting cannot be specified if <see cref="AutoScaleEnabled"/> is set to true. At least one of this property
        /// and <see cref="TargetLowPriorityComputeNodes"/> must be specified if <see cref="AutoScaleEnabled"/> is false.
        /// If not specified, the default is 0.
        /// </remarks>

Answer: public int? TargetDedicatedComputeNodes

<think>
The code is defining properties of CloudPool. After the comment describing the TargetDedicatedComputeNodes property, the next line should start the property declaration, matching the pattern used for other properties (e.g., TargetLowPriorityComputeNodes). Therefore the next line is the property signature: public int? TargetDedicatedComputeNodes
</think>
public int? TargetDedicatedComputeNodes


Context:
/*******************************************************************************
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package com.ibm.ws.sib.api.jms.impl;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Enumeration;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.MessageFormatException;

import com.ibm.websphere.sib.api.jms.ApiJmsConstants;
import com.ibm.ws.sib.mfp.JsJmsMapMessage;
import com.ibm.ws.sib.mfp.JsJmsMessage;
import com.ibm.ws.sib.mfp.MessageCreateFailedException;
import com.ibm.ws.sib.utils.ras.SibTr;
import com.ibm.websphere.ras.TraceComponent;

/**
 * @author matrober
 *
 * This class implements the requirements of a JMS MapMessage
 */
public class JmsMapMessageImpl extends JmsMessageImpl implements MapMessage
{

  /**
   * This svUID assigned at version 1.30
   */
  private static final long serialVersionUID = -5270211659893353729L;

  // ******************* PRIVATE STATE VARIABLES *******************

  /**
   * MFP message object representing a JMS TextMessage
   * Note: Do not initialise this to null here, otherwise it will overwrite
   *       the setup done by instantiateMessage!
   */
  private JsJmsMapMessage mapMsg;

  /**
   * This variable holds a cache of the message toString at the Message level.
   * A separate cache holds the subclass information. The cache is invalidated
   * by changing any property of the message.
   */
  private transient String cachedMapToString = null;

  // *************************** TRACE INITIALIZATION **************************
  private static TraceComponent tc = SibTr.register(JmsMapMessageImpl.class, ApiJmsConstants.MSG_GROUP_EXT, ApiJmsConstants.MSG_BUNDLE_EXT);

  // ************************ CONSTRUCTORS *************************

  /**
   * Constructor used to create a new message object.
   */
  public JmsMapMessageImpl() throws JMSException {
    // Calling the superclass no-args constructor in turn leads to the
    // instantiateMessage method being called, which we override to return
    // a map message.
    super();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl");
    messageClass = CLASS_MAP;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  /**
   * This constructor is used by the JmsMessage.inboundJmsInstance method (static)
   * in order to provide the inbound message path from MFP component to JMS component.
   */
  JmsMapMessageImpl(JsJmsMapMessage newMsg, JmsSessionImpl newSess) {

    // Pass this object to the parent class so that it can keep a reference.
    super(newMsg, newSess);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl", new Object[]{newMsg, newSess});

    // Store the reference we are given, and inform the parent class.
    mapMsg = newMsg;
    messageClass = CLASS_MAP;

    // Note that we do NOT initialize the defaults for inbound messages.

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  /**
   * Construct a jetstream jms message from a (possibly non-jetstream)
   * vanilla jms message.
   */
  JmsMapMessageImpl(MapMessage mapMessage) throws JMSException {
    // copy message headers and properties.
    super(mapMessage);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl", mapMessage);

    // set-up this class's state (i.e. do what this() does).
    // nothing to do.

    // copy map.
    Enumeration mapNames = mapMessage.getMapNames();
    if (mapNames != null) {
      while (mapNames.hasMoreElements()) {
        String name = (String) mapNames.nextElement();
        Object value = mapMessage.getObject(name);
        setObject(name, value);
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  // ********************* INTERFACE METHODS ***********************

  /**
   * @see javax.jms.MapMessage#getBoolean(String)
   */
  public boolean getBoolean(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getBoolean", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getBoolean"},
        e, "JmsMapMessageImpl#1", this, tc);
    }

    boolean value = false;
    try {
      value = JmsMessageImpl.parseBoolean(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // d238447 FFDC review. Don't call processThrowable - this is an app' error.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getBoolean",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getByte(String)
   */
  public byte getByte(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getByte", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getByte"},
        e, "JmsMapMessageImpl#2", this, tc);
    }

    byte value = 0;
    try {
      value = JmsMessageImpl.parseByte(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 don't call processThrowable for app' errors
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getByte",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getShort(String)
   */
  public short getShort(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getShort", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getShort"},
        e, "JmsMapMessageImpl#3", this, tc);
    }

    short value = 0;
    try {
      value = JmsMessageImpl.parseShort(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getShort",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getChar(String)
   */
  public char getChar(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getChar", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getChar"},
          e, "JmsMapMessageImpl#4", this, tc);
    }

    char value = 0;

    // This logic is not part of a Message.parseCharacter because there is no
    // equivalent Message.getCharProperty method which would share it.
    if (obj instanceof Character) {
      value = ((Character)obj).charValue();
    }
    else if (obj == null) {
      RuntimeException e = (RuntimeException)JmsErrorUtils.newThrowable(NullPointerException.class,
            "FIELD_NOT_SET_CWSIA0105", new Object[] { name }, tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Field has not been set", e);
      throw e;
    }
    else {
      // Boolean can only be retrieved as boolean and String (see 3.5.4).
      JMSException e = newBadConvertException(obj, name, "Character", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Invalid convert", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getChar",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getInt(String)
   */
  public int getInt(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getInt", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getInt"},
          e, "JmsMapMessageImpl#5", this, tc);
    }

    int value = 0;
    try {
      value = JmsMessageImpl.parseInt(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getInt",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getLong(String)
   */
  public long getLong(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getLong", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getLong"},
          e, "JmsMapMessageImpl#6", this, tc);
    }

    long value = 0;
    try {
      value = JmsMessageImpl.parseLong(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getLong",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getFloat(String)
   */
  public float getFloat(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getFloat", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getFloat"},
          e, "JmsMapMessageImpl#7", this, tc);
    }

    float value = 0;

    try {
      value = JmsMessageImpl.parseFloat(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getFloat",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getDouble(String)
   */
  public double getDouble(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDouble", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    } catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getDouble"},
          e, "JmsMapMessageImpl#8", this, tc);
    }

    double value = 0;
    try {
      value = JmsMessageImpl.parseDouble(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDouble",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getString(String)
   */
  public String getString(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getString", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getString"},
          e, "JmsMapMessageImpl#9", this, tc);
    }

    String value = null;

    if ((obj instanceof String) || (obj == null)) {
      value = (String)obj;
    }
    else if (obj instanceof byte[]) {
      JMSException e = newBadConvertException(obj, name, "String", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "invalid convert", e);
      throw e;
    }
    else {
      // Every type of property can be returned as a String
      value = obj.toString();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getString",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getBytes(String)
   */
  public byte[] getBytes(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getBytes", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getBytes"},
          e, "JmsMapMessageImpl#10", this, tc);
    }

    byte[] value = null;
    if (obj instanceof byte[]) {
      // Take a copy to prevent an application from altering the data in the message
      byte[] objB = (byte[])obj;
      value = new byte[objB.length];
      System.arraycopy(objB, 0, value, 0, objB.length);
    }
    else if (obj == null) {
      // This property had not been set. The Javadoc for getBytes says we return null
      // if there is no item by this name. Note that this is compatible with applications
      // having set the bytes to null explicitly.
      value = null;
    }
    else {
      JMSException e = newBadConvertException(obj, name, "Byte[]", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Invalid convert", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getBytes",  Arrays.toString(value));
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getObject(String)
   */
  public Object getObject(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getObject", name);

    Object result = null;
    Object obj = null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getObject"},
          e, "JmsMapMessageImpl#11", this, tc);
    }
    if (obj instanceof byte[]) {
      // Take a copy to prevent an application from altering the data in the message
      byte[] objB = (byte[])obj;
      byte[] value = new byte[objB.length];
      System.arraycopy(objB, 0, value, 0, objB.length);
      result = value;
    }
    else {
      result = obj;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getObject",  result);
    return result;
  }

  /**
   * @see javax.jms.MapMessage#getMapNames()
   */
  public Enumeration getMapNames() throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getMapNames");

    Enumeration map=null;
    try {
      map = mapMsg.getMapNames();
    } catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getMapNames"},
          e, "JmsMapMessageImpl#12", this, tc);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getMapNames",  map);
    return map;
  }

  /**
   * @see javax.jms.MapMessage#setBoolean(String, boolean)
   */
  public void setBoolean(String name, boolean value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBoolean", new Object[]{name, value});

    checkBodyWriteable("setBoolean");
    checkPropName(name, "setBoolean");
    try {
      mapMsg.setBoolean(name, value);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.setBoolean"},
        e, "JmsMapMessageImpl#13", this, tc);
    }
    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBoolean");
  }

  /**
   * @see javax.jms.MapMessage#setByte(String, byte)
   */
  public void setByte(String name, byte value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setByte", new Object[]{name, value});

    checkBodyWriteable("setByte");
    checkPropName(name, "setByte");
    try {
      mapMsg.setByte(name, value);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.setByte"},
          e, "JmsMapMessageImpl#14", this, tc);
    }
    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setByte");
  }

  /**
   * @see javax.jms.MapMessage#setBytes(String, byte[])
   */
  public void setBytes(String name, byte[] value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBytes", new Object[]{name, value});

    int length = 0;
    if (value != null) length = value.length;
    setBytes(name, value, 0, length);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBytes");
  }

  /**
   * @see javax.jms.MapMessage#setBytes(String, byte[], int, int)
   */
  public void setBytes(String name, byte[] value, int start, int length) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBytes", new Object[]{name, value, start, length});

    checkBodyWriteable("setBytes");
    checkPropName(name, "setBytes");

    // carry out the deep copy & defend against nulls
    // (should be able to set a null without any problems).
    byte[] deepCopy = null;
    if (value != null) {
      deepCopy = new byte[length];
      System.arraycopy(value, start, deepCopy, 0, length);
    }

    try {
       // pass the copy of the array in to the message object.
       mapMsg.setBytes(name, deepCopy);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.setBytes"},
          e, "JmsMapMessageImpl#15", this, tc);
    }

    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBytes");
  }

  /**
   * @see javax.jms.MapMessage#setChar(String, char)
   */
  public void setChar(String name, char value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChar", new Object[]{name, value});

    checkBodyWriteable("setChar");
    checkPropName(name, "setChar");
    try {
      mapMsg.setChar(name, value);
    }

Answer: catch (UnsupportedEncodingException e) {

<think>
The setChar method follows the same pattern as other setter methods (setBoolean, setByte, setBytes). After the try block that calls mapMsg.setChar(name, value), the next line is the catch clause handling UnsupportedEncodingException, matching the existing code style.
</think>
catch (UnsupportedEncodingException e) {


Context:
/*******************************************************************************
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package com.ibm.ws.sib.api.jms.impl;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Enumeration;

import javax.jms.JMSException;
import javax.jms.MapMessage;
import javax.jms.MessageFormatException;

import com.ibm.websphere.sib.api.jms.ApiJmsConstants;
import com.ibm.ws.sib.mfp.JsJmsMapMessage;
import com.ibm.ws.sib.mfp.JsJmsMessage;
import com.ibm.ws.sib.mfp.MessageCreateFailedException;
import com.ibm.ws.sib.utils.ras.SibTr;
import com.ibm.websphere.ras.TraceComponent;

/**
 * @author matrober
 *
 * This class implements the requirements of a JMS MapMessage
 */
public class JmsMapMessageImpl extends JmsMessageImpl implements MapMessage
{

  /**
   * This svUID assigned at version 1.30
   */
  private static final long serialVersionUID = -5270211659893353729L;

  // ******************* PRIVATE STATE VARIABLES *******************

  /**
   * MFP message object representing a JMS TextMessage
   * Note: Do not initialise this to null here, otherwise it will overwrite
   *       the setup done by instantiateMessage!
   */
  private JsJmsMapMessage mapMsg;

  /**
   * This variable holds a cache of the message toString at the Message level.
   * A separate cache holds the subclass information. The cache is invalidated
   * by changing any property of the message.
   */
  private transient String cachedMapToString = null;

  // *************************** TRACE INITIALIZATION **************************
  private static TraceComponent tc = SibTr.register(JmsMapMessageImpl.class, ApiJmsConstants.MSG_GROUP_EXT, ApiJmsConstants.MSG_BUNDLE_EXT);

  // ************************ CONSTRUCTORS *************************

  /**
   * Constructor used to create a new message object.
   */
  public JmsMapMessageImpl() throws JMSException {
    // Calling the superclass no-args constructor in turn leads to the
    // instantiateMessage method being called, which we override to return
    // a map message.
    super();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl");
    messageClass = CLASS_MAP;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  /**
   * This constructor is used by the JmsMessage.inboundJmsInstance method (static)
   * in order to provide the inbound message path from MFP component to JMS component.
   */
  JmsMapMessageImpl(JsJmsMapMessage newMsg, JmsSessionImpl newSess) {

    // Pass this object to the parent class so that it can keep a reference.
    super(newMsg, newSess);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl", new Object[]{newMsg, newSess});

    // Store the reference we are given, and inform the parent class.
    mapMsg = newMsg;
    messageClass = CLASS_MAP;

    // Note that we do NOT initialize the defaults for inbound messages.

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  /**
   * Construct a jetstream jms message from a (possibly non-jetstream)
   * vanilla jms message.
   */
  JmsMapMessageImpl(MapMessage mapMessage) throws JMSException {
    // copy message headers and properties.
    super(mapMessage);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "JmsMapMessageImpl", mapMessage);

    // set-up this class's state (i.e. do what this() does).
    // nothing to do.

    // copy map.
    Enumeration mapNames = mapMessage.getMapNames();
    if (mapNames != null) {
      while (mapNames.hasMoreElements()) {
        String name = (String) mapNames.nextElement();
        Object value = mapMessage.getObject(name);
        setObject(name, value);
      }
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "JmsMapMessageImpl");
  }

  // ********************* INTERFACE METHODS ***********************

  /**
   * @see javax.jms.MapMessage#getBoolean(String)
   */
  public boolean getBoolean(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getBoolean", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getBoolean"},
        e, "JmsMapMessageImpl#1", this, tc);
    }

    boolean value = false;
    try {
      value = JmsMessageImpl.parseBoolean(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // d238447 FFDC review. Don't call processThrowable - this is an app' error.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getBoolean",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getByte(String)
   */
  public byte getByte(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getByte", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getByte"},
        e, "JmsMapMessageImpl#2", this, tc);
    }

    byte value = 0;
    try {
      value = JmsMessageImpl.parseByte(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 don't call processThrowable for app' errors
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getByte",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getShort(String)
   */
  public short getShort(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getShort", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.getShort"},
        e, "JmsMapMessageImpl#3", this, tc);
    }

    short value = 0;
    try {
      value = JmsMessageImpl.parseShort(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getShort",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getChar(String)
   */
  public char getChar(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getChar", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getChar"},
          e, "JmsMapMessageImpl#4", this, tc);
    }

    char value = 0;

    // This logic is not part of a Message.parseCharacter because there is no
    // equivalent Message.getCharProperty method which would share it.
    if (obj instanceof Character) {
      value = ((Character)obj).charValue();
    }
    else if (obj == null) {
      RuntimeException e = (RuntimeException)JmsErrorUtils.newThrowable(NullPointerException.class,
            "FIELD_NOT_SET_CWSIA0105", new Object[] { name }, tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Field has not been set", e);
      throw e;
    }
    else {
      // Boolean can only be retrieved as boolean and String (see 3.5.4).
      JMSException e = newBadConvertException(obj, name, "Character", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Invalid convert", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getChar",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getInt(String)
   */
  public int getInt(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getInt", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getInt"},
          e, "JmsMapMessageImpl#5", this, tc);
    }

    int value = 0;
    try {
      value = JmsMessageImpl.parseInt(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getInt",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getLong(String)
   */
  public long getLong(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getLong", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getLong"},
          e, "JmsMapMessageImpl#6", this, tc);
    }

    long value = 0;
    try {
      value = JmsMessageImpl.parseLong(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getLong",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getFloat(String)
   */
  public float getFloat(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getFloat", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getFloat"},
          e, "JmsMapMessageImpl#7", this, tc);
    }

    float value = 0;

    try {
      value = JmsMessageImpl.parseFloat(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getFloat",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getDouble(String)
   */
  public double getDouble(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDouble", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    } catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getDouble"},
          e, "JmsMapMessageImpl#8", this, tc);
    }

    double value = 0;
    try {
      value = JmsMessageImpl.parseDouble(obj, name);
    }
    catch (JMSException e) {
      // No FFDC code needed
      // 238447 Don't generate FFDCs for app' errors.
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Error parsing object", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDouble",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getString(String)
   */
  public String getString(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getString", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getString"},
          e, "JmsMapMessageImpl#9", this, tc);
    }

    String value = null;

    if ((obj instanceof String) || (obj == null)) {
      value = (String)obj;
    }
    else if (obj instanceof byte[]) {
      JMSException e = newBadConvertException(obj, name, "String", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "invalid convert", e);
      throw e;
    }
    else {
      // Every type of property can be returned as a String
      value = obj.toString();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getString",  value);
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getBytes(String)
   */
  public byte[] getBytes(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getBytes", name);

    Object obj=null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getBytes"},
          e, "JmsMapMessageImpl#10", this, tc);
    }

    byte[] value = null;
    if (obj instanceof byte[]) {
      // Take a copy to prevent an application from altering the data in the message
      byte[] objB = (byte[])obj;
      value = new byte[objB.length];
      System.arraycopy(objB, 0, value, 0, objB.length);
    }
    else if (obj == null) {
      // This property had not been set. The Javadoc for getBytes says we return null
      // if there is no item by this name. Note that this is compatible with applications
      // having set the bytes to null explicitly.
      value = null;
    }
    else {
      JMSException e = newBadConvertException(obj, name, "Byte[]", tc);
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Invalid convert", e);
      throw e;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getBytes",  Arrays.toString(value));
    return value;
  }

  /**
   * @see javax.jms.MapMessage#getObject(String)
   */
  public Object getObject(String name) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getObject", name);

    Object result = null;
    Object obj = null;
    try {
      obj = mapMsg.getObject(name);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getObject"},
          e, "JmsMapMessageImpl#11", this, tc);
    }
    if (obj instanceof byte[]) {
      // Take a copy to prevent an application from altering the data in the message
      byte[] objB = (byte[])obj;
      byte[] value = new byte[objB.length];
      System.arraycopy(objB, 0, value, 0, objB.length);
      result = value;
    }
    else {
      result = obj;
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getObject",  result);
    return result;
  }

  /**
   * @see javax.jms.MapMessage#getMapNames()
   */
  public Enumeration getMapNames() throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getMapNames");

    Enumeration map=null;
    try {
      map = mapMsg.getMapNames();
    } catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.getMapNames"},
          e, "JmsMapMessageImpl#12", this, tc);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getMapNames",  map);
    return map;
  }

  /**
   * @see javax.jms.MapMessage#setBoolean(String, boolean)
   */
  public void setBoolean(String name, boolean value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBoolean", new Object[]{name, value});

    checkBodyWriteable("setBoolean");
    checkPropName(name, "setBoolean");
    try {
      mapMsg.setBoolean(name, value);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
        JMSException.class,
        "EXCEPTION_RECEIVED_CWSIA0022",
        new Object[] {e, "JmsMapMessageImpl.setBoolean"},
        e, "JmsMapMessageImpl#13", this, tc);
    }
    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBoolean");
  }

  /**
   * @see javax.jms.MapMessage#setByte(String, byte)
   */
  public void setByte(String name, byte value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setByte", new Object[]{name, value});

    checkBodyWriteable("setByte");
    checkPropName(name, "setByte");
    try {
      mapMsg.setByte(name, value);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.setByte"},
          e, "JmsMapMessageImpl#14", this, tc);
    }
    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setByte");
  }

  /**
   * @see javax.jms.MapMessage#setBytes(String, byte[])
   */
  public void setBytes(String name, byte[] value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBytes", new Object[]{name, value});

    int length = 0;
    if (value != null) length = value.length;
    setBytes(name, value, 0, length);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBytes");
  }

  /**
   * @see javax.jms.MapMessage#setBytes(String, byte[], int, int)
   */
  public void setBytes(String name, byte[] value, int start, int length) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBytes", new Object[]{name, value, start, length});

    checkBodyWriteable("setBytes");
    checkPropName(name, "setBytes");

    // carry out the deep copy & defend against nulls
    // (should be able to set a null without any problems).
    byte[] deepCopy = null;
    if (value != null) {
      deepCopy = new byte[length];
      System.arraycopy(value, start, deepCopy, 0, length);
    }

    try {
       // pass the copy of the array in to the message object.
       mapMsg.setBytes(name, deepCopy);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed
      throw (JMSException) JmsErrorUtils.newThrowable(
          JMSException.class,
          "EXCEPTION_RECEIVED_CWSIA0022",
          new Object[] {e, "JmsMapMessageImpl.setBytes"},
          e, "JmsMapMessageImpl#15", this, tc);
    }

    // Invalidate the cached toString object.
    cachedMapToString = null;

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBytes");
  }

  /**
   * @see javax.jms.MapMessage#setChar(String, char)
   */
  public void setChar(String name, char value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChar", new Object[]{name, value});

    checkBodyWriteable("setChar");
    checkPropName(name, "setChar");
    try {
      mapMsg.setChar(name, value);
    }
    catch (UnsupportedEncodingException e) {
      // No FFDC Code Needed

Answer: throw (JMSException) JmsErrorUtils.newThrowable(

<think>
The method setChar follows the same pattern as setBoolean and setByte: after catching UnsupportedEncodingException, it throws a JMSException using JmsErrorUtils.newThrowable with the appropriate identifier. The very next line after the comment is the start of that throw statement.
</think>
throw (JMSException) JmsErrorUtils.newThrowable(