auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void initChannel(final SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); sslContext.ifPresent(sslContext -> pipeline.addLast(PIPELINE_SSL, sslContext.newHandler(ch.alloc()))); if (supportsIdleMonitor()) <START> pipeline.addLast(new IdleStateHandler((int) (settings.idleReadLimit / 1000), (int) (settings.idleWriteLimit / 1000),0)); <END> configure(pipeline); pipeline.addLast(PIPELINE_OP_SELECTOR, opSelectorHandler); pipeline.addLast(PIPELINE_RESULT_ITERATOR_HANDLER, iteratorHandler); pipeline.addLast(PIPELINE_OP_EXECUTOR, opExecutorHandler); finalize(pipeline); }</code><technical_language>Is this setting in millis seconds</technical_language>

Target:
public void initChannel(final SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); sslContext.ifPresent(sslContext -> pipeline.addLast(PIPELINE_SSL, sslContext.newHandler(ch.alloc()))); if (supportsIdleMonitor()) { final int idleConnectionTimeout = (int) (settings.idleConnectionTimeout / 1000); final int keepAliveInterval = (int) (settings.keepAliveInterval / 1000); pipeline.addLast(new IdleStateHandler(idleConnectionTimeout, keepAliveInterval, 0)); } configure(pipeline); pipeline.addLast(PIPELINE_OP_SELECTOR, opSelectorHandler); pipeline.addLast(PIPELINE_RESULT_ITERATOR_HANDLER, iteratorHandler); pipeline.addLast(PIPELINE_OP_EXECUTOR, opExecutorHandler); finalize(pipeline); }
Source:
<code>protected Map<String, String> parseSetAttributesAsTextArg(String text) { <START> char[] chars = text.toCharArray(); <END> String value = ""; String key = ""; String buffer = ""; Map<String, String> keyValuePairs = new HashMap<>(); boolean isInsideQuotes = false; for (char c : chars) { if (c == '=') { key = buffer; buffer = ""; } else if (c == '\"') { if (isInsideQuotes) { value = buffer; buffer = ""; } isInsideQuotes = !isInsideQuotes; } else if (c == ' ' && !isInsideQuotes) { keyValuePairs.put(key, value); } else { buffer += c; } } if (!key.isEmpty() && !value.isEmpty()) { keyValuePairs.put(key, value); } return keyValuePairs; }</code><technical_language>making a copy of a String a char-array for purpose of looping is kind of a bad idea, performance-wise. a regular for loop so, for (int i = 0; i < text.length(); ++i) { final char c = text.charAt(i); ... }</technical_language>

Target:
protected Map<String, String> parseSetAttributesAsTextArg(String text) { String value = ""; String key = ""; StringBuilder buffer = new StringBuilder(); Map<String, String> keyValuePairs = new HashMap<>(); boolean isInsideQuotes = false; for (int i = 0; i < text.length(); ++i) { final char c = text.charAt(i); if (c == '=') { key = buffer.toString(); buffer.setLength(0); } else if (c == '\"') { if (isInsideQuotes) { value = buffer.toString(); buffer.setLength(0); } isInsideQuotes = !isInsideQuotes; } else if (c == ' ' && !isInsideQuotes) { keyValuePairs.put(key, value); } else { buffer.append(c); } } if (!key.isEmpty() && !value.isEmpty()) { keyValuePairs.put(key, value); } return keyValuePairs; }
Source:
<code>public boolean addAll(int index, Collection<? extends E> c) { throw new UnsupportedOperationException("No <START> addAll(index) in <END> " + this.getClass().getName()); }</code><technical_language>addAll(int, Collection)</technical_language>

Target:
public boolean addAll(int index, Collection<? extends E> c) { throw new UnsupportedOperationException("No addAll(int, Collection<? extends E>) in " + this.getClass().getName()); }
Source:
<code>public void dispose() { super.dispose(); <START> fImageCache.dispose(); <END> }</code><technical_language>workbenchLabelProvider.dispose called non-null</technical_language>

Target:
public void dispose() { super.dispose(); imageCache.dispose(); if(workbenchLabelProvider != null) workbenchLabelProvider.dispose(); }
Source:
<code>private String getManagementOptions(FenceAgentOrder order) { String managementOptions = ""; VDSGroup cluster = DbFacade.getInstance().getVdsGroupDao().get(_vds.getVdsGroupId()); <START> boolean isPPC = (cluster.getArchitecture() == ArchitectureType.ppc64); <END> if (order == FenceAgentOrder.Primary) { managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmType(), _vds.getPmOptions(), isPPC); } else if (order == FenceAgentOrder.Secondary) { managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmSecondaryType(), _vds.getPmSecondaryOptions(), isPPC); } return managementOptions; }</code><technical_language>Please remove unnecessary parenthesis</technical_language>

Target:
private String getManagementOptions(FenceAgentOrder order) { String managementOptions = ""; VDS proxyHost = DbFacade.getInstance().getVdsDao().get(proxyHostId); ArchitectureType architectureType = null; if ( proxyHost.getCpuName() != null) { architectureType = proxyHost.getCpuName().getArchitecture(); } if (order == FenceAgentOrder.Primary) { managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmType(), _vds.getPmOptions(), architectureType); } else if (order == FenceAgentOrder.Secondary) { managementOptions = VdsFenceOptions.getDefaultAgentOptions(_vds.getPmSecondaryType(), _vds.getPmSecondaryOptions(), architectureType); } return managementOptions; }
Source:
<code>private void updateItemsAndWidgets(EList<Widget> widgets) { this.widgets = widgets; <START> this.items = getAllItems(widgets); <END> for (Item item : items) { if (item instanceof GenericItem) { ((GenericItem) item).addStateChangeListener(this); } else if (item instanceof GroupItem) { ((GroupItem) item).addStateChangeListener(this); } } }</code><technical_language>need for this</technical_language>

