auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Builder cidrBlocks(Iterable<String> cidrBlocks) { Iterables.addAll(this.cidrBlocks, transform(cidrBlocks, new Function<String, String>() { @Override public String apply(String input) { checkArgument(isCidrFormat(input), "input %s is not a valid CIDR", input); return input; } })); return this; }

Target:
public Builder cidrBlocks(Iterable<String> cidrBlocks) { for (String cidrBlock : cidrBlocks) { checkArgument(isCidrFormat(cidrBlock), "%s is not a valid CIDR", cidrBlock); } Iterables.addAll(this.cidrBlocks, cidrBlocks); return this; }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; WorkspaceProjectContextChangeEvent other = (WorkspaceProjectContextChangeEvent) obj; if (module == null) { if (other.module != null) return false; } else if (!module.equals(other.module)) return false; if (ou == null) { if (other.ou != null) return false; } else if (!ou.equals(other.ou)) return false; if (pkg == null) { if (other.pkg != null) return false; } else if (!pkg.equals(other.pkg)) return false; if (workspaceProject == null) { if (other.workspaceProject != null) return false; } else if (!workspaceProject.equals(other.workspaceProject)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } else if (obj == null || getClass() != obj.getClass()) { return false; } else { WorkspaceProjectContextChangeEvent other = (WorkspaceProjectContextChangeEvent) obj; return Objects.equals(module, other.module) && Objects.equals(ou, other.ou) && Objects.equals(pkg, other.pkg) && Objects.equals(workspaceProject, other.workspaceProject); } }
Source:
public <T> T create(final Class<T> service) { Utils.validateServiceInterface(service); if (validateEagerly) { eagerlyValidateMethods(service); } return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service }, new InvocationHandler() { private final Platform platform = Platform.get(); @Override public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } if (platform.isDefaultMethod(method)) { return platform.invokeDefaultMethod(method, service, proxy, args); } List<Object> argsList = args != null ? Arrays.asList(args) : Collections.emptyList(); Invocation invocation = new Invocation(method, argsList); return loadServiceMethod(method).invoke(invocation); } }); }

Target:
public <T> T create(final Class<T> service) { Utils.validateServiceInterface(service); if (validateEagerly) { eagerlyValidateMethods(service); } return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service }, new InvocationHandler() { private final Platform platform = Platform.get(); private final Object[] emptyArgs = new Object[0]; @Override public Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable { if (method.getDeclaringClass() == Object.class) { return method.invoke(this, args); } if (platform.isDefaultMethod(method)) { return platform.invokeDefaultMethod(method, service, proxy, args); } return loadServiceMethod(method).invoke(args != null ? args : emptyArgs); } }); }
Source:
public static Network getNetworkByVnicProfileId(Guid vnicProfileId) { if (vnicProfileId == null) { return null; } VnicProfile vnicProfile = DbFacade.getInstance().getVnicProfileDao().get(vnicProfileId); return getNetworkByVnicProfile(vnicProfile); }

Target:
public static Network getNetworkByVnicProfileId(Guid vnicProfileId) { VnicProfile vnicProfile = getVnicProfile(vnicProfileId); return getNetworkByVnicProfile(vnicProfile); }
Source:
private boolean isJsonEnabled(HttpServletRequest request) { return "true".equals(request.getParameter(JSONValidationInterceptor.VALIDATE_JSON_PARAM)); }

Target:
protected boolean isJsonEnabled(HttpServletRequest request) { return "true".equals(request.getParameter(JSONValidationInterceptor.VALIDATE_JSON_PARAM)); }
Source:
private ICompletableFuture<SyntheticRequest> invoke(int partitionId) throws Exception { ICompletableFuture<SyntheticRequest> future; if (isClient) { SyntheticRequest request = new SyntheticRequest(syncBackupCount, asyncBackupCount, backupDelayNanos, null); request.setPartitionId(partitionId); Address target = clientPartitionService.getPartitionOwner(partitionId); future = clientInvocationService.invokeOnTarget(request, target); } else { SyntheticOperation operation = new SyntheticOperation(syncBackupCount, asyncBackupCount, getBackupDelayNanos()); future = operationService.invokeOnPartition(null, operation, partitionId); } return future; }

Target:
private ICompletableFuture<Object> invoke(int partitionId) throws Exception { ICompletableFuture<Object> future; if (isClient) { SyntheticRequest request = new SyntheticRequest(syncBackupCount, asyncBackupCount, backupDelayNanos, null); request.setPartitionId(partitionId); Address target = clientPartitionService.getPartitionOwner(partitionId); future = clientInvocationService.invokeOnTarget(request, target); } else { SyntheticOperation operation = new SyntheticOperation(syncBackupCount, asyncBackupCount, getBackupDelayNanos()); future = operationService.invokeOnPartition(serviceName, operation, partitionId); } return future; }
Source:
public void stop(ComponentContext context) throws InterruptedException { super.stop(context); providers.values().forEach(KeyValueStoreProvider::close); }

Target:
public void stop(ComponentContext context) throws InterruptedException { providers.values().forEach(KeyValueStoreProvider::close); super.stop(context); }
Source:
public void testUpdateTableColumnStatisticsEmptyOptionalFields() throws Exception { SchemaTableName tableName = temporaryTable("update_table_column_statistics_empty_optional_fields"); ExtendedHiveMetastore metastoreClient = getMetastoreClient(tableName.getSchemaName()); if (!metastoreClient.supportsColumnStatistics()) { return; } try { doCreateEmptyTable(tableName, ORC, STATISTICS_TABLE_COLUMNS); metastoreClient.updateTableStatistics( tableName.getSchemaName(), tableName.getTableName(), currentStatistics -> STATISTICS_EMPTY_OPTIONAL_FIELDS); assertThat(metastoreClient.getTableStatistics(tableName.getSchemaName(), tableName.getTableName())) .isEqualTo(STATISTICS_EMPTY_OPTIONAL_FIELDS); } finally { dropTable(tableName); } }

