auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
Pair<StreamProcessor, MetadataStore> createStreamProcessor(Config config, ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc, StreamProcessor.StreamProcessorLifecycleListenerFactory listenerFactory, Optional<ExternalContext> externalContextOptional, MetadataStore coordinatorStreamStore) { TaskFactory taskFactory = TaskFactoryUtil.getTaskFactory(appDesc); Map<String, MetricsReporter> reporters = new HashMap<>(); String processorId = createProcessorId(new ApplicationConfig(config), getClass().getClassLoader()); appDesc.getMetricsReporterFactories().forEach((name, factory) -> reporters.put(name, factory.getMetricsReporter(name, processorId, config))); StreamProcessor streamProcessor = new StreamProcessor(processorId, config, reporters, taskFactory, appDesc.getApplicationContainerContextFactory(), appDesc.getApplicationTaskContextFactory(), externalContextOptional, listenerFactory, null, coordinatorStreamStore); return ImmutablePair.of(streamProcessor, coordinatorStreamStore); }

Target:
StreamProcessor createStreamProcessor(Config config, ApplicationDescriptorImpl<? extends ApplicationDescriptor> appDesc, StreamProcessor.StreamProcessorLifecycleListenerFactory listenerFactory, Optional<ExternalContext> externalContextOptional, MetadataStore coordinatorStreamStore) { TaskFactory taskFactory = TaskFactoryUtil.getTaskFactory(appDesc); Map<String, MetricsReporter> reporters = new HashMap<>(); String processorId = createProcessorId(new ApplicationConfig(config), getClass().getClassLoader()); appDesc.getMetricsReporterFactories().forEach((name, factory) -> reporters.put(name, factory.getMetricsReporter(name, processorId, config))); StreamProcessor streamProcessor = new StreamProcessor(processorId, config, reporters, taskFactory, appDesc.getApplicationContainerContextFactory(), appDesc.getApplicationTaskContextFactory(), externalContextOptional, listenerFactory, null, coordinatorStreamStore); return streamProcessor; }
Source:
public void annotationEndpointTestForError() throws URISyntaxException { String url = "/v2/variants/13:32889669:C:T/annotations?species=mmusculus&assembly=grcm38&" + "annot-vep-version=1"; assertEquals("Please specify either both annotation VEP version and annotation VEP cache version, " + "or neither", testForErrorHelper(url)); }

Target:
public void annotationEndpointTestForError() throws URISyntaxException { String url = "/v2/variants/13:32889669:C:T/annotations?species=mmusculus&assembly=grcm38&" + "annot-vep-version=1"; assertEquals("Please specify either both annotation VEP version and annotation VEP cache version, " + "or neither", testForErrorHelper(url)); url = "/v2/variants/13:32889669:C:T/annotations?species=mmusculus&assembly=grcm38&" + "annot-vep-cache-version=1"; assertEquals("Please specify either both annotation VEP version and annotation VEP cache version, " + "or neither", testForErrorHelper(url)); }
Source:
public SchemaCompatibilityResult getCompatibility( final Schema reader, final Schema writer ) { Stack<String> location = new Stack<String>(); return getCompatibility(ROOT_REFERENCE_TOKEN, reader, writer, location); }

Target:
public SchemaCompatibilityResult getCompatibility( final Schema reader, final Schema writer ) { Deque<String> location = new ArrayDeque<String>(); return getCompatibility(ROOT_REFERENCE_TOKEN, reader, writer, location); }
Source:
private void writeToZip(Path currentPath, ZipArchiveOutputStream zipStream, Path projectPath) throws IOException { log.trace("Writing to zip", currentPath); String name = projectPath.getParent().relativize(currentPath).toString(); name = FilenameUtils.separatorsToUnix(name); if (Files.isDirectory(currentPath)) { log.trace("{} is a directory", currentPath); name += "/"; } ZipArchiveEntry entry = new ZipArchiveEntry(name); zipStream.putArchiveEntry(entry); if (Files.isRegularFile(currentPath)) { log.trace("{} is a regular file, copying bytes", currentPath); FileUtils.copyFile(currentPath.toFile(), zipStream); log.trace("Done copying bytes"); } log.trace("Closing entry"); zipStream.closeArchiveEntry(); }

Target:
private void writeToZip(Path currentPath, ZipArchiveOutputStream zipStream, Path projectPath) throws IOException { log.trace("Writing to zip", currentPath); Path relativePath = projectPath.getParent().relativize(currentPath); String name = relativePathToZipCompliantName(relativePath, Files.isDirectory(currentPath)); ZipArchiveEntry entry = new ZipArchiveEntry(name); zipStream.putArchiveEntry(entry); if (Files.isRegularFile(currentPath)) { log.trace("{} is a regular file, copying bytes", currentPath); FileUtils.copyFile(currentPath.toFile(), zipStream); log.trace("Done copying bytes"); } log.trace("Closing entry"); zipStream.closeArchiveEntry(); }
Source:
public void performance() { CurveBuildingBlockBundle emptyBlock = new CurveBuildingBlockBundle(); long startTime, endTime; final int nbTest = 100; startTime = System.currentTimeMillis(); for (int looptest = 0; looptest < nbTest; looptest++) { makeCurvesFromDefinitions(DEFINITIONS_UNITS[0], GENERATORS_UNITS[0], NAMES_UNITS[0], MULTICURVE_KNOWN_DATA, emptyBlock, PSMQDC, PSMQCSDC, false); } endTime = System.currentTimeMillis(); System.out.println("MulticurveBuildingDiscountingDiscountEUR3Test - " + nbTest + " curve construction / 3 units: " + (endTime - startTime) + " ms"); startTime = System.currentTimeMillis(); for (int looptest = 0; looptest < nbTest; looptest++) { makeCurvesFromDefinitions(DEFINITIONS_UNITS[1], GENERATORS_UNITS[1], NAMES_UNITS[1], MULTICURVE_KNOWN_DATA, emptyBlock, PSMQDC, PSMQCSDC, false); } endTime = System.currentTimeMillis(); System.out.println("MulticurveBuildingDiscountingDiscountEUR3Test - " + nbTest + " curve construction / 1 unit: " + (endTime - startTime) + " ms"); }