Target:
private void updateItemsAndWidgets(EList<Widget> widgets) { if (this.widgets != null) { items = getAllItems(this.widgets); for (Item item : items) { if (item instanceof GenericItem) { ((GenericItem) item).removeStateChangeListener(this); } } } this.widgets = widgets; items = getAllItems(widgets); for (Item item : items) { if (item instanceof GenericItem) { ((GenericItem) item).addStateChangeListener(this); } } }
Source:
<code>public boolean isInsideWorkTree() throws GitException { final EmptyGitCommand emptyGitCommand = nativeGit.createEmptyGitCommand(); try { emptyGitCommand.setNextParameter("rev-parse") .setNextParameter("--is-inside-work-tree") .execute(); final String output = emptyGitCommand.getText(); return Boolean.valueOf(output); } catch(GitException ge) { <START> if (ge.getMessage().matches("(?s).*fatal: Not a git repository.*(?s).*")) { <END> return false; } throw ge; } }</code><technical_language>compile static field</technical_language>

Target:
public boolean isInsideWorkTree() throws GitException { final EmptyGitCommand emptyGitCommand = nativeGit.createEmptyGitCommand(); try { emptyGitCommand.setNextParameter("rev-parse") .setNextParameter("--is-inside-work-tree") .execute(); final String output = emptyGitCommand.getText(); return Boolean.valueOf(output); } catch(GitException ge) { String msg = ge.getMessage(); if (msg != null && notInGitRepoErrorPattern.matcher(msg).matches()) { return false; } throw ge; } }
Source:
<code>public final void initStrollIntervalTimer() { cIntervalTimer = TimeKeeper.getInstance().getTimer(Timer.Global.INTERVAL.name()); System.out.println(cIntervalTimer.getRemainingTime() + ""); <START> if(cIntervalTimer.getRemainingTime() > 0 ){ <END> cTimer = new Label(Integer.toString(cIntervalTimer.getRemainingTime()), cGameSkin.get("default_labelStyle", Label.LabelStyle.class)); } else { cTimer = new Label("Ready", cGameSkin.get("default_labelStyle", Label.LabelStyle.class)); } TimeKeeper.getInstance().getTimer(Timer.Global.INTERVAL.name()).subscribe(new TimerTask() { @Override public void onTick(final int seconds) { HomeScreen.this.cTimer.setText(Integer.toString(seconds)); } @Override public void onStart(final int seconds) { } @Override public void onStop() { } }); cTable.row().expandY(); cTable.add(cTimer); }</code><technical_language>Needs whitespace for readability</technical_language>

Target:
public final void initStrollIntervalTimer() { cIntervalTimer = TimeKeeper.getInstance().getTimer(Timer.Global.INTERVAL.name()); createTimeRemainingLabel(); addTimerBevahiour(); cTable.row().expandY(); cTable.add(cTimer); }
Source:
<code>public Counter newCounter() { <START> Counter counter = new Counter(arrayLength); <END> arrays.add(counter); return counter; }</code><technical_language>final</technical_language>

Target:
public Counter newCounter() { final Counter counter = new Counter(arrayLength); arrays.add(counter); return counter; }
Source:
<code>public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { MCPlayer p = environment.getEnv(CommandHelperEnvironment.class).GetPlayer(); <START> Static.AssertPlayerNonNull(p, t); <END> MCItemStack is; Construct m = null; if(args.length == 2){ is = Static.ParseItemNotation(this.getName(), args[0].val(), Static.getInt32(args[1], t), t); } else if(args.length == 3) { if(args[0] instanceof CString) { p = Static.GetPlayer(args[0], t); is = Static.ParseItemNotation(this.getName(), args[1].val(), Static.getInt32(args[2], t), t); } else { is = Static.ParseItemNotation(this.getName(), args[0].val(), Static.getInt32(args[1], t), t); m = args[2]; } } else { p = Static.GetPlayer(args[0], t); is = Static.ParseItemNotation(this.getName(), args[1].val(), Static.getInt32(args[2], t), t); m = args[3]; } MCItemMeta meta; if (m != null) { meta = ObjectGenerator.GetGenerator().itemMeta(m, is.getTypeId(), t); } else { meta = ObjectGenerator.GetGenerator().itemMeta(new CNull(), is.getTypeId(), t); } is.setItemMeta(meta); HashMap<Integer, MCItemStack> h = p.getInventory().addItem(is); if (h.isEmpty()) { return new CInt(0, t); } else { return new CInt(h.get(0).getAmount(), t); } }</code><technical_language>This needs player set. In case a player, this is running console, p null this point, set line 442, is this check go</technical_language>

Target:
public Construct exec(Target t, Environment environment, Construct... args) throws ConfigRuntimeException { MCPlayer p = environment.getEnv(CommandHelperEnvironment.class).GetPlayer(); MCItemStack is; Construct m = null; if(args.length == 2){ is = Static.ParseItemNotation(this.getName(), args[0].val(), Static.getInt32(args[1], t), t); } else if(args.length == 3) { if(args[0] instanceof CString) { p = Static.GetPlayer(args[0], t); is = Static.ParseItemNotation(this.getName(), args[1].val(), Static.getInt32(args[2], t), t); } else { is = Static.ParseItemNotation(this.getName(), args[0].val(), Static.getInt32(args[1], t), t); m = args[2]; } } else { p = Static.GetPlayer(args[0], t); is = Static.ParseItemNotation(this.getName(), args[1].val(), Static.getInt32(args[2], t), t); m = args[3]; } Static.AssertPlayerNonNull(p, t); MCItemMeta meta; if (m != null) { meta = ObjectGenerator.GetGenerator().itemMeta(m, is.getTypeId(), t); } else { meta = ObjectGenerator.GetGenerator().itemMeta(new CNull(), is.getTypeId(), t); } is.setItemMeta(meta); HashMap<Integer, MCItemStack> h = p.getInventory().addItem(is); if (h.isEmpty()) { return new CInt(0, t); } else { return new CInt(h.get(0).getAmount(), t); } }
Source:
<code>public IdentityProvider getResidentIdP() throws IdentityProviderManagementException { try { String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProvider residentIdP = IdentityProviderManager.getInstance() .getResidentIdP(tenantDomain); return residentIdP; } catch (IdentityProviderManagementException idpException) { <START> log.error("Error while getting ResidentIdP", idpException); <END> throw idpException; } }</code><technical_language>log tenantDomain if</technical_language>

