auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void decorateWorkloadClusterPillarWithCsdDownloader(StackType stackType, Cluster cluster, Map<String, SaltPillarProperties> servicePillar) { if (StackType.WORKLOAD.equals(stackType)) { clusterHostServiceRunner.decoratePillarWithClouderaManagerCsds(cluster, servicePillar); } }

Target:
private void decorateWorkloadClusterPillarWithCsdDownloader(StackType stackType, Cluster cluster, Map<String, SaltPillarProperties> servicePillar) { if (StackType.WORKLOAD.equals(stackType)) { clusterHostServiceRunner.decoratePillarWithClouderaManagerCsds(cluster, servicePillar); } else { LOGGER.debug("Skipping the CSD downloading because the stack type is {}", stackType); } }
Source:
public void importCustomEntryTypes(List<EntryType> checkedUnknownEntryTypes, List<EntryType> checkedDifferentEntryTypes) { if (!checkedUnknownEntryTypes.isEmpty()) { checkedUnknownEntryTypes.forEach(type -> EntryTypes.addOrModifyCustomEntryType((CustomEntryType) type, mode)); CustomEntryTypesManager.saveCustomEntryTypes(Globals.prefs); } if (!checkedDifferentEntryTypes.isEmpty()) { checkedUnknownEntryTypes.forEach(type -> EntryTypes.addOrModifyCustomEntryType((CustomEntryType) type, mode)); CustomEntryTypesManager.saveCustomEntryTypes(Globals.prefs); } }