Target:
public void performance() { CurveBuildingBlockBundle emptyBlock = new CurveBuildingBlockBundle(); long startTime, endTime; int nbTest = 100; startTime = System.currentTimeMillis(); for (int looptest = 0; looptest < nbTest; looptest++) { makeCurvesFromDefinitions(DEFINITIONS_UNITS[0], GENERATORS_UNITS[0], NAMES_UNITS[0], MULTICURVE_KNOWN_DATA, emptyBlock, PSMQDC, PSMQCSDC, false); } endTime = System.currentTimeMillis(); System.out.println("MulticurveBuildingDiscountingDiscountEUR3Test - " + nbTest + " curve construction / 3 units: " + (endTime - startTime) + " ms"); startTime = System.currentTimeMillis(); for (int looptest = 0; looptest < nbTest; looptest++) { makeCurvesFromDefinitions(DEFINITIONS_UNITS[1], GENERATORS_UNITS[1], NAMES_UNITS[1], MULTICURVE_KNOWN_DATA, emptyBlock, PSMQDC, PSMQCSDC, false); } endTime = System.currentTimeMillis(); System.out.println("MulticurveBuildingDiscountingDiscountEUR3Test - " + nbTest + " curve construction / 1 unit: " + (endTime - startTime) + " ms"); }
Source:
public Builder withReceiverSection(String receiverSection) { feedbackAttributes.receiverSection = receiverSection == null ? "None" : receiverSection; return this; }

Target:
public Builder withReceiverSection(String receiverSection) { frca.receiverSection = receiverSection == null ? Const.DEFAULT_SECTION : receiverSection; return this; }
Source:
public void detected() { JavaCheckVerifier.verify("src/test/files/checks/SynchronizedClassUsageCheck.java", new SynchronizedClassUsageCheck()); JavaCheckVerifier.verify("src/test/files/checks/SynchronizedClassUsageByAPICheck.java", new SynchronizedClassUsageCheck()); }

Target:
public void detected() { JavaCheckVerifier.verifyNoIssueWithoutSemantic("src/test/files/checks/SynchronizedClassUsageCheck.java", new SynchronizedClassUsageCheck()); JavaCheckVerifier.verify("src/test/files/checks/SynchronizedClassUsageCheck.java", new SynchronizedClassUsageCheck()); JavaCheckVerifier.verify("src/test/files/checks/SynchronizedClassUsageByAPICheck.java", new SynchronizedClassUsageCheck()); }
Source:
private RecordReader<Group> readParquetFile(VirtualFile parquetFile, InputStream parquetFileStream) throws TranslatorException { try { File localFile = createTempFile(parquetFileStream); Path path = new Path(localFile.toURI()); String extension = getExtension(localFile.getName()); if (extension != "parquet") { throw new TranslatorException(ParquetPlugin.Event.TEIID23000, ParquetPlugin.Util.gs(ParquetPlugin.Event.TEIID23000)); } Configuration config = new Configuration(); reader = ParquetFileReader.open(HadoopInputFile.fromPath(path, config)); schema = reader.getFooter().getFileMetaData().getSchema(); columnIO = new ColumnIOFactory().getColumnIO(schema); PageReadStore pages = reader.readNextRowGroup(); return columnIO.getRecordReader(pages, new GroupRecordConverter(schema)); } catch (IOException e){ throw new TranslatorException(e); } }

Target:
private RecordReader<Group> readParquetFile(VirtualFile parquetFile, InputStream parquetFileStream) throws TranslatorException { try { if(this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONED_COLUMNS) != null) { partitionedColumnsValue = getPartitionedColumnsValues(parquetFile); } File localFile = createTempFile(parquetFileStream); Path path = new Path(localFile.toURI()); Configuration config = new Configuration(); FilterCompat.Filter rowGroupFilter = getRowGroupFilter(this.visitor.getColumnPredicates()); reader = ParquetFileReader.open(HadoopInputFile.fromPath(path, config), ParquetReadOptions.builder().withRecordFilter(rowGroupFilter).build()); schema = reader.getFooter().getFileMetaData().getSchema(); filteredSchema = getFilteredSchema(schema, this.visitor.getProjectedColumnNames()); columnIO = new ColumnIOFactory().getColumnIO(filteredSchema); PageReadStore pages = reader.readNextRowGroup(); pageRowCount = pages.getRowCount(); return columnIO.getRecordReader(pages, new GroupRecordConverter(filteredSchema), rowGroupFilter); } catch (IOException e){ throw new TranslatorException(e); } }
Source:
public void testGetAccountByIdBothSuccess() { Account testAccount = getTestAccount(); when(primaryAccountService.getAccountById(anyShort())).thenReturn(testAccount); when(secondaryAccountService.getAccountById(anyShort())).thenReturn(testAccount); assertEquals("Unexpected response", testAccount, compositeAccountService.getAccountById(testAccount.getId())); verify(primaryAccountService).getAccountById(testAccount.getId()); verify(secondaryAccountService).getAccountById(testAccount.getId()); assertEquals("Expected zero inconsistency", 0, metrics.getAccountDataInconsistencyCount.getCount()); }

Target:
public void testGetAccountByIdBothSuccess() { when(primaryAccountService.getAccountById(anyShort())).thenReturn(testAccount); when(secondaryAccountService.getAccountById(anyShort())).thenReturn(testAccount); assertEquals("Unexpected response", testAccount, compositeAccountService.getAccountById(testAccount.getId())); verify(primaryAccountService).getAccountById(testAccount.getId()); verify(secondaryAccountService).getAccountById(testAccount.getId()); assertEquals("Expected zero inconsistency", 0, metrics.accountDataInconsistencyCount.getCount()); }
Source:
private BlockingTimeoutException logAndHandleTimeout(LockRequestSpecification specification) { final String logMessage = "Lock service timed out after milliseconds" + " when servicing for client \"{}\""; log.info(logMessage, SafeArg.of("timeoutDurationMillis", blockingTimeLimitMillis), SafeArg.of("method", specification.method()), UnsafeArg.of("client", specification.client()), UnsafeArg.of("lockRequest", specification.lockRequest())); String errorMessage = String.format( logMessage.replace("{}", "%s"), blockingTimeLimitMillis, specification.method(), specification.client()); return new BlockingTimeoutException(errorMessage); }