Target:
public IdentityProvider getResidentIdP() throws IdentityProviderManagementException { String tenantDomain = ""; try { tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProvider residentIdP = IdentityProviderManager.getInstance() .getResidentIdP(tenantDomain); return residentIdP; } catch (IdentityProviderManagementException idpException) { log.error("Error while getting ResidentIdP in tenantDomain :" + tenantDomain, idpException); throw idpException; } }
Source:
<code>public void testTooManyRepositoriesAreCappedToFive() { TestSubscriber<List<GitHubRepository>> observer = new TestSubscriber<>(); try { viewModel.toGitHubRepositoryList() .apply(Arrays.asList(1, 2, 3, 4, 5, 6)) .subscribe(observer); } catch (Exception e) { Log.e("RepositoriesViewModelTest", e.getMessage()); } observer.awaitTerminalEvent(); <START> assertEquals("Invalid number of repositories", 5, observer.getEvents().get(0).size()); <END> }</code><technical_language>reason for this test is failing is I mentioned in testTooLittleRepositoriesReturnThoseRepositories</technical_language>

Target:
public void testTooManyRepositoriesAreCappedToFive() { TestSubscriber<List<GitHubRepository>> observer = new TestSubscriber<>(); try { viewModel.toGitHubRepositoryList() .apply(Arrays.asList(1, 2, 3, 4, 5, 6)) .subscribe(observer); } catch (Exception e) { Log.e("RepositoriesViewModelTest", e.getMessage()); } observer.awaitTerminalEvent(); assertEquals("Invalid number of repositories", 5, ((List)observer.getEvents().get(0).get(0)).size()); }
Source:
<code><START> APIEvent(final String eventName) { <END> getEventList().add(Pair.create(EventStrings.EVENT_NAME, eventName)); mEventName = eventName; }</code><technical_language>APIEvent(final String eventName) { [](start = 4, length = 34) nit: new line please. #Closed</technical_language>

Target:
APIEvent(final String eventName) { setEvent(EventStrings.EVENT_NAME, eventName); mEventName = eventName; }
Source:
<code>public void updateElement(int index) { final TableViewer tableViewer = fTableViewer; final ISegment[] segmentArray = fSegmentArray; if ((tableViewer != null) && (segmentArray != null) && <START> (segmentArray.length > index) && !fOngoingUpdate) { <END> fOngoingUpdate = true; tableViewer.replace(segmentArray[index], index); fOngoingUpdate = false; } }</code><technical_language>fOngoingUpdate is prevent re-entrant calls this function. this happens, if is normal, table "be modified while is modified". boolean flag avoids this problem. is added (segmentArray.length > index) check. This is needed number of entries in "Current Intervals" view reduced selecting a new timestamp, viewer new limit yet</technical_language>

Target:
public void updateElement(int index) { final TableViewer tableViewer = fTableViewer; final ISegment[] segmentArray = fSegmentArray; if ((tableViewer != null) && (segmentArray != null) && (segmentArray.length > index)) { tableViewer.replace(segmentArray[index], index); } }
Source:
<code>private void createProject() throws OrmException, Failure { List<RefRight> access = new ArrayList<RefRight>(); for (AccountGroup.Id ownerId : ownerIds) { final RefRight.Key prk = new RefRight.Key(nameKey, new RefRight.RefPattern( RefRight.ALL), ApprovalCategory.OWN, ownerId); final RefRight pr = new RefRight(prk); pr.setMaxValue((short) 1); pr.setMinValue((short) 1); access.add(pr); } db.refRights().insert(access); final Project newProject = new Project(nameKey); newProject.setDescription(projectDescription); newProject.setSubmitType(submitType); newProject.setUseContributorAgreements(contributorAgreements); newProject.setUseSignedOffBy(signedOffBy); newProject.setUseContentMerge(contentMerge); newProject.setRequireChangeID(requireChangeID); db.projects().insert(Collections.singleton(newProject)); if (parents.size() > 0) { final StringBuilder err = new StringBuilder(); ProjectControl ctrl = projectCache.get(nameKey).controlFor(currentUser); for (ProjectControl parent: parents) { err.append(util.addParent(ctrl, parent)); } <START> projectCache.evictAll(); <END> String e = err.toString(); if (! "".equals(e)) { throw new Failure(1, e); } } }</code><technical_language>do need evict projects cache here</technical_language>

Target:
private void createProject() throws OrmException, Failure { List<RefRight> access = new ArrayList<RefRight>(); for (AccountGroup.Id ownerId : ownerIds) { final RefRight.Key prk = new RefRight.Key(nameKey, new RefRight.RefPattern( RefRight.ALL), ApprovalCategory.OWN, ownerId); final RefRight pr = new RefRight(prk); pr.setMaxValue((short) 1); pr.setMinValue((short) 1); access.add(pr); } db.refRights().insert(access); final Project newProject = new Project(nameKey); newProject.setDescription(projectDescription); newProject.setSubmitType(submitType); newProject.setUseContributorAgreements(contributorAgreements); newProject.setUseSignedOffBy(signedOffBy); newProject.setUseContentMerge(contentMerge); newProject.setRequireChangeID(requireChangeID); db.projects().insert(Collections.singleton(newProject)); if (parents.size() > 0) { final StringBuilder err = new StringBuilder(); ProjectControl ctrl = projectCache.get(nameKey).controlFor(currentUser); for (ProjectControl parent: parents) { err.append(util.addParent(ctrl, parent)); } String e = err.toString(); if (! "".equals(e)) { throw new Failure(1, e); } } }
Source:
<code>public final boolean isProfileOwnerAction(String action) { return <START> (action != null) ? action.equals(ACTION_PROVISION_MANAGED_PROFILE) <END> || action.equals(ACTION_PROVISION_MANAGED_USER) : false; }</code><technical_language>Instead of checking for action!= null, suggest simply change order of equals, e.g. return ACTION_PROVISION_MANAGED_PROFILE.equals(action) || ACTION_PROVISION_MANAGED_USER.equals(action);</technical_language>

Target:
public final boolean isProfileOwnerAction(String action) { return ACTION_PROVISION_MANAGED_PROFILE.equals(action) || ACTION_PROVISION_MANAGED_USER.equals(action); }
Source:
<code>public void testGetExpiryForAccessIsIgnored() { Expiry<Long, String> expiry = mock(Expiry.class); ChainResolver<Long, String> chainResolver = new ChainResolver<Long, String>(codec, expiry); when(expiry.getExpiryForCreation(anyLong(), anyString())).thenReturn(Duration.INFINITE); List<Operation<Long, String>> list = new ArrayList<Operation<Long, String>>(); list.add(new PutOperation<Long, String>(1L, "One", timeSource.getTimeMillis())); list.add(new PutOperation<Long, String>(1L, "Second", timeSource.getTimeMillis())); Chain chain = getChainFromOperations(list); ResolvedChain<Long, String> resolvedChain = chainResolver.resolve(chain, 1L, timeSource.getTimeMillis()); verify(expiry, times(0)).getExpiryForAccess(anyLong(), any(ValueSupplier.class)); verify(expiry, times(1)).getExpiryForCreation(anyLong(), anyString()); verify(expiry, times(1)).getExpiryForUpdate(anyLong(), any(ValueSupplier.class), anyString()); assertThat(resolvedChain.isCompacted(), is(true)); <START> assertThat(resolvedChain.getCompactedSize(), is(2)); <END> }</code><technical_language>I recommend duplicating assertion in places. set of tests verifies behaves expected assume is correct for others</technical_language>

Target:
public void testGetExpiryForAccessIsIgnored() { Expiry<Long, String> expiry = mock(Expiry.class); ChainResolver<Long, String> chainResolver = new ChainResolver<Long, String>(codec, expiry); when(expiry.getExpiryForCreation(anyLong(), anyString())).thenReturn(Duration.INFINITE); List<Operation<Long, String>> list = new ArrayList<Operation<Long, String>>(); list.add(new PutOperation<Long, String>(1L, "One", timeSource.getTimeMillis())); list.add(new PutOperation<Long, String>(1L, "Second", timeSource.getTimeMillis())); Chain chain = getChainFromOperations(list); ResolvedChain<Long, String> resolvedChain = chainResolver.resolve(chain, 1L, timeSource.getTimeMillis()); verify(expiry, times(0)).getExpiryForAccess(anyLong(), any(ValueSupplier.class)); verify(expiry, times(1)).getExpiryForCreation(anyLong(), anyString()); verify(expiry, times(1)).getExpiryForUpdate(anyLong(), any(ValueSupplier.class), anyString()); assertThat(resolvedChain.isCompacted(), is(true)); }
Source:
<code>public void newDoc(EditableFileType fileType, ResultCallback<EditingTarget, ServerError> callback) <START> { <END> if (fileType instanceof TextFileType) { ensureVisible(true); TextFileType textType = (TextFileType)fileType; server_.getSourceTemplate("", "default" + textType.getDefaultExtension(), new ServerRequestCallback<String>() { @Override public void onResponseReceived(String template) { newDoc(fileType, template, callback); } @Override public void onError(ServerError error) { newDoc(fileType, null, callback); } }); } else { newDoc(fileType, null, callback); } }</code><technical_language>eventually need call this e.g. source pane opens for non-file tab types? (e.g. View(mtcars))</technical_language>

Target:
public void newDoc(EditableFileType fileType, ResultCallback<EditingTarget, ServerError> callback) { ensureVisible(true); if (fileType instanceof TextFileType) { TextFileType textType = (TextFileType)fileType; server_.getSourceTemplate("", "default" + textType.getDefaultExtension(), new ServerRequestCallback<String>() { @Override public void onResponseReceived(String template) { newDoc(fileType, template, callback); } @Override public void onError(ServerError error) { newDoc(fileType, null, callback); } }); } else { newDoc(fileType, null, callback); } }
Source:
<code>protected void propagateNewPanelSize(int visibleWidth, int visibleHeight) { if (getDefaultGridLayer() == null) { return; } boolean toRefresh = false; for (GridWidget gridWidget : getDefaultGridLayer().getGridWidgets()) { toRefresh = toRefresh || gridWidget.getModel().setVisibleSizeAndRefresh(visibleWidth, visibleHeight); } if (toRefresh) { <START> this.getDefaultGridLayer().draw(); <END> } }</code><technical_language>of batch() is better</technical_language>

Target:
protected void propagateNewPanelSize(int visibleWidth, int visibleHeight) { if (getDefaultGridLayer() == null) { return; } boolean toRefresh = false; for (GridWidget gridWidget : getDefaultGridLayer().getGridWidgets()) { toRefresh = toRefresh || gridWidget.getModel().setVisibleSizeAndRefresh(visibleWidth, visibleHeight); } if (toRefresh) { this.getDefaultGridLayer().batch(); } }
Source:
<code>public boolean isReady(TaskActionClient taskActionClient) throws Exception { <START> return false; <END> }</code><technical_language>this return true instead</technical_language>

Target:
public boolean isReady(TaskActionClient taskActionClient) throws Exception { return true; }
Source:
<code>private void createGame(String shipName, boolean shouldSpawnOnGalaxySpawnPosition) { SolShip.shipList.clear(); boolean isNewShip = shipName != null; ShipConfig shipConfig = readShipFromConfigOrLoadFromSaveIfNull(shipName, isNewShip); if (!respawnState.isPlayerRespawned()) { galaxyFiller.fill(this, hullConfigManager, itemManager, shipConfig.hull.getInternalName().split(":")[0]); } hero = new PlayerCreator().createPlayer(shipConfig, shouldSpawnOnGalaxySpawnPosition, respawnState, this, solApplication.getOptions().controlType == GameOptions.ControlType.MOUSE, isNewShip); hero.initialise(); <START> <END> }</code><technical_language>newline</technical_language>

Target:
private void createGame(String shipName, boolean shouldSpawnOnGalaxySpawnPosition) { boolean isNewShip = shipName != null; ShipConfig shipConfig = readShipFromConfigOrLoadFromSaveIfNull(shipName, isNewShip); if (!respawnState.isPlayerRespawned()) { galaxyFiller.fill(this, hullConfigManager, itemManager, shipConfig.hull.getInternalName().split(":")[0]); } hero = new PlayerCreator().createPlayer(shipConfig, shouldSpawnOnGalaxySpawnPosition, respawnState, this, solApplication.getOptions().controlType == GameOptions.ControlType.MOUSE, isNewShip); hero.initialise(); }
Source:
<code>public Hook getHook(Hooks hooks) { for (Hook hook : hooks.getHooks()) { if (parent.generateHookId(hook.getEventName(), hook.getName(), hook.getMd5()).equals(guid)) { return hook; } } <START> return null; <END> }</code><technical_language>return 404, NULL</technical_language>

Target:
public Hook getHook(Hooks hooks) { for (Hook hook : hooks.getHooks()) { if (HostMapper.generateHookId(hook.getEventName(), hook.getName(), hook.getMd5()).equals(guid)) { return hook; } } return notFound(); }
Source:
<code>public void testSessionTokenDecode() throws Throwable { Text alice = new Text("alice"); Text renewer = new Text("yarn"); AbstractS3ATokenIdentifier identifier = new SessionTokenIdentifier(SESSION_TOKEN_KIND, alice, renewer, new URI("s3a://landsat-pds/"), new MarshalledCredentials("a", "b", ""), new EncryptionSecrets(S3AEncryptionMethods.SSE_S3, ""), "origin"); Token<AbstractS3ATokenIdentifier> t1 = new Token<>(identifier, new SessionSecretManager()); AbstractS3ATokenIdentifier decoded = t1.decodeIdentifier(); decoded.validate(); MarshalledCredentials creds = ((SessionTokenIdentifier) decoded).getMarshalledCredentials(); assertNotNull("credentials", MarshalledCredentialBinding.toAWSCredentials(creds, MarshalledCredentials.CredentialTypeRequired.AnyNonEmpty, "")); assertEquals(alice, decoded.getOwner()); UserGroupInformation decodedUser = decoded.getUser(); assertEquals("name of " + decodedUser, "alice", decodedUser.getUserName()); <START> assertEquals(renewer, decoded.getRenewer()); <END> assertEquals("Authentication method of " + decodedUser, UserGroupInformation.AuthenticationMethod.TOKEN, decodedUser.getAuthenticationMethod()); assertEquals("origin", decoded.getOrigin()); }</code><technical_language>add a message for diags, e.g. "renewer"</technical_language>

Target:
public void testSessionTokenDecode() throws Throwable { Text alice = new Text("alice"); Text renewer = new Text("yarn"); AbstractS3ATokenIdentifier identifier = new SessionTokenIdentifier(SESSION_TOKEN_KIND, alice, renewer, new URI("s3a://landsat-pds/"), new MarshalledCredentials("a", "b", ""), new EncryptionSecrets(S3AEncryptionMethods.SSE_S3, ""), "origin"); Token<AbstractS3ATokenIdentifier> t1 = new Token<>(identifier, new SessionSecretManager()); AbstractS3ATokenIdentifier decoded = t1.decodeIdentifier(); decoded.validate(); MarshalledCredentials creds = ((SessionTokenIdentifier) decoded).getMarshalledCredentials(); assertNotNull("credentials", MarshalledCredentialBinding.toAWSCredentials(creds, MarshalledCredentials.CredentialTypeRequired.AnyNonEmpty, "")); assertEquals(alice, decoded.getOwner()); UserGroupInformation decodedUser = decoded.getUser(); assertEquals("name of " + decodedUser, "alice", decodedUser.getUserName()); assertEquals("renewer", renewer, decoded.getRenewer()); assertEquals("Authentication method of " + decodedUser, UserGroupInformation.AuthenticationMethod.TOKEN, decodedUser.getAuthenticationMethod()); assertEquals("origin", decoded.getOrigin()); }
Source:
<code>public RetryImpl(String name, RetryConfig config, Map<String, String> tags) { this.name = name; this.config = config; <START> this.tags = Collections.unmodifiableMap(tags); <END> this.maxAttempts = config.getMaxAttempts(); this.intervalFunction = config.getIntervalFunction(); this.exceptionPredicate = config.getExceptionPredicate(); this.resultPredicate = config.getResultPredicate(); this.metrics = this.new RetryMetrics(); this.eventProcessor = new RetryEventProcessor(); succeededAfterRetryCounter = new LongAdder(); failedAfterRetryCounter = new LongAdder(); succeededWithoutRetryCounter = new LongAdder(); failedWithoutRetryCounter = new LongAdder(); }</code><technical_language>a immutable Vavr map instead</technical_language>

Target:
public RetryImpl(String name, RetryConfig config, Map<String, String> tags) { this.name = name; this.config = config; this.tags = tags; this.maxAttempts = config.getMaxAttempts(); this.intervalFunction = config.getIntervalFunction(); this.exceptionPredicate = config.getExceptionPredicate(); this.resultPredicate = config.getResultPredicate(); this.metrics = this.new RetryMetrics(); this.eventProcessor = new RetryEventProcessor(); succeededAfterRetryCounter = new LongAdder(); failedAfterRetryCounter = new LongAdder(); succeededWithoutRetryCounter = new LongAdder(); failedWithoutRetryCounter = new LongAdder(); }
Source:
<code>protected void addNewWorkingSet(IWorkingSet workingSet) { int checkCount= 0; for (IAdaptable <START> fElement : <END> fElements) { IAdaptable adapted= adapt(workingSet, fElement); if (adapted != null && contains(workingSet, adapted)) { checkCount++; } } GrayedCheckedModelElement element= new GrayedCheckedModelElement(workingSet, checkCount, fElements.length); fModel.addElement(element); fTableViewer.setInput(fModel); fTableViewer.refresh(); fTableViewer.setCheckedElements(fModel.getChecked()); fTableViewer.setGrayedElements((Object[]) fModel.getGrayed()); fTableViewer.setSelection(new StructuredSelection(element)); }</code><technical_language>rename element</technical_language>

Target:
protected void addNewWorkingSet(IWorkingSet workingSet) { int checkCount= 0; for (IAdaptable element : fElements) { IAdaptable adapted= adapt(workingSet, element); if (adapted != null && contains(workingSet, adapted)) { checkCount++; } } GrayedCheckedModelElement element= new GrayedCheckedModelElement(workingSet, checkCount, fElements.length); fModel.addElement(element); fTableViewer.setInput(fModel); fTableViewer.refresh(); fTableViewer.setCheckedElements(fModel.getChecked()); fTableViewer.setGrayedElements((Object[]) fModel.getGrayed()); fTableViewer.setSelection(new StructuredSelection(element)); }
Source:
<code>public OrcFileTail getOrcFileTail(OrcDataSource orcDataSource, MetadataReader metadataReader, Optional<OrcWriteValidation> writeValidation, HiveFileContext hiveFileContext) throws IOException { try { <START> return cache.get(orcDataSource.getId(), () -> delegate.getOrcFileTail(orcDataSource, metadataReader, writeValidation, hiveFileContext)); <END> } catch (ExecutionException | UncheckedExecutionException e) { throwIfInstanceOf(e.getCause(), IOException.class); throw new IOException("Unexpected error in orc file tail reading after cache miss", e.getCause()); } }</code><technical_language>need test hiveFileContext if need get data cache not. Check CachingFileOpener example</technical_language>

Target:
public OrcFileTail getOrcFileTail(OrcDataSource orcDataSource, MetadataReader metadataReader, Optional<OrcWriteValidation> writeValidation, HiveFileContext hiveFileContext) throws IOException { try { if (hiveFileContext.isCacheable()) { return cache.get(orcDataSource.getId(), () -> delegate.getOrcFileTail(orcDataSource, metadataReader, writeValidation, hiveFileContext)); } return delegate.getOrcFileTail(orcDataSource, metadataReader, writeValidation, hiveFileContext); } catch (ExecutionException | UncheckedExecutionException e) { throwIfInstanceOf(e.getCause(), IOException.class); throw new IOException("Unexpected error in orc file tail reading after cache miss", e.getCause()); } }
Source:
<code>public Set<Class<? extends AudioStream>> getSupportedStreams() { <START> return Collections.emptySet(); <END> }</code><technical_language>empty? supports streams</technical_language>

Target:
public Set<Class<? extends AudioStream>> getSupportedStreams() { return SUPPORTED_AUDIO_STREAMS; }
Source:
<code>static String uniqueSuffix(String name) { <START> return Base64.encode(Hashing.sha256().hashString(name).asBytes()). <END> replace('/', '_'). replace('+', '.'). replaceFirst("=+$", ""); }</code><technical_language>want Base36 encoding case insensitive filesystems risk of collision (i.e. macOS Windows)</technical_language>

Target:
static String uniqueSuffix(String name) { byte[] sha256; try { sha256 = MessageDigest.getInstance("SHA-256").digest(name.getBytes(Charsets.UTF_16LE)); } catch (NoSuchAlgorithmException x) { throw new AssertionError("<LINK_0>", x); } return new Base32(0).encodeToString(sha256).replaceFirst("=+$", ""); }
Source:
<code>public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); DiskImage diskFromDb = createDiskImage(); diskFromDb.setReadOnly(false); <START> when(diskDao.get(diskImageGuid)).thenReturn(diskFromDb); <END> initializeCommand(parameters); command.executeVmCommand(); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }</code><technical_language>1. compare vmDevice in command. 2. please assert check return shouldUpdateReadOnly(). thanks</technical_language>

