auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override protected PhysicalNode convert(RelOptPlanner planner, RelMetadataQuery mq, LogicalFilter rel) { RelOptCluster cluster = rel.getCluster(); RelTraitSet traits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); RelTraitSet inTraits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); RelNode input = rel.getInput(); Set<CorrelationId> corrIds = RexUtils.extractCorrelationIds(rel.getCondition()); if (!corrIds.isEmpty()) { inTraits = rel.getTraitSet().replace(RewindabilityTrait.REWINDABLE); traits = traits.replace(RewindabilityTrait.REWINDABLE).replace(CorrelationTrait.correlations(corrIds)); } input = RelOptRule.convert(input, inTraits); return new IgniteFilter(cluster, traits, input, rel.getCondition()); }

Target:
@Override protected PhysicalNode convert(RelOptPlanner planner, RelMetadataQuery mq, LogicalFilter rel) { RelOptCluster cluster = rel.getCluster(); RelTraitSet traits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); Set<CorrelationId> corrIds = RexUtils.extractCorrelationIds(rel.getCondition()); if (!corrIds.isEmpty()) traits = traits.replace(CorrelationTrait.correlations(corrIds)); return new IgniteFilter(cluster, traits, rel.getInput(), rel.getCondition()); }
Source:
public static void removeProperty(String name, ModelControllerClient client) { ModelNode modelNode = createOpNode("system-property=" + name, REMOVE); ModelNode result = executeOp(modelNode, client); modelNode.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true); log.debugf("Removing property %s. Result: %s.", name, result); }

Target:
public static void removeProperty(String name, ModelControllerClient client) { ModelNode modelNode = createOpNode("system-property=" + name, REMOVE); ModelNode result = executeOp(modelNode, client); log.debugf("Removing property %s. Result: %s.", name, result); }
Source:
public void updateMetricData() { try (Connection connection = DriverManager.getConnection( dataSourceFactory.getUrl(), dataSourceFactory.getUser(), dataSourceFactory.getPassword())) { connection.setReadOnly(true); try (PreparedStatement statement = connection.prepareStatement("select * from pg_stat_database where datname = ?")) { statement.setString(1, databaseName); if (statement.execute()) { try (ResultSet resultSet = statement.getResultSet()) { if (resultSet.next()) { for (PostgresMetric metric : metrics) { metric.setValueFromResultSet(resultSet); } statsHealthy = 1; return; } } } } } catch (SQLException ignored) { } statsHealthy = 0; }

Target:
public void updateMetricData() { statsHealthy = fetchDatabaseMetrics() ? 1 : 0; }
Source:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Iterator<Port> portIterator = ports.iterator(); while (portIterator.hasNext()) { Port extraPort = portIterator.next(); if (extraPort.getPortType() == PortType.SSL) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, extraPort.getPortNo(), processors, sendBufferSize, recvBufferSize); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }

Target:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize, metrics); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Port sslPort = ports.get(PortType.SSL); if (sslPort != null) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, sslPort.getPort(), processors, sendBufferSize, recvBufferSize, metrics); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }
Source:
private HealthStatusReport healthStateOfTimeLock( Map<String, ServiceFeedback> organizedFeedbackByServiceName) { int maxAllowedUnhealthyServices = getMaxAllowedUnhealthyServices(organizedFeedbackByServiceName.size()); List<Client> unhealthyClients = KeyedStream.stream(organizedFeedbackByServiceName) .filterEntries((serviceName, serviceFeedback) -> getHealthStatusForService(serviceFeedback) == HealthStatus.UNHEALTHY) .keys() .map(serviceName -> Client.of(serviceName)) .collect(Collectors.toList()); log.info("List of services on which TimeLock is unhealthy - {}", SafeArg.of("unhealthyClients", (Object) unhealthyClients)); if (unhealthyClients.size() > maxAllowedUnhealthyServices) { return ImmutableHealthStatusReport .builder() .status(HealthStatus.UNHEALTHY) .unhealthyClients(unhealthyClients) .message(String.format("TimeLock is unhealthy as %d of %d clients are unhealthy" + ". The highest acceptable number of unhealthy clients is - %d", unhealthyClients.size(), organizedFeedbackByServiceName.size(), maxAllowedUnhealthyServices)) .build(); } return ImmutableHealthStatusReport.builder().status(HealthStatus.HEALTHY).build(); }

