auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean calculateReplicatedStateForStmt(AbstractParsedStmt stmt, Set<String> visitedTables) { if (stmt == null) { return true; } for ( StmtTableScan scan : stmt.allScans()) { <START> boolean guess; <END> if (scan instanceof StmtCommonTableScan) { guess = ((StmtCommonTableScan)scan).calculateReplicatedState(visitedTables); } else { guess = scan.getIsReplicated(); } if ( ! guess ) { return guess; } } return true; }</code><technical_language>I call this more descriptive, isReplicated</technical_language>

Target:
private boolean calculateReplicatedStateForStmt(AbstractParsedStmt stmt, Set<String> visitedTables) { if (stmt == null) { return true; } for ( StmtTableScan scan : stmt.allScans()) { boolean isReplicated; if (scan instanceof StmtCommonTableScan) { isReplicated = ((StmtCommonTableScan)scan).calculateReplicatedState(visitedTables); } else { isReplicated = scan.getIsReplicated(); } if ( ! isReplicated ) { return isReplicated; } } return true; }
Source:
<code><START> protected boolean canDoAction() { <END> addCanDoActionMessage(VdcBllMessages.VAR__ACTION__CREATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_VOLUME); if (!super.canDoAction()) { return false; } volume = getParameters().getVolume(); if (volume == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REQUIRED); return false; } setVdsGroupId(volume.getClusterId()); VDSGroup cluster = getVdsGroup(); if(cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if(!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } if (StringHelper.isNullOrEmpty(volume.getName())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_REQUIRED); return false; } if (volume.getVolumeType() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_TYPE_REQUIRED); return false; } if (volume.getTransportType() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_TRANSPORT_TYPE_REQUIRED); return false; } return validateBricks(volume); }</code><technical_language>put messages protected void setActionMessageParameters() {}</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } setVdsGroupId(volume.getClusterId()); VDSGroup cluster = getVdsGroup(); if (cluster == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if (!cluster.supportsGlusterService()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER); return false; } return validateBricks(volume); }
Source:
<code>public void detachNodeFailInPassiveAtPrepare() throws Exception { final int activeId = findActive(1).getAsInt(); final int passiveId = findPassives(1)[0]; String propertySettingString = "stripe.1.node." + passiveId + ".tc-properties.detachStatus=prepareDeletion-failure"; assertThat(configToolInvocation("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString), is(successful())); out.clearLog(1, passiveId); assertThat( configToolInvocation("detach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, passiveId)), containsOutput("Two-Phase commit failed")); waitUntil(out.getLog(1, passiveId), containsLog("Restarting the server")); <START> waitUntil(out.getLog(1, passiveId), containsLog("Moved to State[ PASSIVE-STANDBY ]")); <END> }</code><technical_language>now, #615, if prepare phase is failing, node restarted Nomad transaction is applied. status quo ;-)</technical_language>

Target:
public void detachNodeFailInPassiveAtPrepare() throws Exception { final int activeId = findActive(1).getAsInt(); final int passiveId = findPassives(1)[0]; String propertySettingString = "stripe.1.node." + passiveId + ".tc-properties.detachStatus=prepareDeletion-failure"; assertThat(configToolInvocation("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString), is(successful())); assertThat( configToolInvocation("detach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, passiveId)), containsOutput("Two-Phase commit failed")); assertThat(getUpcomingCluster("localhost", getNodePort(1, activeId)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, activeId)).getNodeCount(), is(equalTo(2))); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, passiveId)).getNodeCount(), is(equalTo(2))); withTopologyService(1, activeId, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, passiveId, topologyService -> assertTrue(topologyService.isActivated())); }
Source:
<code>public void benchNioWavTrack() throws Exception { WavTrackImpl wavTrackImpl = new WavTrackImpl(url); boolean isEOMReached = false; while (!isEOMReached) { Frame process = wavTrackImpl.process(0); isEOMReached = process.isEOM(); } <START> wavTrackImpl.close(); <END> }</code><technical_language>If exception thrown, wrap wavTrackImpl.close() in a try-finally block, guarantee resources properly closed</technical_language>

Target:
public void benchNioWavTrack() throws Exception { try { rsp = new CachedRemoteStreamProvider(10); wavTrackImpl = new WavTrackImpl(url, rsp); boolean isEOMReached = false; while (!isEOMReached) { Frame process = wavTrackImpl.process(0); isEOMReached = process.isEOM(); } }finally { wavTrackImpl.close(); } }
Source:
<code>public void onFailure(Throwable caught) { close(); <START> status.setContents("Monitoring is unavailable on this host. Maybe node was started with --disableMonitoring option.<br>"+ <END> "Error message: "+ JSONUtils.getJsonErrorMessage(caught)); }</code><technical_language>Monitoring is unavailable this host. monitoring disabled disableMonitoring option error occurred. More information node logs</technical_language>

Target:
public void onFailure(Throwable caught) { close(); status.setContents("Monitoring is unavailable on this host. <br>" + "Either monitoring was disabled with the disableMonitoring option or an error occurred. <br>" + "More information are available inside the node logs."); }
Source:
<code>protected Quip getRandomQuip(QuipType quipType, Queue<String> recentlyUsedQuips){ QuipStore quipStore = QuipStore.getInstance(); LOG.debug("Recently used "+quipType.toString().toLowerCase()+"s in user session:\n"+recentlyUsedQuips.toString()); int maxQuipHistorySize = determineMaxQuipHistorySize(quipStore.getQuips(quipType).size()); Quip quip = quipStore.getRandomQuip(quipType); <START> while(recentlyUsedQuips.contains(quip.getQuipGroup())){ <END> quip = quipStore.getRandomQuip(quipType); } recentlyUsedQuips.add(quip.getQuipGroup()); while(recentlyUsedQuips.size() > maxQuipHistorySize){ recentlyUsedQuips.remove(); } LOG.debug(quipType.toString().toLowerCase()+" being used ("+quip.getQuipGroup()+"): "+quip.getText()); return quip; }</code><technical_language>set a max number of iterations give up? I happen, safe..</technical_language>

