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wogICAgICAgfQogICAgIH0KIAorICAgIC8qKgorICAgICAqIHtAaW5oZXJpdERvY30KKyAgICAgKi8KICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBwcm9jZXNzRXZlbnRzKCkgdGhyb3dzIElPRXhjZXB0aW9uLCBFbmNvZGluZ0V4Y2VwdGlvbiB7CiAgICAgICBpZiAoIWdldElzQ29ubmVjdGVkKCkpIHsKQEAgLTI1NSw5ICsyODgsOSBAQAogCiAgICAgICB3aGlsZSAodHJ1ZSkgewogICAgICAgICBCeXRlQnVmZmVyIGJsb2NrID0gbnVsbDsKLSAgICAgICAgc3luY2hyb25pemVkIChtX3JlY3ZCdWZmZXIpIHsKLSAgICAgICAgICBpZiAoIW1fcmVjdkJ1ZmZlci5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgIGJsb2NrID0gbV9yZWN2QnVmZmVyLnJlbW92ZSgwKTsKKyAgICAgICAgc3luY2hyb25pemVkIChyZWNlaXZlQnVmZmVyKSB7CisgICAgICAgICAgaWYgKCFyZWNlaXZlQnVmZmVyLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgYmxvY2sgPSByZWNlaXZlQnVmZmVyLnJlbW92ZSgwKTsKICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgaWYgKGJsb2NrID09IG51bGwpIHsKQEAgLTI2Nyw2OSArMzAwLDY2IEBACiAgICAgICB9CiAgICAgfQogCisgICAgLyoqCisgICAgICoge0Bpbmhlcml0RG9jfQorICAgICAqLwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIGdldElzQ29ubmVjdGVkKCkgewogICAgICAgcmV0dXJuIGNvbm5lY3RlZDsKICAgICB9CiAKKyAgICAvKioKKyAgICAgKiB7QGluaGVyaXREb2N9CisgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgY2xvc2UoKSB0aHJvd3MgSU9FeGNlcHRpb24gewogICAgICAgbG9nZ2VyLmZpbmUo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