auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand() { if (getVds() == null) { return; } log.info("Before Installation host {}, {}", getVds().getId(), getVds().getName()); try { setVdsStatus(VDSStatus.Installing); if (getParameters().getAuthMethod() == AuthenticationMethod.Password) { copyEngineSshId(); } String gluster_maintenance_old_node = getVds().getName(); VdsStatic vdsStatic = vdsStaticDao.get(getVds().getId()); List<VdsStatic> vdsStatics = vdsStaticDao.getAllForCluster(vdsStatic.getClusterId()); String gluster_maintenance_cluster_node = null; String gluster_maintenance_cluster_node_2 = null; if(vdsStatics.size()>1) { for (VdsStatic vdsStatic2 : vdsStatics) { if (vdsStatic2.getHostName() != gluster_maintenance_old_node && vdsStatic2.getHostName() != gluster_maintenance_cluster_node) { gluster_maintenance_cluster_node = vdsStatic2.getHostName(); } else if (vdsStatic2.getHostName() != gluster_maintenance_old_node && vdsStatic2.getHostName() != gluster_maintenance_cluster_node_2) { gluster_maintenance_cluster_node_2 = vdsStatic2.getHostName(); } } } runAnsibleHostDeployPlaybook(); if(getParameters().getReconfigureGluster()) { runAnsibleReconfigureGluster(); } markCurrentCmdlineAsStored(); markVdsReinstalled(); configureManagementNetwork(); if (!getParameters().getActivateHost()) { setVdsStatus(VDSStatus.Maintenance); } else { setVdsStatus(VDSStatus.Initializing); } log.info("After Installation host {}, {}", getVds().getName(), getVds().getVdsType().name()); setSucceeded(true); } catch (VdsInstallException e) { handleError(e, e.getStatus()); } catch (Exception e) { handleError(e, VDSStatus.InstallFailed); } }

Target:
protected void executeCommand() { if (getVds() == null) { return; } log.info("Before Installation host {}, {}", getVds().getId(), getVds().getName()); try { setVdsStatus(VDSStatus.Installing); if (getParameters().getAuthMethod() == AuthenticationMethod.Password) { copyEngineSshId(); } runAnsibleHostDeployPlaybook(); if(getParameters().getReconfigureGluster()) { runAnsibleReconfigureGluster(); } markCurrentCmdlineAsStored(); markVdsReinstalled(); configureManagementNetwork(); if (!getParameters().getActivateHost()) { setVdsStatus(VDSStatus.Maintenance); } else { setVdsStatus(VDSStatus.Initializing); } log.info("After Installation host {}, {}", getVds().getName(), getVds().getVdsType().name()); setSucceeded(true); } catch (VdsInstallException e) { handleError(e, e.getStatus()); } catch (Exception e) { handleError(e, VDSStatus.InstallFailed); } }
Source:
public KubernetesClient createClient() throws IOException { ConfigBuilder builder; if (auth instanceof KubernetesAuthKubeconfig) { builder = new ConfigBuilder( Config.fromKubeconfig( ((KubernetesAuthKubeconfig) auth).getKubeconfig() ) ); } else { if (StringUtils.isBlank(serviceAddress)) { LOGGER.log(FINE, "Autoconfiguring Kubernetes client"); builder = new ConfigBuilder(Config.autoConfigure(null)); } else { builder = new ConfigBuilder().withMasterUrl(serviceAddress); } } if (auth instanceof KubernetesAuthToken) { builder.withOauthToken(((KubernetesAuthToken) auth).getToken()); } else if (auth instanceof KubernetesAuthUsernamePassword) { KubernetesAuthUsernamePassword usernamePassword = (KubernetesAuthUsernamePassword) auth; builder.withUsername(usernamePassword.getUsername()).withPassword(usernamePassword.getPassword()); } else if (auth instanceof KubernetesAuthCertificate) { KubernetesAuthCertificate certData = (KubernetesAuthCertificate) auth; builder.withClientCertData(certData.getCertificate()); builder.withClientKeyData(certData.getKey()); String password = certData.getKeyPassword(); if (password != null) { builder.withClientKeyPassphrase(password); } } if (skipTlsVerify) { builder.withTrustCerts(true); } if (caCertData != null) { builder.withCaCertData(Base64.encodeBase64String(caCertData.getBytes(UTF_8))); } builder = builder.withRequestTimeout(readTimeout * 1000).withConnectionTimeout(connectTimeout * 1000); builder.withMaxConcurrentRequestsPerHost(maxRequestsPerHost); if (!StringUtils.isBlank(namespace)) { builder.withNamespace(namespace); } else if (StringUtils.isBlank(builder.getNamespace())) { builder.withNamespace("default"); } LOGGER.log(FINE, "Creating Kubernetes client: {0}", this.toString()); return new DefaultKubernetesClient(builder.build()); }

Target:
public KubernetesClient createClient() throws KubernetesAuthException { ConfigBuilder builder; if (StringUtils.isBlank(serviceAddress)) { LOGGER.log(FINE, "Autoconfiguring Kubernetes client"); builder = new ConfigBuilder(Config.autoConfigure(null)); } else { builder = new ConfigBuilder().withMasterUrl(serviceAddress); } if (auth != null) { builder = auth.decorate(builder, new KubernetesAuthConfig(builder.getMasterUrl(), caCertData, skipTlsVerify)); } if (skipTlsVerify) { builder.withTrustCerts(true); } if (caCertData != null) { builder.withCaCertData(Base64.encodeBase64String(caCertData.getBytes(UTF_8))); } builder = builder.withRequestTimeout(readTimeout * 1000).withConnectionTimeout(connectTimeout * 1000); builder.withMaxConcurrentRequestsPerHost(maxRequestsPerHost); if (!StringUtils.isBlank(namespace)) { builder.withNamespace(namespace); } else if (StringUtils.isBlank(builder.getNamespace())) { builder.withNamespace("default"); } LOGGER.log(FINE, "Creating Kubernetes client: {0}", this.toString()); return new DefaultKubernetesClient(builder.build()); }
Source:
public void close() { try { delegate.close(connectionSupplier.getConnection()); } catch (Exception e) { throw new MuleRuntimeException(createStaticMessage(COULD_NOT_OBTAIN_A_CONNECTION), e); } finally { connectionSupplier.close(); connectionSupplierFactory.dispose(); } }