Target:
protected Quip getRandomQuip(QuipType quipType, Queue<String> recentlyUsedQuips){ QuipStore quipStore = QuipStore.getInstance(); LOG.debug("Recently used "+quipType.toString().toLowerCase()+"s in user session:\n"+recentlyUsedQuips.toString()); int maxQuipHistorySize = determineMaxQuipHistorySize(quipStore.getQuips(quipType).size()); Quip quip = quipStore.getRandomQuip(quipType); int rerolls = 0; while(recentlyUsedQuips.contains(quip.getQuipGroup()) && rerolls < MAX_QUIP_REROLLS){ quip = quipStore.getRandomQuip(quipType); rerolls++; } recentlyUsedQuips.add(quip.getQuipGroup()); while(recentlyUsedQuips.size() > maxQuipHistorySize){ recentlyUsedQuips.remove(); } LOG.debug(quipType.toString().toLowerCase()+" being used ("+quip.getQuipGroup()+"): "+quip.getText()); return quip; }
Source:
<code>private void persistDiffPreferences() { setEnabled(false); <START> listenablePrefs.save(new GerritCallback<VoidResult>() { <END> @Override public void onSuccess(VoidResult result) { setEnabled(true); } @Override public void onFailure(Throwable caught) { setEnabled(true); } }); }</code><technical_language>style RPC calls new change screen. migrated REST API</technical_language>

Target:
private void persistDiffPreferences() { setEnabled(false); DiffPreferenceInput in = DiffPreferenceInput.create(); final AccountDiffPreference p = listenablePrefs.get(); in.fromAccountDiffPreference(p); AccountApi.self().view("preferences.diff") .put(in, new AsyncCallback<JavaScriptObject>() { @Override public void onSuccess(JavaScriptObject result) { Gerrit.setAccountDiffPreference(p); setEnabled(true); } @Override public void onFailure(Throwable caught) { setEnabled(true); } }); }
Source:
<code>public void start(StartContext context) { healthReporter = new HealthReporter(emptyLivenessChecksStatus, emptyReadinessChecksStatus); modelControllerClient = modelControllerClientFactory.get().createClient(managementExecutor.get()); <START> if (System.getProperty("__MP_HEALTH_TCK_DISABLE_SERVER_CHECKS") == null) { <END> healthReporter.addServerReadinessCheck(new ServerStateCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); healthReporter.addServerReadinessCheck(new NoBootErrorsCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); healthReporter.addServerReadinessCheck(new DeploymentsStatusCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); } HealthCheckResponse.setResponseProvider(new ResponseProvider()); }</code><technical_language>basically disable checks. remove _TCK_part some workaround flag. advertise feature compatibility flag. If for some reason new behaviour problem someone</technical_language>

Target:
public void start(StartContext context) { final boolean defaultServerProceduresDisabled = ConfigProvider.getConfig().getOptionalValue("mp.health.disable-default-procedures", Boolean.class).orElse(false); healthReporter = new HealthReporter(emptyLivenessChecksStatus, emptyReadinessChecksStatus, defaultServerProceduresDisabled); modelControllerClient = modelControllerClientFactory.get().createClient(managementExecutor.get()); if (!defaultServerProceduresDisabled) { healthReporter.addServerReadinessCheck(new ServerStateCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); healthReporter.addServerReadinessCheck(new NoBootErrorsCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); healthReporter.addServerReadinessCheck(new DeploymentsStatusCheck(modelControllerClient), Thread.currentThread().getContextClassLoader()); } HealthCheckResponse.setResponseProvider(new ResponseProvider()); }
Source:
<code>public void filter_users_where_not_a_member_of_group() throws Exception { Group expectedGroup = getGroupByName(NAME_GROUP_TWO); <START> assertNotContainsUser(expectedGroup, TEST_USER_ID); <END> SCIMSearchResult<User> result = searchUser(String.format("not(groups eq \"%s\")", expectedGroup.getId())); assertThat(String.format("The user %s is in the group %s but should not be!", TEST_USER_NAME, NAME_GROUP_TWO), result.getResources(), not(hasItem(new User.Builder(TEST_USER_NAME).setId(TEST_USER_ID).build()))); }</code><technical_language>holds true here. I fixture is set correctly</technical_language>

Target:
public void filter_users_where_not_a_member_of_group() throws Exception { final SCIMSearchResult<User> result = searchUser("not(groups eq \"44e8645f-a0ff-4b5b-849e-d9f83b9a9bd9\")"); final User expectedUser = new User.Builder(TEST_USER_NAME).setId("cef9452e-00a9-4cec-a086-d171374ffbef") .build(); assertThat("The user marissa is in the group test_group02 but should not be!", result.getResources(), not(hasItem(expectedUser))); }
Source:
<code>public void resendVerificationToken(ChannelType type, AccountId accountId) { checkNotNull(type); checkNotNull(accountId); Study study = studyService.getStudy(accountId.getStudyId()); Account account = accountDao.getAccount(accountId); if (account != null) { if (type == ChannelType.EMAIL) { sendEmailVerificationToken(study, account.getId(), account.getEmail()); } else if (type == ChannelType.PHONE) { sendPhoneVerificationToken(study, account.getId(), account.getPhone()); <START> } <END> } }</code><technical_language>else throws a "impossible code path" exception? This way, if add another channel update this code, get exception instead of a silent failure</technical_language>

