auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void cleanupTest() throws InterruptedException { for (String db : _dbs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); Thread.sleep(20); } _dbs.clear(); Thread.sleep(50); for (int i = 0; i < _participants.length; i++) { _participants[i].syncStop(); _participants[i] = new MockParticipantManager(ZK_ADDR, CLUSTER_NAME, _participants[i].getInstanceName()); } DelayedTransition.clearThrottleRecord(); }

Target:
public void cleanupTest() throws InterruptedException { for (String db : _dbs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); Thread.sleep(20); } _dbs.clear(); Thread.sleep(50); HelixDataAccessor dataAccessor = new ZKHelixDataAccessor(CLUSTER_NAME, new ZkBaseDataAccessor<>(_gZkClient)); for (int i = 0; i < _participants.length; i++) { _participants[i].syncStop(); _participants[i] = new MockParticipantManager(ZK_ADDR, CLUSTER_NAME, _participants[i].getInstanceName()); } try { Assert.assertTrue(TestHelper.verify(() -> dataAccessor.getChildNames(dataAccessor.keyBuilder().liveInstances()).isEmpty(), 1000)); } catch (Exception e) { e.printStackTrace(); System.out.println("There're live instances not cleaned up yet"); assert false; } DelayedTransition.clearThrottleRecord(); }
Source:
public void shouldNotRemoveAllNonMatchedElementsFromNonNil() { final Seq<Integer> t = of(1, 2, 3); final Predicate<Integer> isTooBig = i -> i >= 4; assertThat(t.reject(isTooBig)).isSameAs(t); }

Target:
public void shouldNotRemoveAllNonMatchedElementsFromNonNil() { final Seq<Integer> t = of(1, 2, 3); final Predicate<Integer> isTooBig = i -> i >= 4; assertThat(t.removeAll(isTooBig)).isSameAs(t); }
Source:
void openNoRightsPopup() { InfoPopup.generate( ts.getTranslation( LibraryConstants.Error_NoAccessRights ) ); }

Target:
void openNoRightsPopup() { view.openNoRightsPopup(); }
Source:
public void setSampleIds(Map<String, Integer> sampleIds) { this.sampleIds = sampleIds; this.idSamples = new HashMap<>(sampleIds.size()); for (Map.Entry<String, Integer> entry : sampleIds.entrySet()) { idSamples.put(entry.getValue(), entry.getKey()); } assert sampleIds.size() == idSamples.size(); }

Target:
public void setSampleIds(Map<String, Integer> sampleIds) { this.sampleIds = new HashMap<String, Integer>(sampleIds); this.idSamples = new HashMap<>(this.sampleIds.size()); for (Map.Entry<String, Integer> entry : this.sampleIds.entrySet()) { idSamples.put(entry.getValue(), entry.getKey()); } assert sampleIds.size() == idSamples.size(); }
Source:
private void convertTestFailureIgnore(ReportOptions option, Xpp3Dom configuration) { List<String> testFailureIgnoreList = extractStrings("testFailureIgnore", configuration); if (!testFailureIgnoreList.isEmpty()) { String testFailureIgnore = testFailureIgnoreList.iterator().next(); option.setSkipFailingTests(Boolean.parseBoolean(testFailureIgnore)); } }

Target:
private void convertTestFailureIgnore(ReportOptions option, Xpp3Dom configuration) { Xpp3Dom testFailureIgnore = configuration.getChild("testFailureIgnore"); if (testFailureIgnore != null) { option.setSkipFailingTests(Boolean.parseBoolean(testFailureIgnore.getValue())); } }
Source:
private ServiceHealthKey getServiceHealthKeyFromCache(ServiceHealthCache cache, String serviceId, int port) { return cache.getMap().keySet() .stream() .filter(key -> serviceId.equals(key.getServiceId()) && (port == key.getPort())) .findFirst() .orElse(null); }

Target:
private static Optional<ServiceHealthKey> getServiceHealthKeyFromCache(ServiceHealthCache cache, String serviceId, int port) { return cache.getMap().keySet() .stream() .filter(key -> serviceId.equals(key.getServiceId()) && (port == key.getPort())) .findFirst(); }
Source:
protected void injectSshKeysIntoSystemVmIsoPatch(String publicKeyPath, String privKeyPath) { s_logger.info("Trying to inject public and private keys into systemvm iso"); String injectScript = getInjectScript(); String scriptPath = Script.findScript("", injectScript); String systemVmIsoPath = Script.findScript("", "vms/systemvm.iso"); if (scriptPath == null) { throw new CloudRuntimeException("Unable to find key inject script " + injectScript); } if (systemVmIsoPath == null) { throw new CloudRuntimeException("Unable to find systemvm iso vms/systemvm.iso"); } Script command = null; if(isOnWindows()) { command = new Script("python", s_logger); } else { command = new Script("/bin/bash", s_logger); } String osname = System.getProperty("os.name"); if (osname.startsWith("Windows")) { scriptPath = scriptPath.replaceAll("\\\\" ,"/" ); systemVmIsoPath = systemVmIsoPath.replaceAll("\\\\" ,"/" ); publicKeyPath = publicKeyPath.replaceAll("\\\\" ,"/" ); privKeyPath = privKeyPath.replaceAll("\\\\" ,"/" ); } command.add(scriptPath); command.add(publicKeyPath); command.add(privKeyPath); command.add(systemVmIsoPath); final String result = command.execute(); s_logger.info("Injected public and private keys into systemvm iso with result : " + result); if (result != null) { s_logger.warn("Failed to inject generated public key into systemvm iso " + result); throw new CloudRuntimeException("Failed to inject generated public key into systemvm iso " + result); } }