Target:
public void importCustomEntryTypes(List<EntryType> checkedUnknownEntryTypes, List<EntryType> checkedDifferentEntryTypes) { if (!checkedUnknownEntryTypes.isEmpty()) { checkedUnknownEntryTypes.forEach(type -> EntryTypes.addOrModifyCustomEntryType((CustomEntryType) type, mode)); preferencesService.saveCustomEntryTypes(); } if (!checkedDifferentEntryTypes.isEmpty()) { checkedUnknownEntryTypes.forEach(type -> EntryTypes.addOrModifyCustomEntryType((CustomEntryType) type, mode)); preferencesService.saveCustomEntryTypes(); } }
Source:
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { requireNonNull(catalogName, "catalogName is null"); requireNonNull(config, "config is null"); try { Bootstrap app = new Bootstrap( new JsonModule(), new ElasticsearchConnectorModule(), binder -> { binder.bind(TypeManager.class).toInstance(context.getTypeManager()); binder.bind(NodeManager.class).toInstance(context.getNodeManager()); if (tableDescriptionSupplier.isPresent()) { binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, ElasticsearchTableDescription>>>() {}).toInstance(tableDescriptionSupplier.get()); } else { binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, ElasticsearchTableDescription>>>() {}).to(ElasticsearchTableDescriptionSupplier.class).in(Scopes.SINGLETON); } }); Injector injector = app.strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(ElasticsearchConnector.class); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { requireNonNull(catalogName, "catalogName is null"); requireNonNull(config, "config is null"); try { Bootstrap app = new Bootstrap( new JsonModule(), new ElasticsearchConnectorModule(), binder -> { binder.bind(TypeManager.class).toInstance(context.getTypeManager()); binder.bind(NodeManager.class).toInstance(context.getNodeManager()); binder.bind(ElasticsearchTableDescriptionProvider.class).in(Scopes.SINGLETON); }); Injector injector = app.strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(ElasticsearchConnector.class); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public void testTemplateMemberAccessibilities() throws Exception { String code = getAboveComment(); BindingAssertionHelper bh = new BindingAssertionHelper(code, true); ICPPClassTemplate aTemplate = bh.assertNonProblem("ATemplate", 9); ICPPField defaultMemberVariable = bh.assertNonProblem("defaultMemberVariable", 21); assertAccessibility(ICPPClassType.a_private, aTemplate.getAccessibility(defaultMemberVariable)); ICPPField publicMemberVariable = bh.assertNonProblem("publicMemberVariable", 20); assertAccessibility(ICPPClassType.a_public, aTemplate.getAccessibility(publicMemberVariable)); ICPPField protectedMemberVariable = bh.assertNonProblem("protectedMemberVariable", 23); assertAccessibility(ICPPClassType.a_protected, aTemplate.getAccessibility(protectedMemberVariable)); ICPPField privateMemberVariable = bh.assertNonProblem("privateMemberVariable", 21); assertAccessibility(ICPPClassType.a_private, aTemplate.getAccessibility(privateMemberVariable)); }

Target:
public void testTemplateMemberAccessibilities() throws Exception { BindingAssertionHelper bh = getAssertionHelper(); ICPPClassTemplate aTemplate = bh.assertNonProblem("ATemplate"); ICPPField defaultMemberVariable = bh.assertNonProblem("defaultMemberVariable"); VisibilityHelper.assertVisibility(ICPPClassType.v_private, aTemplate.getVisibility(defaultMemberVariable)); ICPPField publicMemberVariable = bh.assertNonProblem("publicMemberVariable"); VisibilityHelper.assertVisibility(ICPPClassType.v_public, aTemplate.getVisibility(publicMemberVariable)); ICPPField protectedMemberVariable = bh.assertNonProblem("protectedMemberVariable"); VisibilityHelper.assertVisibility(ICPPClassType.v_protected, aTemplate.getVisibility(protectedMemberVariable)); ICPPField privateMemberVariable = bh.assertNonProblem("privateMemberVariable"); VisibilityHelper.assertVisibility(ICPPClassType.v_private, aTemplate.getVisibility(privateMemberVariable)); }
Source:
public void onFinish(SpanWrapper span, String operationName, long durationNanos) { final SpanContextInformation contextInfo = SpanContextInformation.forSpan(span); final MonitoredHttpRequest monitoredHttpRequest = contextInfo .getRequestAttribute(MONITORED_HTTP_REQUEST_ATTRIBUTE); if (monitoredHttpRequest == null) { return; } trackServletExceptions(span, monitoredHttpRequest.httpServletRequest); setParams(span, monitoredHttpRequest.httpServletRequest); setTrackingInformation(span, monitoredHttpRequest.httpServletRequest, monitoredHttpRequest.clientIp, monitoredHttpRequest.userAgentHeader); setStatus(span, monitoredHttpRequest.responseWrapper.getStatus()); span.setTag("bytes_written", monitoredHttpRequest.responseWrapper.getContentLength()); final Future<Void> userAgentParsedFuture = contextInfo.getRequestAttribute(USER_AGENT_PARSED_FUTURE_ATTRIBUTE); if (userAgentParsedFuture != null) { try { userAgentParsedFuture.get(); } catch (Exception e) { logger.warn("Suppressed exception", e); } } final Long gcTime = contextInfo.getRequestAttribute(GC_TIME_ATTRIBUTE); if (gcTime != null) { span.setTag("gc_time_ms", collectGcTimeMs() - gcTime); } }

Target:
public void onFinish(SpanWrapper span, String operationName, long durationNanos) { final SpanContextInformation contextInfo = SpanContextInformation.forSpan(span); final MonitoredHttpRequest monitoredHttpRequest = contextInfo .getRequestAttribute(MONITORED_HTTP_REQUEST_ATTRIBUTE); if (monitoredHttpRequest == null) { return; } trackServletExceptions(span, monitoredHttpRequest.httpServletRequest); setParams(span, monitoredHttpRequest.httpServletRequest); setTrackingInformation(span, monitoredHttpRequest.httpServletRequest, monitoredHttpRequest.clientIp, monitoredHttpRequest.userAgentHeader); setStatus(span, monitoredHttpRequest.responseWrapper.getStatus()); span.setTag("bytes_written", monitoredHttpRequest.responseWrapper.getContentLength()); final Future<Void> userAgentParsedFuture = contextInfo.getRequestAttribute(USER_AGENT_PARSED_FUTURE_ATTRIBUTE); if (userAgentParsedFuture != null) { try { userAgentParsedFuture.get(); } catch (Exception e) { logger.warn("Suppressed exception", e); } } }
Source:
public Mono<T> one(T object) { return Mono.just(object).flatMap(o -> { CouchbaseDocument converted = template.support().encodeEntity(o); Object updatedObject = template.support().applyUpdatedId(o, converted.getId()); return template.getCollection(collection).reactive() .upsert(converted.getId(), converted.export(), buildUpsertOptions()).map(result -> { return (T) template.support().applyUpdatedCas(updatedObject, result.cas()); }); }).onErrorMap(throwable -> { if (throwable instanceof RuntimeException) { return template.potentiallyConvertRuntimeException((RuntimeException) throwable); } else { return throwable; } }); }

Target:
public Mono<T> one(T object) { return Mono.just(object).flatMap(o -> { CouchbaseDocument converted = template.support().encodeEntity(o); return template.getCollection(collection).reactive() .upsert(converted.getId(), converted.export(), buildUpsertOptions()).map(result -> { Object updatedObject = template.support().applyUpdatedId(o, converted.getId()); return (T) template.support().applyUpdatedCas(updatedObject, result.cas()); }); }).onErrorMap(throwable -> { if (throwable instanceof RuntimeException) { return template.potentiallyConvertRuntimeException((RuntimeException) throwable); } else { return throwable; } }); }
Source:
private byte[] receivedClientKeyExchange(final PSKClientKeyExchange message) throws HandshakeException { clientKeyExchange = message; String identity = message.getIdentity(); byte[] psk = pskStore.getKey(getIndicatedServerNames(), identity); String virtualHost = null; if (getIndicatedServerNames() == null) { LOGGER.debug("Client uses PSK identity [{}]", new Object[]{getPeerAddress(), identity}); } else { ServerName serverName = getIndicatedServerNames().getServerName(NameType.HOST_NAME); if (serverName == null) { LOGGER.debug("client provided invalid SNI extension which doesn't include a hostname"); } else { virtualHost = new String(serverName.getName(), ServerName.CHARSET); LOGGER.debug("Client uses PSK identity for server [{}]", new Object[]{getPeerAddress(), identity, virtualHost}); } } if (psk == null) { throw new HandshakeException( String.format("Cannot authenticate client, identity [%s] is unknown", identity), new AlertMessage(AlertLevel.FATAL, AlertDescription.UNKNOWN_PSK_IDENTITY, session.getPeer())); } else { session.setPeerIdentity(new PreSharedKeyIdentity(virtualHost, identity)); return generatePremasterSecretFromPSK(psk); } }

Target:
private byte[] receivedClientKeyExchange(final PSKClientKeyExchange message) throws HandshakeException { clientKeyExchange = message; String identity = message.getIdentity(); byte[] psk = pskStore.getKey(getIndicatedServerNames(), identity); String virtualHost = null; if (getIndicatedServerNames() == null) { LOGGER.debug("Client uses PSK identity [{}]", getPeerAddress(), identity); } else { ServerName serverName = getIndicatedServerNames().getServerName(NameType.HOST_NAME); if (serverName == null) { LOGGER.debug("client provided invalid SNI extension which doesn't include a hostname"); } else { virtualHost = new String(serverName.getName(), ServerName.CHARSET); LOGGER.debug("Client uses PSK identity for server [{}]", getPeerAddress(), identity, virtualHost); } } if (psk == null) { throw new HandshakeException( String.format("Cannot authenticate client, identity [%s] is unknown", identity), new AlertMessage(AlertLevel.FATAL, AlertDescription.UNKNOWN_PSK_IDENTITY, session.getPeer())); } else { session.setPeerIdentity(new PreSharedKeyIdentity(virtualHost, identity)); return generatePremasterSecretFromPSK(psk); } }
Source:
public static Thread findThreadById(final long threadId) { final Collection<Thread> result = findThreads(new ThreadIdPredicate(threadId)); if(!result.iterator().hasNext()) { return null; } else { return result.iterator().next(); } }

Target:
public static Thread findThreadById(final long threadId) { final Collection<Thread> result = findThreads(new ThreadIdPredicate(threadId)); if(result.isEmpty()) { return null; } else { return result.iterator().next(); } }
Source:
public void rotateHostCertificates() throws CloudbreakException { Cluster cluster = stack.getCluster(); String user = cluster.getCloudbreakAmbariUser(); String password = cluster.getCloudbreakAmbariPassword(); try { ApiClient client = getClient(stack.getGatewayPort(), user, password, clientConfig); HostsResourceApi hostsResourceApi = clouderaManagerApiFactory.getHostsResourceApi(client); BatchResourceApi batchResourceApi = clouderaManagerApiFactory.getBatchResourceApi(client); ApiHostList hostList = hostsResourceApi.readHosts(null, null, "SUMMARY"); List<ApiBatchRequestElement> batchRequestElements = hostList.getItems().stream() .filter(host -> host.getClusterRef() != null) .map(host -> new ApiBatchRequestElement() .method(HTTPMethod.POST) .url(ClouderaManagerApiClientProvider.API_V_31 + "/hosts/" + host.getHostId() + "/commands/generateHostCerts") .body("{}") .acceptType("application/json") .contentType("application/json")) .collect(Collectors.toList()); ApiBatchRequest batchRequest = new ApiBatchRequest().items(batchRequestElements); ApiBatchResponse apiBatchResponse = batchResourceApi.execute(batchRequest); if (apiBatchResponse.getSuccess()) { List<BigDecimal> ids = apiBatchResponse.getItems().stream() .map(bre -> new Json((String) bre.getResponse()).getSilent(ApiCommand.class).getId()) .collect(Collectors.toList()); PollingResult pollingResult = clouderaManagerPollingServiceProvider.startPollingCommandList(stack, client, ids, "Rotate host certificates"); if (PollingResult.isExited(pollingResult)) { throw new CancellationException("Cluster was terminated during rotation of host certificates"); } else if (PollingResult.isTimeout(pollingResult)) { throw new ClouderaManagerOperationFailedException("Timeout while Cloudera Manager rotates the host certificates."); } } else { throw new ClouderaManagerOperationFailedException("Host certificates rotation batch operation failed: " + apiBatchResponse); } } catch (ApiException | ClouderaManagerClientInitException e) { throw new CloudbreakException("Can't rotate the host certificates due to: " + e.getMessage()); } }

Target:
public void rotateHostCertificates() throws CloudbreakException { Cluster cluster = stack.getCluster(); String user = cluster.getCloudbreakAmbariUser(); String password = cluster.getCloudbreakAmbariPassword(); try { ApiClient client = getClient(stack.getGatewayPort(), user, password, clientConfig); HostsResourceApi hostsResourceApi = clouderaManagerApiFactory.getHostsResourceApi(client); BatchResourceApi batchResourceApi = clouderaManagerApiFactory.getBatchResourceApi(client); ApiHostList hostList = hostsResourceApi.readHosts(null, null, "SUMMARY"); ApiBatchRequest batchRequest = createHostCertsBatchRequest(hostList); ApiBatchResponse apiBatchResponse = batchResourceApi.execute(batchRequest); processHostCertsBatchResponse(client, apiBatchResponse); } catch (ApiException | ClouderaManagerClientInitException e) { LOGGER.warn("Can't rotate the host certificates", e); throw new CloudbreakException("Can't rotate the host certificates due to: " + e.getMessage()); } }
Source:
protected boolean processResponseError(ReplicaId replicaId, ServerErrorCode serverErrorCode) throws CoordinatorException { switch (serverErrorCode) { case No_Error: return true; case IO_Error: case Data_Corrupt: return false; case Blob_Not_Found: getResponsePolicy.blobNotFound(replicaId); return false; case Blob_Deleted: getResponsePolicy.blobDeleted(replicaId); return false; case Blob_Expired: getResponsePolicy.blobExpired(replicaId); return false; default: logger.error("{} GetResponse for BlobId received from ReplicaId had unexpected error code {}", oc, blobId, replicaId, serverErrorCode); throw new CoordinatorException("Unexpected server error code in GetResponse.", CoordinatorError.UnexpectedInternalError); } }

Target:
protected boolean processResponseError(ReplicaId replicaId, ServerErrorCode serverErrorCode) throws CoordinatorException { switch (serverErrorCode) { case No_Error: return true; case IO_Error: case Data_Corrupt: return false; case Blob_Not_Found: blobNotFoundCount++; if (blobNotFoundCount == replicaIdCount) { throw new CoordinatorException("Blob not found.", CoordinatorError.BlobDoesNotExist); } return false; case Blob_Deleted: blobDeletedCount++; if (blobDeletedCount >= min(Blob_Deleted_Count_Threshold, replicaIdCount)) { throw new CoordinatorException("Blob deleted.", CoordinatorError.BlobDeleted); } return false; case Blob_Expired: blobExpiredCount++; if (blobExpiredCount >= min(Blob_Expired_Count_Threshold, replicaIdCount)) { throw new CoordinatorException("Blob expired.", CoordinatorError.BlobExpired); } return false; default: CoordinatorException e = new CoordinatorException("Server returned unexpected error for GetOperation.", CoordinatorError.UnexpectedInternalError); logger.error("{} GetResponse for BlobId received from ReplicaId had unexpected error code {}: {}", context, blobId, replicaId, serverErrorCode, e); throw e; } }
Source:
public void setUpTtl(final long inactivityDuration, final long inactivityDurationInitialDelay, final boolean useKeepAlive) { this.useKeepAlive = useKeepAlive; this.maxInactivityDuration = inactivityDuration; new Thread(new Runnable() { @Override public void run() { if (inactivityDurationInitialDelay > 0) { try { ttlLatch.await(inactivityDurationInitialDelay, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { } } if (inactivityDuration >= 0) { connectionEntry.ttl = inactivityDuration; } } }).start(); checkInactivity(); }

Target:
public void setUpTtl(final long inactivityDuration, final long inactivityDurationInitialDelay, final boolean useKeepAlive) { this.useKeepAlive = useKeepAlive; this.maxInactivityDuration = inactivityDuration; protocolManager.getScheduledPool().schedule(new Runnable() { @Override public void run() { if (inactivityDuration >= 0) { connectionEntry.ttl = inactivityDuration; } } }, inactivityDurationInitialDelay, TimeUnit.MILLISECONDS); checkInactivity(); }
Source:
protected Object decodeEavsys( String sentence, Channel channel, SocketAddress remoteAddress) { Parser parser = new Parser(PATTERN_EAVSYS, sentence); if (!parser.matches()) { return null; } DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); if (!getLastLocation(position, null)) { return null; } position.set(Position.KEY_ICCID, parser.next()); String unused = parser.next(); unused = parser.next(); int hardware = parser.nextHexInt(); position.set(Position.KEY_VERSION_HW, (hardware == 0x12) ? "SF-Lite" : (hardware == 0x52) ? "S911 Lola" : null); position.set(Position.KEY_VERSION_FW, String.format("%d.%02d.%02d", parser.nextInt(), parser.nextInt(), parser.nextInt())); return position; }

Target:
protected Object decodeEavsys( String sentence, Channel channel, SocketAddress remoteAddress) { Parser parser = new Parser(PATTERN_EAVSYS, sentence); if (!parser.matches()) { return null; } DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); getLastLocation(position, null); position.set(Position.KEY_ICCID, parser.next()); position.set(Position.KEY_PHONE, parser.next()); position.set(Position.KEY_VERSION_FW, parser.next()); return position; }
Source:
private DataSetReference.Builder handleAdditionalIds(OafEntity oafEntity, DataSetReference.Builder metaBuilder) { Map<CharSequence, CharSequence> additionalIds = new HashMap<CharSequence, CharSequence>(); if (CollectionUtils.isNotEmpty(oafEntity.getPidList())) { for (StructuredProperty currentPid : oafEntity.getPidList()) { if (StringUtils.isNotBlank(currentPid.getQualifier().getClassid()) && StringUtils.isNotBlank(currentPid.getValue()) && fieldApprover.approve(currentPid.getDataInfo())) { additionalIds.put(currentPid.getQualifier().getClassid(), currentPid.getValue()); if (ID_TYPE_DOI_LOWERCASED.equalsIgnoreCase(currentPid.getQualifier().getClassid())) { metaBuilder.setReferenceType(ID_TYPE_DOI_LOWERCASED); metaBuilder.setIdForGivenType(currentPid.getValue()); } } } } if (!additionalIds.isEmpty()) { metaBuilder.setAlternateIdentifiers(additionalIds); if (metaBuilder.getReferenceType() == null) { Entry<CharSequence,CharSequence> firstIdsPair = additionalIds.entrySet().iterator().next(); metaBuilder.setReferenceType(firstIdsPair.getKey()); metaBuilder.setIdForGivenType(firstIdsPair.getValue()); } } return metaBuilder; }

Target:
private void handleAdditionalIds(OafEntity oafEntity, DataSetReference.Builder metaBuilder) { List<StructuredProperty> filtered = oafEntity.getPidList().stream() .filter(x -> StringUtils.isNotBlank(x.getQualifier().getClassid())) .filter(x -> StringUtils.isNotBlank(x.getValue())) .filter(x -> fieldApprover.approve(x.getDataInfo())) .collect(Collectors.toList()); Map<CharSequence, CharSequence> additionalIds = filtered.stream() .collect(Collectors.toMap(k -> k.getQualifier().getClassid(), v -> v.getValue())); Optional.ofNullable( filtered.stream().filter(x -> ID_TYPE_DOI_LOWERCASED.equalsIgnoreCase(x.getQualifier().getClassid())) .collect(Collectors.toCollection(LinkedList::new)).peekLast()) .ifPresent(last -> { metaBuilder.setReferenceType(ID_TYPE_DOI_LOWERCASED); metaBuilder.setIdForGivenType(last.getValue()); }); if (!additionalIds.isEmpty()) { metaBuilder.setAlternateIdentifiers(additionalIds); if (metaBuilder.getReferenceType() == null) { Entry<CharSequence, CharSequence> firstIdsPair = additionalIds.entrySet().iterator().next(); metaBuilder.setReferenceType(firstIdsPair.getKey()); metaBuilder.setIdForGivenType(firstIdsPair.getValue()); } } }
Source:
private static PrimitiveTypeInfo getType(String name, Schema schema) { Schema.Type type = schema.isNullable() ? schema.getNonNullable().getType() : schema.getType(); switch (type) { case BOOLEAN: return TypeInfoFactory.booleanTypeInfo; case INT: return TypeInfoFactory.intTypeInfo; case LONG: return TypeInfoFactory.longTypeInfo; case FLOAT: return TypeInfoFactory.floatTypeInfo; case DOUBLE: return TypeInfoFactory.doubleTypeInfo; case STRING: return TypeInfoFactory.stringTypeInfo; case BYTES: return TypeInfoFactory.binaryTypeInfo; default: throw new IllegalArgumentException(String.format( "Schema contains field '%s' with unsupported type %s", name, type)); } }

Target:
private static PrimitiveTypeInfo getType(String name, Schema schema) { Schema.Type type = schema.isNullable() ? schema.getNonNullable().getType() : schema.getType(); switch (type) { case BOOLEAN: return TypeInfoFactory.booleanTypeInfo; case INT: return TypeInfoFactory.intTypeInfo; case LONG: return TypeInfoFactory.longTypeInfo; case FLOAT: return TypeInfoFactory.floatTypeInfo; case DOUBLE: return TypeInfoFactory.doubleTypeInfo; case STRING: return TypeInfoFactory.stringTypeInfo; case BYTES: return TypeInfoFactory.binaryTypeInfo; default: throw new IllegalArgumentException(String.format( "Schema contains field '%s' with unsupported type %s. " + "You should provide an schema with this field dropped to work with this table.", name, type)); } }
Source:
public void start() throws Exception { load(); VIEW_INJECTED_VARS.setEnabled(getConfiguration().isEnablePermissions()); }

Target:
public void start() throws Exception { VIEW_INJECTED_VARS.setEnabled(getConfiguration().isEnablePermissions()); }
Source:
public void categoryTest_003_checkPagination(){ MobileCategoryPageObject mobile = new MobileCategoryPageObject(driver); mobile.openCategory(wikiURL); mobile.openArticlesWithPagination(); mobile.verifyPagination(); }

Target:
public void categoryTest_003_checkPagination() { MobileCategoryPageObject mobile = new MobileCategoryPageObject(driver); mobile.openCategory(wikiURL); mobile.openArticle(2); mobile.verifyArticlesCount(25); String firstArticle = mobile.getFirstArticleName(); String lastArticle = mobile.getLastArticleName(); mobile.showNextArticles(); String firstArticle2 = mobile.getFirstArticleName(); mobile.verifyArticlesNotEquals(firstArticle, firstArticle2); mobile.showPreviousArticles(); mobile.verifyArticlesCount(25); String firstArticle3 = mobile.getFirstArticleName(); String lastArticle3 = mobile.getLastArticleName(); mobile.verifyArticlesEquals(firstArticle, firstArticle3); mobile.verifyArticlesEquals(lastArticle, lastArticle3); }
Source:
public int lengthOfMonth() { return InternationalFixedChronology.DAYS_IN_MONTH; }

Target:
public int lengthOfMonth() { return this.month > 0 ? DAYS_IN_MONTH : 1; }
Source:
public APIResult submit( @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type, @Dimension("colo") @QueryParam("colo") final String ignore) { final HttpServletRequest bufferedRequest = getBufferedRequest(request); final Entity entity = getEntity(bufferedRequest, type); Map<String, APIResult> results = new HashMap<String, APIResult>(); final Set<String> colos = getApplicableColos(type, entity); doesEntityHasExtensionJobTag(entity); validateEntity(entity, colos); results.put(FALCON_TAG, new EntityProxy(type, entity.getName()) { @Override protected Set<String> getColosToApply() { return colos; } @Override protected APIResult doExecute(String colo) throws FalconException { return getConfigSyncChannel(colo).invoke("submit", bufferedRequest, type, colo); } }.execute()); if (!embeddedMode) { results.put(PRISM_TAG, super.submit(bufferedRequest, type, currentColo)); } return consolidateResult(results, APIResult.class); }

Target:
public APIResult submit( @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type, @Dimension("colo") @QueryParam("colo") final String ignore) { final HttpServletRequest bufferedRequest = getBufferedRequest(request); final Entity entity = getEntity(bufferedRequest, type); Map<String, APIResult> results = new HashMap<String, APIResult>(); final Set<String> colos = getApplicableColos(type, entity); entityHasExtensionJobTag(entity); validateEntity(entity, colos); results.put(FALCON_TAG, new EntityProxy(type, entity.getName()) { @Override protected Set<String> getColosToApply() { return colos; } @Override protected APIResult doExecute(String colo) throws FalconException { return getConfigSyncChannel(colo).invoke("submit", bufferedRequest, type, colo); } }.execute()); if (!embeddedMode) { results.put(PRISM_TAG, super.submit(bufferedRequest, type, currentColo)); } return consolidateResult(results, APIResult.class); }
Source:
private ObjectNode _createMappingsNode() { ObjectMapper mapper = new ObjectMapper(); ObjectNode propertiesNode = mapper.createObjectNode(); propertiesNode.put(RecordType.SCOPE.getName(), _createFieldNode("text")); propertiesNode.put(RecordType.METRIC.getName(), _createFieldNode("text")); propertiesNode.put(RecordType.TAGK.getName(), _createFieldNode("text")); propertiesNode.put(RecordType.TAGV.getName(), _createFieldNode("text")); propertiesNode.put(RecordType.NAMESPACE.getName(), _createFieldNode("text")); propertiesNode.put("mts", _createFieldNode("date")); ObjectNode typeNode = mapper.createObjectNode(); typeNode.put("properties", propertiesNode); ObjectNode mappingsNode = mapper.createObjectNode(); mappingsNode.put(TYPE_NAME, typeNode); return mappingsNode; }

Target:
private ObjectNode _createMappingsNode() { ObjectMapper mapper = new ObjectMapper(); ObjectNode propertiesNode = mapper.createObjectNode(); propertiesNode.put(RecordType.SCOPE.getName(), _createFieldNode(FIELD_TYPE_TEXT)); propertiesNode.put(RecordType.METRIC.getName(), _createFieldNode(FIELD_TYPE_TEXT)); propertiesNode.put(RecordType.TAGK.getName(), _createFieldNode(FIELD_TYPE_TEXT)); propertiesNode.put(RecordType.TAGV.getName(), _createFieldNode(FIELD_TYPE_TEXT)); propertiesNode.put(RecordType.NAMESPACE.getName(), _createFieldNode(FIELD_TYPE_TEXT)); propertiesNode.put("mts", _createFieldNode(FIELD_TYPE_DATE)); ObjectNode typeNode = mapper.createObjectNode(); typeNode.put("properties", propertiesNode); ObjectNode mappingsNode = mapper.createObjectNode(); mappingsNode.put(TYPE_NAME, typeNode); return mappingsNode; }
Source:
private static List<EClass> advancedSortEClasses(List<EClass> eclasses) { List<EClass> sortedEClasses = new LinkedList<EClass>(); Map<EClass, Integer> mapOfUnsortedEClasses = new HashMap<EClass, Integer>(); for(EClass eclass : eclasses){ mapOfUnsortedEClasses.put(eclass, eclass.getESuperTypes().size()); } while(mapOfUnsortedEClasses.size()>0){ EClass processedEClass = null; Iterator<Map.Entry<EClass, Integer>> iterator = mapOfUnsortedEClasses.entrySet().iterator(); while(iterator.hasNext() && processedEClass == null){ Map.Entry<EClass, Integer> entry = iterator.next(); if(entry.getValue() == 0){ processedEClass = entry.getKey(); sortedEClasses.add(processedEClass); } } mapOfUnsortedEClasses.remove(processedEClass); for(Map.Entry<EClass, Integer> entry : mapOfUnsortedEClasses.entrySet()){ if(entry.getKey().getESuperTypes().contains(processedEClass)) entry.setValue(entry.getValue()-1); } if(processedEClass == null) return null; } return sortedEClasses; }

Target:
private static List<EClass> advancedSortEClasses(List<EClass> eclasses) { List<EClass> sortedEClasses = new LinkedList<EClass>(); Map<EClass, Integer> mapOfUnsortedEClasses = new HashMap<EClass, Integer>(); for(EClass eclass : eclasses){ mapOfUnsortedEClasses.put(eclass, eclass.getESuperTypes().size()); } while(mapOfUnsortedEClasses.size()>0){ EClass processedEClass = null; Iterator<Map.Entry<EClass, Integer>> iterator = mapOfUnsortedEClasses.entrySet().iterator(); while(iterator.hasNext() && processedEClass == null){ Map.Entry<EClass, Integer> entry = iterator.next(); if(entry.getValue() == 0){ processedEClass = entry.getKey(); sortedEClasses.add(processedEClass); } } mapOfUnsortedEClasses.remove(processedEClass); if(processedEClass != null){ for(Map.Entry<EClass, Integer> entry : mapOfUnsortedEClasses.entrySet()){ if(entry.getKey().getESuperTypes().contains(processedEClass)) entry.setValue(entry.getValue()-1); } } if(processedEClass == null) return null; } return sortedEClasses; }
Source:
public Response fetchWorkflowInstance(@ApiParam("Internal id for workflow instance") @PathParam("id") long id, @QueryParam("include") @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @QueryParam("maxActions") @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions) { try { return ok(super.fetchWorkflowInstance(id, include, maxActions, workflowInstances, listWorkflowConverter)).build(); } catch (@SuppressWarnings("unused") EmptyResultDataAccessException e) { return status(NOT_FOUND).entity(format("Workflow instance %s not found", id)).build(); } }

Target:
public Response fetchWorkflowInstance(@ApiParam("Internal id for workflow instance") @PathParam("id") long id, @QueryParam("include") @ApiParam(value = INCLUDE_PARAM_DESC, allowableValues = INCLUDE_PARAM_VALUES, allowMultiple = true) String include, @QueryParam("maxActions") @ApiParam("Maximum number of actions returned for each workflow instance") Long maxActions) { try { return ok(super.fetchWorkflowInstance(id, include, maxActions, workflowInstances, listWorkflowConverter)).build(); } catch (@SuppressWarnings("unused") EmptyResultDataAccessException e) { return status(NOT_FOUND).entity(new ErrorResponse(format("Workflow instance %s not found", id))).build(); } }
Source:
private void setTimeZoneFromCourseTimeZoneIfRequired() { if (isFollowingCourseTimeZone) { return; } Course course = Ref.create(Key.create(Course.class, courseId)).get(); ZoneId courseTimeZone = Const.DEFAULT_TIME_ZONE; if (course == null) { log.severe("Could not retrieve course \"" + courseId + "\"; defaulting to UTC for session: " + feedbackSessionId); } else { try { courseTimeZone = ZoneId.of(course.getTimeZone()); } catch (DateTimeException e) { log.severe("Invalid time zone \"" + course.getTimeZone() + "\" encountered for course \"" + courseId + "\"; defaulting to UTC for session: " + feedbackSessionId); } } timeZone = courseTimeZone.getId(); isFollowingCourseTimeZone = true; }

Target:
private void setTimeZoneFromCourseTimeZoneIfRequired() { if (isFollowingCourseTimeZone) { wasFollowingCourseTimeZone = true; return; } Course course = Ref.create(Key.create(Course.class, courseId)).get(); ZoneId courseTimeZone = Const.DEFAULT_TIME_ZONE; if (course == null) { log.severe("Could not retrieve course \"" + courseId + "\"; defaulting to UTC for session: " + feedbackSessionId); } else { try { courseTimeZone = ZoneId.of(course.getTimeZone()); } catch (DateTimeException e) { log.severe("Invalid time zone \"" + course.getTimeZone() + "\" encountered for course \"" + courseId + "\"; defaulting to UTC for session: " + feedbackSessionId); } } timeZone = courseTimeZone.getId(); isFollowingCourseTimeZone = true; }
Source:
public void testForOutOfBoundsException() { DefaultDescription desc = new DefaultDescription(); score(0, scorer.score(itemWithTitle("Storage Hunters"), of(itemWithTitle(":Storage Hunters: UK")), desc)); }

Target:
public void testForOutOfBoundsException() { DefaultDescription desc = new DefaultDescription(); score(0, scorer.score(itemWithTitle("Storage Hunters"), of(itemWithTitle(":Storage Hunters: UK")), desc)); score(2, scorer.score(itemWithTitle("Storage Hunters"), of(itemWithTitle(":Storage Hunters:")), desc)); }
Source:
protected void configure(final HttpSecurity http) throws Exception { final SecurityFilter filter = new SecurityFilterWithSkipCondition(config, "HeaderClient") { @Override protected boolean skip(HttpServletRequest request, String authTokenHeader) { final String path = request.getServletPath(); String authToken = request.getHeader(authTokenHeader); return path.startsWith("/api/v1/concepts") && Strings.isNullOrEmpty(authToken); } }; http .antMatcher("/api/**") .addFilterBefore(filter, BasicAuthenticationFilter.class) .csrf() .disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER); }

Target:
protected void configure(final HttpSecurity http) throws Exception { final SecurityFilter filter = new SecurityFilter(config, "HeaderClient,AnonymousClient"); http .antMatcher("/api/**") .addFilterBefore(filter, BasicAuthenticationFilter.class) .csrf() .disable() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER); }
Source:
public VmUniverseParams data() { if (data.isPresent()) { return data.get(); } CorfuClusterParams clusterParams = cluster.build(); FixtureUtil fixtureUtil = fixtureUtilBuilder.build(); ImmutableList<CorfuServerParams> serversParams = fixtureUtil.buildVmServers( clusterParams, servers, vmPrefix ); serversParams.forEach(clusterParams::add); ConcurrentMap<String, String> vmIpAddresses = new ConcurrentHashMap<>(); for (int i = 0; i < clusterParams.getNumNodes(); i++) { vmIpAddresses.put(vmPrefix + (i + 1), "0.0.0.0"); } VmUniverseParams universeParams = universe .vmIpAddresses(vmIpAddresses) .build(); universeParams.add(clusterParams); data = Optional.of(universeParams); return universeParams; }

