auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Collection<Container> match(ModuleDescriptor moduleDescriptor, ContainerRepository containerRepository) { LOG.debug("Matching containers for module {}", moduleDescriptor); String criteria = moduleDescriptor.getDeploymentProperties().getCriteria(); List<Container> candidates = new ArrayList<Container>(); for (Iterator<Container> iterator = containerRepository.getContainerIterator(); iterator.hasNext();) { Container container = iterator.next(); LOG.trace("Evaluating container {}", container); if (StringUtils.isEmpty(criteria) || isCandidate(container, criteria)) { LOG.trace("\tAdded container {}", container); candidates.add(container); } } if (candidates.isEmpty()) { return candidates; } int count = moduleDescriptor.getDeploymentProperties().getCount(); int candidateCount = candidates.size(); if (count <= 0 || count >= candidateCount) { return candidates; } else if (count == 1) { if (index + 1 > candidateCount) { index = 0; } return Collections.singleton(candidates.get(index++)); } else { List<Container> targets = new ArrayList<Container>(); while (targets.size() < count) { if (index + 1 > candidateCount) { index = 0; } targets.add(candidates.get(index++)); } return targets; } }

Target:
public Collection<Container> match(ModuleDescriptor moduleDescriptor, ContainerRepository containerRepository) { LOG.debug("Matching containers for module {}", moduleDescriptor); String criteria = moduleDescriptor.getDeploymentProperties().getCriteria(); List<Container> candidates = new ArrayList<Container>(); for (Iterator<Container> iterator = containerRepository.getContainerIterator(); iterator.hasNext();) { Container container = iterator.next(); LOG.trace("Evaluating container {}", container); if (StringUtils.isEmpty(criteria) || isCandidate(container, criteria)) { LOG.trace("\tAdded container {}", container); candidates.add(container); } } if (candidates.isEmpty()) { LOG.warn("No currently available containers match criteria '{}' for module {}.", criteria, moduleDescriptor); return candidates; } int count = moduleDescriptor.getDeploymentProperties().getCount(); int candidateCount = candidates.size(); if (count <= 0 || count >= candidateCount) { return candidates; } else if (count == 1) { if (index + 1 > candidateCount) { index = 0; } return Collections.singleton(candidates.get(index++)); } else { List<Container> targets = new ArrayList<Container>(); while (targets.size() < count) { if (index + 1 > candidateCount) { index = 0; } targets.add(candidates.get(index++)); } return targets; } }
Source:
public Xid[] recover(int flag) throws XAException { log.infof("recover with flags: %s", flag); return new Xid[]{}; }

Target:
public Xid[] recover(int flag) throws XAException { log.tracef("recover with flags: %s", flag); return new Xid[]{}; }
Source:
public String pages(Model model, @PathVariable String slug, @RequestParam(required = false) String query, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean archived) { Site site = Site.fromSlug(slug); ensureCanDoThis(site, Permission.SEE_PAGES); Collection<Page> pages = (archived) ? getStaticArchivedPages(site) : getStaticPages(site); pages = Strings.isNullOrEmpty(query) ? pages : searchPages(pages, query); SearchUtils.Partition<Page> partition = new SearchUtils.Partition<>(pages, Page.CREATION_DATE_COMPARATOR, PER_PAGE, currentPage); model.addAttribute("site", site); model.addAttribute("query", query); model.addAttribute("partition", partition); model.addAttribute("pages", partition.getItems()); return (archived) ? "fenixedu-cms/archivedPages" : "fenixedu-cms/pages"; }

Target:
public String pages(Model model, @PathVariable String slug, @RequestParam(required = false) String query, @RequestParam(required = false, defaultValue = "1") int currentPage, @RequestParam(required = false, defaultValue = "false") boolean archived) { Site site = Site.fromSlug(slug); ensureCanDoThis(site, Permission.SEE_PAGES); if (archived) { ensureCanDoThis(site, Permission.DELETE_PAGE); } Collection<Page> pages = (archived) ? getStaticArchivedPages(site) : getStaticPages(site); pages = Strings.isNullOrEmpty(query) ? pages : searchPages(pages, query); SearchUtils.Partition<Page> partition = new SearchUtils.Partition<>(pages, Page.CREATION_DATE_COMPARATOR, PER_PAGE, currentPage); model.addAttribute("site", site); model.addAttribute("query", query); model.addAttribute("partition", partition); model.addAttribute("pages", partition.getItems()); return (archived) ? "fenixedu-cms/archivedPages" : "fenixedu-cms/pages"; }
Source:
public static void main(String[] args) { try { handleLaunchArguments(args); fillSubsystemList(); TerasologyEngine engine = new TerasologyEngine(subsystemList); try { engine.init(); if (isHeadless) { engine.run(new StateHeadlessSetup()); } else { engine.run(new StateMainMenu()); } } finally { try { engine.dispose(); } catch (Exception e) { e.printStackTrace(); } } } catch (RuntimeException | IOException e) { if (!isHeadless) { logException(e); } } System.exit(0); }

Target:
public static void main(String[] args) { handlePrintUsageRequest(args); try { handleLaunchArguments(args); TerasologyEngine engine = new TerasologyEngine(createSubsystemList()); try { engine.init(); if (isHeadless) { engine.run(new StateHeadlessSetup()); } else { engine.run(new StateMainMenu()); } } finally { try { engine.dispose(); } catch (Exception e) { e.printStackTrace(); } } } catch (RuntimeException | IOException e) { if (!isHeadless) { logException(e); } } System.exit(0); }
Source:
public void compactInternally() { if (config.compactIntervalMillis() > 0 && checkIfTableHasNotBeenCompactedForCompactIntervalMillis()) { runCompactOnTable(); } }