Target:
private BlockingTimeoutException logAndHandleTimeout(LockRequestSpecification specification) { final String logMessage = "Lock service timed out after milliseconds" + " when servicing for client \"{}\""; log.info(logMessage, SafeArg.of("timeoutDurationMillis", blockingTimeLimitMillis), SafeArg.of("method", specification.method()), SafeArg.of("client", specification.client()), UnsafeArg.of("lockRequest", specification.lockRequest())); String errorMessage = String.format( logMessage.replace("{}", "%s"), blockingTimeLimitMillis, specification.method(), specification.client()); return new BlockingTimeoutException(errorMessage); }
Source:
public void requestPasswordReset_shouldCreateUserActivationKeyGivenEmail() throws Exception { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.setEmail("bwolf@gmail.com"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); assertNull(dao.getLoginCredential(createdUser).getActivationKey()); assertEquals(createdUser, userService.setUserActivationKey(createdUser)); handle(newPostRequest(RESET_PASSWORD_URI, "{\"usernameOrEmail\":\"" + "bwolfe@gmail.com" + "\"}")); assertNotNull(dao.getLoginCredential(createdUser).getActivationKey()); }

Target:
public void requestPasswordReset_shouldCreateUserActivationKeyGivenEmail() throws Exception { User u = userService.getUserByUuid("c98a1558-e131-11de-babe-001e378eb67e"); u.setEmail("butch@gmail.com"); assertNull(dao.getLoginCredential(u).getActivationKey()); handle(newPostRequest(RESET_PASSWORD_URI, "{\"usernameOrEmail\":\"" + u.getEmail() + "\"}")); assertNotNull(dao.getLoginCredential(u).getActivationKey()); }
Source:
private static File extractBaseDirectory(SMInputCursor sources, File defaultBaseDirectory) throws XMLStreamException { SMInputCursor source = sources.childElementCursor("source"); while (source.getNext() != null) { String path = source.collectDescendantText(); if (!StringUtils.isBlank(path)) { File baseDirectory = new File(path); if (!baseDirectory.isDirectory()) { throw new XMLStreamException("Invalid directory path in 'source' element: " + path); } return baseDirectory; } } return defaultBaseDirectory; }

Target:
private static File extractBaseDirectory(SMInputCursor sources, File defaultBaseDirectory) throws XMLStreamException { SMInputCursor source = sources.childElementCursor("source"); while (source.getNext() != null) { String path = source.collectDescendantText(); if (!StringUtils.isBlank(path)) { File baseDirectory = new File(path); if (baseDirectory.isDirectory()) { return baseDirectory; } else { LOG.warn("Invalid directory path in 'source' element: {}", path); } } } return defaultBaseDirectory; }
Source:
public Response signup(@FormParam("courseId") String courseId, @FormParam("components")Set<String> components, @FormParam("email")String email, @FormParam("message")String message) { if (UserDirectoryService.getAnonymousUser().equals(UserDirectoryService.getCurrentUser())) { throw new WebAppForbiddenException(); } CourseSignup entity = courseService.signup(courseId, components, email, message); ResponseBuilder builder = new ResponseBuilderImpl(); builder.status(201); builder.entity(entity); return builder.build(); }

Target:
public Response signup(@FormParam("courseId") String courseId, @FormParam("components")Set<String> components, @FormParam("email")String email, @FormParam("message")String message) { if (UserDirectoryService.getAnonymousUser().equals(UserDirectoryService.getCurrentUser())) { throw new WebAppForbiddenException(); } CourseSignup entity = courseService.signup(courseId, components, email, message); ResponseBuilder builder = Response.status(Response.Status.CREATED); builder.status(201); builder.entity(entity); return builder.build(); }
Source:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); CinderlibReturnValue returnValue; List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getDiskId().toString()); try { CinderlibCommandParameters params = new CinderlibCommandParameters( JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.DELETE_VOLUME, params); if (!returnValue.getSucceed()) { setSucceeded(false); return; } ManagedBlockStorageDisk disk = new ManagedBlockStorageDisk(); disk.setId(getParameters().getDiskId()); disk.setImageId(getParameters().getDiskId()); removeDiskFromDb(disk); } catch (Exception e) { log.error("Failed to remove volume: {}", e); setSucceeded(false); return; } setSucceeded(true); }

Target:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getDiskId().toString()); CinderlibReturnValue returnValue; try { CinderlibCommandParameters params = new CinderlibCommandParameters( JsonHelper.mapToJson(managedBlockStorage.getDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.DELETE_VOLUME, params); } catch (Exception e) { log.error("Failed to remove volume: {}", e); return; } if (!returnValue.getSucceed()) { return; } removeDiskFromDb(); setSucceeded(true); }
Source:
public void shouldFindByFile() throws Exception { RulesetService rulesetService = new RulesetService(); JSONObject ruleset = rulesetService.findByFile("ruleset_slubhh.xml"); JSONObject jsonObject = (JSONObject) ruleset.get("_source"); String actual = (String) jsonObject.get("file"); String expected = "ruleset_slubhh.xml"; assertEquals("Ruleset was not found in index!", expected, actual); }

