auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldNotifyWithTheRightAnnotatedDocument() { try (CapturingEventListener listener = new CapturingEventListener(COMMENT_ADDED, DOCUMENT_CREATED)) { Comment createdAnnotation = createAnnotationAndAddSubscription("CommentAdded", "Creation"); DocumentModel annotationDocumentModel = session.getDocument(new IdRef(createdAnnotation.getId())); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(COMMENT_ADDED)); assertTrue(listener.hasBeenFired(DOCUMENT_CREATED)); List<Event> handledEvents = listener.streamCapturedEvents() .filter(e -> COMMENT_ADDED.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); checkDocumentEventContext(handledEvents.get(0), annotationDocumentModel, annotatedDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), annotationDocumentModel, annotatedDocumentModel, handledEvents.get(0), COMMENT_ADDED); Comment reply = createAnnotation(annotationDocumentModel); DocumentModel replyDocumentModel = session.getDocument(new IdRef(reply.getId())); transactionalFeature.nextTransaction(); handledEvents = listener.streamCapturedEvents() .filter(e -> COMMENT_ADDED.equals(e.getName())) .collect(Collectors.toList()); assertEquals(2, handledEvents.size()); checkDocumentEventContext(handledEvents.get(1), replyDocumentModel, annotationDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), replyDocumentModel, annotatedDocumentModel, handledEvents.get(1), COMMENT_ADDED); } }

Target:
public void shouldNotifyWithTheRightAnnotatedDocument() { Annotation createdAnnotation = createAnnotation(annotatedDocumentModel); DocumentModel createdAnnotationDocModel = session.getDocument(new IdRef(createdAnnotation.getId())); transactionalFeature.nextTransaction(); captureAndVerifyAnnotationEventNotification(() -> { addSubscriptions("CommentAdded"); Comment reply = createAnnotation(createdAnnotationDocModel); DocumentModel replyDocumentModel = session.getDocument(new IdRef(reply.getId())); return session.getDocument(new IdRef(replyDocumentModel.getId())); }, COMMENT_ADDED, DOCUMENT_CREATED); }
Source:
public void loadTabGroupItems(CTabFolder tabgroup, String curProviderId) { for (CTabItem item : tabgroup.getItems()) { item.dispose(); } ProfileLaunchConfigurationTabGroup tabGroupConfig; if (curProviderId == null || "".equals(curProviderId)) { curProviderId = ProviderLaunchConfigurationDelegate .getProviderIdToRun(getProfilingType()); } initialized.put(curProviderId, false); tabGroupConfig = ProfileLaunchConfigurationTabGroup .getTabGroupProviderFromId(curProviderId); if (tabGroupConfig == null) { return; } tabs = tabGroupConfig.getProfileTabs(); setProvider(curProviderId); int itemIndex = getComboItemIndexFromId(curProviderId); providerCombo.select(itemIndex); for (ILaunchConfigurationTab tab : tabs) { tab.setLaunchConfigurationDialog(getLaunchConfigurationDialog()); CTabItem item = new CTabItem(tabgroup, SWT.NONE); item.setText(tab.getName()); item.setImage(tab.getImage()); tab.createControl(tabgroup); item.setControl(tab.getControl()); tabgroup.setSelection(0); } }

Target:
public void loadTabGroupItems(CTabFolder tabgroup, String curProviderId) { for (CTabItem item : tabgroup.getItems()) { item.dispose(); } initialized.clear(); ProfileLaunchConfigurationTabGroup tabGroupConfig; if (curProviderId == null || "".equals(curProviderId)) { curProviderId = ProviderLaunchConfigurationDelegate .getProviderIdToRun(getProfilingType()); } initialized.put(curProviderId, false); tabGroupConfig = ProfileLaunchConfigurationTabGroup .getTabGroupProviderFromId(curProviderId); if (tabGroupConfig == null) { return; } tabs = tabGroupConfig.getProfileTabs(); setProvider(curProviderId); int itemIndex = getComboItemIndexFromId(curProviderId); providerCombo.select(itemIndex); for (ILaunchConfigurationTab tab : tabs) { tab.setLaunchConfigurationDialog(getLaunchConfigurationDialog()); CTabItem item = new CTabItem(tabgroup, SWT.NONE); item.setText(tab.getName()); item.setImage(tab.getImage()); tab.createControl(tabgroup); item.setControl(tab.getControl()); tabgroup.setSelection(0); } }
Source:
private Configuration(Builder builder) { this.context = builder.context; this.applicationId = builder.applicationId; this.clientKey = builder.clientKey; this.localDataStoreEnabled = builder.localDataStoreEnabled; this.interceptors = builder.interceptors; }

Target:
private Configuration(Builder builder) { this.context = builder.context; this.applicationId = builder.applicationId; this.clientKey = builder.clientKey; this.localDataStoreEnabled = builder.localDataStoreEnabled; this.interceptors = builder.interceptors != null ? Collections.unmodifiableList(new ArrayList<>(builder.interceptors)) : null; }
Source:
public void spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws Throwable { subscriberTest(new TestStageTestRun() { @Override public void run(WhiteboxTestStage stage) throws InterruptedException { Exception ex = new RuntimeException("Test Exception: Boom!"); stage.sendError(ex); stage.probe.expectError(ex); env.verifyNoAsyncErrors(); } }); }

Target:
public void spec210_mustBePreparedToReceiveAnOnErrorSignalWithoutPrecedingRequestCall() throws Throwable { subscriberTest(new TestStageTestRun() { @Override public void run(WhiteboxTestStage stage) throws InterruptedException { Exception ex = new TestException(); stage.sendError(ex); stage.probe.expectError(ex); env.verifyNoAsyncErrors(); } }); }
Source:
public BiConsumer<SolutionBusiness<ConferenceSolution>, SolutionPanel<ConferenceSolution>> getConsumer() { return (solutionBusiness, solutionPanel) -> { String[] cfpArray = {"cfp-devoxx"}; JComboBox<String> cfpConferenceBox = new JComboBox<>(cfpArray); JTextField cfpRestUrlTextField = new JTextField("<LINK_0>"); String[] timeslotsEndpointArray = {"/slots", "/schedules/"}; JComboBox<String> timeslotsEndpointBox = new JComboBox<>(timeslotsEndpointArray); Object[] dialogue = { "Choose conference:", cfpConferenceBox, "Enter CFP REST Url:", cfpRestUrlTextField, "Choose timeslots endpoint", timeslotsEndpointBox, }; int option = JOptionPane.showConfirmDialog(solutionPanel, dialogue, "Import", JOptionPane.OK_CANCEL_OPTION); if (option == JOptionPane.OK_OPTION) { String conferenceBaseUrl = cfpRestUrlTextField.getText(); String timeslotsEndpoint = timeslotsEndpointBox.getSelectedItem().toString(); new ConferenceCFPImportWorker(solutionBusiness, solutionPanel, conferenceBaseUrl, timeslotsEndpoint) .executeAndShowDialog(); } }; }