Target:
public void resendVerificationToken(ChannelType type, AccountId accountId) { checkNotNull(accountId); Study study = studyService.getStudy(accountId.getStudyId()); Account account = accountDao.getAccount(accountId); if (account != null) { if (type == ChannelType.EMAIL) { sendEmailVerificationToken(study, account.getId(), account.getEmail()); } else if (type == ChannelType.PHONE) { sendPhoneVerificationToken(study, account.getId(), account.getPhone()); } else { throw new UnsupportedOperationException("Channel type not implemented"); } } }
Source:
<code>public SplitEnumerator<MockSourceSplit, List<MockSourceSplit>> restoreEnumerator( SplitEnumeratorContext<MockSourceSplit> enumContext, List<MockSourceSplit> checkpoint) throws IOException { <START> FutureNotifier futureNotifier = new FutureNotifier(); <END> FutureCompletingBlockingQueue<RecordsWithSplitIds<int[]>> elementsQueue = new FutureCompletingBlockingQueue<>(futureNotifier); return new MockSplitEnumerator(checkpoint, enumContext); }</code><technical_language>FutureNotifier queue needed here</technical_language>

Target:
public SplitEnumerator<MockSourceSplit, List<MockSourceSplit>> restoreEnumerator( SplitEnumeratorContext<MockSourceSplit> enumContext, List<MockSourceSplit> checkpoint) throws IOException { return new MockSplitEnumerator(checkpoint, enumContext); }
Source:
<code>private void refreshTreeContentFromLS() { if (symbols != null && !symbols.isDone()) { symbols.cancel(true); } lastError = null; DocumentSymbolParams params = new DocumentSymbolParams(new TextDocumentIdentifier(info.getFileUri().toString())); symbols = info.getLanguageClient().getTextDocumentService().documentSymbol(params); symbols.thenAccept((List<? extends SymbolInformation> t) -> { symbolsModel.update(t); viewer.getControl().getDisplay().asyncExec(() -> { viewer.refresh(); }); if (!InstanceScope.INSTANCE.getNode(CNFOutlinePage.ID + '.' + info.getFileUri()) .getBoolean(CNFOutlinePage.linkWithEditorPreference, true)) { return; } Display.getDefault().asyncExec(() -> { IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); ITextOperationTarget target = editorPart.getAdapter(ITextOperationTarget.class); <START> if (editorPart instanceof AbstractTextEditor && target instanceof ITextViewerExtension5) { <END> ITextSelection selection = (ITextSelection) ((AbstractTextEditor) editorPart).getSelectionProvider() .getSelection(); int offset = ((ITextViewerExtension5) target).widgetOffset2ModelOffset(selection.getOffset()); CNFOutlinePage.refreshTreeSelection(viewer, offset, info.getDocument()); } }); }); symbols.exceptionally(ex -> { lastError = ex; viewer.getControl().getDisplay().asyncExec(() -> { viewer.refresh(); }); return Collections.emptyList(); }); }</code><technical_language>do want apply in case viewer is a ITextViewerExtension5. offset conditional viewer type</technical_language>

Target:
private void refreshTreeContentFromLS() { if (symbols != null && !symbols.isDone()) { symbols.cancel(true); } lastError = null; DocumentSymbolParams params = new DocumentSymbolParams(new TextDocumentIdentifier(info.getFileUri().toString())); symbols = info.getLanguageClient().getTextDocumentService().documentSymbol(params); symbols.thenAccept((List<? extends SymbolInformation> t) -> { symbolsModel.update(t); viewer.getControl().getDisplay().asyncExec(() -> { viewer.refresh(); }); if (!InstanceScope.INSTANCE.getNode(CNFOutlinePage.ID + '.' + info.getFileUri()) .getBoolean(CNFOutlinePage.linkWithEditorPreference, true)) { return; } Display.getDefault().asyncExec(() -> { IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .getActiveEditor(); if (editorPart instanceof AbstractTextEditor) { ITextSelection selection = (ITextSelection) ((AbstractTextEditor) editorPart).getSelectionProvider() .getSelection(); CNFOutlinePage.refreshTreeSelection(viewer, selection.getOffset(), info.getDocument()); } }); }); symbols.exceptionally(ex -> { lastError = ex; viewer.getControl().getDisplay().asyncExec(() -> { viewer.refresh(); }); return Collections.emptyList(); }); }
Source:
<code>public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (!(source instanceof FlashbackAbility) && affectedControllerId.equals(source.getControllerId())) { Player player = game.getPlayer(affectedControllerId); Card card = game.getCard(objectId); if (card != null && player != null && card.equals(player.getGraveyard().getTopCard(game)) && (card.isInstant() || card.isSorcery()) <START> && game.getState().getZone(objectId).equals(Zone.GRAVEYARD)) { <END> return true; } } return false; }</code><technical_language>Zone is enum, ==</technical_language>

Target:
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { if (!(source instanceof FlashbackAbility) && affectedControllerId.equals(source.getControllerId())) { Player player = game.getPlayer(affectedControllerId); Card card = game.getCard(objectId); if (card != null && player != null && card.equals(player.getGraveyard().getTopCard(game)) && StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game) && game.getState().getZone(objectId) == Zone.GRAVEYARD) { game.getState().setValue("BosiumStrip", card); return true; } } return false; }
Source:
<code>public void connectionLost(Throwable t) { <START> logger.error(String.format("MQTT connection to broker '{}' was lost", name), t); <END> started = false; logger.info("Starting connection helper to periodically try restore connection to broker '{}'", name); MqttBrokerConnectionHelper helper = new MqttBrokerConnectionHelper(this); reconnectTimer = new Timer(true); reconnectTimer.schedule(helper, 10000, RECONNECT_FREQUENCY); }</code><technical_language>in logger.error String.format called implicitly</technical_language>

Target:
public void connectionLost(Throwable t) { logger.error("MQTT connection to broker was lost", t); started = false; logger.info("Starting connection helper to periodically try restore connection to broker '{}'", name); MqttBrokerConnectionHelper helper = new MqttBrokerConnectionHelper(this); reconnectTimer = new Timer(true); reconnectTimer.schedule(helper, 10000, RECONNECT_FREQUENCY); }
Source:
<code><START> public FileSegment<TrecCollection.Document> createFileSegment(Path p) throws IOException { <END> return new FileSegment<>(p); }</code><technical_language>need type</technical_language>

