auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; boolean recreatePage = false; for (AbstractTaskEditorPart part : parts) { boolean hasIncomingChanges = part.hasIncomingChanges(); if (hasIncomingChanges && !part.supportsRefreshing()) { recreatePage = true; break; } else if (hasIncomingChanges) { part.refresh(); } } if (recreatePage) { Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); for (Control control : editorComposite.getChildren()) { control.dispose(); } for (AbstractTaskEditorPart part : parts) { part.dispose(); getManagedForm().removePart(part); } parts.clear(); editorComposite.setMenu(menu); createFormContentInternal(); } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }

Target:
public void refresh() { if (getManagedForm() == null || getManagedForm().getForm().isDisposed()) { return; } try { showEditorBusy(true); boolean hasIncoming = false; if (getTask() != null) { hasIncoming = getTask().getSynchronizationState().isIncoming(); } if (model != null) { doSave(new NullProgressMonitor()); refreshInput(); } else { initModel(getTaskEditor().getTaskEditorInput()); } if (taskData != null) { try { setReflow(false); if (focusTracker != null) { focusTracker.reset(); } lastSelection = null; boolean recreatePage = false; for (AbstractTaskEditorPart part : parts) { if (part.hasIncomingChanges()) { if (!part.supportsRefreshing()) { recreatePage = true; break; } else { part.refresh(); } } } if (recreatePage) { Menu menu = editorComposite.getMenu(); CommonUiUtil.setMenu(editorComposite, null); for (Control control : editorComposite.getChildren()) { control.dispose(); } for (AbstractTaskEditorPart part : parts) { part.dispose(); getManagedForm().removePart(part); } parts.clear(); editorComposite.setMenu(menu); createFormContentInternal(); } getTaskEditor().setMessage(null, 0); if (hasIncoming) { getTaskEditor().setActivePage(getId()); } setSubmitEnabled(true); } finally { setReflow(true); } } updateOutlinePage(); updateHeaderMessage(); getManagedForm().dirtyStateChanged(); getTaskEditor().updateHeaderToolBar(); } finally { showEditorBusy(false); } reflow(); }
Source:
private void printAllProvidedServices(StringBuilder buf, boolean detail) { boolean printHeader = true; for (ProviderModel provider : ApplicationModel.allProviderModels()) { if (printHeader) { buf.append("PROVIDER:\r\n"); printHeader = false; } buf.append(provider.getServiceName()); if (detail) { buf.append(" -> "); buf.append(" published: "); buf.append(isRegistered(provider.getServiceName()) ? "Y" : "N"); } buf.append("\r\n"); } }

Target:
private void printAllProvidedServices(StringBuilder buf, boolean detail) { if (!ApplicationModel.allProviderModels().isEmpty()) { buf.append("PROVIDER:\r\n"); } for (ProviderModel provider : ApplicationModel.allProviderModels()) { buf.append(provider.getServiceName()); if (detail) { buf.append(" -> "); buf.append(" published: "); buf.append(isRegistered(provider.getServiceName()) ? "Y" : "N"); } buf.append("\r\n"); } }
Source:
public final void wrapEditXmlModel(Runnable editAction) { IStructuredModel model = null; try { if (mIsEditXmlModelPending == 0) { model = getModelForEdit(); model.aboutToChangeModel(); } mIsEditXmlModelPending++; editAction.run(); } finally { mIsEditXmlModelPending--; if (model != null) { model.changedModel(); model.releaseFromEdit(); } } }

Target:
public final void wrapEditXmlModel(Runnable editAction) { IStructuredModel model = null; try { if (mIsEditXmlModelPending == 0) { try { model = getModelForEdit(); model.aboutToChangeModel(); } catch (Throwable t) { AdtPlugin.log(t, "XML Editor failed to get model to edit"); return; } } mIsEditXmlModelPending++; editAction.run(); } finally { mIsEditXmlModelPending--; if (model != null) { model.changedModel(); model.releaseFromEdit(); if (mIsEditXmlModelPending < 0) { AdtPlugin.log(IStatus.ERROR, "wrapEditXmlModel finished with invalid nested counter==%d", mIsEditXmlModelPending); mIsEditXmlModelPending = 0; } } } }
Source:
public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { try { HttpUrl.Builder url = HttpUrl.get(details.uri).newBuilder(); if (services != 0) url.addQueryParameter("srvmask", Long.toString(services)); Request.Builder request = new Request.Builder(); request.url(url.build()); request.addHeader("User-Agent", VersionMessage.LIBRARY_SUBVER); log.info("Requesting seeds from {}", url); Response response = client.newCall(request.build()).execute(); if (!response.isSuccessful()) throw new PeerDiscoveryException("HTTP request failed: " + response.code() + " " + response.message()); InputStream stream = response.body().byteStream(); GZIPInputStream zip = new GZIPInputStream(stream); PeerSeedProtos.SignedPeerSeeds proto; try { proto = PeerSeedProtos.SignedPeerSeeds.parseDelimitedFrom(zip); } catch (IOException ioe){ zip.close(); throw ioe; } if (zip != null){ zip.close(); } return protoToAddrs(proto); } catch (PeerDiscoveryException e1) { throw e1; } catch (Exception e) { throw new PeerDiscoveryException(e); } }