Target:
protected void injectSshKeysIntoSystemVmIsoPatch(String publicKeyPath, String privKeyPath) { s_logger.info("Trying to inject public and private keys into systemvm iso"); String injectScript = getInjectScript(); String scriptPath = Script.findScript("", injectScript); String systemVmIsoPath = Script.findScript("", "vms/systemvm.iso"); if (scriptPath == null) { throw new CloudRuntimeException("Unable to find key inject script " + injectScript); } if (systemVmIsoPath == null) { throw new CloudRuntimeException("Unable to find systemvm iso vms/systemvm.iso"); } Script command = null; if(isOnWindows()) { command = new Script("python", s_logger); } else { command = new Script("/bin/bash", s_logger); } if (this.isOnWindows()) { scriptPath = scriptPath.replaceAll("\\\\" ,"/" ); systemVmIsoPath = systemVmIsoPath.replaceAll("\\\\" ,"/" ); publicKeyPath = publicKeyPath.replaceAll("\\\\" ,"/" ); privKeyPath = privKeyPath.replaceAll("\\\\" ,"/" ); } command.add(scriptPath); command.add(publicKeyPath); command.add(privKeyPath); command.add(systemVmIsoPath); final String result = command.execute(); s_logger.info("Injected public and private keys into systemvm iso with result : " + result); if (result != null) { s_logger.warn("Failed to inject generated public key into systemvm iso " + result); throw new CloudRuntimeException("Failed to inject generated public key into systemvm iso " + result); } }
Source:
} catch (Exception e) { logger.error("Error in initializing es test container , error :", e); }

Target:
} catch (Exception e) { log.error("Error in initializing es test container , error :", e); throw e; }
Source:
public void testFailOverflow() throws IOException { final List<Pass> list = new ArrayList<Pass>(2); list.add(new PsFake(true)); list.add(new PsFake(true)); final Opt<Identity> identity = new PsAll(list, 2).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(false) ); }

Target:
public void testFailOverflow() throws Exception { final List<Pass> list = new ArrayList<Pass>(2); list.add(new PsFake(true)); list.add(new PsFake(true)); final Opt<Identity> identity = new PsAll(list, 2).enter(new RqFake()); MatcherAssert.assertThat( identity.has(), Matchers.is(false) ); }
Source:
private String getSimModsLabelContent(ObservableMap<String, String> simMods) { List<String> modNames = simMods.entrySet().stream() .limit(2) .map(Entry::getValue) .collect(Collectors.toList()); if (simMods.size() > 2) { return i18n.get("game.mods.twoAndMore", modNames.get(0), simMods.size() - 1); } return Joiner.on(i18n.get("textSeparator")).join(modNames); }

Target:
private String getSimModsLabelContent(ObservableMap<String, String> simMods) { List<String> modNames = simMods.entrySet().stream() .limit(2) .map(Entry::getValue) .collect(Collectors.toList()); if (simMods.size() > 2) { return i18n.get("game.mods.twoAndMore", modNames.get(0), modNames.get(1), simMods.size() - 2); } return Joiner.on(i18n.get("textSeparator")).join(modNames); }
Source:
public ZibaseBindingConfig(String[] configParameters) { this.values = configParameters; logger.debug("Item Constructor - saved valued : {}", StringUtils.join(this.values, ",")); }

Target:
public ZibaseBindingConfig(String[] configParameters) { this.values = configParameters; logger.debug("Item Constructor - saved value(s) : {}", StringUtils.join(this.values, ",")); }
Source:
public void noMoreBubble() { config.setProperty(PARTITION_OPERATION_THREAD_COUNT.getName(), "1"); initExecutor(); final DummyPartitionTaskFactory taskFactory = new DummyPartitionTaskFactory(); taskFactory.delayMs = 1000; executor.executeOnPartitions(taskFactory, newPartitions()); final DummyOperation op = new DummyOperation(); executor.execute(op); assertTrueEventually(new AssertTask() { @Override public void run() { assertTrue(op.completed); } }, SECONDS.toMillis(5)); }

Target:
public void noMoreBubble() { config.setProperty(PARTITION_OPERATION_THREAD_COUNT.getName(), "1"); initExecutor(); final DummyPartitionTaskFactory taskFactory = new DummyPartitionTaskFactory(); taskFactory.delayMs = 1000; executor.executeOnPartitions(taskFactory, newPartitions()); final DummyOperation op = new DummyOperation(); executor.execute(op); assertTrueEventually(new AssertTask() { @Override public void run() { assertTrue(op.completed); } }, 5); }
Source:
private void testGeneralQuestionOperations() throws Exception { testCancelAddingNewQuestion(); testCancelEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testToggleFeedbackPathDisplayLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); testResponseRate(); }

Target:
private void testGeneralQuestionOperations() throws Exception { testCancelAddingNewQuestion(); testCancelEditQuestion(); testNewQuestionLink(); testInputValidationForQuestion(); testAddQuestionAction(); testEditQuestionLink(); testEditQuestionAction(); testToggleCustomFeedbackPathDisplayLink(); testCopyQuestion(); testChangeFeedbackRecipient(); testEditQuestionNumberAction(); testAjaxOnVisibilityMessageButton(); testDeleteQuestionAction(2); testDeleteQuestionAction(1); testEditNonExistentQuestion(); testResponseRate(); }
Source:
protected ACE getACE(String username, String permission) { return new ACE(username, permission, Boolean.TRUE); }

Target:
protected ACE getACE(String username, String permission) { return new ACE(username, permission, true); }
Source:
private String extension(String filePath) { int extensionPos = filePath.indexOf("."); if (extensionPos > 0) { return filePath.substring(extensionPos + 1); } else { return ""; } }

Target:
private String extension(String filePath) { int extensionPos = filePath.lastIndexOf("."); if (extensionPos > 0) { return filePath.substring(extensionPos + 1); } else { return ""; } }
Source:
public long estimatedInMemorySizeInBytes() { return INSTANCE_SIZE + sizeOf(weight) + sizeOf(mean) + sizeOf(tempWeight) + sizeOf(tempMean); }

Target:
public long estimatedInMemorySizeInBytes() { return INSTANCE_SIZE + sizeOf(weight) + sizeOf(mean) + sizeOf(tempWeight) + sizeOf(tempMean) + sizeOf(order); }
Source:
public Channel createChannel(boolean transactional) { try { Channel channel = this.delegate.createChannel(); if (transactional) { Assert.state(channel != null, "Can't start the transaction - channel is null."); channel.txSelect(); } return channel; } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }

Target:
public Channel createChannel(boolean transactional) { try { Channel channel = this.delegate.createChannel(); if (transactional) { Assert.state(channel != null, "Can't start the transaction - no channel is available."); channel.txSelect(); } return channel; } catch (IOException e) { throw RabbitExceptionTranslator.convertRabbitAccessException(e); } }
Source:
public void recoverGroup(final String groupId) throws IOException { final Map<String, QueryCheckpoint> queryCheckpointMap; final List<AvroDag> dagList; final QueryManager queryManager = queryManagerFuture.get(); try { queryCheckpointMap = checkpointStore.loadSavedGroupState(groupId).getQueryCheckpointMap(); final List<String> queryIdListInGroup = new ArrayList<>(); for (final String queryId : queryCheckpointMap.keySet()) { queryIdListInGroup.add(queryId); } dagList = checkpointStore.loadSavedQueries(queryIdListInGroup); } catch (final FileNotFoundException ie) { LOG.log(Level.WARNING, "Failed in loading app {0}, this app may not exist in the checkpoint store.", new Object[]{groupId}); return; } for (final AvroDag avroDag : dagList) { final QueryCheckpoint queryCheckpoint = queryCheckpointMap.get(avroDag.getQueryId()); queryManager.createQueryWithCheckpoint(avroDag, queryCheckpoint); } }

Target:
public void recoverGroup(final String groupId) throws IOException { final Map<String, QueryCheckpoint> queryCheckpointMap; final List<AvroDag> dagList; final QueryManager queryManager = queryManagerFuture.get(); try { queryCheckpointMap = checkpointStore.loadSavedGroupState(groupId).getQueryCheckpointMap(); final List<String> queryIdListInGroup = new ArrayList<>(); for (final String queryId : queryCheckpointMap.keySet()) { queryIdListInGroup.add(queryId); } dagList = checkpointStore.loadSavedQueries(queryIdListInGroup); } catch (final FileNotFoundException ie) { LOG.log(Level.WARNING, "Failed in loading group {0}, this group may not exist in the checkpoint store.", new Object[]{groupId}); return; } for (final AvroDag avroDag : dagList) { final QueryCheckpoint queryCheckpoint = queryCheckpointMap.get(avroDag.getQueryId()); queryManager.createQueryWithCheckpoint(avroDag, queryCheckpoint); } }
Source:
private static void readyForNextRequest(HttpConnectionContext context) { LOG.info().$("Request complete, ").$(context.getTotalBytesSent()).$(" bytes sent [fd=").$(context.getFd()).$(']').$(); context.clear(); context.getDispatcher().registerChannel(context, IOOperation.READ); }

Target:
private static void readyForNextRequest(HttpConnectionContext context) { LOG.info().$("all sent [fd=").$(context.getFd()).$(", lastRequestBytesSent=").$(context.getLastRequestBytesSent()).$(", nCompletedRequests=").$(context.getNCompletedRequests() + 1) .$(", totalBytesSent=").$(context.getTotalBytesSent()).$(']').$(); context.clear(); context.getDispatcher().registerChannel(context, IOOperation.READ); }
Source:
public void testAbuseFilterTriggerStop() { PageTitle title = new PageTitle(null, ABUSE_FILTER_ERROR_PAGE_TITLE, TEST_WIKI_SITE); String wikitext = "== Section 2 ==\n\nTriggering AbuseFilter number 2 by saying poop many" + "times at " + System.currentTimeMillis(); service.edit(TEST_WIKI_SITE, title, DEFAULT_SECTION_ID, wikitext, ANONYMOUS_TOKEN, DEFAULT_SUMMARY, false, null, null, new Edit.Callback() { @Override public void success(@NonNull EditingResult result) { assertThat(result, instanceOf(AbuseFilterEditResult.class)); assertThat(((AbuseFilterEditResult) result).getType(), is(AbuseFilterEditResult.TYPE_ERROR)); } @Override public void failure(@NonNull Throwable caught) { throw new RuntimeException(caught); } }); }

Target:
public void testAbuseFilterTriggerStop() { PageTitle title = new PageTitle(null, ABUSE_FILTER_ERROR_PAGE_TITLE, TEST_WIKI_SITE); String wikitext = "== Section 2 ==\n\nTriggering AbuseFilter number 2 by saying poop many" + "times at " + System.currentTimeMillis(); final TestLatch latch = new TestLatch(); client.request(TEST_WIKI_SITE, title, DEFAULT_SECTION_ID, wikitext, ANONYMOUS_TOKEN, DEFAULT_SUMMARY, false, null, null, new EditClient.Callback() { @Override public void success(@NonNull Call<Edit> call, @NonNull EditingResult result) { assertThat(result, instanceOf(AbuseFilterEditResult.class)); assertThat(((AbuseFilterEditResult) result).getType(), is(AbuseFilterEditResult.TYPE_ERROR)); latch.countDown(); } @Override public void failure(@NonNull Call<Edit> call, @NonNull Throwable caught) { throw new RuntimeException(caught); } }); latch.await(); }
Source:
public void serialize(final OVXPort port, final JsonGenerator jgen, final SerializerProvider sp) throws IOException, JsonProcessingException { jgen.writeStartObject(); jgen.writeStringField("dpid", port.getParentSwitch().getSwitchName()); jgen.writeStringField("port", String.valueOf(port.getPortNumber())); jgen.writeEndObject(); }

Target:
public void serialize(final OVXPort port, final JsonGenerator jgen, final SerializerProvider sp) throws IOException, JsonProcessingException { jgen.writeStartObject(); jgen.writeStringField("vdpid", port.getParentSwitch().getSwitchName()); jgen.writeNumberField("vport", port.getPortNumber()); jgen.writeEndObject(); }
Source:
static <T> Future<T> ofSupplier(Supplier<? extends T> computation) { return of(DEFAULT_EXECUTOR_SERVICE, computation::get); }