Target:
public void close() { ConnectionSupplier connectionSupplier = null; try { connectionSupplier = connectionSupplierFactory.getConnectionSupplier(); delegate.close(connectionSupplier.getConnection()); } catch (Exception e) { throw new MuleRuntimeException(createStaticMessage(COULD_NOT_OBTAIN_A_CONNECTION), e); } finally { if (connectionSupplier != null) { safely(connectionSupplier::close, e -> LOGGER.debug("Found exception closing the connection supplier", e)); } connectionSupplierFactory.dispose(); } }
Source:
protected static void goToCorrectStart(RandomAccessFile rafile) throws IOException { String line = rafile.readLine(); if (line.startsWith("{\"data\":")) { rafile.seek(46); } else if (line.startsWith("{\"traceEvents\":")) { rafile.seek(14); } else { rafile.seek(0); } }

Target:
public abstract void goToCorrectStart(RandomAccessFile rafile) throws IOException; public abstract String getTraceType(); public abstract String getTsKey(); public abstract Integer getBracketsToSkip(); @Override public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); fProperties.put("Type", getTraceType()); String dir = TmfTraceManager.getSupplementaryFileDir(this); fFile = new File(dir + new File(path).getName()); if (!fFile.exists()) { Job sortJob = new SortingJob(this, path, getTsKey(), getBracketsToSkip()); sortJob.schedule(); while (sortJob.getResult() == null) { try { sortJob.join(); } catch (InterruptedException e) { throw new TmfTraceException(e.getMessage(), e); } } IStatus result = sortJob.getResult(); if (!result.isOK()) { throw new TmfTraceException("Job failed " + result.getMessage()); } } try { fFileInput = new BufferedRandomAccessFile(fFile, "r"); goToCorrectStart(fFileInput); } catch (IOException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
private Func1<String, Observable<Channel>> createChannelInstanceFromPath() { return new Func1<String, Observable<Channel>>() { @Override public Observable<Channel> call(final String channelPath) { return Observable.create(new Observable.OnSubscribe<ChannelInfo>() { @Override public void call(final Subscriber<? super ChannelInfo> subscriber) { channelsDB.child(channelPath).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (dataSnapshot.hasChildren()) { subscriber.onNext(toChannelInfo(dataSnapshot)); } subscriber.onCompleted(); } @Override public void onCancelled(DatabaseError databaseError) { subscriber.onError(databaseError.toException()); } }); } }).map(createChannelInstanceWith(channelPath)); } }; }

Target:
private Func1<String, Observable<Channel>> createChannelInstanceFromPath() { return new Func1<String, Observable<Channel>>() { @Override public Observable<Channel> call(String channelPath) { return getChannelInfoFor(channelPath) .map(createChannelInstanceWith(channelPath)); } }; }
Source:
public void testToStreamRecordV2WhenOldImageIsNull() { com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone(); streamRecord.setOldImage(null); Assertions.assertDoesNotThrow(() -> { StreamRecord convertedStreamRecord = DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord); }); }

Target:
public void testToStreamRecordV2WhenOldImageIsNull() { com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone(); streamRecord.setOldImage(null); Assertions.assertDoesNotThrow(() -> { DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord); }); }
Source:
public int get(int i) { if (i < 0 || i >= index) { throw new ArrayIndexOutOfBoundsException(i); } return ints[i]; }

Target:
public int get(int i) { if (i < 0 || i >= index) { throw new ArrayIndexOutOfBoundsException("Index: " + i + ", Size: " + index); } return ints[i]; }
Source:
public void save(TaskCreateDto dto) { Endpoint endpoint = endpointRepository.findOne(dto.getEndpointId()); if (endpoint == null) { throw new IllegalArgumentException("endpoint not valid"); } Organization organization = null; if (!dto.isPublic()) { organization = organizationRepository.findOne(dto.getOrganizationId()); } Task task = new Task(); task.setName(dto.getName()); task.setInstructions(dto.getInstructions()); task.setDescription(dto.getDescription()); task.setEndpoint(endpoint); task.setOrganization(organization); task = repository.save(task); endpoint.addTask(task); if (!dto.isPublic()) { organization.addTask(task); } }

Target:
public void save(TaskCreateDto dto) { Endpoint endpoint = endpointRepository.findOne(dto.getEndpointId()); if (endpoint == null) { throw new IllegalArgumentException("endpoint not valid"); } Organization organization= organizationRepository.findOne(dto.getOrganizationId()); if (organization == null) { throw new IllegalArgumentException("organization not valid"); } Task task = new Task(); task.setName(dto.getName()); task.setInstructions(dto.getInstructions()); task.setDescription(dto.getDescription()); task.setPublic(dto.isPublic()); endpoint.addTask(task); organization.addTask(task); repository.save(task); }
Source:
private String getLogicalSlotString(SlotRequestId logicalSlotRequestId, ExecutionVertexID executionVertexId) { return String.format( "logical %s for execution vertex (id %s) from the physical %s", logicalSlotRequestId, executionVertexId, physicalSlotRequestId); }

Target:
private String getLogicalSlotString(SlotRequestId logicalSlotRequestId, ExecutionVertexID executionVertexId) { return String.format( "logical slot (%s) for execution vertex (id %s) from the physical slot (%s)", logicalSlotRequestId, executionVertexId, physicalSlotRequestId); }
Source:
private void buildIndex() { first = 0; index = new Entry[inQueue / 100 + 1]; Entry q = head; int qi = 0, ii = 0; while (q != null) { if (++qi % 100 == 0) index[ii++] = q; q = q.next; } last = ii - 1; }