Target:
public InetSocketAddress[] getPeers(long services, long timeoutValue, TimeUnit timeoutUnit) throws PeerDiscoveryException { try { HttpUrl.Builder url = HttpUrl.get(details.uri).newBuilder(); if (services != 0) url.addQueryParameter("srvmask", Long.toString(services)); Request.Builder request = new Request.Builder(); request.url(url.build()); request.addHeader("User-Agent", VersionMessage.LIBRARY_SUBVER); log.info("Requesting seeds from {}", url); Response response = client.newCall(request.build()).execute(); if (!response.isSuccessful()) throw new PeerDiscoveryException("HTTP request failed: " + response.code() + " " + response.message()); InputStream stream = response.body().byteStream(); GZIPInputStream zip = new GZIPInputStream(stream); PeerSeedProtos.SignedPeerSeeds proto; try { proto = PeerSeedProtos.SignedPeerSeeds.parseDelimitedFrom(zip); } finally { zip.close(); } return protoToAddrs(proto); } catch (PeerDiscoveryException e1) { throw e1; } catch (Exception e) { throw new PeerDiscoveryException(e); } }
Source:
public void freeRevocable(QueryId queryId, long bytes) { checkArgument(bytes >= 0, "bytes is negative"); checkArgument(reservedRevocableBytes >= bytes, "tried to free more revocable memory than is reserved"); if (bytes == 0) { return; } Long queryReservation = queryMemoryRevocableReservations.get(queryId); requireNonNull(queryReservation, "queryReservation is null"); checkArgument(queryReservation - bytes >= 0, "tried to free more revocable memory than is reserved by query"); queryReservation -= bytes; if (queryReservation == 0) { queryMemoryRevocableReservations.remove(queryId, queryReservation); } else { queryMemoryRevocableReservations.put(queryId, queryReservation); } synchronized (this) { reservedRevocableBytes -= bytes; if (getFreeBytes() > 0 && future != null) { future.set(null); future = null; } } }

Target:
public void freeRevocable(QueryId queryId, long bytes) { checkArgument(bytes >= 0, "bytes is negative"); checkArgument(reservedRevocableBytes >= bytes, "tried to free more revocable memory than is reserved"); if (bytes == 0) { return; } Long queryReservation = queryMemoryRevocableReservations.merge(queryId, -bytes, Long::sum); checkArgument(queryReservation != -bytes, "queryId does not exist in queryMemoryRevocableReservations"); checkArgument(queryReservation >= 0, "tried to free more revocable memory than is reserved by query"); if (queryReservation == 0) { queryMemoryRevocableReservations.remove(queryId, queryReservation); } synchronized (this) { reservedRevocableBytes -= bytes; if (getFreeBytes() > 0 && future != null) { future.set(null); future = null; } } }
Source:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); } Properties prop = CoreUtil.loadProperties(ExtensionsToolExecutor.class); ParametersParser parser = new ParametersParser(prop); Map<String, Object> argMap = parser.parse(args); return argMap; }

Target:
private static Map<String, Object> parseArgs(String[] args) throws Exception { if(args.length < 1) { throw new IllegalArgumentException("Please provide module. To list existing modules use --help argument."); } return new ParametersParser( CoreUtil.loadProperties(ExtensionsToolExecutor.class, "arguments.properties"), CoreUtil.loadProperties(ExtensionsToolExecutor.class, "defaults.properties") ).parse(args); }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (getUsername().isEmpty()) { throw new LoginException(res.getText(R.string.invalid_card_number).toString()); } urlopen = login(); Document d = Jsoup.parse(response); Element e = d.getElementById("cphMain_lblAmount"); if (e == null) { throw new BankException( res.getText(R.string.unable_to_find).toString() + res.getText(R.string.balance).toString()); } BigDecimal b = Helpers.parseBalance(e.text()); e = d.getElementById("lblCardName"); String name = "HÖRS"; if (e != null) { name = e.text(); if (this.getCustomName().isEmpty()) { this.setCustomName(name); } } Account a = new Account(name, b, "0"); accounts.add(a); balance = balance.add(a.getBalance()); d = Jsoup.parse(urlopen.open("<LINK_0>")); Elements es = d.select("tr"); List<Transaction> transactions = new ArrayList<Transaction>(); if (es != null) { for (Element el : es) { transactions.add( new Transaction(el.child(0).text().trim(), el.child(1).text().trim(), Helpers.parseBalance(el.child(2).text()))); } } a.setTransactions(transactions); if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); urlopen = login(); Document document = Jsoup.parse(response); Element balanceElement = document.getElementById("cphMain_lblAmount"); if (balanceElement == null) { throw new BankException( res.getText(R.string.unable_to_find).toString() + res.getText(R.string.balance).toString()); } Element nameElement = document.getElementById("lblCardName"); String accountName = nameElement == null ? NAME.toUpperCase() : nameElement.text(); if (this.getCustomName().isEmpty()) { this.setCustomName(accountName); } Account account = new Account(accountName, Helpers.parseBalance(balanceElement.text()), "0"); accounts.add(account); balance = balance.add(account.getBalance()); document = Jsoup.parse(urlopen.open("<LINK_0>")); Elements transactionElements = document.select("tr"); List<Transaction> transactions = new ArrayList<Transaction>(); if (transactionElements != null) { for (Element element : transactionElements) { transactions.add(asTransaction(element)); } } account.setTransactions(transactions); super.updateComplete(); }
Source:
private void checkSuccessfulClientStart(String[] cipherSuites, String[] protocols) throws Exception { this.cipherSuites = F.isEmpty(cipherSuites) ? null : cipherSuites; this.protocols = F.isEmpty(protocols) ? null : protocols; IgniteClient client = Ignition.startClient(getClientConfiguration()); client.getOrCreateCache(TEST_CACHE_NAME); client.close(); }

Target:
private void checkSuccessfulClientStart(String[] cipherSuites, String[] protocols) throws Exception { this.cipherSuites = F.isEmpty(cipherSuites) ? null : cipherSuites; this.protocols = F.isEmpty(protocols) ? null : protocols; try (IgniteClient client = Ignition.startClient(getClientConfiguration())) { client.getOrCreateCache(TEST_CACHE_NAME); } }
Source:
Proverb(String[] words) { this.words = words; }