Target:
public FileSegment<Document> createFileSegment(Path p) throws IOException { return new FileSegment<>(p); }
Source:
<code>public int compareExcludingSensitivity(PointSensitivity other) { if (other instanceof ZeroRateSensitivity) { ZeroRateSensitivity otherZero = (ZeroRateSensitivity) other; return ComparisonChain.start() .compare(currencyCurve, otherZero.currencyCurve) .compare(date, otherZero.date) <START> .compare(currency, otherZero.currency) <END> .result(); } return getClass().getSimpleName().compareTo(other.getClass().getSimpleName()); }</code><technical_language>Currency date in file, match ordering in IborRateSensitivity</technical_language>

Target:
public int compareExcludingSensitivity(PointSensitivity other) { if (other instanceof ZeroRateSensitivity) { ZeroRateSensitivity otherZero = (ZeroRateSensitivity) other; return ComparisonChain.start() .compare(curveCurrency, otherZero.curveCurrency) .compare(currency, otherZero.currency) .compare(date, otherZero.date) .result(); } return getClass().getSimpleName().compareTo(other.getClass().getSimpleName()); }
Source:
<code>private void updateActionBarTitle(int page) { String sura = QuranInfo.getSuraNameFromPage(this, page, true); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { <START> actionBar.setDisplayShowTitleEnabled(true); <END> actionBar.setTitle(sura); String desc = QuranInfo.getPageSubtitle(this, page); actionBar.setSubtitle(desc); } }</code><technical_language>a reason hiding translation spinner (in fact, is a separate method for updating actionbar spinner)</technical_language>

Target:
private void updateActionBarTitle(int page) { String sura = QuranInfo.getSuraNameFromPage(this, page, true); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { translationsSpinner.setVisibility(View.GONE); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle(sura); String desc = QuranInfo.getPageSubtitle(this, page); actionBar.setSubtitle(desc); } }
Source:
<code>public GuiContainer createGui(InventoryPlayer inventoryplayer, World world, BlockPos pos) { <START> return new GuiTinkerTank((ContainerTinkerTank) createContainer(inventoryplayer, world, pos), this); <END> }</code><technical_language>Unneeded cast</technical_language>

Target:
public GuiContainer createGui(InventoryPlayer inventoryplayer, World world, BlockPos pos) { return new GuiTinkerTank(createContainer(inventoryplayer, world, pos), this); }
Source:
<code>public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; final HttpServletResponse response = (HttpServletResponse) servletResponse; <START> boolean isGzipped = Optional <END> .ofNullable(request.getHeader(CONTENT_ENCODING)) .map(encoding -> encoding.contains("gzip")) .orElse(false); if (isGzipped && !POST.equals(request.getMethod())) { throw new IllegalStateException(request.getMethod() + " method doesn't support gzip content encoding"); } else if (isGzipped) { request = new GzipServletRequestWrapper(request); } chain.doFilter(request, response); }</code><technical_language>final</technical_language>

Target:
public final void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse, final FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; final boolean isGzipped = Optional .ofNullable(request.getHeader(CONTENT_ENCODING)) .map(encoding -> encoding.contains("gzip")) .orElse(false); if (isGzipped && !POST.equals(request.getMethod())) { reportNotAcceptableError((HttpServletResponse) servletResponse, request); return; } else if (isGzipped) { request = new GzipServletRequestWrapper(request); } chain.doFilter(request, servletResponse); }
Source:
<code>public void convertEmptyAttrValueToNull(Attribute attribute) { if(attribute.getValue() == null) { return; } if (attribute.getValue() instanceof String) { if(((String)attribute.getValue()).matches("\\s*")) { attribute.setValue(null); } } else if (attribute.getValue() instanceof Boolean) { if(attribute.getValue().equals(Boolean.FALSE)) { attribute.setValue(null); } } else if (attribute.getValue() instanceof ArrayList) { if(((ArrayList)attribute.getValue()).isEmpty()) { attribute.setValue(null); } } else if (attribute.getValue() instanceof HashMap) { <START> if(((HashMap)attribute.getValue()).isEmpty()) { <END> attribute.setValue(null); } } }</code><technical_language>LinkedHashMap attribute for a map. I prefer solution, checks attribute type stored in a object (class names including large+className). do @licehammer ? this method ignore values of java types, generic List/Map instead ArrayList/HashMap</technical_language>

Target:
public void convertEmptyAttrValueToNull(Attribute attribute) throws ConsistencyErrorException { if(attribute.getValue() == null) { return; } if (attribute.getValue() instanceof Integer) { return; } if (attribute.getValue() instanceof String) { if(((String)attribute.getValue()).matches("\\s*")) { attribute.setValue(null); } } else if (attribute.getValue() instanceof Boolean) { if(attribute.getValue().equals(Boolean.FALSE)) { attribute.setValue(null); } } else if (attribute.getValue() instanceof ArrayList) { if(((ArrayList)attribute.getValue()).isEmpty()) { attribute.setValue(null); } } else if (attribute.getValue() instanceof LinkedHashMap) { if(((LinkedHashMap)attribute.getValue()).isEmpty()) { attribute.setValue(null); } } else { throw new ConsistencyErrorException("Invalid attribute value type: " + attribute.getType() + " class: " + attribute.getValue().getClass().getName()); } }
Source:
<code>public XStreamMarshaller (List<DMNExtensionRegister> extensionRegisters) { this.extensionRegisters = new ArrayList<DMNExtensionRegister>(); <START> this.extensionRegisters.addAll(extensionRegisters); <END> }</code><technical_language>new ArrayList<>(extensionRegisters) do thing, additional benefit of properly sizing list</technical_language>