Target:
private HealthStatusReport healthStateOfTimeLock( Map<String, ServiceFeedback> organizedFeedbackByServiceName) { int maxAllowedUnhealthyServices = getMaxAllowedUnhealthyServices(organizedFeedbackByServiceName.size()); List<Client> unhealthyClients = KeyedStream.stream(organizedFeedbackByServiceName) .filterEntries((serviceName, serviceFeedback) -> getHealthStatusForService(serviceFeedback) == HealthStatus.UNHEALTHY) .keys() .map(serviceName -> Client.of(serviceName)) .collect(Collectors.toList()); log.info("List of services on which TimeLock is unhealthy - {}", SafeArg.of("unhealthyClients", unhealthyClients)); if (unhealthyClients.size() > maxAllowedUnhealthyServices) { return ImmutableHealthStatusReport .builder() .status(HealthStatus.UNHEALTHY) .unhealthyClients(unhealthyClients) .message(String.format("TimeLock is unhealthy as %d of %d clients are unhealthy" + ". The highest acceptable number of unhealthy clients is - %d", unhealthyClients.size(), organizedFeedbackByServiceName.size(), maxAllowedUnhealthyServices)) .build(); } return ImmutableHealthStatusReport.builder().status(HealthStatus.HEALTHY).build(); }
Source:
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { if (event.getEntity() instanceof Player) { if (event.getDamager() instanceof Player) { Player player = (Player) event.getDamager(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } if (event.getDamager() instanceof Arrow) { Arrow arrow = (Arrow) event.getDamager(); if (arrow.getShooter() instanceof Player) { Player player = (Player) arrow.getShooter(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative/Godmode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } } } }

Target:
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { if (event.getEntity() instanceof Player) { if (event.getDamager() instanceof Player) { Player player = (Player) event.getDamager(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } if (event.getDamager() instanceof Arrow) { Arrow arrow = (Arrow) event.getDamager(); if (arrow.getShooter() instanceof Player) { Player player = (Player) arrow.getShooter(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } } } }
Source:
public void visit(RuleAutomatonDisjunction ruleAutomatonDisjunction) { }

Target:
public void visit(RuleAutomatonDisjunction ruleAutomatonDisjunction) { throw new UnsupportedOperationException(); }
Source:
public void vuapResolvedStateShoulCloseAfterTapingOncloseButton(Page page, String slot, String videoIframeSelector) { final AdsBaseObject ads = openPageWithVideoInLocalStorage(page, VuapVideos.PORVATA_VAST, VuapVideos.VAST_VIDEO); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); vuap.pause(); vuap.clickOnCloseButton(); VuapAssertions.verifyVideoClosedAndReplyButtonDisplayed(vuap, MAX_AUTOPLAY_MOVIE_DURATION); }

Target:
public void vuapResolvedStateShoulCloseAfterTapingOncloseButton(Page page, String slot, String videoIframeSelector) { final AdsBaseObject ads = openPageWithVideoInLocalStorage(page); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); vuap.pause(); vuap.close(); VuapAssertions.verifyReplyButtonDisplayedAfterVideoClose(vuap, MAX_AUTOPLAY_MOVIE_DURATION); }
Source:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { if (CompletionStages.isCompletedSuccessfully(delay)) { return asyncValue(delay).thenApply(ctx, command, (rCtx, rCommand, rValue) -> invokeNextAndExceptionally(ctx, command, handleManyWriteReturn)); } return invokeNextAndExceptionally(ctx, command, handleManyWriteReturn); }

Target:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { return makeStage(asyncInvokeNext(ctx, command, delay)).andExceptionally(ctx, command, handleManyWriteReturn); }
Source:
public void testNoTransactionCommit() { TransactionManager transactionManager = createTestTransactionManager(); AccessControl accessControl = new AccessControlManager(transactionManager); Session session = sessionBuilder() .build(); QueryStateMachine stateMachine = QueryStateMachine.begin(new QueryId("query"), "COMMIT", session, URI.create("fake://uri"), true, transactionManager, accessControl, executor, metadata); try { try { getFutureValue(new CommitTask().execute(new Commit(), transactionManager, metadata, new AllowAllAccessControl(), stateMachine, emptyList())); fail(); } catch (CompletionException e) { throwIfUnchecked(e.getCause()); throw e; } } catch (PrestoException e) { assertEquals(e.getErrorCode(), NOT_IN_TRANSACTION.toErrorCode()); } assertFalse(stateMachine.getQueryInfoWithoutDetails().isClearTransactionId()); assertFalse(stateMachine.getQueryInfoWithoutDetails().getStartedTransactionId().isPresent()); assertTrue(transactionManager.getAllTransactionInfos().isEmpty()); }

Target:
public void testNoTransactionCommit() { TransactionManager transactionManager = createTestTransactionManager(); AccessControl accessControl = new AccessControlManager(transactionManager); Session session = sessionBuilder() .build(); QueryStateMachine stateMachine = QueryStateMachine.begin(new QueryId("query"), "COMMIT", session, URI.create("fake://uri"), true, transactionManager, accessControl, executor, metadata); try { getFutureValue(new CommitTask().execute(new Commit(), transactionManager, metadata, new AllowAllAccessControl(), stateMachine, emptyList())); fail(); } catch (PrestoException e) { assertEquals(e.getErrorCode(), NOT_IN_TRANSACTION.toErrorCode()); } assertFalse(stateMachine.getQueryInfoWithoutDetails().isClearTransactionId()); assertFalse(stateMachine.getQueryInfoWithoutDetails().getStartedTransactionId().isPresent()); assertTrue(transactionManager.getAllTransactionInfos().isEmpty()); }
Source:
public List<CellWithTimestamp> getTimestamps( TableReference tableRef, byte[] startRowInclusive, int limit) { String selQuery = "SELECT key, column1, column2 FROM %s WHERE token(key) >= token(%s) LIMIT %s;"; CqlQuery query = new CqlQuery( selQuery, quotedTableName(tableRef), key(startRowInclusive), limit(limit)); try (CloseableTrace trace = startLocalTrace("cqlExecutor.getTimestamps(query {}, tableRef {}, limit {})", selQuery, LoggingArgs.safeTableOrPlaceholder(tableRef), limit)) { return query.executeAndGetCells(startRowInclusive, this::getCellFromRow); } }

Target:
public List<CellWithTimestamp> getTimestamps( TableReference tableRef, byte[] startRowInclusive, int limit) { String selQuery = "SELECT key, column1, column2 FROM %s WHERE token(key) >= token(%s) LIMIT %s;"; CqlQuery query = new CqlQuery( selQuery, CqlQueryUtils.quotedTableName(tableRef), CqlQueryUtils.key(startRowInclusive), CqlQueryUtils.limit(limit)); return executeAndGetCells(query, startRowInclusive, CqlQueryUtils::getCellFromRow); }
Source:
public Result<BpmnEdge> convertEdge(BaseElement baseElement, Map<String, BpmnNode> nodes) { return Match.of(BaseElement.class, Result.class) .when(SequenceFlow.class, e -> sequenceFlowConverter.convertEdge(e, nodes)) .when(BoundaryEvent.class, e -> boundaryEventConverter.convertEdge(e, nodes)) .when(Association.class, e -> associationConverter.convertEdge(e, nodes)) .defaultValue(Result.ignored("Not an Edge element")) .apply(baseElement) .value() .get(); }

Target:
public Result<BpmnEdge> convertEdge(BaseElement baseElement, Map<String, BpmnNode> nodes) { return Match.of(BaseElement.class, Result.class) .when(SequenceFlow.class, e -> sequenceFlowConverter.convertEdge(e, nodes)) .when(BoundaryEvent.class, e -> boundaryEventConverter.convertEdge(e, nodes)) .when(Association.class, e -> associationConverter.convertEdge(e, nodes)) .defaultValue(Result.ignored("Not an Edge element", getNotFoundMessage(baseElement))) .apply(baseElement) .value(); }
Source:
public long getChildId(int groupPosition, int childPosition) { return childPosition; }

Target:
public long getChildId(int groupPosition, int childPosition) { return getChild(groupPosition, childPosition).getId(); }
Source:
protected MetadataFieldRest createAndReturn(Context context) throws AuthorizeException, SQLException { MetadataFieldRest metadataFieldRest; try { metadataFieldRest = new ObjectMapper().readValue( getRequestService().getCurrentRequest().getHttpServletRequest().getInputStream(), MetadataFieldRest.class ); } catch (IOException excIO) { throw new PatchBadRequestException("error parsing the body ..." + excIO.getMessage()); } String schemaId = getRequestService().getCurrentRequest().getHttpServletRequest().getParameter("schemaId"); if (isBlank(schemaId)) { throw new UnprocessableEntityException("metadata schema ID can be blank not"); } MetadataSchema schema = metadataSchemaService.find(context, parseInt(schemaId)); if (schema == null) { throw new UnprocessableEntityException("metadata schema is found not"); } if (isBlank(metadataFieldRest.getElement())) { throw new UnprocessableEntityException("metadata element can be blank not"); } MetadataField metadataField; try { metadataField = metadataFieldService.create(context, schema, metadataFieldRest.getElement(), metadataFieldRest.getQualifier(), metadataFieldRest.getScopeNote()); metadataFieldService.update(context, metadataField); } catch (NonUniqueMetadataException e) { throw new UnprocessableEntityException( "metadata field " + schema.getName() + "." + metadataFieldRest.getElement() + (metadataFieldRest.getQualifier() != null ? "." + metadataFieldRest.getQualifier() : "") + " already exists" ); } catch (IOException e) { throw new RuntimeException(e); } return converter.convert(metadataField); }

Target:
protected MetadataFieldRest createAndReturn(Context context) throws AuthorizeException, SQLException { MetadataFieldRest metadataFieldRest; try { metadataFieldRest = new ObjectMapper().readValue( getRequestService().getCurrentRequest().getHttpServletRequest().getInputStream(), MetadataFieldRest.class ); } catch (IOException excIO) { throw new PatchBadRequestException("error parsing request body", excIO); } String schemaId = getRequestService().getCurrentRequest().getHttpServletRequest().getParameter("schemaId"); if (isBlank(schemaId)) { throw new UnprocessableEntityException("metadata schema ID cannot be blank"); } MetadataSchema schema = metadataSchemaService.find(context, parseInt(schemaId)); if (schema == null) { throw new UnprocessableEntityException("metadata schema with ID " + schemaId + " not found"); } if (isBlank(metadataFieldRest.getElement())) { throw new UnprocessableEntityException("metadata element (in request body) cannot be blank"); } MetadataField metadataField; try { metadataField = metadataFieldService.create(context, schema, metadataFieldRest.getElement(), metadataFieldRest.getQualifier(), metadataFieldRest.getScopeNote()); metadataFieldService.update(context, metadataField); } catch (NonUniqueMetadataException e) { throw new UnprocessableEntityException( "metadata field " + schema.getName() + "." + metadataFieldRest.getElement() + (metadataFieldRest.getQualifier() != null ? "." + metadataFieldRest.getQualifier() : "") + " already exists" ); } catch (IOException e) { throw new RuntimeException(e); } return converter.convert(metadataField); }
Source:
public AwsListener getOrCreateListener(int port) { Optional<AwsListener> listenerOptional = listeners.stream() .filter(l -> l.getPort() == port) .findFirst(); if (listenerOptional.isPresent()) { return listenerOptional.get(); } else { AwsListener listener = new AwsListener(scheme, port); listeners.add(listener); return listener; } }

Target:
public AwsListener getOrCreateListener(int port) { return listeners.stream() .filter(l -> l.getPort() == port) .findFirst().orElseGet(() -> createListener(port)); }
Source:
public JPanel createPropertiesPanel() { jmsPropertiesTable = new JTable(tableModel); JMeterUtils.applyHiDPI(jmsPropertiesTable); jmsPropertiesTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer()); jmsPropertiesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jmsPropertiesTable.setPreferredScrollableViewportSize(new Dimension(100, 70)); TableColumn mechanismColumn = jmsPropertiesTable.getColumnModel().getColumn(COL_TYPE); mechanismColumn.setCellEditor(new TypeCellEditor()); JPanel panel = new JPanel(new BorderLayout(0, 5)); panel.setBorder(BorderFactory.createTitledBorder( JMeterUtils.getResString("jms_props"))); panel.add(new JScrollPane(jmsPropertiesTable)); panel.add(createButtonPanel(), BorderLayout.SOUTH); return panel; }

Target:
public JPanel createPropertiesPanel() { jmsPropertiesTable = new JTable(tableModel); JMeterUtils.applyHiDPI(jmsPropertiesTable); jmsPropertiesTable.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer()); jmsPropertiesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); jmsPropertiesTable.setPreferredScrollableViewportSize(new Dimension(100, 70)); TableColumn mechanismColumn = jmsPropertiesTable.getColumnModel().getColumn(COL_TYPE); mechanismColumn.setCellEditor(new TypeCellEditor()); JPanel panel = new JPanel(new BorderLayout(0, 5)); panel.setBorder(BorderFactory.createTitledBorder( JMeterUtils.getResString("jms_props"))); panel.add(GuiUtils.emptyBorder(new JScrollPane(jmsPropertiesTable))); panel.add(createButtonPanel(), BorderLayout.SOUTH); return panel; }
Source:
public long getFileSize(){ if (length.length() == 0) { return 0; } return Long.decode(length); }