Target:
private void buildIndex() { sinceLastIndex = 0; first = 0; index = new Entry[inQueue / 100 + 1]; int qi = 0, ii = 0; for (Entry q = head; q != null; q = q.next) { if (++qi % 100 == 0) index[ii++] = q; } last = ii - 1; }
Source:
private int getAccessibility(int memberIndex) throws CoreException { int targetAccessibilityBytes = memberIndex / 4; int accessibilityBlockOffset = memberIndex % 4; int accessibilityMask = 3 << accessibilityBlockOffset * ACCESSIBILITY_BITS; long accessibilityOffset = record + MEMBER_ACCESSIBILITIES + targetAccessibilityBytes; int currentAccessibility = getDB().getByte(accessibilityOffset); int maskedAccessibility = currentAccessibility & accessibilityMask; maskedAccessibility >>>= accessibilityBlockOffset * ACCESSIBILITY_BITS; return maskedAccessibility; }

Target:
private int getAccessibility(int memberIndex) throws CoreException { int targetAccessibilityBytes = memberIndex / VISIBILITY_VALUES_PER_BYTE; int accessibilityBlockOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; int accessibilityMask = VISIBILITY_MASK << accessibilityBlockOffset * VISIBILITY_BITS; long accessibilityOffset = record + MEMBER_VISIBILITIES + targetAccessibilityBytes; int currentAccessibility = getDB().getByte(accessibilityOffset); int maskedAccessibility = currentAccessibility & accessibilityMask; maskedAccessibility >>>= accessibilityBlockOffset * VISIBILITY_BITS; return maskedAccessibility; }
Source:
private URL getKVPurl(String baseUrl, TileIdentifier tileIdentifier) throws RuntimeException { if(!baseUrl.contains("?")) { baseUrl+="?"; } HashMap<String, Object> params = new HashMap<>(); params.put("service", "WMTS"); params.put("version", "1.0.0"); params.put("request", "getTile"); params.put("layer", service.getLayerName()); params.put("style", service.getStyleName()); params.put("format", service.getFormat()); params.put("tilematrixset", service.getTileMatrixSetName()); params.put("TileMatrix", service.getTileMatrix(tileIdentifier.getZ()).getIdentifier()); params.put("TileCol", tileIdentifier.getX()); params.put("TileRow", tileIdentifier.getY()); StringBuilder arguments = new StringBuilder(); for(String p:params.keySet()) { try { arguments.append(p).append("=").append(URLEncoder.encode(params.get(p).toString(),"UTF-8")); arguments.append('&'); }catch (Exception e) { } } try { return new URL(baseUrl+arguments.toString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }

Target:
private URL getKVPurl(String baseUrl, TileIdentifier tileIdentifier) throws RuntimeException { if (!baseUrl.contains("?")) { baseUrl += "?"; } HashMap<String, Object> params = new HashMap<>(); params.put("service", "WMTS"); params.put("version", "1.0.0"); params.put("request", "getTile"); params.put("layer", service.getLayerName()); params.put("style", service.getStyleName()); params.put("format", service.getFormat()); params.put("tilematrixset", service.getTileMatrixSetName()); params.put("TileMatrix", service.getTileMatrix(tileIdentifier.getZ()).getIdentifier()); params.put("TileCol", tileIdentifier.getX()); params.put("TileRow", tileIdentifier.getY()); StringBuilder arguments = new StringBuilder(); for (String key : params.keySet()) { Object val = params.get(key); try { if (val != null) { arguments.append(key).append("="); arguments.append(URLEncoder.encode(val.toString(), "UTF-8")); arguments.append('&'); } } catch (Exception e) { LOGGER.warning("Could not encode param '" + key + "' with value '" + val + "'"); } } try { return new URL(baseUrl + arguments.toString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
Source:
public void createPublicIPAddress() { final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourcegroup); final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue"); PublicIPAddressProperties properties = PublicIPAddressProperties.create(null, null, "Static", 4, null, null); PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, properties); assertNotNull(ip); assertEquals(ip.name(), publicIpAddressName); assertEquals(ip.location(), LOCATION); assertEquals(ip.id(), String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", subscriptionid, resourcegroup, publicIpAddressName)); assertEquals(ip.tags().get("testkey"), "testvalue"); assertNotNull(ip.properties()); assertEquals(ip.properties().provisioningState(), "Updating"); assertNull(ip.properties().ipAddress()); assertEquals(ip.properties().publicIPAllocationMethod(), "Static"); assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4); }

Target:
public void createPublicIPAddress() { final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourcegroup); final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue"); PublicIPAddressProperties properties = PublicIPAddressProperties.builder() .publicIPAllocationMethod("Static") .idleTimeoutInMinutes(4) .build(); PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, properties); assertNotNull(ip); assertEquals(ip.name(), publicIpAddressName); assertEquals(ip.location(), LOCATION); assertEquals(ip.id(), String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", subscriptionid, resourcegroup, publicIpAddressName)); assertEquals(ip.tags().get("testkey"), "testvalue"); assertNotNull(ip.properties()); assertEquals(ip.properties().provisioningState(), "Updating"); assertNull(ip.properties().ipAddress()); assertEquals(ip.properties().publicIPAllocationMethod(), "Static"); assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4); }
Source:
public void testBlockingOnStoreAvailabilityChange() { Cache<Object, Object> cache = createManagerAndGetCache(false, 1); AdvancedAsyncCacheWriter asyncWriter = TestingUtil.getFirstWriter(cache); DummyInMemoryStore store = (DummyInMemoryStore) TestingUtil.extractField(AdvancedAsyncCacheWriter.class, asyncWriter, "actual"); store.setAvailable(true); cache.put(1, 1); MarshalledEntry storedEntry = null; for (int i = 0; i < 100 && (storedEntry = store.load(1)) == null; i++) { TestingUtil.sleepThread(100); } assertNotNull(storedEntry); assertEquals(1, store.size()); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); store.setAvailable(false); assertFalse(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertFalse(TestingUtil.extractField(asyncWriter, "delegateAvailable")); assertTrue(pm.isAvailable()); cache.putAll(intMap(0, 10)); assertEquals(1, store.size()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertFalse(asyncWriter.isAvailable()); assertFalse(pm.isAvailable()); Exceptions.expectException(StoreUnavailableException.class, () -> cache.putAll(intMap(10, 20))); assertEquals(1, store.size()); store.setAvailable(true); assertTrue(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertTrue(pm.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertEquals(10, store.size()); assertFalse(store.contains(10)); }

Target:
public void testBlockingOnStoreAvailabilityChange() { Cache<Object, Object> cache = createManagerAndGetCache(false, 1); AdvancedAsyncCacheWriter asyncWriter = TestingUtil.getFirstWriter(cache); DummyInMemoryStore store = (DummyInMemoryStore) TestingUtil.extractField(AdvancedAsyncCacheWriter.class, asyncWriter, "actual"); store.setAvailable(true); cache.put(1, 1); eventually(() -> store.load(1) != null); assertEquals(1, store.size()); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); store.setAvailable(false); assertFalse(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertFalse(TestingUtil.extractField(asyncWriter, "delegateAvailable")); assertTrue(pm.isAvailable()); cache.putAll(intMap(0, 10)); assertEquals(1, store.size()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertFalse(asyncWriter.isAvailable()); assertFalse(pm.isAvailable()); Exceptions.expectException(StoreUnavailableException.class, () -> cache.putAll(intMap(10, 20))); assertEquals(1, store.size()); store.setAvailable(true); assertTrue(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertTrue(pm.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertEquals(10, store.size()); assertFalse(store.contains(10)); }
Source:
public void testGetFileNameWithRewriting() throws Exception { JsonParser parser = new JsonParser(); try { JsonElement tree = parser.parse( new java.io.FileReader( FileUtils.toFile( CLASS.getResource("prettified_filenames_metadata.json") ) ) ); JsonArray tests = tree.getAsJsonArray(); for( JsonElement test: tests ) { JsonObject o = test.getAsJsonObject(); String original = o.get("filename").getAsString(); String prettified = o.get("prettified").getAsString(); assertThat(FileUtil.getFileNamePrettified(original)).isEqualTo(prettified); } } catch( Exception ex ) { throw( ex ); } }

Target:
public void testGetFileNameWithRewriting() throws Exception { JsonParser parser = new JsonParser(); try { JsonElement tree = parser.parse( new java.io.FileReader( FileUtils.toFile( CLASS.getResource("prettified_filenames_metadata.json") ) ) ); JsonArray tests = tree.getAsJsonArray(); for( JsonElement test: tests ) { JsonObject o = test.getAsJsonObject(); String original = o.get("filename").getAsString(); String prettified = o.get("prettified").getAsString(); assertThat(FileUtil.getFileNamePrettified(original)).isEqualTo(prettified); } } catch( Exception ex ) { throw(new AssertionError(ex)); } }
Source:
public void freshTimestampsDelegatesToTimestampService() { int numTimestamps = 10; TimestampRange range = TimestampRange.createInclusiveRange(21L, 30L); when(timestampService.getFreshTimestamps(10)).thenReturn(range); assertEquals(range, timelock.getFreshTimestamps(numTimestamps)); }

Target:
public void freshTimestampsDelegatesToTimestampService() { int numTimestamps = 10; TimestampRange range = TimestampRange.createInclusiveRange(21L, 30L); when(timestampService.getFreshTimestamps(numTimestamps)).thenReturn(range); assertEquals(range, timelock.getFreshTimestamps(numTimestamps)); }
Source:
public DirectDebitPayment create(Account account, CreateDirectDebitPaymentRequest directDebitPaymentRequest) { var directDebitConnectorCreatePaymentRequest = aDirectDebitConnectorCreatePaymentRequest() .withAgreementId(directDebitPaymentRequest.getAgreementId()) .withAmount(directDebitPaymentRequest.getAmount()) .withDescription(directDebitPaymentRequest.getDescription()) .withReference(directDebitPaymentRequest.getReference()) .build(); Response response = client .target(directDebitConnectorUriGenerator.chargesURI(account)) .request() .accept(MediaType.APPLICATION_JSON) .post(Entity.entity(directDebitConnectorCreatePaymentRequest, MediaType.APPLICATION_JSON_TYPE)); if (response.getStatus() != HttpStatus.SC_CREATED) { throw new CreateChargeException(response); } var connectorResponse = response .readEntity(DirectDebitConnectorCreatePaymentResponse.class); return aDirectDebitPayment().withAmount(connectorResponse.getAmount()) .withReference(connectorResponse.getReference()) .withDescription(connectorResponse.getDescription()) .withPaymentId(connectorResponse.getPaymentExternalId()) .withPaymentProvider(connectorResponse.getPaymentProvider()) .withState(connectorResponse.getState()) .withCreatedDate(connectorResponse.getCreatedDate()) .withSelfLink(publicApiUriGenerator.getDirectDebitPaymentURI(connectorResponse.getPaymentExternalId())) .withEventsLink(publicApiUriGenerator.getDirectDebitPaymentEventsURI(connectorResponse.getPaymentExternalId())) .build(); }

Target:
public DirectDebitPayment create(Account account, CreateDirectDebitPaymentRequest directDebitPaymentRequest) { var directDebitConnectorCreatePaymentRequest = aDirectDebitConnectorCreatePaymentRequest() .withMandateId(directDebitPaymentRequest.getMandateId()) .withAmount(directDebitPaymentRequest.getAmount()) .withDescription(directDebitPaymentRequest.getDescription()) .withReference(directDebitPaymentRequest.getReference()) .build(); Response response = client .target(directDebitConnectorUriGenerator.chargesURI(account)) .request() .accept(MediaType.APPLICATION_JSON) .post(Entity.entity(directDebitConnectorCreatePaymentRequest, MediaType.APPLICATION_JSON_TYPE)); if (response.getStatus() != HttpStatus.SC_CREATED) { throw new CreateChargeException(response); } var connectorResponse = response .readEntity(DirectDebitConnectorCreatePaymentResponse.class); return aDirectDebitPayment().withAmount(connectorResponse.getAmount()) .withReference(connectorResponse.getReference()) .withDescription(connectorResponse.getDescription()) .withPaymentId(connectorResponse.getPaymentExternalId()) .withPaymentProvider(connectorResponse.getPaymentProvider()) .withState(connectorResponse.getState()) .withCreatedDate(connectorResponse.getCreatedDate()) .withSelfLink(publicApiUriGenerator.getDirectDebitPaymentURI(connectorResponse.getPaymentExternalId())) .withEventsLink(publicApiUriGenerator.getDirectDebitPaymentEventsURI(connectorResponse.getPaymentExternalId())) .build(); }
Source:
public void undeploy(String name) { Assert.hasText(name, "name cannot be blank or null"); validateBeforeUndeploy(name); logger.trace("Undeploying {}", name); D definition = getDefinitionRepository().findOne(name); if (definition == null) { throwNoSuchDefinitionException(name); } final I instance = instanceRepository.findOne(name); if (instance == null) { throwNotDeployedException(name); } instanceRepository.delete(instance); undeployResource(name); }

Target:
public void undeploy(String name) { validateBeforeUndeploy(name); logger.trace("Undeploying {}", name); instanceRepository.delete(instanceRepository.findOne(name)); undeployResource(name); }
Source:
public int compareTo(TimeAndDims rhs) { int retVal = Longs.compare(timestamp, rhs.timestamp); if (retVal == 0) { retVal = Ints.compare(dims.length, rhs.dims.length); } int index = 0; while (retVal == 0 && index < dims.length) { String[] lhsVals = dims[index]; String[] rhsVals = rhs.dims[index]; if (lhsVals == null) { if (rhsVals == null) { ++index; continue; } return -1; } if (rhsVals == null) { return 1; } retVal = Ints.compare(lhsVals.length, rhsVals.length); int valsIndex = 0; while (retVal == 0 && valsIndex < lhsVals.length) { final String lhsVal = lhsVals[valsIndex]; final String rhsVal = rhsVals[valsIndex]; if(lhsVal == null && rhsVal == null) return 0; else if(lhsVal == null) return -1; else if(rhsVal == null) return 1; else retVal = lhsVal.compareTo(rhsVal); ++valsIndex; } ++index; } return retVal; }

Target:
public int compareTo(TimeAndDims rhs) { int retVal = Longs.compare(timestamp, rhs.timestamp); if (retVal == 0) { retVal = Ints.compare(dims.length, rhs.dims.length); } int index = 0; while (retVal == 0 && index < dims.length) { String[] lhsVals = dims[index]; String[] rhsVals = rhs.dims[index]; if (lhsVals == null) { if (rhsVals == null) { ++index; continue; } return -1; } if (rhsVals == null) { return 1; } retVal = Ints.compare(lhsVals.length, rhsVals.length); int valsIndex = 0; while (retVal == 0 && valsIndex < lhsVals.length) { final String lhsVal = lhsVals[valsIndex]; final String rhsVal = rhsVals[valsIndex]; if (lhsVal == null && rhsVal == null) { return 0; } else if (lhsVal == null) { return -1; } else if (rhsVal == null) { return 1; } else { retVal = lhsVal.compareTo(rhsVal); } ++valsIndex; } ++index; } return retVal; }
Source:
public List<URI> uploadAllFromHome(String inVerzeichnis) { User currentUser = Helper.getCurrentUser(); ArrayList<URI> files = new ArrayList<>(); FilenameFilter filter = new FileNameEndsWithFilter("]"); try { if (currentUser != null) { URI directoryName = serviceManager.getUserService().getHomeDirectory(currentUser).resolve(inVerzeichnis); files = fileService.getSubUris(filter, directoryName); } else { Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler - no user assigned"); return files; } } catch (IOException ioe) { logger.error("Exception uploadFromHomeAlle()", ioe); Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", ioe.getMessage()); return files; } for (URI data : files) { String dataString = data.toString(); if (dataString.endsWith("/") || dataString.endsWith("\\")) { data = URI.create(dataString.substring(0, dataString.length() - 1)); } if (data.toString().contains("/")) { data = URI.create(dataString.substring(dataString.lastIndexOf("/"))); } } return files; }

Target:
public List<URI> uploadAllFromHome(String inVerzeichnis) { User currentUser = Helper.getCurrentUser(); ArrayList<URI> files = new ArrayList<>(); FilenameFilter filter = new FileNameEndsWithFilter("]"); try { if (currentUser != null) { URI directoryName = serviceManager.getUserService().getHomeDirectory(currentUser).resolve(inVerzeichnis); files = fileService.getSubUris(filter, directoryName); } else { Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", Helper.getTranslation("noUser")); return files; } } catch (IOException ioe) { logger.error("Exception uploadFromHomeAlle()", ioe); Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", ioe.getMessage()); return files; } for (URI data : files) { String dataString = data.toString(); if (dataString.endsWith("/") || dataString.endsWith("\\")) { data = URI.create(dataString.substring(0, dataString.length() - 1)); } if (data.toString().contains("/")) { data = URI.create(dataString.substring(dataString.lastIndexOf("/"))); } } return files; }
Source:
private List<AccountInfo> suggestAccount(VisibilityControl visibilityControl) throws OrmException { if (!suggestAccounts) { return Collections.emptyList(); } final String a = query; final String b = a + MAX_SUFFIX; final LinkedHashMap<Account.Id, AccountInfo> r = new LinkedHashMap<Account.Id, AccountInfo>(); for (final Account p : dbProvider.get().accounts() .suggestByFullName(a, b, limit)) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } if (r.size() < limit) { for (final Account p : dbProvider.get().accounts() .suggestByPreferredEmail(a, b, limit - r.size())) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } } if (r.size() < limit) { for (final AccountExternalId e : dbProvider.get().accountExternalIds() .suggestByEmailAddress(a, b, limit - r.size())) { if (!r.containsKey(e.getAccountId())) { final Account p = accountCache.get(e.getAccountId()).getAccount(); final AccountInfo info = new AccountInfo(p.getId()); addSuggestion(r, p, info, visibilityControl); } } } return new ArrayList<AccountInfo>(r.values()); }

Target:
private List<AccountInfo> suggestAccount(VisibilityControl visibilityControl) throws OrmException { if (!suggestAccounts) { return Collections.emptyList(); } final String a = query; final String b = a + MAX_SUFFIX; final LinkedHashMap<Account.Id, AccountInfo> r = Maps.newLinkedHashMap(); for (final Account p : dbProvider.get().accounts() .suggestByFullName(a, b, limit)) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } if (r.size() < limit) { for (final Account p : dbProvider.get().accounts() .suggestByPreferredEmail(a, b, limit - r.size())) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } } if (r.size() < limit) { for (final AccountExternalId e : dbProvider.get().accountExternalIds() .suggestByEmailAddress(a, b, limit - r.size())) { if (!r.containsKey(e.getAccountId())) { final Account p = accountCache.get(e.getAccountId()).getAccount(); final AccountInfo info = new AccountInfo(p.getId()); addSuggestion(r, p, info, visibilityControl); } } } return new ArrayList<AccountInfo>(r.values()); }
Source:
public void setText(String input, WebElement element) { element.click(); element.clear(); element.sendKeys(input); element.sendKeys(Keys.ESCAPE); }

Target:
protected void setText(String input, WebElement element) { element.click(); element.clear(); element.sendKeys(input); element.sendKeys(Keys.ESCAPE); }
Source:
public static Collection<Descriptor> getSortedDescriptorsForGlobalConfigNoSecurity() { return getSortedDescriptorsForGlobalConfigUnclassified(); }

Target:
public static Collection<Descriptor> getSortedDescriptorsForGlobalConfigNoSecurity() { return getSortedDescriptorsForGlobalConfigByDescriptor(d -> GlobalSecurityConfiguration.FILTER.negate().test(d)); }
Source:
private long getLocalAvailableSpace() { Path path = Paths.get(outputDir.getAbsolutePath()); FileStore fs = java.nio.file.Files.getFileStore(path); return fs.getUsableSpace(); }

Target:
private long getLocalAvailableSpace() { val path = Paths.get(outputDir.getAbsolutePath()); val fs = java.nio.file.Files.getFileStore(path); return fs.getUsableSpace(); }
Source:
@Override protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int seq) { String str = super.getParameterName(op, param, seq); try { Method m = getMethod(op); MXBeanParametersNames namesAnn = m.getAnnotation(MXBeanParametersNames.class); if (namesAnn != null) { assert namesAnn.value() != null; assert seq < namesAnn.value().length; str = namesAnn.value()[seq]; assert str != null; assert !str.trim().isEmpty(); } else { MXBeanParameterInfo argumentInfoAnnotation = getMXBeanArgumentAnnotation(m, seq); if (argumentInfoAnnotation != null) { str = argumentInfoAnnotation.name(); assert str != null; assert !str.trim().isEmpty(); } } } catch (SecurityException | ClassNotFoundException ignored) { } return str; }

Target:
@Override protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int seq) { String str = super.getParameterName(op, param, seq); try { Method m = getMethod(op); MXBeanParametersNames namesAnn = m.getAnnotation(MXBeanParametersNames.class); if (namesAnn != null) { assert namesAnn.value() != null; assert seq < namesAnn.value().length; str = namesAnn.value()[seq]; assert str != null : NAME_MUST_BE_NOT_NULL + str; assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str; } else { MXBeanParameter argInfoAnnotation = getMXBeanArgumentAnnotation(m, seq); if (argInfoAnnotation != null) { str = argInfoAnnotation.name(); assert str != null : NAME_MUST_BE_NOT_NULL + str; assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str; } } } catch (SecurityException | ClassNotFoundException ignored) { } return str; }
Source:
public void setPatientProgram(PatientProgram patientProgram) { setOwner(new PatientProgram(patientProgram)); }