Target:
public BiConsumer<SolutionBusiness<ConferenceSolution>, SolutionPanel<ConferenceSolution>> getConsumer() { return (solutionBusiness, solutionPanel) -> { String[] cfpArray = {"cfp-devoxx"}; JComboBox<String> cfpConferenceBox = new JComboBox<>(cfpArray); JTextField cfpRestUrlTextField = new JTextField("<LINK_0>"); Object[] dialogue = { "Choose conference:", cfpConferenceBox, "Enter CFP REST Url:", cfpRestUrlTextField, }; int option = JOptionPane.showConfirmDialog(solutionPanel, dialogue, "Import", JOptionPane.OK_CANCEL_OPTION); if (option == JOptionPane.OK_OPTION) { String conferenceBaseUrl = cfpRestUrlTextField.getText(); new ConferenceCFPImportWorker(solutionBusiness, solutionPanel, conferenceBaseUrl) .executeAndShowDialog(); } }; }
Source:
public void getRelatedLinear() throws Exception { add(git, "a.txt", "1"); Commit c1 = createCommit(git, admin.getIdent(), "subject: 1"); add(git, "b.txt", "2"); Commit c2 = createCommit(git, admin.getIdent(), "subject: 2"); pushHead(git, "refs/for/master", false); for (Commit c : ImmutableList.of(c2, c1)) { List<ChangeAndCommit> related = getRelated(getPatchSetId(c)); assertThat(related.size()).isEqualTo(2); assertThat(related.get(0).changeId) .named("related to " + c.getChangeId()).isEqualTo(c2.getChangeId()); assertThat(related.get(1).changeId) .named("related to " + c.getChangeId()).isEqualTo(c1.getChangeId()); } }

Target:
public void getRelatedLinear() throws Exception { add(git, "a.txt", "1"); Commit c1 = createCommit(git, admin.getIdent(), "subject: 1"); add(git, "b.txt", "2"); Commit c2 = createCommit(git, admin.getIdent(), "subject: 2"); pushHead(git, "refs/for/master", false); for (Commit c : ImmutableList.of(c2, c1)) { List<ChangeAndCommit> related = getRelated(getPatchSetId(c)); assertThat(related).hasSize(2); assertThat(related.get(0).changeId) .named("related to " + c.getChangeId()).isEqualTo(c2.getChangeId()); assertThat(related.get(1).changeId) .named("related to " + c.getChangeId()).isEqualTo(c1.getChangeId()); } }
Source:
private boolean isUserMisMatch(final String user, final TokenCacheItem tokenCacheItem) { if (!StringExtensions.IsNullOrBlank(user)) { return !user.equalsIgnoreCase(tokenCacheItem.getUserInfo().getDisplayableId()) && !user.equalsIgnoreCase(tokenCacheItem.getUserInfo().getUserId()); } return false; }

Target:
private boolean isUserMisMatch(final String user, final TokenCacheItem tokenCacheItem) { if (StringExtensions.IsNullOrBlank(user) || tokenCacheItem.getUserInfo() == null) { return false; } return !user.equalsIgnoreCase(tokenCacheItem.getUserInfo().getDisplayableId()) && !user.equalsIgnoreCase(tokenCacheItem.getUserInfo().getUserId()); }
Source:
protected Class<?> findClass(String name) throws ClassNotFoundException { for ( ClassLoader classLoader : individualClassLoaders ) { try { return classLoader.loadClass( name ); } catch (Exception | LinkageError ignore) { } } throw new ClassNotFoundException( "Could not loadBlocking requested class : " + name ); }

Target:
protected Class<?> findClass(String name) throws ClassNotFoundException { for ( ClassLoader classLoader : individualClassLoaders ) { try { return classLoader.loadClass( name ); } catch (Exception | LinkageError ignore) { } } throw new ClassNotFoundException( "Could not load requested class : " + name ); }
Source:
protected BlockWriteRequestContext createRequestContext(alluxio.grpc.WriteRequest msg) throws Exception { BlockWriteRequestContext context = mBlockWriteHandler.createRequestContext(msg); BlockWriteRequest request = context.getRequest(); Preconditions.checkState(request.hasCreateUfsBlockOptions()); context.setWritingToLocal(!request.getCreateUfsBlockOptions().getFallback()); if (context.isWritingToLocal()) { mWorker.createBlockRemote(request.getSessionId(), request.getId(), mStorageTierAssoc.getAlias(request.getTier()), request.getMediumType(), FILE_BUFFER_SIZE); } return context; }