Target:
public long getFileSize(){ try { return Long.decode(length); } catch (NumberFormatException e) { LOGGER.log(FINE, "Cannot determine file size of the artifact {0}. The length {1} is not a valid long value", new Object[] {this, length}); return 0; } }
Source:
public void goOnline() { getMetadataStore().setOfflineState(false); List<StorageEngine<ByteArray, byte[], byte[]>> storageEngines = storageService.getStoreRepository().getStorageEnginesByClass(ReadOnlyStorageEngine.class); if (storageEngines.size() > 0) { logger.info("Will attempt to removeRemoteObsoleteState() for " + storageEngines.size() + " Read-Only stores."); for (StorageEngine storageEngine: storageEngines) { StoreVersionManager storeVersionManager = (StoreVersionManager) storageEngine.getCapability(StoreCapabilityType.DISABLE_STORE_VERSION); try { storeVersionManager.removeRemoteObsoleteState(); } catch (Exception e) { logger.error("Failed to removeRemoteObsoleteState() for store: " + storageEngine.getName(), e); } } } createOnlineServices(); startOnlineServices(); }

Target:
public void goOnline() { ReadOnlyStoreStatusValidation validation = validateReadOnlyStoreStatusBeforeGoingOnline(); if (validation.readyToGoOnline) { getMetadataStore().setOfflineState(false); createOnlineServices(); startOnlineServices(); } if (validation.e != null) { throw new VoldemortException("Problem while going online!", validation.e); } }
Source:
private <T extends Dao> T getDao(Class<T> daoType) { T dao = CDI.current().select(daoType).get(); if (dao == null) { throw new IllegalArgumentException("There is no Dao registered for dao type " + daoType.getName()); } return dao; }