Target:
public void setPatientProgram(PatientProgram patientProgram) { setOwner(patientProgram); }
Source:
public String getEmitDateStr() { SimpleDateFormat sdf = new SimpleDateFormat(this.DATE_FORMAT, Locale.ITALY); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(this.getEmitDate()!=null ? this.getEmitDate(): new Date()); }

Target:
public String getEmitDateStr() { SimpleDateFormat sdf = new SimpleDateFormat(this.DATE_FORMAT, Locale.ROOT); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(this.getEmitDate()!=null ? this.getEmitDate(): new Date()); }
Source:
public void purge(Executor threadPool, final PurgeListener task) { ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(threadPool); Future<Void> future = eacs.submit(() -> { long now = timeService.wallClockTime(); List<KeyValuePair<Object, FileEntry>> entriesToPurge = new ArrayList<KeyValuePair<Object, FileEntry>>(); synchronized (entries) { for (Iterator<Map.Entry<K, FileEntry>> it = entries.entrySet().iterator(); it.hasNext(); ) { Map.Entry<K, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); entriesToPurge.add(new KeyValuePair<Object, FileEntry>(next.getKey(), fe)); } } } resizeLock.readLock().lock(); try { for (Iterator<KeyValuePair<Object, FileEntry>> it = entriesToPurge.iterator(); it.hasNext(); ) { KeyValuePair<Object, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); try { free(fe); } catch (Exception e) { throw new PersistenceException(e); } if (task != null) task.entryPurged(next.getKey()); } } synchronized (freeList) { processFreeEntries(); } } finally { resizeLock.readLock().unlock(); } return null; }); try { future.get(); } catch (InterruptedException e) { throw new PersistenceException(e); } catch (ExecutionException e) { throw new PersistenceException(e.getCause()); } }