Target:
public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); initializeCommand(parameters); command.executeVmCommand(); assertFalse(command.shouldUpdateReadOnly()); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }
Source:
<code>public void testCRUD() throws InterruptedException, ExecutionException{ <START> <END> try { setClient.post("http://localhost:8080/rest-app/rest/post", ImmutableMap.of(1, "hello")).get(); }catch(Exception e){ e.printStackTrace(); } }</code><technical_language>testing now</technical_language>

Target:
public void testCRUD() throws InterruptedException, ExecutionException{ assertThat(listClient.get("http://localhost:8080/rest-app/rest/get").get().get(0),is("ok")); try { setClient.post("http://localhost:8080/rest-app/rest/post", ImmutableMap.of(1, "hello")).get(); }catch(Exception e){ e.printStackTrace(); } assertThat(setClient.post("http://localhost:8080/rest-app/rest/post",ImmutableMap.of(1,"hello")).get(),is(ImmutableSet.of("hello"))); assertThat(setClient.put("http://localhost:8080/rest-app/rest/put",ImmutableMap.of(1,"hello")).get(),is(ImmutableSet.of("hello"))); assertThat(listClient.delete("http://localhost:8080/rest-app/rest/delete").get().get(0),is("ok")); }
Source:
<code>public void testPrefixWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "prefix_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("has spaces obj2.txt", 1024), new Ds3Object("obj3_no_spaces.txt", 1024), new Ds3Object("has spaces obj4.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); putJob.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { @Override <START> public SeekableByteChannel buildChannel(String key) throws IOException { <END> final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(120, 1024)); final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(1024); channel.write(randomBuffer); return channel; } }); final Iterable<Contents> objs = helpers.listObjects(bucketName, "has spaces"); boolean foundObj2 = false; boolean foundObj4 = false; for( Contents obj : objs ) { LOG.info("prefix with spaces name: " + obj.getKey()); LOG.info("prefix with spaces size: " + obj.getSize()); if (obj.getKey().equals("has spaces obj2.txt")) foundObj2 = true; if (obj.getKey().equals("has spaces obj4.txt")) foundObj4 = true; } assertTrue(Iterables.size(objs) == 2); assertTrue(foundObj2); assertTrue(foundObj4); } finally { Util.deleteAllContents(client, bucketName); } }</code><technical_language>Missing final</technical_language>