Target:
protected BlockWriteRequestContext createRequestContext(alluxio.grpc.WriteRequest msg) throws Exception { BlockWriteRequestContext context = new BlockWriteRequestContext(msg, FILE_BUFFER_SIZE); if (mDomainSocketEnabled) { context.setCounter(MetricsSystem.counter(WorkerMetrics.BYTES_WRITTEN_DOMAIN)); context.setMeter(MetricsSystem.meter(WorkerMetrics.BYTES_WRITTEN_DOMAIN_THROUGHPUT)); } else { context.setCounter(MetricsSystem.counter(WorkerMetrics.BYTES_WRITTEN_ALLUXIO)); context.setMeter(MetricsSystem.meter(WorkerMetrics.BYTES_WRITTEN_ALLUXIO_THROUGHPUT)); } BlockWriteRequest request = context.getRequest(); Preconditions.checkState(request.hasCreateUfsBlockOptions()); context.setWritingToLocal(!request.getCreateUfsBlockOptions().getFallback()); if (context.isWritingToLocal()) { mWorker.createBlockRemote(request.getSessionId(), request.getId(), mStorageTierAssoc.getAlias(request.getTier()), request.getMediumType(), FILE_BUFFER_SIZE); } return context; }
Source:
static void runTasks(ModLoadingStage fromStage, Consumer<List<ModLoadingException>> errorHandler) { raisedExceptions.clear(); if (taskQueue.isEmpty()) return; LOGGER.info(LOADING, "Dispatching synchronous work after {}: jobs", fromStage, taskQueue.size()); StopWatch globalTimer = StopWatch.createStarted(); while (!taskQueue.isEmpty()) { TaskInfo taskinfo = taskQueue.poll(); Stopwatch timer = Stopwatch.createStarted(); taskinfo.task.run(); timer.stop(); if (timer.elapsed(TimeUnit.SECONDS) > 5) { LOGGER.warn(LOADING, "Mod '{}' took to run a deferred task.", taskinfo.owner.getDisplayName(), timer); } } LOGGER.info(LOADING, "Synchronous work queue completed in {}", globalTimer); errorHandler.accept(raisedExceptions); }

Target:
static void runTasks(ModLoadingStage fromStage, Consumer<List<ModLoadingException>> errorHandler) { raisedExceptions.clear(); if (taskQueue.isEmpty()) return; LOGGER.info(LOADING, "Dispatching synchronous work after {}: jobs", fromStage, taskQueue.size()); StopWatch globalTimer = StopWatch.createStarted(); while (!taskQueue.isEmpty()) { TaskInfo taskinfo = taskQueue.poll(); Stopwatch timer = Stopwatch.createStarted(); taskinfo.task.run(); timer.stop(); if (timer.elapsed(TimeUnit.SECONDS) >= 1) { LOGGER.warn(LOADING, "Mod '{}' took to run a deferred task.", taskinfo.owner.getModId(), timer); } } LOGGER.info(LOADING, "Synchronous work queue completed in {}", globalTimer); errorHandler.accept(raisedExceptions); }
Source:
protected void executeQueryCommand() { List<Guid> ids = new ArrayList<Guid>(); ids.add(getUser().getUserId()); ids.addAll(GuidUtils.getGuidListFromString(getUser().getGroupIds())); List<Quota> quotaList = new ArrayList<Quota>(); for (Guid id : ids) { quotaList.addAll(getDbFacade() .getQuotaDao() .getQuotaByAdElementId(id, null)); } getQueryReturnValue().setReturnValue(QuotaManager.getInstance().generatePerUserUsageReport(quotaList)); }

Target:
protected void executeQueryCommand() { List<Quota> quotaList = getDbFacade().getQuotaDao().getQuotaByAdElementId(getUser().getUserId(), null, true); getQueryReturnValue().setReturnValue(QuotaManager.getInstance().generatePerUserUsageReport(quotaList)); }
Source:
public static int getSessionTimeout() { return Math.max(getInt(R.string.preference_key_session_timeout, SessionFunnel.DEFAULT_SESSION_TIMEOUT), 1); }

Target:
public static int getSessionTimeout() { return Math.max(getInt(R.string.preference_key_session_timeout, SessionFunnel.DEFAULT_SESSION_TIMEOUT), SessionFunnel.MIN_SESSION_TIMEOUT); }
Source:
public void resolveArgumentWhenParameterTypeOAuth2AuthorizedClientAndCurrentAuthenticationNullThenThrowIllegalStateException() { this.authentication = null; MethodParameter methodParameter = this.getMethodParameter("paramTypeAuthorizedClient", OAuth2AuthorizedClient.class); assertThatThrownBy(() -> resolveArgument(methodParameter)) .isInstanceOf(IllegalStateException.class) .hasMessage("Unable to resolve the Authorized Client with registration identifier \"client1\". " + "An \"authenticated\" or \"anonymous\" request is required. " + "To allow for anonymous access, ensure ServerHttpSecurity.anonymous() is configured."); }

Target:
public void resolveArgumentWhenParameterTypeOAuth2AuthorizedClientAndCurrentAuthenticationNullThenThrowIllegalStateException() { this.authentication = null; MethodParameter methodParameter = this.getMethodParameter("paramTypeAuthorizedClient", OAuth2AuthorizedClient.class); assertThatThrownBy(() -> resolveArgument(methodParameter)) .isInstanceOf(IllegalStateException.class) .hasMessage("Unable to resolve the Authorized Client with registration identifier \"client1\". " + "An \"authenticated\" or \"unauthenticated\" session is required. " + "To allow for unauthenticated access, ensure ServerHttpSecurity.anonymous() is configured."); }
Source:
public GoalConflictMessage updateLatestGoalConflictMessageForUser(GoalConflictMessage message, MessageDestinationDTO destination) { Message.getRepository().save(message); return message; }

Target:
public GoalConflictMessage updateLatestGoalConflictMessageForUser(GoalConflictMessage message, MessageDestinationDTO destination) { return message; }
Source:
public void setJwtValidatorFactoryWhenNullThenThrowIllegalArgumentException(){ idTokenDecoderFactory.setJwtValidatorFactory(null); idTokenDecoderFactory.createDecoder(registration.build()); }

Target:
public void setJwtValidatorFactoryWhenNullThenThrowIllegalArgumentException(){ assertThatThrownBy(()-> idTokenDecoderFactory.setJwtValidatorFactory(null)) .isInstanceOf(IllegalArgumentException.class); }
Source:
public EmbeddedSubprocessExecutionSet(final @MapsTo("onEntryAction") OnEntryAction onEntryAction, final @MapsTo("onExitAction") OnExitAction onExitAction, final @MapsTo("isAsync") IsAsync isAsync, final @MapsTo("slaDueDate") SLADueDate slaDueDate) { super(isAsync, slaDueDate); this.onEntryAction = onEntryAction; this.onExitAction = onExitAction; }