Target:
public VmUniverseParams data() { if (data.isPresent()) { return data.get(); } CorfuClusterParams clusterParams = cluster.build(); FixtureUtil fixtureUtil = fixtureUtilBuilder.build(); ImmutableList<CorfuServerParams> serversParams = fixtureUtil.buildVmServers( clusterParams, servers, vmPrefix ); serversParams.forEach(clusterParams::add); ConcurrentMap<String, String> vmIpAddresses = new ConcurrentHashMap<>(); for (int i = 0; i < clusterParams.getNumNodes(); i++) { vmIpAddresses.put(vmPrefix + (i + 1), ANY_ADDRESS); } VmUniverseParams universeParams = universe .vmIpAddresses(vmIpAddresses) .build(); universeParams.add(clusterParams); data = Optional.of(universeParams); return universeParams; }
Source:
void close() throws StoreException { final Timer.Context context = metrics.indexShutdownTimeInMs.time(); try { persistor.write(); if (hardDeleter != null) { try { hardDeleter.shutdown(); } catch (Exception e) { logger.error("Index : " + dataDir + " error while persisting cleanup token ", e); } } try { cleanShutdownFile.createNewFile(); } catch (IOException e) { logger.error("Index : " + dataDir + " error while creating clean shutdown file ", e); } } finally { context.close(); } }

