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ZSB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB0aGUgR05VIExlc3NlciBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlLCB2ZXJzaW9uIDMsIGFzIHB1Ymxpc2hlZCBieSB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLgogCmRpZmYgLS1naXQgYS9uYmFjdGlvbnMueG1sIGIvbmJhY3Rpb25zLnhtbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iOWYwYzQwCi0tLSAvZGV2L251bGwKKysrIGIvbmJhY3Rpb25zLnhtbApAQCAtMCwwICsxLDEwMSBAQAorPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KKzxhY3Rpb25zPgorICAgICAgICA8YWN0aW9uPgorICAgICAgICAgICAgPGFjdGlvbk5hbWU+cmVidWlsZDwvYWN0aW9uTmFtZT4KKyAgICAgICAgICAgIDxwYWNrYWdpbmdzPgorICAgICAgICAgICAgICAgIDxwYWNrYWdpbmc+KjwvcGFja2FnaW5nPgorICAgICAgICAgICAgPC9wYWNrYWdpbmdzPgorICAgICAgICAgICAgPGdvYWxzPgorICAgICAgICAgICAgICAgIDxnb2FsPmNsZWFuPC9nb2FsPgorICAgICAgICAgICAgICAgIDxnb2FsPmluc3RhbGw8L2dvYWw+CisgICAgICAgICAgICA8L2dvYWxzPgorICAgICAgICAgICAgPHByb3BlcnRpZXM+CisgICAgICAgICAgICAgICAgPG5mZC5pcD5uZG4tbGFiMi5qZi5pbnRlbC5jb208L25mZC5pcD4KKyAgICAgICAgICAgIDwvcHJvcGVydGllcz4KKyAgICAgICAgPC9hY3Rpb24+CisgICAgICAgIDxhY3Rpb24+CisgICAgICAgICAgICA8YWN0aW9uTmFtZT50ZXN0PC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPHBhY2thZ2luZ3M+CisgICAgICAgICAgICAgICAgPHBhY2thZ2luZz4qPC9wYWNrYWdpbmc+CisgICAgICAgICAgICA8L3BhY2thZ2luZ3M+CisgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgPGdvYWw+dGVzdDwvZ29hbD4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIDwvZ29hbHM+CisgICAgICAgICAgICA8cHJvcGVydGllcz4KKyAgICAgICAgICAgICAgICA8bmZkLmlwPm5kbi1sYWIyLmpmLmludGVsLmNvbTwvbmZkLmlwPgorICAgICAgICAgICAgPC9wcm9wZXJ0aWVzPgorICAgICAgICA8L2FjdGlvbj4KKyAgICAgICAgPGFjdGlvbj4KKyAgICAgICAgICAgIDxhY3Rpb25OYW1lPnRlc3Quc2luZ2xlPC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPHBhY2thZ2luZ3M+CisgICAgICAgICAgICAgICAgPHBhY2thZ2luZz4qPC9wYWNrYWdpbmc+CisgICAgICAgICAgICA8L3BhY2thZ2luZ3M+CisgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgPGdvYWw+dGVzdC1jb21waWxlPC9nb2FsPgorICAgICAgICAgICAgICAgIDxnb2FsPnN1cmVmaXJlOnRlc3Q8L2dvYWw+CisgICAgICAgICAgICA8L2dvYWxzPgorICAgICAgICAgICAgPHByb3BlcnRpZXM+CisgICAgICAgICAgICAgICAgPHRlc3Q+JHtwYWNrYWdlQ2xhc3NOYW1lfTwvdGVzdD4KKyAgICAgICAgICAgICAgICA8bmZkLmlwPm5kbi1sYWIyLmpmLmludGVsLmNvbTwvbmZkLmlwPgorICAgICAgICAgICAgPC9wcm9wZXJ0aWVzPgorICAgICAgICA8L2FjdGlvbj4KKyAgICAgICAgPGFjdGlvbj4KKyAgICAgICAgICAgIDxhY3Rpb25OYW1lPmJ1aWxkLXdpdGgtZGVwZW5kZW5jaWVzPC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPHJlYWN0b3I+YWxzby1tYWtlPC9yZWFjdG9yPgorICAgICAgICAgICAgPHBhY2thZ2luZ3M+CisgICAgICAgICAgICAgICAgPHBhY2thZ2luZz4qPC9wYWNrYWdpbmc+CisgICAgICAgICAgICA8L3BhY2thZ2luZ3M+CisgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgPGdvYWw+aW5zdGFsbDwvZ29hbD4KKyAgICAgICAgICAgIDwvZ29hbHM+CisgICAgICAgICAgICA8cHJvcGVydGllcz4KKyAgICAgICAgICAgICAgICA8bmZkLmlwPm5kbi1sYWIyLmpmLmludGVsLmNvbTwvbmZkLmlwPgorICAgICAgICAgICAgPC9wcm9wZXJ0aWVzPgorICAgICAgICA8L2FjdGlvbj4KKyAgICAgICAgPGFjdGlvbj4KKyAgICAgICAgICAgIDxhY3Rpb25OYW1lPmJ1aWxkPC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPHBhY2thZ2luZ3M+CisgICAgICAgICAgICAgICAgPHBhY2thZ2luZz4qPC9wYWNrYWdpbmc+CisgICAgICAgICAgICA8L3BhY2thZ2luZ3M+CisgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgPGdvYWw+aW5zdGFsbDwvZ29hbD4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIDwvZ29hbHM+CisgICAgICAgICAgICA8cHJvcGVydGllcz4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICA8bmZkLmlwPm5kbi1sYWIyLmpmLmludGVsLmNvbTwvbmZkLmlwPgorICAgICAgICAgICAgPC9wcm9wZXJ0aWVzPgorICAgICAgICA8L2FjdGlvbj4KKyAgICAgICAgPGFjdGlvbj4KKyAgICAgICAgICAgIDxhY3Rpb25OYW1lPmRlYnVnLnRlc3Quc2luZ2xlPC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPHBhY2thZ2luZ3M+CisgICAgICAgICAgICAgICAgPHBhY2thZ2luZz4qPC9wYWNrYWdpbmc+CisgICAgICAgICAgICA8L3BhY2thZ2luZ3M+CisgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgPGdvYWw+dGVzdC1jb21waWxlPC9nb2FsPgorICAgICAgICAgICAgICAgIDxnb2FsPnN1cmVmaXJlOnRlc3Q8L2dvYWw+CisgICAgICAgICAgICA8L2dvYWxzPgorICAgICAgICAgICAgPHByb3BlcnRpZXM+CisgICAgICAgICAgICAgICAgPHRlc3Q+JHtwYWNrYWdlQ2xhc3NOYW1lfTwvdGVzdD4KKyAgICAgICAgICAgICAgICA8Zm9ya01vZGU+b25jZTwvZm9ya01vZGU+CisgICAgICAgICAgICAgICAgPG5mZC5pcD5uZG4tbGFiMi5qZi5pbnRlbC5jb208L25mZC5pcD4KKyAgICAgICAgICAgICAgICA8bWF2ZW4uc3VyZWZpcmUuZGVidWc+LVhkZWJ1ZyAtWHJ1bmpkd3A6dHJhbnNwb3J0PWR0X3NvY2tldCxzZXJ2ZXI9bixhZGRyZXNzPSR7anBkYS5hZGRyZXNzfTwvbWF2ZW4uc3VyZWZpcmUuZGVidWc+CisgICAgICAgICAgICAgICAgPGpwZGEubGlzdGVuPnRydWU8L2pwZGEubGlzdGVuPgorICAgICAgICAgICAgPC9wcm9wZXJ0aWVzPgorICAgICAgICA8L2FjdGlvbj4KKyAgICAgICAgPGFjdGlvbj4KKyAgICAgICAgICAgIDxhY3Rpb25OYW1lPkNVU1RPTS1SdW4gTkZEIEludGVncmF0aW9uIFRlc3RzPC9hY3Rpb25OYW1lPgorICAgICAgICAgICAgPGRpc3BsYXlOYW1lPlJ1biBORkQgSW50ZWdyYXRpb24gVGVzdHM8L2Rpc3BsYXlOYW1lPgorICAgICAgICAgICAgPGdvYWxzPgorICAgICAgICAgICAgICAgIDxnb2FsPnZlcmlmeTwvZ29hbD4KKyAgICAgICAgICAgIDwvZ29hbHM+CisgICAgICAgICAgICA8cHJvcGVydGllcz4KKyAgICAgICAgICAgICAgICA8bmZkLmlwPm5kbi1sYWIyLmpmLmludGVsLmNvbTwvbmZkLmlwPgorICAgICAgICAgICAgPC9wcm9wZXJ0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5SW50ZXJlc3QoY29udGV4dCk7CisgIH0KKworICAvKioKKyAgICogU3luY2hyb25pemVkIGhlbHBlciBtZXRob2QgdG8gcHJldmVudCBtdWx0aXBsZSB0aHJlYWRzIGZyb20gbWFzaGluZworICAgKiB0b3RhbFJldHJpZXMKKyAgICoKKyAgICogQHBhcmFtIGNvbnRleHQgdGhlIGN1cnJlbnQgcmVxdWVzdCBjb250ZXh0CisgICAqIEB0aHJvd3MgSU9FeGNlcHRpb24gd2hlbiB0aGUgY2xpZW50IGNhbm5vdCBwZXJmb3JtIHRoZSBuZWNlc3NhcnkgbmV0d29yayBJTworICAgKi8KKyAgc3luY2hyb25pemVkIHByaXZhdGUgdm9pZCByZXRyeUludGVyZXN0KFJldHJ5Q29udGV4dCBjb250ZXh0KSB0aHJvd3MgSU9FeGNlcHRpb24geworICAgIGxvZ2dlci5pbmZvKCJSZXRyeWluZyBpbnRlcmVzdDogIiArIGNvbnRleHQuaW50ZXJlc3QudG9VcmkoKSk7CisgICAgY29udGV4dC5mYWNlLmV4cHJlc3NJbnRlcmVzdChjb250ZXh0LmludGVyZXN0LCBjb250ZXh0LCBjb250ZXh0KTsKKyAgICB0b3RhbFJldHJpZXMrKzsKKyAgfQorCisgIC8qKgorICAgKiBAcmV0dXJuIHRoZSB0b3RhbCBudW1iZXIgb2YgcmV0cmllcyBsb2dnZWQgYnkgdGhpcyBjbGllbnQKKyAgICovCisgIHB1YmxpYyBpbnQgdG90YWxSZXRyaWVzKCkgeworICAgIHJldHVybiB0b3RhbFJldHJpZXM7CisgIH0KKworICAvKioKKyAgICogSGVscGVyIGNsYXNzIHRvIHNlcGFyYXRlIG91dCBlYWNoIHJlcXVlc3QgY29udGV4dDsgdGhpcyBhbGxvd3MgdGhlIGNsaWVudAorICAgKiB0byBhY2NlcHQgbXVsdGlwbGUgY29uY3VycmVudCByZXRyeSBvcGVyYXRpb25zCisgICAqLworICBwcml2YXRlIGNsYXNzIFJldHJ5Q29udGV4dCBpbXBsZW1lbn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SZXF1ZXN0IGZhaWxlZCwgY291bnQgIiArIG51bUZhaWx1cmVzICsgIjogIiArIGludGVyZXN0LnRvVXJpKCkpOworCisgICAgICBpZiAoc2hvdWxkUmV0cnkoKSkgeworICAgICAgICB0cnkgeworICAgICAgICAgIHJldHJ5SW50ZXJlc3QodGhpcyk7CisgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGV4KSB7CisgICAgICAgICAgYXBwbGljYXRpb25PblRpbWVvdXQub25UaW1lb3V0KGludGVyZXN0KTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIHsKKyAgICAgICAgYXBwbGljYXRpb25PblRpbWVvdXQub25UaW1lb3V0KGludGVyZXN0KTsKKyAgICAgIH0KKyAgICB9CisgIH0KK30KZGlmZiAtLWdpdCBhL3NyYy9tYWluL2phdmEvY29tL2ludGVsL2puZG4vdXRpbHMvY2xpZW50L2ltcGwvRGVmYXVsdFNlZ21lbnRlZENsaWVudC5qYXZhIGIvc3JjL21haW4vamF2YS9jb20vaW50ZWwvam5kbi91dGlscy9jbGllbnQvaW1wbC9EZWZhdWx0U2VnbWVudGVkQ2xpZW50LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODNlMGJhYQotLS0gL2Rldi9udWxsCisrKyBiL3NyYy9tYWluL2phdmEvY29tL2ludGVsL2puZG4vdXRpbHMvY2xpZW50L2ltcGwvRGVmYXVsdFNlZ21lbnRlZENsaWVudC5qYXZhCkBAIC0wLDAgKzEsMTQ5IEBACisvKgorICogam5kbi11dGlscworICogQ29weXJpZ2h0IChjKSAyMDE1LCBJbnRlbCBDb3Jwb3JhdGlvbi4KKyAqCisgKiBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdAorICogdW5kZXIgdGhlIHRlcm1zIGFuZCBjb25kaXRpb25zIG9mIHRoZSBHTlUgTGVzc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jb21wb25lbnQKKyAgICAgIGVuZCA9IDA7CisgICAgfSAvLyB3aXRoIHNlZ21lbnQgY29tcG9uZW50CisgICAgZWxzZSB7CisgICAgICBOYW1lLkNvbXBvbmVudCBsYXN0Q29tcG9uZW50ID0gZGF0YS5nZXROYW1lKCkuZ2V0KC0xKTsKKyAgICAgIHRyeSB7CisgICAgICAgIGlkID0gbGFzdENvbXBvbmVudC50b051bWJlcldpdGhNYXJrZXIoUEFSVElUSU9OX01BUktFUik7CisgICAgICAgIHBhY2tldHMucHV0KGlkLCBkYXRhKTsKKyAgICAgIH0gY2F0Y2ggKEVuY29kaW5nRXhjZXB0aW9uIGV4KSB7CisgICAgICAgIG9uRXhjZXB0aW9uKGV4KTsKKyAgICAgICAgcmV0dXJuOworICAgICAgfQorICAgIH0KKworICAgIGlmIChoYXNGaW5hbEJsb2NrSWQoZGF0YSkpIHsKKyAgICAgIHRyeSB7CisgICAgICAgIGVuZCA9IGRhdGEuZ2V0TWV0YUluZm8oKS5nZXRGaW5hbEJsb2NrSWQoKS50b051bWJlcldpdGhNYXJrZXIoUEFSVElUSU9OX01BUktFUik7CisgICAgICB9IGNhdGNoIChFbmNvZGluZ0V4Y2VwdGlvbiBleCkgeworICAgICAgICBvbkV4Y2VwdGlvbihleCk7CisgICAgICB9CisgICAgfQorCisgICAgLy8gY2FsbCBkYXRhIG9ic2VydmVycworICAgIGlmIChpc05leHRQYWNrZXQoaWQpKSB7CisgICAgICBkbyB7CisgICAgICAgIGN1cnJlbnQrKzsKKyAgICAgICAgYXNzZXJ0IChwYWNrZXRzLmNvbnRhaW5zS2V5KGN1cnJlbnQpKTsKKyAgICAgICAgRGF0YSByZXRyaWV2ZWQgPSBwYWNrZXRzLmdldChjdXJyZW50KTsKKyAgICAgICAgb2JzZXJ2ZXJzT2ZUeXBlKE9uRGF0YS5jbGFzcykuc3RyZWFtKCkuZm9yRWFjaCgoT25EYXRhIGNiKSAtPiB7CisgICAgICAgICAgY2Iub25EYXRhKGludGVyZXN0LCByZXRyaWV2ZWQpOworICAgICAgICB9KTsKKyAgICAgIH0gd2hpbGUgKGhhc05leHRQYWNrZXQoKSk7CisgICAgfQorCisgICAgLy8gY2FsbCBjb21wbGV0aW9uIG9ic2VydmVycworICAgIGlmIChpc0NvbXBsZXRlKCkpIHsKKyAgICAgIG9uQ29tcGxldGUoKTsKKyAgICB9CisgIH0KKworICBwcml2YXRlIGJvb2xlYW4gaGFzRmluYWxCbG9ja0lkKERhdGEgZGF0YSkgeworICAgIHJldHVybiBkYXRhLmdldE1ldGFJbmZvKCkuZ2V0RmluYWxCbG9ja0lkKCkuZ2V0VmFsdWUoKS5zaXplKCkgPiAwOworICB9CisKKyAgcHJpdmF0ZSBib29sZWFuIGlzTmV4dFBhY2tldChsb25nIGlkKSB7CisgICAgcmV0dXJuIGN1cnJlbnQgKyAxID09IGlkOworICB9CisKKyAgcHJpdmF0ZSBib29sZWFuIGhhc05leHRQYWNrZXQoKSB7CisgICAgcmV0dXJuIHBhY2tldHMuY29udGFpbnNLZXkoY3VycmVudCArIDEpOworICB9CisKKyAgQE92ZXJyaWRlCisgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBvbkNvbXBsZXRlKCkgeworICAgIG9ic2VydmVyc09mVHlwZShPbkNvbXBsZXRlLmNsYXNzKS5zdHJlYW0oKS5mb3JFYWNoKChPbkNvbXBsZXRlIGNiKSAtPiB7CisgICAgICBjYi5vbkNvbXBsZXRlKCk7CisgICAgfSk7CisgIH0KKworICBAT3ZlcnJpZGUKKyAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIG9uVGltZW91dChJbnRlcmVzdCBpbnRlcmVzdCkgeworICAgIG9ic2VydmVyc09mVHlwZShPblRpbWVvdXQuY2xhc3MpLnN0cmVhbSgpLmZvckVhY2goKE9uVGltZW91dCBjYikgLT4geworICAgICAgY2Iub25UaW1lb3V0KGludGVyZXN0KTsKKyAgICB9KTsKKyAgfQorCisgIEBPdmVycmlkZQorICBwdWJsaWMg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HRpb24gewogICAgIENvbXBsZXRhYmxlRnV0dXJlPERhdGE+IGZ1dHVyZSA9IGdldEFzeW5jKGZhY2UsIGludGVyZXN0KTsKKwogICAgIHRyeSB7CiAgICAgICAvLyBwcm9jZXNzIGV2ZW50cyB1bnRpbCBjb21wbGV0ZQogICAgICAgd2hpbGUgKCFmdXR1cmUuaXNEb25lKCkpIHsKICAgICAgICAgc3luY2hyb25pemVkIChmYWNlKSB7CiAgICAgICAgICAgZmFjZS5wcm9jZXNzRXZlbnRzKCk7CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgaWYgKHNsZWVwVGltZSA+IDApIHsKLSAgICAgICAgICB0cnl7CisgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgIFRocmVhZC5zbGVlcChzbGVlcFRpbWUpOwotICAgICAgICAgIH0KLSAgICAgICAgICBjYXRjaChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKXsKKyAgICAgICAgICB9IGNhdGNoIChJbnRlcnJ1cHRlZEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICBUaHJlYWQuY3VycmVudFRocmVhZCgpLmludGVycnVwdCgpOwogICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMTUwLDExICsxNTIsMTEgQEAKICAgfQogCiAgIC8qKgotICAgKiBDcmVhdGUgYSBkZWZhdWx0IGludGVyZXN0IGZvciBhIGdpdmVuIE5hbWUgdXNpbmcgc29tZSBjb21tb24gc2V0dGluZ3M6IC0KLSAgICogbGlmZXRpbWU6IDIgc2Vjb25kcworICAgKiBDcmVhdGUgYSBkZWZhdWx0IGludGVyZXN0IGZvciBhIGdpdmVuIHtAbGluayBOYW1lfSB1c2luZyB0aGUgY2xpZW50J3MKKyAgICogcGFzc2VkIHNldHRpbmdzIChzZWUge0BsaW5rICNTaW1wbGVDbGllbnQobG9uZywgbG9uZyl9KQogICAgKgotICAgKiBAcGFyYW0gbmFtZQotICAgKiBAcmV0dXJuCisgICAqIEBwYXJhbSBuYW1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KKyAgfQorCisgIHByaXZhdGUgY2xhc3MgQWR2YW5jZWREYXRhU2VydmVyIGltcGxlbWVudHMgT25JbnRlcmVzdENhbGxiYWNrIHsKKworICAgIHByaXZhdGUgZmluYWwgaW50IGNvbnRlbnRTaXplOworICAgIHByaXZhdGUgZmluYWwgaW50IHNlZ21lbnRTaXplOworCisgICAgcHVibGljIEFkdmFuY2VkRGF0YVNlcnZlcihpbnQgY29udGVudFNpemUsIGludCBzZWdtZW50U2l6ZSkgeworICAgICAgdGhpcy5jb250ZW50U2l6ZSA9IGNvbnRlbnRTaXplOworICAgICAgdGhpcy5zZWdtZW50U2l6ZSA9IHNlZ21lbnRTaXplOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9uSW50ZXJlc3QoTmFtZSBwcmVmaXgsIEludGVyZXN0IGludGVyZXN0LCBGYWNlIGZhY2UsIGxvbmcgaW50ZXJlc3RGaWx0ZXJJZCwgSW50ZXJlc3RGaWx0ZXIgZmlsdGVyKSB7CisgICAgICAvLyBpZ25vcmUgc2VnbWVudGVkIHJlcXVlc3RzLCB0aGUgZGF0YSBoYXMgYWxyZWFkeSBiZWVuIHB1dCBiZWxvdworICAgICAgaWYgKFNlZ21lbnRhdGlvbkhlbHBlci5pc1NlZ21lbnRlZChpbnRlcmVzdC5nZXROYW1lKCksIChieXRlKSAweDAwKSkgeworICAgICAgICByZXR1cm47CisgICAgICB9CisgICAgICAKKyAgICAgIC8vIHJhbmRvbWx5IGlnbm9yZSAxMCUgb2YgcmVxdWVzdHMKKyAgICAgIGlmIChuZXcgUmFuZG9tKCkubmV4dEludCgxMCkgPCAyKXsKKyAgICAgICAgbG9nZ2VyLmluZm8oIlNraXBwaW5nIGFuIGludGVyZXN0OiAiICsgaW50ZXJlc3QudG9VcmkoKSk7CisgICAgICAgIHJldHVybjsKKyAgICAgIH0KKworICAgICAgQnl0ZUFycmF5SW5wdXRTdHJlYW0gYnl0ZXMgPSBuZXcgQnl0ZU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