Target:
public void compactInternally() { if (compactionSemaphore.tryAcquire()) { try { if (shouldRunCompaction()) { runCompactOnTable(); } } finally { compactionSemaphore.release(); } } }
Source:
public void handleGetDeviceModelResponse(final GetDeviceModelResponseDto getDeviceModelResponseDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; GetDeviceModelResponse getDeviceModelResponse = null; OsgpException exception = null; try { if (responseMessageResultType == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } this.handleResponseMessageReceived(LOGGER, deviceIdentification); getDeviceModelResponse = this.mapper.map(getDeviceModelResponseDto, GetDeviceModelResponse.class); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; exception = this.ensureOsgpException(e, "Exception occurred while getting Device Model Response Data"); } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .withDataObject(getDeviceModelResponse).build(), messageType); }

Target:
public void handleGetDeviceModelResponse(final GetDeviceModelResponseDto getDeviceModelResponseDto, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; GetDeviceModelResponse getDeviceModelResponse = null; OsgpException exception = null; try { if (responseMessageResultType == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } this.handleResponseMessageReceived(LOGGER, deviceIdentification); getDeviceModelResponse = this.mapper.map(getDeviceModelResponseDto, GetDeviceModelResponse.class); } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; exception = this.ensureOsgpException(e, "Exception occurred while getting Device Model Response Data"); } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .withDataObject(getDeviceModelResponse).build(); this.webServiceResponseMessageSender.send(responseMessage, messageType); }
Source:
private SpreadsheetReader createReader(InputStream is, List<String> headers) throws IOException { if (myFormat == CSV) { return new CsvReaderImpl(is, createCSVFormat(headers)); } if (myFormat == XLS) { return new XlsReaderImpl(is, headers); } throw new IllegalArgumentException("Unsupported format: " + myFormat); }

Target:
private SpreadsheetReader createReader(InputStream is, List<String> headers) throws IOException { switch (myFormat) { case CSV: return new CsvReaderImpl(is, createCSVFormat(headers)); case XLS: return new XlsReaderImpl(is, headers); default: throw new IllegalArgumentException("Unsupported format: " + myFormat); } }
Source:
public ConfigurationBasedNamespaceManager(Configuration configuration) { this.configuration = configuration; this.configuration.setProperty(Namespaces.W3C_SCHEMA, "xsd"); this.configuration.setProperty(Namespaces.W3C_NAMESPACE, "xmlns"); this.configuration.setProperty(Namespaces.TOSCA_NAMESPACE, "tosca"); this.configuration.setProperty(Namespaces.TOSCA_WINERY_EXTENSIONS_NAMESPACE, "winery"); this.configuration.setProperty(Namespaces.EXAMPLE_NAMESPACE, "ex"); this.configuration.setProperty(Namespaces.URI_OPENTOSCA_NODETYPE, "otnt"); }

Target:
public ConfigurationBasedNamespaceManager(Configuration configuration) { this.configuration = configuration; this.configuration.setProperty(Namespaces.TOSCA_NAMESPACE, "tosca"); this.configuration.setProperty(Namespaces.TOSCA_WINERY_EXTENSIONS_NAMESPACE, "winery"); this.configuration.setProperty(Namespaces.W3C_XML_SCHEMA_NS_URI, "xsd"); this.configuration.setProperty(Namespaces.W3C_NAMESPACE_URI, "xmlns"); this.configuration.setProperty(Namespaces.EXAMPLE_NAMESPACE_URI, "ex"); this.configuration.setProperty(Namespaces.URI_OPENTOSCA_NODETYPE, "otnt"); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((cachePriority == null) ? 0 : cachePriority.hashCode()); result = prime * result + ((columns == null) ? 0 : columns.hashCode()); result = prime * result + ((conflictHandler == null) ? 0 : conflictHandler.hashCode()); result = prime * result + ((partitionStrategy == null) ? 0 : partitionStrategy.hashCode()); result = prime * result + (rangeScanAllowed ? 1231 : 1237); result = prime * result + ((rowMetadata == null) ? 0 : rowMetadata.hashCode()); result = prime * result + (rangeScanAllowed? 0 : 1); result = prime * result + (explicitCompressionBlockSizeKB); result = prime * result + (negativeLookups? 0 : 1); result = prime * result + (sweepStrategy.hashCode()); result = prime * result + (appendHeavyAndReadLight? 0 : 1); result = prime * result + nameLogSafety.hashCode(); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((cachePriority == null) ? 0 : cachePriority.hashCode()); result = prime * result + ((columns == null) ? 0 : columns.hashCode()); result = prime * result + ((conflictHandler == null) ? 0 : conflictHandler.hashCode()); result = prime * result + ((partitionStrategy == null) ? 0 : partitionStrategy.hashCode()); result = prime * result + (rangeScanAllowed ? 1231 : 1237); result = prime * result + ((rowMetadata == null) ? 0 : rowMetadata.hashCode()); result = prime * result + (rangeScanAllowed ? 0 : 1); result = prime * result + explicitCompressionBlockSizeKB; result = prime * result + (negativeLookups ? 0 : 1); result = prime * result + sweepStrategy.hashCode(); result = prime * result + (appendHeavyAndReadLight ? 0 : 1); result = prime * result + nameLogSafety.hashCode(); return result; }
Source:
public VepAnnotationFileWriter(Long timeoutInSeconds, Integer chunkSize, AnnotationParameters annotationParameters) { if (timeoutInSeconds <= 0) { throw new IllegalArgumentException( "timeout (" + timeoutInSeconds + " seconds) must be strictly greater than 0"); } this.timeoutInSeconds = timeoutInSeconds; this.chunkSize = chunkSize; this.annotationParameters = annotationParameters; alreadyClosed = false; }