Target:
private <T extends Dao> T getDao(Class<T> daoType) { T dao = daos.select(daoType).get(); if (dao == null) { throw new IllegalArgumentException("There is no Dao registered for dao type " + daoType.getName()); } return dao; }
Source:
private void persistDiffPreferences() { AccountDiffPreference diffPref = new AccountDiffPreference(Gerrit.getUserAccount().getId()); diffPref.setIgnoreWhitespace(getIgnoreWhitespace()); diffPref.setTabSize(tabWidth.getIntValue()); diffPref.setLineLength(colWidth.getIntValue()); diffPref.setSyntaxHighlighting(syntaxHighlighting.getValue()); diffPref.setShowWhitespaceErrors(whitespaceErrors.getValue()); diffPref.setIntralineDifference(intralineDifference.getValue()); diffPref.setShowTabs(showTabs.getValue()); Util.ACCOUNT_SVC.changeDiffPreferences(diffPref, new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { } }); Gerrit.setAccountDiffPreference(diffPref); }

Target:
private void persistDiffPreferences() { setEnabled(false); final AccountDiffPreference diffPref = new AccountDiffPreference(Gerrit.getUserAccount().getId()); diffPref.setIgnoreWhitespace(getIgnoreWhitespace()); diffPref.setTabSize(tabWidth.getIntValue()); diffPref.setLineLength(colWidth.getIntValue()); diffPref.setSyntaxHighlighting(syntaxHighlighting.getValue()); diffPref.setShowWhitespaceErrors(whitespaceErrors.getValue()); diffPref.setIntralineDifference(intralineDifference.getValue()); diffPref.setShowTabs(showTabs.getValue()); diffPref.setContext(getContext()); Util.ACCOUNT_SVC.changeDiffPreferences(diffPref, new GerritCallback<VoidResult>() { @Override public void onSuccess(VoidResult result) { Gerrit.setAccountDiffPreference(diffPref); setEnabled(true); } @Override public void onFailure(Throwable caught) { setEnabled(true); } }); }
Source:
public EventDefinitionCrf findByStudyEventDefinitionIdAndCRFIdAndStudyId(Integer studyEventDefinitionId, Integer crfId, Integer studyId) { String query = "select do from " + getDomainClassName() + " do,Study s where do.studyEventDefinition.studyEventDefinitionId = :studyeventdefid " + " and (do.study.studyId = :studyid or (s.studyId = :studyid and s.study.studyId=do.study.studyId)) and do.crf.crfId = :crfid"; Query q = getCurrentSession().createQuery(query); q.setInteger("studyeventdefid", studyEventDefinitionId); q.setInteger("studyid", studyId); q.setInteger("crfid", crfId); return (EventDefinitionCrf) q.uniqueResult(); }

Target:
public EventDefinitionCrf findByStudyEventDefinitionIdAndCRFIdAndStudyId(Integer studyEventDefinitionId, Integer crfId, Integer studyId) { String query = "from " + getDomainClassName() + " do where do.studyEventDefinition.studyEventDefinitionId = :studyeventdefid " + " and do.study.studyId = :studyid and do.crf.crfId = :crfid"; Query q = getCurrentSession().createQuery(query); q.setInteger("studyeventdefid", studyEventDefinitionId); q.setInteger("studyid", studyId); q.setInteger("crfid", crfId); return (EventDefinitionCrf) q.uniqueResult(); }
Source:
public static BooleanExpression asBoolean(boolean value) { return asBoolean(Expressions.constant(value)); }

