auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDRepresentationMoveToRootObjectsMigrationDone() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); assertTrue("Check the migration logic.", ((XMLResource) analysis.eResource()).getEObjectToExtensionMap().isEmpty()); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkFileContainsDRepresentation(analysis.eResource().getURI(), false, WhereToFindDRep.IN_DVIEW, "After migration, the resource should not contain a DRepresentation in DView.ownedRepresentations.."); checkFileContainsDRepresentation(analysis.eResource().getURI(), true, WhereToFindDRep.AS_ROOT_OBJECTS, "After migration, the resource should contain a DRepresentation as root object."); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }

Target:
public void testDRepresentationMoveToRootObjectsMigrationDone() { ResourceSet set = new ResourceSetImpl(); DAnalysis analysis = null; try { analysis = (DAnalysis) ModelUtils.load(URI.createPlatformResourceURI(TEMPORARY_PROJECT_NAME + "/" + SESSION_RESOURCE_NAME, true), set); } catch (IOException e) { failCheckData(); } assertNotNull("Check the representation file test data.", analysis); assertTrue("Check the migration logic.", ((XMLResource) analysis.eResource()).getEObjectToExtensionMap().isEmpty()); String version = analysis.getVersion(); assertTrue("Before save, the migration framework will return true even if the migration has been done during load.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); try { analysis.eResource().save(Collections.emptyMap()); } catch (IOException e) { failCheckData(); } version = analysis.getVersion(); assertFalse("The version tag should now be set telling that the migration was done.", RepresentationsFileMigrationService.getInstance().isMigrationNeeded(Version.parseVersion(version))); checkFileContainsDRepresentation(analysis.eResource().getURI(), false, WhereToFindDRep.IN_DVIEW, "After migration, the resource should not contain a DRepresentation in DView.ownedRepresentations."); checkFileContainsDRepresentation(analysis.eResource().getURI(), true, WhereToFindDRep.AS_ROOT_OBJECTS, "After migration, the resource should contain a DRepresentation as root object."); assertFalse(getErrorLoggersMessage(), doesAnErrorOccurs()); }
Source:
private static double calculateFob(final Genotype genotype, final boolean isRelevantArtifact) { double fob = 0; final int altF2R1 = OrientationBiasUtils.getGenotypeInteger(genotype, ALT_F2R1, 0); final int altF1R2 = OrientationBiasUtils.getGenotypeInteger(genotype, ALT_F1R2, 0); if (isRelevantArtifact) { fob = altF1R2 / (double) (altF1R2 + altF2R1); } else { fob = altF2R1 / (double) (altF1R2 + altF2R1); } return fob; }

Target:
private static double calculateFob(final Genotype genotype, final boolean isRelevantArtifact) { final int altF2R1 = OrientationBiasUtils.getGenotypeInteger(genotype, GATKVCFConstants.OXOG_ALT_F2R1_KEY, 0); final int altF1R2 = OrientationBiasUtils.getGenotypeInteger(genotype, GATKVCFConstants.OXOG_ALT_F1R2_KEY, 0); return (isRelevantArtifact ? altF1R2 : altF2R1) / (double) (altF1R2 + altF2R1); }
Source:
public PutObjectResponse createFolder(final String bucketName, final String folderName) throws IOException { final String normalizedFolderName = ensureNameEndsWithSlash(folderName); final Ds3Object ds3Object = new Ds3Object(normalizedFolderName, 0); final PutBulkJobSpectraS3Response jobResponse = client .putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(bucketName, ImmutableList.of(ds3Object))); final PutObjectRequest folderRequest = new PutObjectRequest( bucketName, normalizedFolderName, new ByteArraySeekableByteChannel(0), jobResponse.getMasterObjectList().getJobId(), 0, 0); return client.putObject(folderRequest); }

Target:
public void createFolder(final String bucketName, final String folderName) throws IOException { final String normalizedFolderName = ensureNameEndsWithSlash(folderName); final Ds3Object ds3Object = new Ds3Object(normalizedFolderName, 0); final PutBulkJobSpectraS3Response jobResponse = client .putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(bucketName, ImmutableList.of(ds3Object))); final PutObjectRequest folderRequest = new PutObjectRequest( bucketName, normalizedFolderName, new ByteArraySeekableByteChannel(0), jobResponse.getMasterObjectList().getJobId(), 0, 0); client.putObject(folderRequest); }
Source:
public static org.jboss.jbossts.txbridge.outbound.OutboundBridge getOutboundBridge() { txbridgeLogger.logger.trace("OutboundBridgeManager.getOutboundBridge()"); try { Transaction transaction = (Transaction)TransactionManager.transactionManager(new InitialContext()).getTransaction(); transctionToUidMappings.putIfAbsent(transaction, new Uid()); Uid outboundMappingUid = transctionToUidMappings.get(transaction); if(!outboundBridgeMappings.containsKey(outboundMappingUid)) { createMapping(transaction, outboundMappingUid); } return outboundBridgeMappings.get(outboundMappingUid); } catch(SystemException | NamingException e) { txbridgeLogger.logger.error(e); } return null; }

Target:
public static org.jboss.jbossts.txbridge.outbound.OutboundBridge getOutboundBridge() { txbridgeLogger.logger.trace("OutboundBridgeManager.getOutboundBridge()"); try { Transaction transaction = (Transaction)TransactionManager.transactionManager(new InitialContext()).getTransaction(); if(!outboundBridgeMappings.containsKey(transaction)) { createMapping(transaction); } return outboundBridgeMappings.get(transaction); } catch(SystemException | NamingException e) { txbridgeLogger.logger.error(e); } return null; }
Source:
public void start(Environment env) throws IOException { try { if (canRunAs()) { parseCommandLine(); final Context ctx = callingContext.subContext(newSession(), join(args)); final Context old = sshScope.set(ctx); try { final BaseCommand cmd = dispatcher.get(); cmd.setArguments(args.toArray(new String[args.size()])); provideStateTo(cmd); atomicCmd.set(cmd); cmd.start(env); } finally { sshScope.set(old); } } else { throw new UnloggedFailure(1, "fatal: Not a peer daemon"); } } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes("UTF-8")); err.flush(); onExit(1); } }