Target:
public void testUpdateTableColumnStatisticsEmptyOptionalFields() throws Exception { SchemaTableName tableName = temporaryTable("update_table_column_statistics_empty_optional_fields"); try { doCreateEmptyTable(tableName, ORC, STATISTICS_TABLE_COLUMNS); ExtendedHiveMetastore metastoreClient = getMetastoreClient(tableName.getSchemaName()); assertThat(metastoreClient.supportsColumnStatistics()).isTrue(); metastoreClient.updateTableStatistics( tableName.getSchemaName(), tableName.getTableName(), currentStatistics -> STATISTICS_EMPTY_OPTIONAL_FIELDS); assertThat(metastoreClient.getTableStatistics(tableName.getSchemaName(), tableName.getTableName())) .isEqualTo(STATISTICS_EMPTY_OPTIONAL_FIELDS); } finally { dropTable(tableName); } }
Source:
public void printTableInfo(String namespace, String tablename) { log.info("\n======================\n"); String fullName = TableRegistry.getFullyQualifiedTableName(namespace, tablename); UUID streamUUID = UUID.nameUUIDFromBytes(fullName.getBytes()); CorfuTable<CorfuDynamicKey, CorfuDynamicRecord> table = getTable(namespace, tablename); log.info("Table " + tablename + " in namespace " + namespace + " with ID " + streamUUID.toString() + " has " + table.size() + " entries"); log.info("\n======================\n"); }

Target:
public void printTableInfo(String namespace, String tablename) { log.info("\n======================\n"); String fullName = TableRegistry.getFullyQualifiedTableName(namespace, tablename); UUID streamUUID = UUID.nameUUIDFromBytes(fullName.getBytes()); CorfuTable<CorfuDynamicKey, CorfuDynamicRecord> table = getTable(namespace, tablename); log.info("Table in namespace with ID has entries", table, namespace, streamUUID.toString(), table.size()); log.info("\n======================\n"); }
Source:
private boolean assignAuthorsForAffiliation(Affiliation currentAffiliation, int currentAffiliationPosition) throws SAXException { boolean atLeasOneAuthorAssigned = false; if (hasAmongParents(parents, ELEM_CONTRIBUTOR)) { currentAuthor.getAffiliationPos().add(currentAffiliationPosition); atLeasOneAuthorAssigned = true; } else if (hasAmongParents(parents, ELEM_CONTRIBUTOR_GROUP)) { for (PmcIngestAuthor author : currentAuthorsGroup) { author.getAffiliationPos().add(currentAffiliationPosition); atLeasOneAuthorAssigned = true; } } else if (currentAffiliationId != null) { for (PmcIngestAuthor author : currentAuthors) { for (String affRefId : author.getAffiliationRefId()) { if (StringUtils.equals(currentAffiliationId, affRefId)) { author.getAffiliationPos().add(currentAffiliationPosition); atLeasOneAuthorAssigned = true; } } } } else { throw new SAXException("unable to connect affiliation with corresponding authors (" + currentAffiliation + ")"); } return atLeasOneAuthorAssigned; }

Target:
private boolean assignAuthorsForAffiliation(Affiliation currentAffiliation, int currentAffiliationPosition) throws SAXException { boolean atLeastOneAuthorAssigned = false; if (hasAmongParents(parents, ELEM_CONTRIBUTOR)) { currentAuthor.getAffiliationPos().add(currentAffiliationPosition); atLeastOneAuthorAssigned = true; } else if (hasAmongParents(parents, ELEM_CONTRIBUTOR_GROUP)) { for (JatsAuthor author : currentAuthorsGroup) { author.getAffiliationPos().add(currentAffiliationPosition); atLeastOneAuthorAssigned = true; } } else if (currentAffiliationId != null) { for (JatsAuthor author : currentAuthors) { for (String affRefId : author.getAffiliationRefId()) { if (StringUtils.equals(currentAffiliationId, affRefId)) { author.getAffiliationPos().add(currentAffiliationPosition); atLeastOneAuthorAssigned = true; } } } } else { throw new SAXException("unable to connect affiliation with corresponding authors (" + currentAffiliation + ")"); } return atLeastOneAuthorAssigned; }
Source:
private void addEndpoint(Endpoint ep) { logger.debug("addEndpoint({}->{})", PanStampConversions.toString(ep)); ep.addListener(endpointListener); }

Target:
private void addEndpoint(Endpoint ep) { logger.debug("addEndpoint({})", PanStampConversions.toString(ep)); ep.addListener(endpointListener); }
Source:
public Response removeLinkedAccount(@PathParam("providerId") String providerId) { String errorMessage = checkCommonPreconditions(providerId); if (errorMessage != null) { return ErrorResponse.error(errorMessage, Response.Status.BAD_REQUEST); } FederatedIdentityModel link = session.users().getFederatedIdentity(user, providerId, realm); if (link == null) { return ErrorResponse.error(Messages.FEDERATED_IDENTITY_NOT_ACTIVE, Response.Status.BAD_REQUEST); } if (!(session.users().getFederatedIdentities(user, realm).size() > 1 || user.getFederationLink() != null || isPasswordSet())) { return ErrorResponse.error(Messages.FEDERATED_IDENTITY_REMOVING_LAST_PROVIDER, Response.Status.BAD_REQUEST); } session.users().removeFederatedIdentity(realm, user, providerId); logger.debugv("Social provider {0} removed successfully from user {1}", providerId, user.getUsername()); event.event(EventType.REMOVE_FEDERATED_IDENTITY).client(auth.getClient()).user(auth.getUser()) .detail(Details.USERNAME, auth.getUser().getUsername()) .detail(Details.IDENTITY_PROVIDER, link.getIdentityProvider()) .detail(Details.IDENTITY_PROVIDER_USERNAME, link.getUserName()) .success(); return Cors.add(request, Response.ok()).auth().allowedOrigins(auth.getToken()).build(); }