Target:
public XStreamMarshaller (List<DMNExtensionRegister> extensionRegisters) { this.extensionRegisters.addAll(extensionRegisters); }
Source:
<code>public synchronized void onContent(Response response, ByteBuffer content) { int length = content.remaining(); size += length; if (size > maxLength) { response.abort(new ResponseTooLargeException()); return; } while (length > 0) { <START> allocateCurrentArray(); <END> int readLength = min(length, currentArray.length - nextBytes); content.get(currentArray, nextBytes, readLength); length -= readLength; nextBytes += readLength; } }</code><technical_language>In this case prefer java if (currentBufferPosition >= currentBuffer.length) { allocateNewBuffer(); } This leaves check in main loop puts allocation (i.e., slow path) in a separate method. Of validate in allocate method is remaining space throw exception if not</technical_language>

Target:
public synchronized void onContent(Response response, ByteBuffer content) { int length = content.remaining(); size += length; if (size > maxLength) { response.abort(new ResponseTooLargeException()); return; } while (length > 0) { if (currentBufferPosition >= currentBuffer.length) { allocateCurrentBuffer(); } int readLength = min(length, currentBuffer.length - currentBufferPosition); content.get(currentBuffer, currentBufferPosition, readLength); length -= readLength; currentBufferPosition += readLength; } }
Source:
<code>public long getUpdateCount() { <START> return Math.max(parent.getUpdateCount(), getPropCacheAccessor().getZooCache().getUpdateCount()); <END> }</code><technical_language>This sum of parent self, max</technical_language>

Target:
public long getUpdateCount() { return parent.getUpdateCount() + getPropCacheAccessor().getZooCache().getUpdateCount(); }
Source:
<code>public long getQueuedQueries() { <START> return getQuerySvc().getQueuedQueriesCount(); <END> }</code><technical_language>return return values metricRegistry, instead of queryservice</technical_language>

Target:
public long getQueuedQueries() { return queuedQueries.getValue(); }
Source:
<code>void convertToReftable(boolean writeLogs, boolean backup) throws IOException { File newRefs = new File(getDirectory(), "refs.new"); File reftableDir = new File(getDirectory(), Constants.REFTABLE); if (reftableDir.exists() && reftableDir.listFiles().length > 0) { throw new IOException(JGitText.get().reftableDirExists); } FileReftableDatabase.convertFrom(this, newRefs, writeLogs); File refsFile = new File(getDirectory(), "refs"); File packedRefs = new File(getDirectory(), Constants.PACKED_REFS); File logsDir = new File(getDirectory(), Constants.LOGS); List<String> additional = <START> this.getRefDatabase().getAdditionalRefs().stream().map(r <END> -> r.getName()).collect( Collectors.toList()); additional.add(Constants.HEAD); if (backup) { FileUtils.rename(refsFile, new File(getDirectory(), "refs.old")); if (packedRefs.exists()) { FileUtils.rename(packedRefs, new File(getDirectory(), Constants.PACKED_REFS + ".old")); } if (logsDir.exists()) { FileUtils.rename(logsDir, new File(getDirectory(), Constants.LOGS + ".old")); } for (String r : additional) { FileUtils.rename(new File(getDirectory(), r), new File(getDirectory(), r + ".old")); } } else { packedRefs.delete(); FileUtils.delete(logsDir, FileUtils.RECURSIVE); FileUtils.delete(refsFile, FileUtils.RECURSIVE); for (String r : additional) { new File(getDirectory(), r).delete(); } } FileUtils.rename(newRefs, refsFile); refs.close(); refs = new FileReftableDatabase(this, refsFile); }</code><technical_language>Is this needed</technical_language>

Target:
void convertToReftable(boolean writeLogs, boolean backup) throws IOException { File newRefs = new File(getDirectory(), "refs.new"); File reftableDir = new File(getDirectory(), Constants.REFTABLE); if (reftableDir.exists() && reftableDir.listFiles().length > 0) { throw new IOException(JGitText.get().reftableDirExists); } FileReftableDatabase.convertFrom(this, newRefs, writeLogs); File refsFile = new File(getDirectory(), "refs"); File packedRefs = new File(getDirectory(), Constants.PACKED_REFS); File logsDir = new File(getDirectory(), Constants.LOGS); List<String> additional = getRefDatabase().getAdditionalRefs().stream() .map(Ref::getName).collect(toList()); additional.add(Constants.HEAD); if (backup) { FileUtils.rename(refsFile, new File(getDirectory(), "refs.old")); if (packedRefs.exists()) { FileUtils.rename(packedRefs, new File(getDirectory(), Constants.PACKED_REFS + ".old")); } if (logsDir.exists()) { FileUtils.rename(logsDir, new File(getDirectory(), Constants.LOGS + ".old")); } for (String r : additional) { FileUtils.rename(new File(getDirectory(), r), new File(getDirectory(), r + ".old")); } } else { packedRefs.delete(); FileUtils.delete(logsDir, FileUtils.RECURSIVE); FileUtils.delete(refsFile, FileUtils.RECURSIVE); for (String r : additional) { new File(getDirectory(), r).delete(); } } FileUtils.rename(newRefs, refsFile); refs.close(); refs = new FileReftableDatabase(this, refsFile); }
Source:
<code>private void initTemplates() { <START> if (templateContainer == null) { <END> return; } for (TemplateData template : templateContainer.getTemplateData()) { add(template); } }</code><technical_language>Is possilbe templateContainer is null</technical_language>

Target:
private void initTemplates() { if (templateContainer == null) { return; } addAll(templateContainer.getTemplateData()); }
Source:
<code>public void testFailedMetadataUpdate() throws Throwable { Path testFile = path("testFile"); FSDataOutputStream outputStream = fs.create(testFile); outputStream.write(1); useIOExceptionMetadataStore(); if (failOnError) { <START> Exception thrown = intercept(MetadataPersistenceException.class, () -> { <END> outputStream.close(); }); assertTrue("expected MetadataPersistenceException wasn't thrown", thrown instanceof MetadataPersistenceException); assertEquals("cause didn't match original exception", ioException, thrown.getCause()); } else { outputStream.close(); assertEquals(1, fs.getInstrumentation().getCounterValue(Statistic.IGNORED_ERRORS)); } }</code><technical_language>intercept is templated; class of return MetadataPersistenceException. Change variable need do instanceOf check</technical_language>