Target:
public static BooleanExpression asBoolean(boolean value) { return asBoolean(constant(value)); }
Source:
public void handleCollision(GameObject other) { if (other instanceof Floor) { float MAX_DIFF_LANDING = 10f; if (getTop() < Gdx.graphics.getHeight() && between(overlapBottom(other), 0, MAX_DIFF_LANDING) && speedY < 0) { setBottom(other.getTop()); speedY = 0; timeSinceLastFloorContact = 0; canJump = true; } } }

Target:
public void handleCollision(GameObject other) { if (other instanceof Floor) { if (getTop() < Gdx.graphics.getHeight() && between(overlapBottom(other), 0, MAX_DIFF_LANDING) && speedY < 0) { setBottom(other.getTop()); speedY = 0; timeSinceLastFloorContact = 0; canJump = true; } } }
Source:
private void applyPaymentToMemberAccounts(PaymentData paymentData, BigDecimal installmentsPaid) throws AccountException { for (LoanBO memberAccount : getMemberAccounts()) { BigDecimal memberPaid = memberAccount.findNumberOfPaidInstallments(); List<LoanScheduleEntity> memberInstallments = memberAccount.getLoanInstallments(); Money memberPaymentAmount = new Money(getCurrency()); int currentPayment; for(currentPayment = memberPaid.intValue(); currentPayment < installmentsPaid.intValue() ; currentPayment++) { memberPaymentAmount = memberPaymentAmount.add(memberInstallments.get(currentPayment).getAmountToBePaidToGetExpectedProportion(BigDecimal.ONE)); } BigDecimal afterComa = installmentsPaid.subtract(new BigDecimal(installmentsPaid.intValue())); if(afterComa.compareTo(BigDecimal.ZERO)==1) { memberPaymentAmount = memberPaymentAmount.add(memberInstallments.get(currentPayment).getAmountToBePaidToGetExpectedProportion(afterComa)); } if(getState().getValue()!=(short)6 && memberPaymentAmount.subtract((memberAccount.getTotalRepayableAmount())).isTinyAmount()) { memberPaymentAmount = memberPaymentAmount.subtract(new Money(getCurrency(), 0.1)); } PaymentData memberPayment = new PaymentData(memberPaymentAmount, paymentData.getPersonnel(), paymentData.getPaymentTypeId(), paymentData.getTransactionDate()); if(!memberPaymentAmount.isTinyAmount() && !memberPaymentAmount.isLessThanZero()) { memberAccount.applyPayment(memberPayment); } } }

Target:
private void applyPaymentToMemberAccounts(PaymentData paymentData, BigDecimal installmentsPaid) throws AccountException { for (LoanBO memberAccount : getMemberAccounts()) { BigDecimal memberPaid = memberAccount.findNumberOfPaidInstallments(); List<LoanScheduleEntity> memberInstallments = memberAccount.getLoanInstallments(); Money memberPaymentAmount = new Money(getCurrency()); int currentPayment; for(currentPayment = memberPaid.intValue(); currentPayment < installmentsPaid.intValue() ; currentPayment++) { memberPaymentAmount = memberPaymentAmount.add(memberInstallments.get(currentPayment).getAmountToBePaidToGetExpectedProportion(BigDecimal.ONE)); } BigDecimal afterComa = installmentsPaid.subtract(new BigDecimal(installmentsPaid.intValue())); if(afterComa.compareTo(BigDecimal.ZERO)==1) { memberPaymentAmount = memberPaymentAmount.add(memberInstallments.get(currentPayment).getAmountToBePaidToGetExpectedProportion(afterComa)); } if(getState().compareTo(AccountState.LOAN_CLOSED_OBLIGATIONS_MET)!=0 && memberPaymentAmount.subtract((memberAccount.getTotalRepayableAmount())).isTinyAmount()) { memberPaymentAmount = memberPaymentAmount.subtract(new Money(getCurrency(), 0.1)); } PaymentData memberPayment = new PaymentData(memberPaymentAmount, paymentData.getPersonnel(), paymentData.getPaymentTypeId(), paymentData.getTransactionDate()); if(!memberPaymentAmount.isTinyAmount() && !memberPaymentAmount.isLessThanZero()) { memberAccount.applyPayment(memberPayment); } } }
Source:
public static void main(String[] args) { Config config = new Config(); final SerializerConfig personProtoSerializerConfig = new SerializerConfig(); personProtoSerializerConfig.setTypeClass(Person.class); personProtoSerializerConfig.setImplementation(new PersonProtoSerializer()); config.getSerializationConfig().addSerializerConfig(personProtoSerializerConfig); final HazelcastInstance hazelcastInstance = newHazelcastInstance(config); final IMap<Integer, Person> personsMap = hazelcastInstance.getMap("person"); populatePerson(personsMap); System.out.println("---- where email is support@hazelcast.com"); System.out.println(personsMap.values(equal("email", "support@hazelcast.com"))); System.out.println("---- where email is not support@hazelcast.com"); System.out.println(personsMap.values(new SqlPredicate("email != support@hazelcast.com"))); }