Target:
public void shouldFindByFile() throws Exception { RulesetService rulesetService = new RulesetService(); JSONObject ruleset = rulesetService.findByFile("ruleset_test.xml"); JSONObject jsonObject = (JSONObject) ruleset.get("_source"); String actual = (String) jsonObject.get("file"); String expected = "ruleset_test.xml"; assertEquals("Ruleset was not found in index!", expected, actual); }
Source:
private boolean isPlatformExtern(String filePath, String symbolName) { if (emittedPlatformSymbols.contains(symbolName)) return false; if (filePath.startsWith("externs.zip String fileName = Iterables.getLast(Splitter.on("/").split(filePath)); switch (fileName) { case "chrome.js": case "deprecated.js": case "fetchapi.js": case "fileapi.js": case "flash.js": case "google.js": case "html5.js": case "intl.js": case "iphone.js": case "mediakeys.js": case "mediasource.js": case "page_visibility.js": case "streamapi.js": case "url.js": case "v8.js": case "webgl.js": case "webstorage.js": case "whatwg_encoding.js": case "window.js": return true; } return fileName.startsWith("es") || filePath.startsWith("gecko_") || filePath.startsWith("w3c_") || filePath.startsWith("ie_") || filePath.startsWith("webkit_"); }

Target:
private boolean isPlatformExtern(String filePath, String symbolName) { if (platformSymbolsMissingInTypeScript.contains(symbolName)) return false; if (filePath.startsWith("externs.zip String fileName = new File(filePath).getName(); return platformExternsFilenames.contains(fileName) || fileName.startsWith("es") || fileName.startsWith("gecko_") || fileName.startsWith("w3c_") || fileName.startsWith("ie_") || fileName.startsWith("webkit_"); }
Source:
private String httpGet(String url) { LOGGER.debug("Sending get to: {}",url); HttpGet get = new HttpGet(url); try { CloseableHttpResponse httpResponse = httpClient.execute(get); int statusCode = httpResponse.getStatusLine().getStatusCode(); String responseAsString = EntityUtils.toString(httpResponse.getEntity()); if (statusCode != 200) { String errorMessage = String.format("Retrieving of primes failed with http status %s body %s", statusCode, responseAsString); LOGGER.info(errorMessage); throw new PrimeFailedException(errorMessage); } LOGGER.info("Received response from scassandra {}", responseAsString); return responseAsString; } catch (IOException e) { LOGGER.info("Retrieving failed", e); throw new PrimeFailedException("Retrieving of primes failed.", e); } }

Target:
private String httpGet(String url) { LOGGER.debug("Sending get to: {}",url); HttpGet get = new HttpGet(url); try { CloseableHttpResponse httpResponse = httpClient.execute(get); int statusCode = httpResponse.getStatusLine().getStatusCode(); String responseAsString = EntityUtils.toString(httpResponse.getEntity()); if (statusCode != 200) { String errorMessage = String.format("Retrieving of primes failed with http status %s body %s", statusCode, responseAsString); LOGGER.info(errorMessage); throw new PrimeFailedException(errorMessage); } LOGGER.debug("Received response from scassandra {}", responseAsString); return responseAsString; } catch (IOException e) { LOGGER.info("Retrieving failed", e); throw new PrimeFailedException("Retrieving of primes failed.", e); } }
Source:
public void setRollbackOnly() { if ( !isActive() ) { if ( jpaCompliance.isJpaTransactionComplianceEnabled() ) { throw new IllegalStateException( "JPA compliance dictates throwing IllegalStateException when #setRollbackOnly " + "is called on non-active transaction" ); } else if ( LOG.isDebugEnabled() ) { LOG.debug( "#setRollbackOnly called on a not-active transaction" ); } } else { markRollbackOnly(); } }

Target:
public void setRollbackOnly() { if ( !isActive() ) { if ( jpaCompliance.isJpaTransactionComplianceEnabled() ) { throw new IllegalStateException( "JPA compliance dictates throwing IllegalStateException when #setRollbackOnly " + "is called on non-active transaction" ); } else { LOG.debug( "#setRollbackOnly called on a not-active transaction" ); } } else { markRollbackOnly(); } }
Source:
public void close() throws IOException { synchronized (this) { while (mCookieUsers > 0) { try { this.wait(); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } } mCookieUsers = -1; } if (mCookie != null) { if (closeDexFile(mCookie)) { mCookie = null; } } }

Target:
public void close() throws IOException { mCookieLock.close(); synchronized (this) { if (mCookie != null) { if (closeDexFile(mCookie)) { mCookie = null; } } } }
Source:
protected boolean canAddVm(ArrayList<String> reasons, Collection<StorageDomain> destStorages) { VmStatic vmStaticFromParams = getParameters().getVmStaticData(); boolean returnValue = canAddVm(reasons, vmStaticFromParams.getName(), getStoragePoolId(), vmStaticFromParams.getPriority()); if (returnValue) { List<ValidationError> validationErrors = validateCustomProperties(vmStaticFromParams); if (!validationErrors.isEmpty()) { VmPropertiesUtils.getInstance().handleCustomPropertiesError(validationErrors, reasons); returnValue = false; } } if (returnValue && shouldCheckSpaceInStorageDomains()) { if (!getStoragePoolId().equals(getStoragePoolIdFromSourceImageContainer())) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH.toString()); returnValue = false; } else { for (StorageDomain domain : destStorages) { StorageDomainValidator storageDomainValidator = new StorageDomainValidator(domain); if (!validate(storageDomainValidator.isDomainWithinThresholds()) || !validate(storageDomainValidator.isDomainHasSpaceForRequest(getNeededDiskSize(domain.getId())))) { return false; } if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } } } } if (returnValue) { returnValue = isDedicatedVdsOnSameCluster(vmStaticFromParams); } return returnValue; }

Target:
protected boolean canAddVm(ArrayList<String> reasons, Collection<StorageDomain> destStorages) { VmStatic vmStaticFromParams = getParameters().getVmStaticData(); boolean returnValue = canAddVm(reasons, vmStaticFromParams.getName(), getStoragePoolId(), vmStaticFromParams.getPriority()); if (returnValue) { List<ValidationError> validationErrors = validateCustomProperties(vmStaticFromParams); if (!validationErrors.isEmpty()) { VmPropertiesUtils.getInstance().handleCustomPropertiesError(validationErrors, reasons); returnValue = false; } } if (returnValue && shouldCheckSpaceInStorageDomains()) { if (!getStoragePoolId().equals(getStoragePoolIdFromSourceImageContainer())) { reasons.add(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_MATCH.toString()); returnValue = false; } else { for (StorageDomain domain : destStorages) { StorageDomainValidator storageDomainValidator = new StorageDomainValidator(domain); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } if (!validate(storageDomainValidator.isDomainWithinThresholds()) || !validate(storageDomainValidator.isDomainHasSpaceForRequest(getNeededDiskSize(domain.getId())))) { return false; } } } } if (returnValue) { returnValue = isDedicatedVdsOnSameCluster(vmStaticFromParams); } return returnValue; }
Source:
protected boolean checkAndInitializeSdk(@NonNull final Activity activity, @NonNull final Map<String, Object> localExtras, @NonNull final Map<String, String> serverExtras) throws Exception { log( DEBUG, "Initializing AppLovin rewarded video..." ); if ( !initialized ) { AppLovinSdk.initializeSdk( activity ); AppLovinSdk.getInstance( activity ).setPluginVersion( "MoPub-Certified-2.1.0" ); initialized = true; return true; } return false; }

Target:
protected boolean checkAndInitializeSdk(@NonNull final Activity activity, @NonNull final Map<String, Object> localExtras, @NonNull final Map<String, String> serverExtras) throws Exception { log( DEBUG, "Initializing AppLovin rewarded video..." ); if ( !initialized ) { AppLovinSdk.initializeSdk( activity ); AppLovinSdk.getInstance( activity ).setPluginVersion( "MoPub-Certified-2.1.0" ); AppLovinIncentivizedInterstitial incentivizedInterstitial = AppLovinIncentivizedInterstitial.create( activity ); incentivizedInterstitial.preload( null ); GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.put( DEFAULT_ZONE, incentivizedInterstitial ); initialized = true; return true; } return false; }
Source:
public PlanNodeCostEstimate visitRowNumber(RowNumberNode node, Void context) { List<Symbol> symbols = node.getOutputSymbols(); if (!node.getMaxRowCountPerPartition().isPresent()) { symbols = ImmutableList.<Symbol>builder() .addAll(node.getPartitionBy()) .add(node.getRowNumberSymbol()) .build(); } return cpuCost(getStats(node).getOutputSizeInBytes(symbols, types)); }

Target:
public PlanNodeCostEstimate visitRowNumber(RowNumberNode node, Void context) { List<Symbol> symbols = node.getOutputSymbols(); if (!node.getMaxRowCountPerPartition().isPresent()) { symbols = ImmutableList.<Symbol>builder() .addAll(node.getPartitionBy()) .add(node.getRowNumberSymbol()) .build(); } PlanNodeStatsEstimate stats = getStats(node); double cpuCost = stats.getOutputSizeInBytes(symbols, types); double memoryCost = node.getPartitionBy().isEmpty() ? 0 : stats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, 0); }
Source:
protected List<Artifact> resolveArtifacts(List<Map<String, Object>> manualTriggerArtifacts) { List<Artifact> resolvedArtifacts = new ArrayList<>(); for (Map a : manualTriggerArtifacts) { Artifact artifact = objectMapper.convertValue(a, Artifact.class); if (Strings.isNullOrEmpty(artifact.getName()) || Strings.isNullOrEmpty(artifact.getVersion()) || Strings.isNullOrEmpty(artifact.getLocation())) { log.error("Artifact does not have enough information to fetch. " + "Artifact must contain name, version, and location."); } else { try { Artifact resolvedArtifact = artifactInfoService.get() .getArtifactByVersion(artifact.getLocation(), artifact.getName(), artifact.getVersion()); if (resolvedArtifact != null) { resolvedArtifacts.add(resolvedArtifact); } } catch (NotFoundException e) { log.error("Artifact " + artifact.getName() + " " + artifact.getVersion() + " not found in image provider " + artifact.getLocation()); } } } return resolvedArtifacts; }

Target:
protected List<Artifact> resolveArtifacts(List<Map<String, Object>> manualTriggerArtifacts) { List<Artifact> resolvedArtifacts = new ArrayList<>(); for (Map a : manualTriggerArtifacts) { Artifact artifact = objectMapper.convertValue(a, Artifact.class); if (Strings.isNullOrEmpty(artifact.getName()) || Strings.isNullOrEmpty(artifact.getVersion()) || Strings.isNullOrEmpty(artifact.getLocation())) { log.error("Artifact does not have enough information to fetch. " + "Artifact must contain name, version, and location."); resolvedArtifacts.add(artifact); } else { try { Artifact resolvedArtifact = artifactInfoService.get() .getArtifactByVersion(artifact.getLocation(), artifact.getName(), artifact.getVersion()); resolvedArtifacts.add(resolvedArtifact); } catch (RetrofitError e) { if (e.getResponse() != null && e.getResponse().getStatus() == HttpStatus.NOT_FOUND.value()) { log.error("Artifact " + artifact.getName() + " " + artifact.getVersion() + " not found in image provider " + artifact.getLocation()); resolvedArtifacts.add(artifact); } else throw e; } } } return resolvedArtifacts; }
Source:
public void onCreate(Bundle savedInstanceState) { LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); LOG.d(TAG, "CordovaActivity.onCreate()"); loadConfig(); if(!preferences.getBoolean("ShowTitle", false)) { getWindow().requestFeature(Window.FEATURE_NO_TITLE); } if(preferences.getBoolean("SetFullscreen", false)) { Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else if (preferences.getBoolean("Fullscreen", false)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setSystemUiVisibilityMode(getWindow()); getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { setSystemUiVisibilityMode(getWindow()); } } }); } else { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } } else { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } super.onCreate(savedInstanceState); cordovaInterface = makeCordovaInterface(); if(savedInstanceState != null) { cordovaInterface.restoreInstanceState(savedInstanceState); } }