Target:
public void purge(Executor threadPool, final PurgeListener task) { long now = timeService.wallClockTime(); List<KeyValuePair<Object, FileEntry>> entriesToPurge = new ArrayList<KeyValuePair<Object, FileEntry>>(); synchronized (entries) { for (Iterator<Map.Entry<K, FileEntry>> it = entries.entrySet().iterator(); it.hasNext(); ) { Map.Entry<K, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); entriesToPurge.add(new KeyValuePair<Object, FileEntry>(next.getKey(), fe)); } } } resizeLock.readLock().lock(); try { for (Iterator<KeyValuePair<Object, FileEntry>> it = entriesToPurge.iterator(); it.hasNext(); ) { KeyValuePair<Object, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); try { free(fe); } catch (Exception e) { throw new PersistenceException(e); } if (task != null) task.entryPurged(next.getKey()); } } synchronized (freeList) { processFreeEntries(); } } finally { resizeLock.readLock().unlock(); } }
Source:
private void commitTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); if (txn != null && (txn.getStatus() == ACTIVE || txn.getStatus() == MARKED_ROLLBACK)) { txn.commit(); } }

Target:
private void commitTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); if (txn != null && txn.getStatus().canRollback()) { txn.commit(); } }
Source:
public IDifferenceGroupProvider createGroupProvider() { Object instance; try { instance = element .createExecutableExtension(DifferenceGroupProviderExtensionRegistryListener.ATT_CLASS); if (instance instanceof IDifferenceGroupProvider) { IDifferenceGroupProvider groupProvider = (IDifferenceGroupProvider)instance; return groupProvider; } } catch (CoreException e) { Throwables.propagate(e); } return null; }