Target:
public Response removeLinkedAccount(@PathParam("providerId") String providerId) { auth.require(AccountRoles.MANAGE_ACCOUNT); String errorMessage = checkCommonPreconditions(providerId); if (errorMessage != null) { return ErrorResponse.error(errorMessage, Response.Status.BAD_REQUEST); } FederatedIdentityModel link = session.users().getFederatedIdentity(user, providerId, realm); if (link == null) { return ErrorResponse.error(Messages.FEDERATED_IDENTITY_NOT_ACTIVE, Response.Status.BAD_REQUEST); } if (!(session.users().getFederatedIdentities(user, realm).size() > 1 || user.getFederationLink() != null || isPasswordSet())) { return ErrorResponse.error(Messages.FEDERATED_IDENTITY_REMOVING_LAST_PROVIDER, Response.Status.BAD_REQUEST); } session.users().removeFederatedIdentity(realm, user, providerId); logger.debugv("Social provider {0} removed successfully from user {1}", providerId, user.getUsername()); event.event(EventType.REMOVE_FEDERATED_IDENTITY).client(auth.getClient()).user(auth.getUser()) .detail(Details.USERNAME, auth.getUser().getUsername()) .detail(Details.IDENTITY_PROVIDER, link.getIdentityProvider()) .detail(Details.IDENTITY_PROVIDER_USERNAME, link.getUserName()) .success(); return Cors.add(request, Response.ok()).auth().allowedOrigins(auth.getToken()).build(); }
Source:
public void nullProxyConfiguration() { Assert.assertTrue(SYSTEM_DEFAULTS.authentication() == null); Assert.assertTrue(SYSTEM_DEFAULTS.credential() == null); Assert.assertTrue(SYSTEM_DEFAULTS.proxyAddress() == null); }

Target:
public void nullProxyConfiguration() { Assert.assertNull(SYSTEM_DEFAULTS.authentication()); Assert.assertNull(SYSTEM_DEFAULTS.credential()); Assert.assertNull(SYSTEM_DEFAULTS.proxyAddress()); }
Source:
public List<VmNumaNode> getVmNumaNodes(VM vm) { int numOfVmCpus = vm.getNumOfCpus(); int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : numOfVmCpus; int offlineCpus = vcpus - numOfVmCpus; List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { if (offlineCpus > 0) { int numaCount = vmNumaNodes.size(); int index = numOfVmCpus; for (VmNumaNode vmNode : vmNumaNodes) { if (numaCount <= 0) { break; } for (int i = vmNode.getCpuIds().size(); i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(index++); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (offlineCpus > 0) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }

Target:
public List<VmNumaNode> getVmNumaNodes(VM vm) { int onlineCpus = vm.getNumOfCpus(); int vcpus = FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, vm.getCompatibilityVersion(), vm.getClusterArch()) ? VmCpuCountHelper.calcMaxVCpu(vm, vm.getClusterCompatibilityVersion()) : onlineCpus; int offlineCpus = vcpus - onlineCpus; List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); if (!vmNumaNodes.isEmpty()) { if (offlineCpus > 0) { int numaCount = vmNumaNodes.size(); int index = onlineCpus; for (VmNumaNode vmNode : vmNumaNodes) { if (numaCount <= 0) { break; } for (int i = vmNode.getCpuIds().size(); i < vcpus / numaCount; i++) { vmNode.getCpuIds().add(index++); } vcpus -= vcpus / numaCount; --numaCount; } } return vmNumaNodes; } if (offlineCpus > 0) { VmNumaNode vmNode = new VmNumaNode(); vmNode.setIndex(0); vmNode.setMemTotal(vm.getMemSizeMb()); for (int i = 0; i < vcpus; i++) { vmNode.getCpuIds().add(i); } return Collections.singletonList(vmNode); } return Collections.emptyList(); }
Source:
public void beforeLoadGame() { String fileName = "world.ini"; if (SaveManager.resourceExists(fileName)) { IniReader ir = new IniReader(fileName, null); long seed = Long.parseLong(ir.getString("seed", "0")); logger.info("Got seed: " + String.valueOf(seed)); SolRandom.setSeed(seed); } }

Target:
private void beforeLoadGame() { if (SaveManager.resourceExists(WORLD_SAVE_FILE_NAME)) { IniReader iniReader = new IniReader(WORLD_SAVE_FILE_NAME, null); long seed = Long.parseLong(iniReader.getString("seed", "0")); logger.info("Got seed: " + String.valueOf(seed)); SolRandom.setSeed(seed); } }
Source:
private Measure(MeasureDto measureDto) { this.value = measureDto.getValue(); this.data = measureDto.getData(); this.variation = measureDto.getVariation(); }

Target:
private Measure(MeasureDto measureDto) { this.value = toPrimitive(measureDto.getValue()); this.data = measureDto.getData(); this.variation = toPrimitive(measureDto.getVariation()); }
Source:
private void UpdateVmNetworks() { if (!Objects.equals(getVm().getVdsGroupId(), getParameters().getVmStaticData().getVdsGroupId())) { List<Network> networks = getNetworkDao().getAllForCluster(getParameters().getVmStaticData().getVdsGroupId()); List<VmNic> interfaces = getVmNicDao().getAllForVm(getParameters().getVmStaticData().getId()); for (final VmNic iface : interfaces) { final Network network = NetworkHelper.getNetworkByVnicProfileId(iface.getVnicProfileId()); boolean networkFound = networks.stream().allMatch(n -> ObjectUtils.equals(n.getId(), network.getId())); if (!networkFound) { iface.setVnicProfileId(null); getVmNicDao().update(iface); } } } }

Target:
private void UpdateVmNetworks() { if (!Objects.equals(getVm().getVdsGroupId(), getParameters().getVmStaticData().getVdsGroupId())) { List<Network> networks = getNetworkDao().getAllForCluster(getParameters().getVmStaticData().getVdsGroupId()); List<VmNic> interfaces = getVmNicDao().getAllForVm(getParameters().getVmStaticData().getId()); for (final VmNic iface : interfaces) { final Network network = NetworkHelper.getNetworkByVnicProfileId(iface.getVnicProfileId()); boolean networkFound = networks.stream().anyMatch(n -> ObjectUtils.equals(n.getId(), network.getId())); if (!networkFound) { iface.setVnicProfileId(null); getVmNicDao().update(iface); } } } }
Source:
protected Map<Guid, Guid> addAllTemplateDisks() { CreateAllTemplateDisksParameters parameters = new CreateAllTemplateDisksParameters(getVm() != null ? getVmId() : Guid.Empty); parameters.setVmTemplateId(getVmTemplateId()); parameters.setVmTemplateName(getVmTemplateName()); parameters.setDiskInfoDestinationMap(diskInfoDestinationMap); parameters.setTargetDiskIds(targetDiskIds); parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); VdcReturnValueBase returnValue = runInternalAction( getAddAllTemplateDisksActionType(), parameters, ExecutionHandler.createDefaultContextForTasks(getContext())); if (!returnValue.getSucceeded()) { throw new EngineException(returnValue.getFault().getError(), returnValue.getFault().getMessage()); } return returnValue.getActionReturnValue(); }

Target:
protected Map<Guid, Guid> addAllTemplateDisks() { VdcReturnValueBase returnValue = runInternalAction( getAddAllTemplateDisksActionType(), buildCreateAllTemplateDisksParameters(), ExecutionHandler.createDefaultContextForTasks(getContext())); if (!returnValue.getSucceeded()) { throw new EngineException(returnValue.getFault().getError(), returnValue.getFault().getMessage()); } return returnValue.getActionReturnValue(); }
Source:
public void propertyChange(PropertyChangeEvent event) { if (event.getOldValue() != event.getNewValue()) { if (event.getPropertyName().equals(RenderingConfig.REFLECTIVE_WATER)) { requiresCondition(() -> renderingConfig.isReflectiveWater()); } else if (event.getPropertyName().equals(RenderingConfig.NORMAL_MAPPING)) { isNormalMapping = renderingConfig.isNormalMapping(); if (isNormalMapping) { addDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } } else { removeDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { removeDesiredStateChange(setHeightTerrain); } } } else { isParallaxMapping = renderingConfig.isParallaxMapping(); if (isNormalMapping) { if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } else { removeDesiredStateChange(setHeightTerrain); } } } worldRenderer.requestTaskListRefresh(); } }