Target:
public EmbeddedSubprocessExecutionSet(final @MapsTo("onEntryAction") OnEntryAction onEntryAction, final @MapsTo("onExitAction") OnExitAction onExitAction, final @MapsTo("isAsync") IsAsync isAsync, final @MapsTo("slaDueDate") SLADueDate slaDueDate) { super(slaDueDate); this.onEntryAction = onEntryAction; this.onExitAction = onExitAction; this.isAsync = isAsync; }
Source:
public HashMap<String, String> getHeaders() { HashMap<String, String> headers = new HashMap<String, String>(); Log.e("X-AUTH-TOKEN", preferences.getString("authentication_token", "none")); Log.e("X-AUTH-EMAIL", preferences.getString("email", "none")); headers.put("X-AUTH-TOKEN", preferences.getString("authentication_token", "none")); headers.put("X-AUTH-EMAIL", preferences.getString("email", "none")); return headers; }

Target:
public HashMap<String, String> getHeaders() { HashMap<String, String> headers = new HashMap<String, String>(); headers.put("X-AUTH-TOKEN", preferences.getString("authentication_token", "none")); headers.put("X-AUTH-EMAIL", preferences.getString("email", "none")); return headers; }
Source:
protected boolean isPopulate() { List<String> populates = httpHeaders.getRequestHeader(POPULATE); if (populates != null && populates.size() > 0) { return Boolean.valueOf(populates.get(0)); } else { return false; } }

Target:
protected boolean isPopulate() { List<String> populates = httpHeaders.getRequestHeader(POPULATE); if (populates != null && populates.size() > 0) { return Boolean.valueOf(populates.get(0)).booleanValue(); } else { return false; } }
Source:
public final void init() { sessionIdGenerator.setSessionIdLength(SESSION_ID_LENGTH); Map<String, Map<String, Session>> sessions = loadSessions(); sessionExpiryChecker = Executors.newScheduledThreadPool(1); sessionExpiryChecker.scheduleAtFixedRate(() -> sessions.values().forEach(entry -> entry.values().parallelStream() .filter(session -> (System.currentTimeMillis() - session.getLastAccessedTime() >= session.getMaxInactiveInterval() * 60 * 1000)) .forEach(Session::invalidate)), 30, 30, TimeUnit.SECONDS); }

Target:
public final void init() { sessionIdGenerator.setSessionIdLength(SESSION_ID_LENGTH); Map<String, Map<String, Session>> sessions = loadSessions(); sessionExpiryChecker = Executors.newScheduledThreadPool(1); if (sessions != null) { sessionExpiryChecker.scheduleAtFixedRate(() -> sessions.values().forEach(entry -> entry.values().parallelStream() .filter(session -> (System.currentTimeMillis() - session.getLastAccessedTime() >= session.getMaxInactiveInterval() * 60 * 1000)) .forEach(Session::invalidate)), 30, 30, TimeUnit.SECONDS); } }
Source:
public Configuration createCache(String cacheName, Configuration configuration, EnumSet<CacheContainerAdmin.AdminFlag> flags) { validateFlags(flags); try { CacheState state = new CacheState(parserRegistry.serialize(cacheName, configuration), flags); getStateCache().put(new ScopedState(CACHE_SCOPE, cacheName), state); return configuration; } catch (Exception e) { throw log.configurationSerializationFailed(cacheName, configuration, e); } }

Target:
public Configuration createCache(String cacheName, Configuration configuration, EnumSet<CacheContainerAdmin.AdminFlag> flags) { validateFlags(flags); try { CacheState state = new CacheState(parserRegistry.serialize(cacheName, configuration), flags); getStateCache().putIfAbsent(new ScopedState(CACHE_SCOPE, cacheName), state); return configuration; } catch (Exception e) { throw log.configurationSerializationFailed(cacheName, configuration, e); } }
Source:
private String getSubmitter(String documentId) { String submitterPrincipalId = null; String principalId = workflowDocumentService.getRoutedByPrincipalIdByDocumentId(documentId); List<ActionTaken> actionTakenDTOs = workflowDocumentService.getActionsTaken(documentId); for (ActionTaken actionTaken : actionTakenDTOs) { if (principalId.equals(actionTaken.getPrincipalId())) { submitterPrincipalId = principalId; } } return submitterPrincipalId; }

Target:
private String getSubmitter(String documentId) { String submitterPrincipalId = null; String principalId = workflowDocumentService.getRoutedByPrincipalIdByDocumentId(documentId); List<ActionTaken> actionTakenDTOs = workflowDocumentService.getActionsTaken(documentId); for (ActionTaken actionTaken : actionTakenDTOs) { if (StringUtils.equals(principalId, actionTaken.getPrincipalId())) { submitterPrincipalId = principalId; } } return submitterPrincipalId; }
Source:
public static WebArchive createWebArchiveNoGw() { logger.info("Packaging Test App"); WebArchive archive = ShrinkWrap.create(WebArchive.class, "restcomm.war"); final WebArchive restcommArchive = ShrinkWrapMaven.resolver() .resolve("org.restcomm:restcomm-connect.application:war:" + Version.getVersion()).withoutTransitivity() .asSingle(WebArchive.class); archive = archive.merge(restcommArchive); archive.delete("/WEB-INF/sip.xml"); archive.delete("/WEB-INF/conf/restcomm.xml"); archive.delete("/WEB-INF/data/hsql/restcomm.script"); archive.delete("/WEB-INF/classes/application.conf"); archive.addAsWebInfResource("sip.xml"); archive.addAsWebInfResource("restcomm_for_SMSEndpointTest.xml", "conf/restcomm.xml"); archive.addAsWebInfResource("restcomm.script_pushNotificationServer", "data/hsql/restcomm.script"); archive.addAsWebInfResource("akka_application.conf", "classes/application.conf"); archive.addAsWebResource("dial-client-entry_wActionUrl.xml"); logger.info("Packaged Test App"); return archive; }