Target:
static <T> Future<T> ofSupplier(Supplier<? extends T> computation) { Objects.requireNonNull(computation, "computation is null"); return of(DEFAULT_EXECUTOR_SERVICE, computation::get); }
Source:
public static ItemStack tryActivateAndGet(@Nonnull Event e, @Nonnull SlimefunItem item) { if (!(item instanceof Talisman)) { return null; } Talisman talisman = (Talisman) item; if (ThreadLocalRandom.current().nextInt(100) > talisman.getChance()) { return null; } Player p = getPlayerByEventType(e); if (p == null || !pass(p, talisman)) { return null; } if (!Slimefun.hasUnlocked(p, talisman, true)) { return null; } ItemStack possibleTalisman = retrieveTalismanFromInventory(p.getInventory(), talisman); if (possibleTalisman != null) { activateTalisman(e, p, p.getInventory(), talisman); return possibleTalisman; } possibleTalisman = retrieveTalismanFromInventory(p.getEnderChest(), talisman); if (possibleTalisman != null) { activateTalisman(e, p, p.getEnderChest(), talisman); return possibleTalisman; } return possibleTalisman; }

Target:
public static ItemStack tryActivateAndGet(@Nonnull Event e, @Nonnull SlimefunItem item) { if (!(item instanceof Talisman)) { return null; } Talisman talisman = (Talisman) item; if (ThreadLocalRandom.current().nextInt(100) > talisman.getChance()) { return null; } Player p = getPlayerByEventType(e); if (p == null || !pass(p, talisman)) { return null; } ItemStack possibleTalisman = retrieveTalismanFromInventory(p.getInventory(), talisman.getItem()); if (possibleTalisman != null) { if (Slimefun.hasUnlocked(p, talisman, true)) { activateTalisman(e, p, p.getInventory(), talisman, possibleTalisman); return possibleTalisman; } else { return null; } } possibleTalisman = retrieveTalismanFromInventory(p.getEnderChest(), talisman.getEnderVariant()); if (possibleTalisman != null) { if (Slimefun.hasUnlocked(p, talisman, true)) { activateTalisman(e, p, p.getEnderChest(), talisman, possibleTalisman); return possibleTalisman; } else { return null; } } return null; }
Source:
public void testChangeTheStatusOfTheAPIToRetired() throws Exception { restAPIPublisher.changeAPILifeCycleStatus(apiId, APILifeCycleAction.RETIRE.getAction()); assertTrue(restAPIPublisher.getLifecycleStatus(apiId).getData().equals("Retired"), apiNameTest + "status not updated as Retired"); HttpResponse retiredApiResponse = restAPIPublisher.getAPI(apiId); assertEquals(retiredApiResponse.getResponseCode(), Response.Status.OK.getStatusCode(), apiNameTest + " is not visible in publisher"); assertTrue(retiredApiResponse.getData().contains(apiNameTest), apiNameTest + " is not visible in " + "publisher"); }

Target:
public void testChangeTheStatusOfTheAPIToRetired() throws Exception { restAPIPublisher.changeAPILifeCycleStatus(apiId, APILifeCycleAction.RETIRE.getAction()); assertTrue(APILifeCycleState.RETIRED.getState().equals(restAPIPublisher.getLifecycleStatus(apiId).getData()), apiNameTest + "status not updated as Retired"); HttpResponse retiredApiResponse = restAPIPublisher.getAPI(apiId); assertEquals(retiredApiResponse.getResponseCode(), Response.Status.OK.getStatusCode(), apiNameTest + " is not visible in publisher"); assertTrue(retiredApiResponse.getData().contains(apiNameTest), apiNameTest + " is not visible in " + "publisher"); }
Source:
public void triggerJob(){ ResourceBundleProvider.updateLocale(new Locale("en_US")); List<String> schemas = studyDao.findAllSchemas(); for (String schema : schemas) { if (StringUtils.isEmpty(schema)) { logger.error("Schema should not be null"); continue; } ArrayList<RuleSetBean> ruleSets = ruleSetDao.findAllRunOnSchedulesPerSchema(true, schema); for (RuleSetBean ruleSet : ruleSets) { if (ruleSet.getStatus().AVAILABLE != null && ruleSet.isRunSchedule()) { CoreResources.tenantSchema.set(schema); if(ruleSet.getItemId()!=null){ logger.info("*** Item Specific Rule ***"); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); StudyBean currentStudy = (StudyBean) getStudyDao().findByPK(ruleSet.getStudyId()); ResourceBundleProvider.updateLocale(Locale.getDefault()); UserAccountBean ub = (UserAccountBean) getUserAccountDao().findByPK(1); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBulk(ruleSetBeans, false, currentStudy, ub, true); } else { logger.info("*** Event Specific Rule ***"); StudyEventChangeDetails studyEventChangeDetails = new StudyEventChangeDetails(true, true); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); ExpressionBean eBean = new ExpressionBean(); eBean.setValue(ruleSet.getTarget().getValue()+".A.B"); ruleSet.setTarget(eBean); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBeanProperty(ruleSetBeans ,1, studyEventChangeDetails); } } } } }

