auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addComplaintData(final SurveillanceReportWorkbookWrapper workbook, final Row row, final Complaint complaint) { addDataCell(workbook, row, COL_COMPLAINT_DATE, dateFormatter.format(complaint.getReceivedDate())); addDataCell(workbook, row, COL_ACB_COMPLAINT_ID, complaint.getAcbComplaintId()); addDataCell(workbook, row, COL_ONC_COMPLAINT_ID, complaint.getOncComplaintId()); addDataCell(workbook, row, COL_SUMMARY, complaint.getSummary()); addDataCell(workbook, row, COL_ACTIONS_RESPONSE, complaint.getActions()); addDataCell(workbook, row, COL_COMPLAINANT_TYPE, complaint.getComplainantType() != null ? complaint.getComplainantType().getName() : ""); addDataCell(workbook, row, COL_COMPLAINANT_TYPE_OTHER, complaint.getComplainantTypeOther()); addDataCell(workbook, row, COL_COMPLAINANT_CONTACTED, complaint.isComplainantContacted() ? "Yes" : "No"); addDataCell(workbook, row, COL_DEVELOPER_CONTACTED, complaint.isDeveloperContacted() ? "Yes" : "No"); addDataCell(workbook, row, COL_ATL_CONTACTED, complaint.isOncAtlContacted() ? "Yes" : "No"); addDataCell(workbook, row, COL_COMPLAINT_STATUS, complaint.getClosedDate() == null ? "Open" : "Closed"); addDataCell(workbook, row, COL_FLAGGED_FOR_ONC, complaint.isFlagForOncReview() ? "Yes" : "No"); }

Target:
private void addComplaintData(final SurveillanceReportWorkbookWrapper workbook, final Row row, final Complaint complaint) { addDataCell(workbook, row, COL_COMPLAINT_DATE, dateFormatter.format(complaint.getReceivedDate())); addDataCell(workbook, row, COL_ACB_COMPLAINT_ID, complaint.getAcbComplaintId()); addDataCell(workbook, row, COL_ONC_COMPLAINT_ID, complaint.getOncComplaintId()); addDataCell(workbook, row, COL_SUMMARY, complaint.getSummary()); addDataCell(workbook, row, COL_ACTIONS_RESPONSE, complaint.getActions()); addDataCell(workbook, row, COL_COMPLAINANT_TYPE, complaint.getComplainantType() != null ? complaint.getComplainantType().getName() : ""); addDataCell(workbook, row, COL_COMPLAINANT_TYPE_OTHER, complaint.getComplainantTypeOther()); addDataCell(workbook, row, COL_COMPLAINANT_CONTACTED, complaint.isComplainantContacted() ? BOOLEAN_YES : BOOLEAN_NO); addDataCell(workbook, row, COL_DEVELOPER_CONTACTED, complaint.isDeveloperContacted() ? BOOLEAN_YES : BOOLEAN_NO); addDataCell(workbook, row, COL_ATL_CONTACTED, complaint.isOncAtlContacted() ? BOOLEAN_YES : BOOLEAN_NO); addDataCell(workbook, row, COL_COMPLAINT_STATUS, complaint.getClosedDate() == null ? Complaint.COMPLAINT_OPEN : Complaint.COMPLAINT_CLOSED); addDataCell(workbook, row, COL_FLAGGED_FOR_ONC, complaint.isFlagForOncReview() ? BOOLEAN_YES : BOOLEAN_NO); }
Source:
public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) { final List<Restaurant> restaurants = SkillUtils.getRestaurantsByMeal(Meal.COFFEE, SkillData.CITY_INFORMATION.getRestaurants()); final Restaurant restaurant = restaurants.get(SkillUtils.getRandomIndexInRange(restaurants.size(), 0)); final ResourceBundle messages = SkillUtils.getMessages(handlerInput); final Map<String, Object> sessionAttributes = handlerInput.getAttributesManager().getSessionAttributes(); sessionAttributes.put("restaurant", restaurant.getName()); final String speechOutput = String.format(messages.getString("COFFEE_SPEECH"), restaurant.getName()); return handlerInput.getResponseBuilder() .withSpeech(speechOutput) .withReprompt(speechOutput) .build(); }

Target:
public Optional<Response> handle(HandlerInput handlerInput, IntentRequest intentRequest) { return SkillUtils.getRestaurantDataAsResponse(handlerInput, true, Meal.COFFEE, "Messages", "COFFEE_SPEECH", SkillData.CITY_INFORMATION.getRestaurants()); }
Source:
protected boolean performImageVdsmOperation() { return TransactionSupport.executeInNewTransaction(() -> { VDSReturnValue vdsReturnValue = null; try { Guid storagePoolId = getDiskImage().getStoragePoolId() != null ? getDiskImage().getStoragePoolId() : Guid.Empty; Guid storageDomainId = getDiskImage().getStorageIds() != null && !getDiskImage().getStorageIds().isEmpty() ? getDiskImage().getStorageIds() .get(0) : Guid.Empty; Guid imageGroupId = getDiskImage().getId() != null ? getDiskImage().getId() : Guid.Empty; Guid taskId = persistAsyncTaskPlaceHolder(ActionType.RestoreAllSnapshots); vdsReturnValue = runVdsCommand(VDSCommandType.DestroyImage, postDeleteActionHandler.fixParameters( new DestroyImageVDSCommandParameters(storagePoolId, storageDomainId, imageGroupId, _imagesToDelete, getDiskImage().isWipeAfterDelete(), storageDomainDao.get(storageDomainId).getDiscardAfterDelete(), true))); if (vdsReturnValue.getSucceeded()) { getReturnValue().getInternalVdsmTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), ActionType.RestoreAllSnapshots, VdcObjectType.Storage, storageDomainId)); } } catch (EngineException e) { getReturnValue().setFault(new EngineFault(e, e.getVdsError().getCode())); log.info("Image '{}' not exist in Irs", getDiskImage().getImageId()); } return vdsReturnValue != null ? vdsReturnValue.getSucceeded() : false; }); }