Target:
public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(RenderingConfig.REFLECTIVE_WATER)) { requiresCondition(() -> renderingConfig.isReflectiveWater()); } else if (event.getPropertyName().equals(RenderingConfig.NORMAL_MAPPING)) { isNormalMapping = renderingConfig.isNormalMapping(); if (isNormalMapping) { addDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } } else { removeDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { removeDesiredStateChange(setHeightTerrain); } } } else if (event.getPropertyName().equals(RenderingConfig.PARALLAX_MAPPING)) { isParallaxMapping = renderingConfig.isParallaxMapping(); if (isNormalMapping) { if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } else { removeDesiredStateChange(setHeightTerrain); } } } worldRenderer.requestTaskListRefresh(); }
Source:
public Guid getId() { return clusterId; }

Target:
public Guid getId() { return id; }
Source:
public WebAppMonitor waitForAtLeastOneAttempt() { return waitForAtLeastOneAttempt(Duration.of(30, TimeUnit.SECONDS)); }

Target:
public WebAppMonitor waitForAtLeastOneAttempt() { return waitForAtLeastOneAttempt(Asserts.DEFAULT_TIMEOUT); }
Source:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); ensureValuesCapacity(); makeInnerQualifyingSet(); QualifyingSet input = hasNulls ? innerQualifyingSet : inputQualifyingSet; if (input.getPositionCount() > 0) { resultsProcessor.reset(); if (filter != null) { int numInput = input.getPositionCount(); outputQualifyingSet.reset(numInput); resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); outputQualifyingSet.setPositionCount(numInnerResults); } else { resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, input.getPositionCount(), input.getEnd(), resultsProcessor); } } if (hasNulls) { innerPosInRowGroup = innerQualifyingSet.getEnd(); } addNullsAfterScan(filter != null ? outputQualifyingSet : inputQualifyingSet, inputQualifyingSet.getEnd()); if (filter != null) { outputQualifyingSet.setEnd(inputQualifyingSet.getEnd()); } endScan(presentStream); }

Target:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); ensureValuesCapacity(); makeInnerQualifyingSet(); QualifyingSet input = hasNulls ? innerQualifyingSet : inputQualifyingSet; if (input.getPositionCount() > 0) { if (filter != null) { int numInput = input.getPositionCount(); outputQualifyingSet.reset(numInput); resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); outputQualifyingSet.setPositionCount(numInnerResults); } else { resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, input.getPositionCount(), input.getEnd(), resultsProcessor); } } if (hasNulls) { innerPosInRowGroup = innerQualifyingSet.getEnd(); } addNullsAfterScan(filter != null ? outputQualifyingSet : inputQualifyingSet, inputQualifyingSet.getEnd()); if (filter != null) { outputQualifyingSet.setEnd(inputQualifyingSet.getEnd()); } endScan(presentStream); }
Source:
public void shouldUpgradeLiquibase() { try { upgradeTestUtil.upgrade("liquibase-master.xml"); } catch (Exception e) { e.printStackTrace(); Assert.fail(); } }

Target:
public void shouldUpgradeLiquibase() throws IOException, SQLException { upgradeTestUtil.upgrade("liquibase-master.xml"); }
Source:
public <K> void setTimer(K key, long timestamp, ScheduledCallback<K> callback) { if (scheduledFutures.containsKey(key)) { LOG.warn("Registering duplicate callback for key: {}. Attempting to cancel the previous callback", key); ScheduledFuture<?> scheduledFuture = scheduledFutures.get(key); if (scheduledFuture != null && !scheduledFuture.cancel(false) && !scheduledFuture.isDone()) { LOG.debug("Failed to cancel the previous callback successfully. Ignoring the current request to register new callback"); return; } } final long delay = timestamp - System.currentTimeMillis(); final ScheduledFuture<?> scheduledFuture = executor.schedule(() -> { scheduledFutures.remove(key); readyTimers.put(TimerKey.of(key, timestamp), callback); if (timerListener != null) { timerListener.onTimer(); } }, delay > 0 ? delay : 0, TimeUnit.MILLISECONDS); scheduledFutures.put(key, scheduledFuture); }

Target:
public <K> void setTimer(K key, long timestamp, ScheduledCallback<K> callback) { if (scheduledFutures.containsKey(key)) { LOG.warn("Registering duplicate callback for key: {}. Attempting to cancel the previous callback", key); ScheduledFuture<?> scheduledFuture = scheduledFutures.get(key); if (scheduledFuture != null && !scheduledFuture.cancel(false) && !scheduledFuture.isDone()) { LOG.warn("Failed to cancel the previous callback successfully. Ignoring the current request to register new callback"); return; } } final long delay = timestamp - System.currentTimeMillis(); final ScheduledFuture<?> scheduledFuture = executor.schedule(() -> { scheduledFutures.remove(key); readyTimers.put(TimerKey.of(key, timestamp), callback); if (timerListener != null) { timerListener.onTimer(); } }, delay > 0 ? delay : 0, TimeUnit.MILLISECONDS); scheduledFutures.put(key, scheduledFuture); }
Source:
public void setUp() { assertTrue(CtfTmfTestTrace.SYNC_SRC.exists()); assertTrue(CtfTmfTestTrace.SYNC_DEST.exists()); CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace(); fTraces = new CtfTmfTrace[2]; fTraces[0] = trace1; fTraces[1] = trace2; fExperiment = new TmfExperiment(trace1.getEventType(), EXPERIMENT, fTraces, BLOCK_SIZE); TmfEventMatching.registerMatchObject(new TcpEventMatching()); TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); }