Target:
public static WebArchive createWebArchiveNoGw() { logger.info("Packaging Test App"); reconfigurePorts(); Map<String,String> replacements = new HashMap(); replacements.put("2727", String.valueOf(mediaPort)); replacements.put("8080", String.valueOf(restcommHTTPPort)); replacements.put("8090", String.valueOf(mockPort)); replacements.put("5080", String.valueOf(restcommPort)); replacements.put("5090", String.valueOf(bobPort)); replacements.put("5091", String.valueOf(alicePort)); return WebArchiveUtil.createWebArchiveNoGw("restcomm_for_SMSEndpointTest.xml", "restcomm.script_pushNotificationServer", replacements); }
Source:
public void reauthentication() { ((GenericAccount)account).setId(USER_ID); StudyParticipant participant = new StudyParticipant.Builder().withEmail(RECIPIENT_EMAIL).build(); doReturn(CONSENTED_STATUS_MAP).when(consentService).getConsentStatuses(any()); doReturn(account).when(accountDao).reauthenticate(study, REAUTH_REQUEST); doReturn(participant).when(participantService).getParticipant(study, account, false); service.reauthenticate(study, CONTEXT, REAUTH_REQUEST); verify(accountDao).reauthenticate(study, REAUTH_REQUEST); verify(cacheProvider).removeSessionByUserId(USER_ID); verify(cacheProvider).setUserSession(sessionCaptor.capture()); UserSession captured = sessionCaptor.getValue(); assertEquals(RECIPIENT_EMAIL, captured.getParticipant().getEmail()); }

Target:
public void reauthentication() { ((GenericAccount)account).setId(USER_ID); account.setReauthToken(REAUTH_TOKEN); StudyParticipant participant = new StudyParticipant.Builder().withEmail(RECIPIENT_EMAIL).build(); doReturn(CONSENTED_STATUS_MAP).when(consentService).getConsentStatuses(any()); doReturn(account).when(accountDao).reauthenticate(study, REAUTH_REQUEST); doReturn(participant).when(participantService).getParticipant(study, account, false); UserSession session = service.reauthenticate(study, CONTEXT, REAUTH_REQUEST); assertEquals(RECIPIENT_EMAIL, session.getParticipant().getEmail()); assertEquals(REAUTH_TOKEN, session.getReauthToken()); verify(accountDao).reauthenticate(study, REAUTH_REQUEST); verify(cacheProvider).removeSessionByUserId(USER_ID); verify(cacheProvider).setUserSession(sessionCaptor.capture()); UserSession captured = sessionCaptor.getValue(); assertEquals(RECIPIENT_EMAIL, captured.getParticipant().getEmail()); assertEquals(REAUTH_TOKEN, captured.getReauthToken()); }
Source:
public void noTrailingSlashesInTarEntryNames() throws Exception { final MountableFile mountableFile = MountableFile.forClasspathResource("mappable-resource/test-resource.txt"); final TarArchiveInputStream tais = intoTarArchive((taos) -> { mountableFile.transferTo(taos, "/some/path.txt"); mountableFile.transferTo(taos, "/path.txt"); mountableFile.transferTo(taos, "path.txt"); }); ArchiveEntry entry; while ((entry = tais.getNextEntry()) != null) { assertFalse("no entries should have a trailing slash", entry.getName().endsWith("/")); } }

Target:
public void noTrailingSlashesInTarEntryNames() throws Exception { final MountableFile mountableFile = MountableFile.forClasspathResource("mappable-resource/test-resource.txt"); @Cleanup final TarArchiveInputStream tais = intoTarArchive((taos) -> { mountableFile.transferTo(taos, "/some/path.txt"); mountableFile.transferTo(taos, "/path.txt"); mountableFile.transferTo(taos, "path.txt"); }); ArchiveEntry entry; while ((entry = tais.getNextEntry()) != null) { assertFalse("no entries should have a trailing slash", entry.getName().endsWith("/")); } }
Source:
public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(ReceiveMode receiveMode, long sequenceNumber) { return receiveDeferredMessageBatch(receiveMode, null, sequenceNumber) .next() .publishOn(scheduler); }

Target:
public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(ReceiveMode receiveMode, long sequenceNumber) { return receiveDeferredMessageBatch(receiveMode, null, sequenceNumber) .next(); }
Source:
public void startTestFor(Activity activity) { Theme theme = new Random().nextBoolean() ? Theme.BLUE : Theme.WHITE; activity.getWindow().setBackgroundDrawable(new ColorDrawable(theme.backgroundColor)); imageView = createImageView(activity, theme); getParent(activity).addView(imageView); explosionField = ExplosionField.attach2Window(activity); delayInitialAnimation(); delayExplosion(); }

Target:
public void startTestFor(Activity activity) { Theme theme = NovodaActivity.RANDOM.nextBoolean() ? Theme.BLUE : Theme.WHITE; setBackground(activity, theme); imageView = createImageView(activity, theme); getParent(activity).addView(imageView); explosionField = ExplosionField.attach2Window(activity); delayInitialAnimation(); delayExplosion(); }
Source:
protected void buildVmCD() { Map<String, Object> struct; boolean hasPayload = vm.getVmPayload() != null && vm.getVmPayload().getType() == VmDeviceType.CDROM; if (hasPayload) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, vm.getVmPayload().getSpecParams(), true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, null, true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (VmPayload.isPayload(vmDevice.getSpecParams())) { continue; } struct = new HashMap<String, Object>(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct, vm); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); } } }

Target:
protected void buildVmCD() { Map<String, Object> struct; boolean hasPayload = vm.getVmPayload() != null && vm.getVmPayload().getDeviceType() == VmDeviceType.CDROM; if (hasPayload) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, vm.getVmPayload().getSpecParams(), true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.newGuid(), vm.getId()), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName(), "", 0, null, true, true, true, "", null, null, null); struct = new HashMap<String, Object>(); addCdDetails(vmDevice, struct, vm); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceGeneralType.DISK, VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } if (VmPayload.isPayload(vmDevice.getSpecParams())) { continue; } struct = new HashMap<String, Object>(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct, vm); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); } } }
Source:
public TemplateService get() { Logger.info("execute ViewServiceProvider.get()"); return HandlebarsTemplateService.of(defaultLoader(), overrideLoader()); }