Target:
public void start(Environment env) throws IOException { try { checkCanRunAs(); parseCommandLine(); final Context ctx = callingContext.subContext(newSession(), join(args)); final Context old = sshScope.set(ctx); try { final BaseCommand cmd = dispatcher.get(); cmd.setArguments(args.toArray(new String[args.size()])); provideStateTo(cmd); atomicCmd.set(cmd); cmd.start(env); } finally { sshScope.set(old); } } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes("UTF-8")); err.flush(); onExit(1); } }
Source:
private void summarizeTimings(String prefix, CommandSender sender, Function<Map.Entry<String, Long>, String> formatter, Stream<Map.Entry<String, Long>> stream) { List<Entry<String, Long>> results = stream.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList()); if (sender instanceof Player) { TextComponent component = new TextComponent(prefix); component.setColor(ChatColor.GOLD); TextComponent hoverComponent = new TextComponent("\n Hover for more details..."); hoverComponent.setColor(ChatColor.GRAY); hoverComponent.setItalic(true); StringBuilder builder = new StringBuilder(); int hidden = 0; for (Map.Entry<String, Long> entry : results) { if (entry.getValue() > VISIBILITY_THRESHOLD) { builder.append("\n&e").append(formatter.apply(entry)); } else { hidden++; } } builder.append("\n\n&c+ &6").append(hidden).append(" more"); hoverComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColors.color(builder.toString())))); component.addExtra(hoverComponent); sender.spigot().sendMessage(component); } else { int hidden = 0; sender.sendMessage(ChatColor.GOLD + prefix); for (Map.Entry<String, Long> entry : results) { if (entry.getValue() > VISIBILITY_THRESHOLD) { sender.sendMessage(" " + ChatColor.stripColor(formatter.apply(entry))); } else { hidden++; } } sender.sendMessage("+ " + hidden + " more"); } }

Target:
private void summarizeTimings(String prefix, CommandSender sender, Function<Map.Entry<String, Long>, String> formatter, Stream<Map.Entry<String, Long>> stream) { List<Entry<String, Long>> results = stream.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toList()); if (sender instanceof Player) { TextComponent component = new TextComponent(prefix); component.setColor(ChatColor.GOLD); TextComponent hoverComponent = new TextComponent("\n Hover for more details..."); hoverComponent.setColor(ChatColor.GRAY); hoverComponent.setItalic(true); StringBuilder builder = new StringBuilder(); int hidden = 0; for (Map.Entry<String, Long> entry : results) { if (entry.getValue() > VISIBILITY_THRESHOLD) { builder.append("\n").append(ChatColor.YELLOW).append(formatter.apply(entry)); } else { hidden++; } } builder.append("\n\n&c+ &6").append(hidden).append(" more"); hoverComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColors.color(builder.toString())))); component.addExtra(hoverComponent); sender.spigot().sendMessage(component); } else { int hidden = 0; StringBuilder builder = new StringBuilder(); builder.append(ChatColor.GOLD + prefix); for (Map.Entry<String, Long> entry : results) { if (entry.getValue() > VISIBILITY_THRESHOLD) { builder.append(" "); builder.append(ChatColor.stripColor(formatter.apply(entry))); } else { hidden++; } } builder.append("\n+ "); builder.append(hidden); builder.append(" more..."); sender.sendMessage(builder.toString()); } }
Source:
byte[] process(CipherOutputStream cipherOutputStream, ByteArrayOutputStream byteArrayOutputStream, byte[] bytes) { try { cipherOutputStream.write(bytes); cipherOutputStream.close(); return byteArrayOutputStream.toByteArray(); } catch (IOException e) { throw new IllegalStateException( "unable to encrypt/decrypt due to IOException", e); } finally { try { cipherOutputStream.close(); } catch (IOException e) { } } }

Target:
byte[] process(CipherOutputStream cipherOutputStream, ByteArrayOutputStream byteArrayOutputStream, byte[] bytes) { try { cipherOutputStream.write(bytes); cipherOutputStream.close(); return byteArrayOutputStream.toByteArray(); } catch (Throwable e) { try { cipherOutputStream.close(); } catch (Throwable e1) { } throw new IllegalStateException("unable to encrypt/decrypt", e); } }
Source:
public void testMmsPartInsert_canInsertPartWithoutDataColumn() { String name = "testMmsInsert_canInsertPartWithoutDataColumn"; Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE); assertThat(mmsUri).isNotNull(); final long mmsId = ContentUris.parseId(mmsUri); final Uri partUri = Telephony.Mms.CONTENT_URI.buildUpon() .appendPath(String.valueOf(mmsId)).appendPath("part").build(); Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, name); assertThatMmsPartInsertSucceeded(insertPartUri, name, MMS_BODY); }