Target:
public void onCreate(Bundle savedInstanceState) { LOG.i(TAG, "Apache Cordova native platform version " + CordovaWebView.CORDOVA_VERSION + " is starting"); LOG.d(TAG, "CordovaActivity.onCreate()"); loadConfig(); if(!preferences.getBoolean("ShowTitle", false)) { getWindow().requestFeature(Window.FEATURE_NO_TITLE); } if(preferences.getBoolean("SetFullscreen", false)) { Log.d(TAG, "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version."); preferences.set("Fullscreen", true); } if(preferences.getBoolean("Fullscreen", false)) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { immersiveMode = true; } else { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } } else { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); } super.onCreate(savedInstanceState); cordovaInterface = makeCordovaInterface(); if(savedInstanceState != null) { cordovaInterface.restoreInstanceState(savedInstanceState); } }
Source:
public void validate_shouldPassIfTheNameIsUniqueAmongstAllConceptMapTypeNames() throws Exception { ConceptMapType mapType = new ConceptMapType(); mapType.setName("unique-name"); Errors errors = new BindException(mapType, "mapType"); PowerMockito.when(conceptService.getConceptMapTypeByName(Mockito.argThat(TestUtil.equalsMatcher("unique-name")))) .thenReturn(null); new ConceptMapTypeValidator().validate(mapType, errors); Assert.assertEquals(false, errors.hasErrors()); }