Target:
void close() throws StoreException { long startTimeInMs = time.milliseconds(); try { persistor.write(); if (hardDeleter != null) { try { hardDeleter.shutdown(); } catch (Exception e) { logger.error("Index : " + dataDir + " error while persisting cleanup token ", e); } } try { cleanShutdownFile.createNewFile(); } catch (IOException e) { logger.error("Index : " + dataDir + " error while creating clean shutdown file ", e); } } finally { metrics.indexShutdownTimeInMs.update(time.milliseconds() - startTimeInMs); } }
Source:
public void channelActive(ChannelHandlerContext ctx) { log.info("channelActive: Outgoing connection established to: from id={}", ctx.channel().remoteAddress(), ctx.channel().localAddress()); HeaderMsg header = getHeaderMsg(0, CorfuMessage.PriorityLevel.NORMAL, 0, UUID.fromString("00000000-0000-0000-0000-000000000000"), this.clientId, false, true); RequestMsg request = getRequestMsg(header, getHandshakeRequestMsg(this.clientId, this.nodeId)); ctx.writeAndFlush(request); log.debug("channelActive: Add to channel pipeline.", READ_TIMEOUT_HANDLER); ctx.pipeline().addBefore(ctx.name(), READ_TIMEOUT_HANDLER, new ReadTimeoutHandler(this.handshakeTimeout)); }