Target:
public TemplateService get() { Logger.debug("Provide TemplateService"); return HandlebarsTemplateService.of(defaultLoader(), overrideLoader()); }
Source:
private void validateDependencies(final List<FlowTriggerDependency> dependencies) { Preconditions.checkNotNull(dependencies); Preconditions.checkArgument(!dependencies.isEmpty(), "no dependencies found"); Set<String> seen = Sets.newHashSet(); for (final FlowTriggerDependency dep : dependencies) { Preconditions.checkArgument(seen.add(dep.getName()), String.format("duplicate dependency" + ".name %s found, dependency.name should be unique", dep.getName())); } seen = Sets.newHashSet(); for (final FlowTriggerDependency dep : dependencies) { final Props props = dep.getPropsCopy(); Preconditions.checkArgument(seen.add(dep.getType() + ":" + props.toString()), String.format ("duplicate " + "dependency" + "config %s found, dependency config should be unique", dep.getName())); } }

Target:
private void validateDependencies(final List<FlowTriggerDependency> dependencies) { validateDepNameUniqueness(dependencies); validateDepDefinitionUniqueness(dependencies); }
Source:
public static void main(String[] args) throws Exception { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("SyslogdTests-context.xml", SyslogdTests.class); System.out.println("Hit enter to terminate"); System.in.read(); ctx.close(); ctx.destroy(); }

Target:
public static void main(String[] args) throws Exception { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("SyslogdTests-context.xml", SyslogdTests.class); System.out.println("Hit enter to terminate"); System.in.read(); ctx.close(); }
Source:
public void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { float f = (float) (par5 >> 24 & 255) / 255.0F; float f1 = (float) (par5 >> 16 & 255) / 255.0F; float f2 = (float) (par5 >> 8 & 255) / 255.0F; float f3 = (float) (par5 & 255) / 255.0F; float f4 = (float) (par6 >> 24 & 255) / 255.0F; float f5 = (float) (par6 >> 16 & 255) / 255.0F; float f6 = (float) (par6 >> 8 & 255) / 255.0F; float f7 = (float) (par6 & 255) / 255.0F; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glShadeModel(GL11.GL_SMOOTH); tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(f1, f2, f3, f); tessellator.addVertex((double) par3, (double) par2, 0); tessellator.addVertex((double) par1, (double) par2, 0); tessellator.setColorRGBA_F(f5, f6, f7, f4); tessellator.addVertex((double) par1, (double) par4, 0); tessellator.addVertex((double) par3, (double) par4, 0); tessellator.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); }

Target:
public void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { float f = (float) (par5 >> 24 & 255) / 255.0F; float f1 = (float) (par5 >> 16 & 255) / 255.0F; float f2 = (float) (par5 >> 8 & 255) / 255.0F; float f3 = (float) (par5 & 255) / 255.0F; float f4 = (float) (par6 >> 24 & 255) / 255.0F; float f5 = (float) (par6 >> 16 & 255) / 255.0F; float f6 = (float) (par6 >> 8 & 255) / 255.0F; float f7 = (float) (par6 & 255) / 255.0F; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glShadeModel(GL11.GL_SMOOTH); tessellator.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); }
Source:
private static Response performRequest( final RestClient restClient, final String method, final String endpoint, final Map<String, String> params, final HttpEntity entity) throws DBException { try { final Header[] headers; if (entity != null) { headers = new Header[]{new BasicHeader("content-type", ContentType.APPLICATION_JSON.toString())}; } else { headers = emptyHeaders; } return restClient.performRequest( method, endpoint, params, entity, headers); } catch (final IOException e) { e.printStackTrace(); throw new DBException(e); } }

Target:
private static Response performRequest( final RestClient restClient, final String method, final String endpoint, final Map<String, String> params, final HttpEntity entity) throws DBException { try { final Header[] headers; if (entity != null) { headers = new Header[]{new BasicHeader("content-type", ContentType.APPLICATION_JSON.toString())}; } else { headers = EMPTY_HEADERS; } return restClient.performRequest( method, endpoint, params, entity, headers); } catch (final IOException e) { e.printStackTrace(); throw new DBException(e); } }
Source:
public void findByCredentialsKeyValue_shouldFindGatewayAccount() { String paymentProvider = "test provider"; databaseTestHelper.addGatewayAccount(anAddGatewayAccountParams() .withAccountId(String.valueOf(gatewayAccountId)) .withPaymentGateway(paymentProvider) .withServiceName("service name") .build()); var credMap = Map.of("some_payment_provider_account_id", "accountid"); final Optional<GatewayAccountEntity> maybeGatewayAccount = gatewayAccountDao.findById(gatewayAccountId); assertThat(maybeGatewayAccount.isPresent(), is(true)); GatewayAccountEntity gatewayAccount = maybeGatewayAccount.get(); gatewayAccount.setCredentials(credMap); gatewayAccountDao.merge(gatewayAccount); Optional<GatewayAccountEntity> serviceAccountMaybe = gatewayAccountDao.findByCredentialsKeyValue("some_payment_provider_account_id", "accountid"); assertThat(serviceAccountMaybe.isPresent(), is(true)); Map<String, String> credentialsMap = serviceAccountMaybe.get().getCredentials(); assertThat(credentialsMap, hasEntry("some_payment_provider_account_id", "accountid")); }

Target:
public void findByCredentialsKeyValue_shouldFindGatewayAccount() { var credMap = Map.of("some_payment_provider_account_id", "accountid"); databaseTestHelper.addGatewayAccount(anAddGatewayAccountParams() .withAccountId(String.valueOf(gatewayAccountId)) .withPaymentGateway("test provider") .withServiceName("service name") .withCredentials(credMap) .build()); Optional<GatewayAccountEntity> maybeGatewayAccount = gatewayAccountDao.findByCredentialsKeyValue("some_payment_provider_account_id", "accountid"); assertThat(maybeGatewayAccount.isPresent(), is(true)); Map<String, String> credentialsMap = maybeGatewayAccount.get().getCredentials(); assertThat(credentialsMap, hasEntry("some_payment_provider_account_id", "accountid")); }
Source:
public static List<String> getVirtioScsiControllersForEntity(Guid id) { return VmHelper.getInstance().getEntity(List.class, VdcQueryType.GetVirtioScsiControllers, new IdQueryParameters(id), "GetVirtioScsiControllers", true); }