Target:
public void validate_shouldPassIfTheNameIsUniqueAmongstAllConceptMapTypeNames() throws Exception { ConceptMapType mapType = new ConceptMapType(); mapType.setName("unique-name"); Errors errors = new BindException(mapType, "mapType"); when(conceptService.getConceptMapTypeByName(eq("unique-name"))).thenReturn(null); new ConceptMapTypeValidator().validate(mapType, errors); Assert.assertEquals(false, errors.hasErrors()); }
Source:
private PKCS10CertificationRequest getCsr(X500Name subject, PublicKey pubKey, PrivateKey priKey, char[] password) throws GeneralSecurityException, IOException { SubjectPublicKeyInfo pkInfo = SubjectPublicKeyInfo.getInstance(pubKey .getEncoded()); JcaContentSignerBuilder signerBuilder = new JcaContentSignerBuilder( "SHA1withRSA"); ContentSigner signer; try { signer = signerBuilder.build(priKey); } catch (OperatorCreationException e) { IOException ioe = new IOException(); ioe.initCause(e); throw ioe; } PKCS10CertificationRequestBuilder builder = new PKCS10CertificationRequestBuilder(subject, pkInfo); if (password != null) { builder.addAttribute( PKCSObjectIdentifiers.pkcs_9_at_challengePassword, new DERPrintableString(new String(password)) ); } return builder.build(signer); }

Target:
private PKCS10CertificationRequest getCsr( X500Name subject, PublicKey pubKey, PrivateKey priKey, char[] password ) throws GeneralSecurityException, IOException { return csrBuilder(subject, pubKey) .addAttribute( PKCSObjectIdentifiers.pkcs_9_at_challengePassword, new DERPrintableString(new String(password)) ) .build(getContentSigner(priKey)); }
Source:
public void destroy() { destroyToolbar(); destroyPalette(); sessionManager.dispose(); getDisplayer().destroy(); getView().destroy(); diagram = null; }

Target:
public void destroy() { destroyToolbar(); destroyPalette(); sessionManager.destroy(); getDisplayer().destroy(); getView().destroy(); diagram = null; }
Source:
public static ISchedulingRule getRuleForContainers(Collection<IPath> paths) { List<ISchedulingRule> rules = new ArrayList<ISchedulingRule>(); IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace() .getRuleFactory(); for (IPath path : paths) { IResource resource = ResourceUtil.getResourceForLocation(path); if (resource != null) { IContainer container = resource.getParent(); if (!(container instanceof IWorkspaceRoot)) { ISchedulingRule rule = ruleFactory.modifyRule(container); if (rule != null) rules.add(rule); } } } if (rules.size() == 0) return null; else return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()])); }

Target:
public static ISchedulingRule getRuleForContainers(Collection<IPath> paths) { List<ISchedulingRule> rules = new ArrayList<ISchedulingRule>(); IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace() .getRuleFactory(); for (IPath path : paths) { IResource resource = ResourceUtil.getResourceForLocation(path); if (resource != null) { IContainer container = resource.getParent(); ISchedulingRule rule = ruleFactory.modifyRule(container); if (rule != null) rules.add(rule); } } if (rules.size() == 0) return null; else return new MultiRule(rules.toArray(new ISchedulingRule[rules.size()])); }
Source:
protected CronWorkflow(String type) { this(type, new Builder() .setHistoryDeletableAfter(weeks(1)) .build()); }

Target:
protected CronWorkflow(String type) { this(type, new Builder().setHistoryDeletableAfter(days(45)).setDeleteHistoryCondition(oncePerDay()).build()); }
Source:
public static URL mergeUrl(URL remoteUrl, Map<String, String> localMap) { Map<String, String> remoteMap = remoteUrl.getParameters(); if (remoteMap == null || remoteMap.size() <= 0) { return remoteUrl.addParameters(localMap); } remoteMap.remove(THREAD_NAME_KEY); remoteMap.remove(THREADPOOL_KEY); remoteMap.remove(CORE_THREADS_KEY); remoteMap.remove(THREADS_KEY); remoteMap.remove(QUEUES_KEY); remoteMap.remove(ALIVE_KEY); remoteMap.remove(TRANSPORTER_KEY); if (localMap != null && localMap.size() > 0) { String remoteApplication = remoteMap.get(APPLICATION_KEY); remoteMap.putAll(localMap); remoteMap.put(REMOTE_APPLICATION_KEY, remoteApplication); String remoteFilter = remoteMap.get(REFERENCE_FILTER_KEY); String localFilter = localMap.get(REFERENCE_FILTER_KEY); if (remoteFilter != null && remoteFilter.length() > 0 && localFilter != null && localFilter.length() > 0) { remoteMap.put(REFERENCE_FILTER_KEY, remoteFilter + "," + localFilter); } String remoteListener = remoteMap.get(INVOKER_LISTENER_KEY); String localListener = localMap.get(INVOKER_LISTENER_KEY); if (remoteListener != null && remoteListener.length() > 0 && localListener != null && localListener.length() > 0) { remoteMap.put(INVOKER_LISTENER_KEY, remoteListener + "," + localListener); } } return remoteUrl; }