Target:
public IDifferenceGroupProvider createGroupProvider() { Object instance; try { instance = element .createExecutableExtension(DifferenceGroupProviderExtensionRegistryListener.ATT_CLASS); if (instance instanceof IDifferenceGroupProvider) { IDifferenceGroupProvider groupProvider = (IDifferenceGroupProvider)instance; return groupProvider; } } catch (CoreException e) { EMFCompareRCPUIPlugin.getDefault().log(e); } return null; }
Source:
public int tick() { long timeStart = System.currentTimeMillis(); final int sizeCap = 500; int numCubes = 0; for (int i = 0; i < this.activeStages; ++i) { numCubes += Math.min(sizeCap, this.stages.get(i).getProcessor().processor.getNumInQueue()); } for (int i = 0; i < this.activeStages; ++i) { if (numCubes <= 0) { this.stages.get(i).getProcessor().share = 0; } else { int size = Math.min(sizeCap, this.stages.get(i).getProcessor().processor.getNumInQueue()); this.stages.get(i).getProcessor().share = (float) size/(float) numCubes; } } int numProcessed = 0; for (int i = 0; i < this.activeStages; ++i) { StageProcessor processor = this.stages.get(i).getProcessor(); if (processor.share <= 0) { continue; } int numMsToProcess = (int) (Math.ceil(processor.share*TickBudget)); long stageTimeStart = System.currentTimeMillis(); int numStageProcessed = processor.processor.processQueueUntil(stageTimeStart + numMsToProcess); numProcessed += numStageProcessed; advanceCubes(processor.processor, i); } long timeDiff = System.currentTimeMillis() - timeStart; if (numProcessed > 0) { CubicChunks.LOGGER.debug("Processed cubes in ms.", numProcessed, timeDiff); for (int i = 0; i < this.activeStages; ++i) { CubicChunks.LOGGER.debug(this.stages.get(i).getProcessor().processor.getProcessingReport()); } } return numProcessed; }