Target:
public void setUp() { assumeTrue(CtfTmfTestTrace.SYNC_SRC.exists()); assumeTrue(CtfTmfTestTrace.SYNC_DEST.exists()); CtfTmfTrace trace1 = CtfTmfTestTrace.SYNC_SRC.getTrace(); CtfTmfTrace trace2 = CtfTmfTestTrace.SYNC_DEST.getTrace(); fTraces = new CtfTmfTrace[2]; fTraces[0] = trace1; fTraces[1] = trace2; fExperiment = new TmfExperiment(trace1.getEventType(), EXPERIMENT, fTraces, BLOCK_SIZE); TmfEventMatching.registerMatchObject(new TcpEventMatching()); TmfEventMatching.registerMatchObject(new TcpLttngEventMatching()); }
Source:
public URL getURL(String protocol) { try { URL url = new URL(protocol, getAddress(), getPort(),""); return url; } catch (MalformedURLException e) { logger.error("Telemetry server URL mal formed", e); return null; } }

Target:
public Optional<URL> getURL(String protocol) { Optional<URL> optional; try { URL url = new URL(protocol, getAddress(), getPort(), ""); optional = Optional.of(url); } catch (MalformedURLException e) { logger.error("Telemetry server URL mal formed", e); optional = Optional.ofNullable(null); } return optional; }
Source:
@Override public Color getColor() { if (this.shadedColor == null) { this.shadedColor = shadeColor(((net.minecraft.block.material.MapColor)baseColor).colorValue, shade); } return this.shadedColor; }

Target:
public Color getColor() { if (this.shadedColor == null) { this.shadedColor = shadeColor(((net.minecraft.block.material.MapColor) baseColor).colorValue, shade); } return this.shadedColor; }
Source:
public ScriptEngineContainer createScriptEngine(String fileExtension, String scriptIdentifier) { ScriptEngineContainer result = null; ScriptEngineProvider engineProvider = findProvider(fileExtension); if (engineProvider == null) { logger.error("loadScript(): scriptengine for language '{}' could not be found for identifier: {}", fileExtension, scriptIdentifier); } else { try { ScriptEngine engine = engineProvider.createScriptEngine(fileExtension); HashMap<String, Object> scriptExManager = new HashMap<>(); result = new ScriptEngineContainer(engine, engineProvider, scriptIdentifier); scriptExManager.put("ScriptExtension", new ScriptExtensionManagerWrapper(result, scriptExtensionManager)); engineProvider.scopeValues(engine, scriptExManager); scriptExtensionManager.importDefaultPresets(engineProvider, engine, scriptIdentifier); loadedScriptEngineInstances.put(scriptIdentifier, result); } catch (Exception ex) { logger.error("Error while creating ScriptEngine", ex); removeScriptExtensions(scriptIdentifier); } } return result; }

Target:
public ScriptEngineContainer createScriptEngine(String fileExtension, String scriptIdentifier) { ScriptEngineContainer result = null; ScriptEngineFactory engineProvider = findEngineFactory(fileExtension); if (engineProvider == null) { logger.error("loadScript(): scriptengine for language '{}' could not be found for identifier: {}", fileExtension, scriptIdentifier); } else { try { ScriptEngine engine = engineProvider.createScriptEngine(fileExtension); HashMap<String, Object> scriptExManager = new HashMap<>(); result = new ScriptEngineContainer(engine, engineProvider, scriptIdentifier); ScriptExtensionManagerWrapper wrapper = new ScriptExtensionManagerWrapper(result); scriptExManager.put("scriptExtension", wrapper); scriptExManager.put("se", wrapper); engineProvider.scopeValues(engine, scriptExManager); ScriptExtensionManager.importDefaultPresets(engineProvider, engine, scriptIdentifier); loadedScriptEngineInstances.put(scriptIdentifier, result); } catch (Exception ex) { logger.error("Error while creating ScriptEngine", ex); removeScriptExtensions(scriptIdentifier); } } return result; }
Source:
public void testJSMetaData() { String replyTo = "$JS.ACK.test-stream.test-consumer.1.2.3.1605139610113260000"; Message msg = new NatsMessage.IncomingBuilder("sid", "subj", replyTo, 0).getMessage(); assertTrue(msg.isJetStream()); MessageMetaData jsmd = msg.metaData(); assertNotNull(jsmd); assertEquals("test-stream", jsmd.getStream()); assertEquals("test-consumer", jsmd.getConsumer()); assertEquals(1, jsmd.deliveredCount()); assertEquals(2, jsmd.streamSequence()); assertEquals(3, jsmd.consumerSequence()); assertEquals(2020, jsmd.timestamp().getYear()); assertEquals(6, jsmd.timestamp().getMinute()); assertEquals(113260000, jsmd.timestamp().getNano()); }