Target:
public void testPrefixWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "prefix_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("has spaces obj2.txt", 1024), new Ds3Object("obj3_no_spaces.txt", 1024), new Ds3Object("has spaces obj4.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); final Iterable<Contents> objs = helpers.listObjects(bucketName, "has spaces"); boolean foundObj2 = false; boolean foundObj4 = false; for (final Contents obj : objs) { LOG.info("prefix with spaces name: " + obj.getKey()); LOG.info("prefix with spaces size: " + obj.getSize()); if (obj.getKey().equals("has spaces obj2.txt")) foundObj2 = true; if (obj.getKey().equals("has spaces obj4.txt")) foundObj4 = true; } assertTrue(Iterables.size(objs) == 2); assertTrue(foundObj2); assertTrue(foundObj4); final CancelJobResponse cancelJobResponse = client.cancelJob(new CancelJobRequest(putJob.getJobId())); assertEquals(204, cancelJobResponse.getStatusCode()); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
<code>public void testOrphanedAllocationCanBeRemapped() throws Exception { try (SlotPoolImpl slotPool = createSlotPoolImpl()) { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); setupSlotPool(slotPool, resourceManagerGateway, mainThreadExecutor); final Scheduler scheduler = setupScheduler(slotPool, mainThreadExecutor); final SlotRequestId slotRequestId1 = new SlotRequestId(); <START> scheduler.allocateSlot( slotRequestId1, new DummyScheduledUnit(), SlotProfile.noRequirements(), timeout); <END> final SlotRequestId slotRequestId2 = new SlotRequestId(); scheduler.allocateSlot( slotRequestId2, new DummyScheduledUnit(), SlotProfile.noRequirements(), timeout); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); final SlotOffer slotOffer = new SlotOffer(allocationId2, 0, ResourceProfile.ANY); slotPool.registerTaskManager(taskManagerLocation.getResourceID()); slotPool.offerSlot(taskManagerLocation, taskManagerGateway, slotOffer); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(slotPool.getPendingRequests().containsKeyA(slotRequestId2), is(true)); assertThat(slotPool.getPendingRequests().containsKeyB(allocationId1), is(true)); assertThat(canceledAllocations, hasSize(0)); } }</code><technical_language>suggestion allocateSlot(scheduler, slotRequestId1);</technical_language>