Target:
Proverb(String[] words) { throw new UnsupportedOperationException("Delete this statement and write your own implementation."); }
Source:
@Test public void getWithNonStringUrlThrows() { class Example { @GET Call<Object> method(@Url Object url) { return null; } } try { buildRequest(Example.class, "foo/bar"); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }

Target:
@Test public void getWithNonStringUrlThrows() { class Example { @GET Call<Object> method(@Url Object url) { return null; } } try { buildRequest(Example.class, "foo/bar"); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("@Url must be String type. (parameter #1)\n" + " for method Example.method"); } }
Source:
public void updateVendorUpdatesStatusInPaymentWorks(List<PaymentWorksUpdateVendorStatus> paymentWorksUpdateVendorStatus) { String jsonString = new PaymentWorksUtil().pojoToJsonString(paymentWorksUpdateVendorStatus); Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_UPDATE_STATUS)).toString(); ClientResponse response = client.handle(buildClientRequest(URL, jsonString)); LOG.debug("Status: " + response.getStatus()); if (response.getStatus() == 200) { LOG.debug("Vendor Update status updated"); } else { LOG.error("Failed to update Vendor Update status: " + response.getEntity(String.class)); } }

Target:
public void updateVendorUpdatesStatusInPaymentWorks( List<PaymentWorksUpdateVendorStatus> paymentWorksUpdateVendorStatus) { String jsonString = getPaymentWorksUtilityService().pojoToJsonString(paymentWorksUpdateVendorStatus); Client client = buildClient(); String URL = (new StringBuilder(getPaymentworksApiUrl()).append(NEW_VENDOR_REQUEST_UPDATE_STATUS)).toString(); ClientResponse response = client.handle(buildClientRequest(URL, jsonString)); if (response.getStatus() == HttpURLConnection.HTTP_OK) { LOG.debug("Vendor Update status updated"); } else { LOG.error("Failed to update Vendor Update status: " + response.getEntity(String.class)); throw new RuntimeException("Unable to update vendor status in PaymentWorks"); } }
Source:
public CloseableHttpClient build() { org.apache.http.impl.client.HttpClientBuilder httpClientBuilder = createHttpClientBuilder(); boolean acceptAnyCertificate = false; boolean acceptAnyHostname = false; if (useSystemProperties) { httpClientBuilder.useSystemProperties(); String property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_CERTIFICATE); if ("true".equalsIgnoreCase(property)) { acceptAnyCertificate = true; } property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_HOSTNAME); if ("true".equalsIgnoreCase(property)) { acceptAnyHostname = true; } } if (allowAnyHostname != null) { if (allowAnyHostname) { acceptAnyHostname = true; } else { acceptAnyHostname = false; } } if (allowAnyCertificate != null) { if (allowAnyCertificate) { acceptAnyCertificate = true; } else { acceptAnyCertificate = false; } } if (acceptAnyCertificate) { httpClientBuilder.setSslcontext(createSslContext()); } if (acceptAnyHostname) { httpClientBuilder.setHostnameVerifier(SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } if (maxConnections > 0) { httpClientBuilder.setMaxConnPerRoute(maxConnections); httpClientBuilder.setMaxConnTotal(maxConnections); } if (requestConfig != null) { httpClientBuilder.setDefaultRequestConfig(requestConfig); } if (!useContentCompression) { httpClientBuilder.disableContentCompression(); } httpClientBuilder.setUserAgent("ProActive"); return httpClientBuilder.build(); }

Target:
public CloseableHttpClient build() { org.apache.http.impl.client.HttpClientBuilder internalHttpClientBuilder = createInternalHttpClientBuilder(); boolean acceptAnyCertificate = false; boolean acceptAnyHostname = false; if (useSystemProperties) { internalHttpClientBuilder.useSystemProperties(); String property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_CERTIFICATE); if ("true".equalsIgnoreCase(property)) { acceptAnyCertificate = true; } property = System.getProperty(WebProperties.WEB_HTTPS_ALLOW_ANY_HOSTNAME); if ("true".equalsIgnoreCase(property)) { acceptAnyHostname = true; } } if (allowAnyHostname != null) { if (allowAnyHostname) { acceptAnyHostname = true; } else { acceptAnyHostname = false; } } if (allowAnyCertificate != null) { if (allowAnyCertificate) { acceptAnyCertificate = true; } else { acceptAnyCertificate = false; } } if (acceptAnyCertificate) { internalHttpClientBuilder.setSslcontext(createSslContext()); } if (acceptAnyHostname) { internalHttpClientBuilder.setHostnameVerifier( SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); } if (maxConnections > 0) { internalHttpClientBuilder.setMaxConnPerRoute(maxConnections); internalHttpClientBuilder.setMaxConnTotal(maxConnections); } if (requestConfig != null) { internalHttpClientBuilder.setDefaultRequestConfig(requestConfig); } if (!useContentCompression) { internalHttpClientBuilder.disableContentCompression(); } return internalHttpClientBuilder.build(); }
Source:
public String initializeProperties(String formName, PropertiesDto propertiesContainer) { Properties properties = propertiesHelpers.propertiesFromDto(propertiesContainer); properties.refreshLayout(properties.getForm(formName)); return properties == null ? "{}" : jsonSerializationHelper.toJson(formName, properties); }