Target:
public VepAnnotationFileWriter(Long timeoutInSeconds, Integer chunkSize, AnnotationParameters annotationParameters) { vepProcess = new VepProcess(annotationParameters, chunkSize, timeoutInSeconds); }
Source:
private Properties saveStoresAndGetConnectorProperties() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException { String keystoreFile = "/tmp/server-keystore"; if (serverKeystore!=null) serverKeystore.store( new FileOutputStream(keystoreFile), new char[0]); String truststoreFile = "/tmp/server-truststore"; if (serverTruststore!=null) serverTruststore.store( new FileOutputStream(truststoreFile), new char[0]); Properties p = new Properties(); p.put(JmxmpAgent.JMXMP_KEYSTORE_FILE_PROPERTY, keystoreFile); p.put(JmxmpAgent.JMXMP_TRUSTSTORE_FILE_PROPERTY, truststoreFile); p.put(JmxmpAgent.USE_SSL_PROPERTY, "true"); p.put(JmxmpAgent.AUTHENTICATE_CLIENTS_PROPERTY, "true"); return p; }

Target:
private Properties saveStoresAndGetConnectorProperties() throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException { String keystoreFile = File.createTempFile("server-keystore", ".jmx.test").getAbsolutePath(); String truststoreFile = File.createTempFile("server-truststore", ".jmx.test").getAbsolutePath(); if (serverKeystore!=null) serverKeystore.store( new FileOutputStream(keystoreFile), new char[0]); if (serverTruststore!=null) serverTruststore.store( new FileOutputStream(truststoreFile), new char[0]); Properties p = new Properties(); p.put(JmxmpAgent.JMXMP_KEYSTORE_FILE_PROPERTY, keystoreFile); p.put(JmxmpAgent.JMXMP_TRUSTSTORE_FILE_PROPERTY, truststoreFile); p.put(JmxmpAgent.USE_SSL_PROPERTY, "true"); p.put(JmxmpAgent.AUTHENTICATE_CLIENTS_PROPERTY, "true"); return p; }
Source:
private void resetCluster(FileSystemMaster fsm) throws Exception { if (!mCluster.get().getLocalAlluxioMaster().isServing()) { mCluster.mLocalAlluxioCluster.startMasters(); fsm = mCluster.mLocalAlluxioCluster.getLocalAlluxioMaster().getMasterProcess() .getMaster(FileSystemMaster.class); } if (!mCluster.get().isStartedWorkers()) { BlockMaster bm = mCluster.get().getLocalAlluxioMaster().getMasterProcess().getMaster(BlockMaster.class); CommonUtils.waitFor("", () -> { try { return bm.getWorkerInfoList().isEmpty(); } catch (Exception e) { return false; } }, WaitForOptions.defaults().setInterval(10).setTimeoutMs(1000)); mCluster.get().startWorkers(); } fsm.updateUfsMode(new AlluxioURI(fsm.getUfsAddress()), UfsMode.READ_WRITE); for (FileInfo fileInfo : fsm .listStatus(new AlluxioURI("/"), ListStatusContext.defaults())) { fsm.delete(new AlluxioURI(fileInfo.getPath()), DeleteContext .create(DeletePOptions.newBuilder().setUnchecked(true).setRecursive(true))); } }

Target:
private void resetCluster(FileSystemMaster fsm) throws Exception { if (!mCluster.get().getLocalAlluxioMaster().isServing()) { mCluster.mLocalAlluxioCluster.startMasters(); fsm = mCluster.mLocalAlluxioCluster.getLocalAlluxioMaster().getMasterProcess() .getMaster(FileSystemMaster.class); } if (!mCluster.get().isStartedWorkers()) { BlockMaster bm = mCluster.get().getLocalAlluxioMaster().getMasterProcess().getMaster(BlockMaster.class); CommonUtils.waitFor("all workers to be considered lost by the master", () -> { try { return bm.getWorkerInfoList().isEmpty(); } catch (Exception e) { return false; } }, WaitForOptions.defaults().setInterval(10).setTimeoutMs(1000)); mCluster.get().startWorkers(); } fsm.updateUfsMode(new AlluxioURI(fsm.getUfsAddress()), UfsMode.READ_WRITE); for (FileInfo fileInfo : fsm .listStatus(new AlluxioURI("/"), ListStatusContext.defaults())) { fsm.delete(new AlluxioURI(fileInfo.getPath()), DeleteContext .create(DeletePOptions.newBuilder().setUnchecked(true).setRecursive(true))); } }
Source:
public boolean onCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu); Config config = environment.getConfig(); if (!config.getCourseDiscoveryConfig().isWebCourseSearchEnabled()) { return result; } getMenuInflater().inflate(R.menu.find_courses, menu); final MenuItem searchItem = menu.findItem(R.id.menu_item_search); searchView = (SearchView) searchItem.getActionView(); Resources resources = getResources(); searchView.setQueryHint(resources.getString(R.string.search_for_courses)); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { String baseUrl = environment.getConfig().getCourseDiscoveryConfig().getCourseSearchUrl(); String searchUrl = buildQuery(baseUrl, query, logger); searchView.clearFocus(); webView.loadUrl(searchUrl); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean queryTextFocused) { if (!queryTextFocused) { searchActive = false; searchItem.collapseActionView(); dismissKeyboard(); showDrawerButton(true); } else { searchActive = true; showDrawerButton(false); } } }); return result; }

