ZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9kYXRhL2FkZEZlZWQzLnR4dCBiL2RhdGFyb3V0ZXItcHJvdi9kYXRhL2FkZEZlZWQzLnR4dApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yMWY1OGEzCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L2RhdGEvYWRkRmVlZDMudHh0CkBAIC0wLDAgKzEsMjMgQEAKKw0KK3sNCisgICAgICJuYW1lIjogIkpldHR5ZGVtbyIsDQorICAgICAidmVyc2lvbiI6ICJtMS4wIiwNCisgICAgICJkZXNjcmlwdGlvbiI6ICJKZXR0eWRlbW8iLA0KKyAgICAgImJ1c2luZXNzX2Rlc2NyaXB0aW9uIjogIkpldHR5ZGVtbyIsDQorICAgICAic3VzcGVuZCI6IGZhbHNlLA0KKyAgICAgImRlbGV0ZWQiOiBmYWxzZSwNCisgICAgICJjaGFuZ2Vvd25lciI6IHRydWUsDQorICAgICAiYXV0aG9yaXphdGlvbiI6IHsNCisgICAgICAgICAgImNsYXNzaWZpY2F0aW9uIjogInVuY2xhc3NpZmllZCIsDQorICAgICAgICAgICJlbmRwb2ludF9hZGRycyI6IFsNCisgICAgICAgICAgICAgICAiMTcyLjE4LjAuMyIsDQorCQkJXSwNCisgICAgICAgICAgImVuZHBvaW50X2lkcyI6IFsNCisgICAgICAgICAgICAgICB7DQorICAgICAgICAgICAgICAgICAgICAicGFzc3dvcmQiOiAicnM4NzNtIiwNCisgICAgICAgICAgICAgICAgICAgICJpZCI6ICJyczg3M20iDQorICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICBdDQorICAgICB9LA0KK30NCisNCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3YvZGF0YS9hZGRTdWJzY3JpYmVyLnR4dCBiL2RhdGFyb3V0ZXItcHJvdi9kYXRhL2FkZFN1YnNjcmliZXIudHh0Cm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmE5ZDQxNTYKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3YvZGF0YS9hZGRTdWJzY3JpYmVyLnR4dApAQCAtMCwwICsxLDE1IEBACisNCit7IA0KKyAgICAgICAgICAgICAgICAiZGVsaXZlcnkiIDoJDQorICAgICAgICAgICAgICAgCQkJCQ0KKyAgICAgICAgICAgICAgICB7IA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVybCIgOiAiaHR0cDovLzE3Mi4xOC4wLjM6NzA3MC8iLCANCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ1c2VyIiA6ICJMT0dJTiIsIA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInBhc3N3b3JkIiA6ICJQQVNTV09SRCIsIA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVzZTEwMCIgOiB0cnVlIA0KKyAgICAgICAgICAgICAgICB9LA0KKyAgICAgICAgICAgICAgICAibWV0YWRhdGFPbmx5IiA6IGZhbHNlLCANCisgICAgICAgICAgICAgICAgInN1c3BlbmQiIDogZmFsc2UsIA0KKwkJCQkiZ3JvdXBpZCIgOiAyOSwNCisgICAgICAgICAgICAgICAgInN1YnNjcmliZXIiIDogInNnNDgxbiINCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3BvbS54bWwgYi9kYXRhcm91dGVyLXByb3YvcG9tLnhtbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zNmIwYTRmCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3BvbS54bWwKQEAgLTAsMCArMSw1NTggQEAKKzwhLS0NCisgID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAgKiBvcmcub25hcC5kbWFhcA0KKyAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgICogDQorICAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAgKiANCisgICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuDQorICAqID09PT09PT09PT09PUxJQ0VOU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Rpb24+DQorICAgICAgPGV4ZWN1dGlvbj4NCisgICAgICAgIDxpZD5jb3B5LXJlc291cmNlcy0yPC9pZD4NCisgICAgICAgIDxwaGFzZT52YWxpZGF0ZTwvcGhhc2U+DQorICAgICAgICA8Z29hbHM+DQorICAgICAgICAgIDxnb2FsPmNvcHktcmVzb3VyY2VzPC9nb2FsPg0KKyAgICAgICAgPC9nb2Fscz4NCisgICAgICAgIDxjb25maWd1cmF0aW9uPg0KKyAgICAgICAgICA8b3V0cHV0RGlyZWN0b3J5PiR7YmFzZWRpcn0vdGFyZ2V0L29wdC9hcHAvZGF0YXJ0ci9ldGM8L291dHB1dERpcmVjdG9yeT4NCisgICAgICAgICAgPHJlc291cmNlcz4NCisgICAgICAgICAgICA8cmVzb3VyY2U+DQorICAgICAgICAgICAgICAgICAgICAgICAgPGRpcmVjdG9yeT4ke2Jhc2VkaXJ9L3NyYy9tYWluL3Jlc291cmNlczwvZGlyZWN0b3J5Pg0KKyAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlcz4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGluY2x1ZGU+bWlzYy8qKjwvaW5jbHVkZT4NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGluY2x1ZGU+KiovKio8L2luY2x1ZGU+DQorICAgICAgICAgICAgICAgICAgICAgICAgPC9pbmNsdWRlcz4NCisgICAgICAgICAgICAgICAgICAgIDwvcmVzb3VyY2U+DQorICAgICAgICAgIDwvcmVzb3VyY2VzPg0KKyAgICAgICAgPC9jb25maWd1cmF0aW9uPg0KKyAgICAgIDwvZXhlY3V0aW9uPg0KKyAgICAgIDxleGVjdXRpb24+DQorICAgICAgICA8aWQ+Y29weS1yZXNvdXJjZXMtMzwvaWQ+DQorICAgICAgICA8cGhhc2U+dmFsaWRhdGU8L3BoYXNlPg0KKyAgICAgICAgPGdvYWxzPg0KKyAgICAgICAgICA8Z29hbD5jb3B5LXJlc291cmNlczwvZ29hbD4NCisgICAgICAgIDwvZ29hbHM+DQorICAgICAgICA8Y29uZmlndXJhdGlvbj4NCisgICAgICAgICAgPG91dHB1dERpcmVjdG9yeT4ke2Jhc2VkaXJ9L3RhcmdldC9vcHQvYXBwL2RhdGFydHI8L291dHB1dERpcmVjdG9yeT4NCisgICAgICAgICAgPHJlc291cmNlcz4NCisgICAgICAgICAgICA8cmVzb3VyY2U+DQorICAgICAgICAgICAgICAgICAgICAgICAgPGRpcmVjdG9yeT4ke2Jhc2VkaXJ9L2RhdGE8L2RpcmVjdG9yeT4NCisgICAgICAgICAgICAgICAgICAgICAgICA8aW5jbHVkZXM+DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlPm1pc2MvKio8L2luY2x1ZGU+DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlPioqLyoqPC9pbmNsdWRlPg0KKyAgICAgICAgICAgICAgICAgICAgICAgIDwvaW5jbHVkZXM+DQorICAgICAgICAgICAgICAgICAgICA8L3Jlc291cmNlPg0KKyAgICAgICAgICA8L3Jlc291cmNlcz4NCisgICAgICAgIDwvY29uZmlndXJhdGlvbj4NCisgICAgICA8L2V4ZWN1dGlvbj4NCisJICAgPGV4ZWN1dGlvbj4NCisgICAgICAgIDxpZD5jb3B5LXJlc291cmNlcy00PC9pZD4NCisgICAgICAgIDxwaGFzZT52YWxpZGF0ZTwvcGhhc2U+DQorICAgICAgICA8Z29hbHM+DQorICAgICAgICAgIDxnb2FsPmNvcHktcmVzb3VyY2VzPC9nb2FsPg0KKyAgICAgICAgPC9nb2Fscz4NCisgICAgICAgIDxjb25maWd1cmF0aW9uPg0KKyAgICAgICAgICA8b3V0cHV0RGlyZWN0b3J5PiR7YmFzZWRpcn0vdGFyZ2V0L29wdC9hcHAvZGF0YXJ0ci9zZWxmX3NpZ25lZDwvb3V0cHV0RGlyZWN0b3J5Pg0KKyAgICAgICAgICA8cmVzb3VyY2VzPg0KKyAgICAgICAgICAgIDxyZXNvdXJjZT4NCisgIC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L2RhdGFyb3V0ZXItcHJvdi9zZWxmX3NpZ25lZC9teWtleS5jZXIKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMmE1YzlkNwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zZWxmX3NpZ25lZC9teWtleS5jZXIKQmluYXJ5IGZpbGVzIGRpZmZlcgpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL2F1dGh6L0F1dGhvcml6YXRpb25SZXNwb25zZS5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL2F1dGh6L0F1dGhvcml6YXRpb25SZXNwb25zZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjI2OTU2ZjgKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvYXV0aHovQXV0aG9yaXphdGlvblJlc3BvbnNlLmphdmEKQEAgLTAsMCArMSw1OCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBB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lYXJjaC9kYXRhcm91dGVyL2F1dGh6L0F1dGhvcml6YXRpb25SZXNwb25zZVN1cHBsZW1lbnQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9BdXRob3JpemF0aW9uUmVzcG9uc2VTdXBwbGVtZW50LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjgyOWM1MAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9BdXRob3JpemF0aW9uUmVzcG9uc2VTdXBwbGVtZW50LmphdmEKQEAgLTAsMCArMSw1MiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5hdXRoejsNCisNCitpbXBvcnQgamF2YS51dGlsLk1hcDsNCisNCisvKiogQW4gb2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YXZhCkBAIC0wLDAgKzEsNjIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5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dhdGlvbnMuDQorCSAqLw0KKwlwdWJsaWMgQXV0aG9yaXphdGlvblJlc3BvbnNlIGRlY2lkZShIdHRwU2VydmxldFJlcXVlc3QgcmVxdWVzdCwgTWFwPFN0cmluZyxTdHJpbmc+IGFkZGl0aW9uYWxBdHRycyk7DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9pbXBsL0F1dGhSZXNwSW1wbC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL2F1dGh6L2ltcGwvQXV0aFJlc3BJbXBsLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZGIzMThkMwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9pbXBsL0F1dGhSZXNwSW1wbC5qYXZhCkBAIC0wLDAgKzEsOTcgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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NWQyYjYxYwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9pbXBsL0F1dGhSZXNwU3VwcGxlbWVudEltcGwuamF2YQpAQCAtMCwwICsxLDcxIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIG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LDAgKzEsMTAwIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVEl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NlYXJjaC9kYXRhcm91dGVyL2F1dGh6L2ltcGwvUHJvdkF1dGhvcml6ZXIuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9pbXBsL1Byb3ZBdXRob3JpemVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDY2ODNkNQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9hdXRoei9pbXBsL1Byb3ZBdXRob3JpemVyLmphdmEKQEAgLTAsMCArMSwxNzkgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorICogKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4NCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICoNCisgKiAqIEVDT01QIGlzIGEgdHJhZGVtYXJrIGFuZCBzZXJ2aWNlIG1hcmsgb2YgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuDQorICogKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorDQorcGFja2FnZSBjb20uYXR0LnJlc2VhcmNoLmRhdGFyb3V0ZXIuYXV0aHouaW1wbDsNCisNCitpbXBvcnQgamF2YS51dGlsLk1hcDsNCisNCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0U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MCwwICsxLDY2IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElF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tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisjICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyMgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisjICogDQorIyAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyMgKiANCisjICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisjICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisjICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorIyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZm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ydmxldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmE0Nzg0OTMKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL0Jhc2VTZXJ2bGV0LmphdmEKQEAgLTAsMCArMSw4NjkgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgK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SBjYXRjaCAoRXhjZXB0aW9uIGUpIHsNCisgICAgICAgICAgICBlLnByaW50U3RhY2tUcmFjZSgpOw0KKyAgICAgICAgfQ0KKw0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvRFJGZWVkc1NlcnZsZXQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvRFJGZWVkc1NlcnZsZXQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kZjI3MDQyCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9EUkZlZWRzU2VydmxldC5qYXZhCkBAIC0wLDAgKzEsMzAwIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJ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AtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvRmVlZFNlcnZsZXQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvRmVlZFNlcnZsZXQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hZmY2ODUzCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9GZWVkU2VydmxldC5qYXZhCkBAIC0wLDAgKzEsMzYyIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSB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m92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9Hcm91cFNlcnZsZXQuamF2YQpAQCAtMCwwICsxLDM4NiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZ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ItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvSW50ZXJuYWxTZXJ2bGV0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTUwYTQ3OAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvSW50ZXJuYWxTZXJ2bGV0LmphdmEKQEAgLTAsMCArMSw1MDYgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQN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Rhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL0xvZ1NlcnZsZXQuamF2YQpAQCAtMCwwICsxLDQzMyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3Ry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bmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTkxMWVjZAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvTWFpbi5qYXZhCkBAIC0wLDAgKzEsMjQ1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmV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CwwICsxLDMxOCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1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bWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvUHJveHlTZXJ2bGV0LmphdmEKQEAgLTAsMCArMSwzMDQgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUg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U3RyaW5nIG1ldGhvZCwgZmluYWwgU3RyaW5nIHVyaSkgew0KKwkJCXN1cGVyKCk7DQorCQkJdGhpcy5tZXRob2QgPSBtZXRob2Q7DQorCSAgICAgICAgc2V0VVJJKFVSSS5jcmVhdGUodXJpKSk7DQorCQl9DQorCQlAT3ZlcnJpZGUNCisJCXB1YmxpYyBTdHJpbmcgZ2V0TWV0aG9kKCkgew0KKwkJCXJldHVybiBtZXRob2Q7DQorCQl9DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9QdWJsaXNoU2VydmxldC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9QdWJsaXNoU2VydmxldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjJhOGUyZTMKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1B1Ymxpc2hTZXJ2bGV0LmphdmEKQEAgLTAsMCArMSwxOTIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgM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Y2ggKE51bWJlckZvcm1hdEV4Y2VwdGlvbiBlKSB7DQorCQkJcmV0dXJuIC0xOw0KKwkJfQ0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvUm91dGVTZXJ2bGV0LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1JvdXRlU2VydmxldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY4ZmQ0YzcKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1JvdXRlU2VydmxldC5qYXZhCkBAIC0wLDAgKzEsNDI5IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAq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NoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1N0YXRpc3RpY3NTZXJ2bGV0LmphdmEKQEAgLTAsMCArMSw1ODggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cml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y5nZXRTdHJpbmcoIlBVQkxJU0hfTEVOR1RIIikpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZCgiLCIpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZChycy5nZXRTdHJpbmcoIkZJTEVTX0RFTElWRVJFRCIpKTsNCisJICAgICAgICAgICAgbGluZS5hcHBlbmQoIiwiKTsNCisJICAgICAgICAgICAgbGluZS5hcHBlbmQocnMuZ2V0U3RyaW5nKCJERUxJVkVSRURfTEVOR1RIIikpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZCgiLCIpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZChycy5nZXRTdHJpbmcoIlNVQlNDUklCRVJfVVJMIikpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZCgiLCIpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZChycy5nZXRTdHJpbmcoIlNVQklEIikpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZCgiLCIpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZChycy5nZXRTdHJpbmcoIlBVQkxJU0hfVElNRSIpKTsNCisJICAgICAgICAgICAgbGluZS5hcHBlbmQoIiwiKTsNCisJICAgICAgICAgICAgbGluZS5hcHBlbmQocnMuZ2V0U3RyaW5nKCJERUxJVkVSWV9USU1FIikpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZCgiLCIpOw0KKwkgICAgICAgICAgICBsaW5lLmFwcGVuZChycy5nZXRTdHJpbmcoIkF2ZXJhZ2VEZWxheSIpKTsNCisJICAgICAgICAgICAgbGluZS5hcHBlbmQoIiwiKTsNCisJICAgICAgICANCisJICAgICAgICAgICAgbGluZS5hcHBlbmQoIlxuIik7DQorCSAgICAgICAgICAgIG91dC53cml0ZShsaW5lLnRvU3RyaW5nKCkuZ2V0Qnl0ZXMoKSk7DQorCSAgICAgICAgICAgIG91dC5mbHVzaCgpOw0KKyAgICAgICAgIH0NCisJfQ0KKwkN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YWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlL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Fpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvU3Vic2NyaWJlU2VydmxldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmVhNzllOWYKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1N1YnNjcmliZVNlcnZsZXQuamF2YQpAQCAtMCwwICsxLDI4OCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmc7DQorDQoraW1wb3J0IGphdmEuaW8uSU9FeGNlcHRpb247DQoraW1wb3J0IGphdmEuaW8uSW52YWxpZE9iamVjdEV4Y2VwdGlvbjsNCitpbXBvcnQgamF2YS51dGlsLkNvbGxlY3Rpb247DQorDQoraW1wb3J0IGphdmF4LnNlcnZsZXQuaH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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLg0KKyAqICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZA0KKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuDQorICogKiA9PT09PT09PT09PT1MSUNFTlNFX0VORD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqDQorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5Lg0KKyAqICoNCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KKw0KKw0KK3BhY2thZ2UgY29tLmF0dC5yZXNlYXJjaC5kYXRhcm91dGVyLnByb3Zpc2lvbmluZzsNCisNCitpbXBvcnQgamF2YS5pby5JT0V4Y2VwdGlvbjsNCitpbXBvcnQgamF2YS5pby5JbnZhbGlkT2JqZWN0RXhjZXB0aW9uOw0KK2ltcG9ydCBqYXZhLm5ldC5IdHRwVVJMQ29ubmVjdGlvbjsNCitpbXBvcnQgamF2YS5uZXQuVVJMOw0KK2ltcG9ydCBqYXZhLnV0aWwuTGlzdDsNCitpbXBvcnQgamF2YS51dGlsLlZlY3RvcjsNCisNCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVxdWVzdDsNCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVzcG9uc2U7DQorDQoraW1wb3J0IG9yZy5qc29uLkpTT05FeGNlcHRpb247DQoraW1wb3J0IG9yZy5qc29uLkpTT05PYmplY3Q7DQorDQoraW1wb3J0IGNvbS5hdHQuZWVsZi5jb25maWd1cmF0aW9uLkVFTEZMb2dnZXI7DQoraW1wb3J0IGNvbS5hdHQuZWVsZi5jb25maWd1cmF0aW9uLkVFTEZNYW5hZ2VyOw0KK2ltcG9ydCBjb20uYXR0LnJlc2Vh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Yi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL1N5bmNocm9uaXplclRhc2suamF2YQpAQCAtMCwwICsxLDYxNCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiA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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT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ZXJ5RXh0cmFSZWNvcmQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvRGVsaXZlcnlFeHRyYVJlY29yZC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjFhMWNiNTYKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0RlbGl2ZXJ5RXh0cmFSZWNvcmQuamF2YQpAQCAtMCwwICsxLDY4IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXR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nL2JlYW5zL0RlbGl2ZXJ5UmVjb3JkLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYjQ3OTFkNAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvRGVsaXZlcnlSZWNvcmQuamF2YQpAQCAtMCwwICsxLDEzNyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZ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Ck7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9FZ3Jlc3NSb3V0ZS5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9FZ3Jlc3NSb3V0ZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjk0YjU5Y2UKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0VncmVzc1JvdXRlLmphdmEKQEAgLTAsMCArMSwyMjcgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorICogKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4NCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICoNCisgKiAqIEVDT01QIGlzIGEgdHJhZGVtYXJrIGFuZCBzZXJ2aWNlIG1hcmsgb2YgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuDQorICogKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorDQorDQorcGFja2FnZSBjb20uYXR0LnJlc2VhcmNoLmRh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tLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvRXZlbnRMb2dSZWNvcmQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvRXZlbnRMb2dSZWNvcmQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hZGY0NWQ0Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9FdmVudExvZ1JlY29yZC5qYXZhCkBAIC0wLDAgKzEsODQgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbn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vcmQuamF2YQpAQCAtMCwwICsxLDE0MSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUI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IG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjRlZTVhYjkKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0ZlZWQuamF2YQpAQCAtMCwwICsxLDc2MCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBh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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyI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DQorCQkJcmV0dXJuIGZhbHNlOw0KKwkJcmV0dXJuIHRydWU7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9GZWVkRW5kcG9pbnRJRC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9GZWVkRW5kcG9pbnRJRC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmYwMDljNjQKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0ZlZWRFbmRwb2ludElELmphdmEKQEAgLTAsMCArMSw4NyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlb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F0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9GZWVkTGlua3MuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jY2NlOWM0Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9GZWVkTGlua3MuamF2YQpAQCAtMCwwICsxLDEwMyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcuYmVhbnM7DQorDQoraW1wb3J0IGphdmEuaW8uSW52YWxpZE9iamVjdEV4Y2VwdGlvbjsNCisNCitpbXBvcnQgb3JnLmpzb24uSlNPTk9iamVjdDsNCisNCisvKioNCisgKiBUaGUgVVJMcyBhc3NvY2lhdGVkIHdp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xvZy5lcXVhbHMob2YubG9nKSkNCisJCQlyZXR1cm4gZmFsc2U7DQorCQlyZXR1cm4gdHJ1ZTsNCisJfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0dyb3VwLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0dyb3VwLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uM2Y1NWIwMAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvR3JvdXAuamF2YQpAQCAtMCwwICsxLDQxNyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNl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cvYmVhbnMvSW5ncmVzc1JvdXRlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTllYTliYwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvSW5ncmVzc1JvdXRlLmphdmEKQEAgLTAsMCArMSw1NDIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU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wgKHN1Ym5ldCA9PSBudWxsKT8iIjpzdWJuZXQsIHNlcSk7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9JbnNlcnRhYmxlLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0luc2VydGFibGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42NjA0YWI0Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9JbnNlcnRhYmxlLmphdmEKQEAgLTAsMCArMSw0MSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYW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m92aXNpb25pbmcvYmVhbnMvSlNPTmFibGUuamF2YQpAQCAtMCwwICsxLDQwIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLg0KKyAqICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZA0KKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuDQorICogKiA9PT09PT09PT09PT1MSUNFTlNFX0VORD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqDQorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5Lg0KKyAqICoNCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KKw0KKw0KK3BhY2thZ2UgY29tLmF0dC5yZXNlYXJjaC5kYXRhcm91dGVyLnByb3Zpc2lvbmluZy5iZWFuczsNCisNCitpbXBvcnQgb3JnLmpzb24uSlNPTk9iamVjdDsNCisNCisvKioNCisgKiBBbiBvYmplY3QgdGhhdCBjYW4gYmUgcmVwcmVzZW50ZWQgYXMgYSB7QGxpbmsgSlNPTk9iamVjdH0uDQorICogQGF1dGhvciBSb2JlcnQgRWJ5DQorICogQHZlcnNpb24gJElkOiBKU09OYWJsZS5qYXZhLHYgMS4xIDIwMTMvMDQvMjYgMjE6MDA6MjYgZWJ5IEV4cCAkDQorICovDQorcHVibGljIGludGVyZmFjZSBKU09OYWJsZSB7DQorCS8qKg0KKwkgKiBHZXQgYSBKU09OT2JqZWN0IHJlcHJlc2VudGluZyB0aGlzIG9iamVjdC4NCisJICogQHJldHVybiB0aGUgSlNPTk9iamVjdA0KKwkgKi8NCisJcHVibGljIEpTT05PYmplY3QgYXNKU09OT2JqZWN0KCk7DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvTE9HSlNPTmFibGUuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvTE9HSlNPTmFibGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45M2NkZmFhCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9MT0dKU09OYWJsZS5qYXZhCkBAIC0wLDAgKzEsNDAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorICogKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4NCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICoNCisgKiAqIEVDT01QIGlzIGEgdHJhZGVtYXJrIGFuZCBzZXJ2aWNlIG1hcmsgb2YgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuDQorICogKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorDQorDQorcGFja2FnZSBjb20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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcuYmVhbnM7DQorDQoraW1wb3J0IGphdmEuc3FsLlByZXBhcmVkU3RhdGVtZW50Ow0KK2ltcG9ydCBqYXZhLnNxbC5TUUxFeGNlcHRpb247DQorDQoraW1wb3J0IGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcudXRpbHMuTG9nZmlsZUxvYWRlcjsNCisNCisvKioNCisgKiBUaGlzIGludGVyZmFjZSBpcyB1c2VkIGJ5IGJlYW4gY2xhc3NlcyB0aGF0IGNhbiBiZSBsb2FkZWQgaW50byB0aGUgTE9HX1JFQ09SRFMgdGFibGUgdXNpbmcgdGhlDQorICogUHJlcGFyZWRTdGF0ZW1lbnQgYXQge0BsaW5rIExvZ2ZpbGVMb2FkZXJ9LklOU0VSVF9TUUwuDQorICoNCisgKiBAYXV0aG9yIFJvYmVydCBFYnkNCisgKiBAdmVyc2lvbiAkSWQ6IExvYWRhYmxlLmphdmEsdiAxLjIgMj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xvYWQNCisJICovDQorCXB1YmxpYyB2b2lkIGxvYWQoUHJlcGFyZWRTdGF0ZW1lbnQgcHMpIHRocm93cyBTUUxFeGNlcHRpb247DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvTG9nUmVjb3JkLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0xvZ1JlY29yZC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjFkZGM1MDkKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL0xvZ1JlY29yZC5qYXZhCkBAIC0wLDAgKzEsMjM1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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k7DQorCQkJcHMuc2V0TG9uZyAgKDE5LCBjbGVuZ3RoMik7DQorCQl9DQorCX0NCisNCisJcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYSkgdGhyb3dzIElPRXhjZXB0aW9uIHsNCisJCUxvZ1JlY29yZC5wcmludExvZ1JlY29yZHMoU3lzdGVtLm91dCwgbmV3IFJMRUJpdFNldChhWzBdKSk7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9OZXR3b3JrUm91dGUuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvTmV0d29ya1JvdXRlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTlmMjE5MgotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvTmV0d29ya1JvdXRlLmphdmEKQEAgLTAsMCArMSwyMzAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIE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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbm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qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvUGFyYW1ldGVycy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjFjYjRiY2EKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL1BhcmFtZXRlcnMuamF2YQpAQCAtMCwwICsxLDI1NyBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorIC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tleW5hbWU9IiArIGtleW5hbWUgKyAiLCB2YWx1ZT0iICsgdmFsdWU7DQorCX0NCit9DQorDQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9QdWJGYWlsUmVjb3JkLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL1B1YkZhaWxSZWNvcmQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xZmUxNDczCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9QdWJGYWlsUmVjb3JkLmphdmEKQEAgLTAsMCArMSw4NSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNl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ioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLg0KKyAqIC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cy5WQVJDSEFSKTsNCisJCXBzLnNldE51bGwgICgxNSwgVHlwZXMuSU5URUdFUik7DQorCQlwcy5zZXROdWxsICAoMTYsIFR5cGVzLklOVEVHRVIpOw0KKwkJcHMuc2V0TnVsbCAgKDE3LCBUeXBlcy5WQVJDSEFSKTsNCisJCXBzLnNldE51bGwgICgxOSwgVHlwZXMuQklHSU5UKTsNCisJfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL1N1YkRlbGl2ZXJ5LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL1N1YkRlbGl2ZXJ5LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNjZlNDRhZgotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvU3ViRGVsaXZlcnkuamF2YQpAQCAtMCwwICsxLDEwOSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcms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wcm92aXNpb25pbmcvYmVhbnMvU3ViTGlua3MuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvU3ViTGlua3MuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yNzEyOGQ4Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9TdWJMaW5rcy5qYXZhCkBAIC0wLDAgKzEsOTUgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3Ug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phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9TdWJzY3JpcHRpb24uamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43YWIxMGE0Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9TdWJzY3JpcHRpb24uamF2YQpAQCAtMCwwICsxLDUxMSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICA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W5nIHRvU3RyaW5nKCkgew0KKwkJcmV0dXJuICJTVUI6IHN1YmlkPSIgKyBzdWJpZCArICIsIGZlZWRpZD0iICsgZmVlZGlkOw0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvU3luY2FibGUuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvU3luY2FibGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wMDE2M2MxCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9TeW5jYWJsZS5qYXZhCkBAIC0wLDAgKzEsNTcgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ljIGJvb2xlYW4gZG9EZWxldGUoQ29ubmVjdGlvbiBjKTsNCisNCisJLyoqDQorCSAqIEdldCB0aGUgIm5hdHVyYWwga2V5IiBmb3IgdGhpcyBvYmplY3QgdHlwZSwgYXMgYSBTdHJpbmcuDQorCSAqIEByZXR1cm4gdGhlIGtleQ0KKwkgKi8NCisJYWJzdHJhY3QgcHVibGljIFN0cmluZyBnZXRLZXkoKTsNCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9VcGRhdGVhYmxlLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2JlYW5zL1VwZGF0ZWFibGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hOWIxOWU3Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9iZWFucy9VcGRhdGVhYmxlLmphdmEKQEAgLTAsMCArMSw0MCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW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KaW5kZXggMDAwMDAwMC4uNGIyODA1MwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvYmVhbnMvcGFja2FnZS5odG1sCkBAIC0wLDAgKzEsMzEgQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisjICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyMgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisjICogDQorIyAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyMgKiANCisjICAqIFVubGVzcyByZXF1aXJlZCBieSBhcH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keT4NCis8L2h0bWw+DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9lZWxmL0VlbGZNc2dzLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL2VlbGYvRWVsZk1zZ3MuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYTIzMDQxCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9lZWxmL0VlbGZNc2dzLmphdmEKQEAgLTAsMCArMSw1NiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcu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KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvZWVsZi9KZXR0eUZpbHRlci5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy9lZWxmL0pldHR5RmlsdGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uY2ZlZjkxMAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvZWVsZi9KZXR0eUZpbHRlci5qYXZhCkBAIC0wLDAgKzEsMzggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQ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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisjICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyMgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisjICogDQorIyAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyMgKiANCisjICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisjICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisjICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0Y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aC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9EQi5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9EQi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmVjNGIwZTYKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3V0aWxzL0RCLmphdmEKQEAgLTAsMCArMSw3MTEgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5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YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvRFJSb3V0ZUNMSS5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9EUlJvdXRlQ0xJLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMzZkNDZlMwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvRFJSb3V0ZUNMSS5qYXZhCkBAIC0wLDAgKzEsNDU2IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXR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CBpeCA9IHNiLmluZGV4T2YoIjxwcmU+Iik7DQorCQlpZiAoaXggPiAwKQ0KKwkJCXNiLmRlbGV0ZSgwLCBpeCs1KTsNCisJCWl4ID0gc2IuaW5kZXhPZigiPC9wcmU+Iik7DQorCQlpZiAoaXggPiAwKQ0KKwkJCXNiLmRlbGV0ZShpeCwgc2IubGVuZ3RoKCkpOw0KKwkJU3lzdGVtLmVyci5wcmludGxuKHNiLnRvU3RyaW5nKCkpOw0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvSlNPTlV0aWxpdGllcy5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9KU09OVXRpbGl0aWVzLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTE2NzY1OAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvSlNPTlV0aWxpdGllcy5qYXZhCkBAIC0wLDAgKzEsNzYgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICog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cbl1cbiIpOw0KKwkJcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9Mb2dmaWxlTG9hZGVyLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3V0aWxzL0xvZ2ZpbGVMb2FkZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mOWMxMWYxCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9Mb2dmaWxlTG9hZGVyLmphdmEKQEAgLTAsMCArMSw1NDkgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5k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aC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9QdXJnZUxvZ0RpclRhc2suamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvUHVyZ2VMb2dEaXJUYXNrLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYjcwNWU2ZgotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvUHVyZ2VMb2dEaXJUYXNrLmphdmEKQEAgLTAsMCArMSw3MCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwYWNrYWdlIGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcudXRpbHM7DQorDQoraW1wb3J0IGphdmEuaW8uRmlsZTsNCitpbXBvcnQ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lvbmluZy91dGlscy9STEVCaXRTZXQuamF2YQpAQCAtMCwwICsxLDQxOCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTS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dbXSBuZXh0KCkgew0KKwkJCQlSTEUgYnMgPSBpLm5leHQoKTsNCisJCQkJcmV0dXJuIG5ldyBMb25nW10geyBicy5maXJzdEJpdCgpLCBicy5sYXN0Qml0KCkgfTsNCisJCQl9DQorDQorCQkJQE92ZXJyaWRlDQorCQkJcHVibGljIHZvaWQgcmVtb3ZlKCkgew0KKwkJCQl0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oKTsNCisJCQl9DQorCQl9Ow0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvVGhyb3R0bGVGaWx0ZXIuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdXRpbHMvVGhyb3R0bGVGaWx0ZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42ZWI4NjZjCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy91dGlscy9UaHJvdHRsZUZpbHRlci5qYXZhCkBAIC0wLDAgKzEsMzE2IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWS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TJmCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvRGFpbHlMYXRlbmN5UmVwb3J0LmphdmEKQEAgLTAsMCArMSwxOTQgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaX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uKCJGaWxlIGNhbm5vdCBiZSB3cml0dGVuOiAiK291dGZpbGUpOw0KKwkJfQ0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL0ZlZWRSZXBvcnQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL0ZlZWRSZXBvcnQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45ZmU3ZTI3Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvRmVlZFJlcG9ydC5qYXZhCkBAIC0wLDAgKzEsMzk1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTG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lTeXN0ZW0uZXJyLnByaW50bG4oZSk7DQorCQkJZS5wcmludFN0YWNrVHJhY2UoKTsNCisJCX0NCisJfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcmVwb3J0cy9MYXRlbmN5UmVwb3J0LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcmVwb3J0cy9MYXRlbmN5UmVwb3J0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTZlMDk2ZQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL0xhdGVuY3lSZXBvcnQuamF2YQpAQCAtMCwwICsxLDE3OSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCisNCisNCitwY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5ub3QgYmUgd3JpdHRlbjogIitvdXRmaWxlKTsNCisJCX0gY2F0Y2ggKFNRTEV4Y2VwdGlvbiBlKSB7DQorCQkJZS5wcmludFN0YWNrVHJhY2UoKTsNCisJCX0NCisJCWxvZ2dlci5kZWJ1ZygiUXVlcnkgdGltZTogIiArIChTeXN0ZW0uY3VycmVudFRpbWVNaWxsaXMoKS1zdGFydCkgKyAiIG1zIik7DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvUmVwb3J0LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcmVwb3J0cy9SZXBvcnQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iZDY0ZTBlCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvUmVwb3J0LmphdmEKQEAgLTAsMCArMSwxNTUgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09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yBlbmQgICA9IHN0YXJ0ICsgKDI0ICogNjAgKiA2MCAqIDEwMDBMKSAtIDE7DQorCQlyZXR1cm4gbmV3IFN0cmluZ1tdIHsgIiIrc3RhcnQsICIiK2VuZCB9Ow0KKwl9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL1JlcG9ydEJhc2UuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL1JlcG9ydEJhc2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yYmRhYmYxCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvUmVwb3J0QmFzZS5qYXZhCkBAIC0wLDAgKzEsNjMgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ew0KKwkJdGhpcy5vdXRmaWxlID0gczsNCisJfQ0KKw0KKwlAT3ZlcnJpZGUNCisJYWJzdHJhY3QgcHVibGljIHZvaWQgcnVuKCk7DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL1N1YnNjcmliZXJSZXBvcnQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL2NvbS9hdHQvcmVzZWFyY2gvZGF0YXJvdXRlci9yZXBvcnRzL1N1YnNjcmliZXJSZXBvcnQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iMDAzYWIxCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvU3Vic2NyaWJlclJlcG9ydC5qYXZhCkBAIC0wLDAgKzEsMTU3IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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KFN0cmluZyBrZXkgOiBuZXcgVHJlZVNldDxTdHJpbmc+KG1hcC5rZXlTZXQoKSkpIHsNCisJCQkJQ291bnRlcnMgYyA9IG1hcC5nZXQoa2V5KTsNCisJCQkJb3MucHJpbnRsbihjLnRvU3RyaW5nKCkpOw0KKwkJCX0NCisJCQlvcy5jbG9zZSgpOw0KKwkJfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsNCisJCQlTeXN0ZW0uZXJyLnByaW50bG4oIkZpbGUgY2Fubm90IGJlIHdyaXR0ZW46ICIrb3V0ZmlsZSk7DQorCQl9DQorCX0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvVm9sdW1lUmVwb3J0LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9jb20vYXR0L3Jlc2VhcmNoL2RhdGFyb3V0ZXIvcmVwb3J0cy9Wb2x1bWVSZXBvcnQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45MmE4NWUyCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvVm9sdW1lUmVwb3J0LmphdmEKQEAgLTAsMCArMSwxNDAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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zJkMjZiCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvY29tL2F0dC9yZXNlYXJjaC9kYXRhcm91dGVyL3JlcG9ydHMvcGFja2FnZS5odG1sCkBAIC0wLDAgKzEsNDMgQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisjICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyMgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisjICogDQorIyAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyMgKiANCisjICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd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ldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0NETC5qYXZhCkBAIC0wLDAgKzEsMzAxIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY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ICAgICAgIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICAgICAgYyA9IHgubmV4dCgpOw0KKyAgICAgICAgICAgICAgICBpZiAoYyA9PSBxKSB7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBpZiAoYyA9PSAwIHx8IGMgPT0gJ1xuJyB8fCBjID09ICdccicpIHsNCisgICAgICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIk1pc3NpbmcgY2xvc2UgcXVvdGUgJyIgKyBxICsgIicuIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGMpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgICAgIGNhc2UgJywnOg0KKyAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgIHJldHVybiAiIjsNCisgICAgICAgIGRlZmF1bHQ6DQorICAgICAgICAgICAgeC5iYWNrKCk7DQorICAgICAgICAgICAgcmV0dXJuIHgubmV4dFRvKCcsJyk7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFByb2R1Y2UgYSBKU09OQXJyYXkgb2Ygc3RyaW5ncyBmcm9tIGEgcm93IG9mIGNvbW1hIGRlbGltaXRlZCB2YWx1ZXMuDQorICAgICAqIEBwYXJhbSB4IEEgSlNPTlRva2VuZXIgb2YgdGhlIHNvdXJjZSB0ZXh0Lg0KKyAgICAgKiBAcmV0dXJuIEEgSlNPTkFycmF5IG9mIHN0cmluZ3MuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBKU09OQXJyYXkgcm93VG9KU09OQXJyYXkoSlNPTlRva2VuZXIgeCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgSlNPTkFycmF5IGphID0gbmV3IEpTT05BcnJheSgpOw0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIFN0cmluZyB2YWx1ZSA9IGdldFZhbHVlKHgpOw0KKyAgICAgICAgICAgIGNoYXIgYyA9IHgubmV4dCgpOw0KKyAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsIHx8DQorICAgICAgICAgICAgICAgICAgICAoamEubGVuZ3RoKCkgPT0gMCAmJiB2YWx1ZS5sZW5ndGgoKSA9PSAwICYmIGMgIT0gJywnKSkgew0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgamEucHV0KHZhbHVlKTsNCisgICAgICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgICAgIGlmIChjID09ICcsJykgew0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgaWYgKGMgIT0gJyAnKSB7DQorICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PSAnXG4nIHx8IGMgPT0gJ1xyJyB8fCBjID09IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gamE7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJCYWQgY2hhcmFjdGVyICciICsgYyArICInICgiICsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCljICsgIikuIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgYyA9IHgubmV4dCgpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIEpTT05PYmplY3QgZnJvbSBhIHJvdyBvZiBjb21tYSBkZWxpbWl0ZWQgdGV4dCwgdXNpbm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dmVkLg0KKyAgICAgKiBAcGFyYW0gamEgQSBKU09OQXJyYXkgb2Ygc3RyaW5ncy4NCisgICAgICogQHJldHVybiBBIHN0cmluZyBlbmRpbmcgaW4gTkVXTElORS4NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHJvd1RvU3RyaW5nKEpTT05BcnJheSBqYSkgew0KKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBqYS5sZW5ndGgoKTsgaSArPSAxKSB7DQorICAgICAgICAgICAgaWYgKGkgPiAwKSB7DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnLCcpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBPYmplY3Qgb2JqZWN0ID0gamEub3B0KGkpOw0KKyAgICAgICAgICAgIGlmIChvYmplY3QgIT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICBTdHJpbmcgc3RyaW5nID0gb2JqZWN0LnRvU3RyaW5nKCk7DQorICAgICAgICAgICAgICAgIGlmIChzdHJpbmcubGVuZ3RoKCkgPiAwICYmIChzdHJpbmcuaW5kZXhPZignLCcpID49IDAgfHwNCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcuaW5kZXhPZignXG4nKSA+PSAwIHx8IHN0cmluZy5pbmRleE9mKCdccicpID49IDAgfHwNCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcuaW5kZXhPZigwKSA+PSAwIHx8IHN0cmluZy5jaGFyQXQoMCkgPT0gJyInKSkgew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCciJyk7DQorICAgICAgICAgICAgICAgICAgICBpbnQgbGVuZ3RoID0gc3RyaW5nLmxlbmd0aCgpOw0KKyAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBsZW5ndGg7IGogKz0gMSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgYyA9IHN0cmluZy5jaGFyQXQoaik7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPj0gJyAnICYmIGMgIT0gJyInKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChjKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyInKTsNCisgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChzdHJpbmcpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAgICAgc2IuYXBwZW5kKCdcbicpOw0KKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFByb2R1Y2UgYSBKU09OQXJyYXkgb2YgSlNPTk9iamVjdHMgZnJvbSBhIGNvbW1hIGRlbGltaXRlZCB0ZXh0IHN0cmluZywNCisgICAgICogdXNpbmcgdGhlIGZpcnN0IHJvdyBhcyBhIHNvdXJjZSBvZiBuYW1lcy4NCisgICAgICogQHBhcmFtIHN0cmluZyBUaGUgY29tbWEgZGVsaW1pdGVkIHRleHQuDQorICAgICAqIEByZXR1cm4gQSBKU09OQXJyYXkgb2YgSlNPTk9iamVjdHMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBKU09OQXJyYXkgdG9KU09OQXJyYXkoU3RyaW5nIHN0cmluZykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgcmV0dXJuIHRvSlNPTkFycmF5KG5ldyBKU09OVG9rZW5lcihzdHJpbmcpKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIEpTT05Bcn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HJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICByZXR1cm4gdG9KU09OQXJyYXkobmFtZXMsIG5ldyBKU09OVG9rZW5lcihzdHJpbmcpKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIEpTT05BcnJheSBvZiBKU09OT2JqZWN0cyBmcm9tIGEgY29tbWEgZGVsaW1pdGVkIHRleHQgc3RyaW5nDQorICAgICAqIHVzaW5nIGEgc3VwcGxpZWQgSlNPTkFycmF5IGFzIHRoZSBzb3VyY2Ugb2YgZWxlbWVudCBuYW1lcy4NCisgICAgICogQHBhcmFtIG5hbWVzIEEgSlNPTkFycmF5IG9mIHN0cmluZ3MuDQorICAgICAqIEBwYXJhbSB4IEEgSlNPTlRva2VuZXIgb2YgdGhlIHNvdXJjZSB0ZXh0Lg0KKyAgICAgKiBAcmV0dXJuIEEgSlNPTkFycmF5IG9mIEpTT05PYmplY3RzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgSlNPTkFycmF5IHRvSlNPTkFycmF5KEpTT05BcnJheSBuYW1lcywgSlNPTlRva2VuZXIgeCkNCisgICAgICAgICAgICB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAobmFtZXMgPT0gbnVsbCB8fCBuYW1lcy5sZW5ndGgoKSA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBKU09OQXJyYXkgamEgPSBuZXcgSlNPTkFycmF5KCk7DQorICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgSlNPTk9iamVjdCBqbyA9IHJvd1RvSlNPTk9iamVjdChuYW1lcywgeCk7DQorICAgICAgICAgICAgaWYgKGpvID09IG51bGwpIHsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGphLnB1dChqbyk7DQorICAgICAgICB9DQorICAgICAgICBpZiAoamEubGVuZ3RoKCkgPT0gMCkgew0KKyAgICAgICAgICAgIHJldHVybiBudWxsOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIGphOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBQcm9kdWNlIGEgY29tbWEgZGVsaW1pdGVkIHRleHQgZnJvbSBhIEpTT05BcnJheSBvZiBKU09OT2JqZWN0cy4gVGhlDQorICAgICAqIGZpcnN0IHJvdyB3aWxsIGJlIGEgbGlzdCBvZiBuYW1lcyBvYnRhaW5lZCBieSBpbnNwZWN0aW5nIHRoZSBmaXJzdA0KKyAgICAgKiBKU09OT2JqZWN0Lg0KKyAgICAgKiBAcGFyYW0gamEgQSBKU09OQXJyYXkgb2YgSlNPTk9iamVjdHMuDQorICAgICAqIEByZXR1cm4gQSBjb21tYSBkZWxpbWl0ZWQgdGV4dC4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyB0b1N0cmluZyhKU09OQXJyYXkgamEpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIEpTT05PYmplY3Qgam8gPSBqYS5vcHRKU09OT2JqZWN0KDApOw0KKyAgICAgICAgaWYgKGpvICE9IG51bGwpIHsNCisgICAgICAgICAgICBKU09OQXJyYXkgbmFtZXMgPSBqby5uYW1lcygpOw0KKyAgICAgICAgICAgIGlmIChuYW1lcyAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiByb3dUb1N0cmluZyhuYW1lcykgKyB0b1N0cmluZyhuYW1lcywgamEpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBudWxsOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBQcm9kdWNlIGEgY29tbWEgZGVsaW1pdGVkIHRleHQgZnJvbSBhIEpTT05Bcn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di9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0Nvb2tpZS5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vQ29va2llLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNjdlNGYxNwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0Nvb2tpZS5qYXZhCkBAIC0wLDAgKzEsMTkxIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXB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sIG5vdCBhIHN0YW5kYXJkLiBPZnRlbiwgY29va2llcyBhcmUgZXhwZWN0ZWQgdG8gaGF2ZQ0KKyAgICAgKiBlbmNvZGVkIHZhbHVlcy4gV2UgZW5jb2RlICc9JyBhbmQgJzsnIGJlY2F1c2Ugd2UgbXVzdC4gV2UgZW5jb2RlICclJyBhbmQNCisgICAgICogJysnIGJlY2F1c2UgdGhleSBhcmUgbWV0YSBjaGFyYWN0ZXJzIGluIFVSTCBlbmNvZGluZy4NCisgICAgICogQHBhcmFtIHN0cmluZyBUaGUgc291cmNlIHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgICBUaGUgZXNjYXBlZCByZXN1bHQuDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyBlc2NhcGUoU3RyaW5nIHN0cmluZykgew0KKyAgICAgICAgY2hhciAgICAgICAgIGM7DQorICAgICAgICBTdHJpbmcgICAgICAgcyA9IHN0cmluZy50cmltKCk7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBpbnQgICAgICAgICAgbGVuZ3RoID0gcy5sZW5ndGgoKTsNCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoOyBpICs9IDEpIHsNCisgICAgICAgICAgICBjID0gcy5jaGFyQXQoaSk7DQorICAgICAgICAgICAgaWYgKGMgPCAnICcgfHwgYyA9PSAnKycgfHwgYyA9PSAnJScgfHwgYyA9PSAnPScgfHwgYyA9PSAnOycpIHsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCclJyk7DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZChDaGFyYWN0ZXIuZm9yRGlnaXQoKGNoYXIpKChjID4+PiA0KSAmIDB4MGYpLCAxNikpOw0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoQ2hhcmFjdGVyLmZvckRpZ2l0KChjaGFyKShjICYgMHgwZiksIDE2KSk7DQorICA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KiBAcmV0dXJuIEEgSlNPTk9iamVjdCBjb250YWluaW5nICJuYW1lIiwgInZhbHVlIiwgYW5kIHBvc3NpYmx5IG90aGVyDQorICAgICAqICBtZW1iZXJzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgSlNPTk9iamVjdCB0b0pTT05PYmplY3QoU3RyaW5nIHN0cmluZykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgU3RyaW5nICAgICAgICAgbmFtZTsNCisgICAgICAgIEpTT05PYmplY3QgICAgIGpvID0gbmV3IEpTT05PYmplY3QoKTsNCisgICAgICAgIE9iamVjdCAgICAgICAgIHZhbHVlOw0KKyAgICAgICAgSlNPTlRva2VuZXIgeCA9IG5ldyBKU09OVG9rZW5lcihzdHJpbmcpOw0KKyAgICAgICAgam8ucHV0KCJuYW1lIiwgeC5uZXh0VG8oJz0nKSk7DQorICAgICAgICB4Lm5leHQoJz0nKTsNCisgICAgICAgIGpvLnB1dCgidmFsdWUiLCB4Lm5leHRUbygnOycpKTsNCisgICAgICAgIHgubmV4dCgpOw0KKyAgICAgICAgd2hpbGUgKHgubW9yZSgpKSB7DQorICAgICAgICAgICAgbmFtZSA9IHVuZXNjYXBlKHgubmV4dFRvKCI9OyIpKTsNCisgICAgICAgICAgICBpZiAoeC5uZXh0KCkgIT0gJz0nKSB7DQorICAgICAgICAgICAgICAgIGlmIChuYW1lLmVxdWFscygic2VjdXJlIikpIHsNCisgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gQm9vbGVhbi5UUlVFOw0KKyAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2luZyAnPScgaW4gY29va2llIHBhcmFtZXRlci4iKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgIHZhbHVlID0gdW5lc2NhcGUoeC5uZXh0VG8oJzsnKSk7DQorICAgICAgICAgICAgICAgIHgubmV4dCgpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBqby5wdXQobmFtZSwgdmFsdWUpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIGpvOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBDb252ZXJ0IGEgSlNPTk9iamVjdCBpbnRvIGEgY29va2llIHNwZWNpZmljYXRpb24gc3RyaW5nLiBUaGUgSlNPTk9iamVjdA0KKyAgICAgKiBtdXN0IGNvbnRhaW4gIm5hbWUiIGFuZCAidmFsdWUiIG1lbWJlcnMuDQorICAgICAqIElmIHRoZSBKU09OT2JqZWN0IGNvbnRhaW5zICJleHBpcmVzIiwgImRvbWFpbiIsICJwYXRoIiwgb3IgInNlY3VyZSINCisgICAgICogbWVtYmVycywgdGhleSB3aWxsIGJlIGFwcGVuZGVkIHRvIHRoZSBjb29raWUgc3BlY2lmaWNhdGlvbiBzdHJpbmcuDQorICAgICAqIEFsbCBvdGhlciBtZW1iZXJzIGFyZSBpZ25vcmVkLg0KKyAgICAgKiBAcGFyYW0gam8gQSBKU09OT2JqZWN0DQorICAgICAqIEByZXR1cm4gQSBjb29raWUgc3BlY2lmaWNhdGlvbiBzdHJpbmcNCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyB0b1N0cmluZyhKU09OT2JqZWN0IGpvKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorDQorICAgICAgICBzYi5hcHBlbmQoZXNjYXBlKGpvLmdldFN0cmluZygibmFtZSIpKSk7DQorICAgICAgICBzYi5hcHBlbmQoIj0iKTsNCisgICAgICAgIHNiLmFwcGVuZChlc2NhcGUoam8uZ2V0U3RyaW5nKCJ2YWx1ZSIpKSk7DQorICAgICAgICBpZiAoam8uaGFzKCJleHBpcmVzIikpIHsNCisgICAgICAgICAgICBzYi5hcHBlbmQoIjtleHBpcmVzPSIpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZChqby5nZXRTdHJpbmcoImV4cGlyZXMiKSk7DQorICAgICAgICB9DQorICAgICAgICBpZiAoam8uaGFzKCJkb21haW4iKSkgew0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgiO2RvbWFpbj0iKTsNCisgICAgICAgICAgICBzYi5hcHBlbmQoZXNjYXBlKGpvLmdldFN0cmluZygiZG9tYWluIikpKTsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChqby5oYXMoInBhdGgiKSkgew0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgiO3BhdGg9Iik7DQorICAgICAgICAgICAgc2IuYXBwZW5kKGVzY2FwZShqby5nZXRTdHJpbmcoInBhdGgiKSkpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKGpvLm9wdEJvb2xlYW4oInNlY3VyZSIpKSB7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCI7c2VjdXJlIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQ29udmVydCA8Y29kZT4lPC9jb2RlPjxpPmhoPC9pPiBzZXF1ZW5jZXMgdG8gc2luZ2xlIGNoYXJhY3RlcnMsIGFuZA0KKyAgICAgKiBjb252ZXJ0IHBsdXMgdG8gc3BhY2UuDQorICAgICAqIEBwYXJhbSBzdHJpbmcgQSBzdHJpbmcgdGhhdCBtYXkgY29udGFpbg0KKyAgICAgKiAgICAgIDxjb2RlPis8L2NvZGU+Jm5ic3A7PHNtYWxsPihwbHVzKTwvc21hbGw+IGFuZA0KKyAgICAgKiAgICAgIDxjb2RlPiU8L2NvZGU+PGk+aGg8L2k+IHNlcXVlbmNlcy4NCisgICAgICogQHJldHVybiBUaGUgdW5lc2NhcGVkIHN0cmluZy4NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHVuZXNjYXBlKFN0cmluZyBzdHJpbmcpIHsNCisgICAgICAgIGludCBsZW5ndGggPSBzdHJpbmcubGVuZ3RoKCk7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgKytpKSB7DQorICAgICAgICAgICAgY2hhciBjID0gc3RyaW5nLmNoYXJBdChpKTsNCisgICAgICAgICAgICBpZiAoYyA9PSAnKycpIHsNCisgICAgICAgICAgICAgICAgYyA9ICcgJzsNCisgICAgICAgICAgICB9IGVsc2UgaWYgKGMgPT0gJyUnICYmIGkgKyAyIDwgbGVuZ3RoKSB7DQorICAgICAgICAgICAgICAgIGludCBkID0gSlNPTlRva2VuZXIuZGVoZXhjaGFyKHN0cmluZy5jaGFyQXQoaSArIDEpKTsNCisgICAgICAgICAgICAgICAgaW50IGUgPSBKU09OVG9rZW5lci5kZWhleGNoYXIoc3RyaW5nLmNoYXJBdChpICsgMikpOw0KKyAgICAgICAgICAgICAgICBpZiAoZCA+PSAwICYmIGUgPj0gMCkgew0KKyAgICAgICAgICAgICAgICAgICAgYyA9IChjaGFyKShkICogMTYgKyBlKTsNCisgICAgICAgICAgICAgICAgICAgIGkgKz0gMjsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9Db29raWVMaXN0LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9Db29raWVMaXN0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODliNzgxNgotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0Nvb2tpZUxpc3QuamF2YQpAQCAtMCwwICsxLDExMiBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBh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05PYmplY3QNCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIEpTT05PYmplY3QgdG9KU09OT2JqZWN0KFN0cmluZyBzdHJpbmcpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIEpTT05PYmplY3Qgam8gPSBuZXcgSlNPTk9iamVjdCgpOw0KKyAgICAgICAgSlNPTlRva2VuZXIgeCA9IG5ldyBKU09OVG9rZW5lcihzdHJpbmcpOw0KKyAgICAgICAgd2hpbGUgKHgubW9yZSgpKSB7DQorICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBDb29raWUudW5lc2NhcGUoeC5uZXh0VG8oJz0nKSk7DQorICAgICAgICAgICAgeC5uZXh0KCc9Jyk7DQorICAgICAgICAgICAgam8ucHV0KG5hbWUsIENvb2tpZS51bmVzY2FwZSh4Lm5leHRUbygnOycpKSk7DQorICAgICAgICAgICAgeC5uZXh0KCk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gam87DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIENvbnZlcnQgYSBKU09OT2JqZWN0IGludG8gYSBjb29raWUgbGlzdC4gQSBjb29raWUgbGlzdCBpcyBhIHNlcXVlbmNlDQorICAgICAqIG9mIG5hbWUvdmFsdWUgcGFpcnMuIFRoZSBuYW1lcyBhcmUgc2VwYXJhdGVkIGZyb20gdGhlIHZhbHVlcyBieSAnPScuDQorICAgICAqIFRoZSBwYWlycyBhcmUgc2VwYXJhdGVkIGJ5ICc7Jy4gVGhlIGNoYXJhY3RlcnMgJyUnLCAnKycsICc9JywgYW5kICc7Jw0KKyAgICAgKiBpbiB0aGUgbmFtZXMgYW5kIHZhbHVlcyBhcmUgcmVwbGFjZWQgYnkgIiVoaCIuDQorICAgICAqIEBwYXJhbSBqbyBBIEpTT05PYmplY3QNCisgICAgICogQHJldHVybiBBIGNvb2tpZSBsaXN0IHN0cmluZw0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHRvU3RyaW5nKEpTT05PYmplY3Qgam8pIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIGJvb2xlYW4gICAgICBiID0gZmFsc2U7DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXMgPSBqby5rZXlzKCk7DQorICAgICAgICBTdHJpbmcgICAgICAgc3RyaW5nOw0KKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgd2hpbGUgKGtleXMuaGFzTmV4dCgpKSB7DQorICAgICAgICAgICAgc3RyaW5nID0ga2V5cy5uZXh0KCkudG9TdHJpbmcoKTsNCisgICAgICAgICAgICBpZiAoIWpvLmlzTnVsbChzdHJpbmcpKSB7DQorICAgICAgICAgICAgICAgIGlmIChiKSB7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJzsnKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoQ29va2llLmVzY2FwZShzdHJpbmcpKTsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCI9Iik7DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZChDb29raWUuZXNjYXBlKGpvLmdldFN0cmluZyhzdHJpbmcpKSk7DQorICAgICAgICAgICAgICAgIGIgPSB0cnVlOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOw0KKyAgICB9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0hUVFAuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0hUVFAuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zNGFkM2Y1Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSFRUUC5qYXZhCkBAIC0wLDAgKzEsMTg1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAq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orICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIEpTT05PYmplY3QgdG9KU09OT2JqZWN0KFN0cmluZyBzdHJpbmcpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIEpTT05PYmplY3QgICAgIGpvID0gbmV3IEpTT05PYmplY3QoKTsNCisgICAgICAgIEhUVFBUb2tlbmVyICAgIHggPSBuZXcgSFRUUFRva2VuZXIoc3RyaW5nKTsNCisgICAgICAgIFN0cmluZyAgICAgICAgIHRva2VuOw0KKw0KKyAgICAgICAgdG9rZW4gPSB4Lm5leHRUb2tlbigpOw0KKyAgICAgICAgaWYgKHRva2VuLnRvVXBwZXJDYXNlKCkuc3RhcnRzV2l0aCgiSFRUUCIpKSB7DQorDQorLy8gUmVzcG9uc2UNCisNCisgICAgICAgICAgICBqby5wdXQoIkhUVFAtVmVyc2lvbiIsIHRva2VuKTsNCisgICAgICAgICAgICBqby5wdXQoIlN0YXR1cy1Db2RlIiwgeC5uZXh0VG9rZW4oKSk7DQorICAgICAgICAgICAgam8ucHV0KCJSZWFzb24tUGhyYXNlIiwgeC5uZXh0VG8oJ1wwJykpOw0KKyAgICAgICAgICAgIHgubmV4dCgpOw0KKw0KKyAgICAgICAgfSBlbHNlIHsNCisNCisvLyBSZXF1ZXN0DQorDQorICAgICAgICAgICAgam8ucHV0KCJNZXRob2QiLCB0b2tlbik7DQorICAgICAgICAgICAgam8ucHV0KCJSZXF1ZXN0LVVSSSIsIHgubmV4dFRva2VuKCkpOw0KKyAgICAgICAgICAgIGpvLnB1dCgiSFRUUC1WZXJzaW9uIiwgeC5uZXh0VG9rZW4oKSk7DQorICAgICAgICB9DQorDQorLy8gRmllbGRzDQorDQorICAgICAgICB3aGlsZSAoeC5tb3JlKCkpIHsNCisgICAgICAgICAgICBTdHJpbmcgbmFtZSA9IHgubmV4dFRvKCc6Jyk7DQorICAgICAgICAgICAgeC5uZXh0KCc6Jyk7DQorICAgICAgICAgICAgam8ucHV0KG5hbWUsIH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ICAgICAqICBpbmZvcm1hdGlvbi4NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHRvU3RyaW5nKEpTT05PYmplY3Qgam8pIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIEl0ZXJhdG9yPFN0cmluZz4ga2V5cyA9IGpvLmtleXMoKTsNCisgICAgICAgIFN0cmluZyAgICAgICBzdHJpbmc7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBpZiAoam8uaGFzKCJTdGF0dXMtQ29kZSIpICYmIGpvLmhhcygiUmVhc29uLVBocmFzZSIpKSB7DQorICAgICAgICAgICAgc2IuYXBwZW5kKGpvLmdldFN0cmluZygiSFRUUC1WZXJzaW9uIikpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnICcpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZChqby5nZXRTdHJpbmcoIlN0YXR1cy1Db2RlIikpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnICcpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZChqby5nZXRTdHJpbmcoIlJlYXNvbi1QaHJhc2UiKSk7DQorICAgICAgICB9IGVsc2UgaWYgKGpvLmhhcygiTWV0aG9kIikgJiYgam8uaGFzKCJSZXF1ZXN0LVVSSSIpKSB7DQorICAgICAgICAgICAgc2IuYXBwZW5kKGpvLmdldFN0cmluZygiTWV0aG9kIikpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnICcpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnIicpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZChqby5nZXRTdHJpbmcoIlJlcXVlc3QtVVJJIikpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnIicpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnICcpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZChqby5nZXRTdHJpbmcoIkhUVFAtVmVyc2lvbiIpKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIk5vdCBlbm91Z2ggbWF0ZXJpYWwgZm9yIGFuIEhUVFAgaGVhZGVyLiIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgc2IuYXBwZW5kKENSTEYpOw0KKyAgICAgICAgd2hpbGUgKGtleXMuaGFzTmV4dCgpKSB7DQorICAgICAgICAgICAgc3RyaW5nID0ga2V5cy5uZXh0KCkudG9TdHJpbmcoKTsNCisgICAgICAgICAgICBpZiAoISJIVFRQLVZlcnNpb24iLmVxdWFscyhzdHJpbmcpICAgICAgJiYgISJTdGF0dXMtQ29kZSIuZXF1YWxzKHN0cmluZykgJiYNCisgICAgICAgICAgICAgICAgICAgICEiUmVhc29uLVBocmFzZSIuZXF1YWxzKHN0cmluZykgJiYgISJNZXRob2QiLmVxdWFscyhzdHJpbmcpICYmDQorICAgICAgICAgICAgICAgICAgICAhIlJlcXVlc3QtVVJJIi5lcXVhbHMoc3RyaW5nKSAgICYmICFqby5pc051bGwoc3RyaW5nKSkgew0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoc3RyaW5nKTsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCI6ICIpOw0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoam8uZ2V0U3RyaW5nKHN0cmluZykpOw0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoQ1JMRik7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAgICAgc2IuYXBwZW5kKENSTEYpOw0KKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSFRUUFRva2VuZXIuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0hUVFBUb2tlbmVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMDU5NGU3NAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0hUVFBUb2tlbmVyLmphdmEKQEAgLTAsMCArMSw5OSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBh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AgZG8gew0KKyAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICB9IHdoaWxlIChDaGFyYWN0ZXIuaXNXaGl0ZXNwYWNlKGMpKTsNCisgICAgICAgIGlmIChjID09ICciJyB8fCBjID09ICdcJycpIHsNCisgICAgICAgICAgICBxID0gYzsNCisgICAgICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICAgICAgICAgIGlmIChjIDwgJyAnKSB7DQorICAgICAgICAgICAgICAgICAgICB0aHJvdyBzeW50YXhFcnJvcigiVW50ZXJtaW5hdGVkIHN0cmluZy4iKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBpZiAoYyA9PSBxKSB7DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIGlmIChjID09IDAgfHwgQ2hhcmFjdGVyLmlzV2hpdGVzcGFjZShjKSkgew0KKyAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgc2IuYXBwZW5kKGMpOw0KKyAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICB9DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTkFycmF5LmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OQXJyYXkuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jOWU3YzQyCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTkFycmF5LmphdmEKQEAgLTAsMCArMSw5NzAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbi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1ZTwvY29kZT4sIDxjb2RlPmZhbHNlPC9jb2RlPiwgb3INCisgKiA8Y29kZT5udWxsPC9jb2RlPi48L2xpPg0KKyAqIDxsaT5WYWx1ZXMgY2FuIGJlIHNlcGFyYXRlZCBieSA8Y29kZT47PC9jb2RlPiA8c21hbGw+KHNlbWljb2xvbik8L3NtYWxsPiBhcw0KKyAqIHdlbGwgYXMgYnkgPGNvZGU+LDwvY29kZT4gPHNtYWxsPihjb21tYSk8L3NtYWxsPi48L2xpPg0KKyAqIDwvdWw+DQorICoNCisgKiBAYXV0aG9yIEpTT04ub3JnDQorICogQHZlcnNpb24gMjAxMi0xMS0xMw0KKyAqLw0KK3B1YmxpYyBjbGFzcyBKU09OQXJyYXkgew0KKw0KKyAgICAvKioNCisgICAgICogVGhlIGFycmF5TGlzdCB3aGVyZSB0aGUgSlNPTkFycmF5J3MgcHJvcGVydGllcyBhcmUga2VwdC4NCisgICAgICovDQorICAgIHByaXZhdGUgZmluYWwgTGlzdDxPYmplY3Q+IG15QXJyYXlMaXN0Ow0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0IGFuIGVtcHR5IEpTT05BcnJheS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkoKSB7DQorICAgICAgICB0aGlzLm15QXJyYXlMaXN0ID0gbmV3IEFycmF5TGlzdDxPYmplY3Q+KCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdCBhIEpTT05BcnJheSBmcm9tIGEgSlNPTlRva2VuZXIuDQorICAgICAqDQorICAgICAqIEBwYXJhbSB4DQorICAgICAqICAgICAgICAgICAgQSBKU09OVG9rZW5lcg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogICAgICAgICAgICAgSWYgdGhlcmUgaXMgYSBzeW50YXggZXJyb3IuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5KEpTT05Ub2tlbmVyIHgpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHRoaXMoKTsNCisgICAgICAgIGlmICh4Lm5leHRDbGVhbigpICE9ICdbJykgew0KKyAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkEgSlNPTkFycmF5IHRleHQgbXVzdCBzdGFydCB3aXRoICdbJyIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKHgubmV4dENsZWFuKCkgIT0gJ10nKSB7DQorICAgICAgICAgICAgeC5iYWNrKCk7DQorICAgICAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgICAgICBpZiAoeC5uZXh0Q2xlYW4oKSA9PSAnLCcpIHsNCisgICAgICAgICAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5teUFycmF5TGlzdC5hZGQoSlNPTk9iamVjdC5OVUxMKTsNCisgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5teUFycmF5TGlzdC5hZGQoeC5uZXh0VmFsdWUoKSk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgc3dpdGNoICh4Lm5leHRDbGVhbigpKSB7DQorICAgICAgICAgICAgICAgIGNhc2UgJzsnOg0KKyAgICAgICAgICAgICAgICBjYXNlICcsJzoNCisgICAgICAgICAgICAgICAgICAgIGlmICh4Lm5leHRDbGVhbigpID09ICddJykgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsNCisgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgICAgIGNhc2UgJ10nOg0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiRXhwZWN0ZWQgYSAnLCcgb3IgJ10nIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdCBhIEpTT05BcnJheSBmcm9tIGEgc291cmNlIEpTT04gdGV4dC4NCisgICAgICoNCisgICAgICogQHBhcmFtIHNvdXJjZQ0KKyAgICAgKiAgICAgICAgICAgIEEgc3RyaW5nIHRoYXQgYmVnaW5zIHdpdGggPGNvZGU+WzwvY29kZT4mbmJzcDs8c21hbGw+KGxlZnQNCisgICAgICogICAgICAgICAgICBicmFja2V0KTwvc21hbGw+IGFuZCBlbmRzIHdpdGggPGNvZGU+XTwvY29kZT4NCisgICAgICogICAgICAgICAgICAmbmJzcDs8c21hbGw+KHJpZ2h0IGJyYWNrZXQpPC9zbWFsbD4uDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGVyZSBpcyBhIHN5bnRheCBlcnJvci4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkoU3RyaW5nIHNvdXJjZSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcyhuZXcgSlNPTlRva2VuZXIoc291cmNlKSk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdCBhIEpTT05BcnJheSBmcm9tIGEgQ29sbGVjdGlvbi4NCisgICAgICoNCisgICAgICogQHBhcmFtIGNvbGxlY3Rpb24NCisgICAgICogICAgICAgICAgICBBIENvbGxlY3Rpb24uDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5KENvbGxlY3Rpb248T2JqZWN0PiBjb2xsZWN0aW9uKSB7DQorICAgICAgICB0aGlzLm15QXJyYXlMaXN0ID0gbmV3IEFycmF5TGlzdDxPYmplY3Q+KCk7DQorICAgICAgICBpZiAoY29sbGVjdGlvbiAhPSBudWxsKSB7DQorICAgICAgICAgICAgSXRlcmF0b3I8T2JqZWN0PiBpdGVyID0gY29sbGVjdGlvbi5pdGVyYXRvcigpOw0KKyAgICAgICAgICAgIHdoaWxlIChpdGVyLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgICAgICB0aGlzLm15QXJyYXlMaXN0LmFkZChKU09OT2JqZWN0LndyYXAoaXRlci5uZXh0KCkpKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdCBhIEpTT05BcnJheSBmcm9tIGFuIGFycmF5DQorICAgICAqDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiBub3QgYW4gYXJyYXkuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5KE9iamVjdCBhcnJheSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcygpOw0KKyAgICAgICAgaWYgKGFycmF5LmdldENsYXNzKCkuaXNBcnJheSgpKSB7DQorICAgICAgICAgICAgaW50IGxlbmd0aCA9IEFycmF5LmdldExlbmd0aChhcnJheSk7DQorICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgICAgICB0aGlzLnB1dChKU09OT2JqZWN0LndyYXAoQXJyYXkuZ2V0KGFycmF5LCBpKSkpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAiSlNPTkFycmF5IGluaXRpYWwgdmFsdWUgc2hvdWxkIGJlIGEgc3RyaW5nIG9yIGNvbGxlY3Rpb24gb3IgYXJyYXkuIik7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgb2JqZWN0IHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhbiBpbmRleC4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGV4IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBsZW5ndGgoKSAtIDEuDQorICAgICAqIEByZXR1cm4gQW4gb2JqZWN0IHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogICAgICAgICAgICAgSWYgdGhlcmUgaXMgbm8gdmFsdWUgZm9yIHRoZSBpbmRleC4NCisgICAgICovDQorICAgIHB1YmxpYyBPYmplY3QgZ2V0KGludCBpbmRleCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMub3B0KGluZGV4KTsNCisgICAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OQXJyYXlbIiArIGluZGV4ICsgIl0gbm90IGZvdW5kLiIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIG9iamVjdDsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBib29sZWFuIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhbiBpbmRleC4gVGhlIHN0cmluZyB2YWx1ZXMgInRydWUiDQorICAgICAqIGFuZCAiZmFsc2UiIGFyZSBjb252ZXJ0ZWQgdG8gYm9vbGVhbi4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGV4IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBsZW5ndGgoKSAtIDEuDQorICAgICAqIEByZXR1cm4gVGhlIHRydXRoLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogICAgICAgICAgICAgSWYgdGhlcmUgaXMgbm8gdmFsdWUgZm9yIHRoZSBpbmRleCBvciBpZiB0aGUgdmFsdWUgaXMgbm90DQorICAgICAqICAgICAgICAgICAgIGNvbnZlcnRpYmxlIHRvIGJvb2xlYW4uDQorICAgICAqLw0KKyAgICBwdWJsaWMgYm9vbGVhbiBnZXRCb29sZWFuKGludCBpbmRleCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMuZ2V0KGluZGV4KTsNCisgICAgICAgIGlmIChvYmplY3QuZXF1YWxzKEJvb2xlYW4uRkFMU0UpDQorICAgICAgICAgICAgICAgIHx8IChvYmplY3QgaW5zdGFuY2VvZiBTdHJpbmcgJiYgKChTdHJpbmcpIG9iamVjdCkNCisgICAgICAgICAgICAgICAgICAgICAgICAuZXF1YWxzSWdub3JlQ2FzZSgiZmFsc2UiKSkpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9IGVsc2UgaWYgKG9iamVjdC5lcXVhbHMoQm9vbGVhbi5UUlVFKQ0KKyAgICAgICAgICAgICAgICB8fCAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nICYmICgoU3RyaW5nKSBvYmplY3QpDQorICAgICAgICAgICAgICAgICAgICAgICAgLmVxdWFsc0lnbm9yZUNhc2UoInRydWUiKSkpIHsNCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsNCisgICAgICAgIH0NCisgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OQXJyYXlbIiArIGluZGV4ICsgIl0gaXMgbm90IGEgYm9vbGVhbi4iKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBkb3VibGUgdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGFuIGluZGV4Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgaW5kZXggbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIGxlbmd0aCgpIC0gMS4NCisgICAgICogQHJldHVybiBUaGUgdmFsdWUuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvciBpZiB0aGUgdmFsdWUgY2Fubm90IGJlIGNvbnZlcnRlZA0KKyAgICAgKiAgICAgICAgICAgICB0byBhIG51bWJlci4NCisgICAgICovDQorICAgIHB1YmxpYyBkb3VibGUgZ2V0RG91YmxlKGludCBpbmRleCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMuZ2V0KGluZGV4KTsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgcmV0dXJuIG9iamVjdCBpbnN0YW5jZW9mIE51bWJlciA/ICgoTnVtYmVyKSBvYmplY3QpLmRvdWJsZVZhbHVlKCkNCisgICAgICAgICAgICAgICAgICAgIDogRG91YmxlLnBhcnNlRG91YmxlKChTdHJpbmcpIG9iamVjdCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OQXJyYXlbIiArIGluZGV4ICsgIl0gaXMgbm90IGEgbnVtYmVyLiIpOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGludCB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYW4gaW5kZXguDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBpbmRleCBtdXN0IGJlIGJldHdlZW4gMCBhbmQgbGVuZ3RoKCkgLSAxLg0KKyAgICAgKiBAcmV0dXJuIFRoZSB2YWx1ZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqICAgICAgICAgICAgIElmIHRoZSBrZXkgaXMgbm90IGZvdW5kIG9yIGlmIHRoZSB2YWx1ZSBpcyBub3QgYSBudW1iZXIuDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGdldEludChpbnQgaW5kZXgpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChpbmRleCk7DQorICAgICAgICB0cnkgew0KKyAgICAgICAgICAgIHJldHVybiBvYmplY3QgaW5zdGFuY2VvZiBOdW1iZXIgPyAoKE51bWJlcikgb2JqZWN0KS5pbnRWYWx1ZSgpDQorICAgICAgICAgICAgICAgICAgICA6IEludGVnZXIucGFyc2VJbnQoKFN0cmluZykgb2JqZWN0KTsNCisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05BcnJheVsiICsgaW5kZXggKyAiXSBpcyBub3QgYSBudW1iZXIuIik7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgSlNPTkFycmF5IGFzc29jaWF0ZWQgd2l0aCBhbiBpbmRleC4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGV4IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBsZW5ndGgoKSAtIDEuDQorICAgICAqIEByZXR1cm4gQSBKU09OQXJyYXkgdmFsdWUuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGVyZSBpcyBubyB2YWx1ZSBmb3IgdGhlIGluZGV4LiBvciBpZiB0aGUgdmFsdWUgaXMgbm90IGENCisgICAgICogICAgICAgICAgICAgSlNPTkFycmF5DQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5IGdldEpTT05BcnJheShpbnQgaW5kZXgpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChpbmRleCk7DQorICAgICAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgSlNPTkFycmF5KSB7DQorICAgICAgICAgICAgcmV0dXJuIChKU09OQXJyYXkpIG9iamVjdDsNCisgICAgICAgIH0NCisgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OQXJyYXlbIiArIGluZGV4ICsgIl0gaXMgbm90IGEgSlNPTkFycmF5LiIpOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIEpTT05PYmplY3QgYXNzb2NpYXRlZCB3aXRoIGFuIGluZGV4Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBzdWJzY3JpcHQNCisgICAgICogQHJldHVybiBBIEpTT05PYmplY3QgdmFsdWUuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGVyZSBpcyBubyB2YWx1ZSBmb3IgdGhlIGluZGV4IG9yIGlmIHRoZSB2YWx1ZSBpcyBub3QgYQ0KKyAgICAgKiAgICAgICAgICAgICBKU09OT2JqZWN0DQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTk9iamVjdCBnZXRKU09OT2JqZWN0KGludCBpbmRleCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMuZ2V0KGluZGV4KTsNCisgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBKU09OT2JqZWN0KSB7DQorICAgICAgICAgICAgcmV0dXJuIChKU09OT2JqZWN0KSBvYmplY3Q7DQorICAgICAgICB9DQorICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiSlNPTkFycmF5WyIgKyBpbmRleCArICJdIGlzIG5vdCBhIEpTT05PYmplY3QuIik7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgbG9uZyB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYW4gaW5kZXguDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBpbmRleCBtdXN0IGJlIGJldHdlZW4gMCBhbmQgbGVuZ3RoKCkgLSAxLg0KKyAgICAgKiBAcmV0dXJuIFRoZSB2YWx1ZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqICAgICAgICAgICAgIElmIHRoZSBrZXkgaXMgbm90IGZvdW5kIG9yIGlmIHRoZSB2YWx1ZSBjYW5ub3QgYmUgY29udmVydGVkDQorICAgICAqICAgICAgICAgICAgIHRvIGEgbnVtYmVyLg0KKyAgICAgKi8NCisgICAgcHVibGljIGxvbmcgZ2V0TG9uZyhpbnQgaW5kZXgpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChpbmRleCk7DQorICAgICAgICB0cnkgew0KKyAgICAgICAgICAgIHJldHVybiBvYmplY3QgaW5zdGFuY2VvZiBOdW1iZXIgPyAoKE51bWJlcikgb2JqZWN0KS5sb25nVmFsdWUoKQ0KKyAgICAgICAgICAgICAgICAgICAgOiBMb25nLnBhcnNlTG9uZygoU3RyaW5nKSBvYmplY3QpOw0KKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiSlNPTkFycmF5WyIgKyBpbmRleCArICJdIGlzIG5vdCBhIG51bWJlci4iKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBzdHJpbmcgYXNzb2NpYXRlZCB3aXRoIGFuIGluZGV4Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgaW5kZXggbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIGxlbmd0aCgpIC0gMS4NCisgICAgICogQHJldHVybiBBIHN0cmluZyB2YWx1ZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqICAgICAgICAgICAgIElmIHRoZXJlIGlzIG5vIHN0cmluZyB2YWx1ZSBmb3IgdGhlIGluZGV4Lg0KKyAgICAgKi8NCisgICAgcHVibGljIFN0cmluZyBnZXRTdHJpbmcoaW50IGluZGV4KSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gdGhpcy5nZXQoaW5kZXgpOw0KKyAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIFN0cmluZykgew0KKyAgICAgICAgICAgIHJldHVybiAoU3RyaW5nKSBvYmplY3Q7DQorICAgICAgICB9DQorICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiSlNPTkFycmF5WyIgKyBpbmRleCArICJdIG5vdCBhIHN0cmluZy4iKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogRGV0ZXJtaW5lIGlmIHRoZSB2YWx1ZSBpcyBudWxsLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgaW5kZXggbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIGxlbmd0aCgpIC0gMS4NCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSB2YWx1ZSBhdCB0aGUgaW5kZXggaXMgbnVsbCwgb3IgaWYgdGhlcmUgaXMgbm8gdmFsdWUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgYm9vbGVhbiBpc051bGwoaW50IGluZGV4KSB7DQorICAgICAgICByZXR1cm4gSlNPTk9iamVjdC5OVUxMLmVxdWFscyh0aGlzLm9wdChpbmRleCkpOw0KKyAgICB9DQorDQorICAgIC8qKg0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TsNCisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRWYWx1ZTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBvcHRpb25hbCBkb3VibGUgdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGFuIGluZGV4LiBOYU4gaXMgcmV0dXJuZWQNCisgICAgICogaWYgdGhlcmUgaXMgbm8gdmFsdWUgZm9yIHRoZSBpbmRleCwgb3IgaWYgdGhlIHZhbHVlIGlzIG5vdCBhIG51bWJlciBhbmQNCisgICAgICogY2Fubm90IGJlIGNvbnZlcnRlZCB0byBhIG51bWJlci4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGV4IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBsZW5ndGgoKSAtIDEuDQorICAgICAqIEByZXR1cm4gVGhlIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIGRvdWJsZSBvcHREb3VibGUoaW50IGluZGV4KSB7DQorICAgICAgICByZXR1cm4gdGhpcy5vcHREb3VibGUoaW5kZXgsIERvdWJsZS5OYU4pOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIG9wdGlvbmFsIGRvdWJsZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYW4gaW5kZXguIFRoZSBkZWZhdWx0VmFsdWUNCisgICAgICogaXMgcmV0dXJuZWQgaWYgdGhlcmUgaXMgbm8gdmFsdWUgZm9yIHRoZSBpbmRleCwgb3IgaWYgdGhlIHZhbHVlIGlzIG5vdCBhDQorICAgICAqIG51bWJlciBhbmQgY2Fubm90IGJlIGNvbnZlcnRlZCB0byBhIG51bWJlci4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgc3Vic2NyaXB0DQorICAgICAqIEBwYX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ICAgICAqIHJldHVybmVkIGlmIHRoZXJlIGlzIG5vIHZhbHVlIGZvciB0aGUgaW5kZXgsIG9yIGlmIHRoZSB2YWx1ZSBpcyBub3QgYQ0KKyAgICAgKiBudW1iZXIgYW5kIGNhbm5vdCBiZSBjb252ZXJ0ZWQgdG8gYSBudW1iZXIuDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBpbmRleCBtdXN0IGJlIGJldHdlZW4gMCBhbmQgbGVuZ3RoKCkgLSAxLg0KKyAgICAgKiBAcGFyYW0gZGVmYXVsdFZhbHVlDQorICAgICAqICAgICAgICAgICAgVGhlIGRlZmF1bHQgdmFsdWUuDQorICAgICAqIEByZXR1cm4gVGhlIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIGludCBvcHRJbnQoaW50IGluZGV4LCBpbnQgZGVmYXVsdFZhbHVlKSB7DQorICAgICAgICB0cnkgew0KKyAgICAgICAgICAgIHJldHVybiB0aGlzLmdldEludChpbmRleCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHJldHVybiBkZWZhdWx0VmFsdWU7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgb3B0aW9uYWwgSlNPTkFycmF5IGFzc29jaWF0ZWQgd2l0aCBhbiBpbmRleC4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgc3Vic2NyaXB0DQorICAgICAqIEByZXR1cm4gQSBKU09OQXJyYXkgdmFsdWUsIG9yIG51bGwgaWYgdGhlIGluZGV4IGhhcyBubyB2YWx1ZSwgb3IgaWYgdGhlDQorICAgICAqICAgICAgICAgdmFsdWUgaXMgbm90IGEgSlNPTkFycmF5Lg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05BcnJheSBvcHRKU09OQXJyYXkoaW50IGluZGV4KSB7DQorICAgICAgICBPYmplY3QgbyA9IHRoaXMub3B0KGluZGV4KTsNCisgICAgICAgIHJldHVybiBvIGluc3RhbmNlb2YgSlNPTkFycmF5ID8gKEpTT05BcnJheSkgbyA6IG51bGw7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgb3B0aW9uYWwgSlNPTk9iamVjdCBhc3NvY2lhdGVkIHdpdGggYW4gaW5kZXguIE51bGwgaXMgcmV0dXJuZWQgaWYNCisgICAgICogdGhlIGtleSBpcyBub3QgZm91bmQsIG9yIG51bGwgaWYgdGhlIGluZGV4IGhhcyBubyB2YWx1ZSwgb3IgaWYgdGhlIHZhbHVlDQorICAgICAqIGlzIG5vdCBhIEpTT05PYmplY3QuDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBpbmRleCBtdXN0IGJlIGJldHdlZW4gMCBhbmQgbGVuZ3RoKCkgLSAxLg0KKyAgICAgKiBAcmV0dXJuIEEgSlNPTk9iamVjdCB2YWx1ZS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OT2JqZWN0IG9wdEpTT05PYmplY3QoaW50IGluZGV4KSB7DQorICAgICAgICBPYmplY3QgbyA9IHRoaXMub3B0KGluZGV4KTsNCisgICAgICAgIHJldHVybiBvIGluc3RhbmNlb2YgSlNPTk9iamVjdCA/IChKU09OT2JqZWN0KSBvIDogbnVsbDsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBvcHRpb25hbCBsb25nIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhbiBpbmRleC4gWmVybyBpcyByZXR1cm5lZCBpZg0KKyAgICAgKiB0aGVyZSBpcyBubyB2YWx1ZSBmb3IgdGhlIGluZGV4LCBvciBpZiB0aGUgdmFsdWUgaXMgbm90IGEgbnVtYmVyIGFuZA0KKyAgICAgKiBjYW5ub3QgYmUgY29udmVydGVkIHRvIGEgbnVtYmVyLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgaW5kZXggbXVzdCBiZSBiZXR3ZWVuIDAgYW5kIGxlbmd0aCgpIC0gMS4NCisgICAgICogQHJldHVybiBUaGUgdmFsdWUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgbG9uZyBvcHRMb25nKGludCBpbmRleCkgew0KKyAgICAgICAgcmV0dXJuIHRoaXMub3B0TG9uZyhpbmRleCwgMCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgb3B0aW9uYWwgbG9uZyB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYW4gaW5kZXguIFRoZSBkZWZhdWx0VmFsdWUgaXMNCisgICAgICogcmV0dXJuZWQgaWYgdGhlcmUgaXMgbm8gdmFsdWUgZm9yIHRoZSBpbmRleCwgb3IgaWYgdGhlIHZhbHVlIGlzIG5vdCBhDQorICAgICAqIG51bWJlciBhbmQgY2Fubm90IGJlIGNvbnZlcnRlZCB0byBhIG51bWJlci4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGV4IG11c3QgYmUgYmV0d2VlbiAwIGFuZCBsZW5ndGgoKSAtIDEuDQorICAgICAqIEBwYXJhbSBkZWZhdWx0VmFsdWUNCisgICAgICogICAgICAgICAgICBUaGUgZGVmYXVsdCB2YWx1ZS4NCisgICAgICogQHJldHVybiBUaGUgdmFsdWUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgbG9uZyBvcHRMb25nKGludCBpbmRleCwgbG9uZyBkZWZhdWx0VmFsdWUpIHsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0TG9uZyhpbmRleCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHJldHVybiBkZWZhdWx0VmFsdWU7DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgLyoq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nJheSh2YWx1ZSkpOw0KKyAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEFwcGVuZCBhIGRvdWJsZSB2YWx1ZS4gVGhpcyBpbmNyZWFzZXMgdGhlIGFycmF5J3MgbGVuZ3RoIGJ5IG9uZS4NCisgICAgICoNCisgICAgICogQHBhcmFtIHZhbHVlDQorICAgICAqICAgICAgICAgICAgQSBkb3VibGUgdmFsdWUuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBpZiB0aGUgdmFsdWUgaXMgbm90IGZpbml0ZS4NCisgICAgICogQHJldHVybiB0aGlzLg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05BcnJheSBwdXQoZG91YmxlIHZhbHVlKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBEb3VibGUgZCA9IG5ldyBEb3VibGUodmFsdWUpOw0KKyAgICAgICAgSlNPTk9iamVjdC50ZXN0VmFsaWRpdHkoZCk7DQorICAgICAgICB0aGlzLnB1dChkKTsNCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBBcHBlbmQgYW4gaW50IHZhbHVlLiBUaGlzIGluY3JlYXNlcyB0aGUgYXJyYXkncyBsZW5ndGggYnkgb25lLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogICAgICAgICAgICBBbiBpbnQgdmFsdWUuDQorICAgICAqIEByZXR1cm4gdGhpcy4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgcHV0KGludCB2YWx1ZSkgew0KKyAgICAgICAgdGhpcy5wdXQobmV3IEludGVnZXIodmFsdWUpKTsNCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBBcHBlbmQgYW4gbG9uZyB2YWx1ZS4gVGhpcyBpbmNyZWFzZXMgdGhlIGFycmF5J3MgbGVuZ3RoIGJ5IG9uZS4NCisgICAgICoNCisgICAgICogQHBhcmFtIHZhbHVlDQorICAgICAqICAgICAgICAgICAgQSBsb25nIHZhbHVlLg0KKyAgICAgKiBAcmV0dXJuIHRoaXMuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5IHB1dChsb25nIHZhbHVlKSB7DQorICAgICAgICB0aGlzLnB1dChuZXcgTG9uZyh2YWx1ZSkpOw0KKyAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFB1dCBhIHZhbHVlIGluIHRoZSBKU09OQXJyYXksIHdoZXJlIHRoZSB2YWx1ZSB3aWxsIGJlIGEgSlNPTk9iamVjdCB3aGljaA0KKyAgICAgKiBpcyBwcm9kdWNlZCBmcm9tIGEgTWFwLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogICAgICAgICAgICBBIE1hcCB2YWx1ZS4NCisgICAgICogQHJldHVybiB0aGlzLg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05BcnJheSBwdXQoTWFwPFN0cmluZyxPYmplY3Q+IHZhbHVlKSB7DQorICAgICAgICB0aGlzLnB1dChuZXcgSlNPTk9iamVjdCh2YWx1ZSkpOw0KKyAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIEFwcGVuZCBhbiBvYmplY3QgdmFsdWUuIFRoaXMgaW5jcmVhc2VzIHRoZSBhcnJheSdzIGxlbmd0aCBieSBvbmUuDQorICAgICAqDQorICAgICAqIEBwYXJhbSB2YWx1ZQ0KKyAgICAgKiAgICAgICAgICAgIEFuIG9iamVjdCB2YWx1ZS4gVGhlIHZhbHVlIHNob3VsZCBiZSBhIEJvb2xlYW4sIERvdWJsZSwNCisgICAgICogICAgICAgICAgICBJbnRlZ2VyLCBKU09OQXJyYXksIEpTT05PYmplY3QsIExvbmcsIG9yIFN0cmluZywgb3IgdGhlDQorICAgICAqICAgICAgICAgICAgSlNPTk9iamVjdC5OVUxMIG9iamVjdC4NCisgICAgICogQHJldHVybiB0aGlzLg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05BcnJheSBwdXQoT2JqZWN0IHZhbHVlKSB7DQorICAgICAgICB0aGlzLm15QXJyYXlMaXN0LmFkZCh2YWx1ZSk7DQorICAgICAgICByZXR1cm4gdGhpczsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHV0IG9yIHJlcGxhY2UgYSBib29sZWFuIHZhbHVlIGluIHRoZSBKU09OQXJyYXkuIElmIHRoZSBpbmRleCBpcyBncmVhdGVyDQorICAgICAqIHRoYW4gdGhlIGxlbmd0aCBvZiB0aGUgSlNPTkFycmF5LCB0aGVuIG51bGwgZWxlbWVudHMgd2lsbCBiZSBhZGRlZCBhcw0KKyAgICAgKiBuZWNlc3NhcnkgdG8gcGFkIGl0IG91dC4NCisgICAgICoNCisgICAgICogQHBhcmFtIGluZGV4DQorICAgICAqICAgICAgICAgICAgVGhlIHN1YnNjcmlwdC4NCisgICAgICogQHBhcmFtIHZhbHVlDQorICAgICAqICAgICAgICAgICAgQSBib29sZWFuIHZhbHVlLg0KKyAgICAgKiBAcmV0dXJuIHRoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGUgaW5kZXggaXMgbmVnYXRpdmUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTkFycmF5IHB1dChpbnQgaW5kZXgsIGJvb2xlYW4gdmFsdWUpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHRoaXMucHV0KGluZGV4LCB2YWx1ZSA/IEJvb2xlYW4uVFJVRSA6IEJvb2xlYW4uRkFMU0UpOw0KKyAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFB1dCBhI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KHZhbHVlKSk7DQorICAgICAgICByZXR1cm4gdGhpczsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHV0IG9yIHJlcGxhY2UgYSBsb25nIHZhbHVlLiBJZiB0aGUgaW5kZXggaXMgZ3JlYXRlciB0aGFuIHRoZSBsZW5ndGggb2YNCisgICAgICogdGhlIEpTT05BcnJheSwgdGhlbiBudWxsIGVsZW1lbnRzIHdpbGwgYmUgYWRkZWQgYXMgbmVjZXNzYXJ5IHRvIHBhZCBpdA0KKyAgICAgKiBvdXQuDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBzdWJzY3JpcHQuDQorICAgICAqIEBwYXJhbSB2YWx1ZQ0KKyAgICAgKiAgICAgICAgICAgIEEgbG9uZyB2YWx1ZS4NCisgICAgICogQHJldHVybiB0aGlzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogICAgICAgICAgICAgSWYgdGhlIGluZGV4IGlzIG5lZ2F0aXZlLg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05BcnJheSBwdXQoaW50IGluZGV4LCBsb25nIHZhbHVlKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICB0aGlzLnB1dChpbmRleCwgbmV3IExvbmcodmFsdWUpKTsNCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBQdXQgYSB2YWx1ZSBpbiB0aGUgSlNPTkFycmF5LCB3aGVyZSB0aGUgdmFsdWUgd2lsbCBiZSBhIEpTT05PYmplY3QgdGhhdA0KKyAgICAgKiBpcyBwcm9kdWNlZCBmcm9tIGEgTWFwLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgc3Vic2NyaXB0Lg0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogICAgICAgICAgICBUaGUgTWFwIHZhbHVlLg0KKyAgICAgKiBAcmV0dXJuIHRoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGUgaW5kZXggaXMgbmVnYXRpdmUgb3IgaWYgdGhlIHRoZSB2YWx1ZSBpcyBhbiBpbnZhbGlkDQorICAgICAqICAgICAgICAgICAgIG51bWJlci4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgcHV0KGludCBpbmRleCwgTWFwPFN0cmluZyxPYmplY3Q+IHZhbHVlKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICB0aGlzLnB1dChpbmRleCwgbmV3IEpTT05PYmplY3QodmFsdWUpKTsNCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBQdXQgb3IgcmVwbGFjZSBhbiBvYmplY3QgdmFsdWUgaW4gdGhlIEpTT05BcnJheS4gSWYgdGhlIGluZGV4IGlzIGdyZWF0ZXINCisgICAgICogdGhhbiB0aGUgbGVuZ3RoIG9mIHRoZSBKU09OQXJyYXksIHRoZW4gbnVsbCBlbGVtZW50cyB3aWxsIGJlIGFkZGVkIGFzDQorICAgICAqIG5lY2Vzc2FyeSB0byBwYWQgaXQgb3V0Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gaW5kZXgNCisgICAgICogICAgICAgICAgICBUaGUgc3Vic2NyaXB0Lg0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogICAgICAgICAgICBUaGUgdmFsdWUgdG8gcHV0IGludG8gdGhlIGFycmF5LiBUaGUgdmFsdWUgc2hvdWxkIGJlIGENCisgICAgICogICAgICAgICAgICBCb29sZWFuLCBEb3VibGUsIEludGVnZXIsIEpTT05BcnJheSwgSlNPTk9iamVjdCwgTG9uZywgb3INCisgICAgICogICAgICAgICAgICBTdHJpbmcsIG9yIHRoZSBKU09OT2JqZWN0Lk5VTEwgb2JqZWN0Lg0KKyAgICAgKiBAcmV0dXJuIHRoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgICAgICAgICAgICBJZiB0aGUgaW5kZXggaXMgbmVnYXRpdmUgb3IgaWYgdGhlIHRoZSB2YWx1ZSBpcyBhbiBpbnZhbGlkDQorICAgICAqICAgICAgICAgICAgIG51bWJlci4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgcHV0KGludCBpbmRleCwgT2JqZWN0IHZhbHVlKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBKU09OT2JqZWN0LnRlc3RWYWxpZGl0eSh2YWx1ZSk7DQorICAgICAgICBpZiAoaW5kZXggPCAwKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05BcnJheVsiICsgaW5kZXggKyAiXSBub3QgZm91bmQuIik7DQorICAgICAgICB9DQorICAgICAgICBpZiAoaW5kZXggPCB0aGlzLmxlbmd0aCgpKSB7DQorICAgICAgICAgICAgdGhpcy5teUFycmF5TGlzdC5zZXQoaW5kZXgsIHZhbHVlKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgd2hpbGUgKGluZGV4ICE9IHRoaXMubGVuZ3RoKCkpIHsNCisgICAgICAgICAgICAgICAgdGhpcy5wdXQoSlNPTk9iamVjdC5OVUxMKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhpcy5wdXQodmFsdWUpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFJlbW92ZSBhbiBpbmRleCBhbmQgY2xvc2UgdGhlIGhvbGUuDQorICAgICAqDQorICAgICAqIEBwYXJhbSBpbmRleA0KKyAgICAgKiAgICAgICAgICAgIFRoZSBpbmRleCBvZiB0aGUgZWxlbWVudCB0byBiZSByZW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SBudW1iZXIgb2Ygc3BhY2VzIHRvIGFkZCB0byBlYWNoIGxldmVsIG9mIGluZGVudGF0aW9uLg0KKyAgICAgKiBAcGFyYW0gaW5kZW50DQorICAgICAqICAgICAgICAgICAgVGhlIGluZGVudGlvbiBvZiB0aGUgdG9wIGxldmVsLg0KKyAgICAgKiBAcmV0dXJuIFRoZSB3cml0ZXIuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKi8NCisgICAgV3JpdGVyIHdyaXRlKFdyaXRlciB3cml0ZXIsIGludCBpbmRlbnRGYWN0b3IsIGludCBpbmRlbnQpDQorICAgICAgICAgICAgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICBib29sZWFuIGNvbW1hbmF0ZSA9IGZhbHNlOw0KKyAgICAgICAgICAgIGludCBsZW5ndGggPSB0aGlzLmxlbmd0aCgpOw0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZSgnWycpOw0KKw0KKyAgICAgICAgICAgIGlmIChsZW5ndGggPT0gMSkgew0KKyAgICAgICAgICAgICAgICBKU09OT2JqZWN0LndyaXRlVmFsdWUod3JpdGVyLCB0aGlzLm15QXJyYXlMaXN0LmdldCgwKSwNCisgICAgICAgICAgICAgICAgICAgICAgICBpbmRlbnRGYWN0b3IsIGluZGVudCk7DQorICAgICAgICAgICAgfSBlbHNlIGlmIChsZW5ndGggIT0gMCkgew0KKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbmV3aW5kZW50ID0gaW5kZW50ICsgaW5kZW50RmFjdG9yOw0KKw0KKyAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxKSB7DQorICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuYXRlKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKCcsJyk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZW50RmFjdG9yID4gMCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZSgnXG4nKTsNCisgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgIEpTT05PYmplY3QuaW5kZW50KHdyaXRlciwgbmV3aW5kZW50KTsNCisgICAgICAgICAgICAgICAgICAgIEpTT05PYmplY3Qud3JpdGVWYWx1ZSh3cml0ZXIsIHRoaXMubXlBcnJheUxpc3QuZ2V0KGkpLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRlbnRGYWN0b3IsIG5ld2luZGVudCk7DQorICAgICAgICAgICAgICAgICAgICBjb21tYW5hdGUgPSB0cnVlOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGlmIChpbmRlbnRGYWN0b3IgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ1xuJyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgSlNPTk9iamVjdC5pbmRlbnQod3JpdGVyLCBpbmRlbnQpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ10nKTsNCisgICAgICAgICAgICByZXR1cm4gd3JpdGVyOw0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKGUpOw0KKyAgICAgICAgfQ0KKyAgICB9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0pTT05FeGNlcHRpb24uamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0pTT05FeGNlcHRpb24uamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yMzA4ZWIyCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTkV4Y2VwdGlvbi5qYXZhCkBAIC0wLDAgKzEsNjMgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorICogKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4NCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICoNCisgKiAqIEVDT01QIGlzIGEgdHJhZGVtYXJrIGFuZCBzZXJ2aWNlIG1hcmsgb2YgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuDQorICogKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorcGFja2FnZSBvcmcuanNvbjsNCisNCisvKioNCisgKiBUaGUgSlNPTkV4Y2VwdGlvbiBpcyB0aHJvd24gYnkgdGhlIEpTT04ub3JnIGNsYXNzZXMgd2hlbiB0aGluZ3MgYXJlIGFtaXNzLg0KKyAqDQorICogQGF1dGhvciBKU09OLm9yZw0KKyAqIEB2ZXJzaW9uIDIwMTMtMDItMTANCisgKi8NCitwdWJsaWMgY2xhc3MgSlNPTkV4Y2VwdGlvbiBleHRlbmRzIFJ1bnRpbWVFeGNlcHRpb24gew0KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBsb25nIHNlcmlhbFZlcnNpb25VSUQgPSAwOw0KKyAgICBwcml2YXRlIFRocm93YWJsZSBjYXVzZTsNCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdHMgYSBKU09ORXhjZXB0aW9uIHdpdGggYW4gZXhwbGFuYXRvcnkgbWVzc2FnZS4NCisgICAgICoNCisgICAgICogQHBhcmFtIG1lc3NhZ2UNCisgICAgICogICAgICAgICAgICBEZXRhaWwgYWJvdXQgdGhlIHJlYXNvbiBmb3IgdGhlIGV4Y2VwdGlvbi4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09ORXhjZXB0aW9uKFN0cmluZyBtZXNzYWdlKSB7DQorICAgICAgICBzdXBlcihtZXNzYWdlKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0cyBhIG5ldyBKU09ORXhjZXB0aW9uIHdpdGggdGhlIHNwZWNpZmllZCBjYXVzZS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09ORXhjZXB0aW9uKFRocm93YWJsZSBjYXVzZSkgew0KKyAgICAgICAgc3VwZXIoY2F1c2UuZ2V0TWVzc2FnZSgpKTsNCisgICAgICAgIHRoaXMuY2F1c2UgPSBjYXVzZTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUmV0dXJucyB0aGUgY2F1c2Ugb2YgdGhpcyBleGNlcHRpb24gb3IgbnVsbCBpZiB0aGUgY2F1c2UgaXMgbm9uZXhpc3RlbnQNCisgICAgICogb3IgdW5rbm93bi4NCisgICAgICoNCisgICAgICogQHJldHVybiB0aGUgY2F1c2Ugb2YgdGhpcyBleGNlcHRpb24gb3IgbnVsbCBpZiB0aGUgY2F1c2UgaXMgbm9uZXhpc3RlbnQNCisgICAgICogICAgICAgICAgb3IgdW5rbm93bi4NCisgICAgICovDQorICAgIHB1YmxpYyBUaHJvd2FibGUgZ2V0Q2F1c2UoKSB7DQorICAgICAgICByZXR1cm4gdGhpcy5jYXVzZTsNCisgICAgfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OTUwuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0pTT05NTC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVhZmI1OTkKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OTUwuamF2YQpAQCAtMCwwICsxLDQ4OSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcH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RhZywgb3RoZXJ3aXNlIG51bGwuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKi8NCisgICAgcHJpdmF0ZSBzdGF0aWMgT2JqZWN0IHBhcnNlKA0KKyAgICAgICAgWE1MVG9rZW5lciB4LA0KKyAgICAgICAgYm9vbGVhbiAgICBhcnJheUZvcm0sDQorICAgICAgICBKU09OQXJyYXkgIGphDQorICAgICkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgU3RyaW5nICAgICBhdHRyaWJ1dGU7DQorICAgICAgICBjaGFyICAgICAgIGM7DQorICAgICAgICBTdHJpbmcgICAgICAgY2xvc2VUYWcgPSBudWxsOw0KKyAgICAgICAgaW50ICAgICAgICBpOw0KKyAgICAgICAgSlNPTkFycmF5ICBuZXdqYSA9IG51bGw7DQorICAgICAgICBKU09OT2JqZWN0IG5ld2pvID0gbnVsbDsNCisgICAgICAgIE9iamVjdCAgICAgdG9rZW47DQorICAgICAgICBTdHJpbmcgICAgICAgdGFnTmFtZSA9IG51bGw7DQorDQorLy8gVGVzdCBmb3IgYW5kIHNraXAgcGFzdCB0aGVzZSBmb3JtczoNCisvLyAgICAgIDwhLS0gLi4uIC0tPg0KKy8vICAgICAgPCFbICAuLi4gXV0+DQorLy8gICAgICA8ISAgIC4uLiAgID4NCisvLyAgICAgIDw/ICAgLi4uICA/Pg0KKw0KKyAgICAgICAgd2hpbGUgKHRydWUpIHsNCisgICAgICAgICAgICBpZiAoIXgubW9yZSgpKSB7DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkJhZCBYTUwiKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdG9rZW4gPSB4Lm5leHRDb250ZW50KCk7DQorICAgICAgICAgICAgaWYgKHRva2VuID09IFhNTC5MVCkgew0KKyAgICAgICAgICAgICAgICB0b2tlbiA9IHgubmV4dFRva2VuKCk7DQorICAgICAgICAgICAgICAgIGlmICh0b2tlbiBpbnN0YW5jZW9mIENoYXJhY3Rlcikgew0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHRva2VuID09IFhNTC5TTEFTSCkgew0KKw0KKy8vIENsb3NlIHRhZyA8Lw0KKw0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0b2tlbiBpbnN0YW5jZW9mIFN0cmluZykpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkV4cGVjdGVkIGEgY2xvc2luZyBuYW1lIGluc3RlYWQgb2YgJyIgKw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuICsgIicuIik7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh4Lm5leHRUb2tlbigpICE9IFhNTC5HVCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaGFwZWQgY2xvc2UgdGFnIik7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbjsNCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW4gPT0gWE1MLkJBTkcpIHsNCisNCisvLyA8IQ0KKw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGMgPSB4Lm5leHQoKTsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PSAnLScpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHgubmV4dCgpID09ICctJykgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeC5za2lwUGFzdCgiLS0+Iik7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4LmJhY2soKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYyA9PSAnWycpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSB4Lm5leHRUb2tlbigpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4uZXF1YWxzKCJDREFUQSIpICYmIHgubmV4dCgpID09ICdbJykgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGphICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYS5wdXQoeC5uZXh0Q0RBVEEoKSk7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJFeHBlY3RlZCAnQ0RBVEFbJyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDE7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0TWV0YSgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRva2VuID09IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaW5nICc+JyBhZnRlciAnPCEnLiIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0b2tlbiA9PSBYTUwuTFQpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpICs9IDE7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuID09IFhNTC5HVCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgLT0gMTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoaSA+IDApOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW4gPT0gWE1MLlFVRVNUKSB7DQorDQorLy8gPD8NCisNCisgICAgICAgICAgICAgICAgICAgICAgICB4LnNraXBQYXN0KCI/PiIpOw0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaGFwZWQgdGFnIik7DQorICAgICAgICAgICAgICAgICAgICB9DQorDQorLy8gT3BlbiB0YWcgPA0KKw0KKyAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCEodG9rZW4gaW5zdGFuY2VvZiBTdHJpbmcpKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiQmFkIHRhZ05hbWUgJyIgKyB0b2tlbiArICInLiIpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgdGFnTmFtZSA9IChTdHJpbmcpdG9rZW47DQorICAgICAgICAgICAgICAgICAgICBuZXdqYSA9IG5ldyBKU09OQXJyYXkoKTsNCisgICAgICAgICAgICAgICAgICAgIG5ld2pvID0gbmV3IEpTT05PYmplY3QoKTsNCisgICAgICAgICAgICAgICAgICAgIGlmIChhcnJheUZvcm0pIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBuZXdqYS5wdXQodGFnTmFtZSk7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGphICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgamEucHV0KG5ld2phKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld2pvLnB1dCgidGFnTmFtZSIsIHRhZ05hbWUpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqYSAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGphLnB1dChuZXdqbyk7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBudWxsOw0KKyAgICAgICAgICAgICAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBudWxsKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRva2VuID09IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2hhcGVkIHRhZyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0b2tlbiBpbnN0YW5jZW9mIFN0cmluZykpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKw0KKy8vIGF0dHJpYnV0ZSA9IHZhbHVlDQorDQorICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlID0gKFN0cmluZyl0b2tlbjsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFycmF5Rm9ybSAmJiAoInRhZ05hbWUiLmVxdWFscyhhdHRyaWJ1dGUpIHx8ICJjaGlsZE5vZGUiLmVxdWFscyhhdHRyaWJ1dGUpKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJSZXNlcnZlZCBhdHRyaWJ1dGUuIik7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4gPT0gWE1MLkVRKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEodG9rZW4gaW5zdGFuY2VvZiBTdHJpbmcpKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaW5nIHZhbHVlIik7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3am8uYWNjdW11bGF0ZShhdHRyaWJ1dGUsIFhNTC5zdHJpbmdUb1ZhbHVlKChTdHJpbmcpdG9rZW4pKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9rZW4gPSBudWxsOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2pvLmFjY3VtdWxhdGUoYXR0cmlidXRlLCAiIik7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5Rm9ybSAmJiBuZXdqby5sZW5ndGgoKSA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBuZXdqYS5wdXQobmV3am8pOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKw0KKy8vIEVtcHR5IHRhZyA8Li4uLz4NCisNCisgICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBYTUwuU0xBU0gpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeC5uZXh0VG9rZW4oKSAhPSBYTUwuR1QpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2hhcGVkIHRhZyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoamEgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlGb3JtKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3amE7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3am87DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorDQorLy8gQ29udGVudCwgYmV0d2VlbiA8Li4uPiBhbmQgPC8uLi4+DQorDQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiAhPSBYTUwuR1QpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2hhcGVkIHRhZyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZVRhZyA9IChTdHJpbmcpcGFyc2UoeCwgYXJyYXlGb3JtLCBuZXdqYSk7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsb3NlVGFnICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjbG9zZVRhZy5lcXVhbHModGFnTmFtZSkpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIk1pc21hdGNoZWQgJyIgKyB0YWdOYW1lICsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIicgYW5kICciICsgY2xvc2VUYWcgKyAiJyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZ05hbWUgPSBudWxsOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFycmF5Rm9ybSAmJiBuZXdqYS5sZW5ndGgoKSA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2pvLnB1dCgiY2hpbGROb2RlcyIsIG5ld2phKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoamEgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5Rm9ybSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXdqYTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ld2pvOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgaWYgKGphICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgIGphLnB1dCh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ZyBUaGUgWE1MIHNvdXJjZSB0ZXh0Lg0KKyAgICAgKiBAcmV0dXJuIEEgSlNPTk9iamVjdCBjb250YWluaW5nIHRoZSBzdHJ1Y3R1cmVkIGRhdGEgZnJvbSB0aGUgWE1MIHN0cmluZy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIEpTT05PYmplY3QgdG9KU09OT2JqZWN0KFN0cmluZyBzdHJpbmcpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHJldHVybiB0b0pTT05PYmplY3QobmV3IFhNTFRva2VuZXIoc3RyaW5nKSk7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFJldmVyc2UgdGhlIEpTT05NTCB0cmFuc2Zvcm1hdGlvbiwgbWFraW5nIGFuIFhNTCB0ZXh0IGZyb20gYSBKU09OQXJyYXkuDQorICAgICAqIEBwYXJhbSBqYSBBIEpTT05BcnJheS4NCisgICAgICogQHJldHVybiBBbiBYTUwgc3RyaW5nLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHRvU3RyaW5nKEpTT05BcnJheSBqYSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaW50ICAgICAgICAgICAgIGk7DQorICAgICAgICBKU09OT2JqZWN0ICAgam87DQorICAgICAgICBTdHJpbmcgICAgICAga2V5Ow0KKyAgICAgICAgSXRlcmF0b3I8U3RyaW5nPiBrZXlzOw0KKyAgICAgICAgaW50ICAgICAgICAgICAgIGxlbmd0aDsNCisgICAgICAgIE9iamVjdCAgICAgICAgIG9iamVjdDsNCisgICAgICAgIFN0cmluZ0J1ZmZlciBzYiA9IG5ldyBTdHJpbmdCdWZmZXIoKTsNCisgICAgICAgIFN0cmluZyAgICAgICB0YWdOYW1lOw0KKyAgICAgICAgU3RyaW5nICAgICAgIHZhbHVlOw0KKw0KKy8vIEVtaXQgPHRhZ05hbWUNCisNCisgICAgICAgIHRhZ05hbWUgPSBqYS5nZXRTdHJpbmcoMCk7DQorICAgICAgICBYTUwubm9TcGFjZSh0YWdOYW1lKTsNCisgICAgICAgIHRhZ05hbWUgPSBYTUwuZXNjYXBlKHRhZ05hbWUpOw0KKyAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICBzYi5hcHBlbmQodGFnTmFtZSk7DQorDQorICAgICAgICBvYmplY3QgPSBqYS5vcHQoMSk7DQorICAgICAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgSlNPTk9iamVjdCkgew0KKyAgICAgICAgICAgIGkgPSAyOw0KKyAgICAgICAgICAgIGpvID0gKEpTT05PYmplY3Qpb2JqZWN0Ow0KKw0KKy8vIEVtaXQgdGhlIGF0dHJpYnV0ZXMNCisNCisgICAgICAgICAgICBrZXlzID0gam8ua2V5cygpOw0KKyAgICAgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgICAgICBrZXkgPSBrZXlzLm5leHQoKS50b1N0cmluZygpOw0KKyAgICAgICAgICAgICAgICBYTUwubm9TcGFjZShrZXkpOw0KKyAgICAgICAgICAgICAgICB2YWx1ZSA9IGpvLm9wdFN0cmluZyhrZXkpOw0KKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCcgJyk7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoWE1MLmVzY2FwZShrZXkpKTsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnPScpOw0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCciJyk7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoWE1MLmVzY2FwZSh2YWx1ZSkpOw0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCciJyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgIGkgPSAxOw0KKyAgICAgICAgfQ0KKw0KKy8vRW1pdCBjb250ZW50IGluIGJvZHkNCisNCisgICAgICAgIGxlbmd0aCA9IGphLmxlbmd0aCgpOw0KKyAgICAgICAgaWYgKGkgPj0gbGVuZ3RoKSB7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCcvJyk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCc+Jyk7DQorICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnPicpOw0KKyAgICAgICAgICAgIGRvIHsNCisgICAgICAgICAgICAgICAgb2JqZWN0ID0gamEuZ2V0KGkpOw0KKyAgICAgICAgICAgICAgICBpICs9IDE7DQorICAgICAgICAgICAgICAgIGlmIChvYmplY3QgIT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIFN0cmluZykgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChYTUwuZXNjYXBlKG9iamVjdC50b1N0cmluZygpKSk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05PYmplY3QpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQodG9TdHJpbmcoKEpTT05PYmplY3Qpb2JqZWN0KSk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05BcnJheSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh0b1N0cmluZygoSlNPTkFycmF5KW9iamVjdCkpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfSB3aGlsZSAoaSA8IGxlbmd0aCk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCcvJyk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKHRhZ05hbWUpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnPicpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFJldmVyc2UgdGhlIEpTT05NTCB0cmFuc2Zvcm1hdGlvbiwgbWFraW5nIGFuIFhNTCB0ZXh0IGZyb20gYSBKU09OT2JqZWN0Lg0KKyAgICAgKiBUaGUgSlNPTk9iamVjdCBtdXN0IGNvbnRhaW4gYSAidGFnTmFtZSIgcHJvcGVydHkuIElmIGl0IGhhcyBjaGlsZHJlbiwNCisgICAgICogdGhlbiBpdCBtdXN0IGhhdmUgYSAiY2hpbGROb2RlcyIgcHJvcGVydHkgY29udGFpbmluZyBhbiBhcnJheSBvZiBvYmplY3RzLg0KKyAgICAgKiBUaGUgb3RoZXIgcHJvcGVydGllcyBhcmUgYXR0cmlidXRlcyB3aXRoIHN0cmluZyB2YWx1ZXMuDQorICAgICAqIEBwYXJhbSBqbyBBIEpTT05PYmplY3QuDQorICAgICAqIEByZXR1cm4gQW4gWE1MIHN0cmluZy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIFN0cmluZyB0b1N0cmluZyhKU09OT2JqZWN0IGpvKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBpbnQgICAgICAgICAgaTsNCisgICAgICAgIEpTT05BcnJheSAgICBqYTsNCisgICAgICAgIFN0cmluZyAgICAgICBrZXk7DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXM7DQorICAgICAgICBpbnQgICAgICAgICAgbGVuZ3RoOw0KKyAgICAgICAgT2JqZWN0ICAgICAgICAgb2JqZWN0Ow0KKyAgICAgICAgU3RyaW5nICAgICAgIHRhZ05hbWU7DQorICAgICAgICBTdHJpbmcgICAgICAgdmFsdWU7DQorDQorLy9FbWl0IDx0YWdOYW1lDQorDQorICAgICAgICB0YWdOYW1lID0gam8ub3B0U3RyaW5nKCJ0YWdOYW1lIik7DQorICAgICAgICBpZiAodGFnTmFtZSA9PSBudWxsKSB7DQorICAgICAgICAgICAgcmV0dXJuIFhNTC5lc2NhcGUoam8udG9TdHJpbmcoKSk7DQorICAgICAgICB9DQorICAgICAgICBYTUwubm9TcGFjZSh0YWdOYW1lKTsNCisgICAgICAgIHRhZ05hbWUgPSBYTUwuZXNjYXBlKHRhZ05hbWUpOw0KKyAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICBzYi5hcHBlbmQodGFnTmFtZSk7DQorDQorLy9FbWl0IHRoZSBhdHRyaWJ1dGVzDQorDQorICAgICAgICBrZXlzID0gam8ua2V5cygpOw0KKyAgICAgICAgd2hpbGUgKGtleXMuaGFzTmV4dCgpKSB7DQorICAgICAgICAgICAga2V5ID0ga2V5cy5uZXh0KCkudG9TdHJpbmcoKTsNCisgICAgICAgICAgICBpZiAoISJ0YWdOYW1lIi5lcXVhbHMoa2V5KSAmJiAhImNoaWxkTm9kZXMiLmVxdWFscyhrZXkpKSB7DQorICAgICAgICAgICAgICAgIFhNTC5ub1NwYWNlKGtleSk7DQorICAgICAgICAgICAgICAgIHZhbHVlID0gam8ub3B0U3RyaW5nKGtleSk7DQorICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyAnKTsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChYTUwuZXNjYXBlKGtleSkpOw0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCc9Jyk7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyInKTsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChYTUwuZXNjYXBlKHZhbHVlKSk7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJyInKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisNCisvL0VtaXQgY29udGVudCBpbiBib2R5DQorDQorICAgICAgICBqYSA9IGpvLm9wdEpTT05BcnJheSgiY2hpbGROb2RlcyIpOw0KKyAgICAgICAgaWYgKGphID09IG51bGwpIHsNCisgICAgICAgICAgICBzYi5hcHBlbmQoJy8nKTsNCisgICAgICAgICAgICBzYi5hcHBlbmQoJz4nKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCc+Jyk7DQorICAgICAgICAgICAgbGVuZ3RoID0gamEubGVuZ3RoKCk7DQorICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxKSB7DQorICAgICAgICAgICAgICAgIG9iamVjdCA9IGphLmdldChpKTsNCisgICAgICAgICAgICAgICAgaWYgKG9iamVjdCAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgICAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKFhNTC5lc2NhcGUob2JqZWN0LnRvU3RyaW5nKCkpKTsNCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob2JqZWN0IGluc3RhbmNlb2YgSlNPTk9iamVjdCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh0b1N0cmluZygoSlNPTk9iamVjdClvYmplY3QpKTsNCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob2JqZWN0IGluc3RhbmNlb2YgSlNPTkFycmF5KSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHRvU3RyaW5nKChKU09OQXJyYXkpb2JqZWN0KSk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChvYmplY3QudG9TdHJpbmcoKSk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKCcvJyk7DQorICAgICAgICAgICAgc2IuYXBwZW5kKHRhZ05hbWUpOw0KKyAgICAgICAgICAgIHNiLmFwcGVuZCgnPicpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTk9iamVjdC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTk9iamVjdC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmI0YjBmZTUKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OT2JqZWN0LmphdmEKQEAgLTAsMCArMSwxNjUzIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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gKiBzbyB0aGUgY2xvbmUgbWV0aG9kIHJldHVybnMgaXRzZWxmLg0KKyAgICAgICAgICogQHJldHVybiAgICAgTlVMTC4NCisgICAgICAgICAqLw0KKyAgICAgICAgcHJvdGVjdGVkIGZpbmFsIE9iamVjdCBjbG9uZSgpIHsNCisgICAgICAgICAgICByZXR1cm4gdGhpczsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qKg0KKyAgICAgICAgICogQSBOdWxsIG9iamVjdCBpcyBlcXVhbCB0byB0aGUgbnVsbCB2YWx1ZSBhbmQgdG8gaXRzZWxmLg0KKyAgICAgICAgICogQHBhcmFtIG9iamVjdCAgICBBbiBvYmplY3QgdG8gdGVzdCBmb3IgbnVsbG5lc3MuDQorICAgICAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIG9iamVjdCBwYXJhbWV0ZXIgaXMgdGhlIEpTT05PYmplY3QuTlVMTCBvYmplY3QNCisgICAgICAgICAqICBvciBudWxsLg0KKyAgICAgICAgICovDQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCB8fCBvYmplY3QgPT0gdGhpczsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qKg0KKyAgICAgICAgICogR2V0IHRoZSAibnVsbCIgc3RyaW5nIHZhbHVlLg0KKyAgICAgICAgICogQHJldHVybiBUaGUgc3RyaW5nICJudWxsIi4NCisgICAgICAgICAqLw0KKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsNCisgICAgICAgICAgICByZXR1cm4gIm51bGwiOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBUaGUgbWFwIHdoZXJlIHRoZSBKU09OT2JqZWN0J3MgcHJvcGVydGllcyBhcmUga2VwdC4NCisgICAgICovDQorICAgIHByaXZhdGUgZmluYWwgTWFwPFN0cmluZyxPYmplY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bmdzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogQGV4Y2VwdGlvbiBKU09ORXhjZXB0aW9uIElmIGEgdmFsdWUgaXMgYSBub24tZmluaXRlIG51bWJlciBvciBpZiBhIG5hbWUgaXMgZHVwbGljYXRlZC4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OT2JqZWN0KEpTT05PYmplY3Qgam8sIFN0cmluZ1tdIG5hbWVzKSB7DQorICAgICAgICB0aGlzKCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG5hbWVzLmxlbmd0aDsgaSArPSAxKSB7DQorICAgICAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICAgICAgdGhpcy5wdXRPbmNlKG5hbWVzW2ldLCBqby5vcHQobmFtZXNbaV0pKTsNCisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gaWdub3JlKSB7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBDb25zdHJ1Y3QgYSBKU09OT2JqZWN0IGZyb20gYSBKU09OVG9rZW5lci4NCisgICAgICogQHBhcmFtIHggQSBKU09OVG9rZW5lciBvYmplY3QgY29udGFpbmluZyB0aGUgc291cmNlIHN0cmluZy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIElmIHRoZXJlIGlzIGEgc3ludGF4IGVycm9yIGluIHRoZSBzb3VyY2Ugc3RyaW5nDQorICAgICAqICBvciBhIGR1cGxpY2F0ZWQga2V5Lg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05PYmplY3QoSlNPTlRva2VuZXIgeCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcygpOw0KKyAgICAgICAgY2hhciBjOw0KKyAgICAgICAgU3RyaW5nIGtleTsNCisNCisgICAgICAgIGlmICh4Lm5leHRDbGVhbigpICE9ICd7Jykgew0KKyAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkEgSlNPTk9iamVjdCB0ZXh0IG11c3QgYmVnaW4gd2l0aCAneyciKTsNCisgICAgICAgIH0NCisgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICBjID0geC5uZXh0Q2xlYW4oKTsNCisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlIDA6DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkEgSlNPTk9iamVjdCB0ZXh0IG11c3QgZW5kIHdpdGggJ30nIik7DQorICAgICAgICAgICAgY2FzZSAnfSc6DQorICAgICAgICAgICAgICAgIHJldHVybjsNCisgICAgICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgICAgICB4LmJhY2soKTsNCisgICAgICAgICAgICAgICAga2V5ID0geC5uZXh0VmFsdWUoKS50b1N0cmluZygpOw0KKyAgICAgICAgICAgIH0NCisNCisvLyBUaGUga2V5IGlzIGZvbGxvd2VkIGJ5ICc6Jy4gV2Ugd2lsbCBhbHNvIHRvbGVyYXRlICc9JyBvciAnPT4nLg0KKw0KKyAgICAgICAgICAgIGMgPSB4Lm5leHRDbGVhbigpOw0KKyAgICAgICAgICAgIGlmIChjID09ICc9Jykgew0KKyAgICAgICAgICAgICAgICBpZiAoeC5uZXh0KCkgIT0gJz4nKSB7DQorICAgICAgICAgICAgICAgICAgICB4LmJhY2soKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPSAnOicpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiRXhwZWN0ZWQgYSAnOicgYWZ0ZXIgYSBrZXkiKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhpcy5wdXRPbmNlKGtleSwgeC5uZXh0VmFsdWUoKSk7DQorDQorLy8gUGFpcnMgYXJlIHNlcGFyYXRlZCBieSAnLCcuIFdlIHdpbGwgYWxzbyB0b2xlcmF0ZSAnOycuDQorDQorICAgICAgICAgICAgc3dpdGNoICh4Lm5leHRDbGVhbigpKSB7DQorICAgICAgICAgICAgY2FzZSAnOyc6DQorICAgICAgICAgICAgY2FzZSAnLCc6DQorICAgICAgICAgICAgICAgIGlmICh4Lm5leHRDbGVhbigpID09ICd9Jykgew0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICBjYXNlICd9JzoNCisgICAgICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgICAgIGRlZmF1bHQ6DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkV4cGVjdGVkIGEgJywnIG9yICd9JyIpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0IGEgSlNPTk9iamVjdCBmcm9tIGEgTWFwLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gbWFwIEEgbWFwIG9iamVjdCB0aGF0IGNhbiBiZSB1c2VkIHRvIGluaXRpYWxpemUgdGhlIGNvbnRlbnRzIG9mDQorICAgICAqICB0aGUgSlNPTk9iamVjdC4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTk9iamVjdChNYXA8U3RyaW5nLE9iamVjdD4gbWFwKSB7DQorICAgICAgICB0aGlzLm1hcCA9IG5ldyBIYXNoTWFwPFN0cmluZyxPYmplY3Q+KCk7DQorICAgICAgICBpZiAobWFwICE9IG51bGwpIHsNCisgICAgICAgICAgICBJdGVyYXRvcjxNYXAuRW50cnk8U3RyaW5nLE9iamVjdD4+IGkgPSBtYXAuZW50cnlTZXQoKS5pdGVyYXRvcigpOw0KKyAgICAgICAgICAgIHdoaWxlIChpLmhhc05le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FtpXTsNCisgICAgICAgICAgICAgICAgICAgIEpTT05PYmplY3QgbmV4dFRhcmdldCA9IHRhcmdldC5vcHRKU09OT2JqZWN0KHNlZ21lbnQpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRUYXJnZXQgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRUYXJnZXQgPSBuZXcgSlNPTk9iamVjdCgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wdXQoc2VnbWVudCwgbmV4dFRhcmdldCk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB0YXJnZXQgPSBuZXh0VGFyZ2V0Ow0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIHRhcmdldC5wdXQocGF0aFtsYXN0XSwgYnVuZGxlLmdldFN0cmluZygoU3RyaW5nKWtleSkpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQWNjdW11bGF0ZSB2YWx1ZXMgdW5kZXIgYSBrZXkuIEl0IGlzIHNpbWlsYXIgdG8gdGhlIHB1dCBtZXRob2QgZXhjZXB0DQorICAgICAqIHRoYXQgaWYgdGhlcmUgaXMgYWxyZWFkeSBhbiBvYmplY3Qgc3RvcmVkIHVuZGVyIHRoZSBrZXkgdGhlbiBhDQorICAgICAqIEpTT05BcnJheSBpcyBzdG9yZWQgdW5kZXIgdGhlIGtleSB0byBob2xkIGFsbCBvZiB0aGUgYWNjdW11bGF0ZWQgdmFsdWVzLg0KKyAgICAgKiBJZiB0aGVyZSBpcyBhbHJlYWR5IGEgSlNPTkFycmF5LCB0aGVuIHRoZSBuZXcgdmFsdWUgaXMgYXBwZW5kZWQgdG8gaXQuDQorICAgICAqIEluIGNvbnRyYXN0LCB0aGUgcHV0IG1ldGhvZCByZXBsYWNlcyB0aGUgcHJldmlvdXMgdmFsdWUuDQorICAgICAqDQ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iamVjdCB2YWx1ZSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGVzdFZhbGlkaXR5KHZhbHVlKTsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLm9wdChrZXkpOw0KKyAgICAgICAgaWYgKG9iamVjdCA9PSBudWxsKSB7DQorICAgICAgICAgICAgdGhpcy5wdXQoa2V5LCBuZXcgSlNPTkFycmF5KCkucHV0KHZhbHVlKSk7DQorICAgICAgICB9IGVsc2UgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05BcnJheSkgew0KKyAgICAgICAgICAgIHRoaXMucHV0KGtleSwgKChKU09OQXJyYXkpb2JqZWN0KS5wdXQodmFsdWUpKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIGtleSArDQorICAgICAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBKU09OQXJyYXkuIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gdGhpczsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIHN0cmluZyBmcm9tIGEgZG91YmxlLiBUaGUgc3RyaW5nICJudWxsIiB3aWxsIGJlIHJldHVybmVkIGlmDQorICAgICAqIHRoZSBudW1iZXIgaXMgbm90IGZpbml0ZS4NCisgICAgICogQHBhcmFtICBkIEEgZG91YmxlLg0KKyAgICAgKiBAcmV0dXJuIEEgU3RyaW5nLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZG91YmxlVG9TdHJpbmcoZG91YmxlIGQpIHsNCisgICAgICAgIGlmIChEb3VibGUuaXNJbmZpbml0ZShkKSB8fCBEb3VibGUuaXNOYU4oZCkpIHsNCisgICAgICAgICAgICByZXR1cm4gIm51bGwiOw0KKyAgICAgICAgfQ0KKw0KKy8vIFNoYXZlIG9mZiB0cmFpbGluZyB6ZXJvcyBhbmQgZGVjaW1hbCBwb2ludCwgaWYgcG9zc2libGUuDQorDQorICAgICAgICBTdHJpbmcgc3RyaW5nID0gRG91YmxlLnRvU3RyaW5nKGQpOw0KKyAgICAgICAgaWYgKHN0cmluZy5pbmRleE9mKCcuJykgPiAwICYmIHN0cmluZy5pbmRleE9mKCdlJykgPCAwICYmDQorICAgICAgICAgICAgICAgIHN0cmluZy5pbmRleE9mKCdFJykgPCAwKSB7DQorICAgICAgICAgICAgd2hpbGUgKHN0cmluZy5lbmRzV2l0aCgiMCIpKSB7DQorICAgICAgICAgICAgICAgIHN0cmluZyA9IHN0cmluZy5zdWJzdHJpbmcoMCwgc3RyaW5nLmxlbmd0aCgpIC0gMSk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlmIChzdHJpbmcuZW5kc1dpdGgoIi4iKSkgew0KKyAgICAgICAgICAgICAgICBzdHJpbmcgPSBzdHJpbmcuc3Vic3RyaW5nKDAsIHN0cmluZy5sZW5ndGgoKSAtIDEpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgdmFsdWUgb2JqZWN0IGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBvYmplY3QgYXNzb2NpYXRlZCB3aXRoIHRoZSBrZXkuDQorICAgICAqIEB0aHJvd3MgICAgICBKU09ORXhjZXB0aW9uIGlmIHRoZSBrZXkgaXMgbm90IGZvdW5kLg0KKyAgICAgKi8NCisgICAgcHVibGljIE9iamVjdCBnZXQoU3RyaW5nIGtleSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKGtleSA9PSBudWxsKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIk51bGwga2V5LiIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMub3B0KGtleSk7DQorICAgICAgICBpZiAob2JqZWN0ID09IG51bGwpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiSlNPTk9iamVjdFsiICsgcXVvdGUoa2V5KSArDQorICAgICAgICAgICAgICAgICAgICAiXSBub3QgZm91bmQuIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gb2JqZWN0Ow0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGJvb2xlYW4gdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGEga2V5Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0ga2V5ICAgQSBrZXkgc3RyaW5nLg0KKyAgICAgKiBAcmV0dXJuICAgICAgVGhlIHRydXRoLg0KKyAgICAgKiBAdGhyb3dzICAgICAgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgaWYgdGhlIHZhbHVlIGlzIG5vdCBhIEJvb2xlYW4gb3IgdGhlIFN0cmluZyAidHJ1ZSIgb3IgImZhbHNlIi4NCisgICAgICovDQorICAgIHB1YmxpYyBib29sZWFuIGdldEJvb2xlYW4oU3RyaW5nIGtleSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMuZ2V0KGtleSk7DQorICAgICAgICBpZiAob2JqZWN0LmVxdWFscyhCb29sZWFuLkZBTFNFKSB8fA0KKyAgICAgICAgICAgICAgICAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nICYmDQorICAgICAgICAgICAgICAgICgoU3RyaW5nKW9iamVjdCkuZXF1YWxzSWdub3JlQ2FzZSgiZmFsc2UiKSkpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9IGVsc2UgaWYgKG9iamVjdC5lcXVhbHMoQm9vbGVhbi5UUlVFKSB8fA0KKyAgICAgICAgICAgICAgICAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nICYmDQorICAgICAgICAgICAgICAgICgoU3RyaW5nKW9iamVjdCkuZXF1YWxzSWdub3JlQ2FzZSgidHJ1ZSIpKSkgew0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOw0KKyAgICAgICAgfQ0KKyAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIHF1b3RlKGtleSkgKw0KKyAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBCb29sZWFuLiIpOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGRvdWJsZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYSBrZXkuDQorICAgICAqIEBwYXJhbSBrZXkgICBBIGtleSBzdHJpbmcuDQorICAgICAqIEByZXR1cm4gICAgICBUaGUgbnVtZXJpYyB2YWx1ZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIGlmIHRoZSBrZXkgaXMgbm90IGZvdW5kIG9yDQorICAgICAqICBpZiB0aGUgdmFsdWUgaXMgbm90IGEgTnVtYmVyIG9iamVjdCBhbmQgY2Fubm90IGJlIGNvbnZlcnRlZCB0byBhIG51bWJlci4NCisgICAgICovDQorICAgIHB1YmxpYyBkb3VibGUgZ2V0RG91YmxlKFN0cmluZyBrZXkpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChrZXkpOw0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gb2JqZWN0IGluc3RhbmNlb2YgTnVtYmVyDQorICAgICAgICAgICAgICAgID8gKChOdW1iZXIpb2JqZWN0KS5kb3VibGVWYWx1ZSgpDQorICAgICAgICAgICAgICAgIDogRG91YmxlLnBhcnNlRG91YmxlKChTdHJpbmcpb2JqZWN0KTsNCisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIHF1b3RlKGtleSkgKw0KKyAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBudW1iZXIuIik7DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgaW50IHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBpbnRlZ2VyIHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzICAgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvciBpZiB0aGUgdmFsdWUgY2Fubm90DQorICAgICAqICBiZSBjb252ZXJ0ZWQgdG8gYW4gaW50ZWdlci4NCisgICAgICovDQorICAgIHB1YmxpYyBpbnQgZ2V0SW50KFN0cmluZyBrZXkpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChrZXkpOw0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gb2JqZWN0IGluc3RhbmNlb2YgTnVtYmVyDQorICAgICAgICAgICAgICAgID8gKChOdW1iZXIpb2JqZWN0KS5pbnRWYWx1ZSgpDQorICAgICAgICAgICAgICAgIDogSW50ZWdlci5wYXJzZUludCgoU3RyaW5nKW9iamVjdCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGFuIGludC4iKTsNCisgICAgICAgIH0NCisgICAgfQ0KK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bmQgb3INCisgICAgICogIGlmIHRoZSB2YWx1ZSBpcyBub3QgYSBKU09OT2JqZWN0Lg0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05PYmplY3QgZ2V0SlNPTk9iamVjdChTdHJpbmcga2V5KSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gdGhpcy5nZXQoa2V5KTsNCisgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBKU09OT2JqZWN0KSB7DQorICAgICAgICAgICAgcmV0dXJuIChKU09OT2JqZWN0KW9iamVjdDsNCisgICAgICAgIH0NCisgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGEgSlNPTk9iamVjdC4iKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBsb25nIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBsb25nIHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzICAgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvciBpZiB0aGUgdmFsdWUgY2Fubm90DQorICAgICAqICBiZSBjb252ZXJ0ZWQgdG8gYSBsb25nLg0KKyAgICAgKi8NCisgICAgcHVibGljIGxvbmcgZ2V0TG9uZyhTdHJpbmcga2V5KSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gdGhpcy5nZXQoa2V5KTsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgcmV0dXJuIG9iamVjdCBpbnN0YW5jZW9mIE51bWJlcg0KKyAgICAgICAgICAgICAgICA/ICgoTnVtYmVyKW9iamVjdCkubG9uZ1ZhbHVlKCkNCisgICAgICAgICAgICAgICAgOiBMb25nLnBhcnNlTG9uZygoU3RyaW5nKW9iamVjdCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGEgbG9uZy4iKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IGFuIGFycmF5IG9mIGZpZWxkIG5hbWVzIGZyb20gYSBKU09OT2JqZWN0Lg0KKyAgICAgKg0KKyAgICAgKiBAcmV0dXJuIEFuIGFycmF5IG9mIGZpZWxkIG5hbWVzLCBvciBudWxsIGlmIHRoZXJlIGFyZSBubyBuYW1lcy4NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nW10gZ2V0TmFtZXMoSlNPTk9iamVjdCBqbykgew0KKyAgICAgICAgaW50IGxlbmd0aCA9IGpvLmxlbmd0aCgpOw0KKyAgICAgICAgaWYgKGxlbmd0aCA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGl0ZXJhdG9yID0gam8ua2V5cygpOw0KKyAgICAgICAgU3RyaW5nW10gbmFtZXMgPSBuZXcgU3RyaW5nW2xlbmd0aF07DQorICAgICAgICBpbnQgaSA9IDA7DQorICAgICAgICB3aGlsZSAoaXRlcmF0b3IuaGFzTmV4dCgpKSB7DQorICAgICAgICAgICAgbmFtZXNbaV0gPSBpdGVyYXRvci5uZXh0KCk7DQorICAgICAgICAgICAgaSArPSAxOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIG5hbWVzOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZX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plY3QuDQorICAgICAqDQorICAgICAqIEByZXR1cm4gQSBrZXlTZXQuDQorICAgICAqLw0KKyAgICBwdWJsaWMgU2V0PFN0cmluZz4ga2V5U2V0KCkgew0KKyAgICAgICAgcmV0dXJuIHRoaXMubWFwLmtleVNldCgpOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIG51bWJlciBvZiBrZXlzIHN0b3JlZCBpbiB0aGUgSlNPTk9iamVjdC4NCisgICAgICoNCisgICAgICogQHJldHVybiBUaGUgbnVtYmVyIG9mIGtleXMgaW4gdGhlIEpTT05PYmplY3QuDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGxlbmd0aCgpIHsNCisgICAgICAgIHJldHVybiB0aGlzLm1hcC5zaXplKCk7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFByb2R1Y2UgYSBKU09OQXJyYXkgY29udGFpbmluZyB0aGUgbmFtZXMgb2YgdGhlIGVsZW1lbnRzIG9mIHRoaXMNCisgICAgICogSlNPTk9iamVjdC4NCisgICAgICogQHJldHVybiBBIEpTT05BcnJheSBjb250YWluaW5nIHRoZSBrZXkgc3RyaW5ncywgb3IgbnVsbCBpZiB0aGUgSlNPTk9iamVjdA0KKyAgICAgKiBpcyBlbXB0eS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgbmFtZXMoKSB7DQorICAgICAgICBKU09OQXJyYXkgamEgPSBuZXcgSlNPTkFycmF5KCk7DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXMgPSB0aGlzLmtleXMoKTsNCisgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgIGphLnB1dChrZXlzLm5leHQoKSk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gamEubGVuZ3RoKCkgPT0gMCA/IG51bGwgOiBqYTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIHN0cmluZ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SA8IG1ldGhvZHMubGVuZ3RoOyBpICs9IDEpIHsNCisgICAgICAgICAgICB0cnkgew0KKyAgICAgICAgICAgICAgICBNZXRob2QgbWV0aG9kID0gbWV0aG9kc1tpXTsNCisgICAgICAgICAgICAgICAgaWYgKE1vZGlmaWVyLmlzUHVibGljKG1ldGhvZC5nZXRNb2RpZmllcnMoKSkpIHsNCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lID0gbWV0aG9kLmdldE5hbWUoKTsNCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSAiIjsNCisgICAgICAgICAgICAgICAgICAgIGlmIChuYW1lLnN0YXJ0c1dpdGgoImdldCIpKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCJnZXRDbGFzcyIuZXF1YWxzKG5hbWUpIHx8DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZ2V0RGVjbGFyaW5nQ2xhc3MiLmVxdWFscyhuYW1lKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSAiIjsNCisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBuYW1lLnN1YnN0cmluZygzKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWUuc3RhcnRzV2l0aCgiaXMiKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IG5hbWUuc3Vic3RyaW5nKDIpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5sZW5ndGgoKSA+IDAgJiYNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhcmFjdGVyLmlzVXBwZXJDYXNlKGtleS5jaGFyQXQoMCkpICYmDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5nZXRQYXJhbWV0ZXJUeXBlcygpLmxlbmd0aCA9PSAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5sZW5ndGgoKSA9PSAxKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IGtleS50b0xvd2VyQ2FzZSgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIUNoYXJhY3Rlci5pc1VwcGVyQ2FzZShrZXkuY2hhckF0KDEpKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBrZXkuc3Vic3RyaW5nKDAsIDEpLnRvTG93ZXJDYXNlKCkgKw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5LnN1YnN0cmluZygxKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0IHJlc3VsdCA9IG1ldGhvZC5pbnZva2UoYmVhbiwgKE9iamVjdFtdKW51bGwpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcC5wdXQoa2V5LCB3cmFwKHJlc3VsdCkpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBpZ25vcmUpIHsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFB1dCBhIGtleS9ib29sZWFuIHBhaXIgaW4gdGhlIEpTT05PYmplY3QuDQorICAgICAqDQorICAgICAqIEBwYXJhbSBrZXkgICBBIGtleSBzdHJpbmcuDQorICAgICAqIEBwYXJhbSB2YWx1ZSBBIGJvb2xlYW4gd2hpY2ggaXMgdGhlIHZhbHVlLg0KKyAgICAgKi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KU09OT2JqZWN0IGlmIGl0IGlzIHByZXNlbnQuDQorICAgICAqIEBwYXJhbSBrZXkgICBBIGtleSBzdHJpbmcuDQorICAgICAqIEBwYXJhbSB2YWx1ZSBBbiBvYmplY3Qgd2hpY2ggaXMgdGhlIHZhbHVlLiBJdCBzaG91bGQgYmUgb2Ygb25lIG9mIHRoZXNlDQorICAgICAqICB0eXBlczogQm9vbGVhbiwgRG91YmxlLCBJbnRlZ2VyLCBKU09OQXJyYXksIEpTT05PYmplY3QsIExvbmcsIFN0cmluZywNCisgICAgICogIG9yIHRoZSBKU09OT2JqZWN0Lk5VTEwgb2JqZWN0Lg0KKyAgICAgKiBAcmV0dXJuIHRoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbiBJZiB0aGUgdmFsdWUgaXMgbm9uLWZpbml0ZSBudW1iZXINCisgICAgICogIG9yIGlmIHRoZSBrZXkgaXMgbnVsbC4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OT2JqZWN0IHB1dChTdHJpbmcga2V5LCBPYmplY3QgdmFsdWUpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIFN0cmluZyBwb29sZWQ7DQorICAgICAgICBpZiAoa2V5ID09IG51bGwpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiTnVsbCBrZXkuIik7DQorICAgICAgICB9DQorICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgew0KKyAgICAgICAgICAgIHRlc3RWYWxpZGl0eSh2YWx1ZSk7DQorICAgICAgICAgICAgcG9vbGVkID0gKFN0cmluZylrZXlQb29sLmdldChrZXkpOw0KKyAgICAgICAgICAgIGlmIChwb29sZWQgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICBpZiAoa2V5UG9vbC5zaXplKCkgPj0ga2V5UG9vbFNpemUpIHsNCisgICAgICAgICAgICAgICAgICAgIGtleVBvb2wgPSBuZXcgSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4oa2V5UG9vbFNpemUpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGtleVBvb2wucHV0KGtleSwga2V5KTsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBrZXkgPSBwb29sZWQ7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIHRoaXMubWFwLnB1dChrZXksIHZhbHVlKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhpcy5yZW1vdmUoa2V5KTsNCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBQdXQgYSBrZXkvdmFsdWUgcGFpciBpbiB0aGUgSlNPTk9iamVjdCwgYnV0IG9ubHkgaWYgdGhlIGtleSBhbmQgdGhlDQorICAgICAqIHZhbHVlIGFyZSBib3RoIG5vbi1udWxsLCBhbmQgb25seSBpZiB0aGVyZSBpcyBub3QgYWxyZWFkeSBhIG1lbWJlcg0KKyAgICAgKiB3aXRoIHRoYXQgbmFtZS4NCisgICAgICogQHBhcmFtIGtleQ0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogQHJldHVybiBoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIGEgZHVwbGljYXRlDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTk9iamVjdCBwdXRPbmNlKFN0cmluZyBrZXksIE9iamVjdCB2YWx1ZSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKGtleSAhPSBudWxsICYmIHZhbHVlICE9IG51bGwpIHsNCisgICAgICAgICAgICBpZiAodGhpcy5vcHQoa2V5KSAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJEdXBsaWNhdGUga2V5IFwiIiArIGtleSArICJcIiIpOw0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JpdGVyIHcpIHRocm93cyBJT0V4Y2VwdGlvbiB7DQorICAgICAgICBpZiAoc3RyaW5nID09IG51bGwgfHwgc3RyaW5nLmxlbmd0aCgpID09IDApIHsNCisgICAgICAgICAgICB3LndyaXRlKCJcIlwiIik7DQorICAgICAgICAgICAgcmV0dXJuIHc7DQorICAgICAgICB9DQorDQorICAgICAgICBjaGFyIGI7DQorICAgICAgICBjaGFyIGMgPSAwOw0KKyAgICAgICAgU3RyaW5nIGhoaGg7DQorICAgICAgICBpbnQgaTsNCisgICAgICAgIGludCBsZW4gPSBzdHJpbmcubGVuZ3RoKCk7DQorDQorICAgICAgICB3LndyaXRlKCciJyk7DQorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpICs9IDEpIHsNCisgICAgICAgICAgICBiID0gYzsNCisgICAgICAgICAgICBjID0gc3RyaW5nLmNoYXJBdChpKTsNCisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlICdcXCc6DQorICAgICAgICAgICAgY2FzZSAnIic6DQorICAgICAgICAgICAgICAgIHcud3JpdGUoJ1xcJyk7DQorICAgICAgICAgICAgICAgIHcud3JpdGUoYyk7DQorICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIGNhc2UgJy8nOg0KKyAgICAgICAgICAgICAgICBpZiAoYiA9PSAnPCcpIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoJ1xcJyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgdy53cml0ZShjKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXGInOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXGIiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXHQnOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXHQiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXG4nOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXG4iKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXGYnOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXGYiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXHInOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXHIiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgZGVmYXVsdDoNCisgICAgICAgICAgICAgICAgaWYgKGMgPCAnICcgfHwgKGMgPj0gJ1x1MDA4MCcgJiYgYyA8ICdcdTAwYTAnKQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjID49ICdcdTIwMDAnICYmIGMgPCAnXHUyMTAwJykpIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoIlxcdSIpOw0KKyAgICAgICAgICAgICAgICAgICAgaGhoaCA9IEludGVnZXIudG9IZXhTdHJpbmcoYyk7DQorICAgICAgICAgICAgICAgICAgICB3LndyaXRlKCIwMDAwIiwgMCwgNCAtIGhoaGgubGVuZ3RoKCkpOw0KKyAgICAgICAgICAgICAgICAgICAgdy53cml0ZShoaGhoKTsNCisgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoYyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgICAgICB3LndyaXRlKCciJyk7DQorICAgICAgICByZXR1cm4gdzsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUmVtb3ZlIGEgbmFtZSBhbmQgaXRzIHZhbHVlLCBpZiBwcmVzZW50Lg0KKyAgICAgKiBAcGFyYW0ga2V5IFRoZSBuYW1lIHRvIGJlIHJlbW92ZWQuDQorICAgICAqIEByZXR1cm4gVGhlIHZhbHVlIHRoYXQgd2FzIGFzc29jaWF0ZWQgd2l0aCB0aGUgbmFtZSwNCisgICAgICogb3IgbnVsbCBpZiB0aGVyZSB3YXMgbm8gdmFsdWUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgT2JqZWN0IHJlbW92ZShTdHJpbmcga2V5KSB7DQorICAgICAgICByZXR1cm4gdGhpcy5tYXAucmVtb3ZlKGtleSk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFRyeSB0byBjb252ZXJ0IGEgc3RyaW5nIGludG8gYSBudW1iZXIsIGJvb2xlYW4sIG9yIG51bGwuIElmIHRoZSBzdHJpbmcNCisgICAgICogY2FuJ3QgYmUgY29udmVydGVkLCByZXR1cm4gdGhlIHN0cmluZy4NCisgICAgICogQHBhcmFtIHN0cmluZyBBIFN0cmluZy4NCisgICAgICogQHJldHVybiBBIHNpbXBsZSBKU09OIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBPYmplY3Qgc3RyaW5nVG9WYWx1ZShTdHJpbmcgc3RyaW5nKSB7DQorICAgICAgICBEb3VibGUgZDsNCisgICAgICAgIGlmIChzdHJpbmcuZXF1YWxzKCIiKSkgew0KKyAgICAgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgICAgICB9DQorICAgICAgICBpZiAoc3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoInRydWUiKSkgew0KKyAgICAgICAgICAgIHJldHVybiBCb29sZWFuLlRSVUU7DQorICAgICAgICB9DQorICAgICAgICBpZiAoc3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoImZhbHNlIikpIHsNCisgICAgICAgICAgICByZXR1cm4gQm9vbGVhbi5GQUxTRTsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChzdHJpbmcuZXF1YWxzSWdub3JlQ2FzZSgibnVsbCIpKSB7DQorICAgICAgICAgICAgcmV0dXJuIEpTT05PYmplY3QuTlVMTDsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qDQorICAgICAgICAgKiBJZiBpdCBtaWdodCBiZSBhIG51bWJlciwgdHJ5IGNvbnZlcnRpbmcgaXQuDQorICAgICAgICAgKiBJZiBhIG51bWJlciBjYW5ub3QgYmUgcHJvZHVjZWQsIHRoZW4gdGhlIHZhbHVlIHdpbGwganVzdA0KKyAgICAgICAgICogYmUgYSBzdHJpbmcuIE5vdGUgdGhhdCB0aGUgcGx1cyBhbmQgaW1wbGllZCBzdHJpbmcNCisgICAgICAgICAqIGNvbnZlbnRpb25zIGFyZSBub24tc3RhbmRhcmQuIEEgSlNPTiBwYXJzZXIgbWF5IGFjY2VwdA0KKyAgICAgICAgICogbm9uLUpTT04gZm9ybXMgYXMgbG9uZyBhcyBpdCBhY2NlcHRzIGFsbCBjb3JyZWN0IEpTT04gZm9ybXMuDQorICAgICAgICAgKi8NCisNCisgICAgICAgIGNoYXIgYiA9IHN0cmluZy5jaGFyQXQoMCk7DQorICAgICAgICBpZiAoKGIgPj0gJzAnICYmIGIgPD0gJzknKSB8fCBiID09ICcuJyB8fCBiID09ICctJyB8fCBiID09ICcrJykgew0KKyAgICAgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgICAgIGlmIChzdHJpbmcuaW5kZXhPZignLicpID4gLTEgfHwNCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcuaW5kZXhPZignZScpID4gLTEgfHwgc3RyaW5nLmluZGV4T2YoJ0UnKSA+IC0xKSB7DQorICAgICAgICAgICAgICAgICAgICBkID0gRG91YmxlLnZhbHVlT2Yoc3RyaW5nKTsNCisgICAgICAgICAgICAgICAgICAgIGlmICghZC5pc0luZmluaXRlKCkgJiYgIWQuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgTG9uZyBteUxvbmcgPSBuZXcgTG9uZyhzdHJpbmcpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG15TG9uZy5sb25nVmFsdWUoKSA9PSBteUxvbmcuaW50VmFsdWUoKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSW50ZWdlcihteUxvbmcuaW50VmFsdWUoKSk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBteUxvbmc7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9ICBjYXRjaCAoRXhjZXB0aW9uIGlnbm9yZSkgew0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFRocm93IGFuIGV4Y2VwdGlvbiBpZiB0aGUgb2JqZWN0IGlzIGEgTmFOIG9yIGluZmluaXRlIG51bWJlci4NCisgICAgICogQHBhcmFtIG8gVGhlIG9iamVjdCB0byB0ZXN0Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgbyBpcyBhIG5vbi1maW5pdGUgbnVtYmVyLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHRlc3RWYWxpZGl0eShPYmplY3QgbykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKG8gIT0gbnVsbCkgew0KKyAgICAgICAgICAgIGlmIChvIGluc3RhbmNlb2YgRG91YmxlKSB7DQorICAgICAgICAgICAgICAgIGlmICgoKERvdWJsZSlvKS5pc0luZmluaXRlKCkgfHwgKChEb3VibGUpbykuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAgICAgIkpTT04gZG9lcyBub3QgYWxsb3cgbm9uLWZpbml0ZSBudW1iZXJzLiIpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfSBlbHNlIGlmIChvIGluc3RhbmNlb2YgRmxvYXQpIHsNCisgICAgICAgICAgICAgICAgaWYgKCgoRmxvYXQpbykuaXNJbmZpbml0ZSgpIHx8ICgoRmxvYXQpbykuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAgICAgIkpTT04gZG9lcyBub3QgYWxsb3cgbm9uLWZpbml0ZSBudW1iZXJzLiIpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBQcm9kdWNlIGEgSlNPTkFycmF5IGNvbnRhaW5pbmcgdGhlIHZhbHVlcyBvZiB0aGUgbWVtYmVycyBvZiB0aGlzDQorICAgICAqIEpTT05PYmplY3QuDQorICAgICAqIEBwYXJhbSBuYW1lcyBBIEpTT05BcnJheSBjb250YWluaW5nIGEgbGlzdCBvZiBrZXkgc3RyaW5ncy4gVGhpcw0KKyAgICAgKiBkZXRlcm1pbmVzIHRoZSBzZXF1ZW5jZSBvZiB0aGUgdmFsdWVzIGluIHRoZSByZXN1bHQuDQorICAgICAqIEByZXR1cm4gQSBKU09OQXJyYXkgb2YgdmFsdWVzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgYW55IG9mIHRoZSB2YWx1ZXMgYXJlIG5vbi1maW5pdGUgbnVtYmVycy4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgdG9KU09OQXJyYXkoSlNPTkFycmF5IG5hbWVzKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAobmFtZXMgPT0gbnVsbCB8fCBuYW1lcy5sZW5ndGgoKSA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBKU09OQXJyYXkgamEgPSBuZXcgSlNPTkFycmF5KCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG5hbWVzLmxlbmd0aCgpOyBpICs9IDEpIHsNCisgICAgICAgICAgICBqYS5wdXQodGhpcy5vcHQobmFtZXMuZ2V0U3RyaW5nKGkpKSk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gamE7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIE1ha2UgYSBKU09OIHRleHQgb2YgdGhpcyBKU09OT2JqZWN0LiBGb3IgY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UNCisgICAgICogaXMgYWRkZWQuIElmIHRoaXMgd291bGQgbm90IHJlc3VsdCBpbiBhIHN5bnRhY3RpY2FsbHkgY29ycmVjdCBKU09OIHRleHQsDQorICAgICAqIHRoZW4gbnVsbCB3aWxsIGJlIHJldHVybmVkIGluc3RlYWQuDQorICAgICAqIDxwPg0KKyAgICAgKiBXYXJuaW5nOiBUaGlzIG1ldGhvZCBhc3N1bWVzIHRoYXQgdGhlIGRhdGEgc3RydWN0dXJlIGlzIGFjeWNsaWNhbC4NCisgICAgICoNCisgICAgICogQHJldHVybiBhIHByaW50YWJsZSwgZGlzcGxheWFibGUsIHBvcnRhYmxlLCB0cmFuc21pdHRhYmxlDQorICAgICAqICByZXByZXNlbnRhdGlvbiBvZiB0aGUgb2JqZWN0LCBiZWdpbm5pbmcNCisgICAgICogIHdpdGggPGNvZGU+ezwvY29kZT4mbmJzcDs8c21hbGw+KGxlZnQgYnJhY2UpPC9zbWFsbD4gYW5kIGVuZGluZw0KKyAgICAgKiAgd2l0aCA8Y29kZT59PC9jb2RlPiZuYnNwOzxzbWFsbD4ocmlnaHQgYnJhY2UpPC9zbWFsbD4uDQorICAgICAqLw0KKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgew0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gdGhpcy50b1N0c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PSAoKEpTT05TdHJpbmcpdmFsdWUpLnRvSlNPTlN0cmluZygpOw0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKGUpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiAoU3RyaW5nKW9iamVjdDsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkJhZCB2YWx1ZSBmcm9tIHRvSlNPTlN0cmluZzogIiArIG9iamVjdCk7DQorICAgICAgICB9DQorICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBOdW1iZXIpIHsNCisgICAgICAgICAgICByZXR1cm4gbnVtYmVyVG9TdHJpbmcoKE51bWJlcikgdmFsdWUpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgQm9vbGVhbiB8fCB2YWx1ZSBpbnN0YW5jZW9mIEpTT05PYmplY3QgfHwNCisgICAgICAgICAgICAgICAgdmFsdWUgaW5zdGFuY2VvZiBKU09OQXJyYXkpIHsNCisgICAgICAgICAgICByZXR1cm4gdmFsdWUudG9TdHJpbmcoKTsNCisgICAgICAgIH0NCisgICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIE1hcCkgew0KKyAgICAgICAgICAgIHJldHVybiBuZXcgSlNPTk9iamVjdCgoTWFwPFN0cmluZywgT2JqZWN0Pil2YWx1ZSkudG9TdHJpbmcoKTsNCisgICAgICAgIH0NCisgICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIENvbGxlY3Rpb24pIHsNCisgICAgICAgICAgICByZXR1cm4gbmV3IEpTT05BcnJheSgoQ29sbGVjdGlvbjxPYmplY3Q+KXZhbHVlKS50b1N0cmluZygp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xpYyBzdGF0aWMgT2JqZWN0IHdyYXAoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7DQorICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05PYmplY3QgfHwgb2JqZWN0IGluc3RhbmNlb2YgSlNPTkFycmF5ICB8fA0KKyAgICAgICAgICAgICAgICAgICAgIE5VTEwuZXF1YWxzKG9iamVjdCkgICAgICB8fCBvYmplY3QgaW5zdGFuY2VvZiBKU09OU3RyaW5nIHx8DQorICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IGluc3RhbmNlb2YgQnl0ZSAgIHx8IG9iamVjdCBpbnN0YW5jZW9mIENoYXJhY3RlciAgfHwNCisgICAgICAgICAgICAgICAgICAgICBvYmplY3QgaW5zdGFuY2VvZiBTaG9ydCAgfHwgb2JqZWN0IGluc3RhbmNlb2YgSW50ZWdlciAgICB8fA0KKyAgICAgICAgICAgICAgICAgICAgIG9iamVjdCBpbnN0YW5jZW9mIExvbmcgICB8fCBvYmplY3QgaW5zdGFuY2VvZiBCb29sZWFuICAgIHx8DQorICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IGluc3RhbmNlb2YgRmxvYXQgIHx8IG9iamVjdCBpbnN0YW5jZW9mIERvdWJsZSAgICAgfHwNCisgICAgICAgICAgICAgICAgICAgICBvYmplY3QgaW5zdGFuY2VvZiBTdHJpbmcpIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3Q7DQorICAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIENvbGxlY3Rpb24pIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSlNPTkFycmF5KChDb2xsZWN0aW9uPE9iamVjdD4pb2JqZWN0KTsNCisgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICBpZiAob2JqZWN0LmdldENsYXNzKCkuaXNBcnJheSgpKSB7DQorICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEpTT05BcnJheShvYmplY3QpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBNYXApIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSlNPTk9iamVjdCgoTWFwPFN0cmluZywgT2JqZWN0PilvYmplY3QpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIFBhY2thZ2Ugb2JqZWN0UGFja2FnZSA9IG9iamVjdC5nZXRDbGFzcygpLmdldFBhY2thZ2UoKTsNCisgICAgICAgICAgICAgU3RyaW5nIG9iamVjdFBhY2thZ2VOYW1lID0gb2JqZWN0UGFja2FnZSAhPSBudWxsDQorICAgICAgICAgICAgICAgICA/IG9iamVjdFBhY2thZ2UuZ2V0TmFtZSgpDQorICAgICAgICAgICAgICAgICA6ICIiOw0KKyAgICAgICAgICAgICBpZiAoDQorICAgICAgICAgICAgICAgICBvYmplY3RQYWNrYWdlTmFtZS5zdGFydHNXaXRoKCJqYXZhLiIpIHx8DQorICAgICAgICAgICAgICAgICBvYmplY3RQYWNrYWdlTmFtZS5zdGFydHNXaXRoKCJqYXZheC4iKSB8fA0KKyAgICAgICAgICAgICAgICAgb2JqZWN0LmdldENsYXNzKCkuZ2V0Q2xhc3NMb2FkZXIoKSA9PSBudWxsDQorICAgICAgICAgICAgICkgew0KKyAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdC50b1N0cmluZygpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIHJldHVybiBuZXcgSlNPTk9iamVjdChvYmplY3QpOw0KKyAgICAgICAgIH0gY2F0Y2goRXhjZXB0aW9uIGV4Y2VwdGlvbikgew0KKyAgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgICB9DQorICAgICB9DQorDQorDQorICAgICAvKioNCisgICAgICAqIFdyaXRlIHRoZSBjb250ZW50cyBvZiB0aGUgSlNPTk9iamVjdCBhcyBKU09OIHRleHQgdG8gYSB3cml0ZXIuDQorICAgICAgKiBGb3IgY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UgaXMgYWRkZWQuDQorICAgICAgKiA8cD4NCisgICAgICAqIFdhcm5pbmc6IFRoaXMgbWV0aG9kIGFzc3VtZXMgdGhhdCB0aGUgZGF0YSBzdHJ1Y3R1cmUgaXMgYWN5Y2xpY2FsLg0KKyAgICAgICoNCisgICAgICAqIEByZXR1cm4gVGhlIHdyaXRlci4NCisgICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgICovDQorICAgICBwdWJsaWMgV3JpdGVyIHdyaXRlKFdyaXRlciB3cml0ZXIpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHJldHVybiB0aGlzLndyaXRlKHdyaXRlciwgMCwgMCk7DQorICAgIH0NCisNCisNCisgICAgQFN1cHByZXNzV2FybmluZ3MoInVuY2hlY2tlZCIpDQorCXN0YXRpYyBmaW5hbCBXcml0ZXIgd3JpdGVWYWx1ZShXcml0ZXIgd3JpdGVyLCBPYmplY3QgdmFsdWUsDQorICAgICAgICAgICAgaW50IGluZGVudEZhY3RvciwgaW50IGluZGVudCkgdGhyb3dzIEpTT05FeGNlcHRpb24sIElPRXhjZXB0aW9uIHsNCisgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsIHx8IHZhbHVlLmVxdWFscyhudWxsKSkgew0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZSgibnVsbCIpOw0KKyAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEpTT05PYmplY3QpIHsNCisgICAgICAgICAgICAoKEpTT05PYmplY3QpIHZhbHVlKS53cml0ZSh3cml0ZXIsIGluZGVudEZhY3RvciwgaW5kZW50KTsNCisgICAgICAgIH0g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ICAgICAgICAgICAgICBvID0gKChKU09OU3RyaW5nKSB2YWx1ZSkudG9KU09OU3RyaW5nKCk7DQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZSk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZShvICE9IG51bGwgPyBvLnRvU3RyaW5nKCkgOiBxdW90ZSh2YWx1ZS50b1N0cmluZygpKSk7DQorICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgIHF1b3RlKHZhbHVlLnRvU3RyaW5nKCksIHdyaXRlcik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gd3JpdGVyOw0KKyAgICB9DQorDQorICAgIHN0YXRpYyBmaW5hbCB2b2lkIGluZGVudChXcml0ZXIgd3JpdGVyLCBpbnQgaW5kZW50KSB0aHJvd3MgSU9FeGNlcHRpb24gew0KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpbmRlbnQ7IGkgKz0gMSkgew0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZSgnICcpOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBXcml0ZSB0aGUgY29udGVudHMgb2YgdGhlIEpTT05PYmplY3QgYXMgSlNPTiB0ZXh0IHRvIGEgd3JpdGVyLiBGb3INCisgICAgICogY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UgaXMgYWRkZWQuDQorICAgICAqIDxwPg0KKyAgICAgKiBXYXJuaW5nOiBUaGlzIG1ldGhvZCBhc3N1bWVzIHRoYXQgdGhlIGRhdGEgc3RydWN0dXJlIGlzIGFjeWNsaWNhbC4NCisgICAgICoNCisgICAgICogQHJldHVybiBUaGUgd3JpdGVyLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIFdyaXRlciB3cml0ZShXcml0ZXIgd3JpdGVyLCBpbnQgaW5kZW50RmFjdG9yLCBpbnQgaW5kZW50KQ0KKyAgICAgICAgICAgIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgYm9vbGVhbiBjb21tYW5hdGUgPSBmYWxzZTsNCisgICAgICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gdGhpcy5sZW5ndGgoKTsNCisgICAgICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXMgPSB0aGlzLmtleXMoKTsNCisgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ3snKTsNCisNCisgICAgICAgICAgICBpZiAobGVuZ3RoID09IDEpIHsNCisgICAgICAgICAgICAgICAgT2JqZWN0IGtleSA9IGtleXMubmV4dCgpOw0KKyAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUocXVvdGUoa2V5LnRvU3RyaW5nKCkpKTsNCisgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKCc6Jyk7DQorICAgICAgICAgICAgICAgIGlmIChpbmRlbnRGYWN0b3IgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJyAnKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB3cml0ZVZhbHVlKHdyaXRlciwgdGhpcy5tYXAuZ2V0KGtleSksIGluZGVudEZhY3RvciwgaW5kZW50KTsNCisgICAgICAgICAgICB9IGVsc2UgaWYgKGxlbmd0aCAhPSAwKSB7DQorICAgICAgICAgICAgICAgIGZpbmFsIGludCBuZXdpbmRlbnQgPSBpbmRlbnQgKyBpbmRlbnRGYWN0b3I7DQorICAgICAgICAgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgICAgICAgICAgT2JqZWN0IGtleSA9IGtleXMubmV4dCgpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmF0ZSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZSgnLCcpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGluZGVudEZhY3RvciA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ1xuJyk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICBpbmRlbnQod3JpdGVyLCBuZXdpbmRlbnQpOw0KKyAgICAgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKHF1b3RlKGtleS50b1N0cmluZygpKSk7DQorICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJzonKTsNCisgICAgICAgICAgICAgICAgICAgIGlmIChpbmRlbnRGYWN0b3IgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKCcgJyk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB3cml0ZVZhbHVlKHdyaXRlciwgdGhpcy5tYXAuZ2V0KGtleSksIGluZGVudEZhY3RvciwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3aW5kZW50KTsNCisgICAgICAgICAgICAgICAgICAgIGNvbW1hbmF0ZSA9IHRydWU7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgaWYgKGluZGVudEZhY3RvciA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZSgnXG4nKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBpbmRlbnQod3JpdGVyLCBpbmRlbnQpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ30nKTsNCisgICAgICAgICAgICByZXR1cm4gd3JpdGVyOw0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhjZXB0aW9uKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZXhjZXB0aW9uKTsNCisgICAgICAgIH0NCisgICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTlN0cmluZy5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vSlNPTlN0cmluZy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmQwMWFlMzMKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OU3RyaW5nLmphdmEKQEAgLTAsMCArMSw0MCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitwYWNrYWdlIG9yZy5qc29uOw0KKy8qKg0KKyAqIFRoZSA8Y29kZT5KU09OU3RyaW5nPC9jb2RlPiBpbnRlcmZhY2UgYWxsb3dzIGEgPGNvZGU+dG9KU09OU3RyaW5nKCk8L2NvZGU+DQorICogbWV0aG9kIHNvIHRoYXQgYS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dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OU3RyaW5nZXIuamF2YQpAQCAtMCwwICsxLDEwMCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCB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ZGVyDQorICAgICAgICAgICAgOiBuZXcgQnVmZmVyZWRSZWFkZXIocmVhZGVyKTsNCisgICAgICAgIHRoaXMuZW9mID0gZmFsc2U7DQorICAgICAgICB0aGlzLnVzZVByZXZpb3VzID0gZmFsc2U7DQorICAgICAgICB0aGlzLnByZXZpb3VzID0gMDsNCisgICAgICAgIHRoaXMuaW5kZXggPSAwOw0KKyAgICAgICAgdGhpcy5jaGFyYWN0ZXIgPSAxOw0KKyAgICAgICAgdGhpcy5saW5lID0gMTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0IGEgSlNPTlRva2VuZXIgZnJvbSBhbiBJbnB1dFN0cmVhbS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OVG9rZW5lcihJbnB1dFN0cmVhbSBpbnB1dFN0cmVhbSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcyhuZXcgSW5wdXRTdHJlYW1SZWFkZXIoaW5wdXRTdHJlYW0pKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0IGEgSlNPTlRva2VuZXIgZnJvbSBhIHN0cmluZy4NCisgICAgICoNCisgICAgICogQHBhcmFtIHMgICAgIEEgc291cmNlIHN0cmluZy4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OVG9rZW5lcihTdHJpbmcgcykgew0KKyAgICAgICAgdGhpcyhuZXcgU3RyaW5nUmVhZGVyKHMpKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQmFjayB1cCBvbmUgY2hhcmFjdGVyLiBUaGlzIHByb3ZpZGVzIGEgc29ydCBvZiBsb29rYWhlYWQgY2FwYWJpbGl0eSwNCisgICAgICogc28gdGhhdCB5b3UgY2FuIHRlc3QgZm9yIGEgZGlnaXQgb3IgbGV0dGVyIGJlZm9yZSBhdHRlbXB0aW5nIHRvIHBhcnNlDQorICAgICAqIHRoZSBuZXh0IG51bWJlciBvciBpZGVudGlmaWVyLg0KKyAgICAgKi8NCisgICAgcHVibGljIHZvaWQgYmFjaygpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIGlmICh0aGlzLnVzZVByZXZpb3VzIHx8IHRoaXMuaW5kZXggPD0gMCkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJTdGVwcGluZyBiYWNrIHR3byBzdGVwcyBpcyBub3Qgc3VwcG9ydGVkIik7DQorICAgICAgICB9DQorICAgICAgICB0aGlzLmluZGV4IC09IDE7DQorICAgICAgICB0aGlzLmNoYXJhY3RlciAtPSAxOw0KKyAgICAgICAgdGhpcy51c2VQcmV2aW91cyA9IHRydWU7DQorICAgICAgICB0aGlzLmVvZiA9IGZhbHNlOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGhleCB2YWx1ZSBvZiBhIGNoYXJhY3RlciAoYmFzZTE2KS4NCisgICAgICogQHBhcmFtIGMgQSBjaGFyYWN0ZXIgYmV0d2VlbiAnMCcgYW5kICc5JyBvciBiZXR3ZWVuICdBJyBhbmQgJ0YnIG9yDQorICAgICAqIGJldHdlZW4gJ2EnIGFuZCAnZicuDQorICAgICAqIEByZXR1cm4gIEFuIGludCBiZXR3ZWVuIDAgYW5kIDE1LCBvciAtMSBpZiBjIHdhcyBub3QgYSBoZXggZGlnaXQuDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIGludCBkZWhleGNoYXIoY2hhciBjKSB7DQorICAgICAgICBpZiAoYyA+PSAnMCcgJiYgYyA8PSAnOScpIHsNCisgICAgICAgICAgICByZXR1cm4gYyAtICcwJzsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdGJykgew0KKyAgICAgICAgICAgIHJldHVybiBjIC0gKCdBJyAtIDEwKTsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChjID49ICdhJyAmJiBjIDw9ICdmJykgew0KKyAgICAgICAgICAgIHJldHVybiBjIC0gKCdhJyAtIDEwKTsNCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiAtMTsNCisgICAgfQ0KKw0KKyAgICBwdWJsaWMgYm9vbGVhbiBlbmQoKSB7DQorICAgICAgICByZXR1cm4gdGhpcy5lb2YgJiYgIXRoaXMudXNlUHJldmlvdXM7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIERldGVybWluZSBpZiB0aGUgc291cmNlIHN0cmluZyBzdGlsbCBjb250YWlucyBjaGFyYWN0ZXJzIHRoYXQgbmV4dCgpDQorICAgICAqIGNhbiBjb25zdW1lLg0KKyAgICAgKiBAcmV0dXJuIHRydWUgaWYgbm90IHlldCBhdCB0aGUgZW5kIG9mIHRoZSBzb3VyY2UuDQorICAgICAqLw0KKyAgICBwdWJsaWMgYm9vbGVhbiBtb3JlKCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcy5uZXh0KCk7DQorICAgICAgICBpZiAodGhpcy5lbmQoKSkgew0KKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgICAgIH0NCisgICAgICAgIHRoaXMuYmFjaygpOw0KKyAgICAgICAgcmV0dXJuIHRydWU7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgbmV4dCBjaGFyYWN0ZXIgaW4gdGhlIHNvdXJjZSBzdHJpbmcuDQorICAgICAqDQorICAgICAqIEByZXR1cm4gVGhlIG5leHQgY2hhcmFjdGVyLCBvciAwIGlmIHBhc3QgdGhlIGVuZCBvZiB0aGUgc291cmNlIHN0cmluZy4NCisgICAgICovDQorICAgIHB1YmxpYyBjaGFyIG5leHQoKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpbnQgYzsNCisgICAgICAgIGlmICh0aGlzLnVzZVByZXZpb3VzKSB7DQorICAgICAgICAgICAgdGhpcy51c2VQcmV2aW91cyA9IGZhbHNlOw0KKyAgICAgICAgICAgIGMgPSB0aGlzLnByZXZpb3VzOw0KKyAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICB0cnkgew0KKyAgICAgICAgICAgICAgICBjID0gdGhpcy5yZWFkZXIucmVhZCgpOw0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4Y2VwdGlvbikgew0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbihleGNlcHRpb24pOw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICBpZiAoYyA8PSAwKSB7IC8vIEVuZCBvZiBzdHJlYW0NCisgICAgICAgICAgICAgICAgdGhpcy5lb2YgPSB0cnVlOw0KKyAgICAgICAgICAgICAgICBjID0gMDsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgICAgICB0aGlzLmluZGV4ICs9IDE7DQorICAgICAgICBpZiAodGhpcy5wcmV2aW91cyA9PSAnXHInKSB7DQorICAgICAgICAgICAgdGhpcy5saW5lICs9IDE7DQorICAgICAgICAgICAgdGhpcy5jaGFyYWN0ZXIgPSBjID09ICdcbicgPyAwIDogMTsNCisgICAgICAgIH0gZWxzZSBpZiAoYyA9PSAnXG4nKSB7DQorICAgICAgICAgICAgdGhpcy5saW5lICs9IDE7DQorICAgICAgICAgICAgdGhpcy5jaGFyYWN0ZXIgPSAwOw0KKyAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICB0aGlzLmNoYXJhY3RlciArPSAxOw0KKyAgICAgICAgfQ0KKyAgICAgICAgdGhpcy5wcmV2aW91cyA9IChjaGFyKSBjOw0KKyAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXM7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIENvbnN1bWUgdGhlIG5leHQgY2hhcmFjdGVyLCBhbmQgY2hlY2sgdGhhdCBpdCBtYXRjaGVzIGEgc3BlY2lmaWVkDQorICAgICAqIGNoYXJhY3Rlci4NCisgICAgICogQHBhcmFtIGMgVGhlIGNoYXJhY3RlciB0byBtYXRjaC4NCisgICAgICogQHJldHVybiBUaGUgY2hhcmFjdGVyLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gaWYgdGhlIGNoYXJhY3RlciBkb2VzIG5vdCBtYXRjaC4NCisgICAgICovDQorICAgIHB1YmxpYyBjaGFyIG5leHQoY2hhciBjKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyIG4gPSB0aGlzLm5leHQoKTsNCisgICAgICAgIGlmIChuICE9IGMpIHsNCisgICAgICAgICAgICB0aHJvdyB0aGlzLnN5bnRheEVycm9yKCJFeHBlY3RlZCAnIiArIGMgKyAiJyBhbmQgaW5zdGVhZCBzYXcgJyIgKw0KKyAgICAgICAgICAgICAgICAgICAgbiArICInIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gbjsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBuZXh0IG4gY2hhcmFjdGVycy4NCisgICAgICoNCisgICAgICogQHBhcmFtIG4gICAgIFRoZSBudW1iZXIgb2YgY2hhcmFjdGVycyB0byB0YWtlLg0KKyAgICAgKiBAcmV0dXJuICAgICAgQSBzdHJpbmcgb2YgbiBjaGFyYWN0ZXJzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogICBTdWJzdHJpbmcgYm91bmRzIGVycm9yIGlmIHRoZXJlIGFyZSBub3QNCisgICAgICogICBuIGNoYXJhY3RlcnMgcmVtYWluaW5nIGluIHRoZSBzb3VyY2Ugc3RyaW5nLg0KKyAgICAgKi8NCisgICAgIHB1YmxpYyBTdHJpbmcgbmV4dChpbnQgbikgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgIGlmIChuID09IDApIHsNCisgICAgICAgICAgICAgcmV0dXJuICIiOw0KKyAgICAgICAgIH0NCisNCisgICAgICAgICBjaGFyW10gY2hhcnMgPSBuZXcgY2hhcltuXTsNCisgICAgICAgICBpbnQgcG9zID0gMDsNCisNCisgICAgICAgICB3aGlsZSAocG9zIDwgbikgew0KKyAgICAgICAgICAgICBjaGFyc1twb3NdID0gdGhpcy5uZXh0KCk7DQorICAgICAgICAgICAgIGlmICh0aGlzLmVuZCgpKSB7DQorICAgICAgICAgICAgICAgICB0aHJvdyB0aGlzLnN5bnRheEVycm9yKCJTdWJzdHJpbmcgYm91bmRzIGVycm9yIik7DQorICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgcG9zICs9IDE7DQorICAgICAgICAgfQ0KKyAgICAgICAgIHJldHVybiBuZXcgU3RyaW5nKGNoYXJzKTsNCisgICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgbmV4dCBjaGFyIGluIHRoZSBzdHJpbmcsIHNraXBwaW5nIHdoaXRlc3BhY2UuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiBAcmV0dXJuICBBIGNoYXJhY3Rlciwgb3IgMCBpZiB0aGVyZSBhcmUgbm8gbW9yZSBjaGFyYWN0ZXJzLg0KKyAgICAgKi8NCisgICAgcHVibGljIGNoYXIgbmV4dENsZWFuKCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIGNoYXIgYyA9IHRoaXMubmV4dCgpOw0KKyAgICAgICAgICAgIGlmIChjID09IDAgfHwgYyA+ICcgJykgew0KKyAgICAgICAgICAgICAgICByZXR1cm4gYzsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFJldHVybiB0aGUgY2hhcmFjdGVycyB1cCB0byB0aGUgbmV4dCBjbG9zZSBxdW90ZSBjaGFyYWN0ZXIuDQorICAgICAqIEJhY2tzbGFzaCBwcm9jZXNzaW5nIGlzIGRvbmUuIFRoZSBmb3JtYWwgSlNPTiBmb3JtYXQgZG9lcyBub3QNCisgICAgICogYWxsb3cgc3RyaW5ncyBpbiBzaW5nbGUgcXVvdGVzLCBidXQgYW4gaW1wbGVtZW50YXRpb24gaXMgYWxsb3dlZCB0bw0KKyAgICAgKiBhY2NlcHQgdGhlbS4NCisgICAgICogQHBhcmFtIHF1b3RlIFRoZSBxdW90aW5nIGNoYXJhY3RlciwgZWl0aGVyDQorICAgICAqICAgICAgPGNvZGU+IjwvY29kZT4mbmJzcDs8c21hbGw+KGRvdWJsZSBxdW90ZSk8L3NtYWxsPiBvcg0KKyAgICAgKiAgICAgIDxjb2RlPic8L2NvZGU+Jm5ic3A7PHNtYWxsPihzaW5nbGUgcXVvdGUpPC9zbWFsbD4uDQorICAgICAqIEByZXR1cm4gICAgICBBIFN0cmluZy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIFVudGVybWluYXRlZCBzdHJpbmcuDQorICAgICAqLw0KKyAgICBwdWJsaWMgU3RyaW5nIG5leHRTdHJpbmcoY2hhciBxdW90ZSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgY2hhciBjOw0KKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIGMgPSB0aGlzLm5leHQoKTsNCisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlIDA6DQorICAgICAgICAgICAgY2FzZSAnXG4nOg0KKyAgICAgICAgICAgIGNhc2UgJ1xyJzoNCisgICAgICAgICAgICAgICAgdGhyb3cgdGhpcy5zeW50YXhFcnJvcigiVW50ZXJtaW5hdGVkIHN0cmluZyIpOw0KKyAgICAgICAgICAgIGNhc2UgJ1xcJzoNCisgICAgICAgICAgICAgICAgYyA9IHRoaXMubmV4dCgpOw0KKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICAgICAgY2FzZSAnYic6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJ1xiJyk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAndCc6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJ1x0Jyk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAnbic6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJ1xuJyk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAnZic6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJ1xmJyk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAncic6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJ1xyJyk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAndSc6DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoKGNoYXIpSW50ZWdlci5wYXJzZUludCh0aGlzLm5leHQoNCksIDE2KSk7DQorICAgICAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICAgICAgY2FzZSAnIic6DQorICAgICAgICAgICAgICAgIGNhc2UgJ1wnJzoNCisgICAgICAgICAgICAgICAgY2FzZSAnXFwnOg0KKyAgICAgICAgICAgICAgICBjYXNlICcvJzoNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZChjKTsNCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgdGhpcy5zeW50YXhFcnJvcigiSWxsZWdhbCBlc2NhcGUuIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgZGVmYXVsdDoNCisgICAgICAgICAgICAgICAgaWYgKGMgPT0gcXVvdGUpIHsNCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZChjKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgdGV4dCB1cCBidXQgbm90IGluY2x1ZGluZyB0aGUgc3BlY2lmaWVkIGNoYXJhY3RlciBvciB0aGUNCisgICAgICogZW5kIG9mIGxpbmUsIHdoaWNoZXZlciBjb21lcyBmaXJzdC4NCisgICAgICogQHBhcmFtICBkZWxpbWl0ZXIgQSBkZWxpbWl0ZXIgY2hhcmFjdGVyLg0KKyAgICAgKiBAcmV0dXJuICAgQSBzdHJpbmcuDQorICAgICAqLw0KKyAgICBwdWJsaWMgU3RyaW5nIG5leHRUbyhjaGFyIGRlbGltaXRlcikgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIGNoYXIgYyA9IHRoaXMubmV4dCgpOw0KKyAgICAgICAgICAgIGlmIChjID09IGRlbGltaXRlciB8fCBjID09IDAgfHwgYyA9PSAnXG4nIHx8IGMgPT0gJ1xyJykgew0KKyAgICAgICAgICAgICAgICBpZiAoYyAhPSAwKSB7DQorICAgICAgICAgICAgICAgICAgICB0aGlzLmJhY2soKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKS50cmltKCk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIHNiLmFwcGVuZChjKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSB0ZXh0IHVwIGJ1dCBub3QgaW5jbHVkaW5nIG9uZSBvZiB0aGUgc3BlY2lmaWVkIGRlbGltaXRlcg0KKyAgICAgKiBjaGFyYWN0ZXJzIG9yIHRoZSBlbmQgb2YgbGluZSwgd2hpY2hldmVyIGNvbWVzIGZpcnN0Lg0KKyAgICAgKiBAcGFyYW0gZGVsaW1pdGVycyBBIHNldCBvZiBkZWxpbWl0ZXIgY2hhcmFjdGVycy4NCisgICAgICogQHJldHVybiBBIHN0cmluZywgdHJpbW1lZC4NCisgICAgICovDQorICAgIHB1YmxpYyBTdHJpbmcgbmV4dFRvKFN0cmluZyBkZWxpbWl0ZXJzKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyIGM7DQorICAgICAgICBTdHJpbmdCdWZmZXIgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgYyA9IHRoaXMubmV4dCgpOw0KKyAgICAgICAgICAgIGlmIChkZWxpbWl0ZXJzLmluZGV4T2YoYykgPj0gMCB8fCBjID09IDAgfHwNCisgICAgICAgICAgICAgICAgICAgIGMgPT0gJ1xuJyB8fCBjID09ICdccicpIHsNCisgICAgICAgICAgICAgICAgaWYgKGMgIT0gMCkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5iYWNrKCk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCkudHJpbSgpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgbmV4dCB2YWx1ZS4gVGhlIHZhbHVlIGNhbiBiZSBhIEJvb2xlYW4sIERvdWJsZSwgSW50ZWdlciwNCisgICAgICogSlNPTkFycmF5LCBKU09OT2JqZWN0LCBMb25nLCBvciBTdHJpbmcsIG9yIHRoZSBKU09OT2JqZWN0Lk5VTEwgb2JqZWN0Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgc3ludGF4IGVycm9yLg0KKyAgICAgKg0KKyAgICAgKiBAcmV0dXJuIEFuIG9iamVjdC4NCisgICAgICovDQorICAgIHB1YmxpYyBPYmplY3QgbmV4dFZhbHVlKCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgY2hhciBjID0gdGhpcy5uZXh0Q2xlYW4oKTsNCisgICAgICAgIFN0cmluZyBzdHJpbmc7DQorDQorICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlICciJzoNCisgICAgICAgICAgICBjYXNlICdcJyc6DQorICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm5leHRTdHJpbmcoYyk7DQorICAgICAgICAgICAgY2FzZSAneyc6DQorICAgICAgICAgICAgICAgIHRoaXMuYmFjaygpOw0KKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEpTT05PYmplY3QodGhpcyk7DQorICAgICAgICAgICAgY2FzZSAnWyc6DQorICAgICAgICAgICAgICAgIHRoaXMuYmFjaygpOw0KKyAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEpTT05BcnJheSh0aGlzKTsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qDQorICAgICAgICAgKiBIYW5kbGUgdW5xdW90ZWQgdGV4dC4gVGhpcyBjb3VsZCBiZSB0aGUgdmFsdWVzIHRydWUsIGZhbHNlLCBvcg0KKyAgICAgICAgICogbnVsbCwgb3IgaXQgY2FuIGJlIGEgbnVtYmVyLiBBbiBpbXBsZW1lbnRhdGlvbiAoc3VjaCBhcyB0aGlzIG9uZSkNCisgICAgICAgICAqIGlzIGFsbG93ZWQgdG8gYWxzbyBhY2NlcHQgbm9uLXN0YW5kYXJkIGZvcm1zLg0KKyAgICAgICAgICoNCisgICAgICAgICAqIEFjY3VtdWxhdGUgY2hhcmFjdGVycyB1bnRpbCB3ZSByZ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yIHNraXBUbyhjaGFyIHRvKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyIGM7DQorICAgICAgICB0cnkgew0KKyAgICAgICAgICAgIGxvbmcgc3RhcnRJbmRleCA9IHRoaXMuaW5kZXg7DQorICAgICAgICAgICAgbG9uZyBzdGFydENoYXJhY3RlciA9IHRoaXMuY2hhcmFjdGVyOw0KKyAgICAgICAgICAgIGxvbmcgc3RhcnRMaW5lID0gdGhpcy5saW5lOw0KKyAgICAgICAgICAgIHRoaXMucmVhZGVyLm1hcmsoMTAwMDAwMCk7DQorICAgICAgICAgICAgZG8gew0KKyAgICAgICAgICAgICAgICBjID0gdGhpcy5uZXh0KCk7DQorICAgICAgICAgICAgICAgIGlmIChjID09IDApIHsNCisgICAgICAgICAgICAgICAgICAgIHRoaXMucmVhZGVyLnJlc2V0KCk7DQorICAgICAgICAgICAgICAgICAgICB0aGlzLmluZGV4ID0gc3RhcnRJbmRleDsNCisgICAgICAgICAgICAgICAgICAgIHRoaXMuY2hhcmFjdGVyID0gc3RhcnRDaGFyYWN0ZXI7DQorICAgICAgICAgICAgICAgICAgICB0aGlzLmxpbmUgPSBzdGFydExpbmU7DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gYzsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0gd2hpbGUgKGMgIT0gdG8pOw0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhjKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZXhjKTsNCisgICAgICAgIH0NCisNCisgICAgICAgIHRoaXMuYmFjaygpOw0KKyAgICAgICAgcmV0dXJuIGM7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIE1ha2UgYSBKU09ORXhjZXB0aW9uIHRvIHNpZ25hbCBhIHN5bnRheCBlcnJvci4NCisgICAgICoNCisgICAgICogQHBhcmFtIG1lc3NhZ2UgVGhlIGVycm9yIG1lc3NhZ2UuDQorICAgICAqIEByZXR1cm4gIEEgSlNPTkV4Y2VwdGlvbiBvYmplY3QsIHN1aXRhYmxlIGZvciB0aHJvd2luZw0KKyAgICAgKi8NCisgICAgcHVibGljIEpTT05FeGNlcHRpb24gc3ludGF4RXJyb3IoU3RyaW5nIG1lc3NhZ2UpIHsNCisgICAgICAgIHJldHVybiBuZXcgSlNPTkV4Y2VwdGlvbihtZXNzYWdlICsgdGhpcy50b1N0cmluZygpKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogTWFrZSBhIHByaW50YWJsZSBzdHJpbmcgb2YgdGhpcyBKU09OVG9rZW5lci4NCisgICAgICoNCisgICAgICogQHJldHVybiAiIGF0IHtpbmRleH0gW2NoYXJhY3RlciB7Y2hhcmFjdGVyfSBsaW5lIHtsaW5lfV0iDQorICAgICAqLw0KKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgew0KKyAgICAgICAgcmV0dXJuICIgYXQgIiArIHRoaXMuaW5kZXggKyAiIFtjaGFyYWN0ZXIgIiArIHRoaXMuY2hhcmFjdGVyICsgIiBsaW5lICIgKw0KKyAgICAgICAgICAgIHRoaXMubGluZSArICJdIjsNCisgICAgfQ0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OV3JpdGVyLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9KU09OV3JpdGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTliMGJhYgotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL0pTT05Xcml0ZXIuamF2YQpAQCAtMCwwICsxLDM0OSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisg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aHJvd3MgSlNPTkV4Y2VwdGlvbiBJZiB0aGUgdmFsdWUgaXMgb3V0IG9mIHNlcXVlbmNlLg0KKyAgICAgKi8NCisgICAgcHJpdmF0ZSBKU09OV3JpdGVyIGFwcGVuZChTdHJpbmcgc3RyaW5nKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAoc3RyaW5nID09IG51bGwpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiTnVsbCBwb2ludGVyIik7DQorICAgICAgICB9DQorICAgICAgICBpZiAodGhpcy5tb2RlID09ICdvJyB8fCB0aGlzLm1vZGUgPT0gJ2EnKSB7DQorICAgICAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuY29tbWEgJiYgdGhpcy5tb2RlID09ICdhJykgew0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy53cml0ZXIud3JpdGUoJywnKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB0aGlzLndyaXRlci53cml0ZShzdHJpbmcpOw0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZSk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlmICh0aGlzLm1vZGUgPT0gJ28nKSB7DQorICAgICAgICAgICAgICAgIHRoaXMubW9kZSA9ICdrJzsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhpcy5jb21tYSA9IHRydWU7DQorICAgICAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgICAgICB9DQorICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiVmFsdWUgb3V0IG9mIHNlcXVlbmNlLiIpOw0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBCZWdpbiBhcHBlbmRpbmcgYSBuZXcgYXJyYXkuIEFs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ICh0aGlzLm1vZGUgPT0gJ2snKSB7DQorICAgICAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICAgICAgdGhpcy5zdGFja1t0aGlzLnRvcCAtIDFdLnB1dE9uY2Uoc3RyaW5nLCBCb29sZWFuLlRSVUUpOw0KKyAgICAgICAgICAgICAgICBpZiAodGhpcy5jb21tYSkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy53cml0ZXIud3JpdGUoJywnKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB0aGlzLndyaXRlci53cml0ZShKU09OT2JqZWN0LnF1b3RlKHN0cmluZykpOw0KKyAgICAgICAgICAgICAgICB0aGlzLndyaXRlci53cml0ZSgnOicpOw0KKyAgICAgICAgICAgICAgICB0aGlzLmNvbW1hID0gZmFsc2U7DQorICAgICAgICAgICAgICAgIHRoaXMubW9kZSA9ICdvJzsNCisgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbihlKTsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiTWlzcGxhY2VkIGtleS4iKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQmVnaW4gYXBwZW5kaW5nIGEgbmV3IG9iamVjdC4gQWxsIGtleXMgYW5kIHZhbHVlcyB1bnRpbCB0aGUgYmFsYW5jaW5nDQorICAgICAqIDxjb2RlPmVuZE9iamVjdDwvY29kZT4gd2lsbCBiZSBhcHBlbmRlZCB0byB0aGlzIG9iamVjdC4gVGhlDQorICAgICAqIDxjb2RlPmVuZE9iamVjdDwvY29kZT4gbWV0aG9kIG11c3QgYmUgY2FsbGVkIHRvIG1hcmsgdGhlIG9iamVjdCdzIGVuZC4NCisgICAgICogQHJldHVybiB0aGlzDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbiBJZiB0aGUgbmVzdGluZyBpcyB0b28gZGVlcCwgb3IgaWYgdGhlIG9iamVjdCBpcw0KKyAgICAgKiBzdGFydGVkIGluIHRoZSB3cm9uZyBwbGFjZSAoZm9yIGV4YW1wbGUgYXMgYSBrZXkgb3IgYWZ0ZXIgdGhlIGVuZCBvZiB0aGUNCisgICAgICogb3V0ZXJtb3N0IGFycmF5IG9yIG9iamVjdCkuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSlNPTldyaXRlciBvYmplY3QoKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAodGhpcy5tb2RlID09ICdpJykgew0KKyAgICAgICAgICAgIHRoaXMubW9kZSA9ICdvJzsNCisgICAgICAgIH0NCisgICAgICAgIGlmICh0aGlzLm1vZGUgPT0gJ28nIHx8IHRoaXMubW9kZSA9PSAnYScpIHsNCisgICAgICAgICAgICB0aGlzLmFwcGVuZCgieyIpOw0KKyAgICAgICAgICAgIHRoaXMucHVzaChuZXcgSlNPTk9iamVjdCgpKTsNCisgICAgICAgICAgICB0aGlzLmNvbW1hID0gZmFsc2U7DQorICAgICAgICAgICAgcmV0dXJuIHRoaXM7DQorICAgICAgICB9DQorICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiTWlzcGxhY2VkIG9iamVjdC4iKTsNCisNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogUG9wIGFuIGFycmF5IG9yIG9iamVjdCBzY29wZS4NCisgICAgICogQHBhcmFtIGMgVGhlIHNjb3BlIHRvIGNsb3NlLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgbmVzdGluZyBpcyB3cm9uZy4NCisgICAgICovDQorICAgIHByaXZhdGUgdm9pZCBwb3AoY2hhciBjKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAodGhpcy50b3AgPD0gMCkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJOZXN0aW5nIGVycm9yLiIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgY2hhciBtID0gdGhpcy5zdGFja1t0aGlzLnRvcCAtIDFdID09IG51bGwgPyAnYScgOiAnayc7DQorICAgICAgICBpZiAobSAhPSBjKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIk5lc3RpbmcgZXJyb3IuIik7DQorICAgICAgICB9DQorICAgICAgICB0aGlzLnRvcCAtPSAxOw0KKyAgICAgICAgdGhpcy5tb2RlID0gdGhpcy50b3AgPT0gMA0KKyAgICAgICAgICAgID8gJ2QnDQorICAgICAgICAgICAgOiB0aGlzLnN0YWNrW3RoaXMudG9wIC0gMV0gPT0gbnVsbA0KKyAgICAgICAgICAgID8gJ2EnDQorICAgICAgICAgICAgOiAnayc7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFB1c2ggYW4gYXJyYXkgb3Igb2JqZWN0IHNjb3BlLg0KKyAgICAgKiBAcGFyYW0gam8gVGhlIHNjb3BlIHRvIG9wZW4uDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbiBJZiBuZXN0aW5nIGlzIHRvbyBkZWVwLg0KKyAgICAgKi8NCisgICAgcHJpdmF0ZSB2b2lkIHB1c2goSlNPTk9iamVjdCBqbykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKHRoaXMudG9wID49IG1heGRlcHRoKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIk5lc3RpbmcgdG9vIGRlZXAuIik7DQorICAgICAgICB9DQorICAgICAgICB0aGlzLnN0YWNrW3RoaXMudG9wXSA9IGpvOw0KKyAgICAgICAgdGhpcy5tb2RlID0gam8gPT0gbnVsbCA/ICdhJyA6ICdrJzsNCisgICAgICAgIHRoaXMudG9wICs9IDE7DQorICAg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W5nKGwpKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQXBwZW5kIGFuIG9iamVjdCB2YWx1ZS4NCisgICAgICogQHBhcmFtIG9iamVjdCBUaGUgb2JqZWN0IHRvIGFwcGVuZC4gSXQgY2FuIGJlIG51bGwsIG9yIGEgQm9vbGVhbiwgTnVtYmVyLA0KKyAgICAgKiAgIFN0cmluZywgSlNPTk9iamVjdCwgb3IgSlNPTkFycmF5LCBvciBhbiBvYmplY3QgdGhhdCBpbXBsZW1lbnRzIEpTT05TdHJpbmcuDQorICAgICAqIEByZXR1cm4gdGhpcw0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgdGhlIHZhbHVlIGlzIG91dCBvZiBzZXF1ZW5jZS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OV3JpdGVyIHZhbHVlKE9iamVjdCBvYmplY3QpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHJldHVybiB0aGlzLmFwcGVuZChKU09OT2JqZWN0LnZhbHVlVG9TdHJpbmcob2JqZWN0KSk7DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vTE9HSlNPTk9iamVjdC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vTE9HSlNPTk9iamVjdC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjJmMThjNTQKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9MT0dKU09OT2JqZWN0LmphdmEKQEAgLTAsMCArMSwxNjUzIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogb3JnLm9uYXAuZG1hYXANCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorICogKiANCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyAqICogDQorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywNCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLg0KKyAqICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2l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4NCisgICAgICovDQorICAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBjbGFzcyBOdWxsIHsNCisNCisgICAgICAgIC8qKg0KKyAgICAgICAgICogVGhlcmUgaXMgb25seSBpbnRlbmRlZCB0byBiZSBhIHNpbmdsZSBpbnN0YW5jZSBvZiB0aGUgTlVMTCBvYmplY3QsDQorICAgICAgICAgKiBzbyB0aGUgY2xvbmUgbWV0aG9kIHJldHVybnMgaXRzZWxmLg0KKyAgICAgICAgICogQHJldHVybiAgICAgTlVMTC4NCisgICAgICAgICAqLw0KKyAgICAgICAgcHJvdGVjdGVkIGZpbmFsIE9iamVjdCBjbG9uZSgpIHsNCisgICAgICAgICAgICByZXR1cm4gdGhpczsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qKg0KKyAgICAgICAgICogQSBOdWxsIG9iamVjdCBpcyBlcXVhbCB0byB0aGUgbnVsbCB2YWx1ZSBhbmQgdG8gaXRzZWxmLg0KKyAgICAgICAgICogQHBhcmFtIG9iamVjdCAgICBBbiBvYmplY3QgdG8gdGVzdCBmb3IgbnVsbG5lc3MuDQorICAgICAgICAgKiBAcmV0dXJuIHRydWUgaWYgdGhlIG9iamVjdCBwYXJhbWV0ZXIgaXMgdGhlIEpTT05PYmplY3QuTlVMTCBvYmplY3QNCisgICAgICAgICAqICBvciBudWxsLg0KKyAgICAgICAgICovDQorICAgICAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCB8fCBvYmplY3QgPT0gdGhpczsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qKg0KKyAgICAgICAgICogR2V0IHRoZSAibnVsbCIgc3RyaW5nIHZhbHVlLg0KKyAgICAgICAgICogQHJldHVybiBUaGUgc3RyaW5nICJudWxsIi4NCisgICAgICAgICAqLw0KKyAgICAgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsNCisgICAgICAgICAg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mdzIGlzIHVzZWQgdG8gaWRlbnRpZnkgdGhlIGtleXMgdGhhdCBzaG91bGQgYmUgY29waWVkLg0KKyAgICAgKiBNaXNzaW5nIGtleXMgYXJlIGlnbm9yZWQuDQorICAgICAqIEBwYXJhbSBqbyBBIEpTT05PYmplY3QuDQorICAgICAqIEBwYXJhbSBuYW1lcyBBbiBhcnJheSBvZiBzdHJpbmdzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICogQGV4Y2VwdGlvbiBKU09ORXhjZXB0aW9uIElmIGEgdmFsdWUgaXMgYSBub24tZmluaXRlIG51bWJlciBvciBpZiBhIG5hbWUgaXMgZHVwbGljYXRlZC4NCisgICAgICovDQorICAgIHB1YmxpYyBMT0dKU09OT2JqZWN0KExPR0pTT05PYmplY3Qgam8sIFN0cmluZ1tdIG5hbWVzKSB7DQorICAgICAgICB0aGlzKCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG5hbWVzLmxlbmd0aDsgaSArPSAxKSB7DQorICAgICAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICAgICAgdGhpcy5wdXRPbmNlKG5hbWVzW2ldLCBqby5vcHQobmFtZXNbaV0pKTsNCisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gaWdub3JlKSB7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBDb25zdHJ1Y3QgYSBKU09OT2JqZWN0IGZyb20gYSBKU09OVG9rZW5lci4NCisgICAgICogQHBhcmFtIHggQSBKU09OVG9rZW5lciBvYmplY3QgY29udGFpbmluZyB0aGUgc291cmNlIHN0cmluZy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIElmIHRoZXJlIGlzIGEgc3ludGF4IGVycm9yIGluIHRoZSBzb3VyY2Ugc3RyaW5nDQorICAgICAqICBvciBhIGR1cGxpY2F0ZWQga2V5Lg0KKyAgICAgKi8NCisgICAgcHVibGljIExPR0pTT05PYmplY3QoSlNPTlRva2VuZXIgeCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGhpcygpOw0KKyAgICAgICAgY2hhciBjOw0KKyAgICAgICAgU3RyaW5nIGtleTsNCisNCisgICAgICAgIGlmICh4Lm5leHRDbGVhbigpICE9ICd7Jykgew0KKyAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkEgSlNPTk9iamVjdCB0ZXh0IG11c3QgYmVnaW4gd2l0aCAneyciKTsNCisgICAgICAgIH0NCisgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICBjID0geC5uZXh0Q2xlYW4oKTsNCisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlIDA6DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkEgSlNPTk9iamVjdCB0ZXh0IG11c3QgZW5kIHdpdGggJ30nIik7DQorICAgICAgICAgICAgY2FzZSAnfSc6DQorICAgICAgICAgICAgICAgIHJldHVybjsNCisgICAgICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgICAgICB4LmJhY2soKTsNCisgICAgICAgICAgICAgICAga2V5ID0geC5uZXh0VmFsdWUoKS50b1N0cmluZygpOw0KKyAgICAgICAgICAgIH0NCisNCisvLyBUaGUga2V5IGlzIGZvbGxvd2VkIGJ5ICc6Jy4gV2Ugd2lsbCBhbHNvIHRvbGVyYXRlICc9JyBvciAnPT4nLg0KKw0KKyAgICAgICAgICAgIGMgPSB4Lm5leHRDbGVhbigpOw0KKyAgICAgICAgICAgIGlmIChjID09ICc9Jykgew0KKyAgICAgICAgICAgICAgICBpZiAoeC5uZXh0KCkgIT0gJz4nKSB7DQorICAgICAgICAgICAgICAgICAgICB4LmJhY2soKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoYyAhPSAnOicpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiRXhwZWN0ZWQgYSAnOicgYWZ0ZXIgYSBrZXkiKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhpcy5wdXRPbmNlKGtleSwgeC5uZXh0VmFsdWUoKSk7DQorDQorLy8gUGFpcnMgYXJlIHNlcGFyYXRlZCBieSAnLCcuIFdlIHdpbGwgYWxzbyB0b2xlcmF0ZSAnOycuDQorDQorICAgICAgICAgICAgc3dpdGNoICh4Lm5leHRDbGVhbigpKSB7DQorICAgICAgICAgICAgY2FzZSAnOyc6DQorICAgICAgICAgICAgY2FzZSAnLCc6DQorICAgICAgICAgICAgICAgIGlmICh4Lm5leHRDbGVhbigpID09ICd9Jykgew0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIHguYmFjaygpOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICBjYXNlICd9JzoNCisgICAgICAgICAgICAgICAgcmV0dXJuOw0KKyAgICAgICAgICAgIGRlZmF1bHQ6DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIkV4cGVjdGVkIGEgJywnIG9yICd9JyIpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQ29uc3RydWN0IGEgSlNPTk9iamVjdCBmcm9tIGEgTWFwLg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0gbWFwIEEgbWFwIG9iamVjdCB0aGF0IGNhbiBiZSB1c2VkIHRvIGluaXRpYWxpemUgdGhlIGNvbnRlbnRzIG9mDQorICAgICAqICB0aGUgSlNPTk9iamVjdC4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgTE9HSlNPTk9iamVjdChNYXA8U3RyaW5nLE9iamVjdD4gbWFwKSB7DQorICAgICAgICB0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LnNwbGl0KCJcXC4iKTsNCisgICAgICAgICAgICAgICAgaW50IGxhc3QgPSBwYXRoLmxlbmd0aCAtIDE7DQorICAgICAgICAgICAgICAgIExPR0pTT05PYmplY3QgdGFyZ2V0ID0gdGhpczsNCisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsYXN0OyBpICs9IDEpIHsNCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzZWdtZW50ID0gcGF0aFtpXTsNCisgICAgICAgICAgICAgICAgICAgIExPR0pTT05PYmplY3QgbmV4dFRhcmdldCA9IHRhcmdldC5vcHRKU09OT2JqZWN0KHNlZ21lbnQpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRUYXJnZXQgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRUYXJnZXQgPSBuZXcgTE9HSlNPTk9iamVjdCgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldC5wdXQoc2VnbWVudCwgbmV4dFRhcmdldCk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB0YXJnZXQgPSBuZXh0VGFyZ2V0Ow0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIHRhcmdldC5wdXQocGF0aFtsYXN0XSwgYnVuZGxlLmdldFN0cmluZygoU3RyaW5nKWtleSkpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogQWNjdW11bGF0ZSB2YWx1ZXMgdW5kZXIgYSBrZXkuIEl0IGlzIHNpbWlsYXIgdG8gdGhlIHB1dCBtZXRob2QgZXhjZXB0DQorICAgICAqIHRoYXQgaWYgdGhlcmUgaXMgYWxyZWFkeSBhbiBvYmplY3Qgc3RvcmVkIHVuZGVyIHRoZSBrZXkgdGhlbiBhDQorICAgICAqIEpTT05BcnJheSBpcyBzdG9yZWQgdW5kZXIgdGhlIGtleS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DQorICAgICAqIEByZXR1cm4gdGhpcy4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIElmIHRoZSBrZXkgaXMgbnVsbCBvciBpZiB0aGUgY3VycmVudCB2YWx1ZQ0KKyAgICAgKiAgYXNzb2NpYXRlZCB3aXRoIHRoZSBrZXkgaXMgbm90IGEgSlNPTkFycmF5Lg0KKyAgICAgKi8NCisgICAgcHVibGljIExPR0pTT05PYmplY3QgYXBwZW5kKFN0cmluZyBrZXksIE9iamVjdCB2YWx1ZSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgdGVzdFZhbGlkaXR5KHZhbHVlKTsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLm9wdChrZXkpOw0KKyAgICAgICAgaWYgKG9iamVjdCA9PSBudWxsKSB7DQorICAgICAgICAgICAgdGhpcy5wdXQoa2V5LCBuZXcgSlNPTkFycmF5KCkucHV0KHZhbHVlKSk7DQorICAgICAgICB9IGVsc2UgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05BcnJheSkgew0KKyAgICAgICAgICAgIHRoaXMucHV0KGtleSwgKChKU09OQXJyYXkpb2JqZWN0KS5wdXQodmFsdWUpKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIGtleSArDQorICAgICAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBKU09OQXJyYXkuIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gdGhpczsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIHN0cmluZyBmcm9tIGEgZG91YmxlLiBUaGUgc3RyaW5nICJudWxsIiB3aWxsIGJlIHJldHVybmVkIGlmDQorICAgICAqIHRoZSBudW1iZXIgaXMgbm90IGZpbml0ZS4NCisgICAgICogQHBhcmFtICBkIEEgZG91YmxlLg0KKyAgICAgKiBAcmV0dXJuIEEgU3RyaW5nLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZG91YmxlVG9TdHJpbmcoZG91YmxlIGQpIHsNCisgICAgICAgIGlmIChEb3VibGUuaXNJbmZpbml0ZShkKSB8fCBEb3VibGUuaXNOYU4oZCkpIHsNCisgICAgICAgICAgICByZXR1cm4gIm51bGwiOw0KKyAgICAgICAgfQ0KKw0KKy8vIFNoYXZlIG9mZiB0cmFpbGluZyB6ZXJvcyBhbmQgZGVjaW1hbCBwb2ludCwgaWYgcG9zc2libGUuDQorDQorICAgICAgICBTdHJpbmcgc3RyaW5nID0gRG91YmxlLnRvU3RyaW5nKGQpOw0KKyAgICAgICAgaWYgKHN0cmluZy5pbmRleE9mKCcuJykgPiAwICYmIHN0cmluZy5pbmRleE9mKCdlJykgPCAwICYmDQorICAgICAgICAgICAgICAgIHN0cmluZy5pbmRleE9mKCdFJykgPCAwKSB7DQorICAgICAgICAgICAgd2hpbGUgKHN0cmluZy5lbmRzV2l0aCgiMCIpKSB7DQorICAgICAgICAgICAgICAgIHN0cmluZyA9IHN0cmluZy5zdWJzdHJpbmcoMCwgc3RyaW5nLmxlbmd0aCgpIC0gMSk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlmIChzdHJpbmcuZW5kc1dpdGgoIi4iKSkgew0KKyAgICAgICAgICAgICAgICBzdHJpbmcgPSBzdHJpbmcuc3Vic3RyaW5nKDAsIHN0cmluZy5sZW5ndGgoKSAtIDEpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgdmFsdWUgb2JqZWN0IGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBvYmplY3QgYXNzb2NpYXRlZCB3aXRoIHRoZSBrZXkuDQorICAgICAqIEB0aHJvd3MgICAgICBKU09ORXhjZXB0aW9uIGlmIHRoZSBrZXkgaXMgbm90IGZvdW5kLg0KKyAgICAgKi8NCisgICAgcHVibGljIE9iamVjdCBnZXQoU3RyaW5nIGtleSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKGtleSA9PSBudWxsKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIk51bGwga2V5LiIpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMub3B0KGtleSk7DQorICAgICAgICBpZiAob2JqZWN0ID09IG51bGwpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiSlNPTk9iamVjdFsiICsgcXVvdGUoa2V5KSArDQorICAgICAgICAgICAgICAgICAgICAiXSBub3QgZm91bmQuIik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gb2JqZWN0Ow0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGJvb2xlYW4gdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGEga2V5Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0ga2V5ICAgQSBrZXkgc3RyaW5nLg0KKyAgICAgKiBAcmV0dXJuICAgICAgVGhlIHRydXRoLg0KKyAgICAgKiBAdGhyb3dzICAgICAgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKiAgaWYgdGhlIHZhbHVlIGlzIG5vdCBhIEJvb2xlYW4gb3IgdGhlIFN0cmluZyAidHJ1ZSIgb3IgImZhbHNlIi4NCisgICAgICovDQorICAgIHB1YmxpYyBib29sZWFuIGdldEJvb2xlYW4oU3RyaW5nIGtleSkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgT2JqZWN0IG9iamVjdCA9IHRoaXMuZ2V0KGtleSk7DQorICAgICAgICBpZiAob2JqZWN0LmVxdWFscyhCb29sZWFuLkZBTFNFKSB8fA0KKyAgICAgICAgICAgICAgICAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nICYmDQorICAgICAgICAgICAgICAgICgoU3RyaW5nKW9iamVjdCkuZXF1YWxzSWdub3JlQ2FzZSgiZmFsc2UiKSkpIHsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9IGVsc2UgaWYgKG9iamVjdC5lcXVhbHMoQm9vbGVhbi5UUlVFKSB8fA0KKyAgICAgICAgICAgICAgICAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nICYmDQorICAgICAgICAgICAgICAgICgoU3RyaW5nKW9iamVjdCkuZXF1YWxzSWdub3JlQ2FzZSgidHJ1ZSIpKSkgew0KKyAgICAgICAgICAgIHJldHVybiB0cnVlOw0KKyAgICAgICAgfQ0KKyAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIHF1b3RlKGtleSkgKw0KKyAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBCb29sZWFuLiIpOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIGRvdWJsZSB2YWx1ZSBhc3NvY2lhdGVkIHdpdGggYSBrZXkuDQorICAgICAqIEBwYXJhbSBrZXkgICBBIGtleSBzdHJpbmcuDQorICAgICAqIEByZXR1cm4gICAgICBUaGUgbnVtZXJpYyB2YWx1ZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIGlmIHRoZSBrZXkgaXMgbm90IGZvdW5kIG9yDQorICAgICAqICBpZiB0aGUgdmFsdWUgaXMgbm90IGEgTnVtYmVyIG9iamVjdCBhbmQgY2Fubm90IGJlIGNvbnZlcnRlZCB0byBhIG51bWJlci4NCisgICAgICovDQorICAgIHB1YmxpYyBkb3VibGUgZ2V0RG91YmxlKFN0cmluZyBrZXkpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChrZXkpOw0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gb2JqZWN0IGluc3RhbmNlb2YgTnVtYmVyDQorICAgICAgICAgICAgICAgID8gKChOdW1iZXIpb2JqZWN0KS5kb3VibGVWYWx1ZSgpDQorICAgICAgICAgICAgICAgIDogRG91YmxlLnBhcnNlRG91YmxlKChTdHJpbmcpb2JqZWN0KTsNCisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkpTT05PYmplY3RbIiArIHF1b3RlKGtleSkgKw0KKyAgICAgICAgICAgICAgICAiXSBpcyBub3QgYSBudW1iZXIuIik7DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIEdldCB0aGUgaW50IHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBpbnRlZ2VyIHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzICAgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvciBpZiB0aGUgdmFsdWUgY2Fubm90DQorICAgICAqICBiZSBjb252ZXJ0ZWQgdG8gYW4gaW50ZWdlci4NCisgICAgICovDQorICAgIHB1YmxpYyBpbnQgZ2V0SW50KFN0cmluZyBrZXkpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChrZXkpOw0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gb2JqZWN0IGluc3RhbmNlb2YgTnVtYmVyDQorICAgICAgICAgICAgICAgID8gKChOdW1iZXIpb2JqZWN0KS5pbnRWYWx1ZSgpDQorICAgICAgICAgICAgICAgIDogSW50ZWdlci5wYXJzZUludCgoU3RyaW5nKW9iamVjdCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGFuIGludC4iKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBKU09OQXJyYXkgdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGEga2V5Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0ga2V5ICAgQSBrZXkgc3RyaW5nLg0KKyAgICAgKiBAcmV0dXJuICAgICAgQSBKU09OQXJyYXkgd2hpY2ggaXMgdGhlIHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzICAgICAgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvcg0KKyAgICAgKiAgaWYgdGhlIHZhbHVlIGlzIG5vdCBhIEpTT05BcnJheS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgZ2V0SlNPTkFycmF5KFN0cmluZyBrZXkpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIE9iamVjdCBvYmplY3QgPSB0aGlzLmdldChrZXkpOw0KKyAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05BcnJheSkgew0KKyAgICAgICAgICAgIHJldHVybiAoSlNPTkFycmF5KW9iamVjdDsNCisgICAgICAgIH0NCisgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGEgSlNPTkFycmF5LiIpOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIEpTT05PYmplY3QgdmFsdWUgYXNzb2NpYXRlZCB3aXRoIGEga2V5Lg0KKyAgICAgKg0KKyAgICAgKiBAcGFyYW0ga2V5ICAgQSBrZXkgc3RyaW5nLg0KKyAgICAgKiBAcmV0dXJuICAgICAgQSBKU09OT2JqZWN0IHdoaWNoIGlzIHRoZSB2YWx1ZS4NCisgICAgICogQHRocm93cyAgICAgIEpTT05FeGNlcHRpb24gaWYgdGhlIGtleSBpcyBub3QgZm91bmQgb3INCisgICAgICogIGlmIHRoZSB2YWx1ZSBpcyBub3QgYSBKU09OT2JqZWN0Lg0KKyAgICAgKi8NCisgICAgcHVibGljIExPR0pTT05PYmplY3QgZ2V0SlNPTk9iamVjdChTdHJpbmcga2V5KSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gdGhpcy5nZXQoa2V5KTsNCisgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBMT0dKU09OT2JqZWN0KSB7DQorICAgICAgICAgICAgcmV0dXJuIChMT0dKU09OT2JqZWN0KW9iamVjdDsNCisgICAgICAgIH0NCisgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGEgSlNPTk9iamVjdC4iKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSBsb25nIHZhbHVlIGFzc29jaWF0ZWQgd2l0aCBhIGtleS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIFRoZSBsb25nIHZhbHVlLg0KKyAgICAgKiBAdGhyb3dzICAgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V5IGlzIG5vdCBmb3VuZCBvciBpZiB0aGUgdmFsdWUgY2Fubm90DQorICAgICAqICBiZSBjb252ZXJ0ZWQgdG8gYSBsb25nLg0KKyAgICAgKi8NCisgICAgcHVibGljIGxvbmcgZ2V0TG9uZyhTdHJpbmcga2V5KSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gdGhpcy5nZXQoa2V5KTsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgcmV0dXJuIG9iamVjdCBpbnN0YW5jZW9mIE51bWJlcg0KKyAgICAgICAgICAgICAgICA/ICgoTnVtYmVyKW9iamVjdCkubG9uZ1ZhbHVlKCkNCisgICAgICAgICAgICAgICAgOiBMb25nLnBhcnNlTG9uZygoU3RyaW5nKW9iamVjdCk7DQorICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgew0KKyAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCJKU09OT2JqZWN0WyIgKyBxdW90ZShrZXkpICsNCisgICAgICAgICAgICAgICAgIl0gaXMgbm90IGEgbG9uZy4iKTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IGFuIGFycmF5IG9mIGZpZWxkIG5hbWVzIGZyb20gYSBKU09OT2JqZWN0Lg0KKyAgICAgKg0KKyAgICAgKiBAcmV0dXJuIEFuIGFycmF5IG9mIGZpZWxkIG5hbWVzLCBvciBudWxsIGlmIHRoZXJlIGFyZSBubyBuYW1lcy4NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nW10gZ2V0TmFtZXMoTE9HSlNPTk9iamVjdCBqbykgew0KKyAgICAgICAgaW50IGxlbmd0aCA9IGpvLmxlbmd0aCgpOw0KKyAgICAgICAgaWYgKGxlbmd0aCA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGl0ZXJhdG9yID0gam8ua2V5cygpOw0KKyAgICAgICAgU3RyaW5nW10gbmFtZXMgPSBuZXcgU3RyaW5nW2xlbmd0aF07DQorICAgICAgICBpbnQgaSA9IDA7DQorICAgICAgICB3aGlsZSAoaXRlcmF0b3IuaGFzTmV4dCgpKSB7DQorICAgICAgICAgICAgbmFtZXNbaV0gPSBpdGVyYXRvci5uZXh0KCk7DQorICAgICAgICAgICAgaSArPSAxOw0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIG5hbWVzOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgYW4gYXJyYXkgb2YgZmllbGQgbmFtZXMgZnJvbSBhbiBPYmplY3QuDQorICAgICAqDQorICAgICAqIEByZXR1cm4gQW4gYXJyYXkgb2YgZmllbGQgbmFtZXMsIG9yIG51bGwgaWYgdGhlcmUgYXJlIG5vIG5hbWVzLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmdbXSBnZXROYW1lcyhPYmplY3Qgb2JqZWN0KSB7DQorICAgICAgICBpZiAob2JqZWN0ID09IG51bGwpIHsNCisgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgIH0NCisgICAgICAgIENsYXNzPD8gZXh0ZW5kcyBPYmplY3Q+IGtsYXNzID0gb2JqZWN0LmdldENsYXNzKCk7DQorICAgICAgICBGaWVsZFtdIGZpZWxkcyA9IGtsYXNzLmdldEZpZWxkcygpOw0KKyAgICAgICAgaW50IGxlbmd0aCA9IGZpZWxkcy5sZW5ndGg7DQorICAgICAgICBpZiAobGVuZ3RoID09IDApIHsNCisgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgIH0NCisgICAgICAgIFN0cmluZ1tdIG5hbWVzID0gbmV3IFN0cmluZ1tsZW5ndGhdOw0KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgIG5hbWVzW2ldID0gZmllbGRzW2ldLmdldE5hbWUoKTsNCisgICAgICAgIH0NCis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Mgb2YgdGhlIEpTT05PYmplY3QuDQorICAgICAqDQorICAgICAqIEByZXR1cm4gQW4gaXRlcmF0b3Igb2YgdGhlIGtleXMuDQorICAgICAqLw0KKyAgICBwdWJsaWMgSXRlcmF0b3I8U3RyaW5nPiBrZXlzKCkgew0KKyAgICAgICAgcmV0dXJuIHRoaXMua2V5U2V0KCkuaXRlcmF0b3IoKTsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IGEgc2V0IG9mIGtleXMgb2YgdGhlIEpTT05PYmplY3QuDQorICAgICAqDQorICAgICAqIEByZXR1cm4gQSBrZXlTZXQuDQorICAgICAqLw0KKyAgICBwdWJsaWMgU2V0PFN0cmluZz4ga2V5U2V0KCkgew0KKyAgICAgICAgcmV0dXJuIHRoaXMubWFwLmtleVNldCgpOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIG51bWJlciBvZiBrZXlzIHN0b3JlZCBpbiB0aGUgSlNPTk9iamVjdC4NCisgICAgICoNCisgICAgICogQHJldHVybiBUaGUgbnVtYmVyIG9mIGtleXMgaW4gdGhlIEpTT05PYmplY3QuDQorICAgICAqLw0KKyAgICBwdWJsaWMgaW50IGxlbmd0aCgpIHsNCisgICAgICAgIHJldHVybiB0aGlzLm1hcC5zaXplKCk7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFByb2R1Y2UgYSBKU09OQXJyYXkgY29udGFpbmluZyB0aGUgbmFtZXMgb2YgdGhlIGVsZW1lbnRzIG9mIHRoaXMNCisgICAgICogSlNPTk9iamVjdC4NCisgICAgICogQHJldHVybiBBIEpTT05BcnJheSBjb250YWluaW5nIHRoZSBrZXkgc3RyaW5ncywgb3IgbnVsbCBpZiB0aGUgSlNPTk9iamVjdA0KKyAgICAgKiBpcyBlbXB0eS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgbmFtZXMoKSB7DQorICAgICAgICBKU09OQXJyYXkgamEgPSBuZXcgSlNPTkFycmF5KCk7DQorICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXMgPSB0aGlzLmtleXMoKTsNCisgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgIGphLnB1dChrZXlzLm5leHQoKSk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gamEubGVuZ3RoKCkgPT0gMCA/IG51bGwgOiBqYTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUHJvZHVjZSBhIHN0cmluZyBmcm9tIGEgTnVtYmVyLg0KKyAgICAgKiBAcGFyYW0gIG51bWJlciBBIE51bWJlcg0KKyAgICAgKiBAcmV0dXJuIEEgU3RyaW5nLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgbiBpcyBhIG5vbi1maW5pdGUgbnVtYmVyLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgbnVtYmVyVG9TdHJpbmcoTnVtYmVyIG51bWJlcikNCisgICAgICAgICAgICB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAobnVtYmVyID09IG51bGwpIHsNCisgICAgICAgICAgICB0aHJvdyBuZXcgSlNPTkV4Y2VwdGlvbigiTnVsbCBwb2ludGVyIik7DQorICAgICAgICB9DQorICAgICAgICB0ZXN0VmFsaWRpdHkobnVtYmVyKTsNCisNCisvLyBTaGF2ZSBvZmYgdHJhaWxpbmcgemVyb3MgYW5kIGRlY2ltYWwgcG9pbnQsIGlmIHBvc3NpYmxlLg0KKw0KKyAgICAgICAgU3RyaW5nIHN0cmluZyA9IG51bWJlci50b1N0cmluZygpOw0KKyAgICAgICAgaWYgKHN0cmluZy5pbmRleE9mKCcuJykgPiAwICYmIHN0cmluZy5pbmRleE9mKCdlJykgPCAwICYmDQorICAgICAgICAgICAgICAgIHN0cmluZy5pbmRleE9mKCdFJykgPCAwKSB7DQorICAgICAgICAgICAgd2hpbGUgK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luZy4NCisgICAgICogQHBhcmFtIGRlZmF1bHRWYWx1ZSAgICAgVGhlIGRlZmF1bHQuDQorICAgICAqIEByZXR1cm4gICAgICBBbiBvYmplY3Qgd2hpY2ggaXMgdGhlIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIGludCBvcHRJbnQoU3RyaW5nIGtleSwgaW50IGRlZmF1bHRWYWx1ZSkgew0KKyAgICAgICAgdHJ5IHsNCisgICAgICAgICAgICByZXR1cm4gdGhpcy5nZXRJbnQoa2V5KTsNCisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRWYWx1ZTsNCisgICAgICAgIH0NCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IGFuIG9wdGlvbmFsIEpTT05BcnJheSBhc3NvY2lhdGVkIHdpdGggYSBrZXkuDQorICAgICAqIEl0IHJldHVybnMgbnVsbCBpZiB0aGVyZSBpcyBubyBzdWNoIGtleSwgb3IgaWYgaXRzIHZhbHVlIGlzIG5vdCBhDQorICAgICAqIEpTT05BcnJheS4NCisgICAgICoNCisgICAgICogQHBhcmFtIGtleSAgIEEga2V5IHN0cmluZy4NCisgICAgICogQHJldHVybiAgICAgIEEgSlNPTkFycmF5IHdoaWNoIGlzIHRoZSB2YWx1ZS4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgb3B0SlNPTkFycmF5KFN0cmluZyBrZXkpIHsNCisgICAgICAgIE9iamVjdCBvID0gdGhpcy5vcHQoa2V5KTsNCisgICAgICAgIHJldHVybiBvIGluc3RhbmNlb2YgSlNPTkFycmF5ID8gKEpTT05BcnJheSlvIDogbnVsbDsNCisgICAgfQ0KKw0KKw0KKyAgICAvKioNCisgICAgICogR2V0IGFuIG9wdGlvbmFsIEpTT05PYmplY3QgYXNzb2NpYXRlZCB3aXRoIGEga2V5Lg0KKyAgICAgKiBJdCByZXR1cm5zIG51bGwgaWYg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sc2UuDQorDQorICAgICAgICBib29sZWFuIGluY2x1ZGVTdXBlckNsYXNzID0ga2xhc3MuZ2V0Q2xhc3NMb2FkZXIoKSAhPSBudWxsOw0KKw0KKyAgICAgICAgTWV0aG9kW10gbWV0aG9kcyA9IGluY2x1ZGVTdXBlckNsYXNzDQorICAgICAgICAgICAgICAgID8ga2xhc3MuZ2V0TWV0aG9kcygpDQorICAgICAgICAgICAgICAgIDoga2xhc3MuZ2V0RGVjbGFyZWRNZXRob2RzKCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1ldGhvZHMubGVuZ3RoOyBpICs9IDEpIHsNCisgICAgICAgICAgICB0cnkgew0KKyAgICAgICAgICAgICAgICBNZXRob2QgbWV0aG9kID0gbWV0aG9kc1tpXTsNCisgICAgICAgICAgICAgICAgaWYgKE1vZGlmaWVyLmlzUHVibGljKG1ldGhvZC5nZXRNb2RpZmllcnMoKSkpIHsNCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lID0gbWV0aG9kLmdldE5hbWUoKTsNCisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBrZXkgPSAiIjsNCisgICAgICAgICAgICAgICAgICAgIGlmIChuYW1lLnN0YXJ0c1dpdGgoImdldCIpKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCJnZXRDbGFzcyIuZXF1YWxzKG5hbWUpIHx8DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZ2V0RGVjbGFyaW5nQ2xhc3MiLmVxdWFscyhuYW1lKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSAiIjsNCisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBuYW1lLnN1YnN0cmluZygzKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG5hbWUuc3RhcnRzV2l0aCgiaXMiKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IG5hbWUuc3Vic3RyaW5nKDIpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5sZW5ndGgoKSA+IDAgJiYNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2hhcmFjdGVyLmlzVXBwZXJDYXNlKGtleS5jaGFyQXQoMCkpICYmDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5nZXRQYXJhbWV0ZXJUeXBlcygpLmxlbmd0aCA9PSAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleS5sZW5ndGgoKSA9PSAxKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9IGtleS50b0xvd2VyQ2FzZSgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIUNoYXJhY3Rlci5pc1VwcGVyQ2FzZShrZXkuY2hhckF0KDEpKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXkgPSBrZXkuc3Vic3RyaW5nKDAsIDEpLnRvTG93ZXJDYXNlKCkgKw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5LnN1YnN0cmluZygxKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorDQorICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0IHJlc3VsdCA9IG1ldGhvZC5pbnZva2UoYmVhbiwgKE9iamVjdFtdKW51bGwpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcC5wdXQoa2V5LCB3cmFwKHJlc3VsdCkpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgIC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Iik7DQorICAgICAgICB9DQorICAgICAgICBpZiAodmFsdWUgIT0gbnVsbCkgew0KKyAgICAgICAgICAgIHRlc3RWYWxpZGl0eSh2YWx1ZSk7DQorICAgICAgICAgICAgcG9vbGVkID0gKFN0cmluZylrZXlQb29sLmdldChrZXkpOw0KKyAgICAgICAgICAgIGlmIChwb29sZWQgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICBpZiAoa2V5UG9vbC5zaXplKCkgPj0ga2V5UG9vbFNpemUpIHsNCisgICAgICAgICAgICAgICAgICAgIGtleVBvb2wgPSBuZXcgTGlua2VkSGFzaE1hcDxTdHJpbmcsIE9iamVjdD4oa2V5UG9vbFNpemUpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGtleVBvb2wucHV0KGtleSwga2V5KTsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBrZXkgPSBwb29sZWQ7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIHRoaXMubWFwLnB1dChrZXksIHZhbHVlKTsNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGhpcy5yZW1vdmUoa2V5KTsNCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiB0aGlzOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBQdXQgYSBrZXkvdmFsdWUgcGFpciBpbiB0aGUgSlNPTk9iamVjdCwgYnV0IG9ubHkgaWYgdGhlIGtleSBhbmQgdGhlDQorICAgICAqIHZhbHVlIGFyZSBib3RoIG5vbi1udWxsLCBhbmQgb25seSBpZiB0aGVyZSBpcyBub3QgYWxyZWFkeSBhIG1lbWJlcg0KKyAgICAgKiB3aXRoIHRoYXQgbmFtZS4NCisgICAgICogQHBhcmFtIGtleQ0KKyAgICAgKiBAcGFyYW0gdmFsdWUNCisgICAgICogQHJldHVybiBoaXMuDQorICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbiBpZiB0aGUga2V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ICAgICByZXR1cm4gcXVvdGUoc3RyaW5nLCBzdykudG9TdHJpbmcoKTsNCisgICAgICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpZ25vcmVkKSB7DQorICAgICAgICAgICAgICAgIC8vIHdpbGwgbmV2ZXIgaGFwcGVuIC0gd2UgYXJlIHdyaXRpbmcgdG8gYSBzdHJpbmcgd3JpdGVyDQorICAgICAgICAgICAgICAgIHJldHVybiAiIjsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisgICAgcHVibGljIHN0YXRpYyBXcml0ZXIgcXVvdGUoU3RyaW5nIHN0cmluZywgV3JpdGVyIHcpIHRocm93cyBJT0V4Y2VwdGlvbiB7DQorICAgICAgICBpZiAoc3RyaW5nID09IG51bGwgfHwgc3RyaW5nLmxlbmd0aCgpID09IDApIHsNCisgICAgICAgICAgICB3LndyaXRlKCJcIlwiIik7DQorICAgICAgICAgICAgcmV0dXJuIHc7DQorICAgICAgICB9DQorDQorICAgICAgICBjaGFyIGI7DQorICAgICAgICBjaGFyIGMgPSAwOw0KKyAgICAgICAgU3RyaW5nIGhoaGg7DQorICAgICAgICBpbnQgaTsNCisgICAgICAgIGludCBsZW4gPSBzdHJpbmcubGVuZ3RoKCk7DQorDQorICAgICAgICB3LndyaXRlKCciJyk7DQorICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpICs9IDEpIHsNCisgICAgICAgICAgICBiID0gYzsNCisgICAgICAgICAgICBjID0gc3RyaW5nLmNoYXJBdChpKTsNCisgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICBjYXNlICdcXCc6DQorICAgICAgICAgICAgY2FzZSAnIic6DQorICAgICAgICAgICAgICAgIHcud3JpdGUoJ1xcJyk7DQorICAgICAgICAgICAgICAgIHcud3JpdGUoYyk7DQorICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgIGNhc2UgJy8nOg0KKyAgICAgICAgICAgICAgICBpZiAoYiA9PSAnPCcpIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoJ1xcJyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgdy53cml0ZShjKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXGInOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXGIiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXHQnOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXHQiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXG4nOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXG4iKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXGYnOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXGYiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXHInOg0KKyAgICAgICAgICAgICAgICB3LndyaXRlKCJcXHIiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgZGVmYXVsdDoNCisgICAgICAgICAgICAgICAgaWYgKGMgPCAnICcgfHwgKGMgPj0gJ1x1MDA4MCcgJiYgYyA8ICdcdTAwYTAnKQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHx8IChjID49ICdcdTIwMDAnICYmIGMgPCAnXHUyMTAwJykpIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoIlxcdSIpOw0KKyAgICAgICAgICAgICAgICAgICAgaGhoaCA9IEludGVnZXIudG9IZXhTdHJpbmcoYyk7DQorICAgICAgICAgICAgICAgICAgICB3LndyaXRlKCIwMDAwIiwgMCwgNCAtIGhoaGgubGVuZ3RoKCkpOw0KKyAgICAgICAgICAgICAgICAgICAgdy53cml0ZShoaGhoKTsNCisgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgIHcud3JpdGUoYyk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgICAgICB3LndyaXRlKCciJyk7DQorICAgICAgICByZXR1cm4gdzsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogUmVtb3ZlIGEgbmFtZSBhbmQgaXRzIHZhbHVlLCBpZiBwcmVzZW50Lg0KKyAgICAgKiBAcGFyYW0ga2V5IFRoZSBuYW1lIHRvIGJlIHJlbW92ZWQuDQorICAgICAqIEByZXR1cm4gVGhlIHZhbHVlIHRoYXQgd2FzIGFzc29jaWF0ZWQgd2l0aCB0aGUgbmFtZSwNCisgICAgICogb3IgbnVsbCBpZiB0aGVyZSB3YXMgbm8gdmFsdWUuDQorICAgICAqLw0KKyAgICBwdWJsaWMgT2JqZWN0IHJlbW92ZShTdHJpbmcga2V5KSB7DQorICAgICAgICByZXR1cm4gdGhpcy5tYXAucmVtb3ZlKGtleSk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFRyeSB0byBjb252ZXJ0IGEgc3RyaW5nIGludG8gYSBudW1iZXIsIGJvb2xlYW4sIG9yIG51bGwuIElmIHRoZSBzdHJpbmcNCisgICAgICogY2FuJ3QgYmUgY29udmVydGVkLCByZXR1cm4gdGhlIHN0cmluZy4NCisgICAgICogQHBhcmFtIHN0cmluZyBBIFN0cmluZy4NCisgICAgICogQHJldHVybiBBIHNpbXBsZSBKU09OIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBPYmplY3Qgc3RyaW5nVG9WYWx1ZShTdHJpbmcgc3RyaW5nKSB7DQorICAgICAgICBEb3VibGUgZDsNCisgICAgICAgIGlmIChzdHJpbmcuZXF1YWxzKCIiKSkgew0KKyAgICAgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgICAgICB9DQorICAgICAgICBpZiAoc3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoInRydWUiKSkgew0KKyAgICAgICAgICAgIHJldHVybiBCb29sZWFuLlRSVUU7DQorICAgICAgICB9DQorICAgICAgICBpZiAoc3RyaW5nLmVxdWFsc0lnbm9yZUNhc2UoImZhbHNlIikpIHsNCisgICAgICAgICAgICByZXR1cm4gQm9vbGVhbi5GQUxTRTsNCisgICAgICAgIH0NCisgICAgICAgIGlmIChzdHJpbmcuZXF1YWxzSWdub3JlQ2FzZSgibnVsbCIpKSB7DQorICAgICAgICAgICAgcmV0dXJuIExPR0pTT05PYmplY3QuTlVMTDsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qDQorICAgICAgICAgKiBJZiBpdCBtaWdodCBiZSBhIG51bWJlciwgdHJ5IGNvbnZlcnRpbmcgaXQuDQorICAgICAgICAgKiBJZiBhIG51bWJlciBjYW5ub3QgYmUgcHJvZHVjZWQsIHRoZW4gdGhlIHZhbHVlIHdpbGwganVzdA0KKyAgICAgICAgICogYmUgYSBzdHJpbmcuIE5vdGUgdGhhdCB0aGUgcGx1cyBhbmQgaW1wbGllZCBzdHJpbmcNCisgICAgICAgICAqIGNvbnZlbnRpb25zIGFyZSBub24tc3RhbmRhcmQuIEEgSlNPTiBwYXJzZXIgbWF5IGFjY2VwdA0KKyAgICAgICAgICogbm9uLUpTT04gZm9ybXMgYXMgbG9uZyBhcyBpdCBhY2NlcHRzIGFsbCBjb3JyZWN0IEpTT04gZm9ybXMuDQorICAgICAgICAgKi8NCisNCisgICAgICAgIGNoYXIgYiA9IHN0cmluZy5jaGFyQXQoMCk7DQorICAgICAgICBpZiAoKGIgPj0gJzAnICYmIGIgPD0gJzknKSB8fCBiID09ICcuJyB8fCBiID09ICctJyB8fCBiID09ICcrJykgew0KKyAgICAgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgICAgIGlmIChzdHJpbmcuaW5kZXhPZignLicpID4gLTEgfHwNCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcuaW5kZXhPZignZScpID4gLTEgfHwgc3RyaW5nLmluZGV4T2YoJ0UnKSA+IC0xKSB7DQorICAgICAgICAgICAgICAgICAgICBkID0gRG91YmxlLnZhbHVlT2Yoc3RyaW5nKTsNCisgICAgICAgICAgICAgICAgICAgIGlmICghZC5pc0luZmluaXRlKCkgJiYgIWQuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgTG9uZyBteUxvbmcgPSBuZXcgTG9uZyhzdHJpbmcpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG15TG9uZy5sb25nVmFsdWUoKSA9PSBteUxvbmcuaW50VmFsdWUoKSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSW50ZWdlcihteUxvbmcuaW50VmFsdWUoKSk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBteUxvbmc7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9ICBjYXRjaCAoRXhjZXB0aW9uIGlnbm9yZSkgew0KKyAgICAgICAgICAgIH0NCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFRocm93IGFuIGV4Y2VwdGlvbiBpZiB0aGUgb2JqZWN0IGlzIGEgTmFOIG9yIGluZmluaXRlIG51bWJlci4NCisgICAgICogQHBhcmFtIG8gVGhlIG9iamVjdCB0byB0ZXN0Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgbyBpcyBhIG5vbi1maW5pdGUgbnVtYmVyLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyB2b2lkIHRlc3RWYWxpZGl0eShPYmplY3QgbykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgaWYgKG8gIT0gbnVsbCkgew0KKyAgICAgICAgICAgIGlmIChvIGluc3RhbmNlb2YgRG91YmxlKSB7DQorICAgICAgICAgICAgICAgIGlmICgoKERvdWJsZSlvKS5pc0luZmluaXRlKCkgfHwgKChEb3VibGUpbykuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAgICAgIkpTT04gZG9lcyBub3QgYWxsb3cgbm9uLWZpbml0ZSBudW1iZXJzLiIpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfSBlbHNlIGlmIChvIGluc3RhbmNlb2YgRmxvYXQpIHsNCisgICAgICAgICAgICAgICAgaWYgKCgoRmxvYXQpbykuaXNJbmZpbml0ZSgpIHx8ICgoRmxvYXQpbykuaXNOYU4oKSkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAgICAgIkpTT04gZG9lcyBub3QgYWxsb3cgbm9uLWZpbml0ZSBudW1iZXJzLiIpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBQcm9kdWNlIGEgSlNPTkFycmF5IGNvbnRhaW5pbmcgdGhlIHZhbHVlcyBvZiB0aGUgbWVtYmVycyBvZiB0aGlzDQorICAgICAqIEpTT05PYmplY3QuDQorICAgICAqIEBwYXJhbSBuYW1lcyBBIEpTT05BcnJheSBjb250YWluaW5nIGEgbGlzdCBvZiBrZXkgc3RyaW5ncy4gVGhpcw0KKyAgICAgKiBkZXRlcm1pbmVzIHRoZSBzZXF1ZW5jZSBvZiB0aGUgdmFsdWVzIGluIHRoZSByZXN1bHQuDQorICAgICAqIEByZXR1cm4gQSBKU09OQXJyYXkgb2YgdmFsdWVzLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgYW55IG9mIHRoZSB2YWx1ZXMgYXJlIG5vbi1maW5pdGUgbnVtYmVycy4NCisgICAgICovDQorICAgIHB1YmxpYyBKU09OQXJyYXkgdG9KU09OQXJyYXkoSlNPTkFycmF5IG5hbWVzKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpZiAobmFtZXMgPT0gbnVsbCB8fCBuYW1lcy5sZW5ndGgoKSA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBKU09OQXJyYXkgamEgPSBuZXcgSlNPTkFycmF5KCk7DQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG5hbWVzLmxlbmd0aCgpOyBpICs9IDEpIHsNCisgICAgICAgICAgICBqYS5wdXQodGhpcy5vcHQobmFtZXMuZ2V0U3RyaW5nKGkpKSk7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gamE7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIE1ha2UgYSBKU09OIHRleHQgb2YgdGhpcyBKU09OT2JqZWN0LiBGb3IgY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UNCisgICAgICogaXMgYWRkZWQuIElmIHRoaXMgd291bGQgbm90IHJlc3VsdCBpbiBhIHN5bnRhY3RpY2FsbHkgY29ycmVjdCBKU09OIHRleHQsDQorICAgICAqIHRoZW4gbnVsbCB3aWxsIGJlIHJldHVybmVkIGluc3RlYWQuDQorICAgICAqIDxwPg0KKyAgICAgKiBXYXJuaW5nOiBUaGlzIG1ldGhvZCBhc3N1bWVzIHRoYXQgdGhlIGRhdGEgc3RydWN0dXJlIGlzIGFjeWNsaWNhbC4NCisgICAgICoNCisgICAgICogQHJldHVybiBhIHByaW50YWJsZSwgZGlzcGxheWFibGUsIHBvcnRhYmxlLCB0cmFuc21pdHRhYmxlDQorICAgICA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NCisJcHVibGljIHN0YXRpYyBTdHJpbmcgdmFsdWVUb1N0cmluZyhPYmplY3QgdmFsdWUpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsIHx8IHZhbHVlLmVxdWFscyhudWxsKSkgew0KKyAgICAgICAgICAgIHJldHVybiAibnVsbCI7DQorICAgICAgICB9DQorICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBKU09OU3RyaW5nKSB7DQorICAgICAgICAgICAgT2JqZWN0IG9iamVjdDsNCisgICAgICAgICAgICB0cnkgew0KKyAgICAgICAgICAgICAgICBvYmplY3QgPSAoKEpTT05TdHJpbmcpdmFsdWUpLnRvSlNPTlN0cmluZygpOw0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7DQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKGUpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgU3RyaW5nKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiAoU3RyaW5nKW9iamVjdDsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkJhZCB2YWx1ZSBmcm9tIHRvSlNPTlN0cmluZzogIiArIG9iamVjdCk7DQorICAgICAgICB9DQorICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBOdW1iZXIpIHsNCisgICAgICAgICAgICByZXR1cm4gbnVtYmVyVG9TdHJpbmcoKE51bWJlcikgdmFsdWUpOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgQm9vbGVhbiB8fCB2YWx1ZSBpbnN0YW5jZW9mIExPR0pTT05PYmplY3QgfHwNCisgICAgICAgICAgICAgICAgdmFsdWUgaW5zdGFuY2VvZiBKU09OQXJyYXkpIHsNCisgICAgICAgICAgIC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Gl0IGludG8gYSBzdHJpbmcuIEFuZCBpZg0KKyAgICAgICogaXQgZG9lc24ndCwgdHJ5IHRvIHdyYXAgaXQgaW4gYSBKU09OT2JqZWN0LiBJZiB0aGUgd3JhcHBpbmcgZmFpbHMsDQorICAgICAgKiB0aGVuIG51bGwgaXMgcmV0dXJuZWQuDQorICAgICAgKg0KKyAgICAgICogQHBhcmFtIG9iamVjdCBUaGUgb2JqZWN0IHRvIHdyYXANCisgICAgICAqIEByZXR1cm4gVGhlIHdyYXBwZWQgdmFsdWUNCisgICAgICAqLw0KKyAgICAgQFN1cHByZXNzV2FybmluZ3MoInVuY2hlY2tlZCIpDQorCXB1YmxpYyBzdGF0aWMgT2JqZWN0IHdyYXAoT2JqZWN0IG9iamVjdCkgew0KKyAgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7DQorICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIExPR0pTT05PYmplY3QgfHwgb2JqZWN0IGluc3RhbmNlb2YgSlNPTkFycmF5ICB8fA0KKyAgICAgICAgICAgICAgICAgICAgIE5VTEwuZXF1YWxzKG9iamVjdCkgICAgICB8fCBvYmplY3QgaW5zdGFuY2VvZiBKU09OU3RyaW5nIHx8DQorICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IGluc3RhbmNlb2YgQnl0ZSAgIHx8IG9iamVjdCBpbnN0YW5jZW9mIENoYXJhY3RlciAgfHwNCisgICAgICAgICAgICAgICAgICAgICBvYmplY3QgaW5zdGFuY2VvZiBTaG9ydCAgfHwgb2JqZWN0IGluc3RhbmNlb2YgSW50ZWdlciAgICB8fA0KKyAgICAgICAgICAgICAgICAgICAgIG9iamVjdCBpbnN0YW5jZW9mIExvbmcgICB8fCBvYmplY3QgaW5zdGFuY2VvZiBCb29sZWFuICAgIHx8DQorICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IGluc3RhbmNlb2YgRmxvYXQgIHx8IG9iamVjdCBpbnN0YW5jZW9mIERvdWJsZSAgICAgfHwNCisgICAgICAgICAgICAgICAgICAgICBvYmplY3QgaW5zdGFuY2VvZiBTdHJpbmcpIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBvYmplY3Q7DQorICAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIENvbGxlY3Rpb24pIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgSlNPTkFycmF5KChDb2xsZWN0aW9uPE9iamVjdD4pb2JqZWN0KTsNCisgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICBpZiAob2JqZWN0LmdldENsYXNzKCkuaXNBcnJheSgpKSB7DQorICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEpTT05BcnJheShvYmplY3QpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBNYXApIHsNCisgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgTE9HSlNPTk9iamVjdCgoTWFwPFN0cmluZywgT2JqZWN0PilvYmplY3QpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIFBhY2thZ2Ugb2JqZWN0UGFja2FnZSA9IG9iamVjdC5nZXRDbGFzcygpLmdldFBhY2thZ2UoKTsNCisgICAgICAgICAgICAgU3RyaW5nIG9iamVjdFBhY2thZ2VOYW1lID0gb2JqZWN0UGFja2FnZSAhPSBudWxsDQorICAgICAgICAgICAgICAgICA/IG9iamVjdFBhY2thZ2UuZ2V0TmFtZSgpDQorICAgICAgICAgICAgICAgICA6ICIiOw0KKyAgICAgICAgICAgICBpZiAoDQorICAgICAgICAgICAgICAgICBvYmplY3RQYWNrYWdlTmFtZS5zdGFydHNXaXRoKCJqYXZhLiIpIHx8DQorICAgICAgICAgICAgICAgICBvYmplY3RQYWNrYWdlTmFtZS5zdGFydHNXaXRoKCJqYXZheC4iKSB8fA0KKyAgICAgICAgICAgICAgICAgb2JqZWN0LmdldENsYXNzKCkuZ2V0Q2xhc3NMb2FkZXIoKSA9PSBudWxsDQorICAgICAgICAgICAgICkgew0KKyAgICAgICAgICAgICAgICAgcmV0dXJuIG9iamVjdC50b1N0cmluZygpOw0KKyAgICAgICAgICAgICB9DQorICAgICAgICAgICAgIHJldHVybiBuZXcgTE9HSlNPTk9iamVjdChvYmplY3QpOw0KKyAgICAgICAgIH0gY2F0Y2goRXhjZXB0aW9uIGV4Y2VwdGlvbikgew0KKyAgICAgICAgICAgICByZXR1cm4gbnVsbDsNCisgICAgICAgICB9DQorICAgICB9DQorDQorDQorICAgICAvKioNCisgICAgICAqIFdyaXRlIHRoZSBjb250ZW50cyBvZiB0aGUgSlNPTk9iamVjdCBhcyBKU09OIHRleHQgdG8gYSB3cml0ZXIuDQorICAgICAgKiBGb3IgY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UgaXMgYWRkZWQuDQorICAgICAgKiA8cD4NCisgICAgICAqIFdhcm5pbmc6IFRoaXMgbWV0aG9kIGFzc3VtZXMgdGhhdCB0aGUgZGF0YSBzdHJ1Y3R1cmUgaXMgYWN5Y2xpY2FsLg0KKyAgICAgICoNCisgICAgICAqIEByZXR1cm4gVGhlIHdyaXRlci4NCisgICAgICAqIEB0aHJvd3MgSlNPTkV4Y2VwdGlvbg0KKyAgICAgICovDQorICAgICBwdWJsaWMgV3JpdGVyIHdyaXRlKFdyaXRlciB3cml0ZXIpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHJldHVybiB0aGlzLndyaXRlKHdyaXRlciwgMCwgMCk7DQorICAgIH0NCisNCisNCisgICAgQFN1cHByZXNzV2FybmluZ3MoInVuY2hlY2tlZCIpDQorCXN0YXRpYyBmaW5hbCBXcml0ZXIgd3JpdGVWYWx1ZShXcml0ZXIgd3JpdGVyLCBPYmplY3QgdmFsdWUsDQorICAgICAgICAgICAgaW50IGluZGVudEZhY3RvciwgaW50IGluZGVudCkgdGhyb3dzIEpTT05FeGNlcHRpb24sIElPRXhjZXB0aW9uIHsNCisgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsIHx8IHZhbHVlLmVxdWFscyhudWxsKSkgew0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZSgibnVsbCIpOw0KKyAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIExPR0pTT05PYmplY3QpIHsNCisgICAgICAgICAgICAoKExPR0pTT05PYmplY3QpIHZhbHVlKS53cml0ZSh3cml0ZXIsIGluZGVudEZhY3RvciwgaW5kZW50KTsNCisgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBKU09OQXJyYXkpIHsNCisgICAgICAgICAgICAoKEpTT05BcnJheSkgdmFsdWUpLndyaXRlKHdyaXRlciwgaW5kZW50RmFjdG9yLCBpbmRlbnQpOw0KKyAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIE1hcCkgew0KKyAgICAgICAgICAgIG5ldyBMT0dKU09OT2JqZWN0KChNYXA8U3RyaW5nLCBPYmplY3Q+KSB2YWx1ZSkud3JpdGUod3JpdGVyLCBpbmRlbnRGYWN0b3IsIGluZGVudCk7DQorICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgQ29sbGVjdGlvbikgew0KKyAgICAgICAgICAgIG5ldyBKU09OQXJyYXkoKENvbGxlY3Rpb248T2JqZWN0PikgdmFsdWUpLndyaXRlKHdyaXRlciwgaW5kZW50RmFjdG9yLA0KKyAgICAgICAgICAgICAgICAgICAgaW5kZW50KTsNCisgICAgICAgIH0gZWxzZSBpZiAodmFsdWUuZ2V0Q2xhc3MoKS5pc0FycmF5KCkpIHsNCisgICAgICAgICAgICBuZXcgSlNPTkFycmF5KHZhbHVlKS53cml0ZSh3cml0ZXIsIGluZGVudEZhY3RvciwgaW5kZW50KTsNCisgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBOdW1iZXIpIHsNCisgICAgICAgICAgICB3cml0ZXIud3JpdGUobnVtYmVyVG9TdHJpbmcoKE51bWJlcikgdmFsdWUpKTsNCisgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgaW5zdGFuY2VvZiBCb29sZWFuKSB7DQorICAgICAgICAgICAgd3JpdGVyLndyaXRlKHZhbHVlLnRvU3RyaW5nKCkpOw0KKyAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEpTT05TdHJpbmcpIHsNCisgICAgICAgICAgICBPYmplY3QgbzsNCisgICAgICAgICAgICB0cnkgew0KKyAgICAgICAgICAgICAgICBvID0gKChKU09OU3RyaW5nKSB2YWx1ZSkudG9KU09OU3RyaW5nKCk7DQorICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZSk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZShvICE9IG51bGwgPyBvLnRvU3RyaW5nKCkgOiBxdW90ZSh2YWx1ZS50b1N0cmluZygpKSk7DQorICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgIHF1b3RlKHZhbHVlLnRvU3RyaW5nKCksIHdyaXRlcik7DQorICAgICAgICB9DQorICAgICAgICByZXR1cm4gd3JpdGVyOw0KKyAgICB9DQorDQorICAgIHN0YXRpYyBmaW5hbCB2b2lkIGluZGVudChXcml0ZXIgd3JpdGVyLCBpbnQgaW5kZW50KSB0aHJvd3MgSU9FeGNlcHRpb24gew0KKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBpbmRlbnQ7IGkgKz0gMSkgew0KKyAgICAgICAgICAgIHdyaXRlci53cml0ZSgnICcpOw0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBXcml0ZSB0aGUgY29udGVudHMgb2YgdGhlIEpTT05PYmplY3QgYXMgSlNPTiB0ZXh0IHRvIGEgd3JpdGVyLiBGb3INCisgICAgICogY29tcGFjdG5lc3MsIG5vIHdoaXRlc3BhY2UgaXMgYWRkZWQuDQorICAgICAqIDxwPg0KKyAgICAgKiBXYXJuaW5nOiBUaGlzIG1ldGhvZCBhc3N1bWVzIHRoYXQgdGhlIGRhdGEgc3RydWN0dXJlIGlzIGFjeWNsaWNhbC4NCisgICAgICoNCisgICAgICogQHJldHVybiBUaGUgd3JpdGVyLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIFdyaXRlciB3cml0ZShXcml0ZXIgd3JpdGVyLCBpbnQgaW5kZW50RmFjdG9yLCBpbnQgaW5kZW50KQ0KKyAgICAgICAgICAgIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIHRyeSB7DQorICAgICAgICAgICAgYm9vbGVhbiBjb21tYW5hdGUgPSBmYWxzZTsNCisgICAgICAgICAgICBmaW5hbCBpbnQgbGVuZ3RoID0gdGhpcy5sZW5ndGgoKTsNCisgICAgICAgICAgICBJdGVyYXRvcjxTdHJpbmc+IGtleXMgPSB0aGlzLmtleXMoKTsNCisgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ3snKTsNCisNCisgICAgICAgICAgICBpZiAobGVuZ3RoID09IDEpIHsNCisgICAgICAgICAgICAgICAgT2JqZWN0IGtleSA9IGtleXMubmV4dCgpOw0KKyAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUocXVvdGUoa2V5LnRvU3RyaW5nKCkpKTsNCisgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKCc6Jyk7DQorICAgICAgICAgICAgICAgIGlmIChpbmRlbnRGYWN0b3IgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJyAnKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB3cml0ZVZhbHVlKHdyaXRlciwgdGhpcy5tYXAuZ2V0KGtleSksIGluZGVudEZhY3RvciwgaW5kZW50KTsNCisgICAgICAgICAgICB9IGVsc2UgaWYgKGxlbmd0aCAhPSAwKSB7DQorICAgICAgICAgICAgICAgIGZpbmFsIGludCBuZXdpbmRlbnQgPSBpbmRlbnQgKyBpbmRlbnRGYWN0b3I7DQorICAgICAgICAgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgICAgICAgICAgT2JqZWN0IGtleSA9IGtleXMubmV4dCgpOw0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbW1hbmF0ZSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZSgnLCcpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGluZGVudEZhY3RvciA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ1xuJyk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICBpbmRlbnQod3JpdGVyLCBuZXdpbmRlbnQpOw0KKyAgICAgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKHF1b3RlKGtleS50b1N0cmluZygpKSk7DQorICAgICAgICAgICAgICAgICAgICB3cml0ZXIud3JpdGUoJzonKTsNCisgICAgICAgICAgICAgICAgICAgIGlmIChpbmRlbnRGYWN0b3IgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVyLndyaXRlKCcgJyk7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB3cml0ZVZhbHVlKHdyaXRlciwgdGhpcy5tYXAuZ2V0KGtleSksIGluZGVudEZhY3RvciwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3aW5kZW50KTsNCisgICAgICAgICAgICAgICAgICAgIGNvbW1hbmF0ZSA9IHRydWU7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgaWYgKGluZGVudEZhY3RvciA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgIHdyaXRlci53cml0ZSgnXG4nKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBpbmRlbnQod3JpdGVyLCBpbmRlbnQpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICB3cml0ZXIud3JpdGUoJ30nKTsNCisgICAgICAgICAgICByZXR1cm4gd3JpdGVyOw0KKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZXhjZXB0aW9uKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oZXhjZXB0aW9uKTsNCisgICAgICAgIH0NCisgICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vTm9uZS5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vTm9uZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjViOWE0N2QKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9Ob25lLmphdmEKQEAgLTAsMCArMSwzMSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIG9yZy5vbmFwLmRtYWFwDQorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyAqICogDQorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisgKiAqIA0KKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4NCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQNCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyAqICogPT09PT09PT09PT09TElDRU5TRV9FTkQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKg0KKyAqICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisgKiAqDQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8NCitwYWNrYWdlIG9yZy5qc29uOw0KKw0KK3B1YmxpYyBpbnRlcmZhY2UgTm9uZSB7DQorICAgIC8qKg0KKyAgICAgKiBOZWdhdGl2ZSBPbmUNCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgaW50IG5vbmUgPSAtMTsNCisNCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vWE1MLmphdmEgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9YTUwuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zM2Y0M2U1Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vWE1MLmphdmEKQEAgLTAsMCArMSw1MzAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisg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AgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnPic6DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiJmd0OyIpOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICBjYXNlICciJzoNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCImcXVvdDsiKTsNCisgICAgICAgICAgICAgICAgYnJlYWs7DQorICAgICAgICAgICAgY2FzZSAnXCcnOg0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoIiZhcG9zOyIpOw0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICBkZWZhdWx0Og0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgIH0NCisNCisgICAgLyoqDQorICAgICAqIFRocm93IGFuIGV4Y2VwdGlvbiBpZiB0aGUgc3RyaW5nIGNvbnRhaW5zIHdoaXRlc3BhY2UuDQorICAgICAqIFdoaXRlc3BhY2UgaXMgbm90IGFsbG93ZWQgaW4gdGFnTmFtZXMgYW5kIGF0dHJpYnV0ZXMuDQorICAgICAqIEBwYXJhbSBzdHJpbmcNCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uDQorICAgICAqLw0KKyAgICBwdWJsaWMgc3RhdGljIHZvaWQgbm9TcGFjZShTdHJpbmcgc3RyaW5nKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBpbnQgaSwgbGVuZ3RoID0gc3RyaW5nLmxlbmd0aCgpOw0KKyAgICAgICAgaWYgKGxlbmd0aCA9PSAwKSB7DQorICAgICAgICAgICAgdGhyb3cgbmV3IEpTT05FeGNlcHRpb24oIkVtcHR5IHN0cmluZy4iKTsNCisgICAgICAgIH0NCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgIGlmIChDaGFyYWN0ZXIuaXNXaGl0ZXNwYWNlKHN0cmluZy5jaGFyQXQoaSkpKSB7DQorICAgICAgICAgICAgICAgIHRocm93IG5ldyBKU09ORXhjZXB0aW9uKCInIiArIHN0cmluZyArDQorICAgICAgICAgICAgICAgICAgICAgICAgIicgY29udGFpbnMgYSBzcGFjZSBjaGFyYWN0ZXIuIik7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorICAgIC8qKg0KKyAgICAgKiBTY2FuIHRoZSBjb250ZW50IGZvbGxvd2luZyB0aGUgbmFtZWQgdGFnLCBhdHRhY2hpbmcgaXQgdG8gdGhlIGNvbnRleHQuDQorICAgICAqIEBwYXJhbSB4ICAgICAgIFRoZSBYTUxUb2tlbmVyIGNvbnRhaW5pbmcgdGhlIHNvdXJjZSBzdHJpbmcuDQorICAgICAqIEBwYXJhbSBjb250ZXh0IFRoZSBKU09OT2JqZWN0IHRoYXQgd2lsbCBpbmNsdWRlIHRoZSBuZXcgbWF0ZXJpYWwuDQorICAgICAqIEBwYXJhbSBuYW1lICAgIFRoZSB0YWcgbmFtZS4NCisgICAgICogQHJldHVybiB0cnVlIGlmIHRoZSBjbG9zZSB0YWcgaXMgcHJvY2Vzc2VkLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gcGFyc2UoWE1MVG9rZW5lciB4LCBKU09OT2JqZWN0IGNvbnRleHQsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIGNoYXIgICAgICAgYzsNCisgICAgICAgIGludCAgICAgICAgaTsNCisgICAgICAgIEpTT05PYmplY3QganNvbm9iamVjdCA9IG51bGw7DQorICAgICAgICBTdHJpbmcgICAgIHN0cmluZzsNCisgICAgICAgIFN0cmluZyAgICAgdGFnTmFtZTsNCisgICAgICAgIE9iamVjdCAgICAgdG9rZW47DQorDQorLy8gVGVzdCBmb3IgYW5kIHNraXAgcGFzdCB0aGVzZSBmb3JtczoNCisvLyAgICAgIDwhLS0gLi4uIC0tPg0KKy8vICAgICAgPCEgICAuLi4gICA+DQorLy8gICAgICA8IVsgIC4uLiBdXT4NCisvLyAgICAgIDw/ICAgLi4uICA/Pg0KKy8vIFJlcG9ydCBlcnJvcnMgZm9yIHRoZXNlIGZvcm1zOg0KKy8vICAgICAgPD4NCisvLyAgICAgIDw9DQorLy8gICAgICA8PA0KKw0KKyAgICAgICAgdG9rZW4gPSB4Lm5leHRUb2tlbigpOw0KKw0KKy8vIDwhDQorDQorICAgICAgICBpZiAodG9rZW4gPT0gQkFORykgew0KKyAgICAgICAgICAgIGMgPSB4Lm5leHQoKTsNCisgICAgICAgICAgICBpZiAoYyA9PSAnLScpIHsNCisgICAgICAgICAgICAgICAgaWYgKHgubmV4dCgpID09ICctJykgew0KKyAgICAgICAgICAgICAgICAgICAgeC5za2lwUGFzdCgiLS0+Iik7DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgeC5iYWNrKCk7DQorICAgICAgICAgICAgfSBlbHNlIGlmIChjID09ICdbJykgew0KKyAgICAgICAgICAgICAgICB0b2tlbiA9IHgubmV4dFRva2VuKCk7DQorICAgICAgICAgICAgICAgIGlmICgiQ0RBVEEiLmVxdWFscyh0b2tlbikpIHsNCisgICAgICAgICAgICAgICAgICAgIGlmICh4Lm5leHQoKSA9PSAnWycpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmcgPSB4Lm5leHRDREFUQSgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJpbmcubGVuZ3RoKCkgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuYWNjdW11bGF0ZSgiY29udGVudCIsIHN0cmluZyk7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJFeHBlY3RlZCAnQ0RBVEFbJyIpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBpID0gMTsNCisgICAgICAgICAgICBkbyB7DQorICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0TWV0YSgpOw0KKyAgICAgICAgICAgICAgICBpZiAodG9rZW4gPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2luZyAnPicgYWZ0ZXIgJzwhJy4iKTsNCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0b2tlbiA9PSBMVCkgew0KKyAgICAgICAgICAgICAgICAgICAgaSArPSAxOw0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuID09IEdUKSB7DQorICAgICAgICAgICAgICAgICAgICBpIC09IDE7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9IHdoaWxlIChpID4gMCk7DQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KKyAgICAgICAgfSBlbHNlIGlmICh0b2tlbiA9PSBRVUVTVCkgew0KKw0KKy8vIDw/DQorDQorICAgICAgICAgICAgeC5za2lwUGFzdCgiPz4iKTsNCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICB9IGVsc2UgaWYgKHRva2VuID09IFNMQVNIKSB7DQorDQorLy8gQ2xvc2UgdGFnIDwvDQorDQorICAgICAgICAgICAgdG9rZW4gPSB4Lm5leHRUb2tlbigpOw0KKyAgICAgICAgICAgIGlmIChuYW1lID09IG51bGwpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzbWF0Y2hlZCBjbG9zZSB0YWcgIiArIHRva2VuKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgaWYgKCF0b2tlbi5lcXVhbHMobmFtZSkpIHsNCisgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzbWF0Y2hlZCAiICsgbmFtZSArICIgYW5kICIgKyB0b2tlbik7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlmICh4Lm5leHRUb2tlbigpICE9IEdUKSB7DQorICAgICAgICAgICAgICAgIHRocm93IHguc3ludGF4RXJyb3IoIk1pc3NoYXBlZCBjbG9zZSB0YWciKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgcmV0dXJuIHRydWU7DQorDQorICAgICAgICB9IGVsc2UgaWYgKHRva2VuIGluc3RhbmNlb2YgQ2hhcmFjdGVyKSB7DQorICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2hhcGVkIHRhZyIpOw0KKw0KKy8vIE9wZW4gdGFnIDwNCisNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgdGFnTmFtZSA9IChTdHJpbmcpdG9rZW47DQorICAgICAgICAgICAgdG9rZW4gPSBudWxsOw0KKyAgICAgICAgICAgIGpzb25vYmplY3QgPSBuZXcgSlNPTk9iamVjdCgpOw0KKyAgICAgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICAgICAgaWYgKHRva2VuID09IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgfQ0KKw0KKy8vIGF0dHJpYnV0ZSA9IHZhbHVlDQorDQorICAgICAgICAgICAgICAgIGlmICh0b2tlbiBpbnN0YW5jZW9mIFN0cmluZykgew0KKyAgICAgICAgICAgICAgICAgICAgc3RyaW5nID0gKFN0cmluZyl0b2tlbjsNCisgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgIGlmICh0b2tlbiA9PSBFUSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0geC5uZXh0VG9rZW4oKTsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0b2tlbiBpbnN0YW5jZW9mIFN0cmluZykpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgeC5zeW50YXhFcnJvcigiTWlzc2luZyB2YWx1ZSIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICBqc29ub2JqZWN0LmFjY3VtdWxhdGUoc3RyaW5nLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWE1MLnN0cmluZ1RvVmFsdWUoKFN0cmluZyl0b2tlbikpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuID0gbnVsbDsNCisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICAgICAganNvbm9iamVjdC5hY2N1bXVsYXRlKHN0cmluZywgIiIpOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKw0KKy8vIEVtcHR5IHRhZyA8Li4uLz4NCisNCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0b2tlbiA9PSBTTEFTSCkgew0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHgubmV4dFRva2VuKCkgIT0gR1QpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaGFwZWQgdGFnIik7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICBpZiAoanNvbm9iamVjdC5sZW5ndGgoKSA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmFjY3VtdWxhdGUodGFnTmFtZSwganNvbm9iamVjdCk7DQorICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuYWNjdW11bGF0ZSh0YWdOYW1lLCAiIik7DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorDQorLy8gQ29udGVudCwgYmV0d2VlbiA8Li4uPiBhbmQgPC8uLi4+DQorDQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW4gPT0gR1QpIHsNCisgICAgICAgICAgICAgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IHgubmV4dENvbnRlbnQoKTsNCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4gPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFnTmFtZSAhPSBudWxsKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJVbmNsb3NlZCB0YWcgIiArIHRhZ05hbWUpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRva2VuIGluc3RhbmNlb2YgU3RyaW5nKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZyA9IChTdHJpbmcpdG9rZW47DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJpbmcubGVuZ3RoKCkgPiAwKSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29ub2JqZWN0LmFjY3VtdWxhdGUoImNvbnRlbnQiLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBYTUwuc3RyaW5nVG9WYWx1ZShzdHJpbmcpKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKw0KKy8vIE5lc3RlZCBlbGVtZW50DQorDQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0b2tlbiA9PSBMVCkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2UoeCwganNvbm9iamVjdCwgdGFnTmFtZSkpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqc29ub2JqZWN0Lmxlbmd0aCgpID09IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmFjY3VtdWxhdGUodGFnTmFtZSwgIiIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChqc29ub2JqZWN0Lmxlbmd0aCgpID09IDEgJiYNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29ub2JqZWN0Lm9wdCgiY29udGVudCIpICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmFjY3VtdWxhdGUodGFnTmFtZSwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25vYmplY3Qub3B0KCJjb250ZW50IikpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmFjY3VtdWxhdGUodGFnTmFtZSwganNvbm9iamVjdCk7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICB0aHJvdyB4LnN5bnRheEVycm9yKCJNaXNzaGFwZWQgdGFnIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFRyeSB0byBjb252ZXJ0IGEgc3RyaW5nIGludG8gYSBudW1iZXIsIGJvb2xlYW4sIG9yIG51bGwuIElmIHRoZSBzdHJpbmcNCisgICAgICogY2FuJ3QgYmUgY29udmVydGVkLCByZXR1cm4gdGhlIHN0cmluZy4gVGhpcyBpcyBtdWNoIGxlc3MgYW1iaXRpb3VzIHRoYW4NCisgICAgICogSlNPTk9iamVjdC5zdHJpbmdUb1ZhbHVlLCBlc3BlY2lhbGx5IGJlY2F1c2UgaXQgZG9lcyBub3QgYXR0ZW1wdCB0bw0KKyAgICAgKiBjb252ZXJ0IHBsdXMgZm9ybXMsIG9jdGFsIGZvcm1zLCBoZXggZm9ybXMsIG9yIEUgZm9ybXMgbGFja2luZyBkZWNpbWFsDQorICAgICAqIHBvaW50cy4NCisgICAgICogQHBhcmFtIHN0cmluZyBBIFN0cmluZy4NCisgICAgICogQHJldHVybiBBIHNpbXBsZSBKU09OIHZhbHVlLg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBPYmplY3Qgc3RyaW5nVG9WYWx1ZShTdHJpbmcgc3RyaW5nKSB7DQorICAgICAgICBpZiAoIiIuZXF1YWxzKHN0cmluZykpIHsNCisgICAgICAgICAgICByZXR1cm4gc3RyaW5nOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKCJ0cnVlIi5lcXVhbHNJZ25vcmVDYXNlKHN0cmluZykpIHsNCisgICAgICAgICAgICByZXR1cm4gQm9vbGVhbi5UUlVFOw0KKyAgICAgICAgfQ0KKyAgICAgICAgaWYgKCJmYWxzZSIuZXF1YWxzSWdub3JlQ2FzZShzdHJpbmcpKSB7DQorICAgICAgICAgICAgcmV0dXJuIEJvb2xlYW4uRkFMU0U7DQorICAgICAgICB9DQorICAgICAgICBpZiAoIm51bGwiLmVxdWFsc0lnbm9yZUNhc2Uoc3RyaW5nKSkgew0KKyAgICAgICAgICAgIHJldHVybiBKU09OT2JqZWN0Lk5VTEw7DQorICAgICAgICB9DQorICAgICAgICBpZiAoIjAiLmVxdWFscyhzdHJpbmcpKSB7DQorICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnRlZ2VyKDApOw0KKyAgICAgICAgfQ0KKw0KKy8vIElmIGl0IG1pZ2h0IGJlIGEgbnVtYmVyLCB0cnkgY29udmVydGluZyBpdC4gSWYgdGhhdCBkb2Vzbid0IHdvcmssDQorLy8gcmV0dXJuIHRoZSBzdHJpbmcuDQorDQorICAgICAgICB0cnkgew0KKyAgICAgICAgICAgIGNoYXIgaW5pdGlhbCA9IHN0cmluZy5jaGFyQXQoMCk7DQorICAgICAgICAgICAgYm9vbGVhbiBuZWdhdGl2ZSA9IGZhbHNlOw0KKyAgICAgICAgICAgIGlmIChpbml0aWFsID09ICctJykgew0KKyAgICAgICAgICAgICAgICBpbml0aWFsID0gc3RyaW5nLmNoYXJBdCgxKTsNCisgICAgICAgICAgICAgICAgbmVnYXRpdmUgPSB0cnVlOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBpZiAoaW5pdGlhbCA9PSAnMCcgJiYgc3RyaW5nLmNoYXJBdChuZWdhdGl2ZSA/IDIgOiAxKSA9PSAnMCcpIHsNCisgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmluZzsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgaWYgKChpbml0aWFsID49ICcwJyAmJiBpbml0aWFsIDw9ICc5JykpIHsNCisgICAgICAgICAgICAgICAgaWYgKHN0cmluZy5pbmRleE9mKCcuJykgPj0gMCkgew0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIERvdWJsZS52YWx1ZU9mKHN0cmluZyk7DQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RyaW5nLmluZGV4T2YoJ2UnKSA8IDAgJiYgc3RyaW5nLmluZGV4T2YoJ0UnKSA8IDApIHsNCisgICAgICAgICAgICAgICAgICAgIExvbmcgbXlMb25nID0gbmV3IExvbmcoc3RyaW5nKTsNCisgICAgICAgICAgICAgICAgICAgIGlmIChteUxvbmcubG9uZ1ZhbHVlKCkgPT0gbXlMb25nLmludFZhbHVlKCkpIHsNCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEludGVnZXIobXlMb25nLmludFZhbHVlKCkpOw0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbXlMb25nOw0KKyAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfSAgY2F0Y2ggKEV4Y2VwdGlvbiBpZ25vcmUpIHsNCisgICAgICAgIH0NCisgICAgICAgIHJldHVybiBzdHJpbmc7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIENvbnZlcnQgYSB3ZWxsLWZvcm1lZCAoYnV0IG5vdCBuZWNlc3NhcmlseSB2YWxpZCkgWE1MIHN0cmluZyBpbnRvIGENCisgICAgICogSlNPTk9iamVjdC4gU29tZSBpbmZvcm1hdGlvbiBtYXkgYmUgbG9zdCBpbiB0aGlzIHRyYW5zZm9ybWF0aW9uDQorICAgICAqIGJlY2F1c2UgSlNPTiBpcyBhIGRhdGEgZm9ybWF0IGFuZCBYTUwgaXMgYSBkb2N1bWVudCBmb3JtYXQuIFhNTCB1c2VzDQorICAgICAqIGVsZW1lbnRzLCBhdHRyaWJ1dGVzLCBhbmQgY29udGVudCB0ZXh0LCB3aGlsZSBKU09OIHVzZXMgdW5vcmRlcmVkDQorICAgICAqIGNvbGxlY3Rpb25zIG9mIG5hbWUvdmFsdWUgcGFpcnMgYW5kIGFycmF5cyBvZiB2YWx1ZXMuIEpTT04gZG9lcyBub3QNCisgICAgICogZG9lcyBub3QgbGlrZSB0byBkaXN0aW5ndWlzaCBiZXR3Z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KiBAcmV0dXJuICBBIHN0cmluZy4NCisgICAgICogQHRocm93cyAgSlNPTkV4Y2VwdGlvbg0KKyAgICAgKi8NCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgdG9TdHJpbmcoT2JqZWN0IG9iamVjdCkgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgcmV0dXJuIHRvU3RyaW5nKG9iamVjdCwgbnVsbCk7DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIENvbnZlcnQgYSBKU09OT2JqZWN0IGludG8gYSB3ZWxsLWZvcm1lZCwgZWxlbWVudC1ub3JtYWwgWE1MIHN0cmluZy4NCisgICAgICogQHBhcmFtIG9iamVjdCBBIEpTT05PYmplY3QuDQorICAgICAqIEBwYXJhbSB0YWdOYW1lIFRoZSBvcHRpb25hbCBuYW1lIG9mIHRoZSBlbmNsb3NpbmcgdGFnLg0KKyAgICAgKiBAcmV0dXJuIEEgc3RyaW5nLg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIHRvU3RyaW5nKE9iamVjdCBvYmplY3QsIFN0cmluZyB0YWdOYW1lKQ0KKyAgICAgICAgICAgIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIFN0cmluZ0J1ZmZlciBzYiA9IG5ldyBTdHJpbmdCdWZmZXIoKTsNCisgICAgICAgIGludCAgICAgICAgICBpOw0KKyAgICAgICAgSlNPTkFycmF5ICAgIGphOw0KKyAgICAgICAgSlNPTk9iamVjdCAgIGpvOw0KKyAgICAgICAgU3RyaW5nICAgICAgIGtleTsNCisgICAgICAgIEl0ZXJhdG9yPFN0cmluZz4ga2V5czsNCisgICAgICAgIGludCAgICAgICAgICBsZW5ndGg7DQorICAgICAgICBTdHJpbmcgICAgICAgc3RyaW5nOw0KKyAgICAgICAgT2JqZWN0ICAgICAgIHZhbHVlOw0KKyAgICAgICAgaWYgKG9iamVjdCBpbnN0YW5jZW9mIEpTT05PYmplY3QpIHsNCisNCisvLyBFbWl0IDx0YWdOYW1lPg0KKw0KKyAgICAgICAgICAgIGlmICh0YWdOYW1lICE9IG51bGwpIHsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh0YWdOYW1lKTsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCc+Jyk7DQorICAgICAgICAgICAgfQ0KKw0KKy8vIExvb3AgdGhydSB0aGUga2V5cy4NCisNCisgICAgICAgICAgICBqbyA9IChKU09OT2JqZWN0KW9iamVjdDsNCisgICAgICAgICAgICBrZXlzID0gam8ua2V5cygpOw0KKyAgICAgICAgICAgIHdoaWxlIChrZXlzLmhhc05leHQoKSkgew0KKyAgICAgICAgICAgICAgICBrZXkgPSBrZXlzLm5leHQoKS50b1N0cmluZygpOw0KKyAgICAgICAgICAgICAgICB2YWx1ZSA9IGpvLm9wdChrZXkpOw0KKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT0gbnVsbCkgew0KKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAiIjsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpIHsNCisgICAgICAgICAgICAgICAgICAgIHN0cmluZyA9IChTdHJpbmcpdmFsdWU7DQorICAgICAgICAgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgICAgICAgICBzdHJpbmcgPSBudWxsOw0KKyAgICAgICAgICAgICAgICB9DQorDQorLy8gRW1pdCBjb250ZW50IGluIGJvZHkNCisNCisgICAgICAgICAgICAgICAgaWYgKCJjb250ZW50Ii5lcXVhbHMoa2V5KSkgew0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgSlNPTkFycmF5KSB7DQorICAgICAgICAgICAgICAgICAgICAgICAgamEgPSAoSlNPTkFycmF5KXZhbHVlOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IGphLmxlbmd0aCgpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+IDApIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnXG4nKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoZXNjYXBlKGphLmdldChpKS50b1N0cmluZygpKSk7DQorICAgICAgICAgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoZXNjYXBlKHZhbHVlLnRvU3RyaW5nKCkpKTsNCisgICAgICAgICAgICAgICAgICAgIH0NCisNCisvLyBFbWl0IGFuIGFycmF5IG9mIHNpbWlsYXIga2V5cw0KKw0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgSlNPTkFycmF5KSB7DQorICAgICAgICAgICAgICAgICAgICBqYSA9IChKU09OQXJyYXkpdmFsdWU7DQorICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBqYS5sZW5ndGgoKTsNCisgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gamEuZ2V0KGkpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSBpbnN0YW5jZW9mIEpTT05BcnJheSkgew0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJzwnKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGtleSk7DQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgnPicpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQodG9TdHJpbmcodmFsdWUpKTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCI8LyIpOw0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoa2V5KTsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCc+Jyk7DQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHRvU3RyaW5nKHZhbHVlLCBrZXkpKTsNCisgICAgICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIiIuZXF1YWxzKHZhbHVlKSkgew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKCc8Jyk7DQorICAgICAgICAgICAgICAgICAgICBzYi5hcHBlbmQoa2V5KTsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiLz4iKTsNCisNCisvLyBFbWl0IGEgbmV3IHRhZyA8az4NCisNCisgICAgICAgICAgICAgICAgfSBlbHNlIHsNCisgICAgICAgICAgICAgICAgICAgIHNiLmFwcGVuZCh0b1N0cmluZyh2YWx1ZSwga2V5KSk7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgaWYgKHRhZ05hbWUgIT0gbnVsbCkgew0KKw0KKy8vIEVtaXQgdGhlIDwvdGFnbmFtZT4gY2xvc2UgdGFnDQorDQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZCgiPC8iKTsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHRhZ05hbWUpOw0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoJz4nKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorDQorLy8gWE1MIGRvZXMgbm90IGhhdmUgZ29vZCBzdXBwb3J0IGZvciBhcnJheXMuIElmIGFuIGFycmF5IGFwcGVhcnMgaW4gYSBwbGFjZQ0KKy8vIHdoZXJlIFhNTCBpcyBsYWNraW5nLCBzeW50aGVzaXplIGFuIDxhcnJheT4gZWxlbWVudC4NCisNCisgICAgICAgIH0gZWxzZSB7DQorICAgICAgICAgICAgaWYgKG9iamVjdC5nZXRDbGFzcygpLmlzQXJyYXkoKSkgew0KKyAgICAgICAgICAgICAgICBvYmplY3QgPSBuZXcgSlNPTkFycmF5KG9iamVjdCk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBKU09OQXJyYXkpIHsNCisgICAgICAgICAgICAgICAgamEgPSAoSlNPTkFycmF5KW9iamVjdDsNCisgICAgICAgICAgICAgICAgbGVuZ3RoID0gamEubGVuZ3RoKCk7DQorICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW5ndGg7IGkgKz0gMSkgew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKHRvU3RyaW5nKGphLm9wdChpKSwgdGFnTmFtZSA9PSBudWxsID8gImFycmF5IiA6IHRhZ05hbWUpKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBzdHJpbmcgPSAob2JqZWN0ID09IG51bGwpID8gIm51bGwiIDogZXNjYXBlKG9iamVjdC50b1N0cmluZygpKTsNCisgICAgICAgICAgICAgICAgcmV0dXJuICh0YWdOYW1lID09IG51bGwpID8gIlwiIiArIHN0cmluZyArICJcIiIgOg0KKyAgICAgICAgICAgICAgICAgICAgKHN0cmluZy5sZW5ndGgoKSA9PSAwKSA/ICI8IiArIHRhZ05hbWUgKyAiLz4iIDoNCisgICAgICAgICAgICAgICAgICAgICI8IiArIHRhZ05hbWUgKyAiPiIgKyBzdHJpbmcgKyAiPC8iICsgdGFnTmFtZSArICI+IjsNCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCit9DQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vWE1MVG9rZW5lci5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vWE1MVG9rZW5lci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmJkYjU0NjYKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vamF2YS9vcmcvanNvbi9YTUxUb2tlbmVyLmphdmEKQEAgLTAsMCArMSwzOTAgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqDQorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBvcmcub25hcC5kbWFhcA0KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisgKiAqIA0KKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorICogKiANCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA0KKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuDQorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorICogKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4NCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyAqICoNCisgKiAqIEVDT01QIGlzIGEgdHJhZGVtYXJrIGFuZCBzZXJ2aWNlIG1hcmsgb2YgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuDQorICogKg0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorcGFja2FnZSBvcmcuanNvbjsNCisNCitpbXBvcn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ICAgICAgZW50aXR5ID0gbmV3IEhhc2hNYXA8U3RyaW5nLENoYXJhY3Rlcj4oOCk7DQorICAgICAgIGVudGl0eS5wdXQoImFtcCIsICBYTUwuQU1QKTsNCisgICAgICAgZW50aXR5LnB1dCgiYXBvcyIsIFhNTC5BUE9TKTsNCisgICAgICAgZW50aXR5LnB1dCgiZ3QiLCAgIFhNTC5HVCk7DQorICAgICAgIGVudGl0eS5wdXQoImx0IiwgICBYTUwuTFQpOw0KKyAgICAgICBlbnRpdHkucHV0KCJxdW90IiwgWE1MLlFVT1QpOw0KKyAgIH0NCisNCisgICAgLyoqDQorICAgICAqIENvbnN0cnVjdCBhbiBYTUxUb2tlbmVyIGZyb20gYSBzdHJpbmcuDQorICAgICAqIEBwYXJhbSBzIEEgc291cmNlIHN0cmluZy4NCisgICAgICovDQorICAgIHB1YmxpYyBYTUxUb2tlbmVyKFN0cmluZyBzKSB7DQorICAgICAgICBzdXBlcihzKTsNCisgICAgfQ0KKw0KKyAgICAvKioNCisgICAgICogR2V0IHRoZSB0ZXh0IGluIHRoZSBDREFUQSBibG9jay4NCisgICAgICogQHJldHVybiBUaGUgc3RyaW5nIHVwIHRvIHRoZSA8Y29kZT5dXSZndDs8L2NvZGU+Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24gSWYgdGhlIDxjb2RlPl1dJmd0OzwvY29kZT4gaXMgbm90IGZvdW5kLg0KKyAgICAgKi8NCisgICAgcHVibGljIFN0cmluZyBuZXh0Q0RBVEEoKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyICAgICAgICAgYzsNCisgICAgICAgIGludCAgICAgICAgICBpOw0KKyAgICAgICAgU3RyaW5nQnVmZmVyIHNiID0gbmV3IFN0cmluZ0J1ZmZlcigpOw0KKyAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICAgICAgaWYgKGVuZCgpKSB7DQorICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJVbmNsb3NlZCBDREFUQSIpOw0KKyAgICAgICAgICAgIH0NCisgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICAgICAgaSA9IHNiLmxlbmd0aCgpIC0gMzsNCisgICAgICAgICAgICBpZiAoaSA+PSAwICYmIHNiLmNoYXJBdChpKSA9PSAnXScgJiYNCisgICAgICAgICAgICAgICAgICAgICAgICAgIHNiLmNoYXJBdChpICsgMSkgPT0gJ10nICYmIHNiLmNoYXJBdChpICsgMikgPT0gJz4nKSB7DQorICAgICAgICAgICAgICAgIHNiLnNldExlbmd0aChpKTsNCisgICAgICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBHZXQgdGhlIG5leHQgWE1MIG91dGVyIHRva2VuLCB0cmltbWluZyB3aGl0ZXNwYWNlLiBUaGVyZSBhcmUgdHdvIGtpbmRzDQorICAgICAqIG9mIHRva2VuczogdGhlICc8JyBjaGFyYWN0ZXIgd2hpY2ggYmVnaW5zIGEgbWFya3VwIHRhZywgYW5kIHRoZSBjb250ZW50DQorICAgICAqIHRleHQgYmV0d2VlbiBtYXJrdXAgdGFncy4NCisgICAgICoNCisgICAgICogQHJldHVybiAgQSBzdHJpbmcsIG9yIGEgJzwnIENoYXJhY3Rlciwgb3IgbnVsbCBpZiB0aGVyZSBpcyBubyBtb3JlDQorICAgICAqIHNvdXJjZSB0ZXh0Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBPYmplY3QgbmV4dENvbnRlbnQoKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyICAgICAgICAgYzsNCisgICAgICAgIFN0cmluZ0J1ZmZlciBzYjsNCisgICAgICAgIGRvIHsNCisgICAgICAgICAgICBjID0gbmV4dCgpOw0KKyAgICAgICAgfSB3aGlsZSAoQ2hhcmFjdGVyLmlzV2hpdGVzcGFjZShjKSk7DQorICAgICAgICBpZiAoYyA9PSAwKSB7DQorICAgICAgICAgICAgcmV0dXJuIG51bGw7DQorICAgICAgICB9DQorICAgICAgICBpZiAoYyA9PSAnPCcpIHsNCisgICAgICAgICAgICByZXR1cm4gWE1MLkxUOw0KKyAgICAgICAgfQ0KKyAgICAgICAgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgaWYgKGMgPT0gJzwnIHx8IGMgPT0gMCkgew0KKyAgICAgICAgICAgICAgICBiYWNrKCk7DQorICAgICAgICAgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpLnRyaW0oKTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgaWYgKGMgPT0gJyYnKSB7DQorICAgICAgICAgICAgICAgIHNiLmFwcGVuZChuZXh0RW50aXR5KGMpKTsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFJldHVybiB0aGUgbmV4dCBlbnRpdHkuIFRoZXNlIGVudGl0aWVzIGFyZSB0cmFuc2xhdGVkIHRvIENoYXJhY3RlcnM6DQorICAgICAqICAgICA8Y29kZT4mYW1wOyAgJmFwb3M7ICAmZ3Q7ICAmbHQ7ICAmcXVvdDs8L2NvZGU+Lg0KKyAgICAgKiBAcGFyYW0gYW1wZXJzYW5kIEFuIGFtcGVyc2FuZCBjaGFyYWN0ZXIuDQorICAgICAqIEByZXR1cm4gIEEgQ2hhcmFjdGVyIG9yIGFuIGVudGl0eSBTdHJpbmcgaWYgdGhlIGVudGl0eSBpcyBub3QgcmVjb2duaXplZC4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIElmIG1pc3NpbmcgJzsnIGluIFhNTCBlbnRpdHkuDQorICAgICAqLw0KKyAgICBwdWJsaWMgT2JqZWN0IG5leHRFbnRpdHkoY2hhciBhbXBlcnNhbmQpIHRocm93cyBKU09ORXhjZXB0aW9uIHsNCisgICAgICAgIFN0cmluZ0J1ZmZlciBzYiA9IG5ldyBTdHJpbmdCdWZmZXIoKTsNCisgICAgICAgIGZvciAoOzspIHsNCisgICAgICAgICAgICBjaGFyIGMgPSBuZXh0KCk7DQorICAgICAgICAgICAgaWYgKENoYXJhY3Rlci5pc0xldHRlck9yRGlnaXQoYykgfHwgYyA9PSAnIycpIHsNCisgICAgICAgICAgICAgICAgc2IuYXBwZW5kKENoYXJhY3Rlci50b0xvd2VyQ2FzZShjKSk7DQorICAgICAgICAgICAgfSBlbHNlIGlmIChjID09ICc7Jykgew0KKyAgICAgICAgICAgICAgICBicmVhazsNCisgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICB0aHJvdyBzeW50YXhFcnJvcigiTWlzc2luZyAnOycgaW4gWE1MIGVudGl0eTogJiIgKyBzYik7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICAgICAgU3RyaW5nIHN0cmluZyA9IHNiLnRvU3RyaW5nKCk7DQorICAgICAgICBPYmplY3Qgb2JqZWN0ID0gZW50aXR5LmdldChzdHJpbmcpOw0KKyAgICAgICAgcmV0dXJuIG9iamVjdCAhPSBudWxsID8gb2JqZWN0IDogYW1wZXJzYW5kICsgc3RyaW5nICsgIjsiOw0KKyAgICB9DQorDQorDQorICAgIC8qKg0KKyAgICAgKiBSZXR1cm5zIHRoZSBuZXh0IFhNTCBtZXRhIHRva2VuLiBUaGlzIGlzIHVzZWQgZm9yIHNraXBwaW5nIG92ZXIgPCEuLi4+DQorICAgICAqIGFuZCA8Py4uLj8+IHN0cnVjdHVyZXMuDQorICAgICAqIEByZXR1cm4gU3ludGF4IGNoYXJhY3RlcnMgKDxjb2RlPjwgPiAvID0gISA/PC9jb2RlPikgYXJlIHJldHVybmVkIGFzDQorICAgICAqICBDaGFyYWN0ZXIsIGFuZCBzdHJpbmdzIGFuZCBuYW1lcyBhcmUgcmV0dXJuZWQgYXMgQm9vbGVhbi4gV2UgZG9uJ3QgY2FyZQ0KKyAgICAgKiAgd2hhdCB0aGUgdmFsdWVzIGFjdHVhbGx5IGFyZS4NCisgICAgICogQHRocm93cyBKU09ORXhjZXB0aW9uIElmIGEgc3RyaW5nIGlzIG5vdCBwcm9wZXJseSBjbG9zZWQgb3IgaWYgdGhlIFhNTA0KKyAgICAgKiAgaXMgYmFkbHkgc3RydWN0dXJlZC4NCisgICAgICovDQorICAgIHB1YmxpYyBPYmplY3QgbmV4dE1ldGEoKSB0aHJvd3MgSlNPTkV4Y2VwdGlvbiB7DQorICAgICAgICBjaGFyIGM7DQorICAgICAgICBjaGFyIHE7DQorICAgICAgICBkbyB7DQorICAgICAgICAgICAgYyA9IG5leHQoKTsNCisgICAgICAgIH0gd2hpbGUgKENoYXJhY3Rlci5pc1doaXRlc3BhY2UoYykpOw0KKyAgICAgICAgc3dpdGNoIChjKSB7DQorICAgICAgICBjYXNlIDA6DQorICAgICAgICAgICAgdGhyb3cgc3ludGF4RXJyb3IoIk1pc3NoYXBlZCBtZXRhIHRhZyIpOw0KKyAgICAgICAgY2FzZSAnPCc6DQorICAgICAgICAgICAgcmV0dXJuIFhNTC5MVDsNCisgICAgICAgIGNhc2UgJz4nOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuR1Q7DQorICAgICAgICBjYXNlICcvJzoNCisgICAgICAgICAgICByZXR1cm4gWE1MLlNMQVNIOw0KKyAgICAgICAgY2FzZSAnPSc6DQorICAgICAgICAgICAgcmV0dXJuIFhNTC5FUTsNCisgICAgICAgIGNhc2UgJyEnOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuQkFORzsNCisgICAgICAgIGNhc2UgJz8nOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuUVVFU1Q7DQorICAgICAgICBjYXNlICciJzoNCisgICAgICAgIGNhc2UgJ1wnJzoNCisgICAgICAgICAgICBxID0gYzsNCisgICAgICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICAgICAgICAgIGlmIChjID09IDApIHsNCisgICAgICAgICAgICAgICAgICAgIHRocm93IHN5bnRheEVycm9yKCJVbnRlcm1pbmF0ZWQgc3RyaW5nIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICAgICAgaWYgKGMgPT0gcSkgew0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJvb2xlYW4uVFJVRTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0NCisgICAgICAgIGRlZmF1bHQ6DQorICAgICAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgICAgICBjID0gbmV4dCgpOw0KKyAgICAgICAgICAgICAgICBpZiAoQ2hhcmFjdGVyLmlzV2hpdGVzcGFjZShjKSkgew0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJvb2xlYW4uVFJVRTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICAgICAgY2FzZSAwOg0KKyAgICAgICAgICAgICAgICBjYXNlICc8JzoNCisgICAgICAgICAgICAgICAgY2FzZSAnPic6DQorICAgICAgICAgICAgICAgIGNhc2UgJy8nOg0KKyAgICAgICAgICAgICAgICBjYXNlICc9JzoNCisgICAgICAgICAgICAgICAgY2FzZSAnISc6DQorICAgICAgICAgICAgICAgIGNhc2UgJz8nOg0KKyAgICAgICAgICAgICAgICBjYXNlICciJzoNCisgICAgICAgICAgICAgICAgY2FzZSAnXCcnOg0KKyAgICAgICAgICAgICAgICAgICAgYmFjaygpOw0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJvb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z4nOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuR1Q7DQorICAgICAgICBjYXNlICcvJzoNCisgICAgICAgICAgICByZXR1cm4gWE1MLlNMQVNIOw0KKyAgICAgICAgY2FzZSAnPSc6DQorICAgICAgICAgICAgcmV0dXJuIFhNTC5FUTsNCisgICAgICAgIGNhc2UgJyEnOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuQkFORzsNCisgICAgICAgIGNhc2UgJz8nOg0KKyAgICAgICAgICAgIHJldHVybiBYTUwuUVVFU1Q7DQorDQorLy8gUXVvdGVkIHN0cmluZw0KKw0KKyAgICAgICAgY2FzZSAnIic6DQorICAgICAgICBjYXNlICdcJyc6DQorICAgICAgICAgICAgcSA9IGM7DQorICAgICAgICAgICAgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgICAgICBjID0gbmV4dCgpOw0KKyAgICAgICAgICAgICAgICBpZiAoYyA9PSAwKSB7DQorICAgICAgICAgICAgICAgICAgICB0aHJvdyBzeW50YXhFcnJvcigiVW50ZXJtaW5hdGVkIHN0cmluZyIpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGlmIChjID09IHEpIHsNCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzYi50b1N0cmluZygpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGlmIChjID09ICcmJykgew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKG5leHRFbnRpdHkoYykpOw0KKyAgICAgICAgICAgICAgICB9IGVsc2Ugew0KKyAgICAgICAgICAgICAgICAgICAgc2IuYXBwZW5kKGMpOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgZGVmYXVsdDoNCisNCisvLyBOYW1lDQorDQorICAgICAgICAgICAgc2IgPSBuZXcgU3RyaW5nQnVmZmVyKCk7DQorICAgICAgICAgICAgZm9yICg7Oykgew0KKyAgICAgICAgICAgICAgICBzYi5hcHBlbmQoYyk7DQorICAgICAgICAgICAgICAgIGMgPSBuZXh0KCk7DQorICAgICAgICAgICAgICAgIGlmIChDaGFyYWN0ZXIuaXNXaGl0ZXNwYWNlKGMpKSB7DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2IudG9TdHJpbmcoKTsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGMpIHsNCisgICAgICAgICAgICAgICAgY2FzZSAwOg0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgICAgICAgICAgICAgIGNhc2UgJz4nOg0KKyAgICAgICAgICAgICAgICBjYXNlICcvJzoNCisgICAgICAgICAgICAgICAgY2FzZSAnPSc6DQorICAgICAgICAgICAgICAgIGNhc2UgJyEnOg0KKyAgICAgICAgICAgICAgICBjYXNlICc/JzoNCisgICAgICAgICAgICAgICAgY2FzZSAnWyc6DQorICAgICAgICAgICAgICAgIGNhc2UgJ10nOg0KKyAgICAgICAgICAgICAgICAgICAgYmFjaygpOw0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNiLnRvU3RyaW5nKCk7DQorICAgICAgICAgICAgICAgIGNhc2UgJzwnOg0KKyAgICAgICAgICAgICAgICBjYXNlICciJzoNCisgICAgICAgICAgICAgICAgY2FzZSAnXCcnOg0KKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgc3ludGF4RXJyb3IoIkJhZCBjaGFyYWN0ZXIgaW4gYSBuYW1lIik7DQorICAgICAgICAgICAgICAgIH0NCisgICAgICAgICAgICB9DQorICAgICAgICB9DQorICAgIH0NCisNCisNCisgICAgLyoqDQorICAgICAqIFNraXAgY2hhcmFjdGVycyB1bnRpbCBwYXN0IHRoZSByZXF1ZXN0ZWQgc3RyaW5nLg0KKyAgICAgKiBJZiBpdCBpcyBub3QgZm91bmQsIHdlIGFyZSBsZWZ0IGF0IHRoZSBlbmQgb2YgdGhlIHNvdXJjZSB3aXRoIGEgcmVzdWx0IG9mIGZhbHNlLg0KKyAgICAgKiBAcGFyYW0gdG8gQSBzdHJpbmcgdG8gc2tpcCBwYXN0Lg0KKyAgICAgKiBAdGhyb3dzIEpTT05FeGNlcHRpb24NCisgICAgICovDQorICAgIHB1YmxpYyBib29sZWFuIHNraXBQYXN0KFN0cmluZyB0bykgdGhyb3dzIEpTT05FeGNlcHRpb24gew0KKyAgICAgICAgYm9vbGVhbiBiOw0KKyAgICAgICAgY2hhciBjOw0KKyAgICAgICAgaW50IGk7DQorICAgICAgICBpbnQgajsNCisgICAgICAgIGludCBvZmZzZXQgPSAwOw0KKyAgICAgICAgaW50IGxlbmd0aCA9IHRvLmxlbmd0aCgpOw0KKyAgICAgICAgY2hhcltdIGNpcmNsZSA9IG5ldyBjaGFyW2xlbmd0aF07DQorDQorICAgICAgICAvKg0KKyAgICAgICAgICogRmlyc3QgZmlsbCB0aGUgY2lyY2xlIGJ1ZmZlciB3aXRoIGFzIG1hbnkgY2hhcmFjdGVycyBhcyBhcmUgaW4gdGhlDQorICAgICAgICAgKiB0byBzdHJpbmcuIElmIHdlIHJlYWNoIGFuIGVhcmx5IGVuZCwgYmFpbC4NCisgICAgICAgICAqLw0KKw0KKyAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxKSB7DQorICAgICAgICAgICAgYyA9IG5leHQoKTsNCisgICAgICAgICAgICBpZiAoYyA9PSAwKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgY2lyY2xlW2ldID0gYzsNCisgICAgICAgIH0NCisNCisgICAgICAgIC8qIFdlIHdpbGwgbG9vcCwgcG9zc2libHkgZm9yIGFsbCBvZiB0aGUgcmVtYWluaW5nIGNoYXJhY3RlcnMuICovDQorDQorICAgICAgICBmb3IgKDs7KSB7DQorICAgICAgICAgICAgaiA9IG9mZnNldDsNCisgICAgICAgICAgICBiID0gdHJ1ZTsNCisNCisgICAgICAgICAgICAvKiBDb21wYXJlIHRoZSBjaXJjbGUgYnVmZmVyIHdpdGggdGhlIHRvIHN0cmluZy4gKi8NCisNCisgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbGVuZ3RoOyBpICs9IDEpIHsNCisgICAgICAgICAgICAgICAgaWYgKGNpcmNsZVtqXSAhPSB0by5jaGFyQXQoaSkpIHsNCisgICAgICAgICAgICAgICAgICAgIGIgPSBmYWxzZTsNCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KKyAgICAgICAgICAgICAgICB9DQorICAgICAgICAgICAgICAgIGogKz0gMTsNCisgICAgICAgICAgICAgICAgaWYgKGogPj0gbGVuZ3RoKSB7DQorICAgICAgICAgICAgICAgICAgICBqIC09IGxlbmd0aDsNCisgICAgICAgICAgICAgICAgfQ0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICAvKiBJZiB3ZSBleGl0IHRoZSBsb29wIHdpdGggYiBpbnRhY3QsIHRoZW4gdmljdG9yeSBpcyBvdXJzLiAqLw0KKw0KKyAgICAgICAgICAgIGlmIChiKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOw0KKyAgICAgICAgICAgIH0NCisNCisgICAgICAgICAgICAvKiBHZXQgdGhlIG5leHQgY2hhcmFjdGVyLiBJZiB0aGVyZSBpc24ndCBvbmUsIHRoZW4gZGVmZWF0IGlzIG91cnMuICovDQorDQorICAgICAgICAgICAgYyA9IG5leHQoKTsNCisgICAgICAgICAgICBpZiAoYyA9PSAwKSB7DQorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCisgICAgICAgICAgICB9DQorICAgICAgICAgICAgLyoNCisgICAgICAgICAgICAgKiBTaG92ZSB0aGUgY2hhcmFjdGVyIGluIHRoZSBjaXJjbGUgYnVmZmVyIGFuZCBhZHZhbmNlIHRoZQ0KKyAgICAgICAgICAgICAqIGNpcmNsZSBvZmZzZXQuIFRoZSBvZmZzZXQgaXMgbW9kIG4uDQorICAgICAgICAgICAgICovDQorICAgICAgICAgICAgY2lyY2xlW29mZnNldF0gPSBjOw0KKyAgICAgICAgICAgIG9mZnNldCArPSAxOw0KKyAgICAgICAgICAgIGlmIChvZmZzZXQgPj0gbGVuZ3RoKSB7DQorICAgICAgICAgICAgICAgIG9mZnNldCAtPSBsZW5ndGg7DQorICAgICAgICAgICAgfQ0KKyAgICAgICAgfQ0KKyAgICB9DQorfQ0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL3BhY2thZ2UuaHRtbCBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9qYXZhL29yZy9qc29uL3BhY2thZ2UuaHRtbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zOTJhMGM2Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL2phdmEvb3JnL2pzb24vcGFja2FnZS5odG1sCkBAIC0wLDAgKzEsNDAgQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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VyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL0VlbGZNZXNzYWdlcy5wcm9wZXJ0aWVzCkBAIC0wLDAgKzEsNTggQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCCpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsNCisjICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLg0KKyMgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQNCisjICogDQorIyAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMA0KKyMgKiANCisjICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUNCisjICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2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BLRVksCisgICAgRkVFRElEICAgICAgICAgICAgIElOVCBVTlNJR05FRCBOT1QgTlVMTCwKKyAgICBERUxJVkVSWV9VUkwgICAgICAgVkFSQ0hBUigyNTYpLAorICAgIERFTElWRVJZX1VTRVIgICAgICBWQVJDSEFSKDIwKSwKKyAgICBERUxJVkVSWV9QQVNTV09SRCAgVkFSQ0hBUigzMiksCisgICAgREVMSVZFUllfVVNFMTAwICAgIEJPT0xFQU4gREVGQVVMVCBGQUxTRSwKKyAgICBNRVRBREFUQV9PTkxZICAgICAgQk9PTEVBTiBERUZBVUxUIEZBTFNFLAorICAgIFNVQlNDUklCRVIgICAgICAgICBWQVJDSEFSKDgpIE5PVCBOVUxMLAorICAgIFNFTEZfTElOSyAgICAgICAgICBWQVJDSEFSKDI1NiksCisgICAgTE9HX0xJTksgICAgICAgICAgIFZBUkNIQVIoMjU2KSwKKyAgICBMQVNUX01PRCAgICAgICAgICAgVElNRVNUQU1QIERFRkFVTFQgQ1VSUkVOVF9USU1FU1RBTVAKKyk7CisKK0NSRUFURSBUQUJMRSBQQVJBTUVURVJTICgKKyAgICBLRVlOQU1FICAgICAgICBWQVJDSEFSKDMyKSBOT1QgTlVMTCBQUklNQVJZIEtFWSwKKyAgICBWQUxVRSAgICAgICAgICBWQVJDSEFSKDQwOTYpIE5PVCBOVUxMCispOworCitDUkVBVEUgVEFCTEUgTE9HX1JFQ09SRFMgKAorICAgIFRZUEUJICAgRU5VTSgncHViJywgJ2RlbCcsICdleHAnKSBOT1QgTlVMTCwKKyAgICBFVkVOVF9USU1FICAgICBCSUdJTlQgTk9UIE5VTEwsICAgICAgICAgICAvKiB0aW1lIG9mIHRoZSBwdWJsaXNoIHJlcXVlc3QgKi8KKyAgICBQVUJMSVNIX0lEICAgICBWQVJDSEFSKDY0KSBOT1QgTlVMTCwgICAgICAvKiB1bmlxdWUgSUQgYXNzaWduZWQgdG8gdGhpcyBwdWJsaXNoIGF0dGVtcHQgKi8KKyAgICBGRUVESUQgICAgIC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Jvdi9zcmMvbWFpbi9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2UvZG9ja2VyLWNvbXBvc2UueW1sIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9kb2NrZXItY29tcG9zZS9kb2NrZXItY29tcG9zZS55bWwKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNGUyYTgxYQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2UvZG9ja2VyLWNvbXBvc2UueW1sCkBAIC0wLDAgKzEsNjkgQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorIyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisjICogWW91IG1he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i9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2Uvbm9kZV9kYXRhL25vZGUucHJvcGVydGllcwpAQCAtMCwwICsxLDExMiBAQAorIy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCisjID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBvcmcub25hcC5kbWFhcA0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogQ29weXJpZ2h0IKkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4NCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOw0KKyMgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuDQorIyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdA0KKyMgKiANCisjICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wDQorIyAqIA0KKyMgICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQ0KKyMgKiBkaXN0cmlidXRlZCB1bmRlciB0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mZGZlCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9kb2NrZXItY29tcG9zZS9ub2RlX2RhdGEvc2VsZl9zaWduZWQvbm9kZWtleS5jZXIKQmluYXJ5IGZpbGVzIGRpZmZlcgpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9kb2NrZXItY29tcG9zZS9wcm92X2RhdGEvYWRkRmVlZDMudHh0IGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9kb2NrZXItY29tcG9zZS9wcm92X2RhdGEvYWRkRmVlZDMudHh0Cm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmEyMWM3YWUKLS0tIC9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL2RvY2tlci1jb21wb3NlL3Byb3ZfZGF0YS9hZGRGZWVkMy50eHQKQEAgLTAsMCArMSw0NCBAQAorIy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCisjID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBvcmcub25hcC5kbWFhcA0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorew0KKyAgICAgIm5hbWUiOiAiSmV0dHlkZW1vIiwNCisgICAgICJ2ZXJzaW9uIjogIm0xLjAiLA0KKyAgICAgImRlc2NyaXB0aW9uIjogIkpldHR5ZGVtbyIsDQorICAgICAiYnVzaW5lc3NfZGVzY3JpcHRpb24iOiAiSmV0dHlkZW1vIiwNCisgICAgICJzdXNwZW5kIjogZmFsc2UsDQorICAgICAiZGVsZXRlZCI6IGZhbHNlLA0KKyAgICAgImNoYW5nZW93bmVyIjogdHJ1ZSwNCisgICAgICJhdXRob3JpemF0aW9uIjogew0KKyAgICAgICAgICAiY2xhc3NpZmljYXRpb24iOiAidW5jbGFzc2lmaWVkIiwNCisgICAgICAgICAgImVuZHBvaW50X2FkZHJzIjogWw0KKyAgICAgICAgICAgICAgICIxNzIuMTguMC4zIiwNCisJCQldLA0KKyAgICAgICAgICAiZW5kcG9pbnRfaWRzIjogWw0KKyAgICAgICAgICAgICAgIHsNCisgICAgICAgICAgICAgICAgICAgICJwYXNzd29yZCI6ICJyczg3M20iLA0KKyAgICAgICAgICAgICAgICAgICAgImlkIjogInJzODczbSINCisgICAgICAgICAgICAgICB9DQorICAgICAgICAgIF0NCisgICAgIH0sDQorfQ0KKw0KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2UvcHJvdl9kYXRhL2FkZFN1YnNjcmliZXIudHh0IGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9kb2NrZXItY29tcG9zZS9wcm92X2RhdGEvYWRkU3Vic2NyaWJlci50eHQKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTk3NDYzMQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2UvcHJvdl9kYXRhL2FkZFN1YnNjcmliZXIudHh0CkBAIC0wLDAgKzEsMzYgQEAKKyMtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQorIyA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogb3JnLm9uYXAuZG1hYXANCisjICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorIyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisjICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorIyAqIA0KKyMgICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisjICogDQorIyAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorIyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsDQorIyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLg0KKyMgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kDQorIyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLg0KKyMgKiA9PT09PT09PT09PT1MSUNFTlNFX0VORD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICoNCisjICogRUNPTVAgaXMgYSB0cmFkZW1hcmsgYW5kIHNlcnZpY2UgbWFyayBvZiBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4NCisjICoNCisjLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KK3sgDQorICAgICAgICAgICAgICAgICJkZWxpdmVyeSIgOgkNCisgICAgICAgICAgICAgICAJCQkJDQorICAgICAgICAgICAgICAgIHsgDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidXJsIiA6ICJodHRwOi8vMTcyLjE4LjAuMzo3MDcwLyIsIA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVzZXIiIDogIkxPR0lOIiwgDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicGFzc3dvcmQiIDogIlBBU1NXT1JEIiwgDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidXNlMTAwIiA6IHRydWUgDQorICAgICAgICAgICAgICAgIH0sDQorICAgICAgICAgICAgICAgICJtZXRhZGF0YU9ubHkiIDogZmFsc2UsIA0KKyAgICAgICAgICAgICAgICAic3VzcGVuZCIgOiBmYWxzZSwgDQorCQkJCSJncm91cGlkIiA6IDI5LA0KKyAgICAgICAgICAgICAgICAic3Vic2NyaWJlciIgOiAic2c0ODFuIg0KK30NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL2RvY2tlci1jb21wb3NlL3Byb3ZfZGF0YS9wcm92c2VydmVyLnByb3BlcnRpZXMgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL2RvY2tlci1jb21wb3NlL3Byb3ZfZGF0YS9wcm92c2VydmVyLnByb3BlcnRpZXMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNmEwM2NiZAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9yZXNvdXJjZXMvZG9ja2VyLWNvbXBvc2UvcHJvdl9kYXRhL3Byb3ZzZXJ2ZXIucHJvcGVydGllcwpAQCAtMCwwICsxLDU5IEBACisjLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KKyMgPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIG9yZy5vbmFwLmRtYWFwDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBDb3B5cmlnaHQgqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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mVyc2lvblBhdHRlcm49JWR7eXl5eS1NTS1kZCBISDptbTpzc30gJS01cCAlY3sxfTolTCAtICVtJW4NCmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL21pc2MvbG9nNGoucHJvcGVydGllcy50bXBsIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9taXNjL2xvZzRqLnByb3BlcnRpZXMudG1wbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lZDFkN2ZhCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy9tYWluL3Jlc291cmNlcy9taXNjL2xvZzRqLnByb3BlcnRpZXMudG1wbApAQCAtMCwwICsxLDY4IEBACitjYXQgPDwhRU9GCisjCisjICAgICAgICAgICAgICAgICAgICAgICAgQVQmVCAtIFBST1BSSUVUQVJZCisjICAgICAgICAgIFRISVMgRklMRSBDT05UQUlOUyBQUk9QUklFVEFSWSBJTkZPUk1BVElPTiBPRgorIyAgICAgICAgQVQmVCBBTkQgSVMgTk9UIFRPIEJFIERJU0NMT1NFRCBPUiBVU0VEIEVYQ0VQVCBJTgorIyAgICAgICAgICAgICBBQ0NPUkRBTkNFIFdJVEggQVBQTElDQUJMRSBBR1JFRU1FTlRTLgorIworIyAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgQVQmVCBLbm93bGVkZ2UgVmVudHVyZXMKKyMgICAgICAgICAgICAgIFVucHVibGlzaGVkIGFuZCBOb3QgZm9yIFB1YmxpY2F0aW9uCisjICAgICAgICAgICAgICAgICAgICAgQWxsIFJpZ2h0cyBSZXNlcnZlZAorIworIyBDVlM6ICRJZDogbG9nNGoucHJvcGVydGllcy50bXBsLHYgMS40IDIwMTQvMDEvMTMgMTk6NDQ6NTcgZWJ5IEV4cCAkCisjCisKK2xvZzRqLnJvb3RMb2dnZXI9aW5mbworCisjCisjIExvZ2dlciB1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EIE5PVCBOVUxMLAorICAgIEFERFIgICAgICAgICAgVkFSQ0hBUig0NCkgTk9UIE5VTEwKKyk7CisKK0NSRUFURSBUQUJMRSBTVUJTQ1JJUFRJT05TICgKKyAgICBTVUJJRCAgICAgICAgICAgICAgSU5UIFVOU0lHTkVEIE5PVCBOVUxMIFBSSU1BUlkgS0VZLAorICAgIEZFRURJRCAgICAgICAgICAgICBJTlQgVU5TSUdORUQgTk9UIE5VTEwsCisgICAgREVMSVZFUllfVVJMICAgICAgIFZBUkNIQVIoMjU2KSwKKyAgICBERUxJVkVSWV9VU0VSICAgICAgVkFSQ0hBUigyMCksCisgICAgREVMSVZFUllfUEFTU1dPUkQgIFZBUkNIQVIoMzIpLAorICAgIERFTElWRVJZX1VTRTEwMCAgICBCT09MRUFOIERFRkFVTFQgRkFMU0UsCisgICAgTUVUQURBVEFfT05MWSAgICAgIEJPT0xFQU4gREVGQVVMVCBGQUxTRSwKKyAgICBTVUJTQ1JJQkVSICAgICAgICAgVkFSQ0hBUig4KSBOT1QgTlVMTCwKKyAgICBTRUxGX0xJTksgICAgICAgICAgVkFSQ0hBUigyNTYpLAorICAgIExPR19MSU5LICAgICAgICAgICBWQVJDSEFSKDI1NiksCisgICAgTEFTVF9NT0QgICAgICAgICAgIFRJTUVTVEFNUCBERUZBVUxUIENVUlJFTlRfVElNRVNUQU1QCispOworCitDUkVBVEUgVEFCTEUgUEFSQU1FVEVSUyAoCisgICAgS0VZTkFNRSAgICAgICAgVkFSQ0hBUigzMikgTk9UIE5VTEwgUFJJTUFSWSBLRVksCisgICAgVkFMVUUgICAgICAgICAgVkFSQ0hBUig0MDk2KSBOT1QgTlVMTAorKTsKKworQ1JFQVRFIFRBQkxFIExPR19SRUNPUkRTICgKKyAgICBUWVBFCSAgIEVOVU0oJ3B1YicsICdkZWwnLCAnZXhwJykgTk9UIE5VTEwsCisgICAgRVZFTlRfVElNRSAgICAgQklHSU5UIE5PVCBOVUxMLCAgICAgICAgICAgLyogdGltZSBv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9kZXYvbnVsbAorKysgYi9kYXRhcm91dGVyLXByb3Yvc3JjL21haW4vcmVzb3VyY2VzL3Byb3ZzZXJ2ZXIucHJvcGVydGllcwpAQCAtMCwwICsxLDQ4IEBACisjLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KKyMgPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQorIyAqIG9yZy5vbmFwLmRtYWFwDQorIyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KKyMgKiBDb3B5cmlnaHQgqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyMgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NCisjICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7DQorIyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4NCisjICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0DQorIyAqIA0KKyMgICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjANCisjICogDQorIyAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlDQorIyAqIGRpc3RyaW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YzhlNDc3NQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvbWFpbi9yZXNvdXJjZXMvc3Vic2NyaWJlci5qYXIKQmluYXJ5IGZpbGVzIGRpZmZlcgpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvQWxsVGVzdHMuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL0FsbFRlc3RzLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTIxNTk1NQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL0FsbFRlc3RzLmphdmEKQEAgLTAsMCArMSw0OCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworCitpbXBvcnQgb3JnLmp1bml0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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIG9yZy5vbmFwLmRtYWFwCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogKiAKKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAqIAorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAq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m91dGVyL3Byb3Zpc2lvbmluZy9wYWNrYWdlLmh0bWwKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDAzODNiOAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3BhY2thZ2UuaHRtbApAQCAtMCwwICsxLDI5IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIG9yZy5vbmFwLmRtYWFwCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBDb3B5cmlnaHQgqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQg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bGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOWE5NjkzMwotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3RCYXNlLmphdmEKQEAgLTAsMCArMSwxNTggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRv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dCAiK2V4cGVjdCsiIGdvdCAiK2NvZGUrIiAiK3NsLmdldFJlYXNvblBocmFzZSgpKTsKKwl9Cit9CmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL3Rlc3QvamF2YS9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy90ZXN0Q2xlYW51cC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdENsZWFudXAuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mYTFjNWY0Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdENsZWFudXAuamF2YQpAQCAtMCwwICsxLDg1IEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIG9yZy5vbmFwLmRtYWFwCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogKiB5b3UgbWF5IG5vdCB1c2Ug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sKKwkJfSBmaW5hbGx5IHsKKwkJCWRlbC5yZWxlYXNlQ29ubmVjdGlvbigpOworCQl9CisJfQorfQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdERSRmVlZHNEZWxldGUuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3REUkZlZWRzRGVsZXRlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZmI0YTU1NAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3REUkZlZWRzRGVsZXRlLmphdmEKQEAgLTAsMCArMSw1OSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworaW1wb3J0IHN0YXRpYyBvcmcuanVuaXQuQXNzZXJ0LmZ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GlvbiBlKSB7CisJCQlmYWlsKGUuZ2V0TWVzc2FnZSgpKTsKKwkJfSBmaW5hbGx5IHsKKwkJCWRlbC5yZWxlYXNlQ29ubmVjdGlvbigpOworCQl9CisJfQorfQpkaWZmIC0tZ2l0IGEvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdERSRmVlZHNHZXQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3REUkZlZWRzR2V0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMzMzMDNmYQotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3REUkZlZWRzR2V0LmphdmEKQEAgLTAsMCArMSwxODggQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaW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EwMDY0NAppbmRleCAwMDAwMDAwLi42NWQwNDFkCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdERSRmVlZHNQb3N0LmphdmEKQEAgLTAsMCArMSwyODIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbm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AKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogKiA9PT09PT09P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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKi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otLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3RGZWVkUHV0LmphdmEKQEAgLTAsMCArMSwyMDIgQEAKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiAqIGRpc3RyaW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ElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIG9yZy5vbmFwLmRtYWFwCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogKiAKKyAqICAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAqIAorICogICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZX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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA9PT09PT09PT09PT1MSUNFTlNFX1NUQVJUPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogb3JnLm9uYXAuZG1hYXAKKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIENvcHlyaWdodCDCqSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAqIAorICogICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqICogCisgKiAgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorIC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Sk7CisJCX0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKwkJCWUucHJpbnRTdGFja1RyYWNlKCk7CisJCQlmYWlsKGUuZ2V0TWVzc2FnZSgpKTsKKwkJfSBmaW5hbGx5IHsKKwkJCWh0dHBQb3N0LnJlbGVhc2VDb25uZWN0aW9uKCk7CisJCX0KKwl9CisKK30KZGlmZiAtLWdpdCBhL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3RMb2dHZXQuamF2YSBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3RMb2dHZXQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41MTAxNTBhCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdExvZ0dldC5qYXZhCkBAIC0wLDAgKzEsMTgxIEBACisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogPT09PT09PT09PT09TElDRU5TRV9TVEFSVD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiAqIG9yZy5vbmFwLmRtYWFwCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBDb3B5cmlnaHQgwqkgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eS4gQWxsIHJpZ2h0cyByZXNlcnZlZC4KKyAqICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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ZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xNWQwNTY1Ci0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdFB1Ymxpc2guamF2YQpAQCAtMCwwICsxLDExOSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworaW1wb3J0IHN0YXRpYyBvcmcuanVuaXQuQXNzZXJ0LmZhaWw7CisKK2ltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOworCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVzcG9uc2U7CisKK2ltcG9ydCBvcmcuYXBhY2hlLmh0dHAuSGVhZGVyOworaW1wb3J0IG9yZy5hcGFjaGUuaHR0cC5IdHRwUmVzcG9uc2U7CitpbXBvcnQgb3JnLmFwYWNoZS5odHRwLmNsaWVudC5SZWRpcmVjdFN0cmF0ZWd5OworaW1wb3J0IG9yZy5hcGFjaGUuaHR0cC5jbGllbnQubWV0aG9kcy5IdH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L3Rlc3QvamF2YS9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy90ZXN0UkxFQml0U2V0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDA5NzBlZAotLS0gL2Rldi9udWxsCisrKyBiL2RhdGFyb3V0ZXItcHJvdi9zcmMvdGVzdC9qYXZhL2RhdGFyb3V0ZXIvcHJvdmlzaW9uaW5nL3Rlc3RSTEVCaXRTZXQuamF2YQpAQCAtMCwwICsxLDIzMSBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworaW1wb3J0IHN0YXRpYyBvcmcuanVuaXQuQXNzZXJ0LmZhaWw7CisKK2ltcG9ydCBqYXZhLnV0aWwuSXRlcmF0b3I7CisKK2ltcG9ydCBvcmcuanVuaXQuVGVzdDsKKworaW1wb3J0IGNvbS5hdHQucmVzZWFyY2guZGF0YXJvdXRlci5wcm92aXNpb25pbmcudXRpbHMuUkxFQml0U2V0OworCitwdWJsaWMgY2xhc3MgdGVzdFJMRUJpdFNldCB7CisJQFRlc3QKKwlwdWJsaWMgdm9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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworaW1wb3J0IGRhdGFyb3V0ZXIucHJvdmlzaW9uaW5nLnRlc3RCYXNlOworCitwdWJsaWMgY2xhc3MgdGVzdFJvdXRlQVBJIGV4dGVuZHMgdGVzdEJhc2UgeworCit9CmRpZmYgLS1naXQgYS9kYXRhcm91dGVyLXByb3Yvc3JjL3Rlc3QvamF2YS9kYXRhcm91dGVyL3Byb3Zpc2lvbmluZy90ZXN0U3Vic2NyaWJlUG9zdC5qYXZhIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdFN1YnNjcmliZVBvc3QuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wZjYyNGVjCi0tLSAvZGV2L251bGwKKysrIGIvZGF0YXJvdXRlci1wcm92L3NyYy90ZXN0L2phdmEvZGF0YXJvdXRlci9wcm92aXNpb25pbmcvdGVzdFN1YnNjcmliZVBvc3QuamF2YQpAQCAtMCwwICsxLDE4MCBAQAorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqID09PT09PT09PT09PUxJQ0VOU0VfU1RBUlQ9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBvcmcub25hcC5kbWFhcAorICogKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqICogQ29weXJpZ2h0IMKpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkuIEFsbCByaWdodHMgcmVzZXJ2ZWQuCisgKiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqICogCisgKiAgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogKiAKKyAqICAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiAqID09PT09PT09PT09PUxJQ0VOU0VfRU5EPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogKgorICogKiBFQ09NUCBpcyBhIHRyYWRlbWFyayBhbmQgc2VydmljZSBtYXJrIG9mIEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5LgorICogKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworcGFja2FnZSBkYXRhcm91dGVyLnByb3Zpc2lvbmluZzsKKworaW1wb3J0IHN0YXRpYyBvcmcuanVuaXQuQXNzZXJ0LmZhaWw7CisKK2ltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOworCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVzcG9uc2U7CisKK2ltcG9ydCBvcmcuYXBhY2hlLmh0dHAuSHR0cEVudGl0eTsKK2ltcG9ydCBvcmcuYXBhY2hlLmh0dHAuSHR0cFJlc3BvbnNlOworaW1wb3J0IG9yZy5hcGFjaGUuaHR0cC5jbGllbnQubWV0aG9kcy5IdHRwUG9zdDsKK2ltcG9ydCBvcmcuYXBhY2hlLmh0dHAuZW50aXR5LkJ5dGVBcnJheUVudGl0eTsKK2ltcG9ydCBvcmcuYXBhY2hlLmh0dHAuZW50aXR5LkNvbnRlbnRUeXBlOworaW1wb3J0IG9yZy5hcGFjaGUuaHR0cC51dGlsLkVudGl0eVV0aWxzOworaW1wb3J0IG9yZy5qc29uLkpTT05BcnJheTsKK2ltcG9ydCBvcmcuanNvbi5KU09ORXhjZXB0aW9uOworaW1wb3J0IG9yZy5qc29uLkpTT05PYmplY3Q7CitpbXBvcnQgb3JnLmpzb24uSlNPTlRva2VuZXI7CitpbXBvcnQgb3JnLmp1bml0LkFmdGVyQ2xhc3M7CitpbXB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