[Engine-devel] Generic "name is used" message
by Mike Kolesnik
------=_Part_1894359_617512914.1363509997819
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Hi,
Lately I had to add an error message that "name is already used".
I looked in the translations files and saw many messages for specific entity types in the system that looked much the same:
VDS_TRY_CREATE_WITH_EXISTING_PARAMS=Cannot ${action} ${type}. Host with the same name already exists
ACTION_TYPE_FAILED_VM_ALREADY_EXIST = Cannot $ { action } $ { type }. VM with the same name already exists .
etc..
What I decided to do is not add another "X with the same name already exists" message,
but instead add a generic message for this condition.
You can review the patch here :
http://gerrit.ovirt.org/#/c/12361
I also went the extra mile to change the current messages that look like this to use this message:
http://gerrit.ovirt.org/#/c/13063/
It is not a full coverage, since some commands don't fill the $action $type replacements,
and the required change is a bit bigger than this patch scope, but it's a good start.
FYI, and if you see other generic messages repeating themselves, don't hesitate to squash them.
Regards,
Mike
------=_Part_1894359_617512914.1363509997819
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><style type=3D'text/css'>p { margin: 0; }</style></head><body><=
div style=3D'font-family: times new roman,new york,times,serif; font-size: =
12pt; color: #000000'>Hi,<br><br>Lately I had to add an error message that =
"name is already used".<br>I looked in the translations files and saw many =
messages for specific entity types in the system that looked much the same:=
<br><span class=3D"str">VDS_TRY_CREATE_WITH_EXISTING_PARAMS=3DCannot ${acti=
on} ${type}. Host with the same name already exists<br></span><span class=
=3D"pln">ACTION_TYPE_FAILED_VM_ALREADY_EXIST</span><span class=3D"pun">=3D<=
/span><span class=3D"typ">Cannot</span><span class=3D"pln"> $</span><span c=
lass=3D"pun">{</span><span class=3D"pln">action</span><span class=3D"pun">}=
</span><span class=3D"pln"> $</span><span class=3D"pun">{</span><span class=
=3D"pln">type</span><span class=3D"pun">}.</span><span class=3D"pln"> VM </=
span><span class=3D"kwd">with</span><span class=3D"pln"> the same name alre=
ady exists</span><span class=3D"pun">.</span><br>etc..<br><br>What I decide=
d to do is not add another "X with the same name already exists" message,<b=
r>but instead add a generic message for this condition.<br><br>You can revi=
ew the patch here:<br>http://gerrit.ovirt.org/#/c/12361<br><br>I also went =
the extra mile to change the current messages that look like this to use th=
is message:<br>http://gerrit.ovirt.org/#/c/13063/<br><br>It is not a full c=
overage, since some commands don't fill the $action $type replacements,<br>=
and the required change is a bit bigger than this patch scope, but it's a g=
ood start.<br><br>FYI, and if you see other generic messages repeating them=
selves, don't hesitate to squash them.<br><br><div><span name=3D"x"></span>=
Regards,<br>Mike<span name=3D"x"></span><br></div><br></div></body></html>
------=_Part_1894359_617512914.1363509997819--
11 years, 8 months
[Engine-devel] DB Performance Monitoring
by Libor Spevak
Hi,
I just wanted to share a partial result from testing of engine db load
during operation (SQL queries frequencies). Maybe, we can decide later,
if some SQL queries result CACHING can boost throughput for larger
deployments.
The caching technology can be from a simple HashMap lookup to
deployments of something like http://ehcache.org/ (memory database).
I prepared two simple scenarios:
- oVirt engine, 2 hosts, 1 VM, running 15 minutes (Power on + Up state)
- oVirt engine, 2 hosts, 10 VMs from one pool, running 15 minutes (Power
on + Up state)
Appending 2 spreadsheets with data about the most used SQL queries
(generated by PostgreSQL standard pg_statements_stat module).
e.g.
- 2nd row shows number of granted connections from the db pool (e.g. can
be used to set optimal connection pool size) (check of connection
health: select 1)
- most of the queries are wrapped by a PLSQL function so we see a wrapper:
/select * from getvdsgroupbyvdsgroupid($1, $2, $3)/
and near to it the 'real' query:
/SELECT vds_groups_view.*//
// FROM vds_groups_view//
// WHERE vds_group_id = v_vds_group_id//
// AND (NOT v_is_filtered OR EXISTS (SELECT 1//
// FROM
user_vds_groups_permissions_view//
// WHERE user_id = v_user_id AND
entity_id = v_vds_group_id))//
/
Just as an example, I selected in yellow color some queries, which
probably do not change often, but are very frequent.
Other tools like 'pg_top' can provide runtime statistics of db processes
(cpu, mem, locks, ... views).
By enabling debug level logging of PostgreSQL we can check real values
to the queries.
Of course, it would be useful to run such tests with many hosts and VMs
to predict scaling issues.
More info about tools configuration:
http://www.ovirt.org/Engine_database_performance_monitoring
Regards,
Libor
11 years, 8 months
[Engine-devel] engine watchdog support - new version in gerrit
by Laszlo Hornyak
hi,
A new version of the engine watchdog support is available in gerrit. This version finished the rest-api support by adding the capabilities resources. The features listed in the feature page are ready, so if you have enough time and courage, please give it a try!
I have left the patch with [wip] because I am waiting for the end of some discussions about the technical background.
http://gerrit.ovirt.org/#/c/12419/
Thx,
Laszlo
11 years, 8 months
Re: [Engine-devel] [oVirt Jenkins] ovirt_engine_find_bugs - Build # 3737 - Still Unstable!
by Eyal Edri
Latest commit introduced new NORMAL findbugs, please fix.
eyal.
infra team.
----- Original Message -----
> From: "Jenkins ci oVirt Server" <jenkins(a)ovirt.org>
> To: eedri(a)redhat.com, engine-patches(a)ovirt.org, oliel(a)redhat.com, yzaslavs(a)redhat.com, dcaro(a)redhat.com,
> gerrit2(a)gerrit.ovirt.org
> Sent: Thursday, March 14, 2013 12:32:10 AM
> Subject: [oVirt Jenkins] ovirt_engine_find_bugs - Build # 3737 - Still Unstable!
>
> Project: http://jenkins.ovirt.org/job/ovirt_engine_find_bugs/
> Build: http://jenkins.ovirt.org/job/ovirt_engine_find_bugs/3737/
> Build Number: 3737
> Build Status: Still Unstable
> Triggered By: Started by an SCM change
>
> -------------------------------------
> Changes Since Last Success:
> -------------------------------------
> Changes for Build #3733
> [Michael Kublin] engine: Making all internal actions to have same
> correlationId
>
>
> Changes for Build #3734
> [Gerrit Code Review] webadmin: Attach disk - verify valid selection
>
> [Gerrit Code Review] webadmin: Make Template dialog - style
> modifications
>
> [Gerrit Code Review] webadmin: About dialog - remove redundant code
>
>
> Changes for Build #3735
> [Allon Mureinik] core: AuditLogableBaseTest synthetic access
>
> [Allon Mureinik] core: TestAuditLoggableBase serial warning
>
>
> Changes for Build #3736
> [Kiril Nesenko] webadmin: Change default doc path.
>
>
> Changes for Build #3737
> [Gerrit Code Review] db: do not write to dbscripts after installation
>
>
>
>
> -----------------
> Failed Tests:
> -----------------
> No tests ran.
>
>
11 years, 8 months
[Engine-devel] Async Task Manager improvements
by Yair Zaslavsky
Hi all,
I would like to present you a document I'm working on (still in draft/working-in-progress mode) of changes to be done at the engine async task manager.
Regarding the detailed design -
The suggested design breaks the task management into two modules - task management/polling part + command management (in context of completion of tasks/commands).
The current status of the design is that the design of task management is provided (needs some polishing) - the command management design will be provided soon.
In addition, we already have some ideas for an alternative design for the task management part (as suggested by Saggi Mizrahi).
After converging , we will present the complete design.
The reason we're sending the Wiki now is that community members will be aware mainly to the motivations behind the changes
(Perhaps we should create separate documents for the design and for the motivation/requirements)
http://www.ovirt.org/Wiki/AsyncTaskManagerChanges
Yair
11 years, 8 months
[Engine-devel] VmDynamic kvm_enable
by Laszlo Hornyak
Hi,
I came across a VmDynamic property 'kvm_enable'. It sounds strange for me, because ovirt is very colsely integrated with kvm. So a short dig into this flag...
There is a similar thing for the VDS, it is set to true by vdsm is the host CPU has a VT flag. It is actually used to check if the host is OK to run VMS.
But the one for Vm it looks like a distributed logical loop in vdsm: it is set when constructing a VM object (vdsm/vm.py:~343) from the data sent by the client (engine) and then reported back in vm stats, so it is just a roundtrip between vdsm and it's client.
In the engine side, it is just keeps sending it between the frontend DB and vdsm, never part of a decision.
Is this still needed here? Can I remove?
VDSM guys?
Thx,
Laszlo
11 years, 8 months
[Engine-devel] Got some troubles when I want to modify oVirt GUI
by Chen, Wei D
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
SGksDQogICBJbiBvcmRlciB0byBhZGQgbmV3IGZlYXR1cmUgdG8gT3ZpcnQsIHRoYXQgaXMgdXNl
ciBjYW4gY2hvb3NlIHZpcnR1YWwgbWFjaGluZSB3aGV0aGVyIG9uIHRydXN0ZWQgbWFjaGluZSBv
ciBub3Qgd2hlbiBpdCBydW5zIHVwLCB3ZSBtb2RpZmllZCB0aGUgcmVsYXRpdmUgZmlsZXMuDQpP
dXIgZ29hbCBpcyB3aGVuIHRoZSB1c2Vy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zYWJsZShnZXRIb3N0Q3B1KCkp
Ow0KwqDCoMKgwqDCoMKgwqAgfQ0KwqDCoMKgwqDCoMKgwqAgZWxzZQ0KwqDCoMKgwqDCoMKgwqAg
ew0KwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBnZXRSdW5WTU9uU3BlY2lmaWNIb3N0KCkuc2V0SXND
aGFuZ2FibGUodHJ1ZSk7DQrCoMKgwqDCoMKgwqDCoCB9DQrCoMKgIMKgwqDCoMKgwqBiZWhhdmlv
ci51cGRhdGVDcHVQaW5uaW5nVmlzaWJpbGl0eSgpOw0K44CA44CAfQ0KDQo=
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_
Content-Type: text/xml; name="AbstractVmPopupWidget.ui.xml"
Content-Description: AbstractVmPopupWidget.ui.xml
Content-Disposition: attachment; filename="AbstractVmPopupWidget.ui.xml";
size=16078; creation-date="Tue, 12 Mar 2013 08:33:20 GMT";
modification-date="Tue, 12 Mar 2013 08:24:34 GMT"
Content-Transfer-Encoding: base64
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjwhRE9DVFlQRSB1aTpVaUJp
bmRlciBTWVNURU0gImh0dHA6Ly9kbC5nb29nbGUuY29tL2d3dC9EVEQveGh0bWwuZW50Ij4NCjx1
aTpVaUJpbmRlciB4bWxuczp1aT0idXJuOnVpOmNvbS5nb29nbGUuZ3d0LnVpYmluZGVyIiB4bWxu
czpnPSJ1cm46aW1wb3J0OmNvbS5nb29nbGUuZ3d0LnVzZXIuY2xpZW50LnVpIg0KICAgICAgICAg
ICAgIHhtbG5zOmQ9InVybjppbXBvcnQ6b3JnLm92aXJ0LmVuZ2luZS51aS5jb21tb24ud2lkZ2V0
LmRpYWxvZyINCiAgICAgICAgICAgICB4bWxuczplPSJ1cm46aW1wb3J0Om9yZy5vdmlydC5lbmdp
bmUudWkuY29tbW9uLndpZGdldC5lZGl0b3IiDQogICAgICAgICAgICAgeG1sbnM6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nQ+DQoJCQk8L3Q6RGlh
bG9nVGFiPg0KCQk8L3Q6dGFiPg0KCTwvdDpEaWFsb2dUYWJQYW5lbD4NCg0KPC91aTpVaUJpbmRl
cj4NCg==
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_
Content-Type: application/octet-stream; name="UnitVmModel.java"
Content-Description: UnitVmModel.java
Content-Disposition: attachment; filename="UnitVmModel.java"; size=75481;
creation-date="Tue, 12 Mar 2013 08:33:20 GMT";
modification-date="Tue, 12 Mar 2013 08:25:07 GMT"
Content-Transfer-Encoding: base64
cGFja2FnZSBvcmcub3ZpcnQuZW5naW5lLnVpLnVpY29tbW9ud2ViLm1vZGVscy52bXM7CgppbXBv
cnQgamF2YS51dGlsLkFycmF5TGlzdDsKaW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBq
YXZhLnV0aWwuQ29sbGVjdGlvbnM7CmltcG9ydCBqYXZhLnV0aWwuQ29tcGFyYXRvcjsKaW1wb3J0
IGphdmEudXRpbC5EYXRlOwppbXBvcnQgamF2YS51dGlsLkhhc2hNYXA7CmltcG9ydCBqYXZhLnV0
aWwuTGlzdDsKCmltcG9ydCBvcmcub3ZpcnQuZW5naW5lLmNvcmUuY29tbW9uLmJ1c2luZXNzZW50
aXRpZXMuQm9vdFNlcXVlbmNlOwppbXBvcnQgb3JnLm92aXJ0LmVuZ2luZS5jb3JlLmNvbW1vbi5i
dXNpbmVzc2VudGl0aWVzLkRpc3BsYXlUeXBlOwppbXBvcnQgb3JnLm92aXJ0LmVuZ2luZS5jb3Jl
LmNvbW1vbi5idXNpbmVzc2VudGl0aWVzLlF1b3RhRW5mb3JjZW1lbnRUeXBlRW51bTsKaW1wb3J0
IG9yZy5vdmlydC5lbmdpbmUuY29yZS5jb21tb24uYnVzaW5lc3NlbnRpdGllcy5Vc2JQb2xpY3k7
CmltcG9ydCBvcmcub3ZpcnQuZW5naW5lLmNvcmUuY29tbW9uLmJ1c2luZXNzZW50aXRpZ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N0ZWRJdGVtQ2hhbmdlZEV2ZW50RGVmaW5pdGlvbikpCiAgICAgICAgewogICAgICAgICAgICBp
ZiAoc2VuZGVyID09IGdldERhdGFDZW50ZXIoKSkKICAgICAgICAgICAgewogICAgICAgICAgICAg
ICAgRGF0YUNlbnRlcl9TZWxlY3RlZEl0ZW1DaGFuZ2VkKHNlbmRlciwgYXJncyk7CiAgICAgICAg
ICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoc2VuZGVyID09IGdldFRlbXBsYXRlKCkpCiAgICAg
ICAgICAgIHsKICAgICAgICAgICAgICAgIFRlbXBsYXRlX1NlbGVjdGVkSXRlbUNoYW5nZWQoc2Vu
ZGVyLCBhcmdzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChzZW5kZXIgPT0g
Z2V0Q2x1c3RlcigpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBDbHVzdGVyX1NlbGVj
dGVkSXRlbUNoYW5nZWQoc2VuZGVyLCBhcmdzKTsKICAgICAgICAgICAgICAgIEluaXRVc2JQb2xp
Y3koKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChzZW5kZXIgPT0gZ2V0VGlt
ZVpvbmUoKSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgVGltZVpvbmVfU2VsZWN0ZWRJ
dGVtQ2hhbmdlZChzZW5kZXIsIGFyZ3MpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2Ug
aWYgKHNlbmRlciA9PSBnZXREZWZhdWx0SG9zdCgpKQogICAgICAgICAgICB7CiAgICAgICAgICAg
ICAgICBEZWZhdWx0SG9zdF9TZWxlY3RlZEl0ZW1DaGFuZ2VkKHNlbmRlciwgYXJncyk7CiAgICAg
ICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoc2VuZGVyID09IGdldE9TVHlwZSgpKQogICAg
ICAgICAgICB7CiAgICAgICAgICAgICAgICBPU1R5cGVfU2VsZWN0ZWRJdGVtQ2hhbmdlZChzZW5k
ZXIsIGFyZ3MpOwogICAgICAgICAgICAgICAgSW5pdFVzYlBvbGljeSgpOwogICAgICAgICAgICB9
CiAgICAgICAgICAgIGVsc2UgaWYgKHNlbmRlciA9PSBnZXRGaXJzdEJvb3REZXZpY2UoKSkKICAg
ICAgICAgICAgewogICAgICAgICAgICAgICAgRmlyc3RCb290RGV2aWNlX1NlbGVjdGVkSXRlbUNo
YW5nZWQoc2VuZGVyLCBhcmdzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChz
ZW5kZXIgPT0gZ2V0RGlzcGxheVByb3RvY29sKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAg
ICAgIERpc3BsYXlQcm90b2NvbF9TZWxlY3RlZEl0ZW1DaGFuZ2VkKHNlbmRlciwgYXJncyk7CiAg
ICAgICAgICAgICAgICBJbml0VXNiUG9saWN5KCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg
ZWxzZSBpZiAoc2VuZGVyID09IGdldE51bU9mU29ja2V0cygpKQogICAgICAgICAgICB7CiAgICAg
ICAgICAgICAgICBOdW1PZlNvY2tldHNfRW50aXR5Q2hhbmdlZChzZW5kZXIsIGFyZ3MpOwogICAg
ICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKHNlbmRlciA9PSBnZXRDb3Jlc1BlclNvY2tl
dCgpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBDb3Jlc1BlclNvY2tldF9FbnRpdHlD
aGFuZ2VkKHNlbmRlciwgYXJncyk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxz
ZSBpZiAoZXYuZXF1YWxzKEVudGl0eU1vZGVsLkVudGl0eUNoYW5nZWRFdmVudERlZmluaXRpb24p
KQogICAgICAgIHsKICAgICAgICAgICAgaWYgKHNlbmRlciA9PSBnZXRNZW1TaXplKCkpCiAgICAg
ICAgICAgIHsKICAgICAgICAgICAgICAgIE1lbVNpemVfRW50aXR5Q2hhbmdlZChzZW5kZXIsIGFy
Z3MpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKHNlbmRlciA9PSBnZXRUb3Rh
bENQVUNvcmVzKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIFRvdGFsQ1BVQ29yZXNf
RW50aXR5Q2hhbmdlZChzZW5kZXIsIGFyZ3MpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVs
c2UgaWYgKHNlbmRlciA9PSBnZXRSdW5WTU9uU3BlY2lmaWNIb3N0KCkpCiAgICAgICAgICAgIHsK
ICAgICAgICAgICAgICAgIFJ1blZNT25TcGVjaWZpY0hvc3RfRW50aXR5Q2hhbmdlZChzZW5kZXIs
IGFyZ3MpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKHNlbmRlciA9PSBnZXRE
b250TWlncmF0ZVZNKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIERvbnRNaWdyYXRl
Vk1fRW50aXR5Q2hhbmdlZChzZW5kZXIsIGFyZ3MpOwogICAgICAgICAgICB9CiAgICAgICAgICAg
IGVsc2UgaWYgKHNlbmRlciA9PSBnZXRSdW5WTU9uVHJ1c3RlZEhvc3QoKSkKICAgICAgICAgICAg
ewogICAgICAgICAgICAgICAgUnVuVk1PblRydXN0ZWRIb3N0X0VudGl0eUNoYW5nZWQoc2VuZGVy
LCBhcmdzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChzZW5kZXIgPT0gZ2V0
SXNBdXRvQXNzaWduKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIElzQXV0b0Fzc2ln
bl9FbnRpdHlDaGFuZ2VkKHNlbmRlciwgYXJncyk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAg
IGVsc2UgaWYgKHNlbmRlciA9PSBnZXRQcm92aXNpb25pbmcoKSkKICAgICAgICAgICAgewogICAg
ICAgICAgICAgICAgUHJvdmlzaW9uaW5n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ICAgIGlmIChxdWVyeUNvdW50ZXIgPT0gMCkKICAgICAgICB7CiAgICAgICAgICAgIFN0b3BQcm9n
cmVzcygpOwogICAgICAgIH0KICAgIH0KCiAgICBwcm90ZWN0ZWQgdm9pZCBJbml0TnVtT2ZNb25p
dG9ycygpCiAgICB7CiAgICAgICAgaWYgKGdldFZtVHlwZSgpID09IFZtVHlwZS5EZXNrdG9wKQog
ICAgICAgIHsKICAgICAgICAgICAgQXN5bmNEYXRhUHJvdmlkZXIuR2V0TnVtT2ZNb25pdG9yTGlz
dChuZXcgQXN5bmNRdWVyeSh0aGlzLAogICAgICAgICAgICAgICAgICAgIG5ldyBJTmV3QXN5bmND
YWxsYmFjaygpIHsKICAgICAgICAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAg
ICAgICAgICAgICAgIHB1YmxpYyB2b2lkIE9uU3VjY2VzcyhPYmplY3QgdGFyZ2V0LCBPYmplY3Qg
cmV0dXJuVmFsdWUpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBVbml0Vm1Nb2RlbCBt
b2RlbCA9IChVbml0Vm1Nb2RlbCkgdGFyZ2V0OwogICAgICAgICAgICAgICAgICAgICAgICAgICAg
SW50ZWdlciBvbGROdW1PZk1vbml0b3JzID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGlmIChtb2RlbC5nZXROdW1PZk1vbml0b3JzKCkuZ2V0U2VsZWN0ZWRJdGVtKCkgIT0gbnVs
bCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBvbGROdW1PZk1vbml0b3JzID0gKEludGVnZXIpIG1vZGVsLmdldE51bU9mTW9uaXRv
cnMoKS5nZXRTZWxlY3RlZEl0ZW0oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxJbnRlZ2VyPiBudW1PZk1vbml0b3Jz
ID0gKEFycmF5TGlzdDxJbnRlZ2VyPikgcmV0dXJuVmFsdWU7CiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICBtb2RlbC5nZXROdW1PZk1vbml0b3JzKCkuc2V0SXRlbXMobnVtT2ZNb25pdG9ycyk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob2xkTnVtT2ZNb25pdG9ycyAhPSBudWxs
KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIG1vZGVsLmdldE51bU9mTW9uaXRvcnMoKS5zZXRTZWxlY3RlZEl0ZW0ob2xkTnVtT2ZN
b25pdG9ycyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAg
ICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSwgZ2V0SGFzaCgpKSk7CiAgICAgICAgfQog
ICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGdldE51bU9mTW9uaXRvcnMoKS5zZXRJ
dGVtcyhuZXcgQXJyYXlMaXN0PEludGVnZXI+KEFycmF5cy5hc0xpc3QobmV3IEludGVnZXJbXSB7
IDEgfSkpKTsKICAgICAgICAgICAgZ2V0TnVtT2ZNb25pdG9ycygpLnNldFNlbGVjdGVkSXRlbSgx
KTsKICAgICAgICB9CiAgICB9CgogICAgcHJvdGVjdGVkIHZvaWQgSW5pdEFsbG93Q29uc29sZVJl
Y29ubmVjdCgpCiAgICB7CiAgICAgICAgZ2V0QWxsb3dDb25zb2xlUmVjb25uZWN0KCkuc2V0RW50
aXR5KGdldFZtVHlwZSgpID09IFZtVHlwZS5TZXJ2ZXIpOwogICAgfQoKICAgIHByaXZhdGUgdm9p
ZCBJbml0T1NUeXBlKCkKICAgIHsKICAgICAgICBMaXN0PFZtT3NUeXBlPiBvc0xpc3QgPSBBcnJh
eXMuYXNMaXN0KFZtT3NUeXBlLnZhbHVlcygpKTsKICAgICAgICBDb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ZSA9IChEaXNwbGF5VHlwZSkgKGdldERpc3BsYXlQcm90b2NvbCgpLmdldFNlbGVjdGVkSXRl
bSgpICE9IG51bGwgPwogICAgICAgICAgICAgICAgKChFbnRpdHlNb2RlbCkgZ2V0RGlzcGxheVBy
b3RvY29sKCkuZ2V0U2VsZWN0ZWRJdGVtKCkpLmdldEVudGl0eSgpIDogbnVsbCk7CgogICAgICAg
IGlmIChvc1R5cGUgPT0gbnVsbCB8fCBjbHVzdGVyID09IG51bGwgfHwgZGlzcGxheVR5cGUgPT0g
bnVsbCkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBnZXRVc2JQb2xp
Y3koKS5zZXRJc0NoYW5nYWJsZSh0cnVlKTsKICAgICAgICBpZiAoVmVyc2lvbi52M18xLmNvbXBh
cmVUbyhjbHVzdGVyLmdldGNvbXBhdGliaWxpdHlfdmVyc2lvbigpKSA+IDApIHsKICAgICAgICAg
ICAgaWYgKG9zVHlwZS5pc1dpbmRvd3MoKSkgewogICAgICAgICAgICAgICAgZ2V0VXNiUG9saWN5
KCkuc2V0SXRlbXMoQXJyYXlzLmFzTGlzdCgKICAgICAgICAgICAgICAgICAgICAgICAgVXNiUG9s
aWN5LkRJU0FCTEVELAogICAgICAgICAgICAgICAgICAgICAgICBVc2JQb2xpY3kuRU5BQkxFRF9M
RUdBQ1kKICAgICAgICAgICAgICAgICAgICAgICAgKSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAg
ICAgICAgICAgICAgICBnZXRVc2JQb2xpY3koKS5zZXRJdGVtcyhBcnJheXMuYXNMaXN0KFVzYlBv
bGljeS5ESVNBQkxFRCkpOwogICAgICAgICAgICAgICAgZ2V0VXNiUG9saWN5KCkuc2V0U2VsZWN0
ZWRJdGVtKFVzYlBvbGljeS5ESVNBQkxFRCk7CiAgICAgICAgICAgICAgICBnZXRVc2JQb2xpY3ko
KS5zZXRJc0NoYW5nYWJsZShmYWxzZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAg
IGlmIChWZXJzaW9uLnYzXzEuY29tcGFyZVRvKGNsdXN0ZXIuZ2V0Y29tcGF0aWJpbGl0eV92ZXJz
aW9uKCkpIDw9IDApIHsKICAgICAgICAgICAgaWYgKG9zVHlwZS5pc0xpbnV4KCkpIHsKICAgICAg
ICAgICAgICAgIGdldFVzYlBvbGljeSgpLnNldEl0ZW1zKEFycmF5cy5hc0xpc3QoCiAgICAgICAg
ICAgICAgICAgICAgICAgIFVzYlBvbGljeS5ESVNBQkxFRCwKICAgICAgICAgICAgICAgICAgICAg
ICAgVXNiUG9saWN5LkVOQUJMRURfTkFUSVZFCiAgICAgICAgICAgICAgICAgICAgICAgICkpOwog
ICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgZ2V0VXNiUG9saWN5KCkuc2V0SXRl
bXMoCiAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgVXNiUG9saWN5LkRJU0FCTEVELAogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIFVzYlBvbGljeS5FTkFCTEVEX0xFR0FDWSwKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBVc2JQb2xpY3kuRU5BQkxFRF9OQVRJVkUKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICApKTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgaWYgKGRp
c3BsYXlUeXBlICE9IERpc3BsYXlUeXBlLnF4bCkgewogICAgICAgICAgICBnZXRVc2JQb2xpY3ko
KS5zZXRJc0NoYW5nYWJsZShmYWxzZSk7CiAgICAgICAgfQoKICAgICAgICBnZXRVc2JQb2xpY3ko
KS5zZXRTZWxlY3RlZEl0ZW0oVXNiUG9saWN5LkRJU0FCTEVEKTsKICAgIH0KCiAgICBwcml2YXRl
IHZvaWQgSW5pdE1pbmltYWxWbU1lbVNpemUoKQogICAgewogICAgICAgIEFzeW5jRGF0YVByb3Zp
ZGVyLkdldE1pbmltYWxWbU1lbVNpemUobmV3IEFzeW5jUXVlcnkodGhpcywKICAgICAgICAgICAg
ICAgIG5ldyBJTmV3QXN5bmNDYWxsYmFjaygpIHsKICAgICAgICAgICAgICAgICAgICBAT3ZlcnJp
ZGUKICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBPblN1Y2Nlc3MoT2JqZWN0IHRhcmdl
dCwgT2JqZWN0IHJldHVyblZhbHVlKSB7CgogICAgICAgICAgICAgICAgICAgICAgICBVbml0Vm1N
b2RlbCB2bU1vZGVsID0gKFVuaXRWbU1vZGVsKSB0YXJnZXQ7CiAgICAgICAgICAgICAgICAgICAg
ICAgIHZtTW9kZWwuc2V0X01pbk1lbVNpemUoKEludGVnZXIpIHJldHVyblZhbHVlKTsKCiAgICAg
ICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwgZ2V0SGFzaCgpKSk7CiAgICB9Cgog
ICAgcHJpdmF0ZSB2b2lkIEluaXRNYXhpbWFsVm1NZW1TaXplMzJPUygpCiAgICB7CiAgICAgICAg
QXN5bmNEYXRhUHJvdmlkZXIuR2V0TWF4aW1hbFZtTWVtU2l6ZTMyT1MobmV3IEFzeW5jUXVlcnko
dGhpcywKICAgICAgICAgICAgICAgIG5ldyBJTmV3QXN5bmNDYWxsYmFjaygpIHsKICAgICAgICAg
ICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBPblN1
Y2Nlc3MoT2JqZWN0IHRhcmdldCwgT2JqZWN0IHJldHVyblZhbHVlKSB7CgogICAgICAgICAgICAg
ICAgICAgICAgICBVbml0Vm1Nb2RlbCB2bU1vZGVsID0gKFVuaXRWbU1vZGVsKSB0YXJnZXQ7CiAg
ICAgICAgICAgICAgICAgICAgICAgIHZtTW9kZWwuc2V0X01heE1lbVNpemUzMigoSW50ZWdlcikg
cmV0dXJuVmFsdWUpOwoKICAgICAgICAgICAg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gIH0KCiAgICBwcml2YXRlIHZvaWQgUnVuVk1PblNwZWNpZmljSG9zdF9F
bnRpdHlDaGFuZ2VkKE9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBhcmdzKQogICAgewogICAgICAg
IGlmICgoQm9vbGVhbikgZ2V0UnVuVk1PblNwZWNpZmljSG9zdCgpLmdldEVudGl0eSgpID09IHRy
dWUpCiAgICAgICAgewogICAgICAgICAgICBjbGVhckFuZERpc2FibGUoZ2V0RG9udE1pZ3JhdGVW
TSgpKTsKICAgICAgICAgICAgZ2V0SG9zdENwdSgpLnNldElzQ2hhbmdhYmxlKHRydWUpOwogICAg
ICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBjbGVhckFuZERpc2FibGUo
Z2V0SG9zdENwdSgpKTsKICAgICAgICAgICAgZ2V0RG9udE1pZ3JhdGVWTSgpLnNldElzQ2hhbmdh
YmxlKHRydWUpOwogICAgICAgIH0KICAgICAgICBiZWhhdmlvci51cGRhdGVDcHVQaW5uaW5nVmlz
aWJpbGl0eSgpOwogICAgfQoKICAgIHByaXZhdGUgdm9pZCBSdW5WTU9uVHJ1c3RlZEhvc3RfRW50
aXR5Q2hhbmdlZChPYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgYXJncykKICAgIHsKICAgICAgICBp
ZiAoKEJvb2xlYW4pIGdldFJ1blZNT25UcnVzdGVkSG9zdCgpLmdldEVudGl0eSgpID09IHRydWUp
CiAgICAgICAgewogICAgICAgICAgICBjbGVhckFuZERpc2FibGUoZ2V0UnVuVk1PblNwZWNpZmlj
SG9zdCgpKTsKICAgICAgICAgICAgY2xlYXJBbmREaXNhYmxlKGdldEhvc3RDcHUoKSk7CiAgICAg
ICAgICAgIGNsZWFyQW5kRGlzYWJsZShnZXREb250TWlncmF0ZVZNKCkpOwogICAgICAgIH0KICAg
ICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBnZXRSdW5WTU9uU3BlY2lmaWNIb3N0KCku
c2V0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ID0gbnVs
bDsKICAgICAgICBmb3IgKE9iamVjdCBpdGVtIDogZ2V0Rmlyc3RCb290RGV2aWNlKCkuZ2V0SXRl
bXMoKSkKICAgICAgICB7CiAgICAgICAgICAgIEVudGl0eU1vZGVsIGEgPSAoRW50aXR5TW9kZWwp
IGl0ZW07CiAgICAgICAgICAgIGlmICgoQm9vdFNlcXVlbmNlKSBhLmdldEVudGl0eSgpID09IExp
bnEuRmlyc3RPckRlZmF1bHQoaXRlbXMpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBm
aXJzdEJvb3REZXZpY2UgPSBhOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGdldEZp
cnN0Qm9vdERldmljZSgpLnNldFNlbGVjdGVkSXRlbShmaXJzdEJvb3REZXZpY2UpOwoKICAgICAg
ICBBcnJheUxpc3Q8RW50aXR5TW9kZWw+IHNlY29uZERldmljZU9wdGlvbnMgPQogICAgICAgICAg
ICAgICAgTGlucS48RW50aXR5TW9kZWw+IENhc3QoZ2V0U2Vjb25kQm9vdERldmljZSgpLmdldEl0
ZW1zKCkpOwoKICAgICAgICBpZiAoaXRlbXMuc2l6ZSgpID4gMSkKICAgICAgICB7CiAgICAgICAg
ICAgIEJvb3RTZXF1ZW5jZSBsYXN0ID0gaXRlbXMuZ2V0KGl0ZW1zLnNpemUoKSAtIDEpOwogICAg
ICAgICAgICBmb3IgKEVudGl0eU1vZGVsIGEgOiBzZWNvbmREZXZpY2VPcHRpb25zKQogICAgICAg
ICAgICB7CiAgICAgICAgICAgICAgICBpZiAoYS5nZXRFbnRpdHkoKSAhPSBudWxsICYmIChCb290
U2VxdWVuY2UpIGEuZ2V0RW50aXR5KCkgPT0gbGFzdCkKICAgICAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgICAgICBnZXRTZWNvbmRCb290RGV2aWNlKCkuc2V0U2VsZWN0ZWRJdGVtKGEpOwog
ICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9
CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGZvciAoRW50aXR5
TW9kZWwgYSA6IHNlY29uZERldmljZU9wdGlvbnMpCiAgICAgICAgICAgIHsKICAgICAgICAgICAg
ICAgIGlmIChhLmdldEVudGl0eSgpID09IG51bGwpCiAgICAgICAgICAgICAgICB7CiAgICAgICAg
ICAgICAgICAgICAgZ2V0U2Vjb25kQm9vdERldmljZSgpLnNldFNlbGVjdGVkSXRlbShhKTsKICAg
ICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQog
ICAgICAgIH0KICAgIH0KCiAgICBwdWJsaWMgdm9pZCBTZXREYXRhQ2VudGVyKFVuaXRWbU1vZGVs
IG1vZGVsLCBBcnJheUxpc3Q8c3RvcmFnZV9wb29sPiBsaXN0KQogICAgewogICAgICAgIGlmICht
b2RlbC5nZXRCZWhhdmlvcigpLmdldFN5c3RlbVRyZWVTZWxlY3RlZEl0ZW0oKSAhPSBudWxsCiAg
ICAgICAgICAgICAgICAmJiBtb2RlbC5nZXRCZWhhdmlvcigpLmdldFN5c3RlbVRyZWVTZWxlY3Rl
ZEl0ZW0oKS5nZXRUeXBlKCkgIT0gU3lzdGVtVHJlZUl0ZW1UeXBlLlN5c3RlbSkKICAgICAgICB7
CiAgICAgICAgICAgIHN3aXRjaCAobW9kZWwuZ2V0QmVoYXZpb3IoKS5nZXRTeXN0ZW1UcmVlU2Vs
ZWN0ZWRJdGVtKCkuZ2V0VHlwZSgpKQogICAgICAgICAgICB7CiAgICAgICAgICAgIGNhc2UgVGVt
cGxhdGVzOgogICAgICAgICAgICBjYXNlIERhdGFDZW50ZXI6CiAgICAgICAgICAgICAgICBzdG9y
YWdlX3Bvb2wgc2VsZWN0RGF0YUNlbnRlciA9CiAgICAgICAgICAgICAgICAgICAgICAgIChzdG9y
YWdlX3Bvb2wpIG1vZGVsLmdldEJlaGF2aW9yK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2VsZWN0ZWRJdGVtKCkuZ2V0RW50aXR5KCk7CiAgICAgICAgICAgICAgICBmb3IgKHN0b3JhZ2Vf
cG9vbCBkYyA6IGxpc3QpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgaWYg
KGRjLmdldElkKCkuZXF1YWxzKGNsdXN0ZXIuZ2V0U3RvcmFnZVBvb2xJZCgpKSkKICAgICAgICAg
ICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldERhdGFDZW50ZXIo
KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXRJdGVtcyhuZXcgQXJyYXlMaXN0
PHN0b3JhZ2VfcG9vbD4oQXJyYXlzLmFzTGlzdChuZXcgc3RvcmFnZV9wb29sW10geyBkYyB9KSkp
OwogICAgICAgICAgICAgICAgICAgICAgICBtb2RlbC5nZXREYXRhQ2VudGVyKCkuc2V0U2VsZWN0
ZWRJdGVtKGRjKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAg
ICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbW9kZWwuZ2V0RGF0YUNl
bnRlcigpLnNldElzQ2hhbmdhYmxlKGZhbHNlKTsKICAgICAgICAgICAgICAgIG1vZGVsLmdldERh
dGFDZW50ZXIoKS5zZXRJbmZvKCJDYW5ub3QgY2hvb3NlIERhdGEgQ2VudGVyIGluIHRyZWUgY29u
dGV4dCIpOyAvLyROT04tTkxTLTEkCiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAg
Y2FzZSBIb3N0OgogICAgICAgICAgICAgICAgVkRTIGhvc3QgPSAoVkRTKSBtb2RlbC5nZXRCZWhh
dmlvcigpLmdldFN5c3RlbVRyZWVTZWxlY3RlZEl0ZW0oKS5nZXRFbnRpdHkoKTsKICAgICAgICAg
ICAgICAgIGZvciAoc3RvcmFnZV9wb29sIGRjIDogbGlzdCkKICAgICAgICAgICAgICAgIHsKICAg
ICAgICAgICAgICAgICAgICBpZiAoZGMuZ2V0SWQoKS5lcXVhbHMoaG9zdC5nZXRTdG9yYWdlUG9v
bElkKCkpKQogICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgbW9k
ZWwuZ2V0RGF0YUNlbnRlcigpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNldEl0
ZW1zKG5ldyBBcnJheUxpc3Q8c3RvcmFnZV9wb29sPihBcnJheXMuYXNMaXN0KG5ldyBzdG9yYWdl
X3Bvb2xbXSB7IGRjIH0pKSk7CiAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldERhdGFD
ZW50ZXIoKS5zZXRTZWxlY3RlZEl0ZW0oZGMpOwogICAgICAgICAgICAgICAgICAgICAgICBtb2Rl
bC5nZXREYXRhQ2VudGVyKCkuc2V0SXNDaGFuZ2FibGUoZmFsc2UpOwogICAgICAgICAgICAgICAg
ICAgICAgICBtb2RlbC5nZXREYXRhQ2VudGVyKCkuc2V0SW5mbygiQ2Fubm90IGNob29zZSBEYXRh
IENlbnRlciBpbiB0cmVlIGNvbnRleHQiKTsgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAg
ICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAg
ICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSBTdG9yYWdlOgogICAgICAgICAg
ICAgICAgc3RvcmFnZV9kb21haW5zIHN0b3JhZ2UgPSAoc3RvcmFnZV9kb21haW5zKSBtb2RlbC5n
ZXRCZWhhdmlvcigpLmdldFN5c3RlbVRyZWVTZWxlY3RlZEl0ZW0oKS5nZXRFbnRpdHkoKTsKICAg
ICAgICAgICAgICAgIGZvciAoc3RvcmFnZV9wb29sIGRjIDogbGlzdCkKICAgICAgICAgICAgICAg
IHsKICAgICAgICAgICAgICAgICAgICBpZiAoZGMuZ2V0SWQoKS5lcXVhbHMoc3RvcmFnZS5nZXRz
dG9yYWdlX3Bvb2xfaWQoKSkpCiAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAg
ICAgICAgICBtb2RlbC5nZXREYXRhQ2VudGVyKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAuc2V0SXRlbXMobmV3IEFycmF5TGlzdDxzdG9yYWdlX3Bvb2w+KEFycmF5cy5hc0xpc3Qo
bmV3IHN0b3JhZ2VfcG9vbFtdIHsgZGMgfSkpKTsKICAgICAgICAgICAgICAgICAgICAgICAgbW9k
ZWwuZ2V0RGF0YUNlbnRlcigpLnNldFNlbGVjdGVkSXRlbShkYyk7CiAgICAgICAgICAgICAgICAg
ICAgICAgIG1vZGVsLmdldERhdGFDZW50ZXIoKS5zZXRJc0NoYW5nYWJsZShmYWxzZSk7CiAgICAg
ICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldERhdGFDZW50ZXIoKS5zZXRJbmZvKCJDYW5ub3Qg
Y2hvb3NlIERhdGEgQ2VudGVyIGluIHRyZWUgY29udGV4dCIpOyAvLyROT04tTkxTLTEkCiAgICAg
ICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAg
ICAgICAgIH0KICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBkZWZhdWx0OgogICAg
ICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZQog
ICAgICAgIHsKICAgICAgICAgICAgbW9kZWwuZ2V0RGF0YUNlbnRlcigpLnNldEl0ZW1zKGxpc3Qp
OwogICAgICAgICAgICBtb2RlbC5nZXREYXRhQ2VudGVyKCkuc2V0U2VsZWN0ZWRJdGVtKExpbnEu
Rmlyc3RPckRlZmF1bHQobGlzdCkpOwogICAgICAgIH0KICAgIH0KCiAgICBwdWJsaWMgdm9pZCBT
ZXRDbHVzdGVycyhVbml0Vm1Nb2RlbCBtb2R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2hvb3NlIENsdXN0ZXIgaW4gdHJlZSBjb250
ZXh0Iik7IC8vJE5PTi1OTFMtMSQKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBj
YXNlIEhvc3Q6CiAgICAgICAgICAgICAgICBWRFMgaG9zdCA9IChWRFMpIGJlaGF2aW9yLmdldFN5
c3RlbVRyZWVTZWxlY3RlZEl0ZW0oKS5nZXRFbnRpdHkoKTsKICAgICAgICAgICAgICAgIGZvciAo
VkRTR3JvdXAgaXRlckNsdXN0ZXIgOiBjbHVzdGVycykKICAgICAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgICAgICBpZiAoaXRlckNsdXN0ZXIuZ2V0SWQoKS5lcXVhbHMoaG9zdC5nZXR2ZHNf
Z3JvdXBfaWQoKSkpCiAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAg
ICBtb2RlbC5nZXRDbHVzdGVyKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2V0
SXRlbXMobmV3IEFycmF5TGlzdDxWRFNHcm91cD4oQXJyYXlzLmFzTGlzdChuZXcgVkRTR3JvdXBb
XSB7IGl0ZXJDbHVzdGVyIH0pKSk7CiAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldENs
dXN0ZXIoKS5zZXRTZWxlY3RlZEl0ZW0oaXRlckNsdXN0ZXIpOwogICAgICAgICAgICAgICAgICAg
ICAgICBtb2RlbC5nZXRDbHVzdGVyKCkuc2V0SXNDaGFuZ2FibGUoZmFsc2UpOwogICAgICAgICAg
ICAgICAgICAgICAgICBtb2RlbC5nZXRDbHVzdGVyKCkuc2V0SW5mbygiQ2Fubm90IGNob29zZSBD
bHVzdGVyIGluIHRyZWUgY29udGV4dCIpOyAvLyROT04tTkxTLTEkCiAgICAgICAgICAgICAgICAg
ICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAg
ICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAg
bW9kZWwuZ2V0Q2x1c3RlcigpLnNldEl0ZW1zKGNsdXN0ZXJzKTsKICAgICAgICAgICAgICAgIGlm
IChjbHVzdGVyR3VpZCA9PSBudWxsKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAg
ICAgIG1vZGVsLmdldENsdXN0ZXIoKS5zZXRTZWxlY3RlZEl0ZW0oTGlucS5GaXJzdE9yRGVmYXVs
dChjbHVzdGVycykpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZQogICAg
ICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldENsdXN0ZXIoKS5zZXRT
ZWxlY3RlZEl0ZW0oTGlucS5GaXJzdE9yRGVmYXVsdChjbHVzdGVycywKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIG5ldyBMaW5xLkNsdXN0ZXJQcmVkaWNhdGUoKEd1aWQpIGNsdXN0ZXJHdWlk
KSkpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAg
IH0KICAgICAgICB9CiAgICAgICAgZWxzZQogICAgICAgIHsKCiAgICAgICAgICAgIG1vZGVsLmdl
dENsdXN0ZXIoKS5zZXRJdGVtcyhjbHVzdGVycyk7CiAgICAgICAgICAgIGlmIChjbHVzdGVyR3Vp
ZCA9PSBudWxsKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBtb2RlbC5nZXRDbHVzdGVy
KCkuc2V0U2VsZWN0ZWRJdGVtKExpbnEuRmlyc3RPckRlZmF1bHQoY2x1c3RlcnMpKTsKICAgICAg
ICAgICAgfQogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIG1v
ZGVsLmdldENsdXN0ZXIoKS5zZXRTZWxlY3RlZEl0ZW0oTGlucS5GaXJzdE9yRGVmYXVsdChjbHVz
dGVycywKICAgICAgICAgICAg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luZXRkUGF0aEludmFsaWQgPSB0cnVlOwogICAgICAgICAgICAgICAgfQoK
ICAgICAgICAgICAgICAgIFN0cmluZyBtc2cgPQogICAgICAgICAgICAgICAgICAgICAgICBDb25z
dGFudHNNYW5hZ2VyLmdldEluc3RhbmNlKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAuZ2V0TWVzc2FnZXMoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbnZhbGlk
UGF0aChrZXJuZWxQYXJhbUludmFsaWQgPyBDb25zdGFudHNNYW5hZ2VyLmdldEluc3RhbmNlKCkK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRDb25zdGFudHMoKQog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmtlcm5lbEludmFsaWQoKSA6
ICIiLCAvLyROT04tTkxTLTEkCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBrZXJuZWxQYXJhbUludmFsaWQgJiYgaW5ldGRQYXRoSW52YWxpZCA/IENvbnN0YW50c01hbmFn
ZXIuZ2V0SW5zdGFuY2UoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAuZ2V0Q29uc3RhbnRzKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgLm9yKCkgOiAiIiwgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgaW5ldGRQYXRoSW52YWxpZCA/IENvbnN0YW50c01hbmFn
ZXIuZ2V0SW5zdGFuY2UoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAuZ2V0Q29uc3RhbnRzKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgLmluZXRkSW52YWxpZCgpIDogIiIpOyAvLyROT04tTkxTLT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1lbVNpemUpCiAgICAgICAgewogICAgICAgICAgICBtb2RlbC5n
ZXRJbnZhbGlkaXR5UmVhc29ucygpLmFkZChDb25zdGFudHNNYW5hZ2VyLmdldEluc3RhbmNlKCkK
ICAgICAgICAgICAgICAgICAgICAuZ2V0TWVzc2FnZXMoKQogICAgICAgICAgICAgICAgICAgIC5t
YXhNZW1TaXplSXMobWF4TWVtU2l6ZSkpOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChtZW1T
aXplIDwgbWluTWVtU2l6ZSkKICAgICAgICB7CiAgICAgICAgICAgIG1vZGVsLmdldEludmFsaWRp
dHlSZWFzb25zKCkuYWRkKENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKQogICAgICAgICAg
ICAgICAgICAgIC5nZXRNZXNzYWdlcygpCiAgICAgICAgICAgICAgICAgICAgLm1pbk1lbVNpemVJ
cyhtaW5NZW1TaXplKSk7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAg
ICAgIGlzVmFsaWQgPSB0cnVlOwogICAgICAgIH0KCiAgICAgICAgbW9kZWwuc2V0SXNWYWxpZChp
c1ZhbGlkKTsKICAgIH0KCiAgICBwcml2YXRlIE5vdENoYW5nYWJsZUZvclZtSW5Qb29sTGlzdE1v
ZGVsIHBvb2xUeXBlOwoKICAgIHB1YmxpYyBMaXN0TW9kZWwgZ2V0UG9vbFR5cGUoKQogICAgewog
ICAgICAgIHJldHVybiBwb29sVHlwZTsKICAgIH0KCiAgICBwcm90ZWN0ZWQgdm9pZCBzZXRQb29s
VHlwZShOb3RDaGFuZ2FibGVGb3JWbUluUG9vbExpc3RNb2RlbCB2YWx1ZSkKICAgIHsKICAgICAg
ICBwb29sVHlwZSA9IHZhbHVlOwogICAgfQoKICAgIHByaXZhdGUgTm90Q2hhbmdhYmxlRm9yVm1J
blBvb2xFbnRpdHlNb2RlbCBudW1PZkRlc2t0b3BzOwoKICAgIHB1YmxpYyBFbnRpdHlNb2RlbCB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kKICAgICAgICAgICAgICAgIHN1cGVyLnNldElzQ2hhbmdh
YmxlKHZhbHVlKTsKICAgICAgICB9CiAgICB9CgogICAgcHJpdmF0ZSBjbGFzcyBOb3RDaGFuZ2Fi
bGVGb3JWbUluUG9vbEVudGl0eU1vZGVsIGV4dGVuZHMgRW50aXR5TW9kZWwgewogICAgICAgIEBP
dmVycmlkZQogICAgICAgIHB1YmxpYyB2b2lkIHNldElzQ2hhbmdhYmxlKGJvb2xlYW4gdmFsdWUp
IHsKICAgICAgICAgICAgaWYgKCFpc1ZtQXR0YWNoZWRUb1Bvb2woKSkKICAgICAgICAgICAgICAg
IHN1cGVyLnNldElzQ2hhbmdhYmxlKHZhbHVlKTsKICAgICAgICB9CiAgICB9CgogICAgcHJpdmF0
ZSBjbGFzcyBOb3RDaGFuZ2FibGVGb3JWbUluUG9vbEtleVZhbHVlTW9kZWwgZXh0ZW5kcyBLZXlW
YWx1ZU1vZGVsIHsKICAgICAgICBAT3ZlcnJpZGUKICAgICAgICBwdWJsaWMgdm9pZCBzZXRJc0No
YW5nYWJsZShib29sZWFuIHZhbHVlKSB7CiAgICAgICAgICAgIGlmICghaXNWbUF0dGFjaGVkVG9Q
b29sKCkpCiAgICAgICAgICAgICAgICBzdXBlci5zZXRJc0NoYW5nYWJsZSh2YWx1ZSk7CiAgICAg
ICAgfQogICAgfQp9Cg==
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_
Content-Type: application/octet-stream; name="AbstractVmPopupWidget.java"
Content-Description: AbstractVmPopupWidget.java
Content-Disposition: attachment; filename="AbstractVmPopupWidget.java";
size=44510; creation-date="Tue, 12 Mar 2013 08:33:20 GMT";
modification-date="Tue, 12 Mar 2013 08:24:49 GMT"
Content-Transfer-Encoding: base64
cGFja2FnZSBvcmcub3ZpcnQuZW5naW5lLnVpLmNvbW1vbi53aWRnZXQudWljb21tb24ucG9wdXA7
CgppbXBvcnQgamF2YS51dGlsLkFycmF5TGlzdDsKaW1wb3J0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fSBlbHNlIGlmICgiSXNIb3N0VGFiVmFsaWQiLmVxdWFscyhwcm9wTmFt
ZSkpIHsgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAgIGlmIChvYmplY3QuZ2V0SXNI
b3N0VGFiVmFsaWQoKSkgewogICAgICAgICAgICAgICAgICAgICAgICBob3N0VGFiLm1hcmtBc1Zh
bGlkKCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAg
ICAgaG9zdFRhYi5tYXJrQXNJbnZhbGlkKG51bGwpOwogICAgICAgICAgICAgICAgICAgIH0KICAg
ICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgc2V0dXBIb3N0VGFiQXZhaWxhYmlsaXR5KG9i
amVjdCk7CiAgICAgICAgICAgIH0KICAgICAgICB9KTsKCiAgICAgICAgb2JqZWN0LmdldElzQXV0
b0Fzc2lnbigpLmdldFByb3BlcnR5Q2hhbmdlZEV2ZW50KCkuYWRkTGlzdGVuZXIobmV3IElFdmVu
dExpc3RlbmVyKCkgewogICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgcHVibGljIHZv
aWQgZXZlbnRSYWlzZWQoRXZlbnQgZXYsIE9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBhcmdzKSB7
CiAgICAgICAgICAgICAgICBib29sZWFuIGlzQXV0b0Fzc2lnbiA9IChCb29sZWFuKSBvYmplY3Qu
Z2V0SXNBdXRvQXNzaWduKCkuZ2V0RW50aXR5KCk7CiAgICAgICAgICAgICAgICBib29sZWFuIHJ1
blZNT25UcnVzdGVkSG9zdCA9IChCb29sZWFuKSBvYmplY3QuZ2V0UnVuVk1PblRydXN0ZWRIb3N0
KCkuZ2V0RW50aXR5KCk7CiAgICAgICAgICAgICAgICBkZWZhdWx0SG9zdEVkaXRvci5zZXRFbmFi
bGVkKCFpc0F1dG9Bc3NpZ24gJiYgIXJ1blZNT25UcnVzdGVkSG9zdCk7CiAgICAgICAgICA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S5nZXRJc1dpbmRv
d3NPUygpKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIklzR2VuZXJhbFRhYlZhbGlkIi5l
cXVhbHMocHJvcE5hbWUpKSB7IC8vJE5PTi1OTFMtMSQKICAgICAgICAgICAgICAgICAgICBpZiAo
dm0uZ2V0SXNHZW5lcmFsVGFiVmFsaWQoKSkgewogICAgICAgICAgICAgICAgICAgICAgICBnZW5l
cmFsVGFiLm1hcmtBc1ZhbGlkKCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAg
ICAgICAgICAgICAgICAgICAgZ2VuZXJhbFRhYi5tYXJrQXNJbnZhbGlkKG51bGwpOwogICAgICAg
ICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIklzRGlzcGxheVRhYlZh
bGlkIi5lcXVhbHMocHJvcE5hbWUpKSB7IC8vJE5PTi1OTFMtMSQKICAgICAgICAgICAgICAgICAg
ICBpZiAodm0uZ2V0SXNEaXNwbGF5VGFiVmFsaWQoKSkgewogICAgICAgICAgICAgICAgICAgICAg
ICBjb25zb2xlVGFiLm1hcmtBc1ZhbGlkKCk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsK
ICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZVRhYi5tYXJrQXNJbnZhbGlkKG51bGwpOwog
ICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIklzQWxsb2Nh
dGlvblRhYlZhbGlkIi5lcXVhbHMocHJvcE5hbWUpKSB7IC8vJE5PTi1OTFMtMSQKICAgICAgICAg
ICAgICAgICAgICBpZiAodm0uZ2V0SXNBbGxvY2F0aW9uVGFiVmFsaWQoKSkgewogICAgICAgICAg
ICAgICAgICAgICAgICByZXNvdXJjZUFsbG9jYXRpb25UYWIubWFya0FzVmFsaWQoKTsKICAgICAg
ICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICByZXNvdXJjZUFs
bG9jYXRpb25UYWIubWFya0FzSW52YWxpZChudWxsKTsKICAgICAgICAgICAgICAgICAgICB9CiAg
ICAgICAgICAgICAgICB9IGVsc2UgaWYgKCJJc0hpZ2hseUF2YWlsYWJsZSIuZXF1YWxzKHByb3BO
YW1lKSkgeyAvLyROT04tTkxTLTEkCiAgICAgICAgICAgICAgICAgICAgaGlnaEF2YWlsYWJpbGl0
eVRhYi5zZXRWaXNpYmxlKChCb29sZWFuKSB2bS5nZXRJc0hpZ2hseUF2YWlsYWJsZSgpLmdldEVu
dGl0eSgpKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIklzQm9vdFNlcXVlbmNlVGFiVmFs
aWQiLmVxdWFscyhwcm9wTmFtZSkpIHsgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAg
IGlmICgoQm9vbGVhbikgdm0uZ2V0SXNIaWdobHlBdmFpbGFibGUoKS5nZXRFbnRpdHkoKSkgewog
ICAgICAgICAgICAgICAgICAgICAgICBib290T3B0aW9uc1RhYi5tYXJrQXNWYWxpZCgpOwogICAg
ICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGJvb3RPcHRp
b25zVGFiLm1hcmtBc0ludmFsaWQobnVsbCk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAg
ICAgICAgICAgfSBlbHNlIGlmICgiSXNDdXN0b21Qcm9wZXJ0aWVzVGFiVmFsaWQiLmVxdWFscyhw
cm9wTmFtZSkpIHsgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAgIGlmICh2bS5nZXRJ
c0N1c3RvbVByb3BlcnRpZXNUYWJWYWxpZCgpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGN1
c3RvbVByb3BlcnRpZXNUYWIubWFya0FzVmFsaWQoKTsKICAgICAgICAgICAgICAgICAgICB9IGVs
c2UgewogICAgICAgICAgICAgICAgICAgICAgICBjdXN0b21Qcm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Ag
ICAgIHB1YmxpYyB2b2lkIG9uQ2xpY2soQ2xpY2tFdmVudCBldmVudCkgewogICAgICAgICAgICAg
ICAgZGVmYXVsdEhvc3RFZGl0b3Iuc2V0RW5hYmxlZChmYWxzZSk7CiAgICAgICAgICAgIH0KICAg
ICAgICB9LCBDbGlja0V2ZW50LmdldFR5cGUoKSk7CgogICAgICAgIHZtLmdldElzQXV0b0Fzc2ln
bigpLmdldEVudGl0eUNoYW5nZWRFdmVudCgpLmFkZExpc3RlbmVyKG5ldyBJRXZlbnRMaXN0ZW5l
cigpIHsKCiAgICAgICAgICAgIEBPdmVycmlkZQogICAgICAgICAgICBwdWJsaWMgdm9pZCBldmVu
dFJhaXNlZChFdmVudCBldiwgT2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGFyZ3MpIHsKICAgICAg
ICAgICAgICAgIGlmICghaXNBdXRvQXNzaWduRWRpdG9yLmFzUmFkaW9CdXR0b24oKS5nZXRWYWx1
ZSgpICYmICFydW5WTU9uVHJ1c3RlZEhvc3RFZGl0b3IuYXNSYWRpb0J1dHRvbigpLmdldFZhbHVl
KCkpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgc3BlY2lmaWNIb3N0LnNl
dFZhbHVlKHRydWUsIHRydWUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAg
ICAgfSk7CgogICAgICAgIC8qcnVuVk1PblRydXN0ZWRIb3N0RWRpdG9yLmFkZERvbUhhbmRsZXIo
bmV3IENsaWNrSGFuZGxlcigpIHsKICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgIHB1
YmxpYyB2b2lkIG9uQ2xpY2soQ2xpY2tFdmVudCBldmVudCkgewogICAgICAgICAgICAgICAgZGVm
YXVsdEhvc3RFZGl0b3Iuc2V0RW5hYmxlZChmYWxzZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9
LCBDbGlja0V2ZW50LmdldFR5cGUoKSk7CgogICAgICAgIHZtLm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aGVkRWRpdG9yLnNldFRhYkluZGV4KG5leHRU
YWJJbmRleCsrKTsKICAgICAgICBjZEltYWdlRWRpdG9yLnNldFRhYkluZGV4KG5leHRUYWJJbmRl
eCsrKTsKICAgICAgICBrZXJuZWxfcGF0aEVkaXRvci5zZXRUYWJJbmRleChuZXh0VGFiSW5kZXgr
Kyk7CiAgICAgICAgaW5pdHJkX3BhdGhFZGl0b3Iuc2V0VGFiSW5kZXgobmV4dFRhYkluZGV4Kysp
OwogICAgICAgIGtlcm5lbF9wYXJhbWV0ZXJzRWRpdG9yLnNldFRhYkluZGV4KG5leHRUYWJJbmRl
eCsrKTsKCiAgICAgICAgLy8gPT1DdXN0b20gUHJvcGVydGllcyBUYWI9PQogICAgICAgIG5leHRU
YWJJbmRleCA9IGN1c3RvbVByb3BlcnRpZXNUYWIuc2V0VGFiSW5kZXhlcyhuZXh0VGFiSW5kZXgp
OwovLyAgICAgICAgY3VzdG9tUHJvcGVydGllc1NoZWV0RWRpdG9yLnNldFRhYkluZGV4KG5leHRU
YWJJbmRleCsrKTsKCiAgICAgICAgcmV0dXJuIG5leHRUYWJJbmRleDsKICAgIH0KfQo=
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_
Content-Type: application/octet-stream; name="VmListModel.java"
Content-Description: VmListModel.java
Content-Disposition: attachment; filename="VmListModel.java"; size=114678;
creation-date="Tue, 12 Mar 2013 08:37:27 GMT";
modification-date="Tue, 12 Mar 2013 08:29:15 GMT"
Content-Transfer-Encoding: base64
cGFja2FnZSBvcmcub3ZpcnQuZW5naW5lLnVpLnVpY29tbW9ud2ViLm1vZGVscy52bXM7CgppbXBv
cnQgamF2YS51dGlsLkFycmF5TGlzdDsKaW1wb3J0IGphdmEudXRpbC5BcnJheXM7CmltcG9ydCBq
YXZhLnV0aWwuSGFzaE1hcDsKaW1wb3J0IGphdmEudXRpbC5MaW5rZWRMaXN0OwppbXBvcnQgamF2
YS51dGlsLkxpc3Q7CmltcG9ydCBqY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cDxWZXJzaW9uLCBBcnJheUxpc3Q8U3RyaW5nPj4oKSk7CiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgSGFzaE1hcDxWZXJzaW9uLCBTdHJpbmc+IGRpY3Rpb25hcnkgPSAoSGFz
aE1hcDxWZXJzaW9uLCBTdHJpbmc+KSByZXR1cm5WYWx1ZTsKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBmb3IgKE1hcC5FbnRyeTxWZXJzaW9uLCBTdHJpbmc+IGtleVZhbHVlUGFpciA6
IGRpY3Rpb25hcnkuZW50cnlTZXQoKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldEN1c3RvbVByb3Bl
cnRpZXNLZXlzTGlzdCgpLnB1dChrZXlWYWx1ZVBhaXIuZ2V0S2V5KCksCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxTdHJpbmc+KCkpOwog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKFN0cmluZyBzIDoga2V5VmFs
dWVQYWlyLmdldFZhbHVlKCkuc3BsaXQoIls7XSIsIC0xKSkgLy8kTk9OLU5MUy0xJAogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBtb2RlbC5nZXRDdXN0b21Qcm9wZXJ0aWVzS2V5c0xpc3QoKS5nZXQoa2V5
VmFsdWVQYWlyLmdldEtleSgpKS5hZGQocyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAg
ICAgICB9KSk7CiAgICAgICAgfQoKICAgICAgICAvLyBDYWxsICdJc0NvbW1hbmRDb21wYXRpYmxl
JyBmb3IgcHJlY2FjaGluZwogICAgICAgIEFzeW5jRGF0YVByb3ZpZGVyLklzQ29tbWFuZENvbXBh
dGlibGUobmV3IEFzeW5jUXVlcnkodGhpcywKICAgICAgICAgICAgICAgIG5ldyBJTmV3QXN5bmND
YWxsYmFjaygpIHsKICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgICAg
ICAgICBwdWJsaWMgdm9pZCBPblN1Y2Nlc3MoT2JqZWN0IHRhcmdldCwgT2JqZWN0IHJldHVyblZh
bHVlKSB7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSksIG51bGwsIG51
bGwsIG51bGwpOwogICAgfQoKICAgIHByaXZhdGUgdm9pZCBBc3NpZ25UYWdzKCkKICAgIHsKICAg
ICAgICBpZiAoZ2V0V2luZG93KCkgIT0gbnVsbCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVy
bjsKICAgICAgICB9CgogICAgICAgIFRhZ0xpc3RNb2RlbCBtb2RlbCA9IG5ldyBUYWdMaXN0TW9k
ZWwoKTsKICAgICAgICBzZXRXaW5kb3cobW9kZWwpOwogICAgICAgIG1vZGVsLnNldFRpdGxlKENv
bnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKS5nZXRDb25zdGFudHMoKS5hc3NpZ25UYWdzVGl0
bGUoKSk7CiAgICAgICAgbW9kZWwuc2V0SGFzaE5hbWUoImFzc2lnbl90YWdzX3ZtcyIpOyAvLyRO
T04tTkxTLTEkCgogICAgICAgIEdldEF0dGFjaGVkVGFnc1RvU2VsZWN0ZWRWTXMobW9kZWwpOwoK
ICAgICAgICBVSUNvbW1hbmQgdGVtcFZhciA9IG5ldyBVSUNvbW1hbmQoIk9uQXNzaWduVGFncyIs
IHRoaXMpOyAvLyROT04tTkxTLTEkCiAgICAgICAgdGVtcFZhci5zZXRUaXRsZShDb25zdGF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1vbi5idXNpbmVzc2VudGl0aWVzLnRhZ3M+KSByZXR1
cm5WYWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbC5zZWxlY3Rl
ZEl0ZW1zQ291bnRlcisrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZtTGlzdE1v
ZGVsLnNlbGVjdGVkSXRlbXNDb3VudGVyID09IHZtTGlzdE1vZGVsLmdldFNlbGVjdGVkSXRlbXMo
KS5zaXplKCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgUG9zdEdldEF0dGFjaGVkVGFncyh2bUxpc3RNb2RlbCwgdGFnTGlzdE1v
ZGVsKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAg
ICAgIH0KICAgICAgICAgICAgICAgICAgICB9KSwKICAgICAgICAgICAgICAgICAgICBpZCk7CiAg
ICAgICAgfQogICAgfQoKICAgIHByaXZhdGUgdm9pZCBQb3N0R2V0QXR0YWNoZWRUYWdzKFZtTGlz
dE1vZGVsIHZtTGlzdE1vZGVsLCBUYWdMaXN0TW9kZWwgdGFnTGlzdE1vZGVsKQogICAgewogICAg
ICAgIGlmICh2bUxpc3RNb2RlbC5nZXRMYXN0RXhlY3V0ZWRDb21tYW5kKCkgPT0gZ2V0QXNzaWdu
VGFnc0NvbW1hbmQoKSkKICAgICAgICB7CiAgICAgICAgICAgIEFycmF5TGlzdDxvcmcub3ZpcnQu
ZW5naW5lLmNvcmUuY29tbW9uLmJ1c2luZXNzZW50aXRpZXMudGFncz4gYXR0YWNoZWRUYWdzID0K
ICAgICAgICAgICAgICAgICAgICBMaW5xLkRpc3RpbmN0KHZtTGlzdE1vZGVsLmFsbEF0dGFjaGVk
VGFncywgbmV3IFRhZ3NFcXVhbGl0eUNvbXBhcmVyKCkpOwogICAgICAgICAgICBmb3IgKG9yZy5v
dmlydC5lb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pOwogICAgICAgICAgICAgICAgc3BpY2VDb25zb2xlTW9kZWwuZ2V0RXJyb3JF
dmVudCgpLmFkZExpc3RlbmVyKHRoaXMpOwogICAgICAgICAgICAgICAgVm5jQ29uc29sZU1vZGVs
IHZuY0NvbnNvbGVNb2RlbCA9IG5ldyBWbmNDb25zb2xlTW9kZWwoKTsKICAgICAgICAgICAgICAg
IHZuY0NvbnNvbGVNb2RlbC5zZXRNb2RlbCh0aGlzKTsKICAgICAgICAgICAgICAgIFJkcENvbnNv
bGVNb2RlbCByZHBDb25zb2xlTW9kZWwgPSBuZXcgUmRwQ29uc29sZU1vZGVsKCk7CgogICAgICAg
ICAgICAgICAgY2FjaGVkQ29uc29sZU1vZGVscy5wdXQodm0uZ2V0SWQoKSwKICAgICAgICAgICAg
ICAgICAgICAgICAgbmV3IEFycmF5TGlzdDxDb25zb2xlTW9kZWw+KEFycmF5cy5hc0xpc3QobmV3
IENvbnNvbGVNb2RlbFtdIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGljZUNv
bnNvbGVNb2RlbCwgdm5jQ29uc29sZU1vZGVsLCByZHBDb25zb2xlTW9kZWwgfSkpKTsKICAgICAg
ICAgICAgfQoKICAgICAgICAgICAgQXJyYXlMaXN0PENvbnNvbGVNb2RlbD4gY2FjaGVkTW9kZWxz
ID0gY2FjaGVkQ29uc29sZU1vZGVscy5nZXQodm0uZ2V0SWQoKSk7CiAgICAgICAgICAgIGZvciAo
Q29uc29sZU1vZGVsIGEgOiBjYWNoZWRNb2RlbHMpCiAgICAgICAgICAgIHsKICAgICAgICAgICAg
ICAgIGEuc2V0RW50aXR5KG51bGwpOwogICAgICAgICAgICAgICAgYS5zZXRFbnRpdHkodm0pOwog
ICAgICAgICAgICB9CgogICAgICAgICAgICBzZXREZWZhdWx0Q29uc29sZU1vZGVsKHZtLmdldERp
c3BsYXlUeXBlKCkgPT0gRGlzcGxheVR5cGUudm5jID8gY2FjaGVkTW9kZWxzLmdldCgxKSA6IGNh
Y2hlZE1vZGVscy5nZXQoMCkpOwoKICAgICAgICAgICAgaWYgKEFzeW5jRGF0YVByb3ZpZGVyLklz
V2luZG93c09zVHlwZSh2bS5nZXRWbU9zKCkpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAg
ICBmb3IgKENvbnNvbGVNb2RlbCBhIDogY2FjaGVkTW9kZWxzKQogICAgICAgICAgICAgICAgewog
ICAgICAgICAgICAgICAgICAgIGlmIChhIGluc3RhbmNlb2YgUmRwQ29uc29sZU1vZGVsKQogICAg
ICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgc2V0QWRkaXRpb25hbENv
bnNvbGVNb2RlbChhKTsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAg
ICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgc2V0SGFzQWRkaXRp
b25hbENvbnNvbGVNb2RlbCh0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlCiAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHNldEFkZGl0aW9uYWxDb25zb2xlTW9kZWwobnVs
bCk7CiAgICAgICAgICAgICAgICBzZXRIYXNBZGRpdGlvbmFsQ29uc29sZU1vZGVsKGZhbHNlKTsK
ICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICBwdWJsaWMgQXJyYXlMaXN0PENvbnNv
bGVNb2RlbD4gR2V0Q29uc29sZU1vZGVsc0J5Vm1HdWlkKEd1aWQgdm1HdWlkKQogICAgewogICAg
ICAgIGlmIChjYWNoZWRDb25zb2xlTW9kZWxzICE9IG51bGwgJiYgY2FjaGVkQ29uc29sZU1vZGVs
cy5jb250YWluc0tleSh2bUd1aWQpKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuIGNhY2hl
ZENvbnNvbGVNb2RlbHMuZ2V0KHZtR3VpZCk7CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gbnVs
bDsK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E11
bHRpcGxlUXVlcnlBc3luY0NhbGxiYWNrKCkgewogICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAg
ICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBFeGVjdXRlZChGcm9udGVuZE11bHRpcGxlUXVlcnlB
c3luY1Jlc3VsdCByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsg
aSA8IHJlc3VsdC5nZXRSZXR1cm5WYWx1ZXMoKS5zaXplKCk7IGkrKykgewogICAgICAgICAgICAg
ICAgICAgICAgICBpZiAocmVzdWx0LmdldFJldHVyblZhbHVlcygpLmdldChpKS5nZXRTdWNjZWVk
ZWQoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgR3VpZCB2bUlkID0gKChHZXRBbGxE
aXNrc0J5Vm1JZFBhcmFtZXRlcnMpIHJlc3VsdC5nZXRQYXJhbWV0ZXJzKCkuZ2V0KGkpKS5nZXRW
bUlkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0UmVtb3ZlRGlza3NDaGVjYm94
ZXNQb3N0KHZtSWQsIChMaXN0PERpc2s+KSByZXN1bHQuZ2V0UmV0dXJuVmFsdWVzKCkuZ2V0KGkp
LmdldFJldHVyblZhbHVlKCkpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAg
ICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAg
ICB9CgogICAgcHJpdmF0ZSB2b2lkIGluaXRSZW1vdmVEaXNrc0NoZWNib3hlc1Bvc3QoR3VpZCB2
bUlkLCBMaXN0PERpc2s+IGRpc2tzKSB7CiAgICAgICAgRW50aXR5TW9kZWwgbW9kZWwgPSB2bXNS
ZW1vdmVNYXAuZ2V0KHZtSWQpOwogICAgICAgIGlmIChkaXNrcy5pc0VtcHR5KCkpIHsKICAgICAg
ICAgICAgdXBkYXRlUmVtb3ZlRGlza3NDaGVja0JveChtb2RlbCwgZmFsc2UsIGZhbHNlLCBDb25z
dGFudHNNYW5hZ2VyLmdldEluc3RhbmNlKCkKICAgICAgICAgICAgICAgICAgICAuZ2V0Q29uc3Rh
bnRzKCkKICAgICAgICAgICAgICAgICAgICAucmVtb3ZlVm1EaXNrc05vRGlza3NNc2coKSk7CiAg
ICAgICAgICAgIHJldHVybjsKICAgICAgICB9CgogICAgICAgIGJvb2xlYW4gaXNPbmx5U2hhcmVk
RGlza3MgPSB0cnVlOwogICAgICAgIGJvb2xlYW4gaXNTbmFwc2hvdEV4aXN0cyA9IGZhbHNlOwog
ICAgICAgIGZvciAoRGlzayBkaXNrIDogZGlza3MpIHsKICAgICAgICAgICAgaWYgKCFkaXNrLmlz
U2hhcmVhYmxlKCkpIHsKICAgICAgICAgICAgICAgIGlzT25seVNoYXJlZERpc2tzID0gZmFsc2U7
CiAgICAgICAgICAgICAgICBpZiAoZGlzay5nZXREaXNrU3RvcmFnZVR5cGUoKSA9PSBEaXNrU3Rv
cmFnZVR5cGUuSU1BR0UpIHsKICAgICAgICAgICAgICAgICAgICBpZiAoKChEaXNrSW1hZ2UpIGRp
c2spLmdldFNuYXBzaG90cygpLnNpemUoKSA+IDEpIHsKICAgICAgICAgICAgICAgICAgICAgICAg
aXNTbmFwc2hvdEV4aXN0cyA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwog
ICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAg
ICAgIH0KCiAgICAgICAgaWYgKGlzU25hcHNob3RFeGlzdHMpIHsKICAgICAgICAgICAgdXBkYXRl
UmVtb3ZlRGlza3NDaGVja0JveChtb2RlbCwgdHJ1ZSwgZmFsc2UsIENvbnN0YW50c01hbmFnZXIu
Z2V0SW5zdGFuY2UoKQogICAgICAgICAgICAgICAgICAgIC5nZXRDb25zdGFudHMoKQogICAgICAg
ICAgICAgICAgICAgIC5yZW1vdmVWbURpc2tzU25hcHNob3RzTXNnKCkpOwogICAgICAgICAgICBy
ZXR1cm47CiAgICAgICAgfQoKICAgICAgICBpZiAoaXNPbmx5U2hhcmVkRGlza3MpIHsKICAgICAg
ICAgICAgdXBkYXRlUmVtb3ZlRGlza3NDaGVja0JveChtb2RlbCwgZmFsc2UsIGZhbHNlLCBDb25z
dGFudHNNYW5hZ2VyLmdldEluc3RhbmNlKCkKICAgICAgICAgICAgICAgICAgICAuZ2V0Q29uc3Rh
bnRzKCkKICAgICAgICAgICAgICAgICAgICAucmVtb3ZlVm1EaXNrc0FsbFNoYXJlZE1zZygpKTsK
ICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgIH0KCiAgICBwcml2YXRlIHZvaWQgTW92
ZSgpCiAgICB7CiAgICAgICAgVk0gdm0gPSAoVk0pIGdldFNlbGVjdGVkSXRlbSgpOwogICAgICAg
IGlmICh2bSA9PSBudWxsKQogICAgICAgIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0K
CiAgICAgICAgaWYgKGdldFdpbmRvdygpICE9IG51bGwpCiAgICAgICAgewogICAgICAgICAgICBy
ZXR1cm47CiAgICAgICAgfQoKICAgICAgICBNb3ZlRGlza01vZGVsIG1vZGVsID0gbmV3IE1vdmVE
aXNrTW9kZWwoKTsKICAgICAgICBzZXRXaW5kb3cobW9kZWwpOwogICAgICAgIG1vZGVsLnNldFRp
dGxlKENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKS5nZXRDb25zdGFudHMoKS5tb3ZlVmly
dHVhbE1hY2hpbmVUaXRsZSgpKTsKICAgICAgICBtb2RlbC5zZXRIYXNoTmFtZSgibW92ZV92aXJ0
dWFsX21hY2hpbmUiKTsgLy8kTk9OLU5MUy0xJAogICAgICAgIG1vZGVsLnNldElzU291cmNlU3Rv
cmFnZURvbWFpbk5hbWVBdmFpbGFibGUodHJ1ZSk7CiAgICAgICAgbW9kZWwuc2V0RW50aXR5KHRo
aXMpOwogICAgICAgIG1vZGVsLlN0YXJ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hcmdldDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhc2hNYXA8Vm1U
ZW1wbGF0ZSwgQXJyYXlMaXN0PERpc2tJbWFnZT4+IHRlbXBsYXRlc0Rpc2tTZXQgPQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSGFzaE1hcDxWbVRlbXBsYXRlLCBBcnJheUxp
c3Q8RGlza0ltYWdlPj4pIHJldHVyblZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAg
SGFzaE1hcDxTdHJpbmcsIEFycmF5TGlzdDxTdHJpbmc+PiB0ZW1wbGF0ZURpYyA9CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBIYXNoTWFwPFN0cmluZywgQXJyYXlMaXN0
PFN0cmluZz4+KCk7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgcmVs
ZXZhbnQgdGVtcGxhdGVzIGFyZSBhbHJlYWR5IHRoZXJlCiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICBmb3IgKE9iamVjdCBzZWxlY3RlZEl0ZW0gOiB2bUxpc3RNb2RlbC5nZXRTZWxlY3RlZEl0
ZW1zKCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgVk0gdm0gPSAoVk0pIHNlbGVjdGVkSXRlbTsKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBib29sZWFuIGhhc01hdGNoID0gZmFsc2U7CiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgZm9yIChWbVRlbXBsYXRlIGEgOiB0ZW1wbGF0ZXNEaXNrU2V0LmtleVNl
dCgpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgaWYgKHZtLmdldFZtdEd1aWQoKS5lcXVhbHMoYS5nZXRJZCgpKSkK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgaGFzTWF0Y2ggPSB0cnVlOwogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIGlmICghdm0uZ2V0Vm10R3VpZCgpLmVxdWFscyhOR3VpZC5FbXB0
eSkgJiYgIWhhc01hdGNoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0ZW1wbGF0ZURpYy5jb250YWluc0tl
eSh2bS5nZXRWbXROYW1lKCkpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZURpYy5wdXQo
dm0uZ2V0Vm10TmFtZSgpLCBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKSk7CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgdGVtcGxhdGVEaWMuZ2V0KHZtLmdldFZtdE5hbWUoKSkuYWRkKHZtLmdldFZtTmFtZSgpKTsK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRlbXBTdHI7CiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBBcnJheUxpc3Q8U3RyaW5nPiB0ZW1wTGlzdDsKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxTdHJpbmc+IG1pc3NpbmdUZW1wbGF0ZXMg
PSBuZXcgQXJyYXlMaXN0PFN0cmluZz4oKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZv
ciAoTWFwLkVudHJ5PFN0cmluZywgQXJyYXlMaXN0PFN0cmluZz4+IGtleVZhbHVlUGFpciA6IHRl
bXBsYXRlRGljLmVudHJ5U2V0KCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcExpc3QgPSBrZXlWYWx1ZVBhaXIuZ2V0VmFs
dWUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wU3RyID0gIlRlbXBsYXRl
ICIgKyBrZXlWYWx1ZVBhaXIuZ2V0S2V5KCkgKyAiIChmb3IgIjsgLy8kTk9OLU5MUy0xJCAvLyRO
T04tTkxTLTIkCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGk7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHRlbXBMaXN0LnNpemUoKSAt
IDE7IGkrKykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHRlbXBTdHIgKz0gdGVtcExpc3QuZ2V0KGkpICsgIiwgIjsg
Ly8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICB0ZW1wU3RyICs9IHRlbXBMaXN0LmdldChpKSArICIpIjsg
Ly8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pc3NpbmdUZW1w
bGF0ZXMuYWRkKHRlbXBTdHIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHZtTGlzdE1vZGVsLlBvc3RFeHBvcnRHZXRNaXNzaW5nVG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XRlc0Zyb21WbXMgPT0gbnVsbCA/
IENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKQogICAgICAgICAgICAgICAgICAgICAgICAu
Z2V0Q29uc3RhbnRzKCkKICAgICAgICAgICAgICAgICAgICAgICAgLmNvdWxkTm90UmVhZFRlbXBs
YXRlc0Zyb21FeHBvcnREb21haW5Nc2coKQogICAgICAgICAgICAgICAgICAgICAgICA6IENvbnN0
YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IC5nZXRDb25zdGFudHMoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVGb2xs
b3dpbmdUZW1wbGF0ZXNBcmVNaXNzaW5nT25UYXJnZXRFeHBvcnREb21haW5Nc2coKSk7CiAgICAg
ICAgICAgICAgICBjb25maXJtTW9kZWwuc2V0SXRlbXMobWlzc2luZ1RlbXBsYXRlc0Zyb21WbXMp
OwoKICAgICAgICAgICAgICAgIFVJQ29tbWFuZCB0ZW1wVmFyID0gbmV3IFVJQ29tbWFuZCgiT25F
eHBvcnROb1RlbXBsYXRlcyIsIHRoaXMpOyAvLyROT04tTkxTLTEkCiAgICAgICAgICAgICAgICB0
ZW1wVmFyLnNldFRpdGxlKENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKS5nZXRDb25zdGFu
dHMoKS5vaygpKTsKICAgICAgICAgICAgICAgIHRlbXBWYXIuc2V0SXNEZWZhdWx0KHRydWUpOwog
ICAgICAgICAgICAgICAgY29uZmlybU1vZGVsLmdldENvbW1hbmRzKCkuYWRkKHRlbXBWYXIpOwog
ICAgICAgICAgICAgICAgVUlDb21tYW5kIHRlbXBWYXIyID0gbmV3IFVJQ29tbWFuZCgiQ2FuY2Vs
Q29uZmlybWF0aW9uIiwgdGhpcyk7IC8vJE5PTi1OTFMtMSQKICAgICAgICAgICAgICAgIHRlbXBW
YXIyLnNldFRpdGxlKENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKS5nZXRDb25zdGFudHMo
KS5jYW5jZWwoKSk7CiAgICAgICAgICAgICAgICB0ZW1wVmFyMi5zZXRJc0NhbmNlbCh0cnVlKTsK
ICAgICAgICAgICAgICAgIGNvbmZpcm1Nb2RlbC5nZXRDb21tYW5kcygpLmFkZCh0ZW1wVmFyMik7
CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAg
ICAgICBpZiAobW9kZWwuZ2V0UHJvZ3Jlc3MoKSAhPSBudWxsKQogICAgICAgICAgICAgICAgewog
ICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAg
ICAgICBtb2RlbC5TdGFydFByb2dyZXNzKG51bGwpOwoKICAgICAgICAgICAgICAgIEZyb250ZW5k
LlJ1bk11bHRpcGxlQWN0aW9uKFZkY0FjdGlvblR5cGUuRXhwb3J0Vm0sIHBhcmFtZXRlcnMsCiAg
ICAgICAgICAgICAgICAgICAgICAgIG5ldyBJRnJvbnRlbmRNdWx0aXBsZUFjdGlvbkFzeW5jQ2Fs
bGJhY2soKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIEV4ZWN1dGVkKEZyb250ZW5kTXVsdGlwbGVB
Y3Rpb25Bc3luY1Jlc3VsdCByZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBFeHBvcnRWbU1vZGVsIGxvY2FsTW9kZWwgPSAoRXhwb3J0Vm1Nb2RlbCkgcmVzdWx0LmdldFN0
YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxNb2RlbC5TdG9wUHJv
Z3Jlc3MoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW5jZWwoKTsKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfSwgbW9kZWwp
OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAg
ICAgIGlmIChtb2RlbC5nZXRQcm9ncmVzcygpICE9IG51bGwpCiAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZm9yIChWZGNBY3Rp
b25QYXJhbWV0ZXJzQmFzZSBpdGVtIDogcGFyYW1ldGVycykKICAgICAgICAgICAgewogICAgICAg
ICAgICAgICAgTW92ZVZtUGFyYW1ldGVycyBwYXJhbWV0ZXIgPSAoTW92ZVZtUGFyYW1ldGVycykg
aXRlbTsKICAgICAgICAgICAgICAgIHBhcmFtZXRlci5zZXRUZW1wbGF0ZU11c3RFeGlzdHMoZmFs
c2UpOwogICAgICAgICAgICB9CgogICAgICAgICAgICBtb2RlbC5TdGFydFByb2dyZXNzKG51bGwp
OwoKICAgICAgICAgICAgRnJvbnRlbmQuUnVuTXVsdGlwbGVBY3Rpb24oVmRjQWN0aW9uVHlwZS5F
eHBvcnRWbSwgcGFyYW1ldGVycywKICAgICAgICAgICAgICAgICAgICBuZXcgSUZyb250ZW5kTXVs
dGlwbGVBY3Rpb25Bc3luY0NhbGxiYWNrKCkgewogICAgICAgICAgICAgICAgICAgICAgICBAT3Zl
cnJpZGUKICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgRXhlY3V0ZWQoRnJvbnRl
bmRNdWx0aXBsZUFjdGlvbkFzeW5jUmVzdWx0IHJlc3VsdCkgewogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgRXhwb3J0Vm1Nb2RlbCBsb2NhbE1vZGVsID0gKEV4cG9ydFZtTW9kZWwpIHJlc3Vs
dC5nZXRTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jYWxNb2RlbC5TdG9w
UHJvZ3Jlc3M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pLCBfYXN5bmNRdWVyeSk7CiAgICB9CgogICAgcHJpdmF0ZSB2b2lkIFJ1bk9u
Y2VVcGRhdGVEb21haW5zKCkKICAgIHsKICAgICAgICBSdW5PbmNlTW9kZWwgbW9kZWwgPSAoUnVu
T25jZU1vZGVsKSBnZXRXaW5kb3coKTsKCiAgICAgICAgLy8gVXBkYXRlIERvbWFpbiBsaXN0CiAg
ICAgICAgQXN5bmNEYXRhUHJvdmlkZXIuR2V0RG9tYWluTGlzdChuZXcgQXN5bmNRdWVyeShtb2Rl
bCwKICAgICAgICAgICAgICAgIG5ldyBJTmV3QXN5bmNDYWxsYmFjaygpIHsKICAgICAgICAgICAg
ICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBPblN1Y2Nl
c3MoT2JqZWN0IHRhcmdldCwgT2JqZWN0IHJldHVyblZhbHVlKSB7CgogICAgICAgICAgICAgICAg
ICAgICAgICBSdW5PbmNlTW9kZWwgcnVuT25jZU1vZGVsID0gKFJ1bk9uY2VNb2RlbCkgdGFyZ2V0
OwogICAgICAgICAgICAgICAgICAgICAgICBMaXN0PFN0cmluZz4gZG9tYWlucyA9IChMaXN0PFN0
cmluZz4pIHJldHVyblZhbHVlOwogICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgb2xkRG9t
YWluID0gKFN0cmluZykgcnVuT25jZU1vZGVsLmdldFN5c1ByZXBEb21haW5OYW1lKCkuZ2V0U2Vs
ZWN0ZWRJdGVtKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvbGREb21haW4gIT0gbnVs
bCAmJiAhb2xkRG9tYWluLmVxdWFscygiIikgJiYgIWRvbWFpbnMuY29udGFpbnMob2xkRG9tYWlu
KSkgLy8kTk9OLU5MUy0xJAogICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBkb21haW5zLmFkZCgwLCBvbGREb21haW4pOwogICAgICAgICAgICAgICAg
ICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bk9uY2VNb2RlbC5nZXRTeXNQcmVw
RG9tYWluTmFtZSgpLnNldEl0ZW1zKGRvbWFpbnMpOwogICAgICAgICAgICAgICAgICAgICAgICBT
dHJpbmcgc2VsZWN0ZWREb21haW4gPSAob2xkRG9tYWluICE9IG51bGwpID8gb2xkRG9tYWluIDog
TGlucS5GaXJzdE9yRGVmYXVsdChkb21haW5zKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWYg
KCFTdHJpbmdIZWxwZXIuc3RyaW5nc0VxdWFsKHNlbGVjdGVkRG9tYWluLCAiIikpIC8vJE5PTi1O
TFMtMSQKICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgcnVuT25jZU1vZGVsLmdldFN5c1ByZXBEb21haW5OYW1lKCkuc2V0U2VsZWN0ZWRJdGVtKHNl
bGVjdGVkRG9tYWluKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAg
ICAgICB9CiAgICAgICAgICAgICAgICB9KSwgdHJ1ZSk7CiAgICB9CgogICAgcHVibGljIHZvaWQg
UnVuT25jZVVwZGF0ZUZsb3BweShWTSB2bSwgQXJyYXlMaXN0PFN0cmluZz4gaW1hZ2VzKQogICAg
ewogICAgICAgIFJ1bk9uY2VNb2RlbCBtb2RlbCA9IChSdW5PbmNlTW9kZWwpIGdldFdpbmRvdygp
OwoKICAgICAgICBpZiAoQXN5bmNEYXRhUHJvdmlkZXIuSXNXaW5kb3dzT3NUeXBlKHZtLmdldFZt
T3MoKSkpCiAgICAgICAgewogICAgICAgICAgICAvLyBBZGQgYSBwc2V1ZG8gZmxvcHB5IGRpc2sg
aW1hZ2UgdXNlZCBmb3IgV2luZG93cycgc3lzcHJlcC4KICAgICAgICAgICAgaWYgKCF2bS5pc0lu
aXRpYWxpemVkKCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGltYWdlcy5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AgIFVuaXRWbU1v
ZGVsIG1vZGVsID0gKFVuaXRWbU1vZGVsKSBnZXRXaW5kb3coKTsKICAgICAgICBWTSB2bSA9IChW
TSkgZ2V0U2VsZWN0ZWRJdGVtKCk7CiAgICAgICAgaWYgKHZtID09IG51bGwpCiAgICAgICAgewog
ICAgICAgICAgICBDYW5jZWwoKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KCiAgICAg
ICAgaWYgKG1vZGVsLmdldFByb2dyZXNzKCkgIT0gbnVsbCkKICAgICAgICB7CiAgICAgICAgICAg
IHJldHVybjsKICAgICAgICB9CgogICAgICAgIGlmICghbW9kZWwuVmFsaWRhdGUoKSkKICAgICAg
ICB7CiAgICAgICAgICAgIG1vZGVsLnNldElzVmFsaWQoZmFsc2UpOwogICAgICAgIH0KICAgICAg
ICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBTdHJpbmcgbmFtZSA9IChTdHJpbmcpIG1vZGVs
LmdldE5hbWUoKS5nZXRFbnRpdHkoKTsKCiAgICAgICAgICAgIC8vIENoZWNrIG5hbWUgdW5pY2l0
YXRlLgogICAgICAgICAgICBBc3luY0RhdGFQcm92aWRlci5Jc1RlbXBsYXRlTmFtZVVuaXF1ZShu
ZXcgQXN5bmNRdWVyeSh0aGlzLAogICAgICAgICAgICAgICAgICAgIG5ldyBJTmV3QXN5bmNDYWxs
YmFjaygpIHsKICAgICAgICAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAg
ICAgICAgICAgIHB1YmxpYyB2b2lkIE9uU3VjY2VzcyhPYmplY3QgdGFyZ2V0LCBPYmplY3QgcmV0
dXJuVmFsdWUpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBWbUxpc3RNb2RlbCB2bUxp
c3RNb2RlbCA9IChWbUxpc3RNb2RlbCkgdGFyZ2V0OwogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgYm9vbGVhbiBpc05hbWVVbmlxdWUgPSAoQm9vbGVhbikgcmV0dXJuVmFsdWU7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFtZVVuaXF1ZSkKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVbml0Vm1Nb2RlbCBW
bU1vZGVsID0gKFVuaXRWbU1vZGVsKSB2bUxpc3RNb2RlbC5nZXRXaW5kb3coKTsKICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBWbU1vZGVsLmdldEludmFsaWRpdHlSZWFzb25zKCkuY2xl
YXIoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWbU1vZGVsLmdldE5hbWUoKQog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldEludmFsaWRpdHlSZWFz
b25zKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hZGQoQ29uc3Rh
bnRzTWFuYWdlci5nZXRJbnN0YW5jZSgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIC5nZXRDb25zdGFudHMoKQogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAubmFtZU11c3RCZVVuaXF1ZUludmFsaWRSZWFzb24oKSk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVm1Nb2RlbC5nZXROYW1lKCkuc2V0SXNW
YWxpZChmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVm1Nb2RlbC5zZXRJ
c1ZhbGlkKGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbC5Qb3N0TmFtZVVuaXF1ZUNoZWNr
KCk7CiAgICA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lN0b3BQcm9ncmVzcygpOwogICAgICAgICAgICAgICAgICAgICAgICBWZGNSZXR1cm5WYWx1ZUJh
c2UgcmV0dXJuVmFsdWVCYXNlID0gcmVzdWx0LmdldFJldHVyblZhbHVlKCk7CiAgICAgICAgICAg
ICAgICAgICAgICAgIGlmIChyZXR1cm5WYWx1ZUJhc2UgIT0gbnVsbCAmJiByZXR1cm5WYWx1ZUJh
c2UuZ2V0U3VjY2VlZGVkKCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIHZtTGlzdE1vZGVsLkNhbmNlbCgpOwogICAgICAgICAgICAgICAgICAg
ICAgICB9CgogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0sIHRoaXMpOwog
ICAgfQoKICAgIHByaXZhdGUgdm9pZCBNaWdyYXRlKCkKICAgIHsKICAgICAgICBWTSB2bSA9IChW
TSkgZ2V0U2VsZWN0ZWRJdGVtKCk7CiAgICAgICAgaWYgKHZtID09IG51bGwpCiAgICAgICAgewog
ICAgICAgICAgICByZXR1cm47CiAgICAgICAgfQoKICAgICAgICBpZiAoZ2V0V2luZG93KCkgIT0g
bnVsbCkKICAgICAgICB7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9CgogICAgICAgIE1p
Z3JhdGVNb2RlbCBtb2RlbCA9IG5ldyBNaWdyYXRlTW9kZWwoKTsKICAgICAgICBzZXRXaW5kb3co
bW9kZWwpOwogICAgICAgIG1vZGVsLnNldFRpdGxlKENvbnN0YW50c01hbmFnZXIuZ2V0SW5zdGFu
Y2UoKS5nZXRDb25zdGFudHMoKS5taWdyYXRlVmlydHVhbE1hY2hpbmVzVGl0bGUoKSk7CiAgICAg
ICAgbW9kZWwuc2V0SGFzaE5hbWUoIm1pZ3JhdGVfdmlydHVhbF9tYWNoaW5lIik7IC8vJE5PTi1O
TFMtMSQKICAgICAgICBtb2RlbC5zZXRWbXNPblNhbWVDbHVzdGVyKHRydWU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1bl9vbl92ZHMgPT0gbnVsbCkK
ICAgICAgICAgICAgewogICAgICAgICAgICAgICAgcnVuX29uX3ZkcyA9IGEuZ2V0UnVuT25WZHMo
KS5nZXRWYWx1ZSgpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGFsbFJ1bk9u
U2FtZVZkcyAmJiAhcnVuX29uX3Zkcy5lcXVhbHMoYS5nZXRSdW5PblZkcygpLmdldFZhbHVlKCkp
KQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBhbGxSdW5PblNhbWVWZHMgPSBmYWxzZTsK
ICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgbW9kZWwuc2V0SXNIb3N0U2VsQXZhaWxh
YmxlKG1vZGVsLmdldFZtc09uU2FtZUNsdXN0ZXIoKSAmJiBob3N0cy5zaXplKCkgPiAwKTsKCiAg
ICAgICAgaWYgKG1vZGVsLmdldFZtc09uU2FtZUNsdXN0ZXIoKSAmJiBhbGxSdW5PblNhbWVWZHMp
CiAgICAgICAgewogICAgICAgICAgICBWRFMgcnVuT25TYW1lVkRTID0gbnVsbDsKICAgICAgICAg
ICAgZm9yIChWRFMgaG9zdCA6IGhvc3RzKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBp
ZiAoaG9zdC5nZXRJZCgpLmVxdWFscyhydW5fb25fdmRzKSkKICAgICAgICAgICAgICAgIHsKICAg
ICAgICAgICAgICAgICAgICBydW5PblNhbWVWRFMgPSBob3N0OwogICAgICAgICAgICAgICAgfQog
ICAgICAgICAgICB9CiAgICAgICAgICAgIGhvc3RzLnJlbW92ZShydW5PblNhbWVWRFMpOwogICAg
ICAgIH0KICAgICAgICBpZiAoaG9zdHMuaXNFbXB0eSgpKQogICAgICAgIHsKICAgICAgICAgICAg
bW9kZWwuc2V0SXNIb3N0U2VsQXZhaWxhYmxlKGZhbHNlKTsKCiAgICAgICAgICAgIGlmIChhbGxS
dW5PblNhbWVWZHMpCiAgICAgICAgICAgIHsKICAg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bGlzdCwKICAgICAgICAgICAgICAgICAgICBuZXcgSUZyb250ZW5k
TXVsdGlwbGVBY3Rpb25Bc3luY0NhbGxiYWNrKCkgewogICAgICAgICAgICAgICAgICAgICAgICBA
T3ZlcnJpZGUKICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZvaWQgRXhlY3V0ZWQoRnJv
bnRlbmRNdWx0aXBsZUFjdGlvbkFzeW5jUmVzdWx0IHJlc3VsdCkgewoKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIE1pZ3JhdGVNb2RlbCBsb2NhbE1vZGVsID0gKE1pZ3JhdGVNb2RlbCkgcmVz
dWx0LmdldFN0YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbE1vZGVsLlN0
b3BQcm9ncmVzcygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsKCk7CgogICAg
ICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSwgbW9kZWwpOwogICAg
ICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICBBcnJheUxpc3Q8VmRjQWN0
aW9uUGFyYW1ldGVyc0Jhc2U+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFZkY0FjdGlvblBhcmFtZXRl
cnNCYXNlPigpOwogICAgICAgICAgICBmb3IgKE9iamVjdCBpdGVtIDogZ2V0U2VsZWN0ZWRJdGVt
cygpKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBWTSBhID0gKFZNKSBpdGVtOwoKICAg
ICAgICAgICAgICAgIGlmIChhLmdldFJ1bk9uVmRzKCkuZ2V0VmFsdWUoKS5lcXVhbHMoKChWRFMp
IG1vZGVsLmdldEhvc3RzKCkuZ2V0U2VsZWN0ZWRJdGVtKCkpLmdldElkKCkpKQogICAgICAgICAg
ICAgICAgewogICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgfQoK
ICAgICAgICAgICAgICAgI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AgICAgICAgbW9kZWwuZ2V0TmFtZSgp
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0SW52YWxpZGl0eVJlYXNvbnMoKQogICAg
ICAgICAgICAgICAgICAgICAgICAgICAgLmFkZChDb25zdGFudHNNYW5hZ2VyLmdldEluc3RhbmNl
KCkuZ2V0Q29uc3RhbnRzKCkubmFtZU11c3RCZVVuaXF1ZUludmFsaWRSZWFzb24oKSk7CiAgICAg
ICAgICAgICAgICAgICAgbW9kZWwuZ2V0TmFtZSgpLnNldElzVmFsaWQoZmFsc2UpOwogICAgICAg
ICAgICAgICAgICAgIG1vZGVsLnNldElzR2VuZXJhbFRhYlZhbGlkKGZhbHNlKTsKICAgICAgICAg
ICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgbW9kZWwuZ2V0TmFtZSgpCiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAuZ2V0SW52YWxpZGl0eVJlYXNvbnMoKS5jbGVhcigpOwog
ICAgICAgICAgICAgICAgICAgIG1vZGVsLmdldE5hbWUoKS5zZXRJc1ZhbGlkKHRydWUpOwogICAg
ICAgICAgICAgICAgICAgIG1vZGVsLnNldElzR2VuZXJhbFRhYlZhbGlkKHRydWUpOwogICAgICAg
ICAgICAgICAgICAgIG9uU2F2ZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAg
ICAgICAgfSksIG5hbWUpOwoKICAgIH0KCiAgICBwcml2YXRlIHZvaWQgb25TYXZlKCkKICAgIHsK
ICAgICAgICBVbml0Vm1Nb2RlbCBtb2RlbCA9IChVbml0Vm1Nb2RlbCkgZ2V0V2luZG93KCk7CiAg
ICAgICAgVk0gc2VsZWN0ZWRJdGVtID0gKFZNKSBnZXRTZWxlY3RlZEl0ZW0oKTsKCiAgICAgICAg
U3RyaW5nIG5hbWUgPSAoU3RyaW5nKSBtb2RlbC5nZXROYW1lKCkuZ2V0RW50aXR5KCk7CgogICAg
ICAgIC8vIFNhdmUgY2h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ny
YXRjaFBhcmFtZXRlcnMoZ2V0Y3VycmVudFZtKCksCiAgICAgICAgICAgICAgICAgICAgICAgIG5l
dyBBcnJheUxpc3Q8RGlza0ltYWdlPigpLAogICAgICAgICAgICAgICAgICAgICAgICBOR3VpZC5F
bXB0eSksCiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJRnJvbnRlbmRBY3Rpb25Bc3luY0Nh
bGxiYWNrKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBFeGVjdXRlZChGcm9udGVuZEFjdGlvbkFz
eW5jUmVzdWx0IHJlc3VsdCkgewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWbUxp
c3RNb2RlbCB2bUxpc3RNb2RlbCA9IChWbUxpc3RNb2RlbCkgcmVzdWx0LmdldFN0YXRlKCk7CiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm1MaXN0TW9kZWwuZ2V0V2luZG93KCkuU3Rv
cFByb2dyZXNzKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmRjUmV0dXJuVmFs
dWVCYXNlIHJldHVyblZhbHVlQmFzZSA9IHJlc3VsdC5nZXRSZXR1cm5WYWx1ZSgpOwogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXR1cm5WYWx1ZUJhc2UgIT0gbnVsbCAmJiBy
ZXR1cm5WYWx1ZUJhc2UuZ2V0U3VjY2VlZGVkKCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbC5D
YW5jZWwoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm1MaXN0TW9kZWwu
c2V0R3VpZGVDb250ZXh0KHJldHVyblZhbHVlQmFzZS5nZXRBY3Rpb25SZXR1cm5WYWx1ZSgpKTsK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm1MaXN0TW9kZWwuVXBkYXRlQWN0
aW9uQXZhaWxhYmlsaXR5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZt
TGlzdE1vZGVsLmdldEd1aWRlQ29tbWFuZCgpLkV4ZWN1dGUoKTsKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAg
ICAgICAgICAgICAgICB9LCB0aGlzKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlCiAg
ICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGlmIChtb2RlbC5nZXRQcm9ncmVzcygpICE9IG51
bGwpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAg
ICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGlmICgoQm9vbGVhbikgbW9kZWwuZ2V0UHJvdmlz
aW9uaW5nKCkuZ2V0RW50aXR5KCkpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAg
ICAgbW9kZWwuU3RhcnRQcm9ncmVzcyhudWxsKTsKCiAgICAgICAgICAgICAgICAgICAgQXN5bmNR
dWVyeSBfYXN5bmNRdWVyeSA9IG5ldyBBc3luY1F1ZXJ5KCk7CiAgICAgICAgICAgICAgICAgICAg
X2FzeW5jUXVlcnkuc2V0TW9kZWwodGhpcyk7CiAgICAgICAgICAgICAgICAgICAgX2FzeW5jUXVl
cnkuYXN5bmNDYWxsYmFjayA9IG5ldyBJTmV3QXN5bmNDYWxsYmFjaygpIHsKICAgICAgICAgICAg
ICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lk
IE9uU3VjY2VzcyhPYmplY3QgbW9kZWwxLCBPYmplY3QgcmVzdWx0MSkKICAgICAgICAgICAgICAg
ICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgVm1MaXN0TW9kZWwgdm1MaXN0
TW9kZWwgPSAoVm1MaXN0TW9kZWwpIG1vZGVsMTsKICAgICAgICAgICAgICAgICAgICAgICAgICAg
IEFycmF5TGlzdDxEaXNrSW1hZ2U+IHRlbXBsYXRlRGlza3MgPSAoQXJyYXlMaXN0PERpc2tJbWFn
ZT4pIHJlc3VsdDE7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgVW5pdFZtTW9kZWwgdW5p
dFZtTW9kZWwgPSAoVW5pdFZtTW9kZWwpIHZtTGlzdE1vZGVsLmdldFdpbmRvdygpOwoKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIEhhc2hNYXA8R3VpZCwgRGlza0ltYWdlPiBpbWFnZVRvRGVz
dGluYXRpb25Eb21haW5NYXAgPQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1
bml0Vm1Nb2RlbC5nZXREaXNrc0FsbG9jYXRpb25Nb2RlbCgpLmdldEltYWdlVG9EZXN0aW5hdGlv
bkRvbWFpbk1hcCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxzdG9y
YWdlX2RvbWFpbnM+IGFjdGl2ZVN0b3JhZ2VEb21haW5zID0KICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgdW5pdFZtTW9kZWwuZ2V0RGlza3NBbGxvY2F0aW9uTW9kZWwoKS5nZXRB
Y3RpdmVTdG9yYWdlRG9tYWlucygpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhhc2hN
YXA8R3VpZCwgRGlza0ltYWdlPiBkaWN0ID0gdW5pdFZtTW9kZWwuZ2V0RGlza3NBbGxvY2F0aW9u
TW9kZWwoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0SW1hZ2VUb0Rl
c3RpbmF0aW9uRG9tYWluTWFwKChCb29sZWFuKSB1bml0Vm1Nb2RlbC5nZXREaXNrc0FsbG9jYXRp
b25Nb2RlbCgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdl
dElzU2luZ2xlU3RvcmFnZURvbWFpbigpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgLmdldEVudGl0eSgpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZv
ciAoRGlza0ltYWdlIHRlbXBsYXRlRGlzayA6IHRlbXBsYXRlRGlza3MpCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGlza01vZGVs
IGRpc2sgPSBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoRGlza01v
ZGVsIGEgOiB1bml0Vm1Nb2RlbC5nZXREaXNrc0FsbG9jYXRpb25Nb2RlbCgpLmdldERpc2tzKCkp
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBpZiAodGVtcGxhdGVEaXNrLmdldElkKCkuZXF1YWxzKGEuZ2V0RGlzaygp
LmdldElkKCkpKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXNrID0gYTsKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlX2RvbWFpbnMgc3RvcmFnZURvbWFpbiA9CiAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaW5xLmdldFN0b3JhZ2VCeUlk
KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZVRv
RGVzdGluYXRpb25Eb21haW5NYXAuZ2V0KHRlbXBsYXRlRGlzay5nZXRJZCgpKQogICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5nZXRzdG9yYWdl
X2lkcygpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgLmdldCgwKSwgYWN0aXZlU3RvcmFnZURvbWFpbnMpOwoKICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBpZiAoZGlzayAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGRpY3QuZ2V0KHRlbXBsYXRlRGlzay5nZXRJZCgpKQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXR2b2x1bWVfdHlwZSgoVm9sdW1lVHlw
ZSkgZGlzay5nZXRWb2x1bWVUeXBlKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIC5nZXRTZWxlY3RlZEl0ZW0oKSk7CiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIGRpY3QuZ2V0KHRlbXBsYXRlRGlzay5nZXRJZCgpKQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zZXR2b2x1bWVfZm9ybWF0KEFz
eW5jRGF0YVByb3ZpZGVyLkdldERpc2tWb2x1bWVGb3JtYXQoCiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoVm9sdW1lVHlwZSkgZGlzay5nZXRWb2x1
bWVUeXBlKCkuZ2V0U2VsZWN0ZWRJdGVtKCksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlRG9tYWluLmdldHN0b3JhZ2VfdHlwZSgpKSk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXNrLmdldFF1b3RhKCku
Z2V0U2VsZWN0ZWRJdGVtKCkgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgZGljdC5nZXQodGVtcGxhdGVEaXNrLmdldElkKCkpLnNldFF1b3RhSWQoKChR
dW90YSkgZGlzay5nZXRRdW90YSgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIC5nZXRTZWxlY3RlZEl0ZW0oKSkuZ2V0SWQoKSk7CiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgc3RvcmFnZV9kb21haW5zIHN0b3JhZ2VEb21haW4gPQogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAoc3RvcmFnZV9kb21haW5zKSB1bml0Vm1Nb2RlbC5nZXREaXNrc0FsbG9j
YXRpb25Nb2RlbCgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
LmdldFN0b3JhZ2VEb21haW4oKS5nZXRTZWxlY3RlZEl0ZW0oKTsKCiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBBZGRWbUZyb21UZW1wbGF0ZVBhcmFtZXRlcnMgcGFyYW0gPQogICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQWRkVm1Gcm9tVGVtcGxhdGVQYXJhbWV0ZXJz
KHZtTGlzdE1vZGVsLmdldGN1cnJlbnRWbSgpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgIGRpY3QsIHN0b3JhZ2VEb21haW4uZ2V0SWQoKSk7CgogICAgICAgICAg
ICAgICAgICAgICAgICAgICAgQXJyYXlMaXN0PFZkY0FjdGlvblBhcmFtZXRlcnNCYXNlPiBwYXJh
bWV0ZXJzID0gbmV3IEFycmF5TGlzdDxWZGNBY3Rpb25QYXJhbWV0ZXJzQmFzZT4oKTsKICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIHBhcmFtZXRlcnMuYWRkKHBhcmFtKTsKCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICBGcm9udGVuZC5SdW5NdWx0aXBsZUFjdGlvbihWZGNBY3Rpb25UeXBl
LkFkZFZtRnJvbVRlbXBsYXRlLCBwYXJhbWV0ZXJzLAogICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBuZXcgSUZyb250ZW5kTXVsdGlwbGVBY3Rpb25Bc3luY0NhbGxiYWNrKCkgewog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaWMgdm9pZCBFeGVjdXRlZChGcm9u
dGVuZE11bHRpcGxlQWN0aW9uQXN5bmNSZXN1bHQgcmVzdWx0KSB7CiAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgVm1MaXN0TW9kZWwgdm1MaXN0TW9kZWwxID0gKFZt
TGlzdE1vZGVsKSByZXN1bHQuZ2V0U3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbDEuZ2V0V2luZG93KCkuU3RvcFByb2dyZXNzKCk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm1MaXN0TW9kZWwx
LkNhbmNlbCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB2bUxpc3RNb2RlbCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAg
ICAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgICAgIEFzeW5jRGF0YVByb3ZpZGVy
LkdldFRlbXBsYXRlRGlza0xpc3QoX2FzeW5jUXVlcnksIHRlbXBsYXRlLmdldElkKCkpOwogICAg
ICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgewogICAg
ICAgICAgICAgICAgICAgIGlmIChtb2RlbC5nZXRQcm9ncmVzcygpICE9IG51bGwpCiAgICAgICAg
ICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAg
ICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBtb2RlbC5TdGFydFByb2dyZXNzKG51bGwp
OwoKICAgICAgICAgICAgICAgICAgICBWbU1hbmFnZW1lbnRQYXJhbWV0ZXJzQmFzZSBwYXJhbXMg
PSBuZXcgVm1NYW5hZ2VtZW50UGFyYW1ldGVyc0Jhc2UoZ2V0Y3VycmVudFZtKCkpOwogICAgICAg
ICAgICAgICAgICAgIHBhcmFtcy5zZXREaXNrSW5mb0Rlc3RpbmF0aW9uTWFwKAogICAgICAgICAg
ICAgICAgICAgICAgICAgICAgbW9kZWwuZ2V0RGlza3NBbGxvY2F0aW9uTW9kZWwoKQogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZ2V0SW1hZ2VUb0Rlc3RpbmF0aW9uRG9tYWlu
TWFwKChCb29sZWFuKSBtb2RlbC5nZXREaXNrc0FsbG9jYXRpb25Nb2RlbCgpCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldElzU2luZ2xlU3RvcmFnZURvbWFp
bigpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldEVudGl0
eSgpKSk7CgogICAgICAgICAgICAgICAgICAgIEFycmF5TGlzdDxWZGNBY3Rpb25QYXJhbWV0ZXJz
QmFzZT4gcGFyYW1ldGVycyA9IG5ldyBBcnJheUxpc3Q8VmRjQWN0aW9uUGFyYW1ldGVyc0Jhc2U+
KCk7CiAgICAgICAgICAgICAgICAgICAgcGFyYW1ldGVycy5hZGQocGFyYW1zKTsKCiAgICAgICAg
ICAgICAgICAgICAgRnJvbnRlbmQuUnVuTXVsdGlwbGVBY3Rpb24oVmRjQWN0aW9uVHlwZS5BZGRW
bSwgcGFyYW1ldGVycywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJRnJvbnRlbmRN
dWx0aXBsZUFjdGlvbkFzeW5jQ2FsbGJhY2soKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHVibGljIHZv
aWQgRXhlY3V0ZWQoRnJvbnRlbmRNdWx0aXBsZUFjdGlvbkFzeW5jUmVzdWx0IHJlc3VsdCkgewog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWbUxpc3RNb2RlbCB2bUxpc3RNb2Rl
bDEgPSAoVm1MaXN0TW9kZWwpIHJlc3VsdC5nZXRTdGF0ZSgpOwogICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbDEuZ2V0V2luZG93KCkuU3RvcFByb2dyZXNzKCk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZtTGlzdE1vZGVsMS5DYW5jZWwo
KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyk7CiAgICAgICAgICAg
ICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgZWxzZSAvLyBVcGRhdGUgZXhp
c3RpbmcgVk0gLT4gY29uc2lzdHMgb2YgZWRpdGluZyBWTSBjbHVzdGVyLCB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BwdWJsaWMgdm9pZCBFeGVjdXRlZChGcm9udGVuZEFjdGlvbkFzeW5jUmVz
dWx0IHJlc3VsdCkgewoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWbUxpc3RNb2Rl
bCB2bUxpc3RNb2RlbCA9IChWbUxpc3RNb2RlbCkgcmVzdWx0LmdldFN0YXRlKCk7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgVmRjUmV0dXJuVmFsdWVCYXNlIHJldHVyblZhbHVlQmFz
ZSA9IHJlc3VsdC5nZXRSZXR1cm5WYWx1ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIGlmIChyZXR1cm5WYWx1ZUJhc2UgIT0gbnVsbCAmJiByZXR1cm5WYWx1ZUJhc2UuZ2V0U3Vj
Y2VlZGVkKCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBGcm9udGVuZC5SdW5BY3Rpb24oVmRjQWN0aW9uVHlwZS5V
cGRhdGVWbSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcg
Vm1NYW5hZ2VtZW50UGFyYW1ldGVyc0Jhc2Uodm1MaXN0TW9kZWwuZ2V0Y3VycmVudFZtKCkpLAog
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBJRnJvbnRlbmRB
Y3Rpb25Bc3luY0NhbGxiYWNrKCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgcHVibGljIHZvaWQgRXhlY3V0ZWQoRnJvbnRlbmRBY3Rpb25Bc3luY1Jl
c3VsdCByZXN1bHQxKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgVm1MaXN0TW9kZWwgdm1MaXN0TW9kZWwxID0gKFZtTGlzdE1vZGVsKSByZXN1
bHQxLmdldFN0YXRlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICB2bUxpc3RNb2RlbDEuZ2V0V2luZG93KCkuU3RvcFByb2dyZXNzKCk7CiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWZGNSZXR1cm5W
YWx1ZUJhc2UgcmV0VmFsID0gcmVzdWx0MS5nZXRSZXR1cm5WYWx1ZSgpOwogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBpc1N1Y2NlZWRl
ZCA9IHJldFZhbC5nZXRTdWNjZWVkZWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXRWYWwgIT0gbnVsbCAmJiBpc1N1Y2NlZWRlZCkK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxp
c3RNb2RlbDEuQ2FuY2VsKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbCk7
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIGVsc2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZtTGlzdE1vZGVsLmdldFdpbmRvdygpLlN0b3BQ
cm9ncmVzcygpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRoaXMpOwogICAg
ICAgICAgICB9CiAgICAgICAgICAgIGVsc2UKICAgICAgICAgICAgewogICAgICAgICAgICAgICAg
aWYgKG1vZGVsLmdldFByb2dyZXNzKCkgIT0gbnVsbCkKICAgICAgICAgICAgICAgIHsKICAgICAg
ICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAg
bW9kZWwuU3RhcnRQcm9ncmVzcyhudWxsKTsKCiAgICAgICAgICAgICAgICBGcm9udGVuZC5SdW5B
Y3Rpb24oVmRjQWN0aW9uVHlwZS5VcGRhdGVWbSwgbmV3IFZtTWFuYWdlbWVudFBhcmFtZXRlcnNC
YXNlKGdldGN1cnJlbnRWbSgpKSwKICAgICAgICAgICAgICAgICAgICAgICAgbmV3IElGcm9udGVu
ZEFjdGlvbkFzeW5jQ2FsbGJhY2soKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBAT3Zl
cnJpZGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1YmxpYyB2b2lkIEV4ZWN1dGVkKEZy
b250ZW5kQWN0aW9uQXN5bmNSZXN1bHQgcmVzdWx0KSB7CgogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIFZtTGlzdE1vZGVsIHZtTGlzdE1vZGVsID0gKFZtTGlzdE1vZGVsKSByZXN1bHQu
Z2V0U3RhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bUxpc3RNb2RlbC5n
ZXRXaW5kb3coKS5TdG9wUHJvZ3Jlc3MoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICBWZGNSZXR1cm5WYWx1ZUJhc2UgcmV0dXJuVmFsdWVCYXNlID0gcmVzdWx0LmdldFJldHVyblZh
bHVlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJldHVyblZhbHVlQmFz
ZSAhPSBudWxsICYmIHJldHVyblZhbHVlQmFzZS5nZXRTdWNjZWVkZWQoKSkKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHZtTGlzdE1vZGVsLkNhbmNlbCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0K
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0s
IHRoaXMpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQoKICAgIHByaXZhdGUgdm9pZCBS
ZXRyaWV2ZUlzb0ltYWdlcygpCiAgICB7CiAgICAgICAgT2JqZWN0IHRlbXBWYXIgPSBnZXRTZWxl
Y3RlZEl0ZW0oKTsKICAgICAgICBWTSB2bSA9IChWTSkgKCh0ZW1wVmFyIGluc3RhbmNlb2YgVk0p
ID8gdGVtcFZhciA6IG51bGwpOwogICAgICAgIGlmICh2bSA9PSBudWxsKQogICAgICAgIHsKICAg
ICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KCiAgICAgICAgR3VpZCBzdG9yYWdlUG9vbElkID0g
dm0uZ2V0U3RvcmFnZVBvb2xJZCgpOwoKICAgICAgICBnZXRJc29JbWFnZXMoKS5jbGVhcigpOwoK
ICAgICAgICBDaGFuZ2VDRE1vZGVsIHRlbXBWYXIyID0gbmV3IENoYW5nZUNETW9kZWwoKTsKICAg
ICAgICB0ZW1wVmFyMi5zZXRUaXRsZShDb25zb2xlTW9kZWwuRWplY3RMYWJlbCk7CiAgICAgICAg
Q2hhbmdlQ0RNb2RlbCBlamVjdE1vZGVsID0gdGVtcFZhcjI7CiAgICAgICAgZWplY3RNb2RlbC5n
ZX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QogICAgICAgIGVs
c2UgaWYgKGNvbW1hbmQgPT0gZ2V0UmVtb3ZlQ29tbWFuZCgpKQogICAgICAgIHsKICAgICAgICAg
ICAgcmVtb3ZlKCk7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0UnVu
Q29tbWFuZCgpKQogICAgICAgIHsKICAgICAgICAgICAgUnVuKCk7CiAgICAgICAgfQogICAgICAg
IGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0UGF1c2VDb21tYW5kKCkpCiAgICAgICAgewogICAgICAg
ICAgICBQYXVzZSgpOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChjb21tYW5kID09IGdldFN0
b3BDb21tYW5kKCkpCiAgICAgICAgewogICAgICAgICAgICBzdG9wKCk7CiAgICAgICAgfQogICAg
ICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0U2h1dGRvd25Db21tYW5kKCkpCiAgICAgICAgewog
ICAgICAgICAgICBTaHV0ZG93bigpOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChjb21tYW5k
ID09IGdldE1pZ3JhdGVDb21tYW5kKCkpCiAgICAgICAgewogICAgICAgICAgICBNaWdyYXRlKCk7
CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0TmV3VGVtcGxhdGVDb21t
YW5kKCkpCiAgICAgICAgewogICAgICAgICAgICBOZXdUZW1wbGF0ZSgpOwogICAgICAgIH0KICAg
ICAgICBlbHNlIGlmIChjb21tYW5kID09IGdldFJ1bk9uY2VDb21tYW5kKCkpCiAgICAgICAgewog
ICAgICAgICAgICBSdW5PbmNlKCk7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKGNvbW1hbmQg
PT0gZ2V0RXhwb3J0Q29tbWFuZCgpKQogICAgICAgIHsKICAgICAgICAgICAgRXhwb3J0KENvbnN0
YW50c01hbmFnZXIuZ2V0SW5zdGFuY2UoKS5nZXRDb25zdGFudHMoKS5leHBvcnRWaXJ0dWFsTWFj
aGluZVRpdGxlKCkpOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChjb21tYW5kID09IGdldE1v
dmVDb21tYW5kKCkpCiAgICAgICAgewogICAgICAgICAgICBNb3ZlKCk7CiAgICAgICAgfQogICAg
ICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0R3VpZGVDb21tYW5kKCkpCiAgICAgICAgewogICAg
ICAgICAgICBHdWlkZSgpOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChjb21tYW5kID09IGdl
dFJldHJpZXZlSXNvSW1hZ2VzQ29tbWFuZCgpKQogICAgICAgIHsKICAgICAgICAgICAgUmV0cmll
dmVJc29JbWFnZXMoKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoY29tbWFuZCA9PSBnZXRD
aGFuZ2VDZENvbW1hbmQoKSkKICAgICAgICB7CiAgICAgICAgICAgIENoYW5nZUNEKCk7CiAgICAg
ICAgfQogICAgICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gZ2V0QXNzaWduVGFnc0NvbW1hbmQoKSkK
ICAgICAgICB7CiAgICAgICAgICAgIEFzc2lnblRhZ3MoKTsKICAgICAgICB9CiAgICAgICAgZWxz
ZSBpZiAoU3RyaW5nSGVscGVyLnN0cmluZ3NFcXVhbChjb21tYW5kLmdldE5hbWUoKSwgIk9uQXNz
aWduVGFncyIpKSAvLyROT04tTkxTLTEkCiAgICAgICAgewogICAgICAgICAgICBPbkFzc2lnblRh
Z3MoKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoU3RyaW5nSGVscGVyLnN0cmluZ3NFcXVh
bChjb21tYW5kLmdldE5hbWUoKSwgIkNhbmNlbCIpKSAvLyROT04tTkxTLTEkCiAgICAgICAgewog
ICAgICAgICAgICBDYW5jZWwoKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoU3RyaW5nSGVs
cGVyLnN0cmluZ3NFcXVhbChjb21tYW5kLmdldE5hb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9yYWdlUG9vbElkKCk7CiAgICB9Cn0K
--_005_C5A0092C63E939488005F15F736A8112097A57B9SHSMSX101ccrcor_--
11 years, 8 months
[Engine-devel] Some notes on UI composition
by Vojtech Szocs
Hi guys,
I've encountered an interesting pattern while working on a recent patch: some View classes actually embed other View classes, and add those embedded Views to the (top-level) View.
For example, ImportVmPopupView has a field "ImportVmGeneralSubTabView generalView", which is created as part of constructor and added to ImportVmPopupView's layout.
The bottom line is, please don't use this pattern. Views are architectural components in Model-View-Presenter which are living in a particular scope (e.g. singleton/non-singleton), so UI composition should be always done on Widget level, instead of View level.
In other words, ImportVmPopupView shouldn't embed ImportVmGeneralSubTabView, but instead embed UI (Widgets) similar to ImportVmGeneralSubTabView. In case embedded View's UI is complex, we can just create a reusable widget that would be used in both ImportVmPopupView and ImportVmGeneralSubTabView.
Otherwise, we could run into problems, especially since ImportVmPopupView is dialog-specific (non-singleton) and ImportVmGeneralSubTabView is sub-tab-specific (singleton). In Model-View-Presenter, View != immediate Widget, View == MVP component wrapping UI (Widget) and bound to a specific scope, so that's the reason why UI composition should be always done on Widget level (on the other hand, subclassing Views is perfectly OK).
Sorry for being police man here .. it's just a note to keep in mind for future :)
Regards,
Vojtech
11 years, 8 months