Target:
public static void main(String[] args) { Config config = new Config(); final SerializerConfig personProtoSerializerConfig = new SerializerConfig(); personProtoSerializerConfig.setTypeClass(Person.class); personProtoSerializerConfig.setImplementation(new PersonProtoSerializer()); config.getSerializationConfig().addSerializerConfig(personProtoSerializerConfig); final HazelcastInstance hazelcastInstance = newHazelcastInstance(config); final IMap<Integer, Person> personsMap = hazelcastInstance.getMap("person"); populate(personsMap); System.out.println("---- where email is support@hazelcast.com"); System.out.println(personsMap.values(equal("email", "support@hazelcast.com"))); System.out.println("---- where email is not support@hazelcast.com"); System.out.println(personsMap.values(new SqlPredicate("email != support@hazelcast.com"))); }
Source:
private List<Tag> searchTagsInternal(final String tagName, final String siteOrFolderId, final User user) { List<Tag> tags; try { Host host = APILocator.getHostAPI().find(siteOrFolderId, user, false); String internalSiteOrFolderId = siteOrFolderId; if ((!UtilMethods.isSet(host) || !UtilMethods.isSet(host.getInode())) && UtilMethods.isSet(siteOrFolderId)) { internalSiteOrFolderId = APILocator.getFolderAPI() .find(siteOrFolderId, user, false).getHostId(); } tags = APILocator.getTagAPI().getSuggestedTag(tagName, internalSiteOrFolderId); } catch (DotDataException | DotSecurityException e) { throw new BadRequestException(e, e.getMessage()); } return tags; }

Target:
private List<Tag> searchTagsInternal(final String tagName, final String siteOrFolderId, final User user) { List<Tag> tags; try { final Host host = APILocator.getHostAPI().find(siteOrFolderId, user, false); String internalSiteOrFolderId = siteOrFolderId; if ((!UtilMethods.isSet(host) || !UtilMethods.isSet(host.getInode())) && UtilMethods.isSet(siteOrFolderId)) { internalSiteOrFolderId = APILocator.getFolderAPI() .find(siteOrFolderId, user, false).getHostId(); } tags = APILocator.getTagAPI().getSuggestedTag(tagName, internalSiteOrFolderId); } catch (DotDataException | DotSecurityException e) { throw new BadRequestException(e, e.getMessage()); } return tags; }
Source:
public static AbstractTaskEditorExtension getTaskEditorExtension(TaskRepository taskRepository, TaskAttribute taskAttribute) { init(); String media = taskAttribute.getMetaData().getValue(TaskAttribute.META_ATTRIBUTE_MEDIA_TYPE); if (media != null && media.contains(MARKUP_KEY)) { String markup = media.substring(media.indexOf(MARKUP_KEY) + MARKUP_KEY.length()); if (markup.contains(";")) { markup = markup.substring(0, markup.indexOf(";")); } SortedSet<RegisteredTaskEditorExtension> extensions = getTaskEditorExtensions(); for (RegisteredTaskEditorExtension extension : extensions) { if (markup.equals(extension.getName())) { return extension.getExtension(); } } } return getTaskEditorExtension(taskRepository); }

Target:
public static AbstractTaskEditorExtension getTaskEditorExtension(TaskRepository taskRepository, TaskAttribute taskAttribute) { init(); String input = taskAttribute.getMetaData().getMediaType(); if (input != null) { try { MediaType media = MediaType.parse(input); Multimap<String, String> parameters = media.parameters(); if (parameters.containsKey(MARKUP_KEY)) { Iterator<String> iter = parameters.get(MARKUP_KEY).iterator(); String markup = iter.next(); SortedSet<RegisteredTaskEditorExtension> extensions = getTaskEditorExtensions(); for (RegisteredTaskEditorExtension extension : extensions) { if (markup.equals(extension.getName())) { return extension.getExtension(); } } } } catch (IllegalArgumentException e) { StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, String.format( "Unable to parse markup type for attribute %s", taskAttribute.toString()), e)); } } return getTaskEditorExtension(taskRepository); }
Source:
public void stopStreamProcessor(SamzaResource resource) { synchronized (lock) { Container container = allocatedResources.get(resource); if (container != null) { log.info("Stopping Container ID: on host: {}", resource.getContainerId(), resource.getHost()); this.nmClientAsync.stopContainerAsync(container.getId(), container.getNodeId()); } else { YarnContainer yarnContainer = state.runningProcessors.get(resource.getContainerId()); if (yarnContainer != null) { log.info("Stopping container from previous attempt with Container ID: on host: {}", resource.getContainerId(), resource.getHost()); amClient.releaseAssignedContainer(yarnContainer.id()); } else { log.info("No container with Container ID: exists. Ignoring the stop request", resource.getContainerId()); } } } }

Target:
public void stopStreamProcessor(SamzaResource resource) { synchronized (lock) { Container container = allocatedResources.get(resource); String containerId = resource.getContainerId(); String containerHost = resource.getHost(); if (container != null) { log.info("Stopping Container ID: on host: {}", containerId, containerHost); this.nmClientAsync.stopContainerAsync(container.getId(), container.getNodeId()); } else { YarnContainer yarnContainer = state.runningProcessors.get(getRunningProcessorId(containerId)); if (yarnContainer != null) { log.info("Stopping container from previous attempt with Container ID: on host: {}", containerId, containerHost); amClient.releaseAssignedContainer(yarnContainer.id()); } else { log.info("No container with Container ID: exists. Ignoring the stop request", containerId); } } } }
Source:
@Test public void parsesBooleanAttributes() { String html = "<a normal=\"123\" boolean empty=\"\"></a>"; Element el = Jsoup.parse(html).select("a").first(); assertEquals("123", el.attr("normal")); assertEquals("", el.attr("boolean")); assertEquals("", el.attr("empty")); assertEquals(html, el.outerHtml()); }