Target:
public List<String> getVirtioScsiControllersForEntity(Guid id) { return getEntity(List.class, VdcQueryType.GetVirtioScsiControllers, new IdQueryParameters(id), "GetVirtioScsiControllers", true); }
Source:
public void testProcessCssStyles() { FontState defaultState = new FontState(); FontState state = new FontState(); processCssStyles(state, defaultState, "font-size: 14px;color: rgb(3,3,3);font-style: italic bold;text-decoration: underline; background-color: blue;"); String number = NumberFormat.getInstance().format(1.273); assertEquals(number, String.format("%1.3f", state.sizeFactor)); assertEquals(new RGB(0, 0, 255), state.background); assertEquals(new RGB(3, 3, 3), state.foreground); assertTrue(state.isBold()); assertTrue(state.isItalic()); assertTrue(state.isUnderline()); }

Target:
public void testProcessCssStyles() { FontState defaultState = new FontState(); FontState state = new FontState(); processCssStyles(state, defaultState, "font-size: 14px;color: rgb(3,3,3);font-style: italic bold;text-decoration: underline; background-color: blue;"); assertEquals(1.273f, state.sizeFactor, 0.001f); assertEquals(new RGB(0, 0, 255), state.background); assertEquals(new RGB(3, 3, 3), state.foreground); assertTrue(state.isBold()); assertTrue(state.isItalic()); assertTrue(state.isUnderline()); }
Source:
public int removeChainFiles(String fromVersion, String toVersion) throws SQLException { int resCount = 0; ChainFiles cf = null; String getChainFiles = "SELECT * FROM Chain_File NATURAL JOIN Chain_File_Files " + "WHERE (FromVersion ~~* ?)" + " AND (ToVersion ~~* ?)"; PreparedStatement getChainFilesStmt = conn.prepareStatement(getChainFiles); getChainFilesStmt.setString(1, fromVersion); getChainFilesStmt.setString(2, toVersion); ResultSet getChainFilesRs = getChainFilesStmt.executeQuery(); if (getChainFilesRs.next()) { cf = new ChainFiles(getChainFilesRs); } getChainFilesStmt.close(); if (cf == null) { return 0; } String filePath = cf.folderPath; String query = "DELETE FROM Chain_File WHERE (FromVersion ~~* ?)" + " AND (ToVersion ~~* ?)"; File chainFile = new File(filePath); File chainFolder = chainFile.getParentFile(); if (chainFolder.exists()) { recursiveDelete(chainFolder); } PreparedStatement deleteStatement = conn.prepareStatement(query); deleteStatement.setString(1, fromVersion); deleteStatement.setString(2, toVersion); resCount = deleteStatement.executeUpdate(); deleteStatement.close(); return resCount; }

Target:
public int removeChainFiles(String fromVersion, String toVersion) throws SQLException { int resCount; String getChainFiles = "SELECT FolderPath FROM Chain_File NATURAL JOIN Chain_File_Files " + "WHERE (FromVersion ~~* ?)" + " AND (ToVersion ~~* ?)"; PreparedStatement getChainFilesStmt = conn.prepareStatement(getChainFiles); getChainFilesStmt.setString(1, fromVersion); getChainFilesStmt.setString(2, toVersion); ResultSet getChainFilesRs = getChainFilesStmt.executeQuery(); String filePath; if (getChainFilesRs.next()) { filePath = getChainFilesRs.getString("FolderPath"); } else { getChainFilesStmt.close(); return 0; } getChainFilesStmt.close(); removeChainFileFiles(fromVersion, toVersion); String query = "DELETE FROM Chain_File WHERE (FromVersion ~~* ?)" + " AND (ToVersion ~~* ?)"; File chainFile = new File(filePath); File chainFolder = chainFile.getParentFile(); if (chainFolder.exists()) { recursiveDelete(chainFolder); } PreparedStatement deleteStatement = conn.prepareStatement(query); deleteStatement.setString(1, fromVersion); deleteStatement.setString(2, toVersion); resCount = deleteStatement.executeUpdate(); deleteStatement.close(); return resCount; }
Source:
RelNode changeTraitsUsingConverters( RelNode rel, RelTraitSet toTraits) { final RelTraitSet fromTraits = rel.getTraitSet(); assert fromTraits.size() >= toTraits.size(); final boolean allowInfiniteCostConverters = CalciteSystemProperty.ALLOW_INFINITE_COST_CONVERTERS.value(); RelNode converted = rel; Convention conventionTrait = null; for (RelTrait trait : toTraits) { if (trait instanceof Convention) { conventionTrait = (Convention) trait; break; } } for (int i = 0; (converted != null) && (i < toTraits.size()); i++) { RelTrait fromTrait = converted.getTraitSet().getTrait(i); final RelTraitDef traitDef = fromTrait.getTraitDef(); RelTrait toTrait = toTraits.getTrait(i); if (toTrait == null) { continue; } assert traitDef == toTrait.getTraitDef(); if (fromTrait.equals(toTrait)) { continue; } rel = traitDef.convert( this, converted, toTrait, conventionTrait, allowInfiniteCostConverters); if (rel != null) { assert rel.getTraitSet().getTrait(traitDef).satisfies(toTrait); register(rel, converted); } converted = rel; } if (converted != null) { assert converted.getTraitSet().satisfies(toTraits); } return converted; }