Target:
public void testOrphanedAllocationCanBeRemapped() throws Exception { final List<AllocationID> allocationIds = new ArrayList<>(); resourceManagerGateway.setRequestSlotConsumer( slotRequest -> allocationIds.add(slotRequest.getAllocationId())); final List<AllocationID> canceledAllocations = new ArrayList<>(); resourceManagerGateway.setCancelSlotConsumer(canceledAllocations::add); try (SlotPoolImpl slotPool = createAndSetUpSlotPool()) { final SlotRequestId slotRequestId1 = new SlotRequestId(); final SlotRequestId slotRequestId2 = new SlotRequestId(); requestNewAllocatedSlots(slotPool, slotRequestId1, slotRequestId2); final AllocationID allocationId1 = allocationIds.get(0); final AllocationID allocationId2 = allocationIds.get(1); offerSlot(slotPool, allocationId2); assertThat(slotPool.getPendingRequests().values(), hasSize(1)); assertThat(slotPool.getPendingRequests().containsKeyA(slotRequestId2), is(true)); assertThat(slotPool.getPendingRequests().containsKeyB(allocationId1), is(true)); assertThat(canceledAllocations, hasSize(0)); } }
Source:
<code>public void actionPerformed(AnActionEvent e) { VirtualFile[] selectedFiles = FileEditorManager.getInstance(e.getProject()).getSelectedFiles(); if(selectedFiles == null || selectedFiles.length == 0) { SonarLintConsole.getSonarQubeConsole(e.getProject()).error("No files for analysis"); return; } Module m = ModuleUtil.findModuleForFile(selectedFiles[0], e.getProject()); <START> if(shouldAnalyze(selectedFiles[0], m)) { <END> SonarlintAnalyzer analyzer = e.getProject().getComponent(SonarlintAnalyzer.class); analyzer.submit(m, Collections.singletonList(selectedFiles[0]), false); } else { SonarLintConsole.getSonarQubeConsole(e.getProject()).error("File " + selectedFiles[0] + " cannot be analyzed"); } }</code><technical_language>configure formatter in IntelliJ</technical_language>