Target:
public void testJSMetaData() { String replyTo = "$JS.ACK.test-stream.test-consumer.1.2.3.1605139610113260000"; Message msg = new IncomingMessageFactory("sid", "subj", replyTo, 0, false).getMessage(); assertTrue(msg.isJetStream()); MessageMetaData jsmd = msg.metaData(); assertNotNull(jsmd); assertEquals("test-stream", jsmd.getStream()); assertEquals("test-consumer", jsmd.getConsumer()); assertEquals(1, jsmd.deliveredCount()); assertEquals(2, jsmd.streamSequence()); assertEquals(3, jsmd.consumerSequence()); assertEquals(2020, jsmd.timestamp().getYear()); assertEquals(6, jsmd.timestamp().getMinute()); assertEquals(113260000, jsmd.timestamp().getNano()); }
Source:
public static Map<String, Object> getLaunchConfigDataAsMap(Service service, String launchConfigName) { if (launchConfigName == null) { launchConfigName = ServiceConstants.PRIMARY_LAUNCH_CONFIG_NAME; } Map<String, Object> launchConfigData = new HashMap<>(); if (launchConfigName.equalsIgnoreCase(ServiceConstants.PRIMARY_LAUNCH_CONFIG_NAME)) { launchConfigData = DataAccessor.fields(service) .withKey(ServiceConstants.FIELD_LAUNCH_CONFIG).withDefault(Collections.EMPTY_MAP) .as(Map.class); for (String key: launchConfigData.keySet()) { if (launchConfigData.get(key) == null) { launchConfigData.remove(key); } } } else { List<Map<String, Object>> secondaryLaunchConfigs = DataAccessor.fields(service) .withKey(ServiceConstants.FIELD_SECONDARY_LAUNCH_CONFIGS) .withDefault(Collections.EMPTY_LIST).as( List.class); for (Map<String, Object> secondaryLaunchConfig : secondaryLaunchConfigs) { if (secondaryLaunchConfig.get("name").toString().equalsIgnoreCase(launchConfigName)) { launchConfigData = secondaryLaunchConfig; break; } } } Map<String, Object> data = new HashMap<>(); data.putAll(launchConfigData); Object labels = data.get(ServiceDiscoveryConfigItem.LABELS.getCattleName()); if (labels != null) { Map<String, String> labelsMap = new HashMap<String, String>(); labelsMap.putAll((Map<String, String>) labels); data.put(ServiceDiscoveryConfigItem.LABELS.getCattleName(), labelsMap); } return data; }

Target:
public static Map<String, Object> getLaunchConfigDataAsMap(Service service, String launchConfigName) { if (launchConfigName == null) { launchConfigName = ServiceConstants.PRIMARY_LAUNCH_CONFIG_NAME; } Map<String, Object> launchConfigData = new HashMap<>(); if (launchConfigName.equalsIgnoreCase(ServiceConstants.PRIMARY_LAUNCH_CONFIG_NAME)) { launchConfigData = DataAccessor.fields(service) .withKey(ServiceConstants.FIELD_LAUNCH_CONFIG).withDefault(Collections.EMPTY_MAP) .as(Map.class); ArrayList<String> deletedKeys = new ArrayList<>(); for (String key: launchConfigData.keySet()) { if (launchConfigData.get(key) == null) { deletedKeys.add(key); } } for (String key: deletedKeys) { launchConfigData.remove(key); } } else { List<Map<String, Object>> secondaryLaunchConfigs = DataAccessor.fields(service) .withKey(ServiceConstants.FIELD_SECONDARY_LAUNCH_CONFIGS) .withDefault(Collections.EMPTY_LIST).as( List.class); for (Map<String, Object> secondaryLaunchConfig : secondaryLaunchConfigs) { if (secondaryLaunchConfig.get("name").toString().equalsIgnoreCase(launchConfigName)) { launchConfigData = secondaryLaunchConfig; break; } } } Map<String, Object> data = new HashMap<>(); data.putAll(launchConfigData); Object labels = data.get(ServiceDiscoveryConfigItem.LABELS.getCattleName()); if (labels != null) { Map<String, String> labelsMap = new HashMap<String, String>(); labelsMap.putAll((Map<String, String>) labels); data.put(ServiceDiscoveryConfigItem.LABELS.getCattleName(), labelsMap); } return data; }
Source:
public String getText(Object object) { Match match = (Match)object; String ret = itemDelegator.getText(match.getLeft()); if (isNullOrEmpty(ret)) { ret = itemDelegator.getText(match.getOrigin()); } if (isNullOrEmpty(ret)) { ret = itemDelegator.getText(match.getRight()); } if (isNullOrEmpty(ret)) { if (match instanceof NotLoadedFragmentMatch) { ret = "[ ... ]"; String name = ((NotLoadedFragmentMatch)match).getName(); if (!isNullOrEmpty(name)) { ret += " (" + name + ")"; } } else { Adapter adapter = EcoreUtil.getAdapter(match.eAdapters(), MatchOfContainmentReferenceChangeAdapter.class); if (adapter instanceof MatchOfContainmentReferenceChangeAdapter) { ReferenceChange referenceChange = ((MatchOfContainmentReferenceChangeAdapter)adapter) .getReferenceChange(); if (referenceChange != null) { ret = new ReferenceChangeItemProviderSpec(getRootAdapterFactory()) .getValueText(referenceChange); } } else { ret = super.getText(object); } } } return ret; }

Target:
public String getText(Object object) { Match match = (Match)object; String ret = itemDelegator.getText(match.getLeft()); if (isNullOrEmpty(ret)) { ret = itemDelegator.getText(match.getOrigin()); } if (isNullOrEmpty(ret)) { ret = itemDelegator.getText(match.getRight()); } if (isNullOrEmpty(ret)) { if (match instanceof NotLoadedFragmentMatch) { ret = "[ ... ]"; String name = ((NotLoadedFragmentMatch)match).getName(); if (!isNullOrEmpty(name)) { ret += " (" + name + ")"; } } else { Adapter matchAdapter = EcoreUtil.getAdapter(match.eAdapters(), MatchOfContainmentReferenceChangeAdapter.class); if (matchAdapter instanceof MatchOfContainmentReferenceChangeAdapter) { ReferenceChange referenceChange = ((MatchOfContainmentReferenceChangeAdapter)matchAdapter) .getReferenceChange(); Adapter rcAdapter = null; if (referenceChange != null) { rcAdapter = EcoreUtil.getAdapter(referenceChange.eAdapters(), ReferenceChangeItemProviderSpec.class); } if (rcAdapter instanceof ReferenceChangeItemProviderSpec) { ret = ((ReferenceChangeItemProviderSpec)rcAdapter).getValueText(referenceChange); } } if (isNullOrEmpty(ret)) { ret = super.getText(object); } } } return ret; }
Source:
private void migrateEntriesWithMetadata(RemoteCache<Object, Object> sourceCache, AtomicInteger counter) { try (CloseableIterator<Map.Entry<Object, MetadataValue<Object>>> iterator = sourceCache.retrieveEntriesWithMetadata(segments, readBatch)) { while (iterator.hasNext()) { Map.Entry<Object, MetadataValue<Object>> entry = iterator.next(); if (!Arrays.equals((byte[]) entry.getKey(), ignoredKey)) { MetadataValue<Object> metadataValue = entry.getValue(); int lifespan = metadataValue.getLifespan(); int maxIdle = metadataValue.getMaxIdle(); long version = metadataValue.getVersion(); long created = metadataValue.getCreated(); long lastUsed = metadataValue.getLastUsed(); Metadata metadata = new EmbeddedMetadata.Builder() .version(new NumericVersion(version)) .lifespan(lifespan, TimeUnit.SECONDS) .maxIdle(maxIdle, TimeUnit.SECONDS) .build(); InternalMetadataImpl internalMetadata = new InternalMetadataImpl(metadata, created, lastUsed); executorService.submit(() -> { Object key = entry.getKey(); if (!deletedKeys.contains(new WrappedByteArray((byte[]) key))) { cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD, Flag.ROLLING_UPGRADE).putIfAbsent(entry.getKey(), entry.getValue().getValue(), internalMetadata); } int currentCount = counter.incrementAndGet(); if (log.isDebugEnabled() && currentCount % 100 == 0) log.debugf(">> Migrated %s entries\n", currentCount); }); } } } }