Target:
protected boolean performImageVdsmOperation() { VDSReturnValue vdsReturnValue = null; try { Guid storagePoolId = getDiskImage().getStoragePoolId() != null ? getDiskImage().getStoragePoolId() : Guid.Empty; Guid storageDomainId = getDiskImage().getStorageIds() != null && !getDiskImage().getStorageIds().isEmpty() ? getDiskImage().getStorageIds() .get(0) : Guid.Empty; Guid imageGroupId = getDiskImage().getId() != null ? getDiskImage().getId() : Guid.Empty; Guid taskId = persistAsyncTaskPlaceHolder(ActionType.RestoreAllSnapshots); vdsReturnValue = TransactionSupport.executeInScope(TransactionScopeOption.Suppress, () -> runVdsCommand(VDSCommandType.DestroyImage, postDeleteActionHandler.fixParameters(new DestroyImageVDSCommandParameters( storagePoolId, storageDomainId, imageGroupId, _imagesToDelete, getDiskImage().isWipeAfterDelete(), storageDomainDao.get(storageDomainId).getDiscardAfterDelete(), true))) ); if (vdsReturnValue.getSucceeded()) { getReturnValue().getInternalVdsmTaskIdList().add( createTask(taskId, vdsReturnValue.getCreationInfo(), ActionType.RestoreAllSnapshots, VdcObjectType.Storage, storageDomainId)); } } catch (EngineException e) { getReturnValue().setFault(new EngineFault(e, e.getVdsError().getCode())); log.info("Image '{}' not exist in Irs", getDiskImage().getImageId()); } return vdsReturnValue != null ? vdsReturnValue.getSucceeded() : false; }
Source:
public List<String> list(@QueryParam("namePattern") final String namePattern, @QueryParam("selector") final List<String> hostSelectors) { List<String> hosts = model.listHosts(); if (namePattern != null) { final Predicate<String> matchesPattern = Pattern.compile(namePattern).asPredicate(); hosts = hosts.stream() .filter(matchesPattern) .collect(Collectors.toList()); } if (!hostSelectors.isEmpty()) { final List<HostSelector> selectors = hostSelectors.stream() .map(selectorStr -> { final HostSelector parsed = HostSelector.parse(selectorStr); if (parsed == null) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid host selector: " + selectorStr) .build() ); } return parsed; }) .collect(Collectors.toList()); final Function<String, Map<String, String>> getLabels = host -> { final HostStatus hostStatus = model.getHostStatus(host); return hostStatus == null ? emptyMap() : hostStatus.getLabels(); }; final Map<String, Map<String, String>> hostsAndLabels = hosts.stream() .collect(Collectors.toMap(Function.identity(), getLabels)); final HostMatcher matcher = new HostMatcher(hostsAndLabels); hosts = matcher.getMatchingHosts(selectors); } return hosts; }

Target:
public List<String> list(@QueryParam("namePattern") final String namePattern, @QueryParam("selector") final List<String> hostSelectors) { List<String> hosts = model.listHosts(); if (namePattern != null) { final Predicate<String> matchesPattern = Pattern.compile(namePattern).asPredicate(); hosts = hosts.stream() .filter(matchesPattern) .collect(Collectors.toList()); } if (!hostSelectors.isEmpty()) { final List<HostSelector> selectors = hostSelectors.stream() .map(selectorStr -> { final HostSelector parsed = HostSelector.parse(selectorStr); if (parsed == null) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid host selector: " + selectorStr) .build() ); } return parsed; }) .collect(Collectors.toList()); final Map<String, Map<String, String>> hostsAndLabels = getLabels(hosts); final HostMatcher matcher = new HostMatcher(hostsAndLabels); hosts = matcher.getMatchingHosts(selectors); } return hosts; }
Source:
public BundleDTO install(String location, byte[] data) throws Exception { if (data == null) { return null; } Bundle installedBundle = null; try (InputStream stream = new ByteArrayInputStream(data)) { installedBundle = context.getBundle(location); if (installedBundle == null) { installedBundle = context.installBundle(location, stream); } else { installedBundle.update(stream); refresh(true); } } return toDTO(installedBundle); }

Target:
public BundleDTO install(String location, byte[] data) throws Exception { Bundle installedBundle = null; try (InputStream stream = new ByteArrayInputStream(data)) { installedBundle = context.getBundle(location); if (installedBundle == null) { installedBundle = context.installBundle(location, stream); } else { installedBundle.update(stream); refresh(true); } } return toDTO(installedBundle); }
Source:
private void dumpPortToFile() { String filename = props.getString(AZKABAN_EXECUTOR_PORT_FILE, "executor.port"); try (BufferedWriter writer = new BufferedWriter(new FileWriter(filename))) { writer.write(String.valueOf(getPort())); writer.write("\n"); } catch (IOException e) { logger.error(e); } }

Target:
private void dumpPortToFile() { try (BufferedWriter writer = new BufferedWriter(new FileWriter(AZKABAN_EXECUTOR_PORT_FILENAME))) { writer.write(String.valueOf(getPort())); writer.write("\n"); } catch (IOException e) { logger.error(e); Throwables.propagate(e); } }
Source:
public void checkAttributeValue(PerunSessionImpl sess, Facility facility, User user, Attribute attribute) throws WrongAttributeValueException, WrongReferenceAttributeValueException, InternalErrorException, WrongAttributeAssignmentException { if(attribute.getValue() == null) throw new WrongAttributeValueException(attribute, "Login can't be null"); try { Attribute loginNamespaceAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":login-namespace"); Attribute loginAttribute = null; if (loginNamespaceAttribute.getValue() != null) { loginAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":login-namespace:" + (String) loginNamespaceAttribute.getValue()); loginAttribute.setValue(attribute.getValue()); sess.getPerunBl().getAttributesManagerBl().checkAttributeValue(sess, user, loginAttribute); } else { throw new WrongReferenceAttributeValueException(attribute, loginNamespaceAttribute, user, facility, "Badly selected login or namespace is not filled"); } } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException(e); } }

Target:
public void checkAttributeValue(PerunSessionImpl sess, Facility facility, User user, Attribute attribute) throws WrongAttributeValueException, WrongReferenceAttributeValueException, InternalErrorException, WrongAttributeAssignmentException { if(attribute.getValue() == null) throw new WrongAttributeValueException(attribute, "Login can't be null"); try { Attribute loginNamespaceAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":login-namespace"); Attribute loginAttribute = null; if (loginNamespaceAttribute.getValue() != null) { loginAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, AttributesManager.NS_USER_ATTR_DEF + ":login-namespace:" + (String) loginNamespaceAttribute.getValue()); loginAttribute.setValue(attribute.getValue()); sess.getPerunBl().getAttributesManagerBl().checkAttributeValue(sess, user, loginAttribute); } else { throw new WrongReferenceAttributeValueException(attribute, loginNamespaceAttribute, user, facility, "Facility need to have nonempty login-namespace attribute."); } } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException(e); } }
Source:
public int onStartCommand(Intent intent, int flags, int startId) { AppLog.i(T.UTILS, "installation referrer service > task: " + startId + " started"); mInstallationReferrerServiceLogic.performTask(intent.getExtras(), Integer.valueOf(startId)); return START_NOT_STICKY; }

Target:
public int onStartCommand(Intent intent, int flags, int startId) { AppLog.i(T.UTILS, "installation referrer service > task: " + startId + " started"); mInstallationReferrerServiceLogic.performTask(intent.getExtras(), startId); return START_NOT_STICKY; }
Source:
public Api getConnection() throws UnsecuredConnectionAttemptError, ServerException, IOException { if (api == null) { String url = String.format("%s://%s:%s/ovirt-engine/api", protocol, server, port); log.debug(String.format("Logging to %s as %s", url, username)); api = new Api(url, username, password, true); } return api; }

Target:
public synchronized Api getConnection() throws UnsecuredConnectionAttemptError, ServerException, IOException { if (api == null) { String url = String.format("%s://%s:%s/ovirt-engine/api", protocol, server, port); log.debug(String.format("Logging to %s as %s", url, username)); api = new Api(url, username, password, true); } return api; }
Source:
public String buildQueryParams(boolean redactPii) { StringBuilder builder = new StringBuilder(); if (transactionType != null) { builder.append("&transaction_type=").append(transactionType.getValue()); } if (isNotBlank(reference)) builder.append("&reference=").append(reference); if (email != null) { if (redactPii) builder.append("&email=*****"); else builder.append("&email=").append(email); } if (fromDate != null) builder.append("&from_date=").append(fromDate); if (toDate != null) builder.append("&to_date=").append(toDate); if (page != null) builder.append("&page=").append(page); if (displaySize != null) builder.append("&display_size=").append(displaySize); getExternalStates().stream() .findFirst() .ifPresent(state -> builder.append("&state=").append(state)); String paymentStates = this.externalChargeStates.stream() .collect(Collectors.joining(",")); String refundStates = this.externalRefundStates.stream() .collect(Collectors.joining(",")); if (isNotEmpty(paymentStates)) { builder.append("&payment_states=").append(paymentStates); } if (isNotEmpty(refundStates)) { builder.append("&refund_states=").append(refundStates); } if (!cardBrands.isEmpty()) { cardBrands.forEach(cardBrand -> builder.append("&card_brand=").append(cardBrand)); } return builder.toString().replaceFirst("&", ""); }

Target:
private String buildQueryParams(boolean redactPii) { StringBuilder builder = new StringBuilder(); if (transactionType != null) { builder.append("&transaction_type=").append(transactionType.getValue()); } if (isNotBlank(reference)) builder.append("&reference=").append(reference); if (email != null) { if (redactPii) { builder.append("&email=*****"); } else { builder.append("&email=").append(email); } } if (fromDate != null) builder.append("&from_date=").append(fromDate); if (toDate != null) builder.append("&to_date=").append(toDate); if (page != null) builder.append("&page=").append(page); if (displaySize != null) builder.append("&display_size=").append(displaySize); getExternalStates().stream() .findFirst() .ifPresent(state -> builder.append("&state=").append(state)); String paymentStates = this.externalChargeStates.stream() .collect(Collectors.joining(",")); String refundStates = this.externalRefundStates.stream() .collect(Collectors.joining(",")); if (isNotEmpty(paymentStates)) { builder.append("&payment_states=").append(paymentStates); } if (isNotEmpty(refundStates)) { builder.append("&refund_states=").append(refundStates); } if (!cardBrands.isEmpty()) { cardBrands.forEach(cardBrand -> builder.append("&card_brand=").append(cardBrand)); } return builder.toString().replaceFirst("&", ""); }
Source:
public void bindToCommit(CommitMetadata commitMetadata) { argumentIsNotNull(commitMetadata); this.commitMetadata = Optional.of(commitMetadata); }

Target:
public void bindToCommit(CommitMetadata commitMetadata) { argumentIsNotNull(commitMetadata); if (this.commitMetadata.isPresent()) { throw new IllegalStateException("Change should be efectively immutable"); } this.commitMetadata = Optional.of(commitMetadata); }
Source:
public Worker(MetricServiceAppConfiguration config, String id, String startTime, String endTime, Boolean exactTimeWindow, Boolean series, String downsample, Map<String, String> tags, List<MetricSpecification> queries) { if (queries == null) { RuntimeException t = new RuntimeException("WHAT???"); t.printStackTrace(); throw t; } this.id = id; this.startTime = startTime; this.endTime = endTime; this.exactTimeWindow = exactTimeWindow; this.series = series; this.tags = tags; this.downsample = downsample; this.queries = queries; }

Target:
public Worker(MetricServiceAppConfiguration config, String id, String startTime, String endTime, Boolean exactTimeWindow, Boolean series, String downsample, Map<String, String> tags, List<MetricSpecification> queries) { if (queries == null) { log.error("Attempt to create query worker without any queries specified"); IllegalArgumentException t = new IllegalArgumentException( "No queries specified"); throw t; } this.id = id; this.startTime = startTime; this.endTime = endTime; this.exactTimeWindow = exactTimeWindow; this.series = series; this.tags = tags; this.downsample = downsample; this.queries = queries; }
Source:
public List<ProjectProblem> getProblems() { return null; }

Target:
public List<ProjectProblem> getProblems() { return problems; }
Source:
public void runCommand(Player player, List<String> arguments) { PlayerAuth auth = playerCache.getAuth(player.getName()); if (auth != null && !Utils.isEmailEmpty(auth.getEmail())) { commonService.send(player, MessageKey.EMAIL_SHOW, emailMask(auth.getEmail())); } else { commonService.send(player, MessageKey.SHOW_NO_EMAIL); } }

Target:
public void runCommand(Player player, List<String> arguments) { PlayerAuth auth = playerCache.getAuth(player.getName()); if (auth != null && !Utils.isEmailEmpty(auth.getEmail())) { if(commonService.getProperty(SecuritySettings.USE_EMAIL_MASKING)){ commonService.send(player, MessageKey.EMAIL_SHOW, emailMask(auth.getEmail())); } else { commonService.send(player, MessageKey.EMAIL_SHOW, auth.getEmail()); } } else { commonService.send(player, MessageKey.SHOW_NO_EMAIL); } }
Source:
public void checkStateChanged(CheckStateChangedEvent event) { if (fChartViewer != null) { Collection<ITmfTreeViewerEntry> checkedViewerEntries = getCheckedViewerEntries(); int size = Iterables.size(Iterables.filter(checkedViewerEntries, TmfGenericTreeEntry.class)); IPreferenceStore corePreferenceStore = Activator.getDefault().getCorePreferenceStore(); String hide = corePreferenceStore.getString(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE); if (size > 20 && !MessageDialogWithToggle.ALWAYS.equals(hide)) { MessageDialogWithToggle.openWarning(getControl().getShell(), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedTitle, String.format(Messages.AbstractSelectTreeViewer_ManyEntriesSelectedMessage, size), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedDontShowAgain, false, corePreferenceStore, ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE); } fChartViewer.handleCheckStateChangedEvent(checkedViewerEntries); refresh(); } }

Target:
public void checkStateChanged(CheckStateChangedEvent event) { if (fChartViewer != null) { fChartViewer.handleCheckStateChangedEvent(getCheckedViewerEntries()); refresh(); } }
Source:
private int interpolateArgumentIndexToParameterIndex(List<HaxeExpression> arguments, HaxeParameterDescription[] parameters, int currentArgumentIndex) { int argumentIndex = 0; int recoverParameterIndex = 0; if (arguments == null || arguments.size() == 0) return argumentIndex; final int parameterCount = parameters.length; final int argumentsCount = arguments.size(); for (int parameterIndex = 0; parameterIndex < parameterCount; parameterIndex++) { if (argumentIndex >= argumentsCount) return parameterIndex; final HaxeParameterDescription parameter = parameters[parameterIndex]; if (!parameters[parameterIndex].isPredefined()) { if (argumentIndex == currentArgumentIndex) return parameterIndex; recoverParameterIndex = parameterIndex + 1; argumentIndex++; continue; } final HaxeExpression argument = arguments.get(argumentIndex); final ResultHolder parameterType = parameter.getResultHolder(); final ResultHolder argumentType = HaxeTypeResolver.getPsiElementType(argument, new HaxeGenericResolver()); if (parameterType.canAssign(argumentType)) { if (argumentIndex == currentArgumentIndex) return parameterIndex; recoverParameterIndex = parameterIndex + 1; argumentIndex++; } } return recoverParameterIndex; }

Target:
private int interpolateArgumentIndexToParameterIndex(List<HaxeExpression> arguments, HaxeParameterDescription[] parameters, int currentArgumentIndex) { int argumentIndex = 0; int recoverParameterIndex = 0; if (arguments == null || arguments.size() == 0) return argumentIndex; final int parameterCount = parameters.length; final int argumentsCount = arguments.size(); for (int parameterIndex = 0; parameterIndex < parameterCount; parameterIndex++) { if (argumentIndex >= argumentsCount) return parameterIndex; final HaxeParameterDescription parameter = parameters[parameterIndex]; if (!parameters[parameterIndex].isPredefined()) { if (argumentIndex == currentArgumentIndex) return parameterIndex; recoverParameterIndex = parameterIndex + 1; argumentIndex++; continue; } final HaxeExpression argument = arguments.get(argumentIndex); final ResultHolder parameterType = parameter.getResultHolder(); final ResultHolder argumentType = HaxeTypeResolver.getPsiElementType(argument, HaxeGenericResolverUtil.generateResolverFromScopeParents(argument)); if (parameterType.canAssign(argumentType)) { if (argumentIndex == currentArgumentIndex) return parameterIndex; recoverParameterIndex = parameterIndex + 1; argumentIndex++; } } return recoverParameterIndex; }
Source:
public ChandraFlamesCatalyst(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{R}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); this.addAbility(new LoyaltyAbility(new DamagePlayersEffect(3, TargetController.OPPONENT), 1)); CastCardFromGraveyardEffect minusEffect = new CastCardFromGraveyardEffect(); minusEffect.setText("You may cast target red instant or sorcery card from your graveyard. If that spell would be put into your graveyard this turn, exile it instead."); Ability ability = new LoyaltyAbility(minusEffect, -2); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); Effect discardHandEffect = new DiscardHandControllerEffect(); Effect drawEffect = new DrawCardSourceControllerEffect(7); drawEffect.setText(", then draw seven cards"); Effect castSpellsFromHandEffect = new CastFromHandWithoutPayingManaCostEffect( StaticFilters.FILTER_CARD_NON_LAND, true, Duration.EndOfTurn); castSpellsFromHandEffect.setText("Until end of turn, you may cast spells from your hand without paying their mana costs."); Ability ultimateAbility = new LoyaltyAbility(discardHandEffect, -8); ultimateAbility.addEffect(drawEffect); ultimateAbility.addEffect(castSpellsFromHandEffect); this.addAbility(ultimateAbility); }