Target:
public void testMmsPartInsert_canInsertPartWithoutDataColumn() { String name = "testMmsInsert_canInsertPartWithoutDataColumn"; Uri mmsUri = insertIntoMmsTable(MMS_SUBJECT_ONE); assertThat(mmsUri).isNotNull(); final long mmsId = ContentUris.parseId(mmsUri); final Uri partUri = Telephony.Mms.CONTENT_URI.buildUpon() .appendPath(String.valueOf(mmsId)).appendPath( Telephony.Mms.Part.TABLE_PART).build(); Uri insertPartUri = insertIntoMmsPartTable(mmsUri, partUri, mmsId, MMS_BODY, name); assertThatMmsPartInsertSucceeded(insertPartUri, name, MMS_BODY); }
Source:
private AbstractSequence<?> readUnknownGenbankResource(final String resource) throws Exception { InputStream inputStream = null; try { inputStream = getClass().getResourceAsStream(resource); GenbankSequenceParser genbankParser = new GenbankSequenceParser(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String seqString = genbankParser.getSequence(bufferedReader, 0); String compoundSet = genbankParser.getCompoundType().getClass().getSimpleName(); if (compoundSet.equals("AminoAcidCompoundSet")) { return readGenbankProteinResource(resource); } else if (compoundSet.equals("RNACompoundSet")) { return readGenbankRNAResource(resource); } else { return readGenbankResource(resource); } } finally { try { inputStream.close(); } catch (Exception e) { } } }

Target:
private AbstractSequence<?> readUnknownGenbankResource(final String resource) throws IOException, CompoundNotFoundException { InputStream inputStream = getClass().getResourceAsStream(resource); GenbankSequenceParser genbankParser = new GenbankSequenceParser(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String seqString = genbankParser.getSequence(bufferedReader, 0); String compoundSet = genbankParser.getCompoundType().getClass().getSimpleName(); if (compoundSet.equals("AminoAcidCompoundSet")) { return readGenbankProteinResource(resource); } else if (compoundSet.equals("RNACompoundSet")) { return readGenbankRNAResource(resource); } else { return readGenbankResource(resource); } }
Source:
public void testOneDistanceIteration() { Iterator<Vector3ic> iter = Diamond3iIterable.region(new Vector3i(),2).build().iterator(); Set<Vector3i> expected = Sets.newHashSet(new Vector3i(), new Vector3i(1, 0, 0), new Vector3i(-1, 0, 0), new Vector3i(0, 1, 0), new Vector3i(0, -1, 0), new Vector3i(0, 0, 1), new Vector3i(0, 0, -1)); while (iter.hasNext()) { Vector3i next = new Vector3i(iter.next()); assertTrue(expected.remove(next), () -> "Received Unexpected: " + next); } assertTrue(expected.isEmpty(), () -> "Missing: " + expected); }

Target:
public void testOneDistanceIteration() { Iterator<Vector3ic> iter = Diamond3iIterable.region(new Vector3i(),1).build().iterator(); Set<Vector3i> expected = Sets.newHashSet(new Vector3i(), new Vector3i(1, 0, 0), new Vector3i(-1, 0, 0), new Vector3i(0, 1, 0), new Vector3i(0, -1, 0), new Vector3i(0, 0, 1), new Vector3i(0, 0, -1)); while (iter.hasNext()) { Vector3i next = new Vector3i(iter.next()); assertTrue(expected.remove(next), () -> "Received Unexpected: " + next); } assertTrue(expected.isEmpty(), () -> "Missing: " + expected); }
Source:
public void importEntries(List<BibEntry> entriesToImport) { if (preferences.shouldWarnAboutDuplicatesForImport()) { BackgroundTask.wrap(() -> entriesToImport.stream() .anyMatch(this::hasDuplicate)).onSuccess(e -> { if (e) { boolean continueImport = dialogService.showConfirmationDialogWithOptOutAndWait(Localization.lang("Duplicates found"), Localization.lang("There are possible duplicates (marked with an icon) that haven't been resolved. Continue?"), Localization.lang("Continue with import"), Localization.lang("Cancel import"), Localization.lang("Disable this confirmation dialog"), optOut -> preferences.setShouldWarnAboutDuplicatesForImport(!optOut)); if (!continueImport) { dialogService.notify(Localization.lang("Import canceled")); } } }).executeWith(Globals.TASK_EXECUTOR); } ImportHandler importHandler = new ImportHandler( dialogService, database, ExternalFileTypes.getInstance(), preferences.getFilePreferences(), preferences.getImportFormatPreferences(), preferences.getUpdateFieldPreferences(), fileUpdateMonitor, undoManager, stateManager); importHandler.importEntries(entriesToImport); dialogService.notify(Localization.lang("Number of entries successfully imported") + ": " + entriesToImport.size()); }

Target:
public void importEntries(List<BibEntry> entriesToImport) { if (preferences.shouldWarnAboutDuplicatesForImport()) { BackgroundTask.wrap(() -> entriesToImport.stream() .anyMatch(this::hasDuplicate)).onSuccess(duplicateFound -> { if (duplicateFound) { boolean continueImport = dialogService.showConfirmationDialogWithOptOutAndWait(Localization.lang("Duplicates found"), Localization.lang("There are possible duplicates (marked with an icon) that haven't been resolved. Continue?"), Localization.lang("Continue with import"), Localization.lang("Cancel import"), Localization.lang("Disable this confirmation dialog"), optOut -> preferences.setShouldWarnAboutDuplicatesForImport(!optOut)); if (!continueImport) { dialogService.notify(Localization.lang("Import canceled")); } else { buildImportHandlerThenImportEntries(entriesToImport); } } else { buildImportHandlerThenImportEntries(entriesToImport); } }).executeWith(Globals.TASK_EXECUTOR); } else { buildImportHandlerThenImportEntries(entriesToImport); } }
Source:
private void checkForStalePipeline(Pipeline pipeline, GenericValidationErrors errors) { Pipeline existingPipeline = pipelineDAO.findById(pipeline.getId()); Long storedUpdateTs = existingPipeline.getLastModified(); Long submittedUpdateTs = pipeline.getLastModified(); if (!storedUpdateTs.equals(submittedUpdateTs)) { errors.reject( "stale", "The submitted pipeline is stale. submitted updateTs " + submittedUpdateTs + " does not match stored updateTs " + storedUpdateTs); } }

Target:
private void checkForStalePipeline(Pipeline pipeline, GenericValidationErrors errors) { Pipeline existingPipeline = pipelineDAO.findById(pipeline.getId()); Long storedUpdateTs = existingPipeline.getLastModified(); Long submittedUpdateTs = pipeline.getLastModified(); if (!submittedUpdateTs.equals(storedUpdateTs)) { errors.reject( "stale", "The submitted pipeline is stale. submitted updateTs " + submittedUpdateTs + " does not match stored updateTs " + storedUpdateTs); } }
Source:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDisk) { VdcActionType vdcActionType = getSnapshotActionType(); if (FeatureSupported.isQemuingCommitSupported(getStoragePool().getCompatibilityVersion())) { vdcActionType = VdcActionType.ColdMergeSnapshotSingleDisk; } RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters(source, dest, VdcActionType.ColdMergeSnapshotSingleDisk); runInternalActionWithTasksContext( vdcActionType, parameters); } else { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }

Target:
private void removeImages() { List<CinderDisk> cinderDisks = new ArrayList<>(); for (final DiskImage source : getSourceImages()) { if (source.getDiskStorageType() == DiskStorageType.CINDER) { cinderDisks.add((CinderDisk) source); continue; } List<DiskImage> images = diskImageDao.getAllSnapshotsForParent(source.getImageId()); DiskImage dest = null; if (!images.isEmpty()) { dest = images.get(0); } if (getSnapshotActionType() == VdcActionType.RemoveSnapshotSingleDiskLive) { CommandCoordinatorUtil.executeAsyncCommand( getSnapshotActionType(), buildRemoveSnapshotSingleDiskParameters(source, dest, getSnapshotActionType()), cloneContextAndDetachFromParent()); } else { RemoveSnapshotSingleDiskParameters parameters = buildRemoveSnapshotSingleDiskParameters(source, dest, VdcActionType.ColdMergeSnapshotSingleDisk); runInternalActionWithTasksContext( getSnapshotActionType(), parameters); } List<Guid> quotasToRemoveFromCache = new ArrayList<>(); quotasToRemoveFromCache.add(source.getQuotaId()); if (dest != null) { quotasToRemoveFromCache.add(dest.getQuotaId()); } getQuotaManager().removeQuotaFromCache(getStoragePoolId(), quotasToRemoveFromCache); } if (!cinderDisks.isEmpty()) { handleCinderSnapshotDisks(cinderDisks); } }
Source:
public Profile apply(final EPackage missingPackage) { final List<String> closestPackageUris = getClosestPackageURIs(missingPackage); Profile profile = null; for (final String packageURI : closestPackageUris) { profile = getProfile(packageURI); if (profile != null && profile != NULL_PROFILE) { final String message = getSuccessMessage(missingPackage.getNsURI(), profile.getURI()); addResourceWarning(message); return profile; } } final String message = getFailMessage(missingPackage.getNsURI()); addResourceError(message); return null; }

Target:
public Profile apply(final EPackage missingPackage) { final List<String> closestPackageUris = getClosestPackageURIs(missingPackage); Optional<Profile> foundProfile = null; for (final String packageURI : closestPackageUris) { foundProfile = getProfile(packageURI); if (foundProfile.isPresent()) { Profile profile = foundProfile.get(); final String message = getSuccessMessage(missingPackage.getNsURI(), profile.getURI()); addResourceWarning(message); return profile; } } final String message = getFailMessage(missingPackage.getNsURI()); addResourceError(message); return null; }
Source:
private synchronized SslContext getSSLContext() { long now = System.currentTimeMillis(); if ((certRefreshTime > 0 && now > (certLastRefreshTime + certRefreshTime))) { if (tlsCertificateFilePath.checkAndRefresh() || tlsKeyStoreFilePath.checkAndRefresh() || tlsKeyStorePasswordFilePath.checkAndRefresh() || tlsTrustStoreFilePath.checkAndRefresh() || tlsTrustStorePasswordFilePath.checkAndRefresh()) { try { LOG.info("Updating tls certs"); if (isServerCtx) { updateServerContext(); } else { updateClientContext(); } } catch (Exception e) { LOG.info("Failed to refresh tls certs", e); } } } return sslContext; }

Target:
private synchronized SslContext getSSLContext() { long now = System.currentTimeMillis(); if ((certRefreshTime > 0 && now > (certLastRefreshTime + certRefreshTime))) { if (tlsCertificateFilePath.checkAndRefresh() || tlsKeyStoreFilePath.checkAndRefresh() || tlsKeyStorePasswordFilePath.checkAndRefresh() || tlsTrustStoreFilePath.checkAndRefresh() || tlsTrustStorePasswordFilePath.checkAndRefresh()) { try { LOG.info("Updating tls certs certFile={}, keyStoreFile={}, trustStoreFile={}", tlsCertificateFilePath.getFileName(), tlsKeyStoreFilePath.getFileName(), tlsTrustStoreFilePath.getFileName()); if (isServerCtx) { updateServerContext(); } else { updateClientContext(); } } catch (Exception e) { LOG.info("Failed to refresh tls certs", e); } } } return sslContext; }
Source:
public void saveFields() { Map<String, Set<Field>> customTabsMap = new LinkedHashMap<>(); String[] lines = fieldsText.get().split("\n"); for (String line : lines) { String[] parts = line.split(":"); if (parts.length != 2) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Each line must be of the following form: 'tab:field1;field2;...;fieldN'.")); return; } String testString = BibtexKeyGenerator.cleanKey(parts[1], preferences.getEnforceLegalKeys()); if (!testString.equals(parts[1]) || (parts[1].indexOf('&') >= 0)) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Field names are not allowed to contain white spaces or certain characters (%0).", "# { } ( ) ~ , ^ & - \" ' ` ʹ \\")); return; } customTabsMap.put(parts[0], FieldFactory.parseFieldList(parts[1])); } preferences.storeEntryEditorTabList(customTabsMap); preferences.updateEntryEditorTabList(); }