Target:
public boolean onCreateOptionsMenu(Menu menu) { boolean result = super.onCreateOptionsMenu(menu); Config config = environment.getConfig(); if (!config.getCourseDiscoveryConfig().isWebCourseSearchEnabled()) { return result; } getMenuInflater().inflate(R.menu.find_courses, menu); final MenuItem searchItem = menu.findItem(R.id.menu_item_search); searchView = (SearchView) searchItem.getActionView(); Resources resources = getResources(); searchView.setQueryHint(resources.getString(R.string.search_for_courses)); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { String baseUrl = environment.getConfig().getCourseDiscoveryConfig().getCourseSearchUrl(); String searchUrl = buildQuery(baseUrl, query, logger); searchView.onActionViewCollapsed(); webView.loadUrl(searchUrl); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean queryTextFocused) { if (!queryTextFocused) { searchView.onActionViewCollapsed(); } enableDrawerMenuButton(!queryTextFocused); } }); return result; }
Source:
private void startListeningInternal() { startListening(); isListening = true; value = calculate(); }

Target:
private void startListeningInternal() { isListening = true; value = calculate(); startListening(); }
Source:
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { List<String> authorizationValues = request.getRequestHeaderValues("Authorization"); if (authorizationValues == null || authorizationValues.isEmpty()) { request.authenticationFailed("Bearer token required", response -> response.setStatusCode(401)); return; } else if (authorizationValues.size() > 1) { request.authenticationFailed("Multiple Authorization headers found", response -> response.setStatusCode(400)); return; } String authorizationValue = authorizationValues.get(0); Matcher matcher = BEARER_TOKEN_PATTERN.matcher(authorizationValue); if (!matcher.matches()) { request.authenticationFailed("Authorization is not Bearer", response -> response.setStatusCode(400)); return; } BearerTokenEvidence tokenEvidence = new BearerTokenEvidence(matcher.group(1)); try { EvidenceVerifyCallback verifyCallback = new EvidenceVerifyCallback(tokenEvidence); callbackHandler.handle(new Callback[] {verifyCallback}); if (verifyCallback.isVerified()) { AuthorizeCallback authorizeCallback = new AuthorizeCallback(null, null); callbackHandler.handle(new Callback[] {authorizeCallback}); if (authorizeCallback.isAuthorized()) { callbackHandler.handle(new Callback[]{new IdentityCredentialCallback(new BearerTokenCredential(tokenEvidence.getToken()), true), AuthenticationCompleteCallback.SUCCEEDED}); request.authenticationComplete(); return; } } invalidBearerToken(request); } catch (IOException | UnsupportedCallbackException e) { throw new HttpAuthenticationException(e); } }

Target:
public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException { List<String> authorizationValues = request.getRequestHeaderValues("Authorization"); if (authorizationValues == null || authorizationValues.isEmpty()) { request.authenticationFailed("Bearer token required", response -> response.setStatusCode(401)); return; } else if (authorizationValues.size() > 1) { request.authenticationFailed("Multiple Authorization headers found", response -> response.setStatusCode(400)); return; } String authorizationValue = authorizationValues.get(0); Matcher matcher = BEARER_TOKEN_PATTERN.matcher(authorizationValue); if (!matcher.matches()) { request.authenticationFailed("Authorization is not Bearer", response -> response.setStatusCode(400)); return; } BearerTokenEvidence tokenEvidence = new BearerTokenEvidence(matcher.group(1)); EvidenceVerifyCallback verifyCallback = new EvidenceVerifyCallback(tokenEvidence); handleCallback(verifyCallback); if (verifyCallback.isVerified()) { AuthorizeCallback authorizeCallback = new AuthorizeCallback(null, null); handleCallback(authorizeCallback); if (authorizeCallback.isAuthorized()) { handleCallback(new IdentityCredentialCallback(new BearerTokenCredential(tokenEvidence.getToken()), true)); handleCallback(AuthenticationCompleteCallback.SUCCEEDED); request.authenticationComplete(); return; } } request.authenticationFailed("Invalid bearer token", response -> response.setStatusCode(403)); }
Source:
public void sendFull(RequestType requestType) { switch (requestType) { case QUERY: StringBuilder query = new StringBuilder(); generate(query, schema.getQueryType(), 0); requestor.sendQuery(query.toString()); break; case MUTATION: StringBuilder mutation = new StringBuilder("mutation "); generate(mutation, schema.getMutationType(), 0); requestor.sendQuery(mutation.toString()); break; case SUBSCRIPTION: StringBuilder subscription = new StringBuilder("subscription "); generate(subscription, schema.getSubscriptionType(), 0); requestor.sendQuery(subscription.toString()); break; } }

Target:
public void sendFull(RequestType requestType) { switch (requestType) { case MUTATION: StringBuilder mutation = new StringBuilder(OPERATION_TYPE_MUTATION); generate(mutation, schema.getMutationType(), 0); requestor.sendQuery(mutation.toString(), param.getRequestMethod()); break; case SUBSCRIPTION: StringBuilder subscription = new StringBuilder(OPERATION_TYPE_SUBSCRIPTION); generate(subscription, schema.getSubscriptionType(), 0); requestor.sendQuery(subscription.toString(), param.getRequestMethod()); break; case QUERY: default: StringBuilder query = new StringBuilder(); generate(query, schema.getQueryType(), 0); requestor.sendQuery(query.toString(), param.getRequestMethod()); break; } }
Source:
public void onClick(DialogInterface dialog, int which) { if (which == DialogInterface.BUTTON_POSITIVE && saveEngines()) { setResult(RESULT_OK); Toast.makeText(this, R.string.sync_notification_savedprefs, Toast.LENGTH_SHORT).show(); } else { setResult(RESULT_CANCELED); } finish(); }