Target:
private void migrateEntriesWithMetadata(RemoteCache<Object, Object> sourceCache, AtomicInteger counter) { try (CloseableIterator<Map.Entry<Object, MetadataValue<Object>>> iterator = sourceCache.retrieveEntriesWithMetadata(segments, readBatch)) { while (iterator.hasNext() && !Thread.currentThread().isInterrupted()) { Map.Entry<Object, MetadataValue<Object>> entry = iterator.next(); if (!Arrays.equals((byte[]) entry.getKey(), ignoredKey)) { MetadataValue<Object> metadataValue = entry.getValue(); int lifespan = metadataValue.getLifespan(); int maxIdle = metadataValue.getMaxIdle(); long version = metadataValue.getVersion(); long created = metadataValue.getCreated(); long lastUsed = metadataValue.getLastUsed(); Metadata metadata = new EmbeddedMetadata.Builder() .version(new NumericVersion(version)) .lifespan(lifespan, TimeUnit.SECONDS) .maxIdle(maxIdle, TimeUnit.SECONDS) .build(); InternalMetadataImpl internalMetadata = new InternalMetadataImpl(metadata, created, lastUsed); executorService.submit(() -> { Object key = entry.getKey(); if (!deletedKeys.contains(new WrappedByteArray((byte[]) key))) { cache.getAdvancedCache().withFlags(Flag.SKIP_CACHE_LOAD, Flag.ROLLING_UPGRADE).putIfAbsent(entry.getKey(), entry.getValue().getValue(), internalMetadata); } int currentCount = counter.incrementAndGet(); if (log.isDebugEnabled() && currentCount % 100 == 0) log.debugf(">> Migrated %s entries\n", currentCount); }); } } } }
Source:
public void observe(@Observes AfterBeanDiscovery event, BeanManager beanManager) throws IOException, ClassNotFoundException { Index index = classPathIndexer.createIndex(); List<AnnotationInstance> annotations = index.getAnnotations(DotName.createSimple("javax.ws.rs.Path")); for (AnnotationInstance annotation : annotations) { if (!annotation.target().kind().equals(AnnotationTarget.Kind.CLASS)) { continue; } Class<?> clazz = getClass().getClassLoader().loadClass(annotation.target().asClass().name().toString()); LRAParticipant participant = processJavaClass(clazz); if (participant != null) { participants.put(participant.getId().getName(), participant); Set<Bean<?>> participantBeans = beanManager.getBeans(clazz, new AnnotationLiteral<Any>() {}); if (participantBeans.isEmpty()) { event.addBean() .read(beanManager.createAnnotatedType(clazz)) .beanClass(clazz) .scope(ApplicationScoped.class) .name(clazz.getName()); } } } event.addBean() .read(beanManager.createAnnotatedType(LRAParticipantRegistry.class)) .beanClass(LRAParticipantRegistry.class) .scope(ApplicationScoped.class) .createWith(context -> new LRAParticipantRegistry(participants)); }

Target:
public void observe(@Observes AfterBeanDiscovery event, BeanManager beanManager) throws IOException, ClassNotFoundException { Index index = classPathIndexer.createIndex(); List<AnnotationInstance> annotations = index.getAnnotations(DotName.createSimple("javax.ws.rs.Path")); for (AnnotationInstance annotation : annotations) { ClassInfo classInfo; AnnotationTarget target = annotation.target(); if (target.kind().equals(AnnotationTarget.Kind.CLASS)) { classInfo = target.asClass(); } else if (target.kind().equals(AnnotationTarget.Kind.METHOD)) { classInfo = target.asMethod().declaringClass(); } else { continue; } LRAParticipant participant = getAsParticipant(classInfo); if (participant != null) { participants.put(participant.getJavaClass().getName(), participant); Set<Bean<?>> participantBeans = beanManager.getBeans(participant.getJavaClass(), new AnnotationLiteral<Any>() {}); if (participantBeans.isEmpty()) { try { participant.setInstance(participant.getJavaClass().newInstance()); } catch (InstantiationException | IllegalAccessException e) { LRALogger.i18NLogger.error_cannotProcessParticipant(e); } } } } event.addBean() .read(beanManager.createAnnotatedType(LRAParticipantRegistry.class)) .beanClass(LRAParticipantRegistry.class) .scope(ApplicationScoped.class) .createWith(context -> new LRAParticipantRegistry(participants)); }
Source:
protected void deleteBreakpointFromTarget(final IBreakpointsTargetDMContext context, final int reference, RequestMonitor finalRm) { final Step deleteBreakpointStep = new Step() { @Override public void execute(final RequestMonitor rm) { fConnection.queueCommand(fCommandFactory.createMIBreakDelete(context, new int[] { reference }), new DataRequestMonitor<MIInfo>(getExecutor(), rm) { @Override protected void handleCompleted() { rm.setStatus(getStatus()); rm.done(); } }); } }; fRunControl.executeWithTargetAvailable(context, new Step[] { deleteBreakpointStep }, finalRm); }