Target:
public void saveFields() { Map<String, Set<Field>> customTabsMap = new LinkedHashMap<>(); String[] lines = fieldsText.get().split("\n"); for (String line : lines) { String[] parts = line.split(":"); if (parts.length != 2) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Each line must be of the following form: 'tab:field1;field2;...;fieldN'.")); return; } String testString = BibtexKeyGenerator.cleanKey(parts[1], preferences.getEnforceLegalKeys()); if (!testString.equals(parts[1]) || (parts[1].indexOf('&') >= 0)) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Field names are not allowed to contain white spaces or certain characters (%0).", "# { } ( ) ~ , ^ & - \" ' ` ʹ \\")); return; } customTabsMap.put(parts[0], FieldFactory.parseFieldList(parts[1])); } preferences.storeEntryEditorTabList(customTabsMap); }
Source:
private String extractGitHubHttpKeyFromModulePom(String artifactId, String version, String groupId) throws MojoExecutionException, IOException { downloadModulePom(new Artifact(artifactId, version, groupId, "pom")); File pomDir = new File("pom/"); File pom = new File(pomDir ,this.artifactId+"-"+version+".pom"); BufferedReader br = null; br = new BufferedReader(new FileReader(pom)); String url = ""; String line = br.readLine(); while (line != null) { if (line.contains("<LINK_1>")) { url = line.substring(line.indexOf(">")+1, line.indexOf("</")); break; } line = br.readLine(); } br.close(); pom.delete(); pomDir.delete(); return StringUtils.removeEnd(url, "/") + ".git"; }