Target:
public void channelActive(ChannelHandlerContext ctx) { log.info("channelActive: Outgoing connection established to: from id={}", ctx.channel().remoteAddress(), ctx.channel().localAddress()); HeaderMsg header = getHeaderMsg(0, CorfuMessage.PriorityLevel.NORMAL, 0, DEFAULT_UUID, this.clientId, false, true); RequestMsg request = getRequestMsg(header, getHandshakeRequestMsg(this.clientId, this.nodeId)); ctx.writeAndFlush(request); log.debug("channelActive: Add to channel pipeline.", READ_TIMEOUT_HANDLER); ctx.pipeline().addBefore(ctx.name(), READ_TIMEOUT_HANDLER, new ReadTimeoutHandler(this.handshakeTimeout)); }
Source:
public Document getResult() { Document aggregateDocument = new Document(); for (String alias : this.orderedAliases) { AggregateValue aggregateValue = this.aliasToValue.get(alias); if (aggregateValue.getResult() != null) { Map<String, Object> map = new HashMap<>(); map.put(alias, aggregateValue.getResult()); aggregateDocument.set(alias, aggregateValue.getResult()); } } return aggregateDocument; }

Target:
public Document getResult() { Document aggregateDocument = new Document(); for (String alias : this.orderedAliases) { AggregateValue aggregateValue = this.aliasToValue.get(alias); if (aggregateValue.getResult() != null) { aggregateDocument.set(alias, aggregateValue.getResult()); } } return aggregateDocument; }
Source:
protected void appendCharacterBuffer(char ch[], int start, int length) { if (characterBuffer != null) { for (int i = start; i < start + length; i++) { characterBuffer.append(ch[i]); } } }