Target:
public void onClick(DialogInterface dialog, int which) { if (which == DialogInterface.BUTTON_POSITIVE) { Logger.debug(LOG_TAG, "Saving selected engines."); saveSelections(); setResult(RESULT_OK); Toast.makeText(this, R.string.sync_notification_savedprefs, Toast.LENGTH_SHORT).show(); } else { setResult(RESULT_CANCELED); } finish(); }
Source:
public void testGlobJs3() throws IOException { try { FlagEntry<JsSourceType> jsFile1 = createJsFile("test1", "var a;"); FlagEntry<JsSourceType> jsFile2 = createJsFile("test2", "var b;"); new File(jsFile2.value).renameTo(new File( new File(jsFile1.value).getParentFile() + File.separator + "test2.js")); String glob1 = new File(jsFile1.value).getParent() + File.separator + "**.js"; String glob2 = "!" + new File(jsFile1.value).getParent() + File.separator + "**test2.js"; compileFiles( "var a;", new FlagEntry<>(JsSourceType.JS, glob1), new FlagEntry<>(JsSourceType.JS, glob2)); } catch (FlagUsageException e) { fail("Unexpected exception" + e); } }

Target:
public void testGlobJs3() throws IOException, FlagUsageException { FlagEntry<JsSourceType> jsFile1 = createJsFile("test1", "var a;"); FlagEntry<JsSourceType> jsFile2 = createJsFile("test2", "var b;"); new File(jsFile2.value).renameTo(new File( new File(jsFile1.value).getParentFile() + File.separator + "test2.js")); String glob1 = new File(jsFile1.value).getParent() + File.separator + "**.js"; String glob2 = "!" + new File(jsFile1.value).getParent() + File.separator + "**test2.js"; compileFiles( "var a;", new FlagEntry<>(JsSourceType.JS, glob1), new FlagEntry<>(JsSourceType.JS, glob2)); }
Source:
<T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException; @Timed <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionReadOnly( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E; long getImmutableTimestamp(); LockService getLockService(); TimelockService getTimelockService(); default KvsLockWatchingService getLockWatchingService() { return null; }

Target:
<T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException; @Timed <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionReadOnly( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E; long getImmutableTimestamp(); LockService getLockService(); TimelockService getTimelockService(); default KvsLockWatchingService getLockWatchingService() { return NoOpKvsLockWatchingService.INSTANCE; }
Source:
public Builder tag(final Map<String, String> tagsToAdd) { for (Entry<String, String> tag : tagsToAdd.entrySet()) { if (CheckTags.isTagNameLegal(tag.getKey()) && CheckTags.isTagValueLegal(tag.getValue())) { tag(tag.getKey(), tag.getValue()); } } return this; }

Target:
public Builder tag(final Map<String, String> tagsToAdd) { for (Entry<String, String> tag : tagsToAdd.entrySet()) { if (CheckTags.isLegalFullCheck(tag.getKey(), tag.getValue())) { tags.put(tag.getKey(), tag.getValue()); } } return this; }
Source:
private void updateIndex(Page page) { index.addPage(page); int numPositions = index.getPositionCount(); long estimatedPagesHashSize = calculatedPredictedSizeDelta(numPositions); if (spillEnabled) { localRevocableMemoryContext.setBytes(index.getEstimatedSize().toBytes() + estimatedPagesHashSize); } else { if (!localUserMemoryContext.trySetBytes(index.getEstimatedSize().toBytes() + estimatedPagesHashSize)) { index.compact(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes() + estimatedPagesHashSize); } } operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); }

Target:
private void updateIndex(Page page) { index.addPage(page); int numPositions = index.getPositionCount(); long estimatedSizeAfterBuild = index.getEstimatedSize().toBytes() + PagesHash.getEstimatedAdditionalSize(numPositions); if (spillEnabled) { localRevocableMemoryContext.setBytes(estimatedSizeAfterBuild); } else { if (!localUserMemoryContext.trySetBytes(estimatedSizeAfterBuild)) { index.compact(); localUserMemoryContext.setBytes(index.getEstimatedSize().toBytes() + PagesHash.getEstimatedAdditionalSize(numPositions)); } } operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); }
Source:
private List<Pair<Guid, Pair<Integer, Integer>>> getUnutilizedResources(List<VDS> hosts) { List<Pair<Guid, Pair<Integer, Integer>>> hostsUnutilizedResources = new ArrayList<>(); for (VDS host : hosts) { Pair<Integer, Integer> innerUnutilizedCpuRamPair = new Pair<>(); int hostFreeCpu = 0; if (host.getUsageCpuPercent() != null) { hostFreeCpu = 100 - host.getUsageCpuPercent(); } innerUnutilizedCpuRamPair.setFirst(hostFreeCpu); int hostFreeMem = 0; if (host.getPhysicalMemMb() != null && host.getUsageMemPercent() != null) { int usedMem = (int) Math.round(host.getPhysicalMemMb() * (host.getUsageMemPercent() / 100.0)); hostFreeMem = host.getPhysicalMemMb() - usedMem; } innerUnutilizedCpuRamPair.setSecond(hostFreeMem); Pair<Guid, Pair<Integer, Integer>> outerUnutilizedCpuRamPair = new Pair<>(host.getId(), innerUnutilizedCpuRamPair); outerUnutilizedCpuRamPair.setFirst(host.getId()); outerUnutilizedCpuRamPair.setSecond(innerUnutilizedCpuRamPair); hostsUnutilizedResources.add(outerUnutilizedCpuRamPair); } return hostsUnutilizedResources; }