Target:
private String extractGitHubHttpKeyFromModulePom(String artifactId, String version, String groupId) throws MojoExecutionException, IOException { downloadModulePom(new Artifact(artifactId, version, groupId, "pom")); String pomFileName = this.artifactId+"-"+version+".pom"; File pomDir = new File("pom/"); File pom = new File("pom/", pomFileName); Model pomProperties = Project.loadProject(pomDir, pomFileName).getModel(); String url = pomProperties.getScm().getUrl(); pom.delete(); pomDir.delete(); return StringUtils.removeEnd(url, "/") + ".git"; }
Source:
public void render(final float delta) { Gdx.gl.glClearColor(0, 0, 0, 0); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); worldManager.update(delta); camera.position.set(camera.viewportWidth / 2.f + worldManager.getPlayer().getX() * 50.f - 100.f, camera.viewportHeight / 2.f, 0); camera.update(); batch.setProjectionMatrix(camera.combined); batch.begin(); for (WorldObject obj : worldManager.getObjects()) { obj.doRender(batch); } if (!gameOverMenuActive && !(worldManager.getGameStatus())) { gameOverMenuActive = true; gameOverTable.setVisible(true); gameOverScore.setText("Score:" + Integer.toString(Math.round(score))); scoreLabel.setVisible(false); Gdx.input.setInputProcessor(stage); } score = score + delta; scoreLabel.setText(Integer.toString(Math.round(score))); batch.end(); stage.act(); stage.draw(); physicsRenderer.render(this.worldManager.getPhysicsWorld(), camera.combined.scale(50.f, 50.f, 1.f)); }

Target:
public void render(final float delta) { Gdx.gl.glClearColor(0, 0, 0, 0); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); worldManager.update(delta); camera.position.set(camera.viewportWidth / 2.f + worldManager.getPlayer().getX() * 50.f - 100.f, camera.viewportHeight / 2.f, 0); camera.update(); batch.setProjectionMatrix(camera.combined); batch.begin(); for (WorldObject obj : worldManager.getObjects()) { obj.doRender(batch); } if (!gameOverMenuActive && !(worldManager.getGameStatus())) { gameOverMenuActive = true; gameOverTable.setVisible(true); gameOverScore.setText("Score:" + Integer.toString(Math.round(score))); scoreLabel.setVisible(false); Gdx.input.setInputProcessor(stage); } score = score + delta * worldManager.getPlayer().getSpeed().len(); scoreLabel.setText(Integer.toString(Math.round(score))); batch.end(); stage.act(); stage.draw(); physicsRenderer.render(this.worldManager.getPhysicsWorld(), camera.combined.scale(50.f, 50.f, 1.f)); }
Source:
ProjectBasicAuthFilter(Provider<WebSession> session, AccountCache accountCache, AccountManager accountManager) throws XsrfException { this.session = session; this.accountCache = accountCache; this.accountManager = accountManager; }

Target:
ProjectBasicAuthFilter(Provider<WebSession> session, AccountCache accountCache, AccountManager accountManager) { this.session = session; this.accountCache = accountCache; this.accountManager = accountManager; }
Source:
public HtmlMetacardModel(Metacard metacard, List<HtmlExportCategory> categories) { this.metacard = metacard; this.title = metacard.getTitle(); this.categories = categories; this.applyAttributeMappingsToMetacard(); }

Target:
public HtmlMetacardModel(Metacard metacard, List<HtmlExportCategory> categories) { this.metacard = metacard; this.title = metacard.getTitle(); this.categories = categories .stream() .map(category -> new HtmlCategoryModel(category.getTitle(), category.getAttributes())) .collect(Collectors.toList()); this.applyAttributeMappingsToMetacard(); }
Source:
public int getCacheMapMarkerId(boolean disabled) { final String icons = Settings.getECIconSet(); if (StringUtils.equals(icons, "1")) { if (disabled) { return R.drawable.marker_disabled_other; } return R.drawable.marker_other; } if (disabled) { return R.drawable.marker_disabled_oc; } return R.drawable.marker_oc; }

Target:
public int getCacheMapMarkerId(boolean disabled) { final String icons = Settings.getECIconSet(); if (StringUtils.equals(icons, "1")) { return disabled ? R.drawable.marker_disabled_other : R.drawable.marker_other; } return disabled ? R.drawable.marker_disabled_oc : R.drawable.marker_oc; }
Source:
private SqlStatementCustomizer create(RegisterRowMapperFactory ma) { final RowMapperFactory[] m = new RowMapperFactory[ma.value().length]; try { Class<? extends RowMapperFactory>[] mcs = ma.value(); for (int i = 0; i < mcs.length; i++) { m[i] = mcs[i].newInstance(); } } catch (Exception e) { throw new IllegalStateException("unable to create a specified row mapper factory", e); } return stmt -> Arrays.asList(m).forEach(stmt::registerRowMapper); }

Target:
private SqlStatementCustomizer create(RegisterRowMapperFactory ma) { final List<RowMapperFactory> m = new ArrayList<RowMapperFactory>(ma.value().length); try { Class<? extends RowMapperFactory>[] mcs = ma.value(); for (int i = 0; i < mcs.length; i++) { m.add(mcs[i].newInstance()); } } catch (Exception e) { throw new IllegalStateException("unable to create a specified row mapper factory", e); } return stmt -> m.forEach(stmt::registerRowMapper); }
Source:
public static byte[] readUntilCR(ByteArrayInputStream inputStream) { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte readByte; while (((readByte = (byte)inputStream.read()) != 0x0D) && readByte != -1) outputStream.write(readByte); return outputStream.toByteArray(); }

Target:
public static byte[] readUntilCR(ByteArrayInputStream inputStream) { if (inputStream == null) throw new NullPointerException("Input stream cannot be null."); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); byte readByte; while (((readByte = (byte)inputStream.read()) != 0x0D) && readByte != -1) outputStream.write(readByte); return outputStream.toByteArray(); }
Source:
private Column initDeploymentColumn() { Column<ProcessSummary, String> deploymentColumn = new Column<ProcessSummary, String>(new TextCell()) { @Override public String getValue(ProcessSummary object) { return object.getDeploymentId(); } }; deploymentColumn.setSortable(true); deploymentColumn.setDataStoreName(COL_ID_DEPLOYMENT); return deploymentColumn; }