Target:
protected void deleteBreakpointFromTarget(final IBreakpointsTargetDMContext context, final int reference, RequestMonitor finalRm) { final Step deleteBreakpointStep = new Step() { @Override public void execute(final RequestMonitor rm) { fConnection.queueCommand( fCommandFactory.createMIBreakDelete(context, new int[] { reference }), new DataRequestMonitor<MIInfo>(getExecutor(), rm)); } }; fRunControl.executeWithTargetAvailable(context, new Step[] { deleteBreakpointStep }, finalRm); }
Source:
protected void onInit() { super.onInit(); boolean hasTopics = false; if (this.topics != null) { Assert.noNullElements(this.topics, "'topics' may not contain null elements."); hasTopics = true; } boolean hasPatterns = false; if (this.topicPatterns != null) { Assert.noNullElements(this.topicPatterns, "'topicPatterns' may not contain null elements."); hasPatterns = true; } Assert.state(hasTopics || hasPatterns, "at least one topic or topic pattern is required for subscription."); if (this.messageConverter instanceof BeanFactoryAware) { ((BeanFactoryAware) this.messageConverter).setBeanFactory(this.getBeanFactory()); } MessageListenerDelegate delegate = new MessageListenerDelegate(); MessageListenerAdapter adapter = new MessageListenerAdapter(delegate); adapter.setSerializer(this.serializer); List<Topic> topicList = new ArrayList<Topic>(); if (hasTopics) { for (String topic : this.topics) { topicList.add(new ChannelTopic(topic)); } } if (hasPatterns) { for (String pattern : this.topicPatterns) { topicList.add(new PatternTopic(pattern)); } } adapter.afterPropertiesSet(); this.container.addMessageListener(adapter, topicList); if (this.taskExecutor != null) { this.container.setTaskExecutor(this.taskExecutor); } this.container.afterPropertiesSet(); }

Target:
protected void onInit() { super.onInit(); boolean hasTopics = false; if (this.topics != null) { Assert.noNullElements(this.topics, "'topics' may not contain null elements."); hasTopics = true; } boolean hasPatterns = false; if (this.topicPatterns != null) { Assert.noNullElements(this.topicPatterns, "'topicPatterns' may not contain null elements."); hasPatterns = true; } Assert.state(hasTopics || hasPatterns, "at least one topic or topic pattern is required for subscription."); if (this.messageConverter instanceof BeanFactoryAware) { ((BeanFactoryAware) this.messageConverter).setBeanFactory(this.getBeanFactory()); } MessageListenerDelegate delegate = new MessageListenerDelegate(); MessageListenerAdapter adapter = new MessageListenerAdapter(delegate); adapter.setSerializer(this.serializer); List<Topic> topicList = new ArrayList<Topic>(); if (hasTopics) { for (String topic : this.topics) { topicList.add(new ChannelTopic(topic)); } } if (hasPatterns) { for (String pattern : this.topicPatterns) { topicList.add(new PatternTopic(pattern)); } } adapter.afterPropertiesSet(); this.container.addMessageListener(adapter, topicList); this.container.afterPropertiesSet(); }
Source:
protected CNodeFactory getNodeFactory() { return (CNodeFactory)super.getNodeFactory(); }

Target:
protected ICNodeFactory getNodeFactory() { return (ICNodeFactory) super.getNodeFactory(); }
Source:
private PojoUtils.Getter generateGettersForField(Class<?> klass, String inputFieldName) throws NoSuchFieldException, SecurityException { Field f = klass.getDeclaredField(inputFieldName); Class c = ClassUtils.primitiveToWrapper(f.getType()); PojoUtils.Getter classGetter = PojoUtils.createGetter(klass, inputFieldName, c); return classGetter; }

Target:
private PojoUtils.Getter generateGettersForField(Class<?> klass, String inputFieldName) throws NoSuchFieldException, SecurityException { Field f = klass.getDeclaredField(inputFieldName); Class c = ClassUtils.primitiveToWrapper(f.getType()); return PojoUtils.createGetter(klass, inputFieldName, c); }
Source:
public static boolean isCidrFormatValid(String cidr) { return (cidr == null || !cidr.matches(ValidationUtils.CIDR_FORMAT_PATTERN)) ? false : true; }

Target:
public boolean isCidrFormatValid(String cidr) { return (cidr == null || !cidr.matches(ValidationUtils.CIDR_FORMAT_PATTERN)) ? false : true; }
Source:
public List<AutoCloseable> start(Params params) { Configuration config = new FluoConfiguration(params.getConfiguration()).getReporterConfiguration("graphite"); if (!config.getBoolean("enable", false)) { return Collections.emptyList(); } String host = config.getString("host"); String prefix = config.getString("prefix", ""); int port = config.getInt("port", 8080); TimeUnit rateUnit = TimeUnit.valueOf(config.getString("rateUnit", "seconds").toUpperCase()); TimeUnit durationUnit = TimeUnit.valueOf(config.getString("durationUnit", "milliseconds").toUpperCase()); Graphite graphite = new Graphite(host, port); GraphiteReporter reporter = GraphiteReporter.forRegistry(params.getMetricRegistry()).convertDurationsTo(durationUnit) .convertRatesTo(rateUnit).prefixedWith(prefix).build(graphite); reporter.start(config.getInt("frequency", 60), TimeUnit.SECONDS); log.info("Reporting metrics to graphite"); return Collections.singletonList((AutoCloseable) reporter); }

Target:
public List<AutoCloseable> start(Params params) { Configuration config = new FluoConfiguration(params.getConfiguration()).getReporterConfiguration("graphite"); if (!config.getBoolean("enable", false)) { return Collections.emptyList(); } String host = config.getString("host"); String prefix = config.getString("prefix", ""); int port = config.getInt("port", 8080); TimeUnit rateUnit = TimeUnit.valueOf(config.getString("rateUnit", "seconds").toUpperCase()); TimeUnit durationUnit = TimeUnit.valueOf(config.getString("durationUnit", "milliseconds").toUpperCase()); Graphite graphite = new Graphite(host, port); GraphiteReporter reporter = GraphiteReporter.forRegistry(params.getMetricRegistry()).convertDurationsTo(durationUnit) .convertRatesTo(rateUnit).prefixedWith(prefix).build(graphite); reporter.start(config.getInt("frequency", 60), TimeUnit.SECONDS); log.info("Reporting metrics to graphite server {}:{}", host, port); return Collections.singletonList((AutoCloseable) reporter); }
Source:
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { buffer.append(getComputedValue(name, prefix, object, context)); }

Target:
public void displayView(StringBuffer buffer, String name, String prefix, BaseCollection object, XWikiContext context) { try { buffer.append(getComputedValue(name, prefix, object, context)); } catch (Exception e) { buffer.append(e.getMessage()); } }