Target:
public void actionPerformed(AnActionEvent e) { Project p = e.getProject(); VirtualFile[] selectedFiles = FileEditorManager.getInstance(p).getSelectedFiles(); SonarLintConsole console = SonarLintConsole.getSonarQubeConsole(p); if (selectedFiles.length == 0) { console.error("No files for analysis"); return; } Module m = ModuleUtil.findModuleForFile(selectedFiles[0], p); if (shouldAnalyze(selectedFiles[0], m)) { boolean background = ActionPlaces.isMainMenuOrActionSearch(e.getPlace()); SonarlintAnalyzer analyzer = p.getComponent(SonarlintAnalyzer.class); if(background) { analyzer.submitAsync(m, Collections.singletonList(selectedFiles[0])); } else { analyzer.submit(m, Collections.singletonList(selectedFiles[0])); } } else { console.error("File " + selectedFiles[0] + " cannot be analyzed"); } }
Source:
<code>public void validateDatasetTypeIsImplemented(final Integer datasetTypeId, final Errors errors) { final DatasetType datasetType = this.datasetTypeService.getDatasetTypeById(datasetTypeId); <START> if (!DatasetTypeEnum.isSubObservationType(datasetType.getDatasetTypeId())) { <END> errors.reject("dataset.operation.not.implemented", new String[] {String.valueOf(datasetTypeId)}, ""); } }</code><technical_language>if store a boolean in database, answered DTO</technical_language>