Target:
private Column initDeploymentColumn() { Column<ProcessSummary, String> deploymentColumn = new Column<ProcessSummary, String>(new TextCell()) { @Override public String getValue(ProcessSummary object) { return object.getDeploymentId(); } }; deploymentColumn.setSortable(true); deploymentColumn.setDataStoreName(COL_ID_PROJECT); return deploymentColumn; }
Source:
private Iterable<ProductItemPrice> getPrices(Template template, ProductPackage productPackage) { Builder<ProductItemPrice> result = ImmutableSet.builder(); int imageId = Integer.parseInt(template.getImage().getId()); result.add(ProductItemPrice.builder().id(imageId).build()); Iterable<String> hardwareIds = Splitter.on(",").split(template.getHardware().getId()); for (String hardwareId : hardwareIds) { int id = Integer.parseInt(hardwareId); result.add(ProductItemPrice.builder().id(id).build()); } Float portSpeed = 10f; ProductItem uplinkItem = find(productPackage.getItems(), and(capacity(portSpeed), categoryCode("port_speed"))); result.add(get(uplinkItem.getPrices(), 0)); result.addAll(defaultPrices); return result.build(); }

Target:
private Iterable<ProductItemPrice> getPrices(Template template, ProductPackage productPackage) { Builder<ProductItemPrice> result = ImmutableSet.builder(); int imageId = Integer.parseInt(template.getImage().getId()); result.add(ProductItemPrice.builder().id(imageId).build()); Iterable<String> hardwareIds = Splitter.on(",").split(template.getHardware().getId()); for (String hardwareId : hardwareIds) { int id = Integer.parseInt(hardwareId); result.add(ProductItemPrice.builder().id(id).build()); } float portSpeed = 10f; ProductItem uplinkItem = find(productPackage.getItems(), and(capacity(portSpeed), categoryCode("port_speed"))); result.add(get(uplinkItem.getPrices(), 0)); result.addAll(defaultPrices); return result.build(); }
Source:
InputStatus pollNext(ReaderOutput<T> output) throws Exception; List<SplitT> snapshotState(); default void checkpointComplete(long checkpointId)

Target:
InputStatus pollNext(ReaderOutput<T> output) throws Exception; List<SplitT> snapshotState(long checkpointId); CompletableFuture<Void> isAvailable(); void addSplits(List<SplitT> splits); void handleSourceEvents(SourceEvent sourceEvent); @Override default void notifyCheckpointComplete(long checkpointId) throws Exception
Source:
public static double hetSNPSensitivity(final double[] depthDistribution, final double[] qualityDistribution, final int sampleSize, final double logOddsThreshold) { final int N = depthDistribution.length; log.info("Creating Roulette Wheel"); final RouletteWheel qualitySampler = new RouletteWheel(qualityDistribution); log.info("Calculating quality sums from quality sampler"); final List<ArrayList<Integer>> qualitySums = qualitySampler.sampleCumulativeSums(N, sampleSize); final ArrayList<Double> qualitySumThresholds = new ArrayList<Double>(N); for (int n = 0; n < N; n++) qualitySumThresholds.add(10*(n*Math.log10(2) + logOddsThreshold)); log.info("Calculating theoretical het sensitivity"); final List<ArrayList<Double>> probabilityToExceedThreshold = proportionsAboveThresholds(qualitySums, qualitySumThresholds); final List<ArrayList<Double>> altDepthDistribution = hetAltDepthDistribution(N); double result = 0.0; for (int n = 0; n < N; n++) { for (int m = 0; m <= n; m++) { result += depthDistribution[n] * altDepthDistribution.get(n).get(m)* probabilityToExceedThreshold.get(m).get(n); } } return result; }

Target:
public static double hetSNPSensitivity(final double[] depthDistribution, final double[] qualityDistribution, final int sampleSize, final double logOddsThreshold) { final int N = depthDistribution.length; log.info("Creating Roulette Wheel"); final RouletteWheel qualitySampler = new RouletteWheel(qualityDistribution); log.info("Calculating quality sums from quality sampler"); final List<ArrayList<Integer>> qualitySums = qualitySampler.sampleCumulativeSums(N, sampleSize); final ArrayList<Double> qualitySumThresholds = new ArrayList<Double>(N); final double LOG_10 = Math.log10(2); for (int n = 0; n < N; n++) qualitySumThresholds.add(10*(n*LOG_10 + logOddsThreshold)); log.info("Calculating theoretical het sensitivity"); final List<ArrayList<Double>> probabilityToExceedThreshold = proportionsAboveThresholds(qualitySums, qualitySumThresholds); final List<ArrayList<Double>> altDepthDistribution = hetAltDepthDistribution(N); double result = 0.0; for (int n = 0; n < N; n++) { for (int m = 0; m <= n; m++) { result += depthDistribution[n] * altDepthDistribution.get(n).get(m)* probabilityToExceedThreshold.get(m).get(n); } } return result; }
Source:
public Map<String, Achievement> provideCatalogMap() { return this.achievementMappings; }

Target:
public Map<String, Achievement> provideCatalogMap() { return Maps.newHashMap(this.achievementMappings); }
Source:
void writeIndex(final OutputStream output) throws IOException { if (output == null) { throw new IllegalArgumentException("null output path"); } BinaryCodec codec = new BinaryCodec(output); final int numberOfBlocksToWrite = entries.size(); codec.writeLong(Integer.toUnsignedLong(numberOfBlocksToWrite)); for (final IndexEntry entry : entries) { codec.writeLong(entry.getCompressedOffset()); codec.writeLong(entry.getUncompressedOffset()); } codec.close(); }