Target:
private List<Pair<Guid, Pair<Integer, Integer>>> getUnutilizedResources(List<VDS> hosts) { List<Pair<Guid, Pair<Integer, Integer>>> hostsUnutilizedResources = new ArrayList<>(); for (VDS host : hosts) { Pair<Integer, Integer> innerUnutilizedCpuRamPair = new Pair<>(); int hostFreeCpu = 0; if (host.getUsageCpuPercent() != null) { hostFreeCpu = 100 - host.getUsageCpuPercent(); } innerUnutilizedCpuRamPair.setFirst(hostFreeCpu); int hostFreeMem = (int) host.getMaxSchedulingMemory(); innerUnutilizedCpuRamPair.setSecond(hostFreeMem); Pair<Guid, Pair<Integer, Integer>> outerUnutilizedCpuRamPair = new Pair<>(host.getId(), innerUnutilizedCpuRamPair); hostsUnutilizedResources.add(outerUnutilizedCpuRamPair); } return hostsUnutilizedResources; }
Source:
private String determineDeviceUUID() throws NotActiveException { DeviceUUIDsMap uuidsMap = new DeviceUUIDsMap(); uuidsMap.loadData(); String uuid = uuidsMap.getUUID(exactSdkVersion, deviceName); if (uuid == null) { throw new NotFoundException("Couldn't find UUID for device " + deviceName + " with SDK " + exactSdkVersion); } int countingTries = 0; String state = uuidsMap.getState(exactSdkVersion, deviceName); while (countingTries < NUMBER_TRIES_GETTING_UUID && state.equals("Shutting Down")) { log.info(String.format("Device is shutting down. Wait %d milliseconds.", SLEEP_TIME_BETWEEN_TRIES)); try { Thread.sleep(SLEEP_TIME_BETWEEN_TRIES); } catch (InterruptedException e) { } uuidsMap.loadData(); state = uuidsMap.getState(exactSdkVersion, deviceName); ++countingTries; } if (state.equals("Shutting down")) throw new NotActiveException("UUID for device " + deviceName + " with SDK " + exactSdkVersion + " is not " + "available to use. " + "Current state:" + state); return uuid; }

Target:
private String determineDeviceUUID() throws DeviceNotAvailableException { DeviceUUIDsMap uuidsMap = new DeviceUUIDsMap(); uuidsMap.loadData(); String uuid = uuidsMap.getUUID(exactSdkVersion, deviceName); if (uuid == null) { String message = "Couldn't find UUID for device " + deviceName + " with SDK " + exactSdkVersion; log.warning(message); throw new NotFoundException(message); } int countingTries = 0; String state = uuidsMap.getState(exactSdkVersion, deviceName); while ((countingTries < NUMBER_TRIES_GETTING_UUID) && (state.equals("Shutting Down"))) { log.info(String.format("Device is shutting down. Wait %d milliseconds.", SLEEP_TIME_BETWEEN_TRIES)); try { Thread.sleep(SLEEP_TIME_BETWEEN_TRIES); } catch (InterruptedException e) { } uuidsMap.loadData(); state = uuidsMap.getState(exactSdkVersion, deviceName); countingTries += 1; } if (state.equals("Shutting down")) { String message = "UUID for device " + deviceName + " with SDK " + exactSdkVersion + " is not available to use. Current state:" + state; log.warning(message); throw new DeviceNotAvailableException(message); } return uuid; }
Source:
private void doRemove(final ApprovalDetail ad, final PushButton remove) { remove.setEnabled(false); PatchUtil.DETAIL_SVC.removeReviewer(changeId, ad.getAccount(), new GerritCallback<ReviewerResult>() { @Override public void onSuccess(ReviewerResult result) { if (result.getErrors().isEmpty()) { final ChangeDetail r = result.getChange(); display(r.getChange(), r.getMissingApprovals(), r.getApprovals()); } else { final ReviewerResult.Error resultError = result.getErrors().get(0); String message; switch (resultError.getType()) { case REMOVE_NOT_PERMITTED: message = "Not allowed to remove reviewer"; break; case COULD_NOT_REMOVE: default: message = "Could not remove reviewer"; } new ErrorDialog(message + " " + resultError.getName()).center(); } } @Override public void onFailure(final Throwable caught) { remove.setEnabled(true); super.onFailure(caught); } }); }

Target:
private void doRemove(final ApprovalDetail ad, final PushButton remove) { remove.setEnabled(false); PatchUtil.DETAIL_SVC.removeReviewer(changeId, ad.getAccount(), new GerritCallback<ReviewerResult>() { @Override public void onSuccess(ReviewerResult result) { if (result.getErrors().isEmpty()) { final ChangeDetail r = result.getChange(); display(r.getChange(), r.getMissingApprovals(), r.getApprovals()); } else { final ReviewerResult.Error resultError = result.getErrors().get(0); String message; switch (resultError.getType()) { case REMOVE_NOT_PERMITTED: message = Util.C.approvalTableRemoveNotPermitted(); break; case COULD_NOT_REMOVE: default: message = Util.C.approvalTableCouldNotRemove(); } new ErrorDialog(message + " " + resultError.getName()).center(); } } @Override public void onFailure(final Throwable caught) { remove.setEnabled(true); super.onFailure(caught); } }); }
Source:
public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", false, true)); }