Target:
public void validateDatasetTypeIsImplemented(final Integer datasetTypeId, final Errors errors) { final DatasetTypeDTO datasetType = this.datasetTypeService.getDatasetTypeById(datasetTypeId); if (!datasetType.isSubObservationType()) { errors.reject("dataset.operation.not.implemented", new String[] {String.valueOf(datasetTypeId)}, ""); } }
Source:
<code>public void testMarkingAcl_someUseMarking_allowConstraintMask() throws Exception { addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.ALLOW, AccessRight.USE_MARKING_AS_INT, 0, "allowUser1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, <START> AccessType.ALLOW, 0, 0, "allowUser2"); <END> addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.ALLOW, 0, 0, "allowGroup1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.ALLOW, AccessRight.USE_MARKING_AS_INT, 0, "allowGroup2"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.DENY, 0, 0, "denyUser1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.DENY, AccessRight.USE_MARKING_AS_INT, 0, "denyUser2"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.DENY, AccessRight.USE_MARKING_AS_INT, 0, "denyGroup1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.DENY, 0, 0, "denyGroup2"); Permissions testPerms = new Permissions(perms); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals( ImmutableSet.<String>of("allowUser1"), acl.getAllowUsers()); assertEquals( ImmutableSet.<String>of("allowGroup2", AUTHENTICATED_USERS), acl.getAllowGroups()); assertEquals( ImmutableSet.<String>of("denyUser2"), acl.getDenyUsers()); assertEquals( ImmutableSet.<String>of("denyGroup1"), acl.getDenyGroups()); }</code><technical_language>s/0/AccessRight.NONE_AS_INT/g-ish (as applicable). Also, 0 sometimes, say, VIEW_ACCESS_RIGHTS mess us</technical_language>

Target:
public void testMarkingAcl_someUseMarking_allowConstraintMask() throws Exception { addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.ALLOW, AccessRight.USE_MARKING_AS_INT, 0, "allowUser1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.ALLOW, AccessRight.NONE_AS_INT, 0, "allowUser2"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.ALLOW, AccessRight.NONE_AS_INT, 0, "allowGroup1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.ALLOW, AccessRight.USE_MARKING_AS_INT, 0, "allowGroup2"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.DENY, VIEW_ACCESS_RIGHTS, 0, "denyUser1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.USER, AccessType.DENY, AccessRight.USE_MARKING_AS_INT, 0, "denyUser2"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.DENY, AccessRight.USE_MARKING_AS_INT, 0, "denyGroup1"); addAce(PermissionSource.MARKING, SecurityPrincipalType.GROUP, AccessType.DENY, AccessRight.NONE_AS_INT, 0, "denyGroup2"); Permissions testPerms = new Permissions(perms); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals(ImmutableSet.of("allowUser1"), acl.getAllowUsers()); assertEquals(ImmutableSet.of("allowGroup2", AUTHENTICATED_USERS), acl.getAllowGroups()); assertEquals(ImmutableSet.of("denyUser2"), acl.getDenyUsers()); assertEquals(ImmutableSet.of("denyGroup1"), acl.getDenyGroups()); }
Source:
<code>private boolean glusterHostRemove(Guid sourceClusterId) { String hostName = (getVds().gethost_name().isEmpty()) ? getVds().getManagmentIp() : getVds().gethost_name(); VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), hostName, false)); <START> if (getSucceeded()) { <END> return returnValue.getSucceeded(); } else { handleVdsError(returnValue); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return false; } }</code><technical_language>i meant if statement check for return of GlusterHostRemove getSucceeded return true (same for add well)</technical_language>

Target:
private boolean glusterHostRemove(Guid sourceClusterId) { String hostName = (getVds().gethost_name().isEmpty()) ? getVds().getManagmentIp() : getVds().gethost_name(); VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), hostName, false)); if (!returnValue.getSucceeded()) { handleVdsError(returnValue); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return false; } return true; }
Source:
<code>public static String getNumaIdForPort(Number port, Map<String, Object> stormConf) { Map validatedNumaMap = null; try { validatedNumaMap = getValidatedNumaMap(stormConf); } catch (KeyNotFoundException e) { LOG.error("Exception while getting NUMA config", e); return null; } for (Object numaEntry : validatedNumaMap.values()) { Map numaMap = (Map<String, Object>) numaEntry; List<Integer> portList = (List<Integer>) numaMap.get(NUMAS_PORTS); if (portList.contains(port)) { return (String) numaMap.get(NUMA_ID); } } <START> return null; <END> }</code><technical_language>This sounds a serious misconfig. I throw exception</technical_language>

Target:
public static String getNumaIdForPort(Number port, Map<String, Object> stormConf) { Map<String, Object> validatedNumaMap = getNumaMap(stormConf); for (Entry<String, Object> numaEntry : validatedNumaMap.entrySet()) { Map numaMap = (Map<String, Object>) numaEntry.getValue(); List<Integer> portList = (List<Integer>) numaMap.get(NUMA_PORTS); if (portList.contains(port)) { return numaEntry.getKey(); } } return null; }