Target:
public static URL mergeUrl(URL remoteUrl, Map<String, String> localMap) { Map<String, String> remoteMap = remoteUrl.getParameters(); if (remoteMap == null || remoteMap.size() <= 0) { return remoteUrl.addParameters(localMap); } remoteMap.remove(THREAD_NAME_KEY); remoteMap.remove(THREADPOOL_KEY); remoteMap.remove(CORE_THREADS_KEY); remoteMap.remove(THREADS_KEY); remoteMap.remove(QUEUES_KEY); remoteMap.remove(ALIVE_KEY); remoteMap.remove(TRANSPORTER_KEY); remoteMap.put(REMOTE_APPLICATION_KEY, remoteMap.get(APPLICATION_KEY)); if (isNotEmptyMap(localMap)) { remoteMap.putAll(localMap); String remoteFilter = remoteMap.get(REFERENCE_FILTER_KEY); String localFilter = localMap.get(REFERENCE_FILTER_KEY); if (isNotEmpty(remoteFilter) && isNotEmpty(localFilter)) { remoteMap.put(REFERENCE_FILTER_KEY, remoteFilter + "," + localFilter); } String remoteListener = remoteMap.get(INVOKER_LISTENER_KEY); String localListener = localMap.get(INVOKER_LISTENER_KEY); if (isNotEmpty(remoteListener) && isNotEmpty(localListener)) { remoteMap.put(INVOKER_LISTENER_KEY, remoteListener + "," + localListener); } } return remoteUrl; }
Source:
public boolean isSameDictionary(final SAMSequenceDictionary that) { if (that == null || that.mSequences == null) return false; if (this == that) return true; final Iterator<SAMSequenceRecord> thatSequences = that.mSequences.iterator(); for (final SAMSequenceRecord thisSequence : mSequences) { if (!thatSequences.hasNext()) return false; else { final SAMSequenceRecord thatSequence = thatSequences.next(); if(!thatSequence.isSameSequence(thisSequence)) return false; } } return !thatSequences.hasNext(); }

Target:
public boolean isSameDictionary(final SAMSequenceDictionary that) { if (that == null || that.mSequences == null) return false; if (this == that) return true; final Iterator<SAMSequenceRecord> thatSequences = that.mSequences.iterator(); for (final SAMSequenceRecord thisSequence : mSequences) { if (!thatSequences.hasNext()) { return false; } else { final SAMSequenceRecord thatSequence = thatSequences.next(); if (!thatSequence.isSameSequence(thisSequence)) { return false; } } } return !thatSequences.hasNext(); }
Source:
private boolean isDistributable(AnalysisJob job) { for (ComponentJob componentJob : _sparkJobContext.getComponentList()) { if (componentJob instanceof AnalyzerJob) { AnalyzerJob analyzerJob = (AnalyzerJob) componentJob; if (!analyzerJob.getDescriptor().isDistributable()) { return false; } } } return true; }

Target:
private boolean isDistributable(AnalysisJob job) { for (ComponentJob componentJob : _sparkJobContext.getComponentList()) { if (!componentJob.getDescriptor().isDistributable()) { return false; } } return true; }
Source:
static Long round(Long timeValue, Number roundToNearest) { return (timeValue / roundToNearest.intValue()) * roundToNearest.intValue(); }

Target:
static Long round(Long timeValue, Number roundToNearest) { long roundingValue = roundToNearest.longValue(); return (timeValue / roundingValue) * roundingValue; }
Source:
public int getSequenceSize() { if (size() == 0) { return 0; } else { Message<?> message = getOne(); if (message != null) { return message.getHeaders().get(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, Integer.class); } else { return 0; } } }

Target:
public int getSequenceSize() { if (size() == 0) { return 0; } else { Message<?> message = getOne(); if (message != null) { Integer sequenceSize = message.getHeaders() .get(IntegrationMessageHeaderAccessor.SEQUENCE_SIZE, Integer.class); return (sequenceSize != null ? sequenceSize : 0); } else { return 0; } } }
Source:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(LocalFinalVariableNameCheck.class); final String pattern = "^[a-z][a-zA-Z0-9]*$"; final String[] expected = { "17:19: " + getCheckMessage(MSG_INVALID_PATTERN, "CDE", pattern), "23:29: " + getCheckMessage(MSG_INVALID_PATTERN, "BR", pattern), "33:35: " + getCheckMessage(MSG_INVALID_PATTERN, "BR", pattern), }; verify(checkConfig, getPath("InputLocalFinalVariableName.java"), expected); }

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(LocalFinalVariableNameCheck.class); final String pattern = "^[a-z][a-zA-Z0-9]*$"; final String[] expected = { "123:19: " + getCheckMessage(MSG_INVALID_PATTERN, "CDE", pattern), }; verify(checkConfig, getPath("InputLocalFinalVariableName.java"), expected); }
Source:
public String toString() { StringBuilder sb = new StringBuilder("Marker ["); sb.append("On: ").append(resource.getFullPath()); MarkerInfo info = getInfo(); if (info == null) { sb.append(", not found]"); return sb.toString(); } sb.append(", id: ").append(info.getId()); sb.append(", type: ").append(info.getType()); Map<String, Object> attributes = info.getAttributes(); if (attributes != null) { TreeMap<String, Object> tm = new TreeMap<>(attributes); Set<Entry<String, Object>> set = tm.entrySet(); if (!set.isEmpty()) { sb.append(", attributes: ["); for (Entry<String, Object> entry : set) { sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(", "); } sb.setLength(sb.length() - 2); sb.append("]"); } } sb.append(", created: ").append(new Date(info.getCreationTime())); sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder("Marker ["); sb.append("on: ").append(resource.getFullPath()); MarkerInfo info = getInfo(); if (info == null) { sb.append(", not found]"); return sb.toString(); } sb.append(", id: ").append(info.getId()); sb.append(", type: ").append(info.getType()); Map<String, Object> attributes = info.getAttributes(); if (attributes != null) { TreeMap<String, Object> tm = new TreeMap<>(attributes); Set<Entry<String, Object>> set = tm.entrySet(); if (!set.isEmpty()) { sb.append(", attributes: ["); for (Entry<String, Object> entry : set) { sb.append(entry.getKey()).append(": ").append(entry.getValue()).append(", "); } sb.setLength(sb.length() - 2); sb.append(']'); } } sb.append(", created: ").append(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(new Date(info.getCreationTime()))); sb.append(']'); return sb.toString(); }
Source:
public static Parser createParser() { return new org.apache.batik.css.parser.Parser() { @Override protected boolean isPseudoElement(final String s) { if (super.isPseudoElement(s)) { return true; } else { switch (s.charAt(0)) { case 't': case 'T': return s.equalsIgnoreCase("target"); } return false; } } }; }