Target:
public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", config.isZstdJniDecompressionEnabled(), true)); }
Source:
private String getBaseUrlString(ChangeSet changeSet) throws MalformedURLException { String baseUrl; if (url != null) { baseUrl = DescriptorImpl.getBaseUrl(url); } else { String scmUrl = getServerConfiguration(changeSet); if (scmUrl.endsWith("/")) { baseUrl = scmUrl; } else { baseUrl = String.format("%s/", scmUrl); } } return baseUrl; }

Target:
private String getBaseUrlString(ChangeSet changeSet) throws MalformedURLException { String baseUrl = url; if (baseUrl == null) { baseUrl = getServerConfiguration(changeSet); } baseUrl = normalizeToEndWithSlash(new URL(baseUrl)).toString(); return baseUrl; }
Source:
protected Connection openConnection() throws IOException { CallbackHandler callbackHandler = null; SSLContext sslContext = null; if (realm != null) { sslContext = realm.getSSLContext(); CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory(); if (handlerFactory != null) { String username = this.username != null ? this.username : localHostName; callbackHandler = handlerFactory.getCallbackHandler(username); } } final ProtocolConnectionConfiguration config = ProtocolConnectionConfiguration.copy(configuration); config.setCallbackHandler(callbackHandler); config.setSslContext(sslContext); config.setUri(uri); config.setSslEnabled(Protocol.HTTP_REMOTING != Protocol.forName(uri.getScheme())); config.setUseStartTLS(Protocol.HTTPS_REMOTING != Protocol.forName(uri.getScheme())); return ProtocolConnectionUtils.connectSync(config); }

Target:
protected Connection openConnection() throws IOException { CallbackHandler callbackHandler = null; SSLContext sslContext = null; if (realm != null) { sslContext = realm.getSSLContext(); CallbackHandlerFactory handlerFactory = realm.getSecretCallbackHandlerFactory(); if (handlerFactory != null) { String username = this.username != null ? this.username : localHostName; callbackHandler = handlerFactory.getCallbackHandler(username); } } final ProtocolConnectionConfiguration config = ProtocolConnectionConfiguration.copy(configuration); config.setCallbackHandler(callbackHandler); config.setSslContext(sslContext); config.setUri(uri); return ProtocolConnectionUtils.connectSync(config); }
Source:
public String getInterfaceNames() { return node.getDefiningType().getCodeUnitDetails().getInterfaceTypeRefs().stream() .map(TypeRef::getNames).map(it -> it.stream().map(Identifier::getValue).collect(Collectors.joining("."))) .collect(Collectors.joining(",")); }

Target:
public List<String> getInterfaceNames() { return node.getDefiningType().getCodeUnitDetails().getInterfaceTypeRefs().stream() .map(TypeRef::getNames).map(it -> it.stream().map(Identifier::getValue).collect(Collectors.joining("."))) .collect(Collectors.toList()); }
Source:
public Object sample_value() { checkHasParams(); if (s.isEmpty()) { return Model.NULL; } int n = Util.randInt(s.size()); Iterator<?> it = s.iterator(); while (it.hasNext()) { if (n == 0) return (Object) it.next(); --n; it.next(); } return null; }

Target:
public Object sample_value() { checkHasParams(); if (elements.length <= 0) { return Model.NULL; } int n = Util.randInt(elements.length); return elements[n]; }
Source:
public static Throwable getError(Task<?> t) { if (t==null) return null; if (!t.isDone()) return null; if (t.isCancelled()) return new CancellationException(); try { t.get(); return null; } catch (Throwable error) { Exceptions.propagateIfFatal(error); return error; } }

Target:
public static Throwable getError(Task<?> t) { if (t==null) return null; if (!t.isDone()) return null; if (t.isCancelled()) return new CancellationException(); try { t.get(); return null; } catch (Throwable error) { return error; } }
Source:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.UPCOMING_JAM && !(value instanceof Jam)) { value = new JamImpl(this, getCurrentPeriod().getCurrentJam()); } else if (prop == Value.NO_MORE_JAM) { if (isInJam() || !isInPeriod()) { return false; } if (!getRulesets().getBoolean(Rule.PERIOD_END_BETWEEN_JAMS)) { return false; } Jam lastJam = getCurrentPeriod().getCurrentJam(); long pcRemaining = getClock(Clock.ID_PERIOD).getMaximumTime() - lastJam.getPeriodClockElapsedEnd(); if (pcRemaining > getRulesets().getLong(Rule.LINEUP_DURATION)) { return false; } boolean ttoForcesJam = getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_TTO); boolean orForcesJam = getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_OR); boolean otoForcesJam = getRulesets().getBoolean(Rule.EXTRA_JAM_AFTER_OTO) && (getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_TTO)); for (ValueWithId v : lastJam.getAll(Jam.Child.TIMEOUTS_AFTER)) { Timeout t = (Timeout)v; if (t.getOwner() instanceof Team) { if (t.isReview() && orForcesJam) { return false; } if (!t.isReview() && ttoForcesJam) { return false; } } else if (otoForcesJam) { return false; } } return true; } return value; }