Target:
@Test public void parsesBooleanAttributes() { String html = "<a normal=\"123\" boolean empty=\"\"></a>"; Element el = Jsoup.parse(html).select("a").first(); assertEquals("123", el.attr("normal")); assertEquals("", el.attr("boolean")); assertEquals("", el.attr("empty")); List<Attribute> attributes = el.attributes().asList(); assertEquals("There should be 3 attribute present", 3, attributes.size()); assertFalse("'normal' attribute should not be boolean", attributes.get(0) instanceof BooleanAttribute); assertTrue("'boolean' attribute should be boolean", attributes.get(1) instanceof BooleanAttribute); assertFalse("'empty' attribute should not be boolean", attributes.get(2) instanceof BooleanAttribute); assertEquals(html, el.outerHtml()); }
Source:
public String eventsURI(Account account, Optional<ZonedDateTime> toDate, Optional<ZonedDateTime> fromDate, Integer page, Integer displaySize, String agreementId, String paymentId) { Map<String, String> params = new LinkedHashMap<>(); toDate.ifPresent(zonedDateTime -> params.put("to_date", DateTimeUtils.toUTCDateString(zonedDateTime))); fromDate.ifPresent(zonedDateTime -> params.put("from_date", DateTimeUtils.toUTCDateString(zonedDateTime))); if (agreementId != null) params.put("mandate_external_id", agreementId); if (paymentId != null) params.put("transaction_external_id", paymentId); params.put("page", Optional.ofNullable(page).orElse(1).toString()); params.put("display_size", Optional.ofNullable(displaySize).orElse(500).toString()); return buildConnectorUri(account, "/v1/events", params); }

Target:
public String eventsURI(Account account, Optional<ZonedDateTime> toDate, Optional<ZonedDateTime> fromDate, Integer page, Integer displaySize, String agreementId, String paymentId) { Map<String, String> params = new LinkedHashMap<>(); toDate.map(ISO_INSTANT_MILLISECOND_PRECISION::format).ifPresent(formattedDate -> params.put("to_date", formattedDate)); fromDate.map(ISO_INSTANT_MILLISECOND_PRECISION::format).ifPresent(formattedDate -> params.put("from_date", formattedDate)); if (agreementId != null) params.put("mandate_external_id", agreementId); if (paymentId != null) params.put("transaction_external_id", paymentId); params.put("page", Optional.ofNullable(page).orElse(1).toString()); params.put("display_size", Optional.ofNullable(displaySize).orElse(500).toString()); return buildConnectorUri(account, "/v1/events", params); }
Source:
@Test public void getWithoutUrlThrows() { class Example { @GET Call<Object> method() { return null; } } try { buildRequest(Example.class); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Missing either @GET URL or @Url parameter.\n" + " for method Example.method"); } }

Target:
@Test public void getWithoutUrlThrows() { class Example { @GET Call<Object> method() { return null; } } try { buildRequest(Example.class); fail(); } catch (IllegalArgumentException e) { assertThat(e).hasMessage("Missing either @GET URL or @Url parameter.\n" + " for method Example.method"); } }
Source:
private static RuntimeException createAtlasDbDependencyException(Throwable ex) { if (ex instanceof InterruptedException || ex instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } throwIfInstance(ex, AtlasDbDependencyException.class); return new AtlasDbDependencyException("The KVS or Timelock threw an exception.", ex); }

Target:
private static RuntimeException createAtlasDbDependencyException(Throwable ex) { if (ex instanceof InterruptedException || ex instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } throwIfInstance(ex, AtlasDbDependencyException.class); return new AtlasDbDependencyException("AtlasDB dependency threw an exception.", ex); }
Source:
public void setHashtags(HashtagsInput input) throws RestApiException { try { postHashtags.get().apply(change, input); } catch (IOException | OrmException e) { throw new RestApiException("Cannot post hashtags", e); } }

Target:
public void setHashtags(HashtagsInput input) throws RestApiException { try { postHashtags.apply(change, input); } catch (IOException | OrmException e) { throw new RestApiException("Cannot post hashtags", e); } }
Source:
protected void setCellValue(Cell cell, Object value) { if (value instanceof Boolean) { cell.setCellValue(toBoolean(value)); } else if (value instanceof LocalDate) { Instant instant = toLocalDate(value).atStartOfDay(timeZone.toZoneId()).toInstant(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd"); simpleDateFormat.setTimeZone(timeZone); cell.setCellValue(simpleDateFormat.format(Date.from(instant))); } else if (value instanceof Instant) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("YYYY-MM-dd'T'hh:mm:ssZ"); simpleDateFormat.setTimeZone(timeZone); cell.setCellValue(simpleDateFormat.format(Date.from((Instant) value))); } else if (value instanceof Double) { cell.setCellValue(toDouble(value)); } else if (value instanceof Integer) { cell.setCellValue(toInt(value)); } else if (value instanceof Long) { cell.setCellValue(toLong(value)); } else if (value instanceof String) { cell.setCellValue(value.toString()); } else { throw new UnsupportedValueException(value); } }

Target:
void setCellValue(Cell cell, Object value) { if (value instanceof Boolean) { cell.setCellValue(toBoolean(value)); } else if (value instanceof LocalDate) { Instant instant = toLocalDate(value).atStartOfDay(timeZone.toZoneId()).toInstant(); cell.setCellValue(simpleDateFormat.format(Date.from(instant))); } else if (value instanceof Instant) { cell.setCellValue(simpleDateTimeFormat.format(Date.from((Instant) value))); } else if (value instanceof Double) { cell.setCellValue(toDouble(value)); } else if (value instanceof Integer) { cell.setCellValue(toInt(value)); } else if (value instanceof Long) { cell.setCellValue(toLong(value)); } else if (value instanceof String) { cell.setCellValue(value.toString()); } else { throw new UnsupportedValueException(value); } }
Source:
static <T> List<T> without(List<T> list, Collection<Integer> indexes) { Set<Integer> indexesSet = ImmutableSet.copyOf(indexes); return IntStream.range(0, list.size()) .filter(index -> !indexesSet.contains(index)) .mapToObj(ImmutableList.copyOf(list)::get) .collect(toImmutableList()); }

Target:
static <T> List<T> without(List<T> list, Collection<Integer> indexes) { Set<Integer> indexesSet = ImmutableSet.copyOf(indexes); return IntStream.range(0, list.size()) .filter(index -> !indexesSet.contains(index)) .mapToObj(list::get) .collect(toImmutableList()); }
Source:
private Scope( Optional<Scope> parent, boolean queryBoundary, RelationId relationId, RelationType relation, Map<String, WithQuery> namedQueries, Map<Identifier, WindowSpecification> windowSpecifications) { this.parent = requireNonNull(parent, "parent is null"); this.relationId = requireNonNull(relationId, "relationId is null"); this.queryBoundary = queryBoundary; this.relation = requireNonNull(relation, "relation is null"); this.namedQueries = ImmutableMap.copyOf(requireNonNull(namedQueries, "namedQueries is null")); this.windowSpecifications = ImmutableMap.copyOf(requireNonNull(windowSpecifications, "windowSpecifications is null")); }

Target:
private Scope( Optional<Scope> parent, boolean queryBoundary, RelationId relationId, RelationType relation, Map<String, WithQuery> namedQueries, Map<Identifier, WindowSpecification> windowSpecifications) { this.parent = requireNonNull(parent, "parent is null"); this.relationId = requireNonNull(relationId, "relationId is null"); this.queryBoundary = queryBoundary; this.relation = requireNonNull(relation, "relation is null"); this.namedQueries = ImmutableMap.copyOf(requireNonNull(namedQueries, "namedQueries is null")); this.windowSpecifications = ImmutableMap.copyOf(windowSpecifications); }
Source:
private void handleReject(SQLException e) { IndexedRecord reject = new GenericData.Record(schemaReject); for (Schema.Field outField : schemaReject.getFields()) { Object outValue = null; if ("errorCode".equals(outField.name())) { outValue = e.getSQLState(); } else if ("errorMessage".equals(outField.name())) { outValue = e.getMessage(); } reject.put(outField.pos(), outValue); } rejectMessage = new HashMap<String, Object>(); rejectMessage.put("error", e.getMessage()); rejectMessage.put("errorCode", e.getSQLState()); rejectMessage.put("errorMessage", e.getMessage()); rejectMessage.put("exception", e.toString()); rejectMessage.put("talend_record", reject); isRejectError = true; }

Target:
private void handleReject(SQLException e) { IndexedRecord reject = new GenericData.Record(schemaReject); reject.put(schemaReject.getField("errorCode").pos(), e.getSQLState()); reject.put(schemaReject.getField("errorMessage").pos(), e.getMessage()); rejectInfo = new HashMap<String, Object>(); rejectInfo.put("error", e.getMessage()); rejectInfo.put("errorCode", e.getSQLState()); rejectInfo.put("errorMessage", e.getMessage()); rejectInfo.put("exception", e.toString()); rejectInfo.put("talend_record", reject); isRejectError = true; }
Source:
public void serialize(XMLExtendedStreamWriter writer, JdbcMixedStoreConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.MIXED_KEYED_JDBC_STORE); writeJdbcStoreAttributes(writer, configuration); writeJDBCStoreTable(writer, Element.STRING_KEYED_TABLE, configuration.stringTable()); writeJDBCStoreTable(writer, Element.BINARY_KEYED_TABLE, configuration.binaryTable()); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }

Target:
public void serialize(XMLExtendedStreamWriter writer, JdbcMixedStoreConfiguration configuration) throws XMLStreamException { writer.writeStartElement(Element.MIXED_KEYED_JDBC_STORE); writeJdbcStoreAttributes(writer, configuration); writeCommonStoreSubAttributes(writer, configuration); writeJDBCStoreTable(writer, Element.STRING_KEYED_TABLE, configuration.stringTable()); writeJDBCStoreTable(writer, Element.BINARY_KEYED_TABLE, configuration.binaryTable()); writeJDBCStoreConnection(writer, configuration); writeCommonStoreElements(writer, configuration); writer.writeEndElement(); }
Source:
private void intiChangeListener() { final EditText email = (EditText) findViewById(R.id.email); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.email = email.getText().toString(); TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); Toast.makeText(v.getContext(), "TODO", Toast.LENGTH_SHORT).show(); } }); }