Target:
protected void appendCharacterBuffer(char ch[], int start, int length) { for (int i = start; i < start + length; i++) { characterBuffer.append(ch[i]); } }
Source:
public static String getRequiredProperty(String key, String defaultValue, String[] validValues, String errorMessage) { assertTrue(StringUtils.isNotBlank(key)); String value = System.getProperty(key); if (StringUtils.isBlank(value)) { if (defaultValue != null && !defaultValue.isEmpty()) { log.info("Required property " + key + " is not defined, will use default value: " + defaultValue); value = defaultValue; } else { throw new AssertionError(errorMessage); } } else { log.info("System property defined: " + key + "=" + value); } if (validValues != null && validValues.length > 0) { assertThat(Arrays.asList(validValues), hasItem(value)); } return value; }

Target:
public static String getRequiredProperty(String key, String defaultValue, String[] validValues, String errorMessage) { assertTrue(StringUtils.isNotBlank(key)); String value = System.getProperty(key); if (StringUtils.isBlank(value)) { if (defaultValue != null && !StringUtils.isBlank(defaultValue)) { log.info("Required property " + key + " is not defined, will use default value: " + defaultValue); value = defaultValue; } else { throw new AssertionError(errorMessage); } } else { log.info("System property defined: " + key + "=" + value); } if (validValues != null && validValues.length > 0) { assertThat(Arrays.asList(validValues), hasItem(value)); } return value; }
Source:
public void initialise() { renderingConfig = config.getRendering(); ssaoShader = worldRenderer.getMaterial("engine:prog.ssao"); ssaoBlurredShader = worldRenderer.getMaterial("engine:prog.ssaoBlur"); requireFBO(DefaultDynamicFBOs.ReadOnlyGBuffer); requireDynamicFBO(new FBOConfig(SSAO_URN, 1.0f, FBO.Type.DEFAULT)); requireDynamicFBO(new FBOConfig(SSAO_BLURRED_URN, 1.0f, FBO.Type.DEFAULT)); }