Target:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.UPCOMING_JAM && !(value instanceof Jam)) { value = new JamImpl(this, getCurrentPeriod().getCurrentJam()); } else if (prop == Value.NO_MORE_JAM) { if (isInJam() || !isInPeriod()) { return false; } if (!getRulesets().getBoolean(Rule.PERIOD_END_BETWEEN_JAMS)) { return false; } Jam lastJam = getCurrentPeriod().getCurrentJam(); long pcRemaining = getClock(Clock.ID_PERIOD).getMaximumTime() - lastJam.getPeriodClockElapsedEnd(); if (pcRemaining >= getRulesets().getLong(Rule.LINEUP_DURATION)) { return false; } boolean ttoForcesJam = getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_TTO); boolean orForcesJam = getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_OR); boolean otoForcesJam = getRulesets().getBoolean(Rule.EXTRA_JAM_AFTER_OTO) && (getRulesets().getBoolean(Rule.STOP_PC_ON_TO) || getRulesets().getBoolean(Rule.STOP_PC_ON_TTO)); for (ValueWithId v : lastJam.getAll(Jam.Child.TIMEOUTS_AFTER)) { Timeout t = (Timeout)v; if (t.getOwner() instanceof Team) { if (t.isReview() && orForcesJam) { return false; } if (!t.isReview() && ttoForcesJam) { return false; } } else if (otoForcesJam) { return false; } } return true; } return value; }
Source:
public static AutoPreviewExtender create(PreviewConfig.Builder builder) { try { return new VendorAutoPreviewExtender(builder); } catch (NoClassDefFoundError e) { Log.d(TAG, "No auto view finder extender found. Falling back to default."); return new DefaultAutoPreviewExtender(); } }

Target:
public static AutoPreviewExtender create(PreviewConfig.Builder builder) { try { return new VendorAutoPreviewExtender(builder); } catch (NoClassDefFoundError e) { Log.d(TAG, "No auto preview extender found. Falling back to default."); return new DefaultAutoPreviewExtender(); } }
Source:
private MaxLoadThreads(long maxLoadThreads) { if (maxLoadThreads <= 0) { throw new IllegalArgumentException( String.format("The maximum number of threads must be >= 0. Provided value is %s", maxLoadThreads)); } this.maxLoadThreads = maxLoadThreads; }

Target:
private MaxLoadThreads(long maxLoadThreads) { if (maxLoadThreads <= 0) { throw new IllegalArgumentException( String.format("The maximum number of threads must be > 0. Provided value is %s", maxLoadThreads)); } this.maxLoadThreads = maxLoadThreads; }
Source:
public static ResourceIdentifier of(String service, String instance, String type, String context, String firstLocatorComponent, String... locatorComponents) { StringBuilder builder = new StringBuilder().append(firstLocatorComponent); for (String component : locatorComponents) { builder.append(SEPARATOR).append(component); } return of(service, instance, type, context, builder.toString()); }

Target:
public static ResourceIdentifier of(String service, String instance, String type, String context, String firstLocatorComponent, String... locatorComponents) { StringBuilder builder = new StringBuilder(firstLocatorComponent); for (String component : locatorComponents) { builder.append(SEPARATOR).append(component); } return of(service, instance, type, context, builder.toString()); }
Source:
public void testOverriddenMethodWithSpecifyParamType() throws RemotingException { mockChannel = mock(Channel.class); given(mockChannel.getAttribute("telnet.service")).willReturn("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService"); given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555")); given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886")); ProviderModel providerModel = new ProviderModel("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService", new DemoServiceImpl(), DemoService.class); ApplicationModel.initProviderModel("org.apache.dubbo.rpc.protocol.dubbo.support.DemoService", providerModel); String result = invoke.telnet(mockChannel, "DemoService.getPerson({\"name\":\"zhangsan\",\"age\":12,\"class\":\"org.apache.dubbo.rpc.protocol.dubbo.support.Person\"})"); assertTrue(result.contains("result: 12")); }

Target:
public void testOverriddenMethodWithSpecifyParamType() throws RemotingException { mockChannel = mock(Channel.class); given(mockChannel.getAttribute("telnet.service")).willReturn(DemoService.class.getName()); given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555")); given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886")); ProviderModel providerModel = new ProviderModel(DemoService.class.getName(), new DemoServiceImpl(), DemoService.class); ApplicationModel.initProviderModel(DemoService.class.getName(), providerModel); String result = invoke.telnet(mockChannel, "getPerson({\"name\":\"zhangsan\",\"age\":12,\"class\":\"org.apache.dubbo.rpc.protocol.dubbo.support.Person\"})"); assertTrue(result.contains("result: 12")); }
Source:
public void onClick(final View view) { for (final View.OnClickListener listener: new ArrayList<View.OnClickListener>(listeners)) { listener.onClick(view); } }

Target:
public void onClick(final View view) { for (final View.OnClickListener listener : listeners) { listener.onClick(view); } }
Source:
MetaStoreConfigAuthenticationProviderImpl(Configuration conf) throws AuthenticationException { userName = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_USERNAME); password = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_PASSWORD); if (null == userName || userName.isEmpty()) { throw new AuthenticationException("No username specified in " + MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_USERNAME); } if (null == password || password.isEmpty()) { throw new AuthenticationException("No password specified in " + MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_USERNAME); } }

Target:
MetaStoreConfigAuthenticationProviderImpl(Configuration conf) throws AuthenticationException { userName = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_USERNAME); password = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_PASSWORD); if (null == userName || userName.isEmpty()) { throw new AuthenticationException("No username specified in " + MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_USERNAME); } if (null == password) { throw new AuthenticationException("No password specified in " + MetastoreConf.ConfVars.THRIFT_AUTH_CONFIG_PASSWORD); } }