Target:
public void testFailedMetadataUpdate() throws Throwable { Path testFile = path("testFile"); FSDataOutputStream outputStream = fs.create(testFile); outputStream.write(1); if (failOnError) { MetadataPersistenceException thrown = intercept( MetadataPersistenceException.class, () -> { outputStream.close(); }); assertEquals("cause didn't match original exception", ioException, thrown.getCause()); } else { MetricDiff ignoredCount = new MetricDiff(fs, Statistic.IGNORED_ERRORS); outputStream.close(); ignoredCount.assertDiffEquals("ignored errors", 1); } }
Source:
<code>public synchronized void start() throws Exception { if (state == State.RUNNING) { LOG.debug("Ignore start() call on HTTP service since it has already been started.", serviceName); return; } if (state != State.NOT_STARTED) { if (state == State.STOPPED) { throw new IllegalStateException("Cannot start the HTTP service " + serviceName + " again since it has been stopped"); } throw new IllegalStateException("Cannot start the HTTP service " + serviceName + " because it was failed earlier"); } try { LOG.info("Starting HTTP Service at address {}", serviceName, bindAddress); channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE); resourceHandler.init(handlerContext); eventExecutorGroup = createEventExecutorGroup(execThreadPoolSize); bootstrap = createBootstrap(channelGroup); Channel serverChannel = bootstrap.bind(bindAddress).sync().channel(); channelGroup.add(serverChannel); bindAddress = (InetSocketAddress) serverChannel.localAddress(); LOG.debug("Started HTTP Service at address {}", serviceName, bindAddress); state = State.RUNNING; } catch (Throwable t) { channelGroup.close().awaitUninterruptibly(); try { if (bootstrap != null) { shutdownExecutorGroups(0, 5, TimeUnit.SECONDS, bootstrap.config().group(), bootstrap.config().childGroup(), eventExecutorGroup); } else { shutdownExecutorGroups(0, 5, TimeUnit.SECONDS, eventExecutorGroup); } } catch (Throwable t2) { } state = State.FAILED; <START> throw (Exception) t; <END> } }</code><technical_language>This is good practice. do this is Exception, Error, cast fail</technical_language>

Target:
public synchronized void start() throws Throwable { if (state == State.RUNNING) { LOG.debug("Ignore start() call on HTTP service since it has already been started.", serviceName); return; } if (state != State.NOT_STARTED) { if (state == State.STOPPED) { throw new IllegalStateException("Cannot start the HTTP service " + serviceName + " again since it has been stopped"); } throw new IllegalStateException("Cannot start the HTTP service " + serviceName + " because it was failed earlier"); } try { LOG.info("Starting HTTP Service at address {}", serviceName, bindAddress); channelGroup = new DefaultChannelGroup(ImmediateEventExecutor.INSTANCE); resourceHandler.init(handlerContext); eventExecutorGroup = createEventExecutorGroup(execThreadPoolSize); bootstrap = createBootstrap(channelGroup); Channel serverChannel = bootstrap.bind(bindAddress).sync().channel(); channelGroup.add(serverChannel); bindAddress = (InetSocketAddress) serverChannel.localAddress(); LOG.debug("Started HTTP Service at address {}", serviceName, bindAddress); state = State.RUNNING; } catch (Throwable t) { channelGroup.close().awaitUninterruptibly(); try { if (bootstrap != null) { shutdownExecutorGroups(0, 5, TimeUnit.SECONDS, bootstrap.config().group(), bootstrap.config().childGroup(), eventExecutorGroup); } else { shutdownExecutorGroups(0, 5, TimeUnit.SECONDS, eventExecutorGroup); } } catch (Throwable t2) { } state = State.FAILED; throw t; } }
Source:
<code>private FileObject processFile(FileObject file) throws AxisFault { <START> boolean isFailedRecord = VFSUtils.isFailRecord(fsManager, file); <END> if(isFailedRecord) { return file; } else { try { FileContent content = file.getContent(); String fileName = file.getName().getBaseName(); String filePath = file.getName().getPath(); String fileURI = file.getName().getURI(); if (injectHandler != null) { Map<String, Object> transportHeaders = new HashMap<String, Object>(); transportHeaders.put(VFSConstants.FILE_PATH, filePath); transportHeaders.put(VFSConstants.FILE_NAME, fileName); transportHeaders.put(VFSConstants.FILE_URI, fileURI); try { transportHeaders.put(VFSConstants.FILE_LENGTH, content.getSize()); transportHeaders.put(VFSConstants.LAST_MODIFIED, content.getLastModifiedTime()); } catch (FileSystemException e) { log.warn("Unable to set file length or last modified date header.", e); } injectHandler.setTransportHeaders(transportHeaders); if (!injectHandler.invoke(file)) { return null; } } } catch (FileSystemException e) { log.error("Error reading file content or attributes : " + file, e); } return file; } }</code><technical_language>isFailedRecord() checking this again? done top. This is additional io operation. formatting is done properly</technical_language>