Target:
public void writeIndex(final OutputStream output) throws IOException { if (output == null) { throw new IllegalArgumentException("null output path"); } BinaryCodec codec = new BinaryCodec(output); final int numberOfBlocksToWrite = entries.size(); codec.writeLong(Integer.toUnsignedLong(numberOfBlocksToWrite)); for (final IndexEntry entry : entries) { codec.writeLong(entry.getCompressedOffset()); codec.writeLong(entry.getUncompressedOffset()); } codec.close(); }
Source:
private void scanClasses(Bundle bundle, Map<Long, Collection<Class<?>>> map, BiConsumer<String, Throwable> throwableHandler) { BundleWiring wiring = bundle.adapt(BundleWiring.class); Collection<String> classes = wiring.listResources("/", "*.class", BundleWiring.LISTRESOURCES_RECURSE); Collection<Class<?>> bundleClasses = new ArrayList<>(); for (String clazz : classes) { String className = clazz.replaceAll("\\.class$", "").replace('/', '.'); if (bundle.equals(flowServerBundle) && !className.startsWith("com.vaadin")) { continue; } if ("module-info".equals(className)) { continue; } try { bundleClasses.add(bundle.loadClass(className)); } catch (ClassNotFoundException | NoClassDefFoundError exception) { throwableHandler.accept(className, exception); } } map.put(bundle.getBundleId(), bundleClasses); }

Target:
private void scanClasses(Bundle bundle, Map<Long, Collection<Class<?>>> map, BiConsumer<String, Throwable> throwableHandler) { BundleWiring wiring = bundle.adapt(BundleWiring.class); Collection<String> classes = wiring.listResources("/", "*.class", BundleWiring.LISTRESOURCES_RECURSE | BundleWiring.LISTRESOURCES_LOCAL); Collection<Class<?>> bundleClasses = new ArrayList<>(); for (String clazz : classes) { String className = clazz.replaceAll("\\.class$", "").replace('/', '.'); if (bundle.equals(flowServerBundle) && !className.startsWith("com.vaadin")) { continue; } if ("module-info".equals(className)) { continue; } try { bundleClasses.add(bundle.loadClass(className)); } catch (ClassNotFoundException | NoClassDefFoundError exception) { throwableHandler.accept(className, exception); } } map.put(bundle.getBundleId(), bundleClasses); }
Source:
private static Optional<Extension> loadCustomExtension() { String xpiProperty = System.getProperty(FirefoxDriver.SystemProperty.DRIVER_XPI_PROPERTY); if (xpiProperty != null && !xpiProperty.equals("")) { File xpi = new File(xpiProperty); return Optional.of((Extension) new FileExtension(xpi)); } return Optional.absent(); }

Target:
private static Extension loadCustomExtension() { String xpiProperty = System.getProperty(FirefoxDriver.SystemProperty.DRIVER_XPI_PROPERTY); if (xpiProperty != null) { File xpi = new File(xpiProperty); if (xpi.exists()) { return new FileExtension(xpi); } } return null; }
Source:
private CommandContext createContextForRunStatelessVm() { Step step = getExecutionContext().getStep(); Job job = JobRepositoryFactory.getJobRepository().getJobWithSteps(step.getJobId()); Step executingStep = job.getDirectStep(StepEnum.EXECUTING); setInternalExecution(true); ExecutionContext runStatelessVmCtx = new ExecutionContext(); runStatelessVmCtx.setMonitored(true); Step runStatelessStep = ExecutionHandler.addSubStep(getExecutionContext(), executingStep, StepEnum.RUN_STATELESS_VM, ExecutionMessageDirector.resolveStepMessage(StepEnum.RUN_STATELESS_VM, getVmValuesForMsgResolving())); runStatelessVmCtx.setShouldEndJob(true); runStatelessVmCtx.setJob(job); runStatelessVmCtx.setStep(runStatelessStep); return dupContext().setExecutionContext(runStatelessVmCtx).setCompensationContext(null).setLock(null); }

Target:
private CommandContext createContextForRunStatelessVm() { Step step = getExecutionContext().getStep(); Job job = JobRepositoryFactory.getJobRepository().getJobWithSteps(step.getJobId()); Step executingStep = job.getDirectStep(StepEnum.EXECUTING); setInternalExecution(true); ExecutionContext runStatelessVmCtx = new ExecutionContext(); runStatelessVmCtx.setMonitored(true); Step runStatelessStep = ExecutionHandler.addSubStep(getExecutionContext(), executingStep, StepEnum.RUN_STATELESS_VM, ExecutionMessageDirector.resolveStepMessage(StepEnum.RUN_STATELESS_VM, getVmValuesForMsgResolving())); runStatelessVmCtx.setShouldEndJob(true); runStatelessVmCtx.setJob(job); runStatelessVmCtx.setStep(runStatelessStep); return dupContext().withExecutionContext(runStatelessVmCtx).withCompensationContext(null).withtLock(null); }
Source:
public RowData deserialize(byte[] message) throws IOException { try { final JsonNode root = objectMapper.readTree(message); if (root instanceof MissingNode) { return null; } return (RowData) runtimeConverter.convert(root); } catch (Throwable t) { if (ignoreParseErrors) { return null; } throw new IOException(format("Failed to deserialize JSON '%s'.", new String(message)), t); } }

Target:
public RowData deserialize(byte[] message) throws IOException { try { final JsonNode root = objectMapper.readTree(message); return (RowData) runtimeConverter.convert(root); } catch (Throwable t) { if (ignoreParseErrors) { return null; } throw new IOException(format("Failed to deserialize JSON '%s'.", new String(message)), t); } }
Source:
public void testGetFeatureReaderWithPathAndWrappers(String file, String index, Function<SeekableByteChannel, SeekableByteChannel> wrapper, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper) throws IOException, URISyntaxException { try(FileSystem fs = Jimfs.newFileSystem("test", Configuration.unix())) { final AbstractFeatureReader<VariantContext, ?> featureReader = getFeatureReader(file, index, wrapper, indexWrapper, new VCFCodec(), fs); Assert.assertTrue(featureReader.hasIndex()); Assert.assertEquals(featureReader.iterator().toList().size(), 26); Assert.assertEquals(featureReader.query("1", 190, 210).toList().size(), 3); Assert.assertEquals(featureReader.query("2", 190, 210).toList().size(), 1); } }