Target:
public String initializeProperties(String formName, PropertiesDto propertiesContainer) { Properties properties = propertiesHelpers.propertiesFromDto(propertiesContainer); if (properties == null) { return "{}"; } properties.refreshLayout(properties.getForm(formName)); return jsonSerializationHelper.toJson(formName, properties); }
Source:
protected void onPostExecute(Void aVoid) { if (mApi == null) { mApi = new RestApi(SyncthingService.this, mConfig.getWebGuiUrl(), mConfig.getApiKey(), SyncthingService.this::onApiAvailable, () -> onServiceStateChange(mCurrentState)); Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl()); } if (mSyncthingRunnable != null || mSyncthingRunnableThread != null) { Log.e(TAG, "StartupTask/onPostExecute: Syncthing binary lifecycle violated"); } mSyncthingRunnable = new SyncthingRunnable(SyncthingService.this, SyncthingRunnable.Command.main); mSyncthingRunnableThread = new Thread(mSyncthingRunnable); mSyncthingRunnableThread.start(); if (mPollWebGuiAvailableTask == null) { mPollWebGuiAvailableTask = new PollWebGuiAvailableTask( SyncthingService.this, getWebGuiUrl(), mConfig.getApiKey(), result -> { Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl()); if (mApi != null) { mApi.readConfigFromRestApi(); } }); } }

Target:
protected void onPostExecute(Void aVoid) { if (mApi == null) { mApi = new RestApi(SyncthingService.this, mConfig.getWebGuiUrl(), mConfig.getApiKey(), SyncthingService.this::onApiAvailable, () -> onServiceStateChange(mCurrentState)); Log.i(TAG, "Web GUI will be available at " + mConfig.getWebGuiUrl()); } if (mSyncthingRunnable != null || mSyncthingRunnableThread != null) { Log.e(TAG, "StartupTask/onPostExecute: Syncthing binary lifecycle violated"); return; } mSyncthingRunnable = new SyncthingRunnable(SyncthingService.this, SyncthingRunnable.Command.main); mSyncthingRunnableThread = new Thread(mSyncthingRunnable); mSyncthingRunnableThread.start(); if (mPollWebGuiAvailableTask == null) { mPollWebGuiAvailableTask = new PollWebGuiAvailableTask( SyncthingService.this, getWebGuiUrl(), mConfig.getApiKey(), result -> { Log.i(TAG, "Web GUI has come online at " + mConfig.getWebGuiUrl()); if (mApi != null) { mApi.readConfigFromRestApi(); } }); } }
Source:
public SliceDictionarySelectiveReader(StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "streamDescriptor is null"); this.filter = requireNonNull(filter, "filter is null").orElse(null); this.systemMemoryContext = systemMemoryContext; this.nonDeterministicFilter = this.filter != null && !this.filter.isDeterministic(); this.nullsAllowed = this.filter == null || nonDeterministicFilter || this.filter.testNull(); this.outputType = requireNonNull(outputType, "outputType is null").orElse(null); this.outputRequired = outputType.isPresent(); if (!outputRequired) { checkState(filter != null, "filter should be present if output is not required"); } }

Target:
public SliceDictionarySelectiveReader(StreamDescriptor streamDescriptor, Optional<TupleDomainFilter> filter, Optional<Type> outputType, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "streamDescriptor is null"); this.filter = requireNonNull(filter, "filter is null").orElse(null); this.systemMemoryContext = systemMemoryContext; this.nonDeterministicFilter = this.filter != null && !this.filter.isDeterministic(); this.nullsAllowed = this.filter == null || nonDeterministicFilter || this.filter.testNull(); this.outputType = requireNonNull(outputType, "outputType is null").orElse(null); OrcType orcType = streamDescriptor.getOrcType(); this.maxCodePointCount = orcType == null ? 0 : orcType.getLength().orElse(-1); this.isCharType = orcType.getOrcTypeKind() == CHAR; this.outputRequired = outputType.isPresent(); checkArgument(filter.isPresent() || outputRequired, "filter must be present if outputRequired is false"); }
Source:
private void syncLunsForBlockStorageDomains() { if (getOldStoragePool().getCompatibilityVersion().lessOrEquals(Version.v4_0) && getStoragePool().getCompatibilityVersion().greaterOrEquals(Version.v4_1)) { Collection<StorageDomain> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId())); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(StorageDomain::getId) .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } } }

Target:
private void syncLunsForBlockStorageDomains() { if (!FeatureSupported.discardAfterDeleteSupported(getOldStoragePool().getCompatibilityVersion()) && FeatureSupported.discardAfterDeleteSupported(getStoragePool().getCompatibilityVersion())) { Collection<Guid> unSyncedStorageDomains = syncLunsForStorageDomains(storageDomainDao.getAllForStoragePool(getStoragePoolId())); if (!unSyncedStorageDomains.isEmpty()) { String unSyncedStorageDomainsList = unSyncedStorageDomains.stream() .map(Guid::toString) .collect(Collectors.joining(", ")); addCustomValue("StorageDomainsIds", unSyncedStorageDomainsList); auditLogDirector.log(this, AuditLogType.STORAGE_DOMAINS_COULD_NOT_BE_SYNCED); } } }
Source:
public Spec acl() { try { return new Spec.Simple( new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/stand/acl/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public Spec acl() { try { return new Spec.Simple( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/stand/acl/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public File takeScreenshot(Driver driver, WebElement element) { try { BufferedImage destination = takeScreenshotAsImage(driver, element); return writeToFile(driver, destination); } catch (IOException e) { log.error("Failed to take screenshot of " + element, e); return null; } }

Target:
public File takeScreenshot(Driver driver, WebElement element) { try { BufferedImage destination = takeScreenshotAsImage(driver, element); return writeToFile(driver, destination); } catch (IOException e) { log.error("Failed to take screenshot of {}", element, e); return null; } }
Source:
protected void inputChanged(Object input, Object oldInput) { elements.clear(); Object[] children = getSortedChildren(getRoot()); list.removeAll(); for (Object element : children) { elements.add(element); mapElement(element, list); } list.setElements(children); }

Target:
protected void inputChanged(Object input, Object oldInput) { elements.clear(); Object[] children = getSortedChildren(getRoot()); list.removeAll(); for (Object child : children) { elements.add(child); mapElement(child, list); } list.setElements(children); }
Source:
public static Link valueOf(String element) { if (!StringUtils.hasText(element)) { return null; } Pattern uriAndAttributes = Pattern.compile("<(.*)>;(.*)"); Matcher matcher = uriAndAttributes.matcher(element); if (matcher.find()) { Map<String, String> attributes = getAttributeMap(matcher.group(2)); if (!attributes.containsKey("rel")) { throw new IllegalArgumentException("Link does not provide a rel attribute!"); } Set<String> unrecognizedHeaders = unrecognizedHeaders(attributes); if (!unrecognizedHeaders.isEmpty()) { throw new IllegalArgumentException("Link contains invalid RFC5988 headers! => " + unrecognizedHeaders); } Link link = new Link(matcher.group(1), attributes.get("rel")); if (attributes.containsKey("hreflang")) { link = link.withHreflang(attributes.get("hreflang")); } if (attributes.containsKey("media")) { link = link.withMedia(attributes.get("media")); } if (attributes.containsKey("title")) { link = link.withTitle(attributes.get("title")); } if (attributes.containsKey("type")) { link = link.withType(attributes.get("type")); } if (attributes.containsKey("deprecation")) { link = link.withDeprecation(attributes.get("deprecation")); } return link; } else { throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); } }

Target:
public static Link valueOf(String element) { if (!StringUtils.hasText(element)) { return null; } Pattern uriAndAttributes = Pattern.compile("<(.*)>;(.*)"); Matcher matcher = uriAndAttributes.matcher(element); if (matcher.find()) { Map<String, String> attributes = getAttributeMap(matcher.group(2)); if (!attributes.containsKey("rel")) { throw new IllegalArgumentException("Link does not provide a rel attribute!"); } Link link = new Link(matcher.group(1), attributes.get("rel")); if (attributes.containsKey("hreflang")) { link = link.withHreflang(attributes.get("hreflang")); } if (attributes.containsKey("media")) { link = link.withMedia(attributes.get("media")); } if (attributes.containsKey("title")) { link = link.withTitle(attributes.get("title")); } if (attributes.containsKey("type")) { link = link.withType(attributes.get("type")); } if (attributes.containsKey("deprecation")) { link = link.withDeprecation(attributes.get("deprecation")); } return link; } else { throw new IllegalArgumentException(String.format("Given link header %s is not RFC5988 compliant!", element)); } }
Source:
void removeRemoteReplicaInfo(RemoteReplicaInfo remoteReplicaInfo) { lock.lock(); replicaLazyRemoveSet.add(remoteReplicaInfo); lock.unlock(); logger.trace("RemoteReplicaInfo scheduled to be removed from ReplicaThread {}.", remoteReplicaInfo, threadName); }

Target:
void removeRemoteReplicaInfo(RemoteReplicaInfo remoteReplicaInfo) { lock.lock(); try { DataNodeId dataNodeId = remoteReplicaInfo.getReplicaId().getDataNodeId(); Set<RemoteReplicaInfo> remoteReplicaInfos = replicasToReplicateGroupedByNode.get(dataNodeId); if (remoteReplicaInfos != null) { if (!remoteReplicaInfos.remove(remoteReplicaInfo)) { replicationMetrics.remoteReplicaInfoRemoveError.inc(); logger.error("ReplicaThread: {}, RemoteReplicaInfo not found.", threadName, remoteReplicaInfo); } } else { replicationMetrics.remoteReplicaInfoRemoveError.inc(); logger.error("ReplicaThread: {}, RemoteReplicaInfos Set is not created for DataNode {}, RemoteReplicaInfo: {}.", threadName, dataNodeId, remoteReplicaInfo); } } finally { lock.unlock(); } logger.trace("RemoteReplicaInfo is removed from ReplicaThread {}.", remoteReplicaInfo, threadName); }
Source:
public int appendFromDirectly(byte[] byteArray, int offset, int length) throws IOException { if (!fileChannel.isOpen()) { throw new ClosedChannelException(); } if (endOffset.get() + length > capacityInBytes) { metrics.overflowWriteError.inc(); throw new IllegalArgumentException( "Channel cannot be written to segment [" + file.getAbsolutePath() + "] because" + " it exceeds the capacity [" + capacityInBytes + "]"); } else { try (DirectRandomAccessFile directFile = new DirectRandomAccessFile(file, "rw", 2 * 1024 * 1024)) { directFile.seek(endOffset.get()); directFile.write(byteArray, offset, length); } endOffset.addAndGet(length); return length; } }

Target:
int appendFromDirectly(byte[] byteArray, int offset, int length) throws IOException { if (!fileChannel.isOpen()) { throw new ClosedChannelException(); } validateAppendSize(length); try (DirectRandomAccessFile directFile = new DirectRandomAccessFile(file, "rw", 2 * 1024 * 1024)) { directFile.seek(endOffset.get()); directFile.write(byteArray, offset, length); endOffset.addAndGet(length); } return length; }
Source:
public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { int closedProcessorNum = 0; final Iterator<EventProcessor> iterator = eventProcessors.iterator(); while(iterator.hasNext()) { final EventProcessor eventProcessor = iterator.next(); try { eventProcessor.close(); } catch (Exception e) { e.printStackTrace(); } iterator.remove(); closedProcessorNum++; if (closedProcessorNum >= currentThreadNum - threadNum) { break; } } } }

Target:
public void adjustThreadNum(final int threadNum) { final int currentThreadNum = eventProcessors.size(); if (currentThreadNum <= threadNum) { addNewThreadsToSet(threadNum - currentThreadNum); } else if (currentThreadNum > threadNum) { int closedProcessorNum = 0; final Iterator<EventProcessor> iterator = eventProcessors.iterator(); while(iterator.hasNext()) { final EventProcessor eventProcessor = iterator.next(); eventProcessor.close(); iterator.remove(); closedProcessorNum++; if (closedProcessorNum >= currentThreadNum - threadNum) { break; } } } }
Source:
public void testScrollService() { assertNotNull(service); assertTrue(service.exists("default")); assertTrue(service.exists("static")); assertTrue(service.exists("repository")); assertFalse(service.exists("unknown")); }

Target:
public void testScrollService() { assertNotNull(service); assertTrue(service.exists(StaticScrollRequest.builder("").build())); assertTrue(service.exists(DocumentScrollRequest.builder("").build())); assertTrue(service.exists(DocumentScrollRequest.builder("").name("repository").build())); assertFalse(service.exists(DocumentScrollRequest.builder("").name("unknown").build())); }
Source:
public void init(FilterConfig filterConfig) throws ServletException { String filterName = filterConfig.getFilterName(); ObjectName name = null; try { name = new ObjectName(((Filter) this).getClass().getName(), "filterName", filterName); MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); platformMBeanServer.registerMBean(this, name); log.info("ThrottlingFilter MBean registered as {}.", name); } catch (MalformedObjectNameException e) { log.error("filter name is invalid as an MBean property.", filterName, e); } catch (InstanceAlreadyExistsException e) { log.error("MBean for {}} has already been registered.", filterName, e); } catch (NotCompliantMBeanException | MBeanRegistrationException e) { log.error("Could not register MBean for Filter {}.", filterName, e); } objectName = name; }

Target:
public void init(FilterConfig filterConfig) throws ServletException { String filterName = filterConfig.getFilterName(); ObjectName name = null; try { name = new ObjectName(this.getClass().getName(), "filterName", filterName); MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer(); platformMBeanServer.registerMBean(this, name); log.info("ThrottlingFilter MBean registered as {}.", name); } catch (MalformedObjectNameException e) { log.error("filter name is invalid as an MBean property.", filterName, e); } catch (InstanceAlreadyExistsException e) { log.error("MBean for {}} has already been registered.", filterName, e); } catch (NotCompliantMBeanException | MBeanRegistrationException e) { log.error("Could not register MBean for Filter {}.", filterName, e); } objectName = name; }
Source:
public static String getShortMessage() { return "Gradient too steep, changes too quickly"; }

Target:
public static String getShortMessage() { return "Changes too quickly"; }
Source:
public void theAuditTrailContainsMultipleRetryLogRecords(final Map<String, String> settings) throws Throwable { final String pattern = PATTERN_RETRY_OPERATION; final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); assertTrue("DeviceLogItems are not found in the database", this.responseNotifier.waitForLog(deviceIdentification, 1000, 600000)); final List<DeviceLogItem> deviceLogItems = this.deviceLogItemRepository .findByDeviceIdentification(deviceIdentification, new PageRequest(0, 2)).getContent(); for (int i = 0; i < deviceLogItems.size(); i++) { final DeviceLogItem item = deviceLogItems.get(i); LOGGER.info("CreationTime: {}", item.getCreationTime().toString()); LOGGER.info("DecodedMessage: {}", item.getDecodedMessage()); final boolean isMatchRetryOperation = Pattern.matches(pattern, item.getDecodedMessage()); assertTrue("No retry log item found.", isMatchRetryOperation); } }

Target:
public void theAuditTrailContainsMultipleRetryLogRecords(final Map<String, String> settings) throws Throwable { final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); assertTrue("DeviceLogItems are not found in the database", this.responseNotifier.waitForLog(deviceIdentification, 1000, 600000)); final List<DeviceLogItem> deviceLogItems = this.deviceLogItemRepository .findByDeviceIdentification(deviceIdentification, new PageRequest(0, 2)).getContent(); for (final DeviceLogItem deviceLogItem : deviceLogItems) { LOGGER.info("CreationTime: {}", deviceLogItem.getCreationTime().toString()); LOGGER.info("DecodedMessage: {}", deviceLogItem.getDecodedMessage()); final boolean isMatchRetryOperation = Pattern.matches(PATTERN_RETRY_OPERATION, deviceLogItem.getDecodedMessage()); assertTrue("No retry log item found.", isMatchRetryOperation); } }
Source:
public boolean isHealthy(ServiceEndPoint endPoint) { throw new RuntimeException("This should not get executed"); }

Target:
public boolean isHealthy(ServiceEndPoint endPoint) { throw new RuntimeException("isHealthy() should not get executed as part the performance test suite"); }
Source:
public void writeVersion(final String version) { if (null == version || version.isEmpty()) { return; } final XTextDocument document = odtEditor.getXTextDocument(); final XDocumentPropertiesSupplier xsDocProp = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); final XDocumentProperties props = xsDocProp.getDocumentProperties(); XPropertyContainer userDefined = props.getUserDefinedProperties(); try { userDefined.removeProperty(CustomFields.VERSION); } catch (UnknownPropertyException | NotRemoveableException e) { } try { userDefined.addProperty(CustomFields.VERSION, com.sun.star.beans.PropertyAttribute.REMOVABLE, version); } catch (IllegalArgumentException | PropertyExistException | IllegalTypeException e) { Activator.log.error(e); } }