Target:
public void triggerJob(){ ResourceBundleProvider.updateLocale(new Locale("en_US")); List<String> schemas = studyDao.findAllSchemas(); for (String schema : schemas) { if (StringUtils.isEmpty(schema)) { logger.error("Schema should not be null"); continue; } ArrayList<RuleSetBean> ruleSets = ruleSetDao.findAllRunOnSchedulesPerSchema(true, schema); for (RuleSetBean ruleSet : ruleSets) { if (ruleSet.getStatus().AVAILABLE != null && ruleSet.isRunSchedule()) { CoreResources.tenantSchema.set(schema); if(ruleSet.getItemId()!=null){ logger.debug("*** Item Specific Rule ***"); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); StudyBean currentStudy = (StudyBean) getStudyDao().findByPK(ruleSet.getStudyId()); ResourceBundleProvider.updateLocale(Locale.getDefault()); UserAccountBean ub = (UserAccountBean) getUserAccountDao().findByPK(1); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBulk(ruleSetBeans, false, currentStudy, ub, true); } else { logger.debug("*** Event Specific Rule ***"); StudyEventChangeDetails studyEventChangeDetails = new StudyEventChangeDetails(true, true); ArrayList<RuleSetBean> ruleSetBeans = new ArrayList<>(); ExpressionBean eBean = new ExpressionBean(); eBean.setValue(ruleSet.getTarget().getValue()+".A.B"); ruleSet.setTarget(eBean); ruleSetBeans.add(ruleSet); ruleSetService.runRulesInBeanProperty(ruleSetBeans ,1, studyEventChangeDetails); } } } } }
Source:
public Response getDetail(@PathParam("extension-name") String extensionName){ checkIfExtensionServiceIsEnabled(); validateExtensionName(extensionName); JSONObject result = new JSONObject(); try { result.put(EXTENSION_DETAIL,buildDetailResult(extensionName)); return Response.ok(result).build(); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }

Target:
public Response getDetail(@PathParam("extension-name") String extensionName){ checkIfExtensionServiceIsEnabled(); validateExtensionName(extensionName); try { return Response.ok(buildDetailResult(extensionName)).build(); } catch (Throwable e) { throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } }
Source:
public void deleteTaskContainerMappings(Iterable<String> taskNames) { for (String taskName : taskNames) { metadataStore.remove(keySerde.toBytes(taskName)); } }

Target:
public void deleteTaskContainerMappings(Iterable<String> taskNames) { for (String taskName : taskNames) { metadataStore.delete(keySerde.toBytes(taskName)); taskNameToContainerId.remove(taskName); } }
Source:
public void handleGenerateAndReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("Handle generate and replace keys response for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Generate and replace keys response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleGenerateAndReplaceKeysResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("Handle generate and replace keys response for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Generate and replace keys response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
public void testRegistersMetricsCorrectly() throws Exception { String testCluster = "testCoordinatorMetrics"; Coordinator coordinator = createCoordinator(_zkConnectionString, testCluster); coordinator.start(); List<BrooklinMetricInfo> metricInfos = coordinator.getMetricInfos(); DynamicMetricsManager metricsManager = DynamicMetricsManager.getInstance(); String coordinatorSimpleClassName = Coordinator.class.getSimpleName(); Map<String, BrooklinMetricInfo> metricInfoByName = metricInfos.stream() .filter(info -> info.getNameOrRegex().startsWith(coordinatorSimpleClassName)) .collect(Collectors.toMap(BrooklinMetricInfo::getNameOrRegex, Function.identity())); Map<String, Metric> metrics = metricsManager.getMetricRegistry().getMetrics().entrySet().stream() .filter(entry -> entry.getKey().startsWith(coordinatorSimpleClassName)) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); Assert.assertEquals(metricInfoByName.size(), metrics.size()); Map<Class<? extends BrooklinMetricInfo>, Class<? extends Metric>> metricInfoTypeToMetricType = new HashMap<>(); metricInfoTypeToMetricType.put(BrooklinCounterInfo.class, Counter.class); metricInfoTypeToMetricType.put(BrooklinGaugeInfo.class, Gauge.class); metricInfoTypeToMetricType.put(BrooklinHistogramInfo.class, Histogram.class); metricInfoTypeToMetricType.put(BrooklinMeterInfo.class, Meter.class); for (Map.Entry<String, BrooklinMetricInfo> entry : metricInfoByName.entrySet()) { String metricInfoKey = entry.getKey(); BrooklinMetricInfo metricInfo = entry.getValue(); Metric metric = metrics.get(metricInfoKey); Assert.assertNotNull(metric); Class<? extends Metric> actualMetricClazz = metric.getClass(); Class<? extends Metric> expectedMetricClazz = metricInfoTypeToMetricType.get(metricInfo.getClass()); Assert.assertTrue(expectedMetricClazz.isAssignableFrom(actualMetricClazz)); } coordinator.stop(); }

Target:
public void testRegistersMetricsCorrectly() throws Exception { String testCluster = "testCoordinatorMetrics"; Coordinator coordinator = createCoordinator(_zkConnectionString, testCluster); coordinator.start(); MetricsTestUtils.verifyMetrics(coordinator, DynamicMetricsManager.getInstance()); coordinator.stop(); }
Source:
public void test() throws Exception { final String tableName = getUniqueNames(1)[0]; final Connector c = getConnector(); c.tableOperations().create(tableName); Random random = new Random(); BatchWriter bw = c.createBatchWriter(tableName, null); for (int i = 0; i < 50000; i++) { byte[] row = new byte[100]; random.nextBytes(row); Mutation m = new Mutation(row); m.put("", "", ""); bw.addMutation(m); } bw.close(); c.tableOperations().flush(tableName, null, null, true); final AtomicBoolean stop = new AtomicBoolean(false); Thread t1 = slowScan(c, tableName, stop); t1.start(); Thread t2 = slowScan(c, tableName, stop); t2.start(); sleepUninterruptibly(500, TimeUnit.MILLISECONDS); long now = System.currentTimeMillis(); Scanner m = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY); Iterators.size(m.iterator()); long delay = System.currentTimeMillis() - now; System.out.println("Delay = " + delay); assertTrue("metadata table scan was slow", delay < 1000); assertFalse(stop.get()); stop.set(true); t1.interrupt(); t2.interrupt(); t1.join(); t2.join(); m.close(); }

Target:
public void test() throws Exception { final String tableName = getUniqueNames(1)[0]; final Connector c = getConnector(); c.tableOperations().create(tableName); Random random = new Random(); BatchWriter bw = c.createBatchWriter(tableName, null); for (int i = 0; i < 50000; i++) { byte[] row = new byte[100]; random.nextBytes(row); Mutation m = new Mutation(row); m.put("", "", ""); bw.addMutation(m); } bw.close(); c.tableOperations().flush(tableName, null, null, true); final AtomicBoolean stop = new AtomicBoolean(false); Thread t1 = slowScan(c, tableName, stop); t1.start(); Thread t2 = slowScan(c, tableName, stop); t2.start(); sleepUninterruptibly(500, TimeUnit.MILLISECONDS); long now = System.currentTimeMillis(); try (Scanner s = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY)) { Iterators.size(s.iterator()); } long delay = System.currentTimeMillis() - now; System.out.println("Delay = " + delay); assertTrue("metadata table scan was slow", delay < 1000); assertFalse(stop.get()); stop.set(true); t1.interrupt(); t2.interrupt(); t1.join(); t2.join(); }
Source:
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { Component c = defaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col); ColumnImpl column = myTableHeaderFacade.findColumnByViewIndex(col); if (column.getSort() == SortOrder.ASCENDING) { ((JLabel) c).setIcon(ascIcon); } if (column.getSort() == SortOrder.DESCENDING) { ((JLabel) c).setIcon(descIcon); } return c; }