Target:
public void testGetFeatureReaderWithPathAndWrappers(String file, String index, Function<SeekableByteChannel, SeekableByteChannel> wrapper, Function<SeekableByteChannel, SeekableByteChannel> indexWrapper) throws IOException, URISyntaxException { try(FileSystem fs = Jimfs.newFileSystem("test", Configuration.unix()); final AbstractFeatureReader<VariantContext, ?> featureReader = getFeatureReader(file, index, wrapper, indexWrapper, new VCFCodec(), fs)){ Assert.assertTrue(featureReader.hasIndex()); Assert.assertEquals(featureReader.iterator().toList().size(), 26); Assert.assertEquals(featureReader.query("1", 190, 210).toList().size(), 3); Assert.assertEquals(featureReader.query("2", 190, 210).toList().size(), 1); } }
Source:
public int run() throws Exception { mustHaveValidSite(); dbInjector = createDbInjector(MULTI_USER); if (IndexModule.getIndexType(dbInjector) == IndexType.SQL) { throw die("index.type must be configured (or not SQL)"); } limitThreads(); if (version == null) { version = ChangeSchemas.getLatest().getVersion(); } LifecycleManager dbManager = new LifecycleManager(); dbManager.add(dbInjector); dbManager.start(); sysInjector = createSysInjector(); LifecycleManager sysManager = new LifecycleManager(); sysManager.add(sysInjector); sysManager.start(); index = sysInjector.getInstance(IndexCollection.class).getSearchIndex(); index.markReady(false); index.deleteAll(); int result = indexAll(); index.markReady(true); sysManager.stop(); dbManager.stop(); return result; }

Target:
public int run() throws Exception { mustHaveValidSite(); dbInjector = createDbInjector(MULTI_USER); if (IndexModule.getIndexType(dbInjector) == IndexType.SQL) { throw die("index.type must be configured (or not SQL)"); } limitThreads(); disableLuceneAutomaticCommit(); if (version == null) { version = ChangeSchemas.getLatest().getVersion(); } LifecycleManager dbManager = new LifecycleManager(); dbManager.add(dbInjector); dbManager.start(); sysInjector = createSysInjector(); LifecycleManager sysManager = new LifecycleManager(); sysManager.add(sysInjector); sysManager.start(); index = sysInjector.getInstance(IndexCollection.class).getSearchIndex(); index.markReady(false); index.deleteAll(); int result = indexAll(); index.markReady(true); sysManager.stop(); dbManager.stop(); return result; }
Source:
public synchronized void recordWarningCode(int code) { Integer Icode = code; if(!warningCodes.containsKey(Icode)) { int[] val = new int[1]; val[0] = 0; warningCodes.put(Icode, val); } warningCodes.get(Icode)[0]++; }

Target:
public synchronized void recordWarningCode(int code) { Integer key = code; if(!warningCodes.containsKey(key)) { int[] val = new int[1]; val[0] = 0; warningCodes.put(key, val); } warningCodes.get(key)[0]++; }
Source:
public void smokeTestOfNetexLoadData() { GraphBuilderParameters builderParameters = createBuilderParameters(); NetexBundle netexBundle = createNetexBundle(builderParameters); netexBundle.checkInputs(); OtpTransitServiceBuilder transitBuilder = netexBundle.loadBundle(new Deduplicator()); OtpTransitService otpModel = transitBuilder.build(); assertAgencies(otpModel.getAllAgencies()); assertStops(otpModel.getAllStops()); assertTripPatterns(otpModel.getTripPatterns()); assertTrips(otpModel.getAllTrips()); assertServiceIds(otpModel.getAllServiceIds()); assertNoticeAssignments(otpModel.getNoticeAssignments()); assetServiceCalendar(transitBuilder.buildCalendarServiceData()); }

Target:
public void smokeTestOfNetexLoadData() { NetexBundle netexBundle = ConstantsForTests.createMinimalNetexBundle(); netexBundle.checkInputs(); OtpTransitServiceBuilder transitBuilder = netexBundle.loadBundle(new Deduplicator()); OtpTransitService otpModel = transitBuilder.build(); assertAgencies(otpModel.getAllAgencies()); assertStops(otpModel.getAllStops()); assertTripPatterns(otpModel.getTripPatterns()); assertTrips(otpModel.getAllTrips()); assertServiceIds(otpModel.getAllServiceIds()); assertNoticeAssignments(otpModel.getNoticeAssignments()); assetServiceCalendar(transitBuilder.buildCalendarServiceData()); }
Source:
private void initializeChannelHandlers(NettyMetrics nettyMetrics, NettyConfig nettyConfig, RestRequestHandler requestHandler, PublicAccessLogger publicAccessLogger, RestServerState restServerState) { channelHandlerInfoList = new LinkedHashMap<>(); channelHandlerInfoList.put("codec", new HttpServerCodec()); channelHandlerInfoList.put("HealthCheckHandler", new HealthCheckHandler(restServerState, nettyMetrics)); channelHandlerInfoList .put("PublicAccessLogHandler", new PublicAccessLogRequestHandler(publicAccessLogger, nettyMetrics)); channelHandlerInfoList.put("idleStateHandler", new IdleStateHandler(0, 0, nettyConfig.nettyServerIdleTimeSeconds)); channelHandlerInfoList.put("chunker", new ChunkedWriteHandler()); channelHandlerInfoList.put("processor", new NettyMessageProcessor(nettyMetrics, nettyConfig, requestHandler)); }

Target:
private void initializeChannelHandlers(NettyMetrics nettyMetrics, NettyConfig nettyConfig, RestRequestHandler requestHandler, PublicAccessLogger publicAccessLogger, RestServerState restServerState) { channelHandlerInfoList.put("codec", new HttpServerCodec()); channelHandlerInfoList.put("HealthCheckHandler", new HealthCheckHandler(restServerState, nettyMetrics)); channelHandlerInfoList .put("PublicAccessLogHandler", new PublicAccessLogRequestHandler(publicAccessLogger, nettyMetrics)); channelHandlerInfoList.put("idleStateHandler", new IdleStateHandler(0, 0, nettyConfig.nettyServerIdleTimeSeconds)); channelHandlerInfoList.put("chunker", new ChunkedWriteHandler()); channelHandlerInfoList.put("processor", new NettyMessageProcessor(nettyMetrics, nettyConfig, requestHandler)); }