Target:
private FileObject processFile(FileObject file) throws AxisFault { try { FileContent content = file.getContent(); String fileName = file.getName().getBaseName(); String filePath = file.getName().getPath(); String fileURI = file.getName().getURI(); if (injectHandler != null) { Map<String, Object> transportHeaders = new HashMap<String, Object>(); transportHeaders.put(VFSConstants.FILE_PATH, filePath); transportHeaders.put(VFSConstants.FILE_NAME, fileName); transportHeaders.put(VFSConstants.FILE_URI, fileURI); try { transportHeaders.put(VFSConstants.FILE_LENGTH, content.getSize()); transportHeaders.put(VFSConstants.LAST_MODIFIED, content.getLastModifiedTime()); } catch (FileSystemException e) { log.warn("Unable to set file length or last modified date header.", e); } injectHandler.setTransportHeaders(transportHeaders); if (!injectHandler.invoke(file)) { return null; } } } catch (FileSystemException e) { log.error("Error reading file content or attributes : " + file, e); } return file; }
Source:
<code>private static Collection<InetAddress> resolveInetAddresses(ClusterNode node) { Set<InetAddress> res = new HashSet<>(node.addresses().size()); Iterator<String> hostNamesIt = node.hostNames().iterator(); for (String addr : node.addresses()) { String hostName = hostNamesIt.hasNext() ? hostNamesIt.next() : null; InetAddress inetAddr = null; if (!F.isEmpty(hostName)) { try { if (IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TEST_ENV)) { if (hostName.endsWith(".hostname")) { String ipStr = hostName.substring(0, hostName.length() - ".hostname".length()); inetAddr = InetAddress.getByAddress(hostName, InetAddress.getByName(ipStr).getAddress()); } else <START> throw new UnknownHostException(hostName); <END> } else inetAddr = InetAddress.getByName(hostName); } catch (UnknownHostException ignored) { } } if (inetAddr == null || inetAddr.isLoopbackAddress()) { try { if (IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TEST_ENV)) inetAddr = InetAddress.getByAddress(addr + ".hostname", InetAddress.getByName(addr).getAddress()); else inetAddr = InetAddress.getByName(addr); } catch (UnknownHostException ignored) { } } if (inetAddr != null) res.add(inetAddr); } return res; }</code><technical_language>point of throwing UnknownHostException caching lines</technical_language>

Target:
private static Collection<InetAddress> resolveInetAddresses(ClusterNode node) { Set<InetAddress> res = new HashSet<>(node.addresses().size()); Iterator<String> hostNamesIt = node.hostNames().iterator(); for (String addr : node.addresses()) { String hostName = hostNamesIt.hasNext() ? hostNamesIt.next() : null; InetAddress inetAddr = null; if (!F.isEmpty(hostName)) { try { if (IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TEST_ENV)) { if (hostName.endsWith(".hostname")) { String ipStr = hostName.substring(0, hostName.length() - ".hostname".length()); inetAddr = InetAddress.getByAddress(hostName, InetAddress.getByName(ipStr).getAddress()); } } else inetAddr = InetAddress.getByName(hostName); } catch (UnknownHostException ignored) { } } if (inetAddr == null || inetAddr.isLoopbackAddress()) { try { if (IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_TEST_ENV)) inetAddr = InetAddress.getByAddress(addr + ".hostname", InetAddress.getByName(addr).getAddress()); else inetAddr = InetAddress.getByName(addr); } catch (UnknownHostException ignored) { } } if (inetAddr != null) res.add(inetAddr); } return res; }
Source:
<code>public String toString() { <START> return dayOfWeek.getDisplayName(TextStyle.FULL, Locale.getDefault()) + " " + localTime.toString(); <END> }</code><technical_language>TUESDAY@09:00 ? --W--2T09:00 is unpleasant. (These classes avoid spaces in format)</technical_language>

Target:
public String toString() { return dayOfWeek + "@" + localTime; }
Source:
<code>public MessageListenerTestContainer createListenerContainer(RabbitListenerEndpoint endpoint) { MessageListenerTestContainer container = new MessageListenerTestContainer(endpoint); this.listenerContainers.put(endpoint.getId(), container); <START> if (endpoint.getId() == null && endpoint instanceof AbstractRabbitListenerEndpoint) { <END> ((AbstractRabbitListenerEndpoint) endpoint).setId("endpoint#" + counter.getAndIncrement()); } return container; }</code><technical_language>previous line of code moved this if, end null key in map</technical_language>

Target:
public MessageListenerTestContainer createListenerContainer(RabbitListenerEndpoint endpoint) { MessageListenerTestContainer container = new MessageListenerTestContainer(endpoint); if (endpoint.getId() == null && endpoint instanceof AbstractRabbitListenerEndpoint) { ((AbstractRabbitListenerEndpoint) endpoint).setId("endpoint#" + counter.getAndIncrement()); } String id = endpoint.getId(); assertNotNull(this.getClass().getSimpleName() + " does not support " + endpoint.getClass().getSimpleName() + " without an id", id); this.listenerContainers.put(id, container); return container; }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.CONSTRUCTOR); <END> }</code><technical_language>java.util.Collections.singletonList() prefered for singleton list. (always a practice rely JDK classes libs)</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.CONSTRUCTOR); }
Source:
<code>void shouldNotFailOnDeleteByEntityWithNullVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> { <START> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume(); return null; <END> }); } StepVerifier.create(repository.findById(1L).map(thing -> repository.deleteById(1L))) .expectNextCount(1L) .verifyComplete(); }</code><technical_language>suggestion return tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume();</technical_language>