Target:
public int tick() { long timeStart = System.currentTimeMillis(); final int sizeCap = 500; int numCubes = 0; for (GeneratorStage stage : this.stages) { numCubes += Math.min(sizeCap, stage.getProcessor().processor.getNumInQueue()); } for (GeneratorStage stage : this.stages) { if (numCubes <= 0) { stage.getProcessor().share = 0; } else { int size = Math.min(sizeCap, stage.getProcessor().processor.getNumInQueue()); stage.getProcessor().share = (float) size/(float) numCubes; } } int numProcessed = 0; for (GeneratorStage stage : this.stages) { StageProcessor processor = stage.getProcessor(); if (processor.share <= 0) { continue; } int numMsToProcess = (int) (Math.ceil(processor.share*TickBudget)); long stageTimeStart = System.currentTimeMillis(); int numStageProcessed = processor.processor.processQueueUntil(stageTimeStart + numMsToProcess); numProcessed += numStageProcessed; advanceCubes(processor.processor, stage); } long timeDiff = System.currentTimeMillis() - timeStart; if (numProcessed > 0) { CubicChunks.LOGGER.debug("Processed cubes in ms.", numProcessed, timeDiff); for (GeneratorStage stage : this.stages) { CubicChunks.LOGGER.debug(stage.getProcessor().processor.getProcessingReport()); } } return numProcessed; }
Source:
public boolean isConverged(int iteration, LongValue value) { if ( value.getValue() > 3 ) { return true; } else return false; }

Target:
public boolean isConverged(int iteration, LongValue value) { return value.getValue() > 3; }
Source:
public void afterSuite() throws IOException { System.out.println("afterSuite " + getClass().getName()); _lock.close(); super.afterSuite(); }

Target:
public void afterSuite() throws IOException { _lock.close(); super.afterSuite(); }
Source:
public MicroGauge(Gauge gauge) { this.gauge = gauge; }

Target:
MicroGauge(Gauge gauge) { this.gauge = gauge; }
Source:
void createV1ForwardIndexForTextIndex(String column, IndexLoadingConfig indexLoadingConfig) throws IOException { FieldSpec fieldSpec = _schema.getFieldSpecFor(column); Preconditions.checkNotNull(fieldSpec); checkUnsupportedOperationsForTextIndex(column, indexLoadingConfig, fieldSpec); int totalDocs = _segmentMetadata.getTotalDocs(); Object defaultValue = fieldSpec.getDefaultNullValue(); String stringDefaultValue = (String) defaultValue; int lengthOfLongestEntry = stringDefaultValue.getBytes(Charset.forName("UTF-8")).length; int dictionaryElementSize = 0; SingleValueVarByteRawIndexCreator rawIndexCreator = new SingleValueVarByteRawIndexCreator(_indexDir, ChunkCompressorFactory.CompressionType.SNAPPY, column, totalDocs, lengthOfLongestEntry); for (int docId = 0; docId < totalDocs; docId++) { rawIndexCreator.index(docId, defaultValue); } rawIndexCreator.close(); Object sortedArray = new String[]{(String) defaultValue}; DefaultColumnStatistics columnStatistics = new DefaultColumnStatistics(defaultValue , defaultValue , sortedArray, false, totalDocs, 0); ColumnIndexCreationInfo columnIndexCreationInfo = new ColumnIndexCreationInfo(columnStatistics, false , false, null, null, true , defaultValue ); SegmentColumnarIndexCreator .addColumnMetadataInfo(_segmentProperties, column, columnIndexCreationInfo, totalDocs, fieldSpec, false , dictionaryElementSize, false , TextIndexType.NONE); }