Target:
public static Parser createParser() { return new org.apache.batik.css.parser.Parser() { @Override protected boolean isPseudoElement(final String s) { if (super.isPseudoElement(s)) { return true; } else { return s.equalsIgnoreCase(CSS.PSEUDO_TARGET); } } @Override protected Scanner createScanner(final InputSource source) { documentURI = source.getURI(); if (documentURI == null) { documentURI = ""; } final Reader r = source.getCharacterStream(); if (r != null) { return new CssScanner(r); } InputStream is = source.getByteStream(); if (is != null) { return new CssScanner(is, source.getEncoding()); } final String uri = source.getURI(); if (uri == null) { throw new CSSException(formatMessage("empty.source", null)); } try { final ParsedURL purl = new ParsedURL(uri); is = purl.openStreamRaw(CSSConstants.CSS_MIME_TYPE); return new CssScanner(is, source.getEncoding()); } catch (final IOException e) { throw new CSSException(e); } } @Override protected void parseRuleSet() { if (((CssScanner) scanner).getCurrent() == '|') { ((CssScanner) scanner).joinIdentifier(); } super.parseRuleSet(); } }; }
Source:
public void tags() throws IOException { JsonReader reader = newReader("{}"); assertThat(reader.getTag(String.class)).isNull(); assertThat(reader.getTag(Integer.class)).isNull(); assertThat(reader.getTags()).isEmpty(); reader.setTag(String.class, "Foo"); reader.setTag(Integer.class, "Bar"); assertThat(reader.getTag(String.class)).isEqualTo("Foo"); assertThat(reader.getTag(Integer.class)).isEqualTo("Bar"); assertThat(reader.getTags()) .containsOnly( new SimpleEntry<Class<?>, Object>(String.class, "Foo"), new SimpleEntry<Class<?>, Object>(Integer.class, "Bar")); }

Target:
public void tags() throws IOException { JsonReader reader = newReader("{}"); assertThat(reader.tag(Integer.class)).isNull(); assertThat(reader.tag(CharSequence.class)).isNull(); reader.setTag(Integer.class, 1); reader.setTag(CharSequence.class, "Foo"); try { reader.setTag((Class) CharSequence.class, 1); fail(); } catch (IllegalArgumentException expected) { assertThat(expected).hasMessage("Tag value must be of type java.lang.CharSequence"); } assertThat(reader.tag(Integer.class)).isEqualTo(1).isInstanceOf(Integer.class); assertThat(reader.tag(CharSequence.class)).isEqualTo("Foo").isInstanceOf(String.class); assertThat(reader.tag(String.class)).isNull(); }
Source:
public void sendResponse(ReplyHeader h, Record r, String tag) throws IOException { try { if (!channel.isOpen()) { return; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos); try { baos.write(fourBytes); bos.writeRecord(h, "header"); if (r != null) { bos.writeRecord(r, tag); } baos.close(); } catch (IOException e) { LOG.error("Error serializing response"); } byte b[] = baos.toByteArray(); ByteBuffer bb = ByteBuffer.wrap(b); bb.putInt(b.length - 4).rewind(); sendBuffer(bb); if (h.getXid() > 0) { if (!zkServer.shouldThrottle(outstandingCount.decrementAndGet())) { enableRecv(); } } } catch (Exception e) { throw new IOException(e); } }

Target:
public void sendResponse(ReplyHeader h, Record r, String tag) throws IOException { try { if (!channel.isOpen()) { return; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos); baos.write(fourBytes); bos.writeRecord(h, "header"); if (r != null) { bos.writeRecord(r, tag); } baos.close(); byte b[] = baos.toByteArray(); ByteBuffer bb = ByteBuffer.wrap(b); bb.putInt(b.length - 4).rewind(); sendBuffer(bb); if (h.getXid() > 0) { if (!zkServer.shouldThrottle(outstandingCount.decrementAndGet())) { enableRecv(); } } } catch (Exception e) { throw new IOException(e); } }
Source:
public String toString() { return toStringHelper(this) .add("setSessionProperties", setSessionProperties) .add("clearSessionProperties", clearSessionProperties) .add("addedPreparedStatements", addedPreparedStatements) .add("deallocatedPreparedStatements", deallocatedPreparedStatements) .add("startedTransactionId", startedTransactionId) .add("clearTransactionId", clearTransactionId) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("setSessionProperties", setSessionProperties) .add("clearSessionProperties", clearSessionProperties) .add("addedPreparedStatements", addedPreparedStatements) .add("deallocatedPreparedStatements", deallocatedPreparedStatements) .add("startedTransactionId", startedTransactionId) .add("clearTransactionId", clearTransactionId) .omitNullValues() .toString(); }
Source:
private void buildIndex() { int i = 0; index.clear(); Entry q = head; while (q != null) { if (++i % 100 == 0) { index.add(q); } q = q.next; } }

Target:
private void buildIndex() { int i = 0; index.clear(); Entry q = head; while (q != null) { if (++i % 100 == 0) index.add(q); q = q.next; } }
Source:
public void onStartup(final ObservablePath path, final PlaceRequest place) { super.init(path, place, type); testRunnerReportingPanel.reset(); scenarioSimulationEditorPresenter.init(this, (ObservablePath) place.getPath()); }

Target:
public void onStartup(final ObservablePath path, final PlaceRequest place) { super.init(path, place, type); scenarioSimulationEditorPresenter.setWrapper(this); scenarioSimulationEditorPresenter.setPath(path); }