Target:
public ChandraFlamesCatalyst(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{R}{R}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CHANDRA); this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5)); this.addAbility(new LoyaltyAbility(new DamagePlayersEffect(3, TargetController.OPPONENT), 1)); CastCardFromGraveyardThenExileItEffect minusEffect = new CastCardFromGraveyardThenExileItEffect(); minusEffect.setText("You may cast target red instant or sorcery card from your graveyard. If that spell would be put into your graveyard this turn, exile it instead"); Ability ability = new LoyaltyAbility(minusEffect, -2); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); Effect discardHandEffect = new DiscardHandControllerEffect(); Effect drawEffect = new DrawCardSourceControllerEffect(7); drawEffect.setText(", then draw seven cards"); Effect castSpellsFromHandEffect = new CastFromHandWithoutPayingManaCostEffect( StaticFilters.FILTER_CARD_NON_LAND, true, Duration.EndOfTurn); castSpellsFromHandEffect.setText("Until end of turn, you may cast spells from your hand without paying their mana costs"); Ability ultimateAbility = new LoyaltyAbility(discardHandEffect, -8); ultimateAbility.addEffect(drawEffect); ultimateAbility.addEffect(castSpellsFromHandEffect); this.addAbility(ultimateAbility); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_dashboard); if (savedInstanceState == null) { prepareUI(); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_dashboard); if (savedInstanceState == null) { DashboardUnsentFragment detailsFragment = new DashboardUnsentFragment(); detailsFragment.setArguments(getIntent().getExtras()); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.add(R.id.dashboard_details_container, detailsFragment); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commit(); DashboardSentFragment completedFragment = new DashboardSentFragment(); detailsFragment.setArguments(getIntent().getExtras()); FragmentTransaction ftr = getFragmentManager().beginTransaction(); ftr.add(R.id.dashboard_completed_container, completedFragment); ftr.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ftr.commit(); } }
Source:
List<byte[]> deaggregateKinesisRecord(Record kinesisRecord) throws InvalidProtocolBufferException { ByteBuffer kinesisRecordData = kinesisRecord.getData(); int recordSize = kinesisRecordData.position(0).remaining(); boolean validAggregateLength = (recordSize > KPL_AGGREGATE_MAGIC_NUMBERS.length + KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES); if (!validAggregateLength) { ByteBuffer kinesisData = (ByteBuffer) kinesisRecord.getData().position(0); return Collections.singletonList(toByteArray(kinesisData)); } else { byte[] magicNumbers = new byte[KPL_AGGREGATE_MAGIC_NUMBERS.length]; byte[] protobufMessage = new byte[recordSize - KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES - KPL_AGGREGATE_MAGIC_NUMBERS.length]; byte[] checksum = new byte[KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES]; kinesisRecordData.get(magicNumbers, 0, magicNumbers.length); kinesisRecordData.get(protobufMessage, 0, protobufMessage.length); kinesisRecordData.get(checksum, 0, checksum.length); byte[] messageHash = Hashing.md5().hashBytes(protobufMessage).asBytes(); if (Arrays.equals(magicNumbers, KPL_AGGREGATE_MAGIC_NUMBERS) && Arrays.equals(messageHash, checksum)) { List<byte[]> data = new ArrayList<>(); AggregatedRecordProtos.AggregatedRecord aggregatedRecord = AggregatedRecordProtos.AggregatedRecord.parseFrom(protobufMessage); for (AggregatedRecordProtos.Record userRecord : aggregatedRecord.getRecordsList()) { data.add(userRecord.getData().toByteArray()); } return data; } else { ByteBuffer kinesisData = (ByteBuffer) kinesisRecord.getData().position(0); return Collections.singletonList(toByteArray(kinesisData)); } } }