Target:
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col) { Component c = myDefaultRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col); ColumnImpl column = myTableHeaderFacade.findColumnByViewIndex(col); if (column.getSort() == SortOrder.ASCENDING && c instanceof JLabel) { ((JLabel) c).setIcon(myAscIcon); } if (column.getSort() == SortOrder.DESCENDING && c instanceof JLabel) { ((JLabel) c).setIcon(myDescIcon); } return c; }
Source:
private void executeActions(Rule rule) { List<Action> actions = ((RuntimeRule) rule).getActions(); if (actions == null || actions.size() == 0) { return; } for (Iterator< Action>it = actions.iterator(); it.hasNext();) { RuntimeAction a = (RuntimeAction) it.next(); ActionHandler aHandler = a.getModuleHandler(); try { String rUID = rule.getUID(); Map<String, Object> context = getContext(rUID, a.getConnections()); Map<String, ?> outputs = aHandler.execute(context); if (outputs != null) { context = getContext(rUID); updateContext(rUID, a.getId(), outputs); } } catch (Throwable t) { logger.error("Fail to execute the action: " + a.getId(), t); } } }

Target:
private void executeActions(Rule rule) { List<Action> actions = ((RuntimeRule) rule).getActions(); if (actions == null || actions.size() == 0) { return; } RuleStatus ruleStatus = null; for (Iterator< Action>it = actions.iterator(); it.hasNext();) { ruleStatus = getRuleStatus(rule.getUID()); if (ruleStatus != RuleStatus.RUNNING) { return; } RuntimeAction a = (RuntimeAction) it.next(); ActionHandler aHandler = a.getModuleHandler(); try { String rUID = rule.getUID(); Map<String, Object> context = getContext(rUID, a.getConnections()); Map<String, ?> outputs = aHandler.execute(context); if (outputs != null) { context = getContext(rUID); updateContext(rUID, a.getId(), outputs); } } catch (Throwable t) { logger.error("Fail to execute the action: " + a.getId(), t); } } }
Source:
public String getRequestUrl(String reqContext, String page) { if (reqContext == null) { reqContext = DEFAULT_URL + DEFAULT_APP; } return reqContext + "/" + page; }

Target:
public static String getRequestUrl(String reqContext, String page) { if (reqContext == null) { reqContext = DEFAULT_URL + DEFAULT_APP; } return reqContext + "/" + page; }
Source:
private NetworkProviderProxy getProviderProxy() { if (providerProxy == null) { Provider<?> provider = providerDao.get(getNetwork().getProvidedBy().getProviderId()); providerProxy = providerProxyFactory.create(provider); } return providerProxy; }

Target:
private NetworkProviderProxy getProviderProxy() { if (providerProxy == null) { Provider<?> provider = getProvider(); providerProxy = providerProxyFactory.create(provider); } return providerProxy; }
Source:
public void setup() { j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy() .grant(Jenkins.READ, Item.READ, Item.DISCOVER, Item.CONFIGURE).everywhere().toAuthenticated() .grant(Jenkins.MANAGE).everywhere().to("bob")); }

Target:
public void setup() { j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); j.jenkins.setAuthorizationStrategy(new MockAuthorizationStrategy() .grant(Jenkins.READ, Item.READ, Item.DISCOVER, Item.CONFIGURE).everywhere().toAuthenticated() .grant(Jenkins.ADMINISTER).everywhere().to("bob")); }
Source:
public boolean createProcessesWithCalendar(ProcessDTO processDTO) { Collection<String> functionalDivisions; try { Process process = ServiceManager.getProcessService().getById(processDTO.getId()); Integer rulesetId = process.getRuleset().getId(); List<Property> workpieceProperties = process.getWorkpieces(); String docType = ""; for (Property workpieceProperty : workpieceProperties) { if ("DocType".equals(workpieceProperty.getTitle())) { docType = workpieceProperty.getValue(); break; } } if (rulesetCache.containsKey(rulesetId)) { functionalDivisions = rulesetCache.get(rulesetId); } else { Ruleset ruleset = ServiceManager.getRulesetService().getById(rulesetId); functionalDivisions = ServiceManager.getRulesetService().openRuleset(ruleset) .getFunctionalDivisions(FunctionalDivision.CREATE_CHILDREN_WITH_CALENDAR); rulesetCache.put(rulesetId, functionalDivisions); } if (functionalDivisions.contains(docType)) { return true; } } catch (IOException | DAOException e) { Helper.setErrorMessage(ERROR_READING, new Object[] {ObjectType.PROCESS.getTranslationSingular() }, logger, e); } return false; }

Target:
public boolean createProcessesWithCalendar(ProcessDTO processDTO) { Collection<String> functionalDivisions; try { Process process = ServiceManager.getProcessService().getById(processDTO.getId()); Integer rulesetId = process.getRuleset().getId(); String docType = ""; for (Property workpieceProperty : process.getWorkpieces()) { if ("DocType".equals(workpieceProperty.getTitle())) { docType = workpieceProperty.getValue(); break; } } if (rulesetCache.containsKey(rulesetId)) { functionalDivisions = rulesetCache.get(rulesetId); } else { Ruleset ruleset = ServiceManager.getRulesetService().getById(rulesetId); functionalDivisions = ServiceManager.getRulesetService().openRuleset(ruleset) .getFunctionalDivisions(FunctionalDivision.CREATE_CHILDREN_WITH_CALENDAR); rulesetCache.put(rulesetId, functionalDivisions); } if (functionalDivisions.contains(docType)) { return true; } } catch (IOException | DAOException e) { Helper.setErrorMessage(ERROR_READING, new Object[] {ObjectType.PROCESS.getTranslationSingular() }, logger, e); } return false; }
Source:
private static Registration createRegistration() { File tempKeystoreFile = TestFileUtil.createUniqueTempFile(authorityKeystorePath); X509CertificateGenerator certificateGenerator = new X509CertificateGenerator(); certificateGenerator.createAndStoreCACertificates(tempKeystoreFile); return certificateGenerator.createAgentCertificate(tempKeystoreFile, "blah"); }