Target:
public void writeVersion(final String version) { if (null == version || version.isEmpty()) { return; } final XTextDocument document = odtEditor.getXTextDocument(); final XDocumentPropertiesSupplier xsDocProp = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, document); final XDocumentProperties props = xsDocProp.getDocumentProperties(); XPropertyContainer userDefined = props.getUserDefinedProperties(); try { userDefined.removeProperty(CustomFields.VERSION); } catch (UnknownPropertyException | NotRemoveableException e) { } try { userDefined.addProperty(CustomFields.VERSION, PropertyAttribute.REMOVABLE, version); } catch (IllegalArgumentException | PropertyExistException | IllegalTypeException e) { Activator.log.error(e); } }
Source:
public void setForeground (Color color) { super.setForeground(color); foreground = color; for (Sash sashe : sashes) { sashe.setForeground(foreground); } }

Target:
public void setForeground (Color color) { super.setForeground(color); foreground = color; for (Sash sash : sashes) { sash.setForeground(foreground); } }
Source:
public static org.ovirt.engine.core.common.job.Step map(Step step, org.ovirt.engine.core.common.job.Step entity) { org.ovirt.engine.core.common.job.Step target = entity != null ? entity : new org.ovirt.engine.core.common.job.Step(); target.setId(new Guid(step.getId())); if (step.isSetParentStep()) { target.setParentStepId(Guid.createGuidFromString(step.getParentStep().getId())); } target.setJobId(Guid.createGuidFromString(step.getJob().getId())); if (step.isSetType()) { target.setStepType(map(step.getType())); } if (step.isSetDescription()) { target.setDescription(step.getDescription()); } if (step.isSetNumber()) { target.setStepNumber(step.getNumber()); } if (step.isSetStatus()) { target.setStatus(JobMapper.map(step.getStatus(), null)); } target.setStartTime(step.isSetStartTime() ? step.getStartTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setEndTime(step.isSetEndTime() ? step.getEndTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setExternal(step.isSetExternal() ? step.isExternal() : true); return target; }

Target:
public static org.ovirt.engine.core.common.job.Step map(Step step, org.ovirt.engine.core.common.job.Step entity) { org.ovirt.engine.core.common.job.Step target = entity != null ? entity : new org.ovirt.engine.core.common.job.Step(); target.setId(new Guid(step.getId())); if (step.isSetParentStep()) { target.setParentStepId(Guid.createGuidFromString(step.getParentStep().getId())); } target.setJobId(GuidUtils.asGuid(step.getJob().getId())); if (step.isSetType()) { StepEnum type = StepEnum.fromValue(step.getType()); if (type != null) { target.setStepType(map(type)); } } if (step.isSetDescription()) { target.setDescription(step.getDescription()); } if (step.isSetNumber()) { target.setStepNumber(step.getNumber()); } if (step.isSetStatus()) { target.setStatus(JobMapper.map(step.getStatus(), null)); } target.setStartTime(step.isSetStartTime() ? step.getStartTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setEndTime(step.isSetEndTime() ? step.getEndTime().toGregorianCalendar().getTime() : new Date((Calendar.getInstance().getTimeInMillis()))); target.setExternal(step.isSetExternal() ? step.isExternal() : true); return target; }
Source:
protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) { ITmfTrace trace = getTrace(); if (trace == null) { return null; } ITmfTreeDataProvider<@NonNull TmfTreeDataModel> provider = DataProviderManager.getInstance().getDataProvider(trace, fId, ITmfTreeDataProvider.class); if (provider == null) { return null; } TmfModelResponse<List<@NonNull TmfTreeDataModel>> tree = provider.fetchTree(new TimeQueryFilter(0l, Long.MAX_VALUE, 2), null); List<@NonNull TmfTreeDataModel> model = tree.getModel(); if (model == null) { return null; } TmfTreeViewerEntry root = new TmfTreeViewerEntry(StringUtils.EMPTY); Map<Long, TmfTreeViewerEntry> map = new HashMap<>(); map.put(-1L, root); for (@NonNull TmfTreeDataModel entry : model) { TmfGenericTreeEntry<@NonNull TmfTreeDataModel> viewerEntry = new TmfGenericTreeEntry<>(entry); map.put(entry.getId(), viewerEntry); TmfTreeViewerEntry parent = map.get(entry.getParentId()); if (parent != null && !parent.getChildren().contains(viewerEntry)) { parent.addChild(viewerEntry); } } return root; }

Target:
protected ITmfTreeViewerEntry updateElements(long start, long end, boolean isSelection) { throw new UnsupportedOperationException("This method should not be called for AbstractSelectTreeViewers"); }
Source:
public void shouldReturnBadRequestOnMissingSchemaAtSpecifiedVersion() { Topic topic = randomTopic("avro", "topicWithoutSchemaAtSpecifiedVersion").withContentType(AVRO).build(); operations.buildTopicWithSchema(topicWithSchema(topic, user.getSchemaAsString())); HermesMessage message = hermesMessage(topic.getQualifiedName(), user.asBytes()) .avro(2) .build(); Response response = publisher.publishAvro(topic.getQualifiedName(), message.getBody(), message.getHeaders()); assertThat(response.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode()); assertThat(response.readEntity(String.class)) .isEqualTo("{\"message\":\"Given schema version does not exist\",\"code\":\"SCHEMA_VERSION_DOES_NOT_EXIST\"}"); }

Target:
public void shouldReturnBadRequestOnMissingSchemaAtSpecifiedVersion() { Topic topic = randomTopic("avro", "topicWithoutSchemaAtSpecifiedVersion").withContentType(AVRO).build(); operations.buildTopicWithSchema(topicWithSchema(topic, user.getSchemaAsString())); HermesMessage message = hermesMessage(topic.getQualifiedName(), user.asBytes()) .avro(2) .build(); Response response = publisher.publishAvro(topic.getQualifiedName(), message.getBody(), message.getHeaders()); assertThat(response.getStatus()).isEqualTo(BAD_REQUEST.getStatusCode()); assertThat(response.readEntity(String.class)) .isEqualTo("{\"message\":\"Given schema version '2' does not exist\",\"code\":\"SCHEMA_VERSION_DOES_NOT_EXIST\"}"); }
Source:
public DeployitCommunicator getCommunicator() { LOCK.enter(); try { if (null == communicator) { try { communicator = RemoteBooter.getCommunicator(booterConfig); LOG.debug("Reusing existing communicator for config: {}.", safeBooterConfigKey()); } catch (IllegalStateException ex) { LOG.warn("No communicator found for config: {}. Creating new DeployitCommunicator. Cause: {}.", safeBooterConfigKey(), ex.getMessage(), ex); DescriptorRegistry.remove(booterConfig); communicator = RemoteBooter.boot(booterConfig); } } } finally { LOCK.leave(); } return communicator; }

Target:
public DeployitCommunicator getCommunicator() { LOCK.enter(); try { if (null == communicator) { try { communicator = RemoteBooter.getCommunicator(booterConfig); LOG.debug("Reusing existing communicator for config: {}.", safeBooterConfigKey()); } catch (IllegalStateException ex) { LOG.warn("No communicator found for config: {}. Creating new DeployitCommunicator. Cause: {}.", safeBooterConfigKey(), ex.getMessage(), ex); DescriptorRegistry.remove(booterConfig); communicator = RemoteBooter.boot(booterConfig); fixVersionDepl6949(); } } } finally { LOCK.leave(); } return communicator; }
Source:
public Publisher<CoreEvent> apply(Publisher<CoreEvent> publisher) { return from(publisher) .flatMap(event -> Mono.from(processWithChildContextDontComplete(event, nestedChain, ofNullable(getLocation()))) .transform(p -> policyTemplate.orElseGet(() -> createRetryPolicyTemplate(event)).applyPolicy(p, getRetryPredicate(), e -> { }, getThrowableFunction(event), timer))); }

Target:
public Publisher<CoreEvent> apply(Publisher<CoreEvent> publisher) { return from(publisher) .flatMap(event -> Mono.from(processWithChildContextDontComplete(event, nestedChain, ofNullable(getLocation()))) .transform(p -> fetchPolicyTemplate(event).applyPolicy(p, getRetryPredicate(), e -> { }, getThrowableFunction(event), timer))); }
Source:
public MigratableTableTranslation<DBOColumnModel, DBOColumnModel> getTranslator() { return new BasicMigratableTableTranslation<DBOColumnModel>(){ @TemporaryCode(author="ziming", comment = "one-time migration change. remove after stack 309") @Override public DBOColumnModel createDatabaseObjectFromBackup(DBOColumnModel backup) { ColumnModel columnModel = ColumnModelUtils.createDTOFromDBO(backup); if(ColumnTypeListMappings.isList(columnModel.getColumnType())){ columnModel.setMaximumListLength(ColumnConstants.MAX_ALLOWED_LIST_LENGTH); } DBOColumnModel modifiedDBO = ColumnModelUtils.createDBOFromDTO(columnModel, StackConfigurationSingleton.singleton().getTableMaxEnumValues()); return modifiedDBO; } }; }

Target:
public MigratableTableTranslation<DBOColumnModel, DBOColumnModel> getTranslator() { return new BasicMigratableTableTranslation<DBOColumnModel>(){ @TemporaryCode(author="ziming", comment = "one-time migration change. remove after stack 309") @Override public DBOColumnModel createDatabaseObjectFromBackup(DBOColumnModel backup) { ColumnModel columnModel = ColumnModelUtils.createDTOFromDBO(backup); DBOColumnModel modifiedDBO = ColumnModelUtils.createDBOFromDTO(columnModel, StackConfigurationSingleton.singleton().getTableMaxEnumValues()); return modifiedDBO; } }; }
Source:
public MessageHeader_Format_V2(ByteBuffer input) { this.buffer = input; }

Target:
public MessageHeader_Format_V2(ByteBuffer input) { buffer = input; }
Source:
protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; else return StructuredSelection.EMPTY; }

Target:
protected IStructuredSelection getSelection(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelectionChecked(event); return getStructuredSelection(selection); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SetRangerCloudIdentityMappingRequest that = (SetRangerCloudIdentityMappingRequest) o; return azureUserMapping.equals(that.azureUserMapping) && azureGroupMapping.equals(that.azureGroupMapping); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SetRangerCloudIdentityMappingRequest that = (SetRangerCloudIdentityMappingRequest) o; return Objects.equals(azureUserMapping, that.azureUserMapping) && Objects.equals(azureGroupMapping, that.azureGroupMapping); }
Source:
private String setPropertyAndGetString(String name, String category, String defaultValue, String comment, String[] validValues, String[] validValuesDisplay, String langKey) { Property prop = this.get(category, name, defaultValue); prop.setValidValues(validValues); if (validValuesDisplay != null) prop.setValidValuesDisplay(validValuesDisplay); prop.setLanguageKey(langKey); prop.setComment(comment + " [default: " + defaultValue + "]"); return prop.getString(); }

Target:
private String setPropertyAndGetString(String name, String category, String defaultValue, String comment, String[] validValues, String[] validValuesDisplay, String langKey) { Property prop = this.get(category, name, defaultValue); prop.setValidValues(validValues); prop.setValidValuesDisplay(validValuesDisplay); prop.setLanguageKey(langKey); prop.setComment(comment + " [default: " + defaultValue + "]"); return prop.getString(); }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); for (IActivityResult f : activityResultListeners) { try { f.onActivityResult(requestCode, resultCode, data); } catch (Exception e) { Log.e(Tag.TAG, "Error executing onActivityResult subscriber"); } } }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); for (IActivityResult f : activityResultListeners) { try { f.onActivityResult(requestCode, resultCode, data); } catch (Exception e) { Log.e(Tag.TAG, "Error executing onActivityResult subscriber " + f, e); } } }