Target:
void createV1ForwardIndexForTextIndex(String column, IndexLoadingConfig indexLoadingConfig) throws IOException { FieldSpec fieldSpec = _schema.getFieldSpecFor(column); Preconditions.checkNotNull(fieldSpec); checkUnsupportedOperationsForTextIndex(column, indexLoadingConfig, fieldSpec); int totalDocs = _segmentMetadata.getTotalDocs(); Object defaultValue = fieldSpec.getDefaultNullValue(); String stringDefaultValue = (String) defaultValue; int lengthOfLongestEntry = StringUtil.encodeUtf8(stringDefaultValue).length; int dictionaryElementSize = 0; SingleValueVarByteRawIndexCreator rawIndexCreator = new SingleValueVarByteRawIndexCreator(_indexDir, ChunkCompressorFactory.CompressionType.SNAPPY, column, totalDocs, lengthOfLongestEntry); for (int docId = 0; docId < totalDocs; docId++) { rawIndexCreator.index(docId, defaultValue); } rawIndexCreator.close(); Object sortedArray = new String[]{(String) defaultValue}; DefaultColumnStatistics columnStatistics = new DefaultColumnStatistics(defaultValue , defaultValue , sortedArray, false, totalDocs, 0); ColumnIndexCreationInfo columnIndexCreationInfo = new ColumnIndexCreationInfo(columnStatistics, false , false, null, null, true , defaultValue ); SegmentColumnarIndexCreator .addColumnMetadataInfo(_segmentProperties, column, columnIndexCreationInfo, totalDocs, fieldSpec, false , dictionaryElementSize, false , TextIndexType.NONE); }
Source:
private boolean processDependentParameters( MasterReport report, Map<String, ParameterDefinitionEntry> reportParameter, ParameterContext parameterContext, DataRow parameterValues ) { try { final DesignTimeDataFactoryContext factoryContext = new DesignTimeDataFactoryContext( report ); final CompoundDataFactory cdf = CompoundDataFactory.normalize( report.getDataFactory() ); final CompoundDataFactory derive = (CompoundDataFactory) cdf.derive(); derive.initialize( factoryContext ); boolean anyDependencyProcessed = false; try { for ( final ParameterDefinitionEntry entry : reportParameter.values() ) { final List<String> dependentParameter = computeNormalLineage( parameterContext, entry ); final List<String> queryDependencies = computeListParameterLineage( derive, entry, parameterValues ); if ( queryDependencies == null ) { dependencyInformationAvailable = false; continue; } if ( dependentParameter != null && dependentParameter.size() > 0 ) { dependentParameter.forEach( p -> addDependency( p, entry.getName() ) ); anyDependencyProcessed = true; } if ( queryDependencies != null && queryDependencies.size() > 0 ) { queryDependencies.forEach( p -> addDependency( p, entry.getName() ) ); anyDependencyProcessed = true; } } } finally { derive.close(); } return anyDependencyProcessed; } catch ( ReportDataFactoryException re ) { DebugLog.log( "Failed to compute dependency information", re ); return false; } }

Target:
private boolean processDependentParameters( MasterReport report, Map<String, ParameterDefinitionEntry> reportParameter, ParameterContext parameterContext, DataRow parameterValues ) { boolean isDependencyInfoAvail = true; try { final DesignTimeDataFactoryContext factoryContext = new DesignTimeDataFactoryContext( report ); final CompoundDataFactory cdf = CompoundDataFactory.normalize( report.getDataFactory() ); final CompoundDataFactory derive = (CompoundDataFactory) cdf.derive(); derive.initialize( factoryContext ); try { for ( final ParameterDefinitionEntry entry : reportParameter.values() ) { final List<String> dependentParameter = computeNormalLineage( parameterContext, entry ); final List<String> queryDependencies = computeListParameterLineage( derive, entry, parameterValues ); if ( queryDependencies == null ) { isDependencyInfoAvail = false; continue; } if ( dependentParameter != null && dependentParameter.size() > 0 ) { dependentParameter.forEach( p -> addDependency( p, entry.getName() ) ); } if ( queryDependencies != null && queryDependencies.size() > 0 ) { queryDependencies.forEach( p -> addDependency( p, entry.getName() ) ); } } } finally { derive.close(); } } catch ( ReportDataFactoryException re ) { DebugLog.log( "Failed to compute dependency information", re ); isDependencyInfoAvail = false; } return isDependencyInfoAvail; }
Source:
public CurrencyValuesArray convertedTo(Currency reportingCurrency, CalculationMarketData marketData) { if (currency.equals(reportingCurrency)) { return this; } MarketDataBox<FxRate> rates = marketData.getValue(FxRateKey.of(currency, reportingCurrency)); checkNumberOfRates(rates.getScenarioCount()); double[] convertedValues = IntStream.range(0, values.size()) .mapToDouble(i -> rates.getValue(i).convert(values.get(i), currency, reportingCurrency)) .toArray(); return new CurrencyValuesArray(reportingCurrency, DoubleArray.ofUnsafe(convertedValues)); }

Target:
public CurrencyValuesArray convertedTo(Currency reportingCurrency, CalculationMarketData marketData) { if (currency.equals(reportingCurrency)) { return this; } MarketDataBox<FxRate> rates = marketData.getValue(FxRateKey.of(currency, reportingCurrency)); checkNumberOfRates(rates.getScenarioCount()); DoubleArray convertedValues = values.mapWithIndex((i, v) -> rates.getValue(i).convert(v, currency, reportingCurrency)); return new CurrencyValuesArray(reportingCurrency, convertedValues); }