Target:
RelNode changeTraitsUsingConverters( RelNode rel, RelTraitSet toTraits) { final RelTraitSet fromTraits = rel.getTraitSet(); assert fromTraits.size() >= toTraits.size(); final boolean allowInfiniteCostConverters = CalciteSystemProperty.ALLOW_INFINITE_COST_CONVERTERS.value(); RelNode converted = rel; for (int i = 0; (converted != null) && (i < toTraits.size()); i++) { RelTrait fromTrait = converted.getTraitSet().getTrait(i); final RelTraitDef traitDef = fromTrait.getTraitDef(); RelTrait toTrait = toTraits.getTrait(i); if (toTrait == null) { continue; } assert traitDef == toTrait.getTraitDef(); if (fromTrait.equals(toTrait)) { continue; } rel = traitDef.convert( this, converted, toTrait, allowInfiniteCostConverters); if (rel != null) { assert rel.getTraitSet().getTrait(traitDef).satisfies(toTrait); register(rel, converted); } converted = rel; } if (converted != null) { assert converted.getTraitSet().satisfies(toTraits); } return converted; }
Source:
protected void modifySearchResultLinkTitle(SearchResult result, final HttpServletRequest httpServletRequest, final IPortletWindowId portletWindowId) { if (result.getType().size() > 0 && result.getTitle().contains("${")) { final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(httpServletRequest, portletWindowId); final IPortletEntity portletEntity = portletWindow.getPortletEntity(); final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition(); final SpELEnvironmentRoot spelEnvironment = new SpELEnvironmentRoot(portletDefinition); try { result.setTitle(spELService.getValue(result.getTitle(), spelEnvironment)); } catch (SpelParseException e) { result.setTitle("Invalid Spring EL expression '" + result.getTitle()+"'"); } } }

Target:
protected void modifySearchResultLinkTitle(SearchResult result, final HttpServletRequest httpServletRequest, final IPortletWindowId portletWindowId) { if (result.getType().size() > 0 && result.getTitle().contains("${")) { final IPortletWindow portletWindow = this.portletWindowRegistry.getPortletWindow(httpServletRequest, portletWindowId); final IPortletEntity portletEntity = portletWindow.getPortletEntity(); final IPortletDefinition portletDefinition = portletEntity.getPortletDefinition(); final SpELEnvironmentRoot spelEnvironment = new SpELEnvironmentRoot(portletDefinition); try { result.setTitle(spELService.getValue(result.getTitle(), spelEnvironment)); } catch (SpelParseException | SpelEvaluationException e) { result.setTitle("(Invalid portlet title) - see details in log file"); logger.error("Invalid Spring EL expression in search result portlet title", result.getTitle(), e); } } }
Source:
private void rememberAliases(IPreferenceStore ps) { if (fStructureViewerAliases == null) return; StringBuffer buffer= new StringBuffer(); Iterator<String> iter= fStructureViewerAliases.keySet().iterator(); while (iter.hasNext()) { String key= iter.next(); String alias= fStructureViewerAliases.get(key); buffer.append(key); buffer.append('.'); buffer.append(alias); buffer.append(' '); } ps.setValue(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME, buffer.toString()); }

Target:
private void rememberAliases(IPreferenceStore ps) { if (fStructureViewerAliases == null) return; StringBuilder buffer= new StringBuilder(); for (Map.Entry<String, String> entry : fStructureViewerAliases.entrySet()) { String key= entry.getKey(); String alias= entry.getValue(); buffer.append(key); buffer.append('.'); buffer.append(alias); buffer.append(' '); } ps.setValue(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME, buffer.toString()); }
Source:
public String renderAfterConstructorJs() { StringBuilder builder = new StringBuilder(); if (getStyle() != null) { builder.append(getJsId() + ".setStyle(new " + getStyle().getJsType() + "(" + getStyle().renderJs() + "));"); } return builder.toString(); }

Target:
public String renderAfterConstructorJs() { StringBuilder builder = new StringBuilder(); if (getStyle() != null) { builder.append(getJsId()); builder.append(".setStyle(new "); builder.append(getStyle().getJsType()); builder.append("(" + getStyle().renderJs() + "));"); } return builder.toString(); }
Source:
public void byteEquivalenceTest(final List<Byte> values) { codecPairTestForByte(values, this::writeByteForByte, this::readIntegerForByte); codecPairTestForByte(values, this::writeByteForByte, this::readLongForByte); codecPairTestForByte(values, this::writeIntegerForByte, this::readByteForByte); codecPairTestForByte(values, this::writeIntegerForByte, this::readLongForByte); codecPairTestForByte(values, this::writeLongForByte, this::readByteForByte); codecPairTestForByte(values, this::writeLongForByte, this::readIntegerForByte); }

Target:
public void byteEquivalenceTest(final List<Byte> values) { codecPairTest(values, this::externalByteCodecWrite, this::externalIntegerCodecRead); codecPairTest(values, this::externalByteCodecWrite, this::externalLongCodecRead); codecPairTest(values, this::externalIntegerCodecWrite, this::externalByteCodecRead); codecPairTest(values, this::externalIntegerCodecWrite, this::externalLongCodecRead); codecPairTest(values, this::externalLongCodecWrite, this::externalByteCodecRead); codecPairTest(values, this::externalLongCodecWrite, this::externalIntegerCodecRead); }
Source:
private void checkForMaxLength(Case caseForBlock) throws InvalidStructureException { if (caseForBlock.getTypeId().length() > 255) { throw new InvalidStructureException( "case_type is longer than 255 chars for case with ID: " + caseForBlock.getCaseId() + " and case_type " + caseForBlock.getTypeId(), parser); } else if (caseForBlock.getUserId().length() > 255) { throw new InvalidStructureException( "owner_id is longer than 255 chars for case with ID: " + caseForBlock.getCaseId() + " and owner_id " + caseForBlock.getUserId(), parser); } else if (caseForBlock.getName().length() > 255) { throw new InvalidStructureException( "case_name is longer than 255 chars for case with ID: " + caseForBlock.getCaseId() + " and case_name " + caseForBlock.getName(), parser); } else if (caseForBlock.getExternalId()!=null && caseForBlock.getExternalId().length() > 255) { throw new InvalidStructureException( "external_id is longer than 255 chars for case with ID: " + caseForBlock.getCaseId() + " and external_id " + caseForBlock.getExternalId(), parser); } }

Target:
private void checkForMaxLength(Case caseForBlock) throws InvalidStructureException { if (caseForBlock.getTypeId().length() > 255) { throw new InvalidCasePropertyLengthException("case_type"); } else if (caseForBlock.getUserId().length() > 255) { throw new InvalidCasePropertyLengthException("owner_id"); } else if (caseForBlock.getName().length() > 255) { throw new InvalidCasePropertyLengthException("case_name"); } else if (caseForBlock.getExternalId()!=null && caseForBlock.getExternalId().length() > 255) { throw new InvalidCasePropertyLengthException("external_id"); } }