Target:
private void intiChangeListener() { final EditText email = (EditText) findViewById(R.id.email); findViewById(R.id.confirm).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { User user = new User(); user.id = AppPrefs.getInstance(v.getContext()).getCurrentUserId(); user.email = email.getText().toString(); TaskQueue.loadQueueDefault(v.getContext()).execute(new UpdateUserTask(user)); } }); }
Source:
public boolean checkValue(Collection<String> errorMessages) { if (!valueRequired) return true; if ((value == null) || (value.isEmpty())) { errorMessages.add(name + " is not set properly"); return false; } return true; }

Target:
public boolean checkValue(Collection<String> errorMessages) { if (!valueRequired) return true; if ((value == null) || (value.trim().isEmpty())) { errorMessages.add(name + " is not set properly"); return false; } return true; }
Source:
public ZestExpressionURL deepCopy() { ZestExpressionURL copy = new ZestExpressionURL(); List<String> copyIncludeRegex = new ArrayList<>(includeRegexes); List<String> copyExcludeRegex = new ArrayList<>(excludeRegexes); List<Pattern> copyIncludePatterns = new ArrayList<>(includePatterns); List<Pattern> copyExcludePatterns = new ArrayList<>(excludePatterns); copy.excludePatterns = copyExcludePatterns; copy.includePatterns = copyIncludePatterns; copy.includeRegexes = copyIncludeRegex; copy.excludeRegexes = copyExcludeRegex; return copy; }

Target:
public ZestExpressionURL deepCopy() { ZestExpressionURL copy = new ZestExpressionURL(); List<String> copyIncludeRegex = new ArrayList<>(includeRegexes); List<String> copyExcludeRegex = new ArrayList<>(excludeRegexes); copy.includeRegexes = copyIncludeRegex; copy.excludeRegexes = copyExcludeRegex; return copy; }