Target:
private Registration createRegistration() throws IOException { File tempKeystoreFile = tmpFolder.newFile(); X509CertificateGenerator certificateGenerator = new X509CertificateGenerator(); certificateGenerator.createAndStoreCACertificates(tempKeystoreFile); return certificateGenerator.createAgentCertificate(tempKeystoreFile, "blah"); }
Source:
private void canClose(Collection<URI> uris) { String exceptionMessagePrefix = "The lock cannot be released because there are still streams flowing for the following URIs: "; String exceptionMessage = uris.parallelStream().filter(uri -> streamManagement.isKnowingAnOpenStreamTo(uri)) .map(uri -> uri.toString()).collect(Collectors.joining(", ", exceptionMessagePrefix, "")); if (exceptionMessage.length() > exceptionMessagePrefix.length()) { throw new IllegalStateException(exceptionMessage); } }

Target:
private void canClose(Collection<URI> uris) { String exceptionMessagePrefix = "The lock cannot be released because there are still streams flowing for the following URIs: "; String exceptionMessage = uris.parallelStream().filter(streamManagement::isKnowingAnOpenStreamTo) .map(uri -> uri.toString()).collect(Collectors.joining(", ", exceptionMessagePrefix, "")); if (exceptionMessage.length() > exceptionMessagePrefix.length()) { throw new IllegalStateException(exceptionMessage); } }
Source:
private void addAndOr(CodeWriter code, CondStack stack, IfCondition condition) throws CodegenException { Mode mode = condition.getMode(); String modeStr = mode == Mode.AND ? " && " : " || "; Iterator<IfCondition> it = condition.getArgs().iterator(); while (it.hasNext()) { IfCondition next = it.next(); if (next.getMode() == mode) { add(code, stack, next); } else { wrap(code, stack, next); } if (it.hasNext()) { code.add(modeStr); } } }

Target:
private void addAndOr(CodeWriter code, CondStack stack, IfCondition condition) throws CodegenException { String mode = condition.getMode() == Mode.AND ? " && " : " || "; Iterator<IfCondition> it = condition.getArgs().iterator(); while (it.hasNext()) { wrap(code, stack, it.next()); if (it.hasNext()) { code.add(mode); } } }
Source:
protected String getParagraphNumber(ArtifactReadable artifact, String templateContent) { String startParagraphNumber = "1"; Matcher matcher = headElementsPattern.matcher(templateContent); if (matcher.find()) { String elementType = matcher.group(0); if (elementType != null && elementType.equals(INSERT_ARTIFACT_HERE)) { if (artifact.isAttributeTypeValid(ParagraphNumber)) { String paragraphNum = artifact.getSoleAttributeValue(ParagraphNumber, ""); if (Strings.isValid(paragraphNum)) { startParagraphNumber = paragraphNum; } } } } return startParagraphNumber; }

Target:
protected String getParagraphNumber(ArtifactReadable artifact, String templateContent) { String startParagraphNumber = "1"; Matcher matcher = headElementsPattern.matcher(templateContent); if (matcher.find()) { String elementType = matcher.group(0); if (elementType != null && elementType.equals(INSERT_ARTIFACT_HERE)) { String paragraphNum = artifact.getSoleAttributeValue(ParagraphNumber, ""); if (Strings.isValid(paragraphNum)) { startParagraphNumber = paragraphNum; } } } return startParagraphNumber; }
Source:
public final PartitionDescProto getPartition(final String databaseName, final String tableName, final String partitionName) throws UndefinedPartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final PartitionIdentifierProto request = PartitionIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName) .setPartitionName(partitionName) .build(); final GetPartitionDescResponse response = stub.getPartitionByPartitionName(null, request); throwsIfThisError(response.getState(), UndefinedPartitionMethodException.class); throwsIfThisError(response.getState(), UndefinedPartitionException.class); ensureOk(response.getState()); return response.getPartition(); } catch (ServiceException e) { throw new RuntimeException(e); } }

Target:
public final PartitionDescProto getPartition(final String databaseName, final String tableName, final String partitionName) throws UndefinedDatabaseException, UndefinedTableException, UndefinedPartitionException, UndefinedPartitionMethodException { try { final BlockingInterface stub = getStub(); final PartitionIdentifierProto request = PartitionIdentifierProto.newBuilder() .setDatabaseName(databaseName) .setTableName(tableName) .setPartitionName(partitionName) .build(); final GetPartitionDescResponse response = stub.getPartitionByPartitionName(null, request); throwsIfThisError(response.getState(), UndefinedDatabaseException.class); throwsIfThisError(response.getState(), UndefinedTableException.class); throwsIfThisError(response.getState(), UndefinedPartitionMethodException.class); throwsIfThisError(response.getState(), UndefinedPartitionException.class); ensureOk(response.getState()); return response.getPartition(); } catch (ServiceException e) { throw new RuntimeException(e); } }
Source:
public Encounter createEncounter(String configName, DateTime encounterDatetime, String encounterType, String locationName, String patientUuid, String providerUuid, String visitUuid, String formUuid, Map<String, String> observations) { Location location = getLocationByName(configName, locationName); Patient patient = patientService.getPatientByUuid(configName, patientUuid); Provider provider = providerService.getProviderByUuid(configName, providerUuid); Visit visit = null; Form form = null; if (StringUtils.isNotEmpty(visitUuid)) { visit = visitService.getVisitByUuid(configName, visitUuid); } if (StringUtils.isNotEmpty(formUuid)) { form = formService.getFormByUuid(configName, formUuid); } List<Observation> observationList = MapUtils.isNotEmpty(observations) ? convertObservationMapToList(observations, encounterDatetime) : null; EncounterType type = new EncounterType(encounterType, null); Encounter encounter = new Encounter(location, type, encounterDatetime.toDate(), patient, visit, Collections.singletonList(provider.getPerson()), observationList, form); return encounterService.createEncounter(configName, encounter); }