Target:
public void initialise() { renderingConfig = config.getRendering(); ssaoShader = worldRenderer.getMaterial("engine:prog.ssao"); ssaoBlurredShader = worldRenderer.getMaterial("engine:prog.ssaoBlur"); requiresFBO(new FBOConfig(SSAO, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); requiresFBO(new FBOConfig(SSAO_BLURRED, FULL_SCALE, FBO.Type.DEFAULT), displayResolutionDependentFBOs); }
Source:
public void testUIElements() { setApplicationPath(); WelcomePageBase welcomePage = initPage(getDriver(), WelcomePageBase.class); LoginPageBase loginPage = welcomePage.clickNextBtn(); CarinaDescriptionPageBase carinaDescriptionPage = loginPage.login(); UIElementsPageBase uiElements = carinaDescriptionPage.navigateToUIElementsPage(); uiElements.typeText("some Text"); uiElements.typeDate("22/10/2018"); uiElements.typeEmail("some@email.com"); uiElements.swipeToFemaleRadioButton(); uiElements.checkCopy(); uiElements.clickOnFemaleRadioButton(); uiElements.clickOnOtherRadioButton(); }

Target:
public void testUIElements() { WelcomePageBase welcomePage = initPage(getDriver(), WelcomePageBase.class); LoginPageBase loginPage = welcomePage.clickNextBtn(); CarinaDescriptionPageBase carinaDescriptionPage = loginPage.login(); UIElementsPageBase uiElements = carinaDescriptionPage.navigateToUIElementsPage(); final String text = "some text"; final String date = "22/10/2018"; final String email = "some@email.com"; uiElements.typeText(text); Assert.assertEquals(uiElements.getText(), text, "Text was not typed"); uiElements.typeDate(date); Assert.assertEquals(uiElements.getDate(), date, "Date was not typed"); uiElements.typeEmail(email); Assert.assertEquals(uiElements.getEmail(), email, "Email was not typed"); uiElements.swipeToFemaleRadioButton(); uiElements.checkCopy(); Assert.assertTrue(uiElements.isCopyChecked(), "Copy checkbox was not checked"); uiElements.clickOnFemaleRadioButton(); Assert.assertTrue(uiElements.isFemaleRadioButtonSelected(), "Female radio button was not selected!"); uiElements.clickOnOtherRadioButton(); Assert.assertTrue(uiElements.isOthersRadioButtonSelected(), "Others radio button was not selected!"); }
Source:
public PageSet<? extends StorageMetadata> list() { return null; }

Target:
public PageSet<? extends StorageMetadata> list() { throw new UnsupportedOperationException(); }
Source:
private void applyProjectsVolumes(List<PodData> podsData, List<HasMetadata> componentObjects) { PersistentVolumeClaim volumeClaim = newPVC(PROJECTS_VOLUME_NAME, "ReadWriteOnce", defaultProjectPVCSize); componentObjects.add(volumeClaim); for (PodData podData : podsData) { if (podData.getSpec() == null) { continue; } Volume volume = newVolume(PROJECTS_VOLUME_NAME, PROJECTS_VOLUME_NAME); podData.getSpec().getVolumes().add(volume); for (Container container : podData.getSpec().getContainers()) { VolumeMount volumeMount = newVolumeMount(PROJECTS_VOLUME_NAME, projectFolderPath, null); container.getVolumeMounts().add(volumeMount); } } }

Target:
private void applyProjectsVolumes(List<PodData> podsData, List<HasMetadata> componentObjects) { if (componentObjects .stream() .noneMatch( hasMeta -> hasMeta instanceof PersistentVolumeClaim && hasMeta.getMetadata().getName().equals(PROJECTS_VOLUME_NAME))) { PersistentVolumeClaim volumeClaim = newPVC( PROJECTS_VOLUME_NAME, defaultPVCAccessMode, defaultProjectPVCSize, pvcStorageClassName); componentObjects.add(volumeClaim); } for (PodData podData : podsData) { if (podData .getSpec() .getVolumes() .stream() .noneMatch(volume -> volume.getName().equals(PROJECTS_VOLUME_NAME))) { Volume volume = newVolume(PROJECTS_VOLUME_NAME, PROJECTS_VOLUME_NAME); podData.getSpec().getVolumes().add(volume); } for (Container container : podData.getSpec().getContainers()) { if (container .getVolumeMounts() .stream() .noneMatch(mount -> mount.getName().equals(PROJECTS_VOLUME_NAME))) { VolumeMount volumeMount = newVolumeMount(PROJECTS_VOLUME_NAME, projectFolderPath, null); container.getVolumeMounts().add(volumeMount); } } } }
Source:
public void disableButton(HTMLAnchorElement anchorElement, boolean disabled) { String buttonCssClass = "btn btn-default"; if (disabled) { buttonCssClass += " disabled"; } anchorElement.setAttribute("class", buttonCssClass); }

Target:
public void disableButton(HTMLAnchorElement anchorElement, boolean disabled) { if (disabled) { anchorElement.classList.add("disabled"); } else { anchorElement.classList.remove("disabled"); } }
Source:
public WorkQueue.Executor get() { CurrentUser user = userProvider.get(); WorkQueue.Executor executor = queues.getInteractiveQueue(); if (user.isBatchUser()) { executor = queues.getBatchQueue(); } return executor; }

Target:
public WorkQueue.Executor get() { WorkQueue.Executor executor; if (user.isBatchUser()) { executor = queues.getBatchQueue(); } else { executor = queues.getInteractiveQueue(); } return executor; }
Source:
public static void toJSON(OutputWriter outputWriter, List<PipelineConfigs> listOfPipelineConfigs) { List<PipelineConfig> pipelines = listOfPipelineConfigs.stream().flatMap(pipelineConfigs -> pipelineConfigs.getPipelines().stream()).collect(Collectors.toList()); outputWriter.addLinks(linksWriter -> { linksWriter.addLink("self", Routes.Pipeline.INTERNAL_BASE); }).addChild("_embedded", childWriter -> { childWriter.addChildList("pipelines", pipelineConfigWriter -> { pipelines.forEach(pipeline -> { pipelineConfigWriter.addChild(innerChildWriter -> { PipelineConfigWithMinimalAttributesRepresenter.toJSON(innerChildWriter, pipeline); }); }); }); }); }

Target:
public static void toJSON(OutputWriter outputWriter, List<PipelineConfigs> listOfPipelineConfigs) { List<PipelineConfig> pipelines = listOfPipelineConfigs .stream() .map(PipelineConfigs::getPipelines) .flatMap(Collection::stream) .collect(Collectors.toList()); outputWriter.addLinks(linksWriter -> { linksWriter.addLink("self", Routes.Pipeline.INTERNAL_BASE); }).addChild("_embedded", childWriter -> { childWriter.addChildList("pipelines", pipelineConfigWriter -> { pipelines.forEach(pipeline -> { pipelineConfigWriter.addChild(innerChildWriter -> { PipelineConfigWithMinimalAttributesRepresenter.toJSON(innerChildWriter, pipeline); }); }); }); }); }
Source:
public boolean equals(Object obj) { if (!(obj instanceof TypeAndTime)) { return false; } final TypeAndTime obj2 = (TypeAndTime) obj; return (obj2.event.equals(event) && obj2.time.equals(time) ); }

Target:
public boolean equals(Object obj) { if (!(obj instanceof TypeAndTime)) { return false; } final TypeAndTime obj2 = (TypeAndTime) obj; return Objects.equal(event,obj2.event) && Objects.equal(time,obj2.time); }