Target:
void shouldNotFailOnDeleteByEntityWithNullVersion(@Autowired VersionedThingWithAssignedIdRepository repository) { try (Session session = driver.session()) { session.writeTransaction(tx -> tx.run("CREATE (v:VersionedThingWithAssignedId {id:1})").consume()); } StepVerifier.create(repository.findById(1L).map(thing -> repository.deleteById(1L))) .expectNextCount(1L) .verifyComplete(); }
Source:
<code>public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { <START> logger.debug("validateItemType called with bindingConfig={}", bindingConfig); <END> Matcher matcher = CONFIG_PATTERN.matcher(bindingConfig); if (!matcher.matches() || matcher.groupCount() != 2) throw new BindingConfigParseException("Config for item '" + item.getName() + "' could not be parsed."); String property = matcher.group(2); logger.debug("validateItemType called with property={}", property); }</code><technical_language>please remove decrease TRACE</technical_language>

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { logger.trace("validateItemType called with bindingConfig={}", bindingConfig); Matcher matcher = CONFIG_PATTERN.matcher(bindingConfig); if (!matcher.matches() || matcher.groupCount() != 2) throw new BindingConfigParseException("Config for item '" + item.getName() + "' could not be parsed."); String property = matcher.group(2); logger.trace("validateItemType called with property={}", property); }
Source:
<code>private SearchQueryBuilder(FhirContext theFhirContext, ModelConfig theModelConfig, PartitionSettings thePartitionSettings, RequestPartitionId theRequestPartitionId, String theResourceType, SqlObjectFactory theSqlBuilderFactory, String theBindVariableSubstitutionBase, Dialect theDialect, boolean theCountQuery, ArrayList<Object> theBindVariableValues) { myFhirContext = theFhirContext; myModelConfig = theModelConfig; myPartitionSettings = thePartitionSettings; myRequestPartitionId = theRequestPartitionId; myResourceType = theResourceType; mySqlBuilderFactory = theSqlBuilderFactory; myCountQuery = theCountQuery; myDialect = theDialect; <START> if (myDialect instanceof org.hibernate.dialect.MySQL57Dialect){ <END> dialectIsMySql = true; } if (myDialect instanceof org.hibernate.dialect.MariaDB53Dialect){ dialectIsMariaDb = true; } if (myDialect instanceof org.hibernate.dialect.SQLServer2012Dialect){ dialectIsMsSql = true; } mySpec = new DbSpec(); mySchema = mySpec.addDefaultSchema(); mySelect = new SelectQuery(); myBindVariableSubstitutionBase = theBindVariableSubstitutionBase; myBindVariableValues = theBindVariableValues; }</code><technical_language>avoid version specific dialects.. I get checking dialect is instanceof MySQLDialect (which covers versions of MySQL MariaDB) SQLServerDialect (which covers versions of SQL Server)</technical_language>

Target:
private SearchQueryBuilder(FhirContext theFhirContext, ModelConfig theModelConfig, PartitionSettings thePartitionSettings, RequestPartitionId theRequestPartitionId, String theResourceType, SqlObjectFactory theSqlBuilderFactory, String theBindVariableSubstitutionBase, Dialect theDialect, boolean theCountQuery, ArrayList<Object> theBindVariableValues) { myFhirContext = theFhirContext; myModelConfig = theModelConfig; myPartitionSettings = thePartitionSettings; myRequestPartitionId = theRequestPartitionId; myResourceType = theResourceType; mySqlBuilderFactory = theSqlBuilderFactory; myCountQuery = theCountQuery; myDialect = theDialect; if (myDialect instanceof org.hibernate.dialect.MySQLDialect){ dialectIsMySql = true; } if (myDialect instanceof org.hibernate.dialect.SQLServerDialect){ dialectIsMsSql = true; } mySpec = new DbSpec(); mySchema = mySpec.addDefaultSchema(); mySelect = new SelectQuery(); myBindVariableSubstitutionBase = theBindVariableSubstitutionBase; myBindVariableValues = theBindVariableValues; }
Source:
<code>private static Analyzer createAnalyzer() { try { return (Analyzer) Class.forName(LUCENE_ANALYZER) .getConstructor(Version.class) .newInstance(Version.LUCENE_30); } catch (Exception e) { <START> throw new IllegalArgumentException("Unable to initizalize Lucene analyzer", e); <END> } }</code><technical_language>Please, some DbException add a new constant ErrorCode if needed</technical_language>

Target:
private static Analyzer createAnalyzer() { String analyzerClassName = Utils.getProperty(LUCENE_ANALYZER, null); if (analyzerClassName == null) { return new StandardAnalyzer(); } try { return (Analyzer) Class.forName(analyzerClassName).getConstructor().newInstance(); } catch (Exception e) { throw DbException.get(ErrorCode.LUCENE_ANALYZER_DOES_NOT_EXIST_1, e, analyzerClassName); } }
Source:
<code>static void uploadClusterConfigs(String hardwareLayoutPath, String partitionLayoutPath, String zkLayoutPath, String clusterNamePrefix, int maxPartitionsInOneResource, HelixAdminFactory helixAdminFactory) throws Exception { HelixBootstrapUpgradeUtil clusterMapToHelixMapper = new HelixBootstrapUpgradeUtil(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath, clusterNamePrefix, maxPartitionsInOneResource, false, false, helixAdminFactory); Map<String, Map<String, String>> partitionOverrideInfos = clusterMapToHelixMapper.generatePartitionOverrideFromAllDCs(); <START> info("Uploading partition override to HelixPropertyStore based on static clustermap."); <END> clusterMapToHelixMapper.uploadPartitionOverride(partitionOverrideInfos); info("Upload cluster configs completed."); }</code><technical_language>stop term "static clustermap" especially for newly introduced</technical_language>

Target:
static void uploadClusterConfigs(String hardwareLayoutPath, String partitionLayoutPath, String zkLayoutPath, String clusterNamePrefix, int maxPartitionsInOneResource, HelixAdminFactory helixAdminFactory) throws Exception { HelixBootstrapUpgradeUtil clusterMapToHelixMapper = new HelixBootstrapUpgradeUtil(hardwareLayoutPath, partitionLayoutPath, zkLayoutPath, clusterNamePrefix, maxPartitionsInOneResource, false, false, helixAdminFactory); Map<String, Map<String, String>> partitionOverrideInfos = clusterMapToHelixMapper.generatePartitionOverrideFromAllDCs(); info("Uploading partition override to HelixPropertyStore based on override json file."); clusterMapToHelixMapper.uploadPartitionOverride(partitionOverrideInfos); info("Upload cluster configs completed."); }