Target:
public Encounter createEncounter(String configName, DateTime encounterDatetime, String encounterType, String locationName, String patientUuid, String providerUuid, String visitUuid, String formUuid, Map<String, String> observations) { Location location = getLocationByName(configName, locationName); Patient patient = patientService.getPatientByUuid(configName, patientUuid); Provider provider = providerService.getProviderByUuid(configName, providerUuid); Visit visit = null; Form form = null; if (StringUtils.isNotEmpty(visitUuid)) { visit = visitService.getVisitByUuid(configName, visitUuid); } if (StringUtils.isNotEmpty(formUuid)) { form = formService.getFormByUuid(configName, formUuid); } List<Observation> observationList = MapUtils.isNotEmpty(observations) ? convertObservationMapToList(observations, encounterDatetime) : null; EncounterType type = new EncounterType(null, encounterType); Encounter encounter = new Encounter(location, type, encounterDatetime.toDate(), patient, visit, Collections.singletonList(provider.getPerson()), observationList, form); return encounterService.createEncounter(configName, encounter); }
Source:
public static void setCustomTags(final Scope scope, final Map<String, Object> tags) { for (final Map.Entry<String, Object> entry : tags.entrySet()) { if (entry.getValue() instanceof Boolean) { scope.span().setTag(entry.getKey(), (Boolean) entry.getValue()); } else if (entry.getValue() instanceof Number) { scope.span().setTag(entry.getKey(), (Number) entry.getValue()); } else if (entry.getValue() instanceof String) { scope.span().setTag(entry.getKey(), (String) entry.getValue()); } else { LOG.error("Tag is not of the expected type"); continue; } } }

Target:
public static void setCustomTags(final Scope scope, final Map<String, Object> tags) { for (final Map.Entry<String, Object> entry : tags.entrySet()) { if (entry.getValue() instanceof Boolean) { scope.span().setTag(entry.getKey(), (Boolean) entry.getValue()); } else if (entry.getValue() instanceof Number) { scope.span().setTag(entry.getKey(), (Number) entry.getValue()); } else if (entry.getValue() instanceof String) { scope.span().setTag(entry.getKey(), (String) entry.getValue()); } else { LOG.warn("Tag is not of the expected type"); continue; } } }
Source:
public String asSummaryString() { return "filesystem"; }

Target:
public String asSummaryString() { return "Filesystem"; }
Source:
public Builder networks(final Map<String, AttachedNetwork> networks) { if (networks != null) { final ImmutableMap.Builder<String, AttachedNetwork> builder = ImmutableMap.builder(); for (Map.Entry<String, AttachedNetwork> entry : networks.entrySet()) { builder.put(entry.getKey(), entry.getValue()); } this.networks = builder.build(); } return this; }

Target:
public Builder networks(final Map<String, AttachedNetwork> networks) { if (networks != null) { this.networks = ImmutableMap.copyOf(networks); } return this; }
Source:
public RestTemplate newRestTemplate(String serviceUrl) { RestTemplate restTemplate = new RestTemplate(); try { URI serviceURI = new URI(serviceUrl); if (serviceURI.getUserInfo() != null) { String[] credentials = serviceURI.getUserInfo().split(":"); if (credentials.length == 2) { restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor( credentials[0], credentials[1])); } } } catch (URISyntaxException ignore) { } return restTemplate; }

Target:
public RestTemplate newRestTemplate(String serviceUrl) { RestTemplateBuilder restTemplateBuilder = new RestTemplateBuilder(); try { URI serviceURI = new URI(serviceUrl); if (serviceURI.getUserInfo() != null) { String[] credentials = serviceURI.getUserInfo().split(":"); if (credentials.length == 2) { restTemplateBuilder.interceptors(new BasicAuthorizationInterceptor( credentials[0], credentials[1])); } } } catch (URISyntaxException ignore) { } return restTemplateBuilder.build(); }
Source:
public GroupArrayAggregationState(Type type) { this.type = type; this.headBlockIndex = new ShortBigArray(NULL); this.headPosition = new IntBigArray(NULL); this.nextBlockIndex = new ShortBigArray(NULL); this.nextPosition = new IntBigArray(NULL); this.tailAbsoluteAddress = new LongBigArray(NULL); this.pageBuilder = new PageBuilder(ImmutableList.of(type)); this.values = new ArrayList<>(); this.sumPositions = new LongArrayList(); values.add(getCurrentBlockBuilder()); sumPositions.add(0L); valueBlocksRetainedSizeInBytes = 0; totalPositions = 0; capacity = 1024; nextBlockIndex.ensureCapacity(capacity); nextPosition.ensureCapacity(capacity); }

Target:
public GroupArrayAggregationState(Type type) { this.type = type; this.headBlockIndex = new ShortBigArray(NULL); this.headPosition = new IntBigArray(NULL); this.nextBlockIndex = new ShortBigArray(NULL); this.nextPosition = new IntBigArray(NULL); this.tailBlockIndex = new ShortBigArray(NULL); this.tailPosition = new IntBigArray(NULL); this.pageBuilderStatus = new PageBuilderStatus(MAX_BLOCK_SIZE, MAX_BLOCK_SIZE); this.currentBlockBuilder = type.createBlockBuilder(pageBuilderStatus.createBlockBuilderStatus(), 16); this.values = new ArrayList<>(); this.sumPositions = new LongArrayList(); values.add(currentBlockBuilder); sumPositions.add(0L); valueBlocksRetainedSizeInBytes = 0; totalPositions = 0; capacity = 1024; nextBlockIndex.ensureCapacity(capacity); nextPosition.ensureCapacity(capacity); }