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X0xBU1RfTkFNRTsKK2ltcG9ydCBzdGF0aWMgb3JnLm9wZW5lY29tcC5zZGMuYmUuYXVkaXRpbmcuaW1wbC5BdWRpdFRlc3RVdGlscy5VU0VSX1VJRDsKIAogcHVibGljIGNsYXNzIEF1ZGl0QmFzZUV2ZW50RmFjdG9yeVRlc3QgewogCmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvYXVkaXRpbmcvaW1wbC9BdWRpdENvbnN1bWVyRXZlbnRGdW5jVGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2F1ZGl0aW5nL2ltcGwvQXVkaXRDb25zdW1lckV2ZW50RnVuY1Rlc3QuamF2YQpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggYmZhY2NkZC4uMDAwMDAwMAotLS0gYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvYXVkaXRpbmcvaW1wbC9BdWRpdENvbnN1bWVyRXZlbnRGdW5jVGVzdC5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsMTcwICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0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N0YXR1cy5PSyk7CiAKICAgICAgICAgYXNzZXJ0VGhhdChhdWRpdGluZ01hbmFnZXIuYXVkaXRFdmVudChmYWN0b3J5KSkuaXNFcXVhbFRvKEVYUEVDVEVEX0FVVEhfUkVRVUVTVF9MT0dfU1RSKTsKZGlmZiAtLWdpdCBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jYXRhbG9nL2ltcGwvRG1hYXBQcm9kdWNlclRlc3QuamF2YSBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jYXRhbG9nL2ltcGwvRG1hYXBQcm9kdWNlclRlc3QuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hZjA2ODdjCi0tLSAvZGV2L251bGwKKysrIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2NhdGFsb2cvaW1wbC9EbWFhcFByb2R1Y2VyVGVzdC5qYXZhCkBAIC0wLDAgKzEsMTQwIEBACisvKi0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBTREMKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMjAgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMC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0aW9uIGUpIHsKKyAgICAgICAgICAgIC8vIFRPRE8gQXV0by1nZW5lcmF0ZWQgY2F0Y2ggYmxvY2sKKyAgICAgICAgICAgIGUucHJpbnRTdGFja1RyYWNlKCk7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyBUT0RPIEF1dG8tZ2VuZXJhdGVkIGNhdGNoIGJsb2NrCisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworICAgICAgICB9ZmluYWxseSB7CisgICAgICAgICAgICBnZXRDb25maWd1cmF0aW9uTWFuYWdlcigpLmdldENvbmZpZ3VyYXRpb24oKS5nZXREbWFhcFByb2R1Y2VyQ29uZmlndXJhdGlvbigpLnNldEFjdGl2ZShvbGRWYWwpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIGlzQWN0aXZlKCl7CisgICAgICAgIHJldHVybiBnZXRDb25maWd1cmF0aW9uTWFuYWdlcigpLmdldENvbmZpZ3VyYXRpb24oKS5nZXREbWFhcFByb2R1Y2VyQ29uZmlndXJhdGlvbigpLmdldEFjdGl2ZSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB0b2dnbGVJbmFjdGl2ZSgpeworICAgICAgICBnZXRDb25maWd1cmF0aW9uTWFuYWdlcigpLmdldENvbmZpZ3VyYXRpb24oKS5nZXREbWFhcFByb2R1Y2VyQ29uZmlndXJhdGlvbigpLnNldEFjdGl2ZShmYWxzZSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHRvZ2dsZUFjdGl2ZSgpeworICAgICAgICBnZXRDb25maWd1cmF0aW9uTWFuYWdlcigpLmdldENvbmZpZ3VyYXRpb24oKS5nZXREbWFhcFByb2R1Y2VyQ29uZmlndXJhdGlvbigpLnNldEFjdGl2ZSh0cnVlKTsKKyAgICB9CisKK30KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jYX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ICJJUCBNdXggRGVtdXgiOworICAgICAgICBDb21wb25lbnQgY29tcG9uZW50ID0gaW5pdENvbXBvbmVudChDb21wb25lbnRUeXBlRW51bS5TRVJWSUNFLCBudWxsLCBjYXRlZ29yeU5hbWUpOworICAgICAgICBjb21wb25lbnRMaXN0LmFkZChjb21wb25lbnQpOworICAgICAgICBDb21wb25lbnQgY29tcG9uZW50MiA9IGluaXRDb21wb25lbnQoQ29tcG9uZW50VHlwZUVudW0uU0VSVklDRSwgbnVsbCwgY2F0ZWdvcnlOYW1lMik7CisgICAgICAgIGNvbXBvbmVudExpc3QuYWRkKGNvbXBvbmVudDIpOworICAgICAgICBNYXA8U3RyaW5nLE1hcDxTdHJpbmcsTGlzdDxVaUxlZnRQYWxldHRlQ29tcG9uZW50Pj4+IHJlc3BvbnNlID0gZ2V0Q2F0ZWdvcml6ZWRDb21wb25lbnRzKGdldENvbXBvbmVudHNVdGlscygpLmNvbnZlcnRDb21wb25lbnRUb1VpTGVmdFBhbGV0dGVDb21wb25lbnRPYmplY3QoY29tcG9uZW50TGlzdCkpOworICAgICAgICBhc3NlcnRUaGF0KHJlc3BvbnNlLmdldCgiR2VuZXJpYyIpLmdldCgiR2VuZXJpYyIpLnNpemUoKSkuaXNFcXVhbFRvKDIpOworICAgIH0KKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgY2F0ZWdvcml6ZVR3b1Jlc291cmNlc0RpZmZDYXRlZ29yeSgpeworICAgICAgICBMaXN0PENvbXBvbmVudD4gY29tcG9uZW50TGlzdCA9IG5ldyBBcnJheUxpc3Q8PigpOworICAgICAgICBTdHJpbmcgY2F0ZWdvcnlOYW1lID0gIkFwcGxpY2F0aW9uIEw0KyI7CisgICAgICAgIFN0cmluZyBjYXRlZ29yeU5hbWUyID0gIklQIE11eCBEZW11eCI7CisgICAgICAgIFN0cmluZyBzdWJDYXRlZ29yeU5hbWUgPSAiTG9hZCBCYWxhbmNlciI7CisgICAgICAgIENvbXBvbmVudCBjb21wb25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8uYW55KFJlc291cmNlLmNsYXNzKSwgTW9ja2l0by5hbnkoVXNlci5jbGFzcyksIE1vY2tpdG8uYW55Qm9vbGVhbigpLCBNb2NraXRvLmFueUJvb2xlYW4oKSwgTW9ja2l0by5hbnlCb29sZWFuKCksIE1vY2tpdG8uZXEobnVsbCksIE1vY2tpdG8uZXEobnVsbCksIE1vY2tpdG8uZXEoZmFsc2UpKSkKLSAgICAgICAgICAgICAgICAudGhlbkFuc3dlcihuZXcgQW5zd2VyPEltbXV0YWJsZVBhaXI8UmVzb3VyY2UsIEFjdGlvblN0YXR1cz4+KCkgewotICAgICAgICAgICAgICAgICAgICBwdWJsaWMgSW1tdXRhYmxlUGFpcjxSZXNvdXJjZSwgQWN0aW9uU3RhdHVzPiBhbnN3ZXIoSW52b2NhdGlvbk9uTW9jayBpbnZvY2F0aW9uKSB0aHJvd3MgVGhyb3dhYmxlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdFtdIGFyZ3MgPSBpbnZvY2F0aW9uLmdldEFyZ3VtZW50cygpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBJbW11dGFibGVQYWlyPD4oKFJlc291cmNlKSBhcmdzWzBdLCBBY3Rpb25TdGF0dXMuQ1JFQVRFRCk7CisgICAgICAgICAgICAgICAgLnRoZW5BbnN3ZXIoKEFuc3dlcjxJbW11dGFibGVQYWlyPFJlc291cmNlLCBBY3Rpb25TdGF0dXM+PikgaW52b2NhdGlvbiAtPiB7CisgICAgICAgICAgICAgICAgICAgIE9iamVjdFtdIGFyZ3MgPSBpbnZvY2F0aW9uLmdldEFyZ3VtZW50cygpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEltbXV0YWJsZVBhaXI8PigoUmVzb3VyY2UpIGFyZ3NbMF0sIEFjdGlvblN0YXR1cy5DUkVBVEVEKTsKIAotICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgIHdoZW4oc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Z2luZUNvbmZpZ3VyYXRpb24gY29uZmlndXJhdGlvbk1vY2sgPSBNb2NraXRvLm1vY2soRGlzdHJpYnV0aW9uRW5naW5lQ29uZmlndXJhdGlvbi5jbGFzcyk7CisgICAgcHJpdmF0ZSBEaXN0cmlidXRpb25FbmdpbmVDb25maWd1cmF0aW9uIGNvbmZpZ3VyYXRpb25Nb2NrID0gTW9ja2l0by5tb2NrKERpc3RyaWJ1dGlvbkVuZ2luZUNvbmZpZ3VyYXRpb24uY2xhc3MpOworICAgIHByaXZhdGUgQ29uZmlndXJhdGlvbiBjb25maWd1cmF0aW9uID0gTW9ja2l0by5tb2NrKENvbmZpZ3VyYXRpb24uY2xhc3MpOwogCiAgICAgcHVibGljIER1bW15RGlzdHJpYnV0aW9uQ29uZmlndXJhdGlvbk1hbmFnZXIoKSB7CiAgICAgICAgIG5ldyBDb25maWd1cmF0aW9uTWFuYWdlcihuZXcgRHVtbXlDb25maWd1cmF0aW9uU291cmNlKCkpOwpAQCAtNDIsNiArNDQsOSBAQAogICAgICAgICAgICAgaWYgKGNsYXNzTmFtZS5lcXVhbHMoRGlzdHJpYnV0aW9uRW5naW5lQ29uZmlndXJhdGlvbi5jbGFzcykpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gKFQpY29uZmlndXJhdGlvbk1vY2s7CiAgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoY2xhc3NOYW1lLmVxdWFscyhDb25maWd1cmF0aW9uLmNsYXNzKSkgeworICAgICAgICAgICAgICAgIHJldHVybiAoVCljb25maWd1cmF0aW9uOworICAgICAgICAgICAgfQogICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgIH0KIApAQCAtNTQsNCArNTksNyBAQAogICAgIHB1YmxpYyBEaXN0cmlidXRpb25FbmdpbmVDb25maWd1cmF0aW9uIGdldENvbmZpZ3VyYXRpb25Nb2NrKCkgewogICAgICAgICByZXR1cm4gY29uZmlndXJhdGlvbk1vY2s7CiAgICAgfQorICAgIHB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c3IiwiMjIiKSkKKyAgICAgICAgICAgICAgICAuZ2V0RW52aXJvbm1lbnRJZCgpKS5pc0VxdWFsVG8oIjEiKTsKKworICAgICAgICBhc3NlcnRUaGF0KGVudkVuZ2luZS5nZXRFbnZpcm9ubWVudEJ5RG1hYXBVZWJBZGRyZXNzKEFycmF5cy5hc0xpc3QoIjc3IiwiNTUiKSkKKyAgICAgICAgICAgICAgICAuZ2V0RW52aXJvbm1lbnRJZCgpKS5pc0VxdWFsVG8oIjIiKTsKKworICAgICAgICBhc3NlcnRUaGF0KGVudkVuZ2luZS5nZXRFbnZpcm9ubWVudEJ5RG1hYXBVZWJBZGRyZXNzKEFycmF5cy5hc0xpc3QoIjExIiwiNDQiKSkKKyAgICAgICAgICAgICAgICAuZ2V0RW52aXJvbm1lbnRJZCgpKS5pc0VxdWFsVG8oIjEiKTsKKyAgICB9CisKKworCisKICAgICBwcml2YXRlIFN0cmluZyBnZXRDb3JydXB0ZWRPcGVyYXRpb25hbEVudkpzb24oKSB7CiAgICAgICAgIHJldHVybiAie1wiT1BFUkFUSU9OQUwtZW52aXJvbm1lbnQtbmFtZVwiOlwiT3AgRW52IE5hbWVcIiwiCiAgICAgICAgICAgICAgICAgKyAiXCJPUEVSQVRJT05BTC1lbnZpcm9ubWVudC10eXBlXCI6XCJWTkZcIiwiCkBAIC0xODMsNyArMjMzLDcgQEAKICAgICAgICAgICAgICAgICAiXCJyZWxhdGlvbnNoaXAtbGlzdFwiOnsiICsKICAgICAgICAgICAgICAgICAiXCJyZWxhdGlvbnNoaXBcIjpbXSIgKwogICAgICAgICAgICAgICAgICJ9IiArCi0gICAgICAgICAgICAgIn0iOworICAgICAgICAgICAgICAgICJ9IjsKICAgICB9CiAKICAgICBwcml2YXRlIFN0cmluZyBnZXRGdWxsT3BlcmF0aW9uYWxFbnZKc29uKCkgewpAQCAtMjEzLDcgKzI2Myw3IEBACiAgICAgICAgICAgICAgICAgIlwicHJvcGVydHktdmFsdWVcIjpcIk9FbmFtZ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jU5NGFmLi4wMDAwMDAwCi0tLSBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL2Rpc3RyaWJ1dGlvbi9lbmdpbmUvcmVzdC9Nc29SZXN0Q2xpZW50VGVzdC5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsMTYxICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxOSBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICogCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICogCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaX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kZXggMDAwMDAwMC4uZDdlMDY1NAotLS0gL2Rldi9udWxsCisrKyBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL2hlYWx0aC9IZWFsdGhDaGVja0J1c2luZXNzTG9naWNIZWFsdGhUZXN0LmphdmEKQEAgLTAsMCArMSwzMjggQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICoKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpY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GgvSGVhbHRoQ2hlY2tCdXNpbmVzc0xvZ2ljVGVzdC5qYXZhCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBhMDUxODRmLi4wMDAwMDAwCi0tLSBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL2hlYWx0aC9IZWFsdGhDaGVja0J1c2luZXNzTG9naWNUZXN0LmphdmEKKysrIC9kZXYvbnVsbApAQCAtMSwyODYgKzAsMCBAQAotLyotCi0gKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKiAKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKiAKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8ga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bCBDb21wb25lbnRUeXBlRW51bSBjb21wb25lbnRUeXBlID0gQ29tcG9uZW50VHlwZUVudW0uU0VSVklDRTsKLSAgICAgICAgZmluYWwgU3RyaW5nIGNvbXBvbmVudElkID0gInRlc3RDb21wb25lbnRJZCI7Ci0gICAgICAgIGZpbmFsIFN0cmluZyBhcnRpZmFjdEdyb3VwVHlwZSA9ICJ0ZXN0QXJ0aWZhY3RHcm91cFR5cGUiOwotICAgICAgICBmaW5hbCBTdHJpbmcgdXNlcklkID0gbnVsbDsKLQotICAgICAgICB3aGVuKGNvbXBvbmVudHNVdGlscy5nZXRSZXNwb25zZUZvcm1hdChlcShBY3Rpb25TdGF0dXMuTUlTU0lOR19JTkZPUk1BVElPTikpKQotICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKGV4cGVjdGVkUmVzcG9uc2VGb3JtYXQpOwotCi0gICAgICAgIHRlc3RBcnRpZmFjdHNCdXNpbmVzc0xvZ2ljLnNldENvbXBvbmVudHNVdGlscyhjb21wb25lbnRzVXRpbHMpOwotCi0gICAgICAgIEVpdGhlcjxNYXA8U3RyaW5nLCBBcnRpZmFjdERlZmluaXRpb24+LCBSZXNwb25zZUZvcm1hdD4gcmVzcG9uc2UgPQotICAgICAgICAgICAgICAgIHRlc3RBcnRpZmFjdHNCdXNpbmVzc0xvZ2ljLmhhbmRsZUdldEFydGlmYWN0c0J5VHlwZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lckNvbXBvbmVudFR5cGUsIHBhcmVudElkLCBjb21wb25lbnRUeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50SWQsIGFydGlmYWN0R3JvdXBUeXBlLCB1c2VySWQKLSAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzc2VydFRydWUocmVzcG9uc2UuaXNSaWdodCgpKTsKLSAgICAgICAgYXNzZXJ0RXF1YWxzKHJlc3BvbnNlLnJpZ2h0KCkudmFsdWUoKSwgZXhwZWN0ZWRS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YXRlQXJ0aWZhY3RXaXRoRW1wdHlCb2R5KCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAgUmVwcmVzZW50YXRpb25VdGlscy5jb252ZXJ0SnNvblRvQXJ0aWZhY3REZWZpbml0aW9uKCIiLCBBcnRpZmFjdERlZmluaXRpb24uY2xhc3MsIHRydWUpOworICAgICAgICAgICAgZmFpbCgpOworICAgICAgICB9IGNhdGNoIChDb21wb25lbnRFeGNlcHRpb24gZXhwKSB7CisgICAgICAgICAgICBhc3NlcnRUaGF0KGV4cC5nZXRBY3Rpb25TdGF0dXMoKSkuaXNFcXVhbFRvKEFjdGlvblN0YXR1cy5NSVNTSU5HX0JPRFkpOworICAgICAgICB9CisgICAgfQorCisgICAgQFRlc3QKICAgICBwdWJsaWMgdm9pZCB0ZXN0SW52YWxpZE51bWJlckdyb3VwVHlwZSgpIHsKICAgICAgICAgQXJ0aWZhY3REZWZpbml0aW9uIGFkID0gbmV3IEFydGlmYWN0RGVmaW5pdGlvbigpOwogICAgICAgICBhZC5zZXRBcnRpZmFjdE5hbWUoImFydGlmYWN0MSIpOwpAQCAtMzQ1LDEzICs1NTksNzQgQEAKIAogICAgICAgICBKc29uRWxlbWVudCBqc29uQXJ0aWZhY3QgPSBnc29uLnRvSnNvblRyZWUoYWQpOwogICAgICAgICBqc29uQXJ0aWZhY3QuZ2V0QXNKc29uT2JqZWN0KCkuYWRkUHJvcGVydHkoImFydGlmYWN0R3JvdXBUeXBlIiwgMTIzKTsKKyAgICAgICAganNvbkFydGlmYWN0LmdldEFzSnNvbk9iamVjdCgpLmFkZFByb3BlcnR5KCJhcnRpZmFjdExhYmVsIiwgIiBsYWJlbCIpOworICAgICAgICBqc29uQXJ0aWZhY3QuZ2V0QXNKc29uT2JqZWN0KCkuYWRkUHJvcGVydHkoInRpbWVvdXQiLCAiIDgwIik7CisgICAgICAgIGpzb25BcnRpZmFjdC5nZXRBc0pzb25PYmplY3QoKS5hZGRQcm9wZXJ0eSgiYXJ0aWZh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NvbnZlcnRKc29uVG9BcnRpZmFjdERlZmluaXRpb24oanNvbkFydGlmYWN0LnRvU3RyaW5nKCksCisgICAgICAgICAgICAgICAgICAgIEFydGlmYWN0RGVmaW5pdGlvbi5jbGFzcywgdHJ1ZSk7CisgICAgICAgICAgICBmYWlsKCk7CisgICAgICAgIH0gY2F0Y2ggKENvbXBvbmVudEV4Y2VwdGlvbiBleHApIHsKKyAgICAgICAgICAgIGFzc2VydFRoYXQoZXhwLmdldEFjdGlvblN0YXR1cygpKS5pc0VxdWFsVG8oQWN0aW9uU3RhdHVzLk1BTkRBVE9SWV9QUk9QRVJUWV9NSVNTSU5HX1ZBTFVFKTsKKyAgICAgICAgICAgIGFzc2VydFRoYXQoZXhwLmdldFBhcmFtcygpWzBdKS5pc0VxdWFsVG8oImFydGlmYWN0VHlwZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgQFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0TWlzc2luZ0FydGlmYWN0TGFiZWwoKSB7CisgICAgICAgIEFydGlmYWN0RGVmaW5pdGlvbiBhZCA9IG5ldyBBcnRpZmFjdERlZmluaXRpb24oKTsKKworICAgICAgICBKc29uRWxlbWVudCBqc29uQXJ0aWZhY3QgPSBnc29uLnRvSnNvblRyZWUoYWQpOworICAgICAgICBqc29uQXJ0aWZhY3QuZ2V0QXNKc29uT2JqZWN0KCkuYWRkUHJvcGVydHkoImFydGlmYWN0R3JvdXBUeXBlIiwgQXJ0aWZhY3RHcm91cFR5cGVFbnVtLkRFUExPWU1FTlQudG9TdHJpbmcoKSk7CisgICAgICAgIGpzb25BcnRpZmFjdC5nZXRBc0pzb25PYmplY3QoKS5hZGRQcm9wZXJ0eSgidGltZW91dCIsICIgODAiKTsKKyAgICAgICAganNvbkFydGlmYWN0LmdldEFzSnNvbk9iamVjdCgpLmFkZFByb3BlcnR5KCJhcnRpZmFjdFR5cGUiLCAiIEhFQVQiKTsKKworICAgICAgICB0cnkgeworICAgICAgICAgICAgUm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NlcklkIiksIGFueSgpLCBhbnlCb29sZWFuKCkpKQorICAgICAgICB3aGVuKHVzZXJWYWxpZGF0aW9ucy52YWxpZGF0ZVVzZXJFeGlzdHMoTW9ja2l0by5lcSgidXNlcklkIikpKQogICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKHVzZXIpOwogICAgICAgICB3aGVuKHRvc2NhT3BlcmF0aW9uRmFjYWRlLmdldFRvc2NhRnVsbEVsZW1lbnQoYW55KCkpKQogICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKEVpdGhlci5sZWZ0KHJlc291cmNlKSk7CkBAIC0xNTYzLDIzICsxODMwLDIzIEBACiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oYXJ0aWZhY3REZWZpbml0aW9uKTsKICAgICAgICAgd2hlbihncmFwaExvY2tPcGVyYXRpb24ubG9ja0NvbXBvbmVudChlcShyZXNvdXJjZS5nZXRVbmlxdWVJZCgpKSwgYW55KE5vZGVUeXBlRW51bS5jbGFzcykpKQogICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKFN0b3JhZ2VPcGVyYXRpb25TdGF0dXMuT0spOwotICAgICAgICB3aGVuKGFydGlmYWN0VG9zY2FPcGVyYXRpb24udXBkYXRlQXJ0aWZhY3RPblJlc291cmNlKGFueShBcnRpZmFjdERlZmluaXRpb24uY2xhc3MpLCBhbnkoKSwgYW55U3RyaW5nKCksIGFueShOb2RlVHlwZUVudW0uY2xhc3MpLCBhbnkoKSkpCisgICAgICAgIHdoZW4oYXJ0aWZhY3RUb3NjYU9wZXJhdGlvbi51cGRhdGVBcnRpZmFjdE9uUmVzb3VyY2UoYW55KEFydGlmYWN0RGVmaW5pdGlvbi5jbGFzcyksIGFueSgpLCBhbnlTdHJpbmcoKSwgYW55KE5vZGVUeXBlRW51bS5jbGFzcyksIGFueSgpLCBhbnlCb29sZWFuKCkpKQogICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKEVpdGhlci5sZWZ0KGFydGlmYWN0RGVma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hdGlvbkZhY2FkZS5nZXRUb3NjYUZ1bGxFbGVtZW50KGVxKGNvbXBvbmVudElkKSkpCiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oRWl0aGVyLmxlZnQocmVzb3VyY2UpKTsKICAgICAgICAgd2hlbihhcnRpZmFjdFRvc2NhT3BlcmF0aW9uLmdldEFydGlmYWN0QnlJZChhbnlTdHJpbmcoKSwgYW55U3RyaW5nKCksIGFueShDb21wb25lbnRUeXBlRW51bS5jbGFzcyksIGFueVN0cmluZygpKSkKICAgICAgICAgICAgICAgICAudGhlblJldHVybihFaXRoZXIubGVmdChhcnRpZmFjdERlZmluaXRpb24pKTsKICAgICAgICAgd2hlbihhcnRpZmFjdENhc3NhbmRyYURhby5nZXRBcnRpZmFjdChhbnkoKSkpCi0gICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oRWl0aGVyLmxlZnQoZXNBcnRpZmFjdERhdGEpKTsKKyAgICAgICAgICAgICAgICAudGhlblJldHVybihFaXRoZXIubGVmdChkYW9BcnRpZmFjdERhdGEpKTsKKyAgICAgICAgd2hlbihncmFwaExvY2tPcGVyYXRpb24ubG9ja0NvbXBvbmVudChhbnkoKSwgYW55KCkpKS50aGVuUmV0dXJuKFN0b3JhZ2VPcGVyYXRpb25TdGF0dXMuT0spOwogCi0gICAgICAgIEVpdGhlcjxJbW11dGFibGVQYWlyPFN0cmluZywgYnl0ZVtdPiwgUmVzcG9uc2VGb3JtYXQ+IHJlc3VsdCA9CisgICAgICAgIEltbXV0YWJsZVBhaXI8U3RyaW5nLCBieXRlW10+IHJlc3VsdCA9CiAgICAgICAgICAgICAgICAgYXJ0aWZhY3RCTC5oYW5kbGVEb3dubG9hZFJlcXVlc3RCeUlkKGNvbXBvbmVudElkLCBhcnRpZmFjdElkLCB1c2VyLmdldFVzZXJJZCgpLCBDb21wb25lbnRUeXBlRW51bS5SRVNPVVJDRSwKICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudElkLCBudWxsKTsKL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PVVJDRSwgY29tcG9uZW50SWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAsIG51bGwpOworICAgICAgICB9IGNhdGNoIChDb21wb25lbnRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgYXNzZXJ0RXF1YWxzKGUuZ2V0QWN0aW9uU3RhdHVzKCksIEFjdGlvblN0YXR1cy5NSVNTSU5HX0lORk9STUFUSU9OKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBmYWlsKCk7CiAgICAgfQogCiAgICAgQFRlc3QKQEAgLTE3MjcsMTEgKzE5OTYsMTAgQEAKICAgICAgICAgd2hlbihhcnRpZmFjdFRvc2NhT3BlcmF0aW9uLmdldEFydGlmYWN0cyhhbnkoKSwgYW55KE5vZGVUeXBlRW51bS5jbGFzcyksIGFueShBcnRpZmFjdEdyb3VwVHlwZUVudW0uY2xhc3MpLCBhbnkoKSkpCiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oRWl0aGVyLmxlZnQoYXJ0aWZhY3REZWZpbml0aW9uTWFwKSk7CiAKLSAgICAgICAgRWl0aGVyPE1hcDxTdHJpbmcsIEFydGlmYWN0RGVmaW5pdGlvbj4sIFJlc3BvbnNlRm9ybWF0PiByZXN1bHQgPQorICAgICAgICBNYXA8U3RyaW5nLCBBcnRpZmFjdERlZmluaXRpb24+IHJlc3VsdCA9CiAgICAgICAgICAgICAgICAgYXJ0aWZhY3RCTC5oYW5kbGVHZXRBcnRpZmFjdHNCeVR5cGUoQ29tcG9uZW50VHlwZUVudW0uU0VSVklDRS5uYW1lKCksIHBhcmVudElkLCBDb21wb25lbnRUeXBlRW51bS5TRVJWSUNFLAogICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50SWQsIGFydGlmYWN0R3JvdXBUeXBlLCB1c2VySWQpOwotICAgICAgICBNYXA8U3RyaW5nLCBBcnRpZmFjdERlZmluaXRpb24+IGxlZnRSZXN1bHQgPSByZXN1bHQubGVmdCgpLn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KKyAgICAgICAgICAgICAgICAgICAgQ29tcG9uZW50VHlwZUVudW0uUkVTT1VSQ0VfSU5TVEFOQ0UsIGNvbnRhaW5lckNvbXBvbmVudElELCByZXNvdXJjZUluc3RhbmNlSWQsIHByb3BlcnRpZXMsICJ1c2VySWQiKTsKKyAgICAgICAgfSBjYXRjaCAoQ29tcG9uZW50RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIGFzc2VydFRoYXQoZS5nZXRBY3Rpb25TdGF0dXMoKSkuaXNFcXVhbFRvKEFjdGlvblN0YXR1cy5QUk9QRVJUWV9OT1RfRk9VTkQpOworICAgICAgICB9CisKKyAgICB9CisKKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdENyZWF0ZU9yVXBkYXRlUHJvcGVydGllc1ZhbHVlc1ZhbGlkYXRpb25GYWlsdXJlKCl7CisgICAgICAgIFN0cmluZyBjb250YWluZXJDb21wb25lbnRJRD0iY29udGFpbmVySWQiOworICAgICAgICBTdHJpbmcgcmVzb3VyY2VJbnN0YW5jZUlkID0gInJlc291cmNlSWQiOworICAgICAgICBTdHJpbmcgY29tcG9uZW50SW5zdGFuY2VJRCA9ICJjb21wb25lbnRJbnN0YW5jZSI7CisgICAgICAgIExpc3Q8Q29tcG9uZW50SW5zdGFuY2VQcm9wZXJ0eT4gcHJvcGVydGllcyA9IG5ldyBBcnJheUxpc3Q8PigpOworICAgICAgICBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5IHByb3BlcnR5ID0gbmV3IENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkoKTsKKyAgICAgICAgcHJvcGVydHkuc2V0TmFtZSgicHJvcGVydHkiKTsKKyAgICAgICAgcHJvcGVydHkuc2V0VmFsdWUoIm5ld1ZhbCIpOworICAgICAgICBwcm9wZXJ0eS5zZXRUeXBlKCJzdHJpbmciKTsKKyAgICAgICAgcHJvcGVydGllcy5hZGQocHJvcGVydHkpOworCisgICAgICAgIExpc3Q8Q29tcG9uZW50SW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c0VxdWFsVG8oQWN0aW9uU3RhdHVzLklOVkFMSURfQ09OVEVOVCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgZmFpbCgpOworICAgIH0KKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdENyZWF0ZU9yVXBkYXRlUHJvcGVydGllc1ZhbHVlc01pc3NpbmdGaWVsZEZhaWx1cmUoKXsKKyAgICAgICAgU3RyaW5nIGNvbnRhaW5lckNvbXBvbmVudElEPSJjb250YWluZXJJZCI7CisgICAgICAgIFN0cmluZyByZXNvdXJjZUluc3RhbmNlSWQgPSAicmVzb3VyY2VJZCI7CisgICAgICAgIFN0cmluZyBjb21wb25lbnRJbnN0YW5jZUlEID0gImNvbXBvbmVudEluc3RhbmNlIjsKKyAgICAgICAgTGlzdDxDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5PiBwcm9wZXJ0aWVzID0gbmV3IEFycmF5TGlzdDw+KCk7CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkgcHJvcGVydHkgPSBuZXcgQ29tcG9uZW50SW5zdGFuY2VQcm9wZXJ0eSgpOworICAgICAgICBwcm9wZXJ0eS5zZXRWYWx1ZSgibmV3VmFsIik7CisgICAgICAgIHByb3BlcnR5LnNldFR5cGUoInN0cmluZyIpOworICAgICAgICBwcm9wZXJ0aWVzLmFkZChwcm9wZXJ0eSk7CisKKyAgICAgICAgTGlzdDxDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5PiBvcmlnUHJvcGVydGllcyA9IG5ldyBBcnJheUxpc3Q8PigpOworICAgICAgICBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5IG9yaWdQcm9wZXJ0eSA9IG5ldyBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5KCk7CisgICAgICAgIG9yaWdQcm9wZXJ0eS5zZXROYW1lKCJwcm9wZXJ0eSIpOworICAgICAgICBvcmlnUHJvcGVydHkuc2V0VmFsdWUoInZhbHVlI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wdGlvbiBlKXsKKyAgICAgICAgICAgIGFzc2VydFRoYXQoZS5nZXRBY3Rpb25TdGF0dXMoKSkuaXNFcXVhbFRvKEFjdGlvblN0YXR1cy5NSVNTSU5HX1BST1BFUlRZX05BTUUpOworICAgICAgICB9CisgICAgfQogCiAgICAgQFRlc3QKICAgICBwdWJsaWMgdm9pZCB0ZXN0RGVsZXRlRm9yd2FyZGluZ1BhdGhzV2hlbkNvbXBvbmVudGluc3RhbmNlRGVsZXRlZCgpIHsKQEAgLTI1MSw5ICs0NzksOCBAQAogICAgICAgICBTdHJpbmcgY29udGFpbmVyQ29tcG9uZW50SUQgPSAiU2VydmljZS1jb21wIjsKICAgICAgICAgU3RyaW5nIGNvbXBvbmVudEluc3RhbmNlSUQgPSAiTm9kZUExIjsKICAgICAgICAgU2VydmljZSBjb21wb25lbnQgPSBuZXcgU2VydmljZSgpOwotICAgICAgICBjb21wb25lbnQuc2V0Q29tcG9uZW50SW5zdGFuY2VzKAotICAgICAgICAgICAgICAgIEFycmF5cy5hc0xpc3QoY3JlYXRlQ29tcG9uZW50SXN0YW5jZSgiTm9kZUEyIiksIGNyZWF0ZUNvbXBvbmVudElzdGFuY2UoIk5vZGVCMiIpLAotICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlQ29tcG9uZW50SXN0YW5jZShjb21wb25lbnRJbnN0YW5jZUlEKSkpOworICAgICAgICBjb21wb25lbnQuc2V0Q29tcG9uZW50SW5zdGFuY2VzKEFycmF5cy5hc0xpc3QoY3JlYXRlQ29tcG9uZW50SW5zdGFuY2UoIk5vZGVBMiIpLCBjcmVhdGVDb21wb25lbnRJbnN0YW5jZSgiTm9kZUIyIiksCisgICAgICAgICAgICBjcmVhdGVDb21wb25lbnRJbnN0YW5jZShjb21wb25lbnRJbnN0YW5jZUlEKSkpOwogCiAgICAgICAgIGNvbXBvbmVudC5hZGRGb3J3YXJkaW5nUGF0aChjcmVhdGVQYXRoKCJwYXRoMSIsIGNvbXBvbmVudEluc3Rh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0gICAgICAgICAgICAgICAgICAgICAgICAgLmNvcHlDb21wb25lbnRJbnN0YW5jZShpbnB1dENvbXBvbmVudEluc3RhbmNlLCBjb250YWluZXJDb21wb25lbnRJZCwgY29tcG9uZW50SW5zdGFuY2VJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVTRVJfSUQpOwotCisgICAgICAgICAgICAgICAgLmNvcHlDb21wb25lbnRJbnN0YW5jZShpbnB1dENvbXBvbmVudEluc3RhbmNlLCBjb250YWluZXJDb21wb25lbnRJZCwgY29tcG9uZW50SW5zdGFuY2VJZCwgVVNFUl9JRCk7CiAgICAgICAgIHNlcnZpY2Uuc2V0TGFzdFVwZGF0ZXJVc2VySWQob2xkU2VydmljZUxhc3RVcGRhdGVkVXNlcklkKTsKLQogICAgICAgICBhc3NlcnRUaGF0KHJlc3VsdC5pc1JpZ2h0KCkpOwogICAgIH0KIApAQCAtMTI3MywyMSArMTE0NSwxMSBAQAogICAgICAgICB3aGVuKGdyYXBoTG9ja09wZXJhdGlvbi5sb2NrQ29tcG9uZW50KE1vY2tpdG8uYW55U3RyaW5nKCksIGVxKE5vZGVUeXBlRW51bS5TZXJ2aWNlKSkpCiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oU3RvcmFnZU9wZXJhdGlvblN0YXR1cy5PSyk7CiAgICAgICAgIEVpdGhlcjxDb21wb25lbnQsIFN0b3JhZ2VPcGVyYXRpb25TdGF0dXM+IGdldENvbXBvbmVudFJlcyA9IEVpdGhlci5sZWZ0KHJlc291cmNlKTsKLSAgICAgICAgd2hlbih0b3NjYU9wZXJhdGlvbkZhY2FkZS5nZXRUb3NjYUZ1bGxFbGVtZW50KGlucHV0Q29tcG9uZW50SW5zdGFuY2UuZ2V0Q29tcG9uZW50VWlkKCkpKQotICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKGdldENvbXBvbmVudFJlcyk7CiAgICAgICAgIEltbXV0YWJsZVBhaXI8Q29tcG9uZW50LCBTdHJp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PENvbXBvbmVudCwgU3RvcmFnZU9wZXJhdGlvblN0YXR1cz4gY29udCA9IEVpdGhlci5sZWZ0KHNlcnZpY2UpOworICAgICAgICB3aGVuKGNvbXBvbmVudHNVdGlscy5jb252ZXJ0RnJvbVN0b3JhZ2VSZXNwb25zZShlcShTdG9yYWdlT3BlcmF0aW9uU3RhdHVzLk5PVF9GT1VORCksZXEobnVsbCkpKQorICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKEFjdGlvblN0YXR1cy5HRU5FUkFMX0VSUk9SKTsKKyAgICAgICAgd2hlbih0b3NjYU9wZXJhdGlvbkZhY2FkZS5nZXRUb3NjYUVsZW1lbnQoYW55KFN0cmluZy5jbGFzcyksIGFueShDb21wb25lbnRQYXJhbWV0ZXJzVmlldy5jbGFzcykpKQorICAgICAgICAgICAgICAgIC50aGVuUmV0dXJuKGNvbnQpOwogCisgICAgICAgIHRyeXsKICAgICAgICAgcmVzdWx0ID0gY29tcG9uZW50SW5zdGFuY2VCdXNpbmVzc0xvZ2ljCi0gICAgICAgICAgICAgICAgICAgICAgICAgLmJhdGNoRGVsZXRlQ29tcG9uZW50SW5zdGFuY2UoY29udGFpbmVyQ29tcG9uZW50UGFyYW0sIGNvbnRhaW5lckNvbXBvbmVudElkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50SW5zdGFuY2VJZExpc3QsIHVzZXJJZCk7CisgICAgICAgICAgICAgICAgLmJhdGNoRGVsZXRlQ29tcG9uZW50SW5zdGFuY2UoY29udGFpbmVyQ29tcG9uZW50UGFyYW0sIGNvbnRhaW5lckNvbXBvbmVudElkLCBjb21wb25lbnRJbnN0YW5jZUlkTGlzdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJJZCk7CisgICAgICAgICAgICB9Y2F0Y2ggKENvbXBvbmVudEV4Y2VwdGlvbiBlKXsKKyAgICAgICAgICAgICAgICBhc3NlcnRFcXVhbHMoZS5nZXRBY3Rpb25TdGF0dXMo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0KLSAqICAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiAgKiAgQ29weXJpZ2h0IChDKSAyMDE5ICBOb3JkaXggRm91bmRhdGlvbi4KLSAqICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiAgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqICAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqICAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICogICoKLSAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKiAgKgotICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqICAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKiAgKgotICogICogU1BEWC1Ma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3VuZFJlc3BvbnNlKTsKLQotICAgICAgICBFaXRoZXI8TGlzdDxQb2xpY3lEZWZpbml0aW9uPiwgUmVzcG9uc2VGb3JtYXQ+IGRlY2xhcmVkUG9saWNpZXNFaXRoZXIgPSBidXNpbmVzc0xvZ2ljCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRlY2xhcmVQcm9wZXJ0aWVzKFVTRVJfSUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOT05fRVhJU1RfQ09NUE9ORU5UX0lELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29tcG9uZW50VHlwZUVudW0uUkVTT1VSQ0UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRJbnB1dEZvclByb3BlcnR5VG9Qb2xpY3lEZWNsYXJhdGlvbigpKTsKLQotICAgICAgICBhc3NlcnRUcnVlKGRlY2xhcmVkUG9saWNpZXNFaXRoZXIuaXNSaWdodCgpKTsKLSAgICAgICAgYXNzZXJ0RXF1YWxzKG5ldyBJbnRlZ2VyKDQwNCksIGRlY2xhcmVkUG9saWNpZXNFaXRoZXIucmlnaHQoKS52YWx1ZSgpLmdldFN0YXR1cygpKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGJ1c2luZXNzTG9naWMKKyAgICAgICAgICAgICAgICAgICAgLmRlY2xhcmVQcm9wZXJ0aWVzKFVTRVJfSUQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgTk9OX0VYSVN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3YXMgbm90IHVwZ3JhZGVkCi0gICAgICAgIGFzc2VydEVxdWFscyhyZXNvdXJjZS5nZXREZXJpdmVkRnJvbUdlbmVyaWNWZXJzaW9uKCksIGN1cnJlbnREZXJpdmVkRnJvbVZlcnNpb24pOwotICAgICAgICAvL3ZlcmlmeSBpbnB1dHMgd2VyZSBub3QgcmVtb3ZlZAotICAgICAgICBhc3NlcnRFcXVhbHMoNywgcmVzb3VyY2UuZ2V0SW5wdXRzKCkuc2l6ZSgpKTsKLSAgICAgICAgLy92ZXJpZnkgdXNlciBkZWZpbmVkIGlucHV0IGV4aXN0cwotICAgICAgICBhc3NlcnRFcXVhbHMoMSwgcmVzb3VyY2UuZ2V0SW5wdXRzKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0cmVhbSgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIocCAtPiBudWxsID09IHAuZ2V0T3duZXJJZCgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY29sbGVjdChDb2xsZWN0b3JzLnRvTGlzdCgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2l6ZSgpKTsKLSAgICAgICAgYXNzZXJ0RXF1YWxzKCJpbnRlZ2VyIiwgcmVzb3VyY2UuZ2V0SW5wdXRzKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3RyZWFtKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKHAgLT4gbnVsbCA9PSBwLmdldE93bmVySWQoKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmluZEFueSgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldCgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmdldFR5cGUoKSk7Ci0gICAgfQorCXByaXZhdGUgUmVzb3VyY2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ICAgICAgIHNlcnZpY2VDb250YWN0SWQuc2V0Q29udGFjdElkKGNvbnRhY3RJZFRvb0xvbmcpOwogICAgICAgICB0cnl7CiAgICAgICAgICAgICBibC5jcmVhdGVTZXJ2aWNlKHNlcnZpY2VDb250YWN0SWQsIHVzZXIpOwotICAgICAgICB9IGNhdGNoKEJ5QWN0aW9uU3RhdHVzQ29tcG9uZW50RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgfSBjYXRjaChDb21wb25lbnRFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgYXNzZXJ0Q29tcG9uZW50RXhjZXB0aW9uKGUsIEFjdGlvblN0YXR1cy5DT01QT05FTlRfSU5WQUxJRF9DT05UQUNULCBDb21wb25lbnRUeXBlRW51bS5TRVJWSUNFLmdldFZhbHVlKCkpOworICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CisgICAgICAgIGZhaWwoKTsKICAgICB9CiAKICAgICBwcml2YXRlIHZvaWQgdGVzdENvbnRhY3RJZFdyb25nRm9ybWF0Q3JlYXRlKCkgewpAQCAtNDk3LDkgKzM4OSwxMSBAQAogICAgICAgICBzZXJ2aWNlQ29udGFjdElkLnNldENvbnRhY3RJZChjb250YWN0SWRUb29Mb25nKTsKICAgICAgICAgdHJ5ewogICAgICAgICAgICAgYmwuY3JlYXRlU2VydmljZShzZXJ2aWNlQ29udGFjdElkLCB1c2VyKTsKLSAgICAgICAgfSBjYXRjaChCeUFjdGlvblN0YXR1c0NvbXBvbmVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgIH0gY2F0Y2goQ29tcG9uZW50RXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIGFzc2VydENvbXBvbmVudEV4Y2VwdGlvbihlLCBBY3Rpb25TdGF0dXMuQ09NUE9ORU5UX0lOVkFMSURfQ09OVEFDVCwgQ29tcG9uZW50VHlwZUVudW0uU0VSVklDRS5nZXRWYWx1ZSgpKTsKKyAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQorICA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w0NTUgQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICoKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292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3VwQnVzaW5lc3NMb2dpYywgaW50ZXJmYWNlT3BlcmF0aW9uLCBpbnRlcmZhY2VMaWZlY3ljbGVUeXBlT3BlcmF0aW9uLAorICAgICAgICAgICAgICAgIGFydGlmYWN0QmwsIGRpc3RyaWJ1dGlvbkVuZ2luZSwgY29tcG9uZW50SW5zdGFuY2VCdXNpbmVzc0xvZ2ljLAorICAgICAgICAgICAgICAgIHNlcnZpY2VEaXN0cmlidXRpb25WYWxpZGF0aW9uLCBmb3J3YXJkaW5nUGF0aFZhbGlkYXRvciwgdWlDb21wb25lbnREYXRhQ29udmVydGVyLAorICAgICAgICAgICAgICAgIHNlcnZpY2VGaWx0ZXJPcGVyYXRpb24sIHNlcnZpY2VGaWx0ZXJWYWxpZGF0b3IsIGFydGlmYWN0VG9zY2FPcGVyYXRpb24sIGNvbXBvbmVudENvbnRhY3RJZFZhbGlkYXRvciwKKyAgICAgICAgICAgICAgICBjb21wb25lbnROYW1lVmFsaWRhdG9yLCBjb21wb25lbnRUYWdzVmFsaWRhdG9yLCBjb21wb25lbnRWYWxpZGF0b3IsCisgICAgICAgICAgICAgICAgY29tcG9uZW50SWNvblZhbGlkYXRvciwgY29tcG9uZW50UHJvamVjdENvZGVWYWxpZGF0b3IsIGNvbXBvbmVudERlc2NyaXB0aW9uVmFsaWRhdG9yKTsKKyAgICAgICAgYmwuc2V0Q29tcG9uZW50Q29udGFjdElkVmFsaWRhdG9yKGNvbXBvbmVudENvbnRhY3RJZFZhbGlkYXRvcik7CisgICAgICAgIGJsLnNldENvbXBvbmVudEljb25WYWxpZGF0b3IoY29tcG9uZW50SWNvblZhbGlkYXRvcik7CisgICAgICAgIGJsLnNldENvbXBvbmVudFRhZ3NWYWxpZGF0b3IoY29tcG9uZW50VGFnc1ZhbGlkYXRvcik7CisgICAgICAgIGJsLnNldENvbXBvbmVudE5hbWVWYWxpZGF0b3IoY29tcG9uZW50TmFtZVZhbGlkYXRvcik7CisgICAgICAgIGJsLnNldENvbXBvbmVudERl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0KTsKKyAgICAgICAgLy8gfQorICAgICAgICAvLyBlbHNlIGlmKCBmaWx0ZXJNYXAuZXF1YWxzKEZJTFRFUl9NQVBfVU5DRVJUSUZJRURfVkVSU0lPTl9DVVJSKSApeworICAgICAgICAvLyBsaXN0ID0gbmV3CisgICAgICAgIC8vIEFycmF5TGlzdDxFU1RpbWVCYXNlZEV2ZW50Pigpe3svKmFkZChjcmVhdGVSZXNvdXJjZUF1ZGl0KTthZGQoY2hlY2tJblJlc291cmNlQXVkaXQpOyovYWRkKGNoZWNrT3V0UmVzb3VyY2VBdWRpdCk7fX07CisgICAgICAgIC8vIGVpdGhlciA9IEVpdGhlci5sZWZ0KGxpc3QpOworICAgICAgICAvLyB9CisgICAgICAgIC8vIGVsc2V7CisgICAgICAgIC8vIGVpdGhlciA9IG51bGw7CisgICAgICAgIC8vIH0KKyAgICAgICAgLy8gcmV0dXJuIGVpdGhlcjsKKyAgICAgICAgLy8gfQorICAgICAgICAvLyB9KS53aGVuKGF1ZGl0aW5nRGFvKS5nZXRGaWx0ZXJlZFJlc291cmNlQWRtaW5BdWRpdGluZ0V2ZW50cyhNb2NraXRvLmFueU1hcCgpKTsKKyAgICAgICAgLy8KKyAgICAgICAgLy8KKyAgICAgICAgTGlzdDxSZXNvdXJjZUFkbWluRXZlbnQ+IGxpc3QgPSBuZXcgQXJyYXlMaXN0PFJlc291cmNlQWRtaW5FdmVudD4oKSB7CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYWRkKGNyZWF0ZVJlc291cmNlQXVkaXQpOworICAgICAgICAgICAgICAgIGFkZChjaGVja0luUmVzb3VyY2VBdWRpdCk7CisgICAgICAgICAgICAgICAgYWRkKGNoZWNrT3V0UmVzb3VyY2VBdWRpdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIEVpdGhlcjxMaXN0PFJlc291cmNlQWRtaW5FdmVudD4sIEFjdGlvblN0YXR1cz4gcmVzdWx0ID0gRWl0aGVyLmxlZnQobGl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W9uc1Rlc3QuamF2YSBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL2ltcGwvU2VydmljZVZhbGlkYXRpb25zVGVzdC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjJhMzMzMjkKLS0tIC9kZXYvbnVsbAorKysgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9pbXBsL1NlcnZpY2VWYWxpZGF0aW9uc1Rlc3QuamF2YQpAQCAtMCwwICsxLDIwOSBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbm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0aWZpY2F0aW9uQ2hhbmdlVHJhbnNpdGlvblRlc3QuamF2YQpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZjg0MDFlOC4uMDAwMDAwMAotLS0gYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9saWZlY3ljbGUvQ2VydGlmaWNhdGlvbkNoYW5nZVRyYW5zaXRpb25UZXN0LmphdmEKKysrIC9kZXYvbnVsbApAQCAtMSwxODAgKzAsMCBAQAotLyotCi0gKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKiAKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKiAKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQg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9iZS9jb21wb25lbnRzL2xpZmVjeWNsZS9DZXJ0aWZpY2F0aW9uQ2hhbmdlVHJhbnNpdGlvblRlc3RzLmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9saWZlY3ljbGUvQ2VydGlmaWNhdGlvbkNoYW5nZVRyYW5zaXRpb25UZXN0cy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjJhZjQxM2UKLS0tIC9kZXYvbnVsbAorKysgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9saWZlY3ljbGUvQ2VydGlmaWNhdGlvbkNoYW5nZVRyYW5zaXRpb25UZXN0cy5qYXZhCkBAIC0wLDAgKzEsMjY5IEBACisvKi0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBTREMKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5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Rldi9udWxsCisrKyBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL2xpZmVjeWNsZS9DZXJ0aWZpY2F0aW9uQ2hhbmdlVHJhbnNpdGlvblZhbGlkYXRpb25UZXN0LmphdmEKQEAgLTAsMCArMSwxNDggQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAi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T09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1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WNvbXAvc2RjL2JlL2NvbXBvbmVudHMvbGlmZWN5Y2xlL0xpZmVjeWNsZUJ1c2luZXNzTG9naWNUZXN0LmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9saWZlY3ljbGUvTGlmZWN5Y2xlQnVzaW5lc3NMb2dpY1Rlc3QuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iY2VjMzMwCi0tLSAvZGV2L251bGwKKysrIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2NvbXBvbmVudHMvbGlmZWN5Y2xlL0xpZmVjeWNsZUJ1c2luZXNzTG9naWNUZXN0LmphdmEKQEAgLTAsMCArMSwxNjQgQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZ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bXBvbmVudHMvbWVyZ2UvaW5zdGFuY2UvQ29tcG9uZW50SW5zdGFuY2VIZWF0RW52TWVyZ2VUZXN0LmphdmEKQEAgLTkyLDcgKzkyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vY2tpdG8uZXEoVVNFUiksIE1vY2tpdG8uZXEoanNvbiksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2NraXRvLnJlZkVxKGFydGlmYWN0VXBkYXRlT3BlcmF0aW9uKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTnVsbCgpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlblJldHVybihFaXRoZXIubGVmdChFaXRoZXIubGVmdChuZXcgQXJ0aWZhY3REZWZpbml0aW9uKCkpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oRWl0aGVyLmxlZnQobmV3IEFydGlmYWN0RGVmaW5pdGlvbigpKSk7CiAgICAgICAgIH0KICAgICB9CiAKZGlmZiAtLWdpdCBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL21lcmdlL2luc3RhbmNlL0NvbXBvbmVudEluc3RhbmNlSW50ZXJmYWNlc01lcmdlVGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2NvbXBvbmVudHMvbWVyZ2UvaW5zdGFuY2UvQ29tcG9uZW50SW5zdGFuY2VJbnRlcmZhY2VzTWV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WZmIC0tZ2l0IGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2NvbXBvbmVudHMvcGF0aC9iZWFucy9GZWF0dXJlVG9nZ2xlRGFvTW9jay5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2NvbXBvbmVudHMvcGF0aC9iZWFucy9GZWF0dXJlVG9nZ2xlRGFvTW9jay5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmE3ZjdhNzYKLS0tIC9kZXYvbnVsbAorKysgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9wYXRoL2JlYW5zL0ZlYXR1cmVUb2dnbGVEYW9Nb2NrLmphdmEKQEAgLTAsMCArMSw1NyBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNl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uZW50cy9wcm9wZXJ0eS9Qcm9wZXJ0eUNvbnN0cmFpbnRzVXRpbHNUZXN0LmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvY29tcG9uZW50cy9wcm9wZXJ0eS9Qcm9wZXJ0eUNvbnN0cmFpbnRzVXRpbHNUZXN0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOGFjNDEzOQotLS0gL2Rldi9udWxsCisrKyBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9jb21wb25lbnRzL3Byb3BlcnR5L1Byb3BlcnR5Q29uc3RyYWludHNVdGlsc1Rlc3QuamF2YQpAQCAtMCwwICsxLDE1OCBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgK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AKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICoKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IE5va2lhLiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqID09PT09PT09PT09PUxJQ0VOU0VfR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Fzc2VydC5hc3NlcnRUcnVlKGFwcENyZWRlbnRpYWxzLmdldCgidXNlcm5hbWUiKS5lcXVhbHMoInNkYyIpKTsKKyAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoYXBwQ3JlZGVudGlhbHMuZ2V0KCJwYXNzd29yZCIpLmVxdWFscygiYXNkYyIpKTsKICAgICB9CiAKICAgICBAVGVzdAotICAgIHB1YmxpYyB2b2lkIHRlc3RQdXNoVXNlckdlbmVyYWxFcnJvcigpIHRocm93cyBFeGNlcHRpb24gewotICAgICAgICBSZXNwb25zZUZvcm1hdCByZXNwb25zZUZvcm1hdCA9IE1vY2tpdG8ubW9jayhSZXNwb25zZUZvcm1hdC5jbGFzcyk7Ci0gICAgICAgIE1vY2tpdG8ud2hlbihyZXNwb25zZUZvcm1hdC5nZXRNZXNzYWdlSWQoKSkudGhlblJldHVybigibW9jayIpOwotICAgICAgICBNb2NraXRvLndoZW4odWJsLmNyZWF0ZVVzZXIoTW9ja2l0by5hbnkoKSwgTW9ja2l0by5hbnkoKSkpLnRoZW5SZXR1cm4oRWl0aGVyLnJpZ2h0KHJlc3BvbnNlRm9ybWF0KSk7CisgICAgcHVibGljIHZvaWQgdGVzdFB1c2hVc2VyKCkgewogICAgICAgICBFY29tcFVzZXIgdXNlciA9IG5ldyBFY29tcFVzZXIoKTsKICAgICAgICAgU2V0PEVjb21wUm9sZT4gcm9sZVNldCA9IG5ldyBIYXNoU2V0PD4oKTsKICAgICAgICAgRWNvbXBSb2xlIHJvbGUgPSBuZXcgRWNvbXBSb2xlKCk7CkBAIC02NywyMCArNjksMTYgQEAKICAgICAgICAgcm9sZS5zZXROYW1lKCJEZXNpZ25lciIpOwogICAgICAgICByb2xlU2V0LmFkZChyb2xlKTsKICAgICAgICAgdXNlci5zZXRSb2xlcyhyb2xlU2V0KTsKLSAgICAgICAgdHJ5eworICAgICAgICB0cnkgewogICAgICAgICAgICAgdGVzdFN1YmplY3QucHVzaFVzZXIodXNlcik7Ci0gICAgIC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wogICAgICAgICBFY29tcFJvbGUgcm9sZSA9IG5ldyBFY29tcFJvbGUoKTsKQEAgLTg4LDU4ICs4NiwxODkgQEAKICAgICAgICAgcm9sZS5zZXROYW1lKCJEZXNpZ25lciIpOwogICAgICAgICByb2xlU2V0LmFkZChyb2xlKTsKICAgICAgICAgdXNlci5zZXRSb2xlcyhyb2xlU2V0KTsKLSAgICAgICAgdGVzdFN1YmplY3QucHVzaFVzZXIodXNlcik7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICB0ZXN0U3ViamVjdC5wdXNoVXNlcih1c2VyKTsKKyAgICAgICAgfSBjYXRjaCAoUG9ydGFsQVBJRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGUuZ2V0TWVzc2FnZSgpLnN0YXJ0c1dpdGgoIkZhaWxlZCB0byBjcmVhdGUgdXNlciIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBBc3NlcnQuZmFpbCgpOwogICAgIH0KIAogICAgIEBUZXN0Ci0gICAgcHVibGljIHZvaWQgdGVzdFB1c2hVc2VyTnVsbFJvbGVzKCkgdGhyb3dzIEV4Y2VwdGlvbiB7CisgICAgcHVibGljIHZvaWQgdGVzdFB1c2hVc2VyTXVsdGlwbGVSb2xlcygpIHsKKyAgICAgICAgRWNvbXBVc2VyIHVzZXIgPSBuZXcgRWNvbXBVc2VyKCk7CisgICAgICAgIFNldDxFY29tcFJvbGU+IHJvbGVTZXQgPSBuZXcgSGFzaFNldDw+KCk7CisgICAgICAgIEVjb21wUm9sZSByb2xlID0gbmV3IEVjb21wUm9sZSgpOworICAgICAgICByb2xlLnNldElkKDFMKTsKKyAgICAgICAgcm9sZS5zZXROYW1lKCJEZXNpZ25lciIpOworICAgICAgICByb2xlU2V0LmFkZChyb2xlKTsKKyAgICAgICAgRWNvbXBSb2xlIHJvbGUxID0gbmV3IEVjb21wUm9sZSgpOworICAgICAgICByb2xlLnNldElkKDJMKTsKKyAgICAgICAgcm9sZVNldC5hZGQocm9sZTEpOworICAgICAgICByb2xlLnNldE5hbWUoIlRlc3RlciIpOworICAgICAgICB1c2VyLnNldFJvbGVzKHJvbGVTZXQpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgdGVzdFN1YmplY3QucHVzaFVzZXIodXNlcik7CisgICAgICAgIH0gY2F0Y2ggKFBvcnRhbEFQSUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBBc3NlcnQuYXNzZXJ0VHJ1ZShlLmdldE1lc3NhZ2UoKS5zdGFydHNXaXRoKCJSZWNlaXZlZCBtdWx0aXBsZSByb2xlcyBmb3IgdXNlciIpKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgICAgICBBc3NlcnQuZmFpbCgpOworICAgIH0KKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFB1c2hVc2VyTnVsbFJvbGVzKCkgewogICAgICAgICBFY29tcFVzZXIgdXNlciA9IG5ldyBFY29tcFVzZXIoKTsKICAgICAgICAgdHJ5ewogICAgICAgICAgICAgdGVzdFN1YmplY3QucHVzaFVzZXIodXNlcik7CiAgICAgICAgIH0gY2F0Y2ggKFBvcnRhbEFQSUV4Y2VwdGlvbiBlKXsKICAgICAgICAgICAgIEFzc2VydC5hc3NlcnRUcnVlKGUuZ2V0TWVzc2FnZSgpLmVxdWFscygiUmVjZWl2ZWQgbnVsbCByb2xlcyBmb3IgdXNlciIgKyB1c2VyKSk7CisgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KLQorICAgICAgICBBc3NlcnQuZmFpbCgpOwogICAgIH0KIAogICAgIEBUZXN0Ci0gICAgcHVibGljIHZvaWQgdGVzdFB1c2hVc2VyVXNlck51bGwoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICBwdWJsaWMgdm9pZCB0ZXN0UHVzaFVzZXJVc2VyTnVsbCgpIHsKICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIHRlc3RTdWJqZWN0LnB1c2hVc2VyKG51bGwpOwogICAgICAgICB9IGNhdGNoIChQb3J0YWxBUElFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoZS5nZXRNZXNzYWdlKCkuZXF1YWxzKCJSZWNlaXZlZCBudWxsIGZvciBhcmd1bWVudCB1c2VyIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIEFzc2VydC5mYWlsKCk7CisgICAgfQorCisgICAgQFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RWRpdFVzZXJVc2VyTnVsbCgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHRlc3RTdWJqZWN0LmVkaXRVc2VyKG51bGwsIG51bGwpOworICAgICAgICB9IGNhdGNoIChQb3J0YWxBUElFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoZS5nZXRNZXNzYWdlKCkuZXF1YWxzKCJSZWNlaXZlZCBudWxsIGZvciBhcmd1bWVudCB1c2VyIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIEFzc2VydC5mYWlsKCk7CisgICAgfQorCisgICAgQFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0RWRpdFVzZXJJZE51bGwoKSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICB0ZXN0U3ViamVjdC5lZGl0VXNlcihudWxsLCBuZXcgRWNvbXBVc2VyKCkpOworICAgICAgICB9IGNhdGNoIChQb3J0YWxBUElFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgQXNzZXJ0LmFzc2VydFRydWUoZS5nZXRNZXNzYWdlKCkuZXF1YWxzKCJSZWNlaXZlZCBudWxsIGZvciBhcmd1bWVudCBsb2dpbklkIikpOworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIEFzc2VydC5mYWlsKCk7CisgICAgfQorCisgICAgQFRl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VNUX05BTUUpOwotICAgICAgICB1c2VyLnNldEZpcnN0TmFtZShGSVJTVF9OQU1FKTsKLSAgICAgICAgdXNlci5zZXRPcmdVc2VySWQoVVNFUl9JRCk7Ci0gICAgICAgIHJldHVybiB1c2VyOwotICAgIH0KKwkJLy8gdGVzdCAxCisJCXJlc3VsdCA9IEVjb21wVXNlckNvbnZlcnRlci5jb252ZXJ0RWNvbXBVc2VyVG9Vc2VyKGVjb21wVXNlcik7CisJfQogfQpkaWZmIC0tZ2l0IGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2V4Y2VwdGlvbi9Db21wb25lbnRFeGNlcHRpb25NYXRjaGVyLmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvZXhjZXB0aW9uL0NvbXBvbmVudEV4Y2VwdGlvbk1hdGNoZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zMjMwMTk2Ci0tLSAvZGV2L251bGwKKysrIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2V4Y2VwdGlvbi9Db21wb25lbnRFeGNlcHRpb25NYXRjaGVyLmphdmEKQEAgLTAsMCArMSw1MiBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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lKQorICAgICAgICAgICAgICAgIC5hcHBlbmRUZXh0KCIgd2FzIGZvdW5kIGluc3RlYWQgb2YgIikKKyAgICAgICAgICAgICAgICAuYXBwZW5kVmFsdWUoZXhwZWN0ZWRFcnJvckNvZGUpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9leHRlcm5hbGFwaS9zZXJ2bGV0L0FydGlmYWN0RXh0ZXJuYWxTZXJ2bGV0VGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2V4dGVybmFsYXBpL3NlcnZsZXQvQXJ0aWZhY3RFeHRlcm5hbFNlcnZsZXRUZXN0LmphdmEKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwZjg0YWQuLjAwMDAwMDAKLS0tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2V4dGVybmFsYXBpL3NlcnZsZXQvQXJ0aWZhY3RFeHRlcm5hbFNlcnZsZXRUZXN0LmphdmEKKysrIC9kZXYvbnVsbApAQCAtMSwxMDA2ICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxOSBOb2tpYS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1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FbmRwb2ludCA9ICIvdjEvY2F0YWxvZy97YXNzZXRUeXBlfS97dXVpZH0vaW50ZXJmYWNlcy97aW50ZXJmYWNlVVVJRH0vb3BlcmF0aW9ucy97b3BlcmF0aW9uVVVJRH0vYXJ0aWZhY3RzL3thcnRpZmFjdFVVSUR9IjsKLSAgICAgICAgU3RyaW5nIHBhdGggPSBTdHJTdWJzdGl0dXRvci5yZXBsYWNlKGZvcm1hdEVuZHBvaW50LCBwYXJhbWV0ZXJzTWFwLCAieyIsIn0iKTsKLQotICAgICAgICB3aGVuKGFydGlmYWN0c0J1c2luZXNzTG9naWMKLSAgICAgICAgICAgICAgICAudXBkYXRlQXJ0aWZhY3RPbkludGVyZmFjZU9wZXJhdGlvbkJ5UmVzb3VyY2VVVUlEKGFueVN0cmluZygpLCBhbnkoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFueSgpLCBhbnkoKSwgYW55KCksCi0gICAgICAgICAgICAgICAgICAgICAgICBhbnkoKSwgYW55KCksIGFueSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgYW55KCkpKQotICAgICAgICAgICAgICAgIC50aGVuVGhyb3cobmV3IFJ1bnRpbWVFeGNlcHRpb24oIlRleHQgZXhjZXB0aW9uIikpOwotCi0gICAgICAgIFJlc3BvbnNlIHJlc3BvbnNlID0gdGFyZ2V0KCkKLSAgICAgICAgICAgICAgICAucGF0aChwYXRoKQotICAgICAgICAgICAgICAgIC5yZXF1ZXN0KCkKLSAgICAgICAgICAgICAgICAuYWNjZXB0KE1lZGlhVHlwZS5BUFBMSUNBVElPTl9KU09OKQotICAgICAgICAgICAgICAgIC5oZWFkZXIoQ29uc3RhbnRzLlhfRUNPTVBfSU5TVEFOQ0VfSURfSEVBREVSLCAibW9ja1hFY29tcEluc3RhbmNlSWQiKQotICAgICAgICAgICAgICAgIC5oZWFkZXIoQ29uc3RhbnRzLlVTRVJfSURfSEVBREVSLCBkZXNpZ25lclVzZXIuZ2V0VXNlcklkKCkpCi0gICAg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FERVIsIGRlc2lnbmVyVXNlci5nZXRVc2VySWQoKSkKLSAgICAgICAgICAgICAgICAuZ2V0KCk7Ci0KLSAgICAgICAgYXNzZXJ0VGhhdChyZXNwb25zZS5nZXRTdGF0dXMoKSkuaXNFcXVhbFRvKEh0dHBTdGF0dXMuU0NfT0spOwotICAgIH0KLQotICAgIEBPdmVycmlkZQotICAgIHByb3RlY3RlZCBBcHBsaWNhdGlvbiBjb25maWd1cmUoKSB7Ci0gICAgICAgIEFwcGxpY2F0aW9uQ29udGV4dCBjb250ZXh0ID0gbmV3IEFubm90YXRpb25Db25maWdBcHBsaWNhdGlvbkNvbnRleHQoU3ByaW5nQ29uZmlnLmNsYXNzKTsKLSAgICAgICAgcmV0dXJuIG5ldyBSZXNvdXJjZUNvbmZpZyhBcnRpZmFjdEV4dGVybmFsU2VydmxldC5jbGFzcykKLSAgICAgICAgICAgICAgICAucmVnaXN0ZXIobmV3IEFic3RyYWN0QmluZGVyKCkgewotCi0gICAgICAgICAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgdm9pZCBjb25maWd1cmUoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKHJlcXVlc3QpLnRvKEh0dHBTZXJ2bGV0UmVxdWVzdC5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKHVzZXJCdXNpbmVzc0xvZ2ljKS50byhVc2VyQnVzaW5lc3NMb2dpYy5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKGNvbXBvbmVudEluc3RhbmNlQnVzaW5lc3NMb2dpYykudG8oQ29tcG9uZW50SW5zdGFuY2VCdXNpbmVzc0xvZ2ljLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmQoY29tcG9uZW50VXRpbHMpLnRvKENvbXBvbmVudHNVdGlscy5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKHN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dGFuY2VCdXNpbmVzc0xvZ2ljKS50byhDb21wb25lbnRJbnN0YW5jZUJ1c2luZXNzTG9naWMuY2xhc3MpOwotICAgICAgICAgICAgICAgICAgICAgICAgYmluZChjb21wb25lbnRzVXRpbHMpLnRvKENvbXBvbmVudHNVdGlscy5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKHNlcnZsZXRVdGlscykudG8oU2VydmxldFV0aWxzLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmQocmVzb3VyY2VJbXBvcnRNYW5hZ2VyKS50byhSZXNvdXJjZUltcG9ydE1hbmFnZXIuY2xhc3MpOwotICAgICAgICAgICAgICAgICAgICAgICAgYmluZChlbGVtZW50QnVzaW5lc3NMb2dpYykudG8oRWxlbWVudEJ1c2luZXNzTG9naWMuY2xhc3MpOwotICAgICAgICAgICAgICAgICAgICAgICAgYmluZChhc3NldE1ldGFkYXRhQ29udmVydGVyKS50byhBc3NldE1ldGFkYXRhQ29udmVydGVyLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmQobGlmZWN5Y2xlQnVzaW5lc3NMb2dpYykudG8oTGlmZWN5Y2xlQnVzaW5lc3NMb2dpYy5jbGFzcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBiaW5kKHJlc291cmNlQnVzaW5lc3NMb2dpYykudG8oUmVzb3VyY2VCdXNpbmVzc0xvZ2ljLmNsYXNzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpbmQoc2VydmljZUJ1c2luZXNzTG9naWMpLnRvKFNlcnZpY2VCdXNpbmVzc0xvZ2ljLmNsYXNzKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgLnByb3BlcnR5KCJjb250ZXh0Q29uZmlnIiwgY29udGV4dCk7CmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY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hlbih1c2VyQWRtaW4uZ2V0VXNlcihkZXNpZ25lclVzZXIuZ2V0VXNlcklkKCksIGZhbHNlKSkudGhlblJldHVybihkZXNpZ25lclVzZXIpOworICAgICAgICB3aGVuKHVzZXJBZG1pbi5nZXRVc2VyKG90aGVyVXNlci5nZXRVc2VySWQoKSwgZmFsc2UpKS50aGVuUmV0dXJuKG90aGVyVXNlcik7CiAgICAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAKICAgICAgICAgU3RyaW5nIGFwcENvbmZpZ0RpciA9ICJzcmMvdGVzdC9yZXNvdXJjZXMvY29uZmlnIjsKQEAgLTM0Niw3ICszNDcsOSBAQAogCiAgICAgICAgIG9yZy5vcGVuZWNvbXAuc2RjLmJlLmNvbmZpZy5Db25maWd1cmF0aW9uIGNvbmZpZ3VyYXRpb24gPSBuZXcgb3JnLm9wZW5lY29tcC5zZGMuYmUuY29uZmlnLkNvbmZpZ3VyYXRpb24oKTsKICAgICAgICAgY29uZmlndXJhdGlvbi5zZXRKYW51c0dyYXBoSW5NZW1vcnlHcmFwaCh0cnVlKTsKLQorICAgICAgICBvcmcub3BlbmVjb21wLnNkYy5iZS5jb25maWcuQ29uZmlndXJhdGlvbi5IZWF0RGVwbG95bWVudEFydGlmYWN0VGltZW91dCBoZWF0RGVwbG95bWVudEFydGlmYWN0VGltZW91dCA9IG5ldyBvcmcub3BlbmVjb21wLnNkYy5iZS5jb25maWcuQ29uZmlndXJhdGlvbi5IZWF0RGVwbG95bWVudEFydGlmYWN0VGltZW91dCgpOworICAgICAgICBoZWF0RGVwbG95bWVudEFydGlmYWN0VGltZW91dC5zZXREZWZhdWx0TWludXRlcygzMCk7OworICAgICAgICBjb25maWd1cmF0aW9uLnNldEhlYXRBcnRpZmFjdERlcGxveW1lbnRUaW1lb3V0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XQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvZmFjYWRlL29wZXJhdGlvbnMvRmFjYWRlVXNlckNhY2hlT3BlcmF0aW9uVGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2ZhY2FkZS9vcGVyYXRpb25zL0ZhY2FkZVVzZXJDYWNoZU9wZXJhdGlvblRlc3QuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jMTk0N2Q1Ci0tLSAvZGV2L251bGwKKysrIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2ZhY2FkZS9vcGVyYXRpb25zL0ZhY2FkZVVzZXJDYWNoZU9wZXJhdGlvblRlc3QuamF2YQpAQCAtMCwwICsxLDYzIEBACisvKi0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBTREMKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMjAgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggd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BBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KKworcGFja2FnZSBvcmcub3BlbmVjb21wLnNkYy5iZS5maWx0ZXJzOworCitpbXBvcnQgb3JnLmp1bml0LkJlZm9yZTsKK2ltcG9ydCBvcmcuanVuaXQu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KQEAgLTAsMCArMSwxMzAgQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICoKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGF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0hJVkVELCBDb21wb25lbnRUeXBlRW51bS5SRVNPVVJDRSkpOwogCX0KLX0KK30KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvaW1wbC9Eb3dubG9hZEFydGlmYWN0TG9naWNUZXN0LmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvaW1wbC9Eb3dubG9hZEFydGlmYWN0TG9naWNUZXN0LmphdmEKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDY3M2MxMWYuLjAwMDAwMDAKLS0tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL2ltcGwvRG93bmxvYWRBcnRpZmFjdExvZ2ljVGVzdC5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsMTAwICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxOSBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzI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G9naWMgcmVzdWx0OworCQlVc2VyQnVzaW5lc3NMb2dpYyByZXN1bHQ7CiAKIAkJLy8gZGVmYXVsdCB0ZXN0CiAJCXRlc3RTdWJqZWN0ID0gY3JlYXRlVGVzdFN1YmplY3QoKTsKZGlmZiAtLWdpdCBhL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9pbXBsL2FhZi9Sb2xlQW5kUGVybWlzc2lvbkVudW1UZXN0LmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvaW1wbC9hYWYvUm9sZUFuZFBlcm1pc3Npb25FbnVtVGVzdC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjI4MzFhODEKLS0tIC9kZXYvbnVsbAorKysgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvaW1wbC9hYWYvUm9sZUFuZFBlcm1pc3Npb25FbnVtVGVzdC5qYXZhCkBAIC0wLDAgKzEsNzAgQEAKKy8qLQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aG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9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgK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AgICAgICAgfQogCiAgICAgICAgIEBCZWFuCkBAIC0xODAsNyArMTkyLDcgQEAKIAogICAgICAgICBAQmVhbgogICAgICAgICBUb3NjYU9wZXJhdGlvbkZhY2FkZSB0b3NjYU9wZXJhdGlvbkZhY2FkZSgpIHsKLSAgICAgICAgICAgIHJldHVybiBuZXcgVG9zY2FPcGVyYXRpb25GYWNhZGUoKTsKKyAgICAgICAgICAgIHJldHVybiB0b3NjYU9wZXJhdGlvbkZhY2FkZTsKICAgICAgICAgfQogCiAgICAgICAgIEBCZWFuCkBAIC0yODEsNyArMjkzLDcgQEAKICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBVc2VyIGFkbWluVXNlciA9IG5ldyBVc2VyKCJhZG1pbiIsICJhZG1pbiIsICJhZG1pbiIsICJhZG1pbkBlbWFpbC5jb20iLCBSb2xlLkFETUlOLm5hbWUoKSwgU3lzdGVtLmN1cnJlbnRUaW1lTWlsbGlzKCkpOwogICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFVzZXIgZGVzaWduZXJVc2VyID0gbmV3IFVzZXIoImRlc2lnbmVyIiwgImRlc2lnbmVyIiwgImRlc2lnbmVyIiwgImRlc2lnbmVyQGVtYWlsLmNvbSIsIFJvbGUuREVTSUdORVIubmFtZSgpLCBTeXN0ZW0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY3VycmVudFRpbWVNaWxsaXMoKSk7Ci0gICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgVXNlciBvdGhlclVzZXIgPSBuZXcgVXNlcigib3RoZXIiLCAib3RoZXIiLCAib3RoZXIiLCAib3RoZXJAZW1haWwuY29tIiwgUm9sZS5PUFMubmFtZSgpLCBTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKSk7Cisg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AgICAgICB3aGVuKHVzZXJBZG1pbi5nZXRVc2VyKGRlc2lnbmVyVXNlci5nZXRVc2VySWQoKSwgZmFsc2UpKS50aGVuUmV0dXJuKGRlc2lnbmVyRWl0aGVyKTsKLSAgICAgICAgd2hlbih1c2VyQWRtaW4uZ2V0VXNlcihvdGhlclVzZXIuZ2V0VXNlcklkKCksIGZhbHNlKSkudGhlblJldHVybihvdGhlckVpdGhlcik7CisgICAgICAgIHdoZW4odXNlckFkbWluLmdldFVzZXIoYWRtaW5Vc2VyLmdldFVzZXJJZCgpLCBmYWxzZSkpLnRoZW5SZXR1cm4oYWRtaW5Vc2VyKTsKKyAgICAgICAgd2hlbih1c2VyQWRtaW4uZ2V0VXNlcihkZXNpZ25lclVzZXIuZ2V0VXNlcklkKCksIGZhbHNlKSkudGhlblJldHVybihkZXNpZ25lclVzZXIpOworICAgICAgICB3aGVuKHVzZXJBZG1pbi5nZXRVc2VyKG90aGVyVXNlci5nZXRVc2VySWQoKSwgZmFsc2UpKS50aGVuUmV0dXJuKG90aGVyVXNlcik7CiAgICAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAKLSAgICAgICAgU3RyaW5nIGFwcENvbmZpZ0RpciA9ICJzcmMvdGVzdC9yZXNvdXJjZXMvY29uZmlnL2NhdGFsb2ctYmUiOworICAgICAgICBTdHJpbmcgYXBwQ29uZmlnRGlyID0gInNyYy90ZXN0L3Jlc291cmNlcy9jb25maWciOwogICAgICAgICBDb25maWd1cmF0aW9uU291cmNlIGNvbmZpZ3VyYXRpb25Tb3VyY2UgPSBuZXcgRlNDb25maWd1cmF0aW9uU291cmNlKEV4dGVybmFsQ29uZmlndXJhdGlvbi5nZXRDaGFuZ2VMaXN0ZW5lcigpLCBhcHBDb25maWdEaXIpOwogICAgICAgICBDb25maWd1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A9IHJlZjsKICAgICAgICAgd2hlbihjb21wb25lbnRJbnN0YW5jZUJ1c2luZXNzTG9naWMKICAgICAgICAgICAgICAgICAuZGlzc29jaWF0ZVJJRnJvbVJJKGNvbXBvbmVudElkLCBVU0VSX0lELCByZWYsIENvbXBvbmVudFR5cGVFbnVtLmZpbmRCeVBhcmFtTmFtZShjb250YWluZXJDb21wb25lbnRUeXBlKSkpCiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oYWN0aW9uUmVzcG9uc2VFaXRoZXIpOwpAQCAtMzE3LDQgKzI5MiwxNDIgQEAKICAgICAgICAgd2hlbih3ZWJBcHBsaWNhdGlvbkNvbnRleHQuZ2V0QmVhbihTZXJ2bGV0VXRpbHMuY2xhc3MpKS50aGVuUmV0dXJuKHNlcnZsZXRVdGlscyk7CiAgICAgICAgIHdoZW4oc2VydmxldFV0aWxzLmdldENvbXBvbmVudHNVdGlscygpKS50aGVuUmV0dXJuKGNvbXBvbmVudHNVdGlscyk7CiAgICAgfQorCisgICAgQFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VXBkYXRlUmVzb3VyY2VJbnN0YW5jZVByb3BlcnRpZXNTdWNjZXNzKCl7CisKKyAgICAgICAgU3RyaW5nIGNvbnRhaW5lckNvbXBvbmVudFR5cGUgPSAic2VydmljZXMiOworICAgICAgICBTdHJpbmcgY29tcG9uZW50SWQgPSAiY29tcG9uZW50SWQiOworICAgICAgICBTdHJpbmcgcmVzb3VyY2VJbnN0YW5jZUlkID0gInJlc291cmNlSW5zdGFuY2VJZCI7CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkgW10gcHJvcGVydGllcyA9IG5ldyBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5WzFdOworICAgICAgICBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5IHByb3BlcnR5ID0gbmV3IENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkoKTsKKyAgICAgICAgcHJvcGVydHkuc2V0TmFtZSgicHJvcGVydHkiKTsKKyAgICAgICAgcHJvcGVydHkuc2V0VmFsdWUoInZhbHVlIik7CisgICAgICAgIHByb3BlcnR5LnNldFR5cGUoIlN0cmluZyIpOworICAgICAgICBwcm9wZXJ0aWVzWzBdID0gKHByb3BlcnR5KTsKKyAgICAgICAgT2JqZWN0TWFwcGVyIG1hcHBlciA9IG5ldyBPYmplY3RNYXBwZXIoKTsKKyAgICAgICAgU3RyaW5nIHByb3BlcnR5SnNvbiA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBwcm9wZXJ0eUpzb24gPSBtYXBwZXIud3JpdGVWYWx1ZUFzU3RyaW5nKHByb3BlcnRpZXMpOworICAgICAgICB9IGNhdGNoIChKc29uUHJvY2Vzc2luZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBwYXRoID0gIi92MS9jYXRhbG9nLyIgKyBjb250YWluZXJDb21wb25lbnRUeXBlICsgIi8iICsgY29tcG9uZW50SWQgKyAiL3Jlc291cmNlSW5zdGFuY2UiICsgIi8iICsKKyAgICAgICAgICAgICAgICByZXNvdXJjZUluc3RhbmNlSWQgKyAiL3Byb3BlcnRpZXMiOworICAgICAgICB3aGVuKGNvbXBvbmVudHNVdGlscy5jb252ZXJ0SnNvblRvT2JqZWN0VXNpbmdPYmplY3RNYXBwZXIocHJvcGVydHlKc29uLCBuZXcgVXNlcigpLCBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5W10uY2xhc3MsCisgICAgICAgICAgICAgICAgbnVsbCwgQ29tcG9uZW50VHlwZUVudW0uUkVTT1VSQ0VfSU5TVEFOQ0UpKS50aGVuUmV0dXJuKEVpdGhlci5sZWZ0KHByb3BlcnRpZXMpKTsKKyAgICAgICAgd2hlbihjb21wb25lbnRJbnN0YW5jZUJ1c2luZXNzTG9naWMuY3JlYXRlT3JVcGRhdGVQcm9wZXJ0a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nIGNvbXBvbmVudElkID0gImNvbXBvbmVudElkIjsKKyAgICAgICAgU3RyaW5nIHJlc291cmNlSW5zdGFuY2VJZCA9ICJyZXNvdXJjZUluc3RhbmNlSWQiOworICAgICAgICBDb21wb25lbnRJbnN0YW5jZUlucHV0W10gaW5wdXRzID0gbmV3IENvbXBvbmVudEluc3RhbmNlSW5wdXRbMV07CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlSW5wdXQgaW5wdXQgPSBuZXcgQ29tcG9uZW50SW5zdGFuY2VJbnB1dCgpOworICAgICAgICBpbnB1dC5zZXROYW1lKCJpbnB1dCIpOworICAgICAgICBpbnB1dC5zZXRWYWx1ZSgidmFsdWUiKTsKKyAgICAgICAgaW5wdXQuc2V0VHlwZSgiU3RyaW5nIik7CisgICAgICAgIGlucHV0c1swXSA9IChpbnB1dCk7CisgICAgICAgIE9iamVjdE1hcHBlciBtYXBwZXIgPSBuZXcgT2JqZWN0TWFwcGVyKCk7CisgICAgICAgIFN0cmluZyBpbnB1dEpzb24gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW5wdXRKc29uID0gbWFwcGVyLndyaXRlVmFsdWVBc1N0cmluZyhpbnB1dHMpOworICAgICAgICB9IGNhdGNoIChKc29uUHJvY2Vzc2luZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBwYXRoID0gIi92MS9jYXRhbG9nLyIgKyBjb250YWluZXJDb21wb25lbnRUeXBlICsgIi8iICsgY29tcG9uZW50SWQgKyAiL3Jlc291cmNlSW5zdGFuY2UiICsgIi8iICsKKyAgICAgICAgICAgICAgICByZXNvdXJjZUluc3RhbmNlSWQgKyAiL2lucHV0cyI7CisgICAgICAgIHdoZW4oY29tcG9uZW50c1V0aWxzLmNvbnZlcnRKc29uVG9PYmplY3RVc2luZ09iamVjdE1hcHBlcihpbnB1dEpzb24sIG5ldyBVc2VyKCks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2V0U3RhdHVzKCkpLmlzRXF1YWxUbyhIdHRwU3RhdHVzLk9LXzIwMCk7CisgICAgfQorCisgICAgQFRlc3QKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VXBkYXRlUmVzb3VyY2VJbnN0YW5jZVByb3BlcnRpZXNGYWlsdXJlKCl7CisKKyAgICAgICAgU3RyaW5nIGNvbnRhaW5lckNvbXBvbmVudFR5cGUgPSAic2VydmljZXMiOworICAgICAgICBTdHJpbmcgY29tcG9uZW50SWQgPSAiY29tcG9uZW50SWQiOworICAgICAgICBTdHJpbmcgcmVzb3VyY2VJbnN0YW5jZUlkID0gInJlc291cmNlSW5zdGFuY2VJZCI7CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkgW10gcHJvcGVydGllcyA9IG5ldyBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5WzFdOworICAgICAgICBDb21wb25lbnRJbnN0YW5jZVByb3BlcnR5IHByb3BlcnR5ID0gbmV3IENvbXBvbmVudEluc3RhbmNlUHJvcGVydHkoKTsKKyAgICAgICAgcHJvcGVydHkuc2V0TmFtZSgicHJvcGVydHkiKTsKKyAgICAgICAgcHJvcGVydHkuc2V0VmFsdWUoInZhbHVlIik7CisgICAgICAgIHByb3BlcnR5LnNldFR5cGUoIlN0cmluZyIpOworICAgICAgICBwcm9wZXJ0aWVzWzBdID0gKHByb3BlcnR5KTsKKyAgICAgICAgT2JqZWN0TWFwcGVyIG1hcHBlciA9IG5ldyBPYmplY3RNYXBwZXIoKTsKKyAgICAgICAgU3RyaW5nIHByb3BlcnR5SnNvbiA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBwcm9wZXJ0eUpzb24gPSBtYXBwZXIud3JpdGVWYWx1ZUFzU3RyaW5nKHByb3BlcnRpZXMpOworICAgICAgICB9IGNhdGNoIChKc29uUHJvY2Vzc2luZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOwor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QWN0aW9uU3RhdHVzLlJFU09VUkNFX05PVF9GT1VORCkpLnRoZW5SZXR1cm4ocmVzcG9uc2VGb3JtYXQpOworICAgICAgICBSZXNwb25zZSByZXNwb25zZSA9IHRhcmdldCgpCisgICAgICAgICAgICAgICAgLnBhdGgocGF0aCkKKyAgICAgICAgICAgICAgICAucmVxdWVzdChNZWRpYVR5cGUuQVBQTElDQVRJT05fSlNPTikKKyAgICAgICAgICAgICAgICAuaGVhZGVyKCJVU0VSX0lEIiwgVVNFUl9JRCkucG9zdChFbnRpdHkuZW50aXR5KHByb3BlcnRpZXMsIE1lZGlhVHlwZS5BUFBMSUNBVElPTl9KU09OKSk7CisgICAgICAgIGFzc2VydFRoYXQocmVzcG9uc2UuZ2V0U3RhdHVzKCkpLmlzRXF1YWxUbyhIdHRwU3RhdHVzLk5PVF9GT1VORF80MDQpOworICAgIH0KKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgdGVzdFVwZGF0ZVJlc291cmNlSW5zdGFuY2VJbnB1dHNGYWlsdXJlKCl7CisKKyAgICAgICAgU3RyaW5nIGNvbnRhaW5lckNvbXBvbmVudFR5cGUgPSAic2VydmljZXMiOworICAgICAgICBTdHJpbmcgY29tcG9uZW50SWQgPSAiY29tcG9uZW50SWQiOworICAgICAgICBTdHJpbmcgcmVzb3VyY2VJbnN0YW5jZUlkID0gInJlc291cmNlSW5zdGFuY2VJZCI7CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlSW5wdXQgW10gaW5wdXRzID0gbmV3IENvbXBvbmVudEluc3RhbmNlSW5wdXRbMV07CisgICAgICAgIENvbXBvbmVudEluc3RhbmNlSW5wdXQgaW5wdXQgPSBuZXcgQ29tcG9uZW50SW5zdGFuY2VJbnB1dCgpOworICAgICAgICBpbnB1dC5zZXROYW1lKCJpbnB1dCIpOworICAgICAgICBpbnB1dC5zZXRWYWx1ZSgidmFsdWUiKTsKKyAgICAgICAgaW5wdXQuc2V0VHlwZSgiU3RyaW5nIik7CisgICAgICAgIGlucHV0c1swXSA9IChpbnB1dCk7CisgICAgICAgIE9iamVjdE1hcHBlciBtYXBwZXIgPSBuZXcgT2JqZWN0TWFwcGVyKCk7CisgICAgICAgIFN0cmluZyBpbnB1dEpzb24gPSBudWxsOworICAgICAgICB0cnkgeworICAgICAgICAgICAgaW5wdXRKc29uID0gbWFwcGVyLndyaXRlVmFsdWVBc1N0cmluZyhpbnB1dHMpOworICAgICAgICB9IGNhdGNoIChKc29uUHJvY2Vzc2luZ0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOworICAgICAgICB9CisgICAgICAgIFN0cmluZyBwYXRoID0gIi92MS9jYXRhbG9nLyIgKyBjb250YWluZXJDb21wb25lbnRUeXBlICsgIi8iICsgY29tcG9uZW50SWQgKyAiL3Jlc291cmNlSW5zdGFuY2UiICsgIi8iICsKKyAgICAgICAgICAgICAgICByZXNvdXJjZUluc3RhbmNlSWQgKyAiL2lucHV0cyI7CisgICAgICAgIHdoZW4oY29tcG9uZW50c1V0aWxzLmNvbnZlcnRKc29uVG9PYmplY3RVc2luZ09iamVjdE1hcHBlcihpbnB1dEpzb24sIG5ldyBVc2VyKCksIENvbXBvbmVudEluc3RhbmNlSW5wdXRbXS5jbGFzcywKKyAgICAgICAgICAgICAgICBudWxsLCBDb21wb25lbnRUeXBlRW51bS5SRVNPVVJDRV9JTlNUQU5DRSkpLnRoZW5SZXR1cm4oRWl0aGVyLmxlZnQoaW5wdXRzKSk7CisgICAgICAgIHdoZW4oY29tcG9uZW50SW5zdGFuY2VCdXNpbmVzc0xvZ2ljLmNyZWF0ZU9yVXBkYXRlSW5zdGFuY2VJbnB1dFZhbHVlcyhlcShDb21wb25lbnRUeXBlRW51bS5maW5kQnlQYXJhbU5hbWUoU0VSVklDRV9QQVJBTV9OQU1FKSksCisgICAgICAgICAgICAgICAgZXEoY29tcG9uZW50SWQpLCBlcShyZXNvdXJjZUluc3RhbmNlSWQpLCBlcShBc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3NlcnZsZXRzL0NvbnN1bWVyU2VydmxldFRlc3QuamF2YSBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9zZXJ2bGV0cy9Db25zdW1lclNlcnZsZXRUZXN0LmphdmEKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDZhYTExYTYuLjAwMDAwMDAKLS0tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL3NlcnZsZXRzL0NvbnN1bWVyU2VydmxldFRlc3QuamF2YQorKysgL2Rldi9udWxsCkBAIC0xLDExMyArMCwwIEBACi0vKi0KLSAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBTREMKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBDb3B5cmlnaHQgKEMpIDIwMTkgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqIAotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMv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tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL3NlcnZsZXRzL0NzYXJCdWlsZFNlcnZsZXRUZXN0LmphdmEKKysrIC9kZXYvbnVsbApAQCAtMSw4MSArMCwwIEBACi0vKi0KLSAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBTREMKLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBDb3B5cmlnaHQgKEMpIDIwMTkgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqIAotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqIAotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJV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AvdWkiOwogCQl3aGVuKGVsZW1lbnRCdXNpbmVzc0xvZ2ljLmdldEFsbEFydGlmYWN0VHlwZXMoZGVzaWduZXJVc2VyLmdldFVzZXJJZCgpKSkKIAkJCQkudGhlblRocm93KG5ldyBSdW50aW1lRXhjZXB0aW9uKCJUZXN0IGV4Y2VwdGlvbjogYXJ0aWZhY3RUeXBlcyIpKTsKIApkaWZmIC0tZ2l0IGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL3NlcnZsZXRzL0V4Y2VwdGlvbkhhbmRsZXJFbmRwb2ludFRlc3QuamF2YSBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9zZXJ2bGV0cy9FeGNlcHRpb25IYW5kbGVyRW5kcG9pbnRUZXN0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDc0MzVjNAotLS0gL2Rldi9udWxsCisrKyBiL2NhdGFsb2ctYmUvc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9iZS9zZXJ2bGV0cy9FeGNlcHRpb25IYW5kbGVyRW5kcG9pbnRUZXN0LmphdmEKQEAgLTAsMCArMSw3NyBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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ZW50c1V0aWxzIGNvbXBvbmVudFV0aWxzOworCisgICAgQG9yZy5zcHJpbmdmcmFtZXdvcmsuY29udGV4dC5hbm5vdGF0aW9uLkNvbmZpZ3VyYXRpb24KKyAgICBASW1wb3J0KEJhc2VUZXN0Q29uZmlnLmNsYXNzKQorICAgIHN0YXRpYyBjbGFzcyBFeGNlcHRpb25IYW5kbGVyQ29uZmlnIHsKKworICAgICAgICBAQmVhbgorICAgICAgICBFeGNlcHRpb25IYW5kbGVyRW5kcG9pbnQgZXhjZXB0aW9uSGFuZGxlckVuZHBvaW50KCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBFeGNlcHRpb25IYW5kbGVyRW5kcG9pbnQoY29tcG9uZW50VXRpbHMpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgY29uZmlndXJlQ2xpZW50KENsaWVudENvbmZpZyBjb25maWcpIHsKKyAgICAgICAgZmluYWwgSmFja3Nvbkpzb25Qcm92aWRlciBqYWNrc29uSnNvblByb3ZpZGVyID0gbmV3IEphY2tzb25KYXhiSnNvblByb3ZpZGVyKCkKKyAgICAgICAgICAgICAgICAuY29uZmlndXJlKERlc2VyaWFsaXphdGlvbkZlYXR1cmUuRkFJTF9PTl9VTktOT1dOX1BST1BFUlRJRVMsIGZhbHNlKTsKKyAgICAgICAgY29uZmlnLnJlZ2lzdGVyKGphY2tzb25Kc29uUHJvdmlkZXIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBSZXNvdXJjZUNvbmZpZyBjb25maWd1cmUoKSB7CisgICAgICAgIGNvbXBvbmVudFV0aWxzID0gbW9jayhDb21wb25lbnRzVXRpbHMuY2xhc3MpOworCisgICAgICAgIHJldHVybiBzdXBlci5jb25maWd1cmUoRXhjZXB0aW9uSGFuZGxlckNvbmZpZy5jbGFzcykKKyAgICAgICAgICAgICAgICAucmVnaXN0ZXIoRXhjZXB0aW9uSGFuZGxl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cyk7CisgICAgICAgICAgICBDb21wb25lbnRzVXRpbHMgY29tcG9uZW50c1V0aWxzID0gbW9jayhDb21wb25lbnRzVXRpbHMuY2xhc3MpOworCisgICAgICAgICAgICByZXR1cm4gbmV3IEdyb3VwRW5kcG9pbnQodXNlckJ1c2luZXNzTG9naWMsIGNvbXBvbmVudHNVdGlscywgZ3JvdXBCdXNpbmVzc0xvZ2ljKCkpOwogICAgICAgICB9CiAKICAgICAgICAgQEJlYW4KQEAgLTE2OCw5ICsxNzYsOSBAQAogICAgICAgICB3aGVuKGFjY2Vzc1ZhbGlkYXRpb25zLnZhbGlkYXRlVXNlckNhblJldHJpZXZlQ29tcG9uZW50RGF0YShlcShWQUxJRF9DT01QT05FTlRfSUQpLCBlcSgicmVzb3VyY2VzIiksIGVxKFZBTElEX1VTRVIpLCBhbnlTdHJpbmcoKSkpCiAgICAgICAgICAgICAgICAgLnRoZW5SZXR1cm4oY3IpOwogICAgICAgICB3aGVuKGNvbXBvbmVudFZhbGlkYXRpb25zLmdldENvbXBvbmVudEluc3RhbmNlKGNyLCBBKSkudGhlblJldHVybihPcHRpb25hbC5vZihjaSkpOwotICAgICAgICBkb05vdGhpbmcoKS53aGVuKGdyb3Vwc09wZXJhdGlvbikudXBkYXRlR3JvdXBPbkNvbXBvbmVudChlcShWQUxJRF9DT01QT05FTlRfSUQpLCBpc0EoR3JvdXBEZWZpbml0aW9uLmNsYXNzKSk7CisgICAgICAgIGRvTm90aGluZygpLndoZW4oZ3JvdXBzT3BlcmF0aW9uKS51cGRhdGVHcm91cE9uQ29tcG9uZW50KGVxKFZBTElEX0NPTVBPTkVOVF9JRCksIGlzQShHcm91cERlZmluaXRpb24uY2xhc3MpLCBhbnkoUHJvbW90ZVZlcnNpb25FbnVtLmNsYXNzKSk7CiAgICAgICAgIHdoZW4oZ3JvdXBPcGVyYXRpb24udmFsaWRhdGVBbmRVcGRhdGVQcm9wZXJ0eVZhbHVlKGlzQShHcm91cFByb3BlcnR5LmNsYXNz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pZ3VyYXRpb25Tb3VyY2UpOworCiAgICAgQEJlZm9yZUNsYXNzCiAgICAgcHVibGljIHN0YXRpYyB2b2lkIGNvbmZpZ3VyZU1vY2tzKCkgewogICAgICAgICByZXF1ZXN0ID0gbW9jayhIdHRwU2VydmxldFJlcXVlc3QuY2xhc3MpOwpAQCAtMTIwLDYgKzEzNiw4IEBACiAgICAgICAgIGNvbXBvbmVudHNVdGlscyA9IG1vY2soQ29tcG9uZW50c1V0aWxzLmNsYXNzKTsKICAgICAgICAgc2VydmxldFV0aWxzID0gbW9jayhTZXJ2bGV0VXRpbHMuY2xhc3MpOwogICAgICAgICByZXNvdXJjZUltcG9ydE1hbmFnZXIgPSBtb2NrKFJlc291cmNlSW1wb3J0TWFuYWdlci5jbGFzcyk7CisKKwogICAgIH0KIAogICAgIEBCZWZvcmUKQEAgLTE1Miw2ICsxNzAsNyBAQAogICAgICAgICAgICAgc2VydmxldFV0aWxzLCByZXNvdXJjZUltcG9ydE1hbmFnZXIsIGRhdGFUeXBlQnVzaW5lc3NMb2dpYyk7CiAgICAgICAgIFJlc291cmNlQ29uZmlnIHJlc291cmNlQ29uZmlnID0gbmV3IFJlc291cmNlQ29uZmlnKCkKICAgICAgICAgICAgIC5yZWdpc3RlcihpbnB1dHNTZXJ2bGV0KQorICAgICAgICAgICAgLnJlZ2lzdGVyKG5ldyBDb21wb25lbnRFeGNlcHRpb25NYXBwZXIoY29tcG9uZW50c1V0aWxzKSkKICAgICAgICAgICAgIC5yZWdpc3RlcihuZXcgQWJzdHJhY3RCaW5kZXIoKSB7CiAgICAgICAgICAgICAgICAgQE92ZXJyaWRlCiAgICAgICAgICAgICAgICAgcHJvdGVjdGVkIHZvaWQgY29uZmlndXJlKCkgewpAQCAtMTY0LDYgKzE4Myw5IEBACiAgICAgICAgIHJldHVybiByZXNvdXJjZUNvbmZpZzsKICAgICB9CiAKKworCisKICAgICBwcml2YXRlIElucHV0RGVmaW5pdGlvbiBzZXRVcExpc3RJbnB1dCgp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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKiAKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKiAKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVu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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKiAKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKiAKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0Y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HJlcXVlc3QuZ2V0U2Vzc2lvbigpKS50aGVuUmV0dXJuKHNlc3Npb24pOwotICAgICAgICAgICAgICAgICAgICAgICAgd2hlbihzZXNzaW9uLmdldFNlcnZsZXRDb250ZXh0KCkpLnRoZW5SZXR1cm4oc2VydmxldENvbnRleHQpOwotICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGFwcENvbmZpZ0RpciA9ICJzcmMvdGVzdC9yZXNvdXJjZXMvY29uZmlnL2NhdGFsb2ctYmUiOwotICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlndXJhdGlvblNvdXJjZSBjb25maWd1cmF0aW9uU291cmNlID0gbmV3IEZTQ29uZmlndXJhdGlvblNvdXJjZShFeHRlcm5hbENvbmZpZ3VyYXRpb24uZ2V0Q2hhbmdlTGlzdGVuZXIoKSwgYXBwQ29uZmlnRGlyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb25NYW5hZ2VyIGNvbmZpZ3VyYXRpb25NYW5hZ2VyID0gbmV3IENvbmZpZ3VyYXRpb25NYW5hZ2VyKGNvbmZpZ3VyYXRpb25Tb3VyY2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgbWFuZGF0b3J5SGVhZGVyIDogY29uZmlndXJhdGlvbk1hbmFnZXIuZ2V0Q29uZmlndXJhdGlvbigpLmdldElkZW50aWZpY2F0aW9uSGVhZGVyRmllbGRzKCkpIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4ocmVxdWVzdC5nZXRIZWFkZXIobWFuZGF0b3J5SGVhZGVyKSkudGhlblJldHVybihtYW5kYXRvcnlIZWFkZXIpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4oc2VydmxldENvbnRleHQuZ2V0QXR0cmlidXRlKENvbnN0YW50cy5DT05GSUdVUkFUSU9OX01BTkFHRVJfQVRUUikpLnRoZW5SZXR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C5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsMTIyICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICogCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICogCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2U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Bwcml2YXRlIHN0YXRpYyBFaXRoZXI8VXNlciwgQWN0aW9uU3RhdHVzPiBidWlsZEVpdGhlclVzZXIoU3RyaW5nIHVzZXJJZCwgYm9vbGVhbiBpc0FjdGl2ZSkgewotICAgICAgICBVc2VyIHVzZXIgPSBuZXcgVXNlcigpOwotICAgICAgICB1c2VyLnNldFVzZXJJZCh1c2VySWQpOwotICAgICAgICB1c2VyLnNldFJvbGUoVXNlclJvbGVFbnVtLkFETUlOLmdldE5hbWUoKSk7Ci0gICAgICAgIGlmICghaXNBY3RpdmUpIHsKLSAgICAgICAgICAgIHVzZXIuc2V0U3RhdHVzKFVzZXJTdGF0dXNFbnVtLklOQUNUSVZFKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gRWl0aGVyLmxlZnQodXNlcik7Ci0gICAgfQotCi19CmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvYmUvc2VydmxldHMvVXNlckVuZHBvaW50VGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL3NlcnZsZXRzL1VzZXJFbmRwb2ludFRlc3QuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mYzE4NDU5Ci0tLSAvZGV2L251bGwKKysrIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2JlL3NlcnZsZXRzL1VzZXJFbmRwb2ludFRlc3QuamF2YQpAQCAtMCwwICsxLDI0NCBAQAorLyotCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogU0RDCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDIwIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KKworcGFja2FnZSBvcmcub3BlbmVjb21wLnNkYy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W9uRmVhdHVyZS5GQUlMX09OX1VOS05PV05fUFJPUEVSVElFUywgZmFsc2UpOworICAgICAgICBjb25maWcucmVnaXN0ZXIoamFja3Nvbkpzb25Qcm92aWRlcik7CisgICAgICAgIGNvbmZpZy5yZWdpc3RlcihNdWx0aVBhcnRGZWF0dXJlLmNsYXNzKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgUmVzb3VyY2VDb25maWcgY29uZmlndXJlKCkgeworICAgICAgICByZXR1cm4gc3VwZXIuY29uZmlndXJlKFVzZXJFbmRwb2ludFRlc3QuVXNlclRlc3RDb25maWcuY2xhc3MpCisgICAgICAgICAgICAgICAgLnJlZ2lzdGVyKFVzZXJBZG1pblNlcnZsZXQuY2xhc3MpCisgICAgICAgICAgICAgICAgLnByb3BlcnR5KExvZ2dpbmdGZWF0dXJlLkxPR0dJTkdfRkVBVFVSRV9MT0dHRVJfTEVWRUxfU0VSVkVSLCAiV0FSTklORyIpOworICAgIH0KKworICAgIEBUZXN0CisgICAgcHVibGljIHZvaWQgZ2V0VXNlcl9zdWNjZXNzKCkgeworICAgICAgICBVc2VyIHVzZXIgPSB0YXJnZXQoKS5wYXRoKCIvdjEvdXNlci8iICsgVVNFUl9JRCkKKyAgICAgICAgICAgICAgICAucmVxdWVzdChNZWRpYVR5cGUuQVBQTElDQVRJT05fSlNPTikKKyAgICAgICAgICAgICAgICAuaGVhZGVyKENvbnN0YW50cy5VU0VSX0lEX0hFQURFUiwgVVNFUl9JRCkKKyAgICAgICAgICAgICAgICAuZ2V0KFVzZXIuY2xhc3MpOworICAgICAgICBhc3NlcnRUaGF0KHVzZXIuZ2V0VXNlcklkKCkpLmlzRXF1YWxUbyhVU0VSX0lEKTsKKyAgICB9CisKKyAgICBAVGVzdAorICAgIHB1YmxpYyB2b2lkIGdldFVzZXJSb2xlX3N1Y2Nlc3MoKSB7CisgICAgICAgIFN0cmluZyByZXN1bHQgPSB0YXJnZXQoKS5wYXRoK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TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIFNEQworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAyMCBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICoKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGlta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RpdmVVc2VyKG51bGwpKS5pc0ZhbHNlKCk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICBUaHJlYWRMb2NhbHNIb2xkZXIuc2V0VXNlckNvbnRleHQob3JpZ2luYWxVc2VyQ29udGV4dCk7CisgICAgICAgIH0KKyAgICB9CiB9CmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvY29tbW9uL3RyYW5zYWN0aW9uL2ltcGwvRVNBY3Rpb25UZXN0LmphdmEgYi9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvY29tbW9uL3RyYW5zYWN0aW9uL2ltcGwvRVNBY3Rpb25UZXN0LmphdmEKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGE1ZWE3YzMuLjAwMDAwMDAKLS0tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2NvbW1vbi90cmFuc2FjdGlvbi9pbXBsL0VTQWN0aW9uVGVzdC5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsNDkgKzAsMCBAQAotLyotCi0gKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcG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vc3JjL3Rlc3QvamF2YS9vcmcvb3BlbmVjb21wL3NkYy9jb21tb24vdHJhbnNhY3Rpb24vbW5nci9Sb2xsYmFja01hbmFnZXJUZXN0LmphdmEKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDkwOWJhNjQuLjAwMDAwMDAKLS0tIGEvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2NvbW1vbi90cmFuc2FjdGlvbi9tbmdyL1JvbGxiYWNrTWFuYWdlclRlc3QuamF2YQorKysgL2Rldi9udWxsCkBAIC0xLDY1ICswLDAgQEAKLS8qLQotICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIFNEQwotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAqIENvcHlyaWdodCAoQykgMjAxOSBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KLSAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICogCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICogCi0gKiBVbmxlc3MgcmV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gICAgICAgICB9Ci0gICAgICAgIH07Ci0gICAgfQotCi0gICAgcHVibGljIGludCBnZXROZXh0VHJhbnNhY3Rpb25JZCgpIHsKLSAgICAgICAgdHJhbnNhY3Rpb25JZCsrOwotICAgICAgICByZXR1cm4gdHJhbnNhY3Rpb25JZDsKLSAgICB9Ci19CmRpZmYgLS1naXQgYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvY29tbW9uL3RyYW5zYWN0aW9uL21uZ3IvVHJhbnNhY3Rpb25NYW5hZ2VyVGVzdC5qYXZhIGIvY2F0YWxvZy1iZS9zcmMvdGVzdC9qYXZhL29yZy9vcGVuZWNvbXAvc2RjL2NvbW1vbi90cmFuc2FjdGlvbi9tbmdyL1RyYW5zYWN0aW9uTWFuYWdlclRlc3QuamF2YQpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMmU2ODVhOC4uMDAwMDAwMAotLS0gYS9jYXRhbG9nLWJlL3NyYy90ZXN0L2phdmEvb3JnL29wZW5lY29tcC9zZGMvY29tbW9uL3RyYW5zYWN0aW9uL21uZ3IvVHJhbnNhY3Rpb25NYW5hZ2VyVGVzdC5qYXZhCisrKyAvZGV2L251bGwKQEAgLTEsNzIgKzAsMCBAQAotLyotCi0gKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogU0RDCi0gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICogQ29weXJpZ2h0IChDKSAyMDE5IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgotICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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jIFRoZSBpbnRlcnZhbCB0byB0cnkgYW5kIHJlY29ubmVjdCB0byBqYW51c0dyYXBoIERCIHdoZW4gaXQgaXMgZG93biBkdXJpbmcgQVNEQyBzdGFydHVwOgoramFudXNHcmFwaFJlY29ubmVjdEludGVydmFsSW5TZWNvbmRzOiAzCisKKyMgVGhlIHJlYWQgdGltZW91dCB0b3dhcmRzIFRpdGFuIERCIHdoZW4gaGVhbHRoIGNoZWNrIGlzIGludm9rZWQ6CitqYW51c0dyYXBoSGVhbHRoQ2hlY2tSZWFkVGltZW91dDogMQorCit1ZWJIZWFsdGhDaGVja1JlY29ubmVjdEludGVydmFsSW5TZWNvbmRzOiAxNQordWViSGVhbHRoQ2hlY2tSZWFkVGltZW91dDogNAorCisjIFByb3RvY29scworcHJvdG9jb2xzOgorICAgLSBodHRwCisgICAtIGh0dHBzCisKKyMgRGVmYXVsdCBpbXBvcnRzCitkZWZhdWx0SW1wb3J0czoKKyAgIC0gbm9kZXM6CisgICAgICAgIGZpbGU6IG5vZGVzLnltbAorICAgLSBkYXRhdHlwZXM6CisgICAgICAgIGZpbGU6IGRhdGEueW1sCisgICAtIGNhcGFiaWxpdGllczoKKyAgICAgICAgZmlsZTogY2FwYWJpbGl0aWVzLnltbAorICAgLSByZWxhdGlvbnNoaXBzOgorICAgICAgICBmaWxlOiByZWxhdGlvbnNoaXBzLnltbAorICAgLSBncm91cHM6CisgICAgICAgIGZpbGU6IGdyb3Vwcy55bWwKKyAgIC0gcG9saWNpZXM6CisgICAgICAgIGZpbGU6IHBvbGljaWVzLnltbAorCisjIFVzZXJzCit1c2VyczoKKyAgICB0b206IHBhc3N3ZAorICAgIGJvYjogcGFzc3dkCisKK25lbzRqOgorICAgIGhvc3Q6IG5lbzRqaG9zdAorICAgIHBvcnQ6IDc0NzQKKyAgICB1c2VyOiBuZW80agorICAgIHBhc3N3b3JkOiAiMTIzNDUiCisKK2Nhc3NhbmRyYUNvbmZpZzoKKyAgICBjYXNzYW5kcmFIb3N0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MzAKKyAgbWluTWludXRlczogMQorICBtYXhNaW51dGVzOiAxMjAKKworc2VydmljZURlcGxveW1lbnRBcnRpZmFjdHM6CisgICAgWUFOR19YTUw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbAorICAgIFZORl9DQVRBTE9HOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB4bWwKKyAgICBNT0RFTF9JTlZFTlRPUllfUFJPRklMRToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgTU9ERUxfUVVFUllfU1BFQzoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgVUNQRV9MQVlFUl8yX0NPTkZJR1VSQVRJT046CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbAorCisjQUFJIEFydGlmYWN0cworICAgIEFBSV9TRVJWSUNFX01PREVMOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB4bWwKKyAgICBBQUlfVkZfTU9EVUxFX01PREVMOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB4bWwKKyAgICBBQUlfVkZfSU5TVEFOQ0VfTU9ERUw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbCAKKyAgICBPVEhFUjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKworcmVzb3VyY2VEZXBsb3ltZW50QXJ0aWZhY3RzOgorICAgIEhFQVQ6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHlhbWwKKyAgICAgICAgICAgIC0geW1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBIRUFUX1ZPTDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geWFtbAorICAgICAgICAgICAgLSB5bWwKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIEhFQVRfTkVUOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB5YW1sCisgICAgICAgICAgICAtIHltbAorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgSEVBVF9ORVNURUQ6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHlhbWwKKyAgICAgICAgICAgIC0geW1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBIRUFUX0FSVElGQUNUOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgWUFOR19YTUw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbAorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgVk5GX0NBVEFMT0c6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbAorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgVkZfTElDRU5TRToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBWRU5ET1JfTElDRU5TRToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBNT0RFTF9JTlZFTlRPUllfUFJPRklMRToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBNT0RFTF9RVUVSWV9TUEVDOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB4bWwKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIExJRkVDWUNMRV9PUEVSQVRJT05TOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSB5YW1sCisgICAgICAgICAgICAtIHltbAorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6CisgICAgICAgICAgICAtIFZGCisgICAgICAgICAgICAtIFZGQworICAgIFZFU19FVkVOVFM6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHlhbWwKKyAgICAgICAgICAgIC0geW1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBQRVJGT1JNQU5DRV9DT1VOVEVSOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICAgICAgLSBjc3YKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIEFQUENfQ09ORklHOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6CisgICAgICAgICAgICAtIFZGCisgICAgRENBRV9UT1NDQToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geW1sCisgICAgICAgICAgICAtIHlhbWwKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOgorICAgICAgICAgICAgLSBWRgorICAgICAgICAgICAgLSBWRkNNVAorICAgIERDQUVfSlNPTjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0ganNvbgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6CisgICAgICAgICAgICAtIFZGCisgICAgICAgICAgICAtIFZGQ01UCisgICAgRENBRV9QT0xJQ1k6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIGVtZgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6CisgICAgICAgICAgICAtIFZGCisgICAgICAgICAgICAtIFZGQ01UCisgICAgRENBRV9ET0M6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczoKKyAgICAgICAgICAgIC0gVkYgCisgICAgICAgICAgICAtIFZGQ01UICAgICAgIAorICAgIERDQUVfRVZFTlQ6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczoKKyAgICAgICAgICAgIC0gVkYKKyAgICAgICAgICAgIC0gVkZDTVQKKyAgICBBQUlfVkZfTU9ERUw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHhtbAorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6CisgICAgICAgICAgICAtIFZGCisgICAgQUFJX1ZGX01PRFVMRV9NT0RFTDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0geG1sCisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczoKKyAgICAgICAgICAgIC0gVkYKKyAgICBPVEhFUjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIFNOTVBfUE9MTDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIFNOTVBfVFJBUDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworCityZXNvdXJjZUluc3RhbmNlRGVwbG95bWVudEFydGlmYWN0czoKKyAgICBIRUFUX0VOVjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0gZW52CisgICAgVkZfTU9EVUxFU19NRVRBREFUQToKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0ganNvbgorICAgIFZFU19FVkVOVFM6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHlhbWwKKyAgICAgICAgICAgIC0geW1sCisgICAgUEVSRk9STUFOQ0VfQ09VTlRFUjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0gY3N2CisgICAgRENBRV9JTlZFTlRPUllfVE9TQ0E6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIHltbAorICAgICAgICAgICAgLSB5YW1sCisgICAgRENBRV9JTlZFTlRPUllfSlNPTjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgICAgIC0ganNvbgorICAgIERDQUVfSU5WRU5UT1JZX1BPTElDWToKKyAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgICAgICAtIGVtZgorICAgIERDQUVfSU5WRU5UT1JZX0RPQzoKKyAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgRENBRV9JTlZFTlRPUllfQkxVRVBSSU5UOgorICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICBEQ0FFX0lOVkVOVE9SWV9FVkVOVDoKKyAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgU05NUF9QT0xMOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgU05NUF9UUkFQOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisKK3Jlc291cmNlSW5mb3JtYXRpb25hbEFydGlmYWN0czoKKyAgICBDSEVGOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgUFVQUEVUOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgU0hFTEw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBZQU5HOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgWUFOR19YTUw6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBIRUFUOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgQlBFTDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIERHX1hNTDoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAqYWxsUmVzb3VyY2VUeXBlcworICAgIE1VUkFOT19QS0c6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczogKmFsbFJlc291cmNlVHlwZXMKKyAgICBPVEhFUjoKKyAgICAgICAgYWNjZXB0ZWRUeXBlczoKKyAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOiAKKyAgICAgICAgICAgIC0gVkZDCisgICAgICAgICAgICAtIENWRkMKKyAgICAgICAgICAgIC0gQ1AKKyAgICAgICAgICAgIC0gVkwKKyAgICAgICAgICAgIC0gVkYKKyAgICAgICAgICAgIC0gVkZDTVQKKyAgICAgICAgICAgIC0gQWJzdHJhY3QKKyAgICAgICAgICAgIC0gUE5GCisgICAgU05NUF9QT0xMOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgU05NUF9UUkFQOgorICAgICAgICBhY2NlcHRlZFR5cGVzOgorICAgICAgICB2YWxpZEZvclJlc291cmNlVHlwZXM6ICphbGxSZXNvdXJjZVR5cGVzCisgICAgR1VJREU6CisgICAgICAgIGFjY2VwdGVkVHlwZXM6CisgICAgICAgIHZhbGlkRm9yUmVzb3VyY2VUeXBlczoKKyAgICAgICAgICAgIC0gVkYKKyAgICAgICAgICAgIC0gVkZDCisgICAgICAgICAgICAtIENWRkMKKworcmVzb3VyY2VJbmZvcm1hdGlvbmFsRGVwbG95ZWRBcnRpZmFjdHM6CisKK3VuTG9nZ2VkVXJsczoKKyAgIC0gL3NkYzIvcmVzdC9oZWFsdGhDaGVjaworCitjbGVhbkNvbXBvbmVudHNDb25maWd1cmF0aW9uOgorICAgIGNsZWFuSW50ZXJ2YWxJbk1pbnV0ZXM6IDE0NDAKKyAgICBjb21wb25lbnRzVG9DbGVhbjoKKyAgICAgICAtIFJlc291cmNlCisgICAgICAgLSBT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NhdGVnb3J5OgogICAtIEdlbmVyaWMKIGV4Y2x1ZGVSZXNvdXJjZVR5cGU6Ci0gIC0gUE5GICAKKyAgLSBQTkYKIGluZm9ybWF0aW9uYWxSZXNvdXJjZUFydGlmYWN0czoKICAgZmVhdHVyZXM6CiAgICAgICBkaXNwbGF5TmFtZTogRmVhdHVyZXMKQEAgLTI5Myw3ICsyNjksMTAgQEAKICAgICBpc1Byb3h5OiBmYWxzZQogICAgIHByb2JlSW50ZXJ2YWxJblNlY29uZHM6IDE1CiAKLWRlZmF1bHRIZWF0QXJ0aWZhY3RUaW1lb3V0TWludXRlczogNjAKK2hlYXRBcnRpZmFjdERlcGxveW1lbnRUaW1lb3V0OgorICBkZWZhdWx0TWludXRlczogMzAKKyAgbWluTWludXRlczogMQorICBtYXhNaW51dGVzOiAxMjAKIAogc2VydmljZURlcGxveW1lbnRBcnRpZmFjdHM6CiAgICAgWUFOR19YTUw6CkBAIC0zMjEsNyArMzAwLDcgQEAKICAgICAgICAgICAgIC0geG1sCiAgICAgQUFJX1ZGX0lOU1RBTkNFX01PREVMOgogICAgICAgICBhY2NlcHRlZFR5cGVzOgotICAgICAgICAgICAgLSB4bWwgCisgICAgICAgICAgICAtIHhtbAogICAgIE9USEVSOgogICAgICAgICBhY2NlcHRlZFR5cGVzOgogCkBAIC00MTUsOCArMzk0LDggQEAKICAgICBEQ0FFX0RPQzoKICAgICAgICAgYWNjZXB0ZWRUeXBlczoKICAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOgotICAgICAgICAgICAgLSBWRiAKLSAgICAgICAgICAgIC0gVkZDTVQgICAgICAgCisgICAgICAgICAgICAtIFZGCisgICAgICAgICAgICAtIFZGQ01UCiAgICAgRENBRV9FVkVOVDoKICAgICAgICAgYWNjZXB0ZWRUeXBlczoKICAgICAgICAgdmFsaWRGb3JSZXNvdXJjZVR5cGVzOgpAQCAtNTA5LDcgKzQ4OCw3IEBACiAgICAgICAgIHZhbGlkRm9yUmVzb3Vy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yZWQ6IGZhbHNlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBzdGF0aWNfcm91dGVzX2xpc3Q6CisgICAgICAgIHR5cGU6IGxpc3QKKyAgICAgICAgZGVzY3JpcHRpb246IFN0YXRpYyByb3V0ZXMgZW5hYmxlZAorICAgICAgICByZXF1aXJlZDogZmFsc2UKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKKyAgICAgICAgZW50cnlfc2NoZW1hOgorICAgICAgICAgIHR5cGU6IGJvb2xlYW4KKyAgICAgIGF2YWlsYWJpbGl0eV96b25lX2VuYWJsZToKKyAgICAgICAgdHlwZTogYm9vbGVhbgorICAgICAgICBkZXNjcmlwdGlvbjogSW5kaWNhdGVzIGF2YWlsYWJpbGl0eSB6b25lIGlzIGVuYWJsZWQKKyAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCisgICAgICAgIGRlZmF1bHQ6IGZhbHNlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBzZXJ2aWNlX3RlbXBsYXRlX25hbWU6CisgICAgICAgIHR5cGU6IHN0cmluZworICAgICAgICBkZXNjcmlwdGlvbjogU2VydmljZSB0ZW1wbGF0ZSBuYW1lCisgICAgICAgIHJlcXVpcmVkOiBmYWxzZQorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAorICAgICAgb3JkZXJlZF9pbnRlcmZhY2VzOgorICAgICAgICB0eXBlOiBib29sZWFuCisgICAgICAgIGRlc2NyaXB0aW9uOiBJbmRpY2F0ZXMgaWYgc2VydmljZSBpbnRlcmZhY2UgYXJlIG9yZGVyZWQKKyAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCisgICAgICAgIGRlZmF1bHQ6IGZhbHNlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBmbGF2b3I6CisgICAgICAgIHR5cGU6IHN0cmluZworICAgICAgICBkZXNjcmlwdGlvbjogZmxhdm9yCisgICAgICAgIHJlcXVpcmVkOiBmYWxzZQorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAorICAgICAgaW1hZ2VfbmFtZToKKyAgICAgICAgdHlwZTogc3RyaW5nCisgICAgICAgIGRlc2NyaXB0aW9uOiBJbWFnZSBuYW1lCisgICAgICAgIHJlcXVpcmVkOiB0cnVlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBzZXJ2aWNlX3R5cGU6CisgICAgICAgIHR5cGU6IHN0cmluZworICAgICAgICBkZXNjcmlwdGlvbjogU2VydmljZSB0eXBlCisgICAgICAgIHJlcXVpcmVkOiB0cnVlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICAgIGNvbnN0cmFpbnRzOgorICAgICAgICAtIHZhbGlkX3ZhbHVlczoKKyAgICAgICAgICAtIGZpcmV3YWxsCisgICAgICAgICAgLSBhbmFseXplcgorICAgICAgICAgIC0gc291cmNlLW5hdAorICAgICAgICAgIC0gbG9hZGJhbGFuY2VyCisgICAgICBzZXJ2aWNlX2ludGVyZmFjZV90eXBlX2xpc3Q6CisgICAgICAgIHR5cGU6IGxpc3QKKyAgICAgICAgZGVzY3JpcHRpb246IExpc3Qgb2YgaW50ZXJmYWNlIHR5cGVzCisgICAgICAgIHJlcXVpcmVkOiB0cnVlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICAgIGVudHJ5X3NjaGVtYToKKyAgICAgICAgICB0eXBlOiBzdHJpbmcKKyAgICAgICAgICBjb25zdHJhaW50czoKKyAgICAgICAgICAtIHZhbGlkX3ZhbHVlczoKKyAgICAgICAgICAgIC0gbWFuYWdlbWVudAorICAgICAgICAgICAgLSBsZWZ0CisgICAgICAgICAgICAtIHJpZ2h0CisgICAgICAgICAgICAtIG90aGVyCisgICAgICBzZXJ2aWNlX2luc3RhbmNlX25hbWU6CisgICAgICAgIHR5cGU6IHN0cmluZworICAgICAgICBkZXNjcmlwdGlvbjogU2VydmljZSBpbnN0YW5jZSBuYW1lCisgICAgICAgIHJlcXVpcmVkOiB0cnVlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBpbnRlcmZhY2VfbGlzdDoKKyAgICAgICAgdHlwZTogbGlzdAorICAgICAgICBkZXNjcmlwdGlvbjogTGlzdCBvZiBpbnRlcmZhY2VzCisgICAgICAgIHJlcXVpcmVkOiBmYWxzZQorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAorICAgICAgICBlbnRyeV9zY2hlbWE6CisgICAgICAgICAgdHlwZTogb3JnLm9wZW5lY29tcC5kYXRhdHlwZXMuaGVhdC5uZXR3b3JrLmNvbnRyYWlsLkludGVyZmFjZURhdGEKKyAgICAgIHNlcnZpY2VfbW9kZToKKyAgICAgICAgdHlwZTogc3RyaW5nCisgICAgICAgIGRlc2NyaXB0aW9uOiBTZXJ2aWNlIG1vZGUKKyAgICAgICAgcmVxdWlyZWQ6IHRydWUKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKKyAgICAgICAgY29uc3RyYWludHM6CisgICAgICAgIC0gdmFsaWRfdmFsdWVzOgorICAgICAgICAgIC0gdHJhbnNwYXJlbnQKKyAgICAgICAgICAtIGluLW5ldHdvcmsKKyAgICAgICAgICAtIGluLW5ldHdvcmstbmF0CisgICAgICBzaGFyZWRfaXBfbGlzdDoKKyAgICAgICAgdHlwZTogbGlzdAorICAgICAgICBkZXNjcmlwdGlvbjogU2hhcmVkIGlwcyBlbmFibGVkCisgICAgICAgIHJlcXVpcmVkOiBmYWxzZQorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAorICAgICAgICBlbnRyeV9zY2hlbWE6CisgICAgICAgICAgdHlwZTogYm9vbGVhbgorICAgIGF0dHJpYnV0ZXM6CisgICAgICB0ZW5hbnRfaWQ6CisgICAgICAgIHR5cGU6IHN0cmluZworICAgICAgICBkZXNjcmlwdGlvbjogVGVuYW50IGlkIG9mIHRoZSBTZXJ2aWNlIEluc3RhbmNlCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECisgICAgICBmcV9uY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AgICAgIC0gdmFsaWRfdmFsdWVzOgogICAgICAgICAtIGJhc2UKQEAgLTM3OCwxMiArMzc4LDEyIEBACiAgICAgICAgIHR5cGU6IHN0cmluZwogICAgICAgICBkZXNjcmlwdGlvbjogU3RhcnQgcG9ydAogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgIGVuZF9wb3J0OgogICAgICAgICB0eXBlOiBzdHJpbmcKICAgICAgICAgZGVzY3JpcHRpb246IEVuZCBwb3J0CiAgICAgICAgIHJlcXVpcmVkOiBmYWxzZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogCiBvcmcub3BlbmVjb21wLmRhdGF0eXBlcy5oZWF0LmNvbnRyYWlsLm5ldHdvcmsucnVsZS5SdWxlOgogICAgIGRlcml2ZWRfZnJvbTogdG9zY2EuZGF0YXR5cGVzLlJvb3QKQEAgLTM5Myw0NSArMzkzLDQ1IEBACiAgICAgICAgIHR5cGU6IGxpc3QKICAgICAgICAgZGVzY3JpcHRpb246IFNvdXJjZSBwb3J0cwogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgICAgZW50cnlfc2NoZW1hOgogICAgICAgICAgIHR5cGU6IG9yZy5vcGVuZWNvbXAuZGF0YXR5cGVzLmhlYXQuY29udHJhaWwubmV0d29yay5ydWxlLlBvcnRQYWlycwogICAgICAgcHJvdG9jb2w6CiAgICAgICAgIHR5cGU6IHN0cmluZwogICAgICAgICBkZXNjcmlwdGlvbjogUHJvdG9jb2wKICAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCi0gICAgICAgIHN0YXR1czogc3VwcG9ydGVkCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECiAgICAgICBkc3RfYWRkcmVzc2VzOgogICAgICAgICB0eXBlOiBsaXN0CiAgICAgICAgIGRlc2NyaXB0aW9uOiBEZXN0aW5hdGlvbiBhZGRyZXNzZXMKICAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCi0gICAgICAgIHN0YXR1czogc3VwcG9ydGVkCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECiAgICAgICAgIGVudHJ5X3NjaGVtYToKICAgICAgICAgICB0eXBlOiBvcmcub3BlbmVjb21wLmRhdGF0eXBlcy5oZWF0LmNvbnRyYWlsLm5ldHdvcmsucnVsZS5WaXJ0dWFsTmV0d29yawogICAgICAgYXBwbHlfc2VydmljZToKICAgICAgICAgdHlwZTogc3RyaW5nCiAgICAgICAgIGRlc2NyaXB0aW9uOiBTZXJ2aWNlIHRvIGFwcGx5CiAgICAgICAgIHJlcXVpcmVkOiBmYWxzZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogICAgICAgZHN0X3BvcnRzOgogICAgICAgICB0eXBlOiBsaXN0CiAgICAgICAgIGRlc2NyaXB0aW9uOiBEZXN0aW5hdGlvbiBwb3J0cwogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgICAgZW50cnlfc2NoZW1hOgogICAgICAgICAgIHR5cGU6IG9yZy5vcGVuZWNvbXAuZGF0YXR5cGVzLmhlYXQuY29udHJhaWwubmV0d29yay5ydWxlLlBvcnRQYWlycwogICAgICAgc3JjX2FkZHJlc3NlczoKICAgICAgICAgdHlwZTogbGlzdAogICAgICAgICBkZXNjcmlwdGlvbjogU291cmNlIGFkZHJlc3NlcwogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQK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WxzZQogICAgICAgICBkZWZhdWx0OiBpbmdyZXNzCi0gICAgICAgIHN0YXR1czogc3VwcG9ydGVkCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECiAgICAgICAgIGNvbnN0cmFpbnRzOgogICAgICAgICAtIHZhbGlkX3ZhbHVlczoKICAgICAgICAgICAtIGVncmVzcwpAQCAtNTIzLDcgKzUyMyw3IEBACiAgICAgICAgIHR5cGU6IGludGVnZXIKICAgICAgICAgZGVzY3JpcHRpb246IFRoZSBtaW5pbXVtIHBvcnQgbnVtYmVyIGluIHRoZSByYW5nZSB0aGF0IGlzIG1hdGNoZWQgYnkgdGhlIHNlY3VyaXR5IGdyb3VwIHJ1bGUuCiAgICAgICAgIHJlcXVpcmVkOiBmYWxzZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogICAgICAgICBjb25zdHJhaW50czoKICAgICAgICAgLSBpbl9yYW5nZToKICAgICAgICAgICAtIDAKQEAgLTUzNywxMyArNTM3LDEzIEBACiAgICAgICAgIHR5cGU6IHN0cmluZwogICAgICAgICBkZXNjcmlwdGlvbjogU3Vic3RpdHV0ZSBTZXJ2aWNlIFRlbXBsYXRlCiAgICAgICAgIHJlcXVpcmVkOiB0cnVlCi0gICAgICAgIHN0YXR1czogc3VwcG9ydGVkCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECiAgICAgICBpbmRleF92YWx1ZToKICAgICAgICAgdHlwZTogaW50ZWdlcgogICAgICAgICBkZXNjcmlwdGlvbjogSW5kZXggdmFsdWUgb2YgdGhlIHN1YnN0aXR1dGlvbiBzZXJ2aWNlIHRlbXBsYXRlIHJ1bnRpbWUgaW5zdGFuY2UKICAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCiAgICAgICAgIGRlZmF1bHQ6IDAKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgICAgY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ICAgdHlwZTogbGlzdAogICAgICAgICBkZXNjcmlwdGlvbjogRGVzdGluYXRpb24gYWRkcmVzc2VzCiAgICAgICAgIHJlcXVpcmVkOiBmYWxzZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogICAgICAgICBlbnRyeV9zY2hlbWE6CiAgICAgICAgICAgdHlwZTogb3JnLm9wZW5lY29tcC5kYXRhdHlwZXMuaGVhdC5jb250cmFpbFYyLm5ldHdvcmsucnVsZS5Ec3RWaXJ0dWFsTmV0d29yawogICAgICAgbmV0d29ya19wb2xpY3lfZW50cmllc19wb2xpY3lfcnVsZV9kc3RfcG9ydHM6CiAgICAgICAgIHR5cGU6IGxpc3QKICAgICAgICAgZGVzY3JpcHRpb246IERlc3RpbmF0aW9uIHBvcnRzCiAgICAgICAgIHJlcXVpcmVkOiBmYWxzZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogICAgICAgICBlbnRyeV9zY2hlbWE6CiAgICAgICAgICAgdHlwZTogb3JnLm9wZW5lY29tcC5kYXRhdHlwZXMuaGVhdC5jb250cmFpbFYyLm5ldHdvcmsucnVsZS5Ec3RQb3J0UGFpcnMKICAgICAgIG5ldHdvcmtfcG9saWN5X2VudHJpZXNfcG9saWN5X3J1bGVfcHJvdG9jb2w6CiAgICAgICAgIHR5cGU6IHN0cmluZwogICAgICAgICBkZXNjcmlwdGlvbjogUHJvdG9jb2wKICAgICAgICAgcmVxdWlyZWQ6IGZhbHNlCi0gICAgICAgIHN0YXR1czogc3VwcG9ydGVkCisgICAgICAgIHN0YXR1czogU1VQUE9SVEVECiAgICAgICBuZXR3b3JrX3BvbGljeV9lbnRyaWVzX3BvbGljeV9ydWxlX3NyY19hZGRyZXNzZXM6CiAgICAgICAgIHR5cGU6IGxpc3QKICAgICAgICAgZGVzY3JpcHRpb246IFNvdXJjZSBhZGRyZXNzZXMKIC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LmRhdGF0eXBlcy5Sb290CkBAIC04MTEsMjYgKzgxMSwyNiBAQAogICAgICAgICB0eXBlOiBsaXN0CiAgICAgICAgIGRlc2NyaXB0aW9uOiBBbiBvcmRlcmVkIGxpc3Qgb2Ygc3RhdGljIHJvdXRlcyB0byBiZSBhZGRlZCB0byB0aGlzIGludGVyZmFjZQogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgICAgZW50cnlfc2NoZW1hOgogICAgICAgICAgIHR5cGU6IG9yZy5vcGVuZWNvbXAuZGF0YXR5cGVzLmhlYXQubmV0d29yay5jb250cmFpbC5wb3J0LlN0YXRpY1JvdXRlCiAgICAgICB2aXJ0dWFsX25ldHdvcms6CiAgICAgICAgIHR5cGU6IHN0cmluZwogICAgICAgICBkZXNjcmlwdGlvbjogVmlydHVhbCBOZXR3b3JrIGZvciB0aGlzIGludGVyZmFjZQogICAgICAgICByZXF1aXJlZDogdHJ1ZQotICAgICAgICBzdGF0dXM6IHN1cHBvcnRlZAorICAgICAgICBzdGF0dXM6IFNVUFBPUlRFRAogICAgICAgYWxsb3dlZF9hZGRyZXNzX3BhaXJzOgogICAgICAgICB0eXBlOiBsaXN0CiAgICAgICAgIGRlc2NyaXB0aW9uOiBMaXN0IG9mIGFsbG93ZWQgYWRkcmVzcyBwYWlyIGZvciB0aGlzIGludGVyZmFjZQogICAgICAgICByZXF1aXJlZDogZmFsc2UKLSAgICAgICAgc3RhdHVzOiBzdXBwb3J0ZWQKKyAgICAgICAgc3RhdHVzOiBTVVBQT1JURUQKICAgICAgICAgZW50cnlfc2NoZW1hOgogICAgICAgICAgIHR5cGU6IG9yZy5vcGVuZWNvbXAuZGF0YXR5cGVzLmhlYXQubmV0d29yay5jb250cmFpbC5BZGRyZXNzUGFpcgogICAgICAgaXBfYWRkcmVzczoKICAgICAgICAgdHlwZTogc3RyaW5nCiAg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