Target:
List<byte[]> deaggregateKinesisRecord(Record kinesisRecord) throws InvalidProtocolBufferException { ByteBuffer kinesisRecordData = kinesisRecord.getData(); int recordSize = kinesisRecordData.position(0).remaining(); if (recordSize > KPL_AGGREGATE_MAGIC_NUMBERS.length + KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES) { byte[] magicNumbers = new byte[KPL_AGGREGATE_MAGIC_NUMBERS.length]; byte[] protobufMessage = new byte[recordSize - KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES - KPL_AGGREGATE_MAGIC_NUMBERS.length]; byte[] checksum = new byte[KPL_AGGREGATE_CHECKSUM_LENGTH_IN_BYTES]; kinesisRecordData.get(magicNumbers, 0, magicNumbers.length); kinesisRecordData.get(protobufMessage, 0, protobufMessage.length); kinesisRecordData.get(checksum, 0, checksum.length); byte[] messageHash = Hashing.md5().hashBytes(protobufMessage).asBytes(); if (Arrays.equals(magicNumbers, KPL_AGGREGATE_MAGIC_NUMBERS) && Arrays.equals(messageHash, checksum)) { List<byte[]> data = new ArrayList<>(); AggregatedRecordProtos.AggregatedRecord aggregatedRecord = AggregatedRecordProtos.AggregatedRecord.parseFrom( protobufMessage); for (AggregatedRecordProtos.Record userRecord : aggregatedRecord.getRecordsList()) { data.add(userRecord.getData().toByteArray()); } return data; } } return Collections.singletonList(toByteArray((ByteBuffer) kinesisRecordData.position(0))); }
Source:
private long extractRetryDelay(MessageSendingResult result) { return result.isRetryLater() ? result.getRetryAfterMillis() : subscription.getSubscriptionPolicy().getMessageBackoff(); }

Target:
private long extractRetryDelay(MessageSendingResult result) { long defaultBackoff = subscription.getSerialSubscriptionPolicy().getMessageBackoff(); long ttlMillis = TimeUnit.SECONDS.toMillis(subscription.getSerialSubscriptionPolicy().getMessageTtl()); return result.getRetryAfterMillis().map(delay -> Math.min(delay, ttlMillis)).orElse(defaultBackoff); }
Source:
void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); routerMetrics.operationFailureWithUnsetExceptionCount.inc(); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e); routerCallback.scheduleDeletes(op.getSuccessfullyPutChunkIdsIfComposite(), op.getServiceId()); } else { CreatedBlobType blobType = op.getNumDataChunks() == 1 ? CreatedBlobType.Simple : CreatedBlobType.Composite; notificationSystem.onBlobCreated(op.getBlobIdString(), op.getBlobProperties(), op.getUserMetadata(), blobType); for (StoreKey storeKey : op.getSuccessfullyPutChunkIdsIfComposite()) { notificationSystem.onBlobCreated(storeKey.getID(), op.getBlobProperties(), op.getUserMetadata(), CreatedBlobType.DataChunk); } updateChunkingAndSizeMetricsOnSuccessfulPut(op); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.putBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); NonBlockingRouter.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }

Target:
void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); op.maybeNotifyForBlobCreation(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); routerMetrics.operationFailureWithUnsetExceptionCount.inc(); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e); routerCallback.scheduleDeletes(op.getSuccessfullyPutChunkIdsIfComposite(), op.getServiceId()); } else { updateChunkingAndSizeMetricsOnSuccessfulPut(op); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.putBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); NonBlockingRouter.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }
Source:
static AwsDates generateXAmzDate() { DateFormat dateFormat = new SimpleDateFormat(X_AMZ_DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String xAmzDate = dateFormat.format(new Date(Clock.SYSTEM.currentTimeMillis())); return fromXAmzDate(xAmzDate); }

Target:
static AwsDates generateXAmzDate() { DateFormat dateFormat = new SimpleDateFormat(X_AMZ_DATE_FORMAT); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); String xAmzDate = dateFormat.format(new Date(System.currentTimeMillis())); return new AwsDates(xAmzDate); }
Source:
public PatchSetContent pull(IReviewItemSet parentObject, String key, IProgressMonitor monitor) throws CoreException { RemoteEmfConsumer<IReview, IReviewItemSet, String, PatchSetDetail, PatchSetDetail, String> itemSetConsumer = getGerritProvider().getReviewItemSetFactory() .getConsumerForLocalKey(parentObject.getReview(), key); PatchSetDetail detail = itemSetConsumer.getRemoteObject(); while (detail == null) { try { Thread.sleep(20); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } itemSetConsumer.pull(false, monitor); detail = itemSetConsumer.getRemoteObject(); } if (detail != null) { PatchSetContent content = new PatchSetContent((PatchSet) null, detail); return pull(parentObject, content, monitor); } throw new CoreException(new Status(IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, "Couldn't obtain patch set detail for " + key + ". Check remote connection.")); }

Target:
public PatchSetContent pull(IReviewItemSet parentObject, String key, IProgressMonitor monitor) throws CoreException { RemoteEmfConsumer<IReview, IReviewItemSet, String, PatchSetDetail, PatchSetDetail, String> itemSetConsumer = getGerritProvider().getReviewItemSetFactory() .getConsumerForLocalKey(parentObject.getReview(), key); PatchSetDetail detail = itemSetConsumer.getRemoteObject(); if (detail == null) { itemSetConsumer.pull(false, monitor); detail = itemSetConsumer.getRemoteObject(); } if (detail != null) { PatchSetContent content = new PatchSetContent((PatchSet) null, detail); return pull(parentObject, content, monitor); } throw new CoreException(new Status(IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, "Couldn't obtain patch set detail for " + key + ". Check remote connection.")); }
Source:
private IViewReference[] getViewReferences(boolean allPerspectives) { MPerspective perspective = getCurrentPerspective(); if (perspective != null) { int scope = allPerspectives ? WINDOW_SCOPE : EModelService.PRESENTATION; Set<MUIElement> parts = new HashSet<MUIElement>(); List<MPlaceholder> placeholders = modelService.findElements(window, null, MPlaceholder.class, null, scope); parts.addAll(placeholders); parts.addAll(modelService.findElements(window, null, MPart.class, null, scope)); List<IViewReference> visibleReferences = new ArrayList<IViewReference>(); for (ViewReference reference : viewReferences) { if (parts.contains(reference.getModel()) && reference.getModel().isToBeRendered()) { visibleReferences.add(reference); for (MPlaceholder placeholder : placeholders) { if (reference.getModel() == placeholder.getRef() && !placeholder.isToBeRendered()) { visibleReferences.remove(reference); } } } } return visibleReferences.toArray(new IViewReference[visibleReferences.size()]); } return new IViewReference[0]; }

Target:
private IViewReference[] getViewReferences(boolean allPerspectives) { MPerspective perspective = getCurrentPerspective(); if (perspective != null) { int scope = allPerspectives ? WINDOW_SCOPE : EModelService.PRESENTATION; Set<MUIElement> parts = new HashSet<MUIElement>(); List<MPlaceholder> placeholders = modelService.findElements(window, null, MPlaceholder.class, null, scope); parts.addAll(placeholders); parts.addAll(modelService.findElements(window, null, MPart.class, null, scope)); List<IViewReference> visibleReferences = new ArrayList<IViewReference>(); for (ViewReference reference : viewReferences) { MPart model = reference.getModel(); if (parts.contains(model) && model.isToBeRendered() && (model.getCurSharedRef() == null || model.getCurSharedRef().isToBeRendered())) { visibleReferences.add(reference); } } return visibleReferences.toArray(new IViewReference[visibleReferences.size()]); } return new IViewReference[0]; }
Source:
final public Double getWeight(ExecutionSemester semester) { if (isBolonhaDegree()) { return getEctsCredits(semester); } if (getDegreeType().isMasterDegree()) { return getCredits(); } final Double weigth = super.getWeigth(); return (weigth == null || weigth == 0.0) ? WEIGHT_FOR_PRE_BOLONHA : weigth; }

Target:
final public Double getWeight(ExecutionSemester semester) { if (isBolonhaDegree()) { return getEctsCredits(semester); } if (getDegreeType().isMasterDegree()) { return getCredits(); } return super.getWeigth(); }
Source:
public void testIsConnectionDoesNotExistForHostAndTargetFails() { when(storageServerConnectionExtensionDao.getByHostIdAndTarget(conn.getHostId(), conn.getIqn())).thenReturn(new StorageServerConnectionExtension()); assertNotNull(validator.isConnectionDoesNotExistForHostAndTarget(conn).getMessage()); }

Target:
public void testIsConnectionDoesNotExistForHostAndTargetFails() { when(storageServerConnectionExtensionDao.getByHostIdAndTarget(conn.getHostId(), conn.getIqn())).thenReturn(new StorageServerConnectionExtension()); assertEquals(EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_ALREADY_EXISTS, validator.isConnectionDoesNotExistForHostAndTarget(conn).getMessage()); }
Source:
public void matchBatchType() throws Exception { BatchExecution actualExecution = BatchExecution.builder() .withBatchQueries(BatchQuery.builder().withQuery("some query").build(), unmatchingBatchQuery) .withBatchType(LOGGED) .build(); BatchExecution expectedExecution = BatchExecution.builder() .withBatchQueries(BatchQuery.builder().withQuery("some query").build()) .withBatchType(LOGGED) .build(); BatchExecutionMatcher underTest = new BatchExecutionMatcher(expectedExecution); boolean matched = underTest.matchesSafely(newArrayList(actualExecution, unmatchingBatchExecution)); assertTrue(matched); }

Target:
public void matchBatchType() throws Exception { BatchExecution actualExecution = BatchExecution.builder() .withBatchQueries(BatchQuery.builder().withQuery("some query").build(), unmatchingBatchQuery) .withBatchType(LOGGED) .build(); BatchExecution expectedExecution = BatchExecution.builder() .withBatchQueries(BatchQuery.builder().withQuery("some query").build()) .withBatchType(LOGGED) .build(); BatchExecutionMatcher underTest = batchExecutionRecorded(expectedExecution); boolean matched = underTest.matchesSafely(newArrayList(actualExecution, unmatchingBatchExecution)); assertTrue(matched); }
Source:
public void emitTuples() { if(initialOffset.equals("latest")) { if(noOfWindows < noOfWindowsToEscape) { return; } } int range = getMaxvalue() - getMinvalue() + 1; while (count < getTuplesBlast()) { int rval = getMinvalue() + random.nextInt(range); if (integer_data.isConnected()) { integer_data.emit(rval); } if (string_data.isConnected()) { string_data.emit(Integer.toString(rval)); } if (output.isConnected()) { output.emit(rval); } count++; } }

Target:
public void emitTuples() { if(disableGenerate) { return; } if(initialOffset.equals(KafkaValidationModule.DEFAULTOFFSET)) { if(noOfWindows < noOfWindowsToEscape) { return; } } int range = getMaxvalue() - getMinvalue() + 1; while (count < getTuplesBlast()) { int rval = getMinvalue() + random.nextInt(range); if (integer_data.isConnected()) { integer_data.emit(rval); } if (string_data.isConnected()) { string_data.emit(Integer.toString(rval)); } if (output.isConnected()) { output.emit(rval); } count++; } }
Source:
public void shouldNotifyWithTheRightCommentedDocument() { try (CapturingEventListener listener = new CapturingEventListener(COMMENT_ADDED, DOCUMENT_CREATED)) { Comment createdComment = createCommentAndAddSubscription("CommentAdded", "Creation"); DocumentModel commentDocumentModel = session.getDocument(new IdRef(createdComment.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), commentDocumentModel, commentedDocumentModel, commentedDocumentModel); checkReceivedMail(emailsResult.getMails(), commentDocumentModel, commentedDocumentModel, handledEvents.get(0), COMMENT_ADDED); Comment reply = createComment(commentDocumentModel); 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, commentDocumentModel, commentedDocumentModel); checkReceivedMail(emailsResult.getMails(), replyDocumentModel, commentedDocumentModel, handledEvents.get(1), COMMENT_ADDED); } }

Target:
public void shouldNotifyWithTheRightCommentedDocument() { Comment createdComment = createComment(commentedDocumentModel); DocumentModel createdCommentDocModel = session.getDocument(new IdRef(createdComment.getId())); transactionalFeature.nextTransaction(); captureAndVerifyCommentEventNotification(() -> { addSubscriptions("CommentAdded"); Comment reply = createComment(createdCommentDocModel); DocumentModel replyDocumentModel = session.getDocument(new IdRef(reply.getId())); return session.getDocument(new IdRef(replyDocumentModel.getId())); }, COMMENT_ADDED, DOCUMENT_CREATED); }
Source:
private void handleException(Exception e, HttpServletResponse resp) throws IOException { if (e instanceof InvalidRequestException || e instanceof CodecException ) { LOG.warn("Invalid request", e); resp.setStatus(HttpServletResponse.SC_BAD_REQUEST); resp.getWriter().append("Invalid request:").append(e.getMessage()).flush(); } else if (e instanceof RequestRejectedException) { LOG.warn("Request rejected", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Request rejected:").append(e.getMessage()).flush(); } else if (e instanceof InvalidResponseException) { LOG.warn("Invalid response", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Invalid Response:").append(e.getMessage()).flush(); } else if (e instanceof InterruptedException) { LOG.warn("Thread Interrupted", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Thread Interrupted:").append(e.getMessage()).flush(); } else { LOG.warn("Unexpected exception", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Unexpected exception:").append(e.getMessage()).flush(); } }

Target:
private void handleException(Exception e, HttpServletResponse resp) throws IOException { if (e instanceof InvalidRequestException || e instanceof CodecException ) { LOG.warn("Invalid request", e); resp.setStatus(HttpServletResponse.SC_BAD_REQUEST); resp.getWriter().append("Invalid request:").append(e.getMessage()).flush(); } else if (e instanceof RequestRejectedException) { LOG.warn("Request rejected", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Request rejected:").append(e.getMessage()).flush(); } else if (e instanceof RequestCanceledException) { LOG.warn("Request cancelled", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Request cancelled:").append(e.getMessage()).flush(); } else if (e instanceof InvalidResponseException) { LOG.warn("Invalid response", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Invalid Response:").append(e.getMessage()).flush(); } else if (e instanceof InterruptedException) { LOG.warn("Thread Interrupted", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Thread Interrupted:").append(e.getMessage()).flush(); } else { LOG.warn("Unexpected exception", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.getWriter().append("Unexpected exception:").append(e.getMessage()).flush(); } }
Source:
public static List<UUID> getSequence() { return Arrays.asList( new UUID( Long.MIN_VALUE, Long.MIN_VALUE ), new UUID( Long.MIN_VALUE, -1L ), new UUID( Long.MIN_VALUE, 0L ), new UUID( Long.MIN_VALUE, 1L ), new UUID( Long.MAX_VALUE, Long.MIN_VALUE ), new UUID( Long.MAX_VALUE, Long.MAX_VALUE ) ); }

Target:
public static List<UUID> getSequence() { return Arrays.asList( new UUID( Long.MIN_VALUE, Long.MIN_VALUE ), new UUID( Long.MIN_VALUE, -1L ), new UUID( Long.MIN_VALUE, 0L ), new UUID( Long.MIN_VALUE, 1L ), new UUID( Long.MAX_VALUE, Long.MIN_VALUE ), new UUID( Long.MAX_VALUE, Long.MAX_VALUE ), UUID.fromString( "8cea97f9-9696-4299-9f05-636a208b6c1f" ) ); }
Source:
private void startProxy(final IServer startedServer) { if (proxyServers.containsKey(startedServer)) { final LiveReloadProxyServer proxyServer = proxyServers.get(startedServer); try { proxyServer.start(); } catch (Exception e) { Logger.error("Failed to start LiveReload Proxy on port " + ((NetworkConnector)proxyServer.getConnectors()[0]).getPort() + " for server " + startedServer.getName(), e); } } else { try { final int targetPort = WSTUtils.getWebPort(startedServer); if (targetPort == -1) { return; } final String targetHost = WSTUtils.getWebHost(startedServer); final boolean allowRemoteConnections = isRemoteConnectionsAllowed(); final boolean enableScriptInjection = isScriptInjectionEnabled(); final String proxyHost = getProxyHost(); final int proxyPort = getProxyPort(startedServer); final LiveReloadProxyServer proxyServer = new LiveReloadProxyServer(proxyHost, proxyPort, targetHost, targetPort, websocketPort, allowRemoteConnections, enableScriptInjection); proxyServers.put(startedServer, proxyServer); final JettyServerRunner proxyRunner = JettyServerRunner.start(proxyServer); proxyRunners.put(startedServer, proxyRunner); } catch (Exception e) { Logger.error("Failed to create or start LiveReload proxy for server " + startedServer.getName(), e); } } }

Target:
private void startProxy(final IServer startedServer) { if (proxyServers.containsKey(startedServer)) { final LiveReloadProxyServer proxyServer = proxyServers.get(startedServer); try { proxyServer.start(); } catch (Exception e) { Logger.error("Failed to start LiveReload Proxy on port " + ((NetworkConnector)proxyServer.getConnectors()[0]).getPort() + " for server " + startedServer.getName(), e); } } else { try { final int targetPort = WSTUtils.getWebPort(startedServer); if (targetPort == -1) { return; } final String targetHost = WSTUtils.getWebHost(startedServer); final boolean allowRemoteConnections = isRemoteConnectionsAllowed(); final boolean enableScriptInjection = isScriptInjectionEnabled(); final String proxyHost = getProxyHost(); final int proxyPort = getProxyPort(startedServer); final LiveReloadProxyServer proxyServer = new LiveReloadProxyServer(proxyHost, proxyPort, targetHost, targetPort, websocketPort, allowRemoteConnections, enableScriptInjection); proxyServers.put(startedServer, proxyServer); final JettyServerRunner proxyRunner = JettyServerRunner.start(proxyServer); if(proxyRunner != null) { proxyRunners.put(startedServer, proxyRunner); } } catch (Exception e) { Logger.error("Failed to create or start LiveReload proxy for server " + startedServer.getName(), e); } } }
Source:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Null metacard cannot be transformed to XLSX"); } return xlsxMetacardUtility.buildSpreadSheet(Collections.singletonList(metacard)); }

Target:
public BinaryContent transform(Metacard metacard, Map<String, Serializable> arguments) throws CatalogTransformerException { if (metacard == null) { LOGGER.debug("Attempted to transform null metacard"); throw new CatalogTransformerException("Null metacard cannot be transformed to XLSX"); } List<Metacard> metacards = Collections.singletonList(metacard); return XlsxMetacardUtility.buildSpreadSheet(metacards); }