auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> diskImages = <START> new HashSet<>(); <END> if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); diskImages = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskImages); }</code><technical_language>null semantics of "all disks in snapshot". empty set semantics of "no disks all". tl;dr - this null</technical_language>

Target:
private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> diskImages = null; if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); diskImages = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskImages); }
Source:
<code>public boolean setConfig(Configuration conf) { boolean success = false; try { for(int i=0; i<this.publishers.length; i++) { success |= this.publishers[i].setConfig(conf); if(success) LOG.info("Successfully loaded " + this.publishers[i].getClass().getName() +" publisher"); } }catch(Exception e) { <START> LOG.warn("Error while loading publishers : " + e.getMessage()); <END> } if(!success) { LOG.warn("Could not load any publishers out of " + this.publishers.length +" publishers"); } return success; }</code><technical_language>Parameterized logging please</technical_language>

Target:
public boolean setConfig(Configuration conf) { boolean success = false; try { for(int i=0; i<this.publishers.length; i++) { success |= this.publishers[i].setConfig(conf); if(success) LOG.info("Successfully loaded publisher", this.publishers[i].getClass().getName()); } }catch(Exception e) { LOG.warn("Error while loading publishers : {}", e.getMessage()); } if(!success) { LOG.warn("Could not load any publishers out of publishers", this.publishers.length); } return success; }
Source:
<code>private boolean updateMetadataForIndex(final String indexName, final long lastSequence) { <START> boolean success; <END> Future<Boolean> result = queue.submit(new Callable<Boolean>() { @Override public Boolean call() { boolean updateSuccess = true; ContentValues v = new ContentValues(); v.put("last_sequence", lastSequence); int row = database.update(IndexManager.INDEX_METADATA_TABLE_NAME, v, " index_name = ? ", new String[]{ indexName }); if (row <= 0) { updateSuccess = false; } return updateSuccess; } }); try { success = result.get(); } catch (ExecutionException e) { logger.log(Level.SEVERE, "Execution error encountered:", e); success = false; } catch (InterruptedException e) { logger.log(Level.SEVERE, "Execution interrupted error encountered:", e); success = false; } return success; }</code><technical_language>Define point of use</technical_language>

Target:
private boolean updateMetadataForIndex(final String indexName, final long lastSequence) { Future<Boolean> result = queue.submit(new Callable<Boolean>() { @Override public Boolean call() { boolean updateSuccess = true; ContentValues v = new ContentValues(); v.put("last_sequence", lastSequence); int row = database.update(IndexManager.INDEX_METADATA_TABLE_NAME, v, " index_name = ? ", new String[]{ indexName }); if (row <= 0) { updateSuccess = false; } return updateSuccess; } }); boolean success; try { success = result.get(); } catch (ExecutionException e) { logger.log(Level.SEVERE, "Execution error encountered:", e); success = false; } catch (InterruptedException e) { logger.log(Level.SEVERE, "Execution interrupted error encountered:", e); success = false; } return success; }
Source:
<code>public void setupExecutor() { if (m_executor!=null) { return; } synchronized(m_executorLock) { <START> exportLog.info("Activating ExportDataSource gen " + m_generation <END> + " table " + m_tableName + " partition " + m_partitionId + "FirstAction: " + (m_firstAction != null ? "true" : "false")); if (m_executor==null) { ListeningExecutorService es = CoreUtils.getListeningExecutorService( "ExportDataSource gen " + m_generation + " table " + m_tableName + " partition " + m_partitionId, 1); if (m_firstAction != null) { exportLog.info("Submitting truncate task for ExportDataSource gen " + m_generation + " table " + m_tableName + " partition " + m_partitionId); es.submit(m_firstAction); } if (m_queuedActions.size()>0) { for (RunnableWithES queuedR : m_queuedActions) { queuedR.setExecutorService(es); es.submit(queuedR); } m_queuedActions.clear(); } m_executor = es; } } }</code><technical_language>Is this gonna generate a lot of messages in log if partitions export tables? Export is generating a lot of messages. careful putting messages useful developers in log</technical_language>

Target:
public void setupExecutor() { if (m_executor!=null) { return; } synchronized(m_executorLock) { if (exportLog.isDebugEnabled()) { exportLog.debug("Activating ExportDataSource gen " + m_generation + " table " + m_tableName + " partition " + m_partitionId + "FirstAction: " + (m_firstAction != null ? "true" : "false")); } if (m_executor==null) { ListeningExecutorService es = CoreUtils.getListeningExecutorService( "ExportDataSource gen " + m_generation + " table " + m_tableName + " partition " + m_partitionId, 1); if (m_firstAction != null) { exportLog.info("Submitting truncate task for ExportDataSource gen " + m_generation + " table " + m_tableName + " partition " + m_partitionId); es.submit(m_firstAction); } if (m_queuedActions.size()>0) { for (RunnableWithES queuedR : m_queuedActions) { queuedR.setExecutorService(es); es.submit(queuedR); } m_queuedActions.clear(); } m_executor = es; } } }
Source:
<code>private void computeResultsForLiteral(Literal literal, List<String> columnNames, List<DataSchema.ColumnDataType> columnTypes, List<Object> row) { Object fieldValue = literal.getFieldValue(); columnNames.add(fieldValue.toString()); switch (literal.getSetField()) { case SHORT_VALUE: columnTypes.add(DataSchema.ColumnDataType.INT); row.add((int) literal.getShortValue()); break; case INT_VALUE: columnTypes.add(DataSchema.ColumnDataType.INT); row.add(literal.getIntValue()); break; case LONG_VALUE: columnTypes.add(DataSchema.ColumnDataType.LONG); row.add(literal.getLongValue()); break; case DOUBLE_VALUE: columnTypes.add(DataSchema.ColumnDataType.DOUBLE); row.add(literal.getDoubleValue()); break; case BOOL_VALUE: columnTypes.add(DataSchema.ColumnDataType.STRING); row.add(new Boolean(literal.getBoolValue()).toString()); break; case STRING_VALUE: columnTypes.add(DataSchema.ColumnDataType.STRING); System.out.println("literal.getStringValue() = " + literal.getStringValue()); row.add(literal.getStringValue()); break; case BINARY_VALUE: columnTypes.add(DataSchema.ColumnDataType.BYTES); row.add(BytesUtils.toHexString(literal.getBinaryValue())); break; <START> case BYTE_VALUE: <END> columnTypes.add(DataSchema.ColumnDataType.BYTES); row.add(BytesUtils.toHexString(new byte[]{literal.getByteValue()})); break; } }</code><technical_language>BYTE modeled INT</technical_language>

Target:
private void computeResultsForLiteral(Literal literal, List<String> columnNames, List<DataSchema.ColumnDataType> columnTypes, List<Object> row) { Object fieldValue = literal.getFieldValue(); columnNames.add(fieldValue.toString()); switch (literal.getSetField()) { case BOOL_VALUE: columnTypes.add(DataSchema.ColumnDataType.STRING); row.add(new Boolean(literal.getBoolValue()).toString()); break; case BYTE_VALUE: columnTypes.add(DataSchema.ColumnDataType.INT); row.add((int)literal.getByteValue()); break; case SHORT_VALUE: columnTypes.add(DataSchema.ColumnDataType.INT); row.add((int) literal.getShortValue()); break; case INT_VALUE: columnTypes.add(DataSchema.ColumnDataType.INT); row.add(literal.getIntValue()); break; case LONG_VALUE: columnTypes.add(DataSchema.ColumnDataType.LONG); row.add(literal.getLongValue()); break; case DOUBLE_VALUE: columnTypes.add(DataSchema.ColumnDataType.DOUBLE); row.add(literal.getDoubleValue()); break; case STRING_VALUE: columnTypes.add(DataSchema.ColumnDataType.STRING); row.add(literal.getStringValue()); break; case BINARY_VALUE: columnTypes.add(DataSchema.ColumnDataType.BYTES); row.add(BytesUtils.toHexString(literal.getBinaryValue())); break; } }
Source:
<code>private void createPOJO(TypeDeclarationDescr typeDescr) { SafeTypeResolver typeResolver = new SafeTypeResolver(pkg.getTypeResolver()); DescrTypeDefinition descrDeclaredTypeDefinition = new DescrTypeDefinition(packageDescr, typeDescr, typeResolver); descrDeclaredTypeDefinition.getErrors().forEach(builder::addBuilderResult); ClassOrInterfaceDeclaration generatedClass = new GeneratedClassDeclaration(descrDeclaredTypeDefinition, <START> Arrays.asList(GeneratedFact.class, AccessibleFact.class)) <END> .toClassDeclaration(); packageModel.addGeneratedPOJO(generatedClass); addTypeMetadata(typeDescr.getTypeName()); }</code><technical_language>Nitpick: is reason create list of interfaces implemented pojo generation instead of in a static final field</technical_language>

Target:
private void createPOJO(TypeDeclarationDescr typeDescr) { SafeTypeResolver typeResolver = new SafeTypeResolver(pkg.getTypeResolver()); DescrTypeDefinition descrDeclaredTypeDefinition = new DescrTypeDefinition(packageDescr, typeDescr, typeResolver); descrDeclaredTypeDefinition.getErrors().forEach(builder::addBuilderResult); ClassOrInterfaceDeclaration generatedClass = new GeneratedClassDeclaration(descrDeclaredTypeDefinition, MARKER_INTERFACES) .toClassDeclaration(); packageModel.addGeneratedPOJO(generatedClass); addTypeMetadata(typeDescr.getTypeName()); }
Source:
<code>public SecurityKey build() { final SecurityKey securityKey = new SecurityKey(this.dlmsDevice, this.securityKeyType, this.key, this.validFrom, this.validTo); securityKey.setVersion(this.version); securityKey.setValidFrom(this.validFrom); <START> if (this.validTo != null) { <END> securityKey.setValidTo(this.validTo); } return securityKey; }</code><technical_language>If null is a valid for validTo cleaner setter in securityKey capable of dealing null values well, instead of guarding input calling setter</technical_language>

Target:
public SecurityKey build() { final SecurityKey securityKey = new SecurityKey(this.dlmsDevice, this.securityKeyType, this.key, this.validFrom, this.validTo); securityKey.setVersion(this.version); securityKey.setValidFrom(this.validFrom); securityKey.setValidTo(this.validTo); return securityKey; }
Source:
<code>protected double parseDouble(String value, String description) throws InvalidStateException { try { Double numeric = Double.valueOf(value); if (numeric.isNaN()) { throw new InvalidStateException("Could not understand '" + value + "' in " + description); } <START> return numeric.doubleValue(); <END> } catch (NumberFormatException nfe) { throw new InvalidStateException("Could not understand '" + value + "' in " + description); } }</code><technical_language>Lint warning unneed unbox, unboxing is done automatically in new versions of Java</technical_language>

Target:
protected double parseDouble(String value, String description) throws InvalidStateException { try { Double numeric = Double.valueOf(value); if (numeric.isNaN()) { throw new InvalidStateException("Could not understand '" + value + "' in " + description); } return numeric; } catch (NumberFormatException nfe) { throw new InvalidStateException("Could not understand '" + value + "' in " + description); } }
Source:
<code>public boolean equals(final Object obj) { boolean result = false; if (this == obj) { result = true; } else { if (obj instanceof RepresentationDescriptionItemImpl) { final RepresentationDescriptionItemImpl rdiObj = (RepresentationDescriptionItemImpl) obj; <START> result = EqualityHelper.areEquals(this.representationDescription, <END> rdiObj.representationDescription); result = this.parent.equals(rdiObj.parent); } } return result; }</code><technical_language>line remove</technical_language>

Target:
public boolean equals(final Object obj) { boolean result = false; if (this == obj) { result = true; } else { if (obj instanceof RepresentationDescriptionItemImpl) { final RepresentationDescriptionItemImpl rdiObj = (RepresentationDescriptionItemImpl) obj; result = EqualityHelper.areEquals(this.representationDescription, rdiObj.representationDescription); result = result && this.parent.equals(rdiObj.parent); } } return result; }
Source:
<code>static boolean isChoice(Term term) { return term instanceof KItem && ((KItem) term).kLabel() instanceof KLabelConstant <START> && (((KItem) term).kLabel().toString().equals("Map:choice") <END> || ((KItem) term).kLabel().toString().equals("Set:choice")) && ((KItem) term).kList() instanceof KList && ((KList) ((KItem) term).kList()).isConcreteCollection() && ((KList) ((KItem) term).kList()).concreteSize() == 2; }</code><technical_language>extract "Map:choice" a constant</technical_language>

Target:
static boolean isChoice(Term term) { return term instanceof KItem && ((KItem) term).kLabel() instanceof KLabelConstant && (((KItem) term).kLabel().toString().equals(MAP_CHOICE) || ((KItem) term).kLabel().toString().equals(SET_CHOICE)) && ((KItem) term).kList() instanceof KList && ((KList) ((KItem) term).kList()).isConcreteCollection() && ((KList) ((KItem) term).kList()).concreteSize() == 2; }
Source:
<code>public static BloomFilterHeader toBloomFilterHeader( org.apache.parquet.column.values.bloomfilter.BloomFilter bloomFilter) { BloomFilterAlgorithm algorithm = null; BloomFilterHash hashStrategy = null; BloomFilterCompression compression = null; if (bloomFilter.getAlgorithm() == BloomFilter.Algorithm.BLOCK) { algorithm = BloomFilterAlgorithm.BLOCK(new SplitBlockAlgorithm()); } if (bloomFilter.getHashStrategy() == BloomFilter.HashStrategy.XXH64) { hashStrategy = BloomFilterHash.XXHASH(new XxHash()); } if (bloomFilter.getCompression() == BloomFilter.Compression.UNCOMPRESSED) { compression = BloomFilterCompression.UNCOMPRESSED(new Uncompressed()); } if (algorithm != null && hashStrategy != null && compression != null) { return new BloomFilterHeader(bloomFilter.getBitsetSize(), algorithm, hashStrategy, compression); } else { <START> return null; <END> } }</code><technical_language>This method is want write a constructed bloom filter file. If is missing invalid is a bug so, I throw exception instead of simply returning null</technical_language>

Target:
public static BloomFilterHeader toBloomFilterHeader( org.apache.parquet.column.values.bloomfilter.BloomFilter bloomFilter) { BloomFilterAlgorithm algorithm = null; BloomFilterHash hashStrategy = null; BloomFilterCompression compression = null; if (bloomFilter.getAlgorithm() == BloomFilter.Algorithm.BLOCK) { algorithm = BloomFilterAlgorithm.BLOCK(new SplitBlockAlgorithm()); } if (bloomFilter.getHashStrategy() == BloomFilter.HashStrategy.XXH64) { hashStrategy = BloomFilterHash.XXHASH(new XxHash()); } if (bloomFilter.getCompression() == BloomFilter.Compression.UNCOMPRESSED) { compression = BloomFilterCompression.UNCOMPRESSED(new Uncompressed()); } if (algorithm != null && hashStrategy != null && compression != null) { return new BloomFilterHeader(bloomFilter.getBitsetSize(), algorithm, hashStrategy, compression); } else { throw new IllegalArgumentException(String.format("Failed to build thrift structure for BloomFilterHeader," + "algorithm=%s, hash=%s, compression=%s", bloomFilter.getAlgorithm(), bloomFilter.getHashStrategy(), bloomFilter.getCompression())); } }
Source:
<code>public List<DeviceStatus> getPillStatus(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @PathParam("email") final String email) { LOGGER.debug("Fetching pill status for user = {}", email); <START> Optional<Long> accountId = getAccountIdByEmail(email); <END> final List<DeviceStatus> pillStatuses = new ArrayList<>(); if (!accountId.isPresent()) { LOGGER.debug("ID not found for account {}", email); throw new WebApplicationException(Response.Status.NOT_FOUND); } final ImmutableList<DeviceAccountPair> pills = deviceDAO.getPillsForAccountId(accountId.get()); for (final DeviceAccountPair pill : pills) { pillStatuses.addAll(deviceDAO.pillStatusWithBatteryLevel(pill.internalDeviceId)); } return pillStatuses; }</code><technical_language>final</technical_language>

Target:
public List<DeviceStatus> getPillStatus(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken, @PathParam("email") final String email) { LOGGER.debug("Fetching pill status for user = {}", email); final Optional<Long> accountId = getAccountIdByEmail(email); final List<DeviceStatus> pillStatuses = new ArrayList<>(); if (!accountId.isPresent()) { LOGGER.debug("ID not found for account {}", email); throw new WebApplicationException(Response.Status.NOT_FOUND); } final ImmutableList<DeviceAccountPair> pills = deviceDAO.getPillsForAccountId(accountId.get()); for (final DeviceAccountPair pill : pills) { pillStatuses.addAll(deviceDAO.pillStatusWithBatteryLevel(pill.internalDeviceId)); } return pillStatuses; }
Source:
<code>public void testUGILoginFromKeytab() throws Exception { long beforeLogin = Time.now(); String principal = "foo"; File keytab = new File(workDir, "foo.keytab"); kdc.createPrincipal(keytab, principal); UserGroupInformation.loginUserFromKeytab(principal, keytab.getPath()); UserGroupInformation ugi = UserGroupInformation.getLoginUser(); Assert.assertTrue("UGI should be configured to login from keytab", ugi.isFromKeytab()); User user = getUser(ugi.getSubject()); Assert.assertNotNull(user.getLogin()); <START> Assert.assertTrue("User last login time is not set correctly", <END> user.getLastLogin() > beforeLogin); }</code><technical_language>error text include values fault, debug a junit report</technical_language>

Target:
public void testUGILoginFromKeytab() throws Exception { long beforeLogin = Time.now(); String principal = "foo"; File keytab = new File(workDir, "foo.keytab"); kdc.createPrincipal(keytab, principal); UserGroupInformation.loginUserFromKeytab(principal, keytab.getPath()); UserGroupInformation ugi = UserGroupInformation.getLoginUser(); Assert.assertTrue("UGI should be configured to login from keytab", ugi.isFromKeytab()); User user = getUser(ugi.getSubject()); Assert.assertNotNull(user.getLogin()); Assert.assertTrue("User login time is less than before login time, " + "beforeLoginTime:" + beforeLogin + " userLoginTime:" + user.getLastLogin(), user.getLastLogin() > beforeLogin); }
Source:
<code>protected void startProcess(ExecutorDriver driver, Task task) { if (task.process == null) { try { <START> task.run(); <END> redirectProcess(task.process); } catch (IOException e) { LOGGER.error("Failed to run command", e); fail(driver); } } else { LOGGER.error("Tried to start process, but process already running"); } }</code><technical_language>some other Executors wait if task exits immediately. do too</technical_language>

Target:
protected void startProcess(ExecutorDriver driver, Task task) { if (task.process == null) { try { task.run(); redirectProcess(task.process); try { Thread.sleep(10000); task.process.exitValue(); fail(driver); } catch (InterruptedException | IllegalThreadStateException e) { LOGGER.debug("task still running after 10s"); } } catch (IOException e) { LOGGER.error("Failed to run command", e); fail(driver); } } else { LOGGER.error("Tried to start process, but process already running"); } }
Source:
<code><START> private static Arguments printout(Arguments arguments) { <END> System.out.println(Arrays.toString(arguments.get())); return arguments; }</code><technical_language>need return Arguments</technical_language>

Target:
private static Arguments printout(Arguments arguments) { if (testMode != TestMode.PLAYBACK) { System.out.println(Arrays.toString(arguments.get())); } return arguments; }
Source:
<code>public void testContentEquals() { <START> Bytes b1 = Bytes.of("a"); <END> byte[] b2 = b1.toArray(); Assert.assertTrue(b1.contentEquals(b2)); byte[] b3 = Bytes.of("b").toArray(); Assert.assertFalse(b1.contentEquals(b3)); }</code><technical_language>nice check lengths empty</technical_language>

Target:
public void testContentEquals() { Bytes b1 = Bytes.of("a"); byte[] b2 = b1.toArray(); byte[] b3 = Bytes.of("b").toArray(); Bytes b5 = Bytes.of("qwerty"); byte[] b6 = b5.toArray(); Bytes b7 = Bytes.of(""); byte[] b8 = b7.toArray(); Assert.assertTrue(b1.contentEquals(b2)); Assert.assertTrue(b5.contentEquals(b6)); Assert.assertTrue(b7.contentEquals(b8)); Assert.assertFalse(b1.contentEquals(b3)); Assert.assertFalse(b1.contentEquals(b6)); Assert.assertFalse(b5.contentEquals(b2)); Assert.assertFalse(b1.contentEquals(b8)); Assert.assertFalse(b5.contentEquals(b8)); Assert.assertFalse(b7.contentEquals(b2)); Assert.assertFalse(b7.contentEquals(b6)); }
Source:
<code>public void testInvalidURI() throws Exception { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); <START> Mockito.when(request.getRemoteAddr()).thenReturn(null); <END> Mockito.when(request.getMethod()).thenReturn("GET"); Mockito.when(request.getRequestURI()).thenReturn("/InvalidURI"); Mockito.when(request.getQueryString()).thenReturn(null); HttpServletResponse response = Mockito.mock(HttpServletResponse.class); Filter filter = new HostRestrictingAuthorizationFilter(); HashMap<String, String> configs = new HashMap<String, String>() {}; configs.put(AuthenticationFilter.AUTH_TYPE, "simple"); FilterConfig fc = new DummyFilterConfig(configs); filter.init(fc); filter.doFilter(request, response, (servletRequest, servletResponse) -> {}); Mockito.verify(response, Mockito.times(1)) .sendError(Mockito.eq(HttpServletResponse.SC_NOT_FOUND), Mockito.anyString()); filter.destroy(); }</code><technical_language>nit: this required</technical_language>

Target:
public void testInvalidURI() throws Exception { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getMethod()).thenReturn("GET"); Mockito.when(request.getRequestURI()).thenReturn("/InvalidURI"); HttpServletResponse response = Mockito.mock(HttpServletResponse.class); Filter filter = new HostRestrictingAuthorizationFilter(); HashMap<String, String> configs = new HashMap<String, String>() {}; configs.put(AuthenticationFilter.AUTH_TYPE, "simple"); FilterConfig fc = new DummyFilterConfig(configs); filter.init(fc); filter.doFilter(request, response, (servletRequest, servletResponse) -> {}); Mockito.verify(response, Mockito.times(1)) .sendError(Mockito.eq(HttpServletResponse.SC_NOT_FOUND), Mockito.anyString()); filter.destroy(); }
Source:
<code>public void handleUpstream( ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { if (!(evt instanceof MessageEvent)) { ctx.sendUpstream(evt); return; } MessageEvent e = (MessageEvent) evt; Object originalMessage = e.getMessage(); Object decodedMessage = decode(e.getChannel(), e.getRemoteAddress(), originalMessage); onMessageEvent(e.getChannel(), e.getRemoteAddress(), originalMessage, decodedMessage); if (originalMessage == decodedMessage) { ctx.sendUpstream(evt); } else { if (decodedMessage == null) { decodedMessage = handleEmptyMessage(e.getChannel(), e.getRemoteAddress(), originalMessage); } if (decodedMessage != null) { if (decodedMessage instanceof Collection) { for (Object o : (Collection) decodedMessage) { saveOriginal(o, originalMessage); Channels.fireMessageReceived(ctx, o, e.getRemoteAddress()); } <START> } else if (decodedMessage instanceof Map) { <END> Iterator it = ((Map) decodedMessage).entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); List<Position> positions = (List<Position>) pair.getValue(); for (Position position : positions) { saveOriginal(position, originalMessage); Channels.fireMessageReceived(ctx, position, e.getRemoteAddress()); } } } else { saveOriginal(decodedMessage, originalMessage); Channels.fireMessageReceived(ctx, decodedMessage, e.getRemoteAddress()); } } } }</code><technical_language>do need a map</technical_language>

Target:
public void handleUpstream( ChannelHandlerContext ctx, ChannelEvent evt) throws Exception { if (!(evt instanceof MessageEvent)) { ctx.sendUpstream(evt); return; } MessageEvent e = (MessageEvent) evt; Object originalMessage = e.getMessage(); Object decodedMessage = decode(e.getChannel(), e.getRemoteAddress(), originalMessage); onMessageEvent(e.getChannel(), e.getRemoteAddress(), originalMessage, decodedMessage); if (originalMessage == decodedMessage) { ctx.sendUpstream(evt); } else { if (decodedMessage == null) { decodedMessage = handleEmptyMessage(e.getChannel(), e.getRemoteAddress(), originalMessage); } if (decodedMessage != null) { if (decodedMessage instanceof Collection) { for (Object o : (Collection) decodedMessage) { saveOriginal(o, originalMessage); Channels.fireMessageReceived(ctx, o, e.getRemoteAddress()); } } else { saveOriginal(decodedMessage, originalMessage); Channels.fireMessageReceived(ctx, decodedMessage, e.getRemoteAddress()); } } } }
Source:
<code>private void refresh(ClusterConfig clusterConfig, InstanceConfig instanceConfig, Collection<AssignableReplica> existingAssignment) { reset(); Map<String, Integer> instanceCapaity = instanceConfig.getInstanceCapacityMap(); if (instanceCapaity.isEmpty()) { instanceCapaity = clusterConfig.getDefaultInstanceCapacityMap(); } _currentCapacity.putAll(instanceCapaity); _faultZone = computeFaultZone(clusterConfig, instanceConfig); _instanceTags = new HashSet<>(instanceConfig.getTags()); _disabledPartitionsMap = instanceConfig.getDisabledPartitionsMap(); <START> _maxCapacity = instanceCapaity; <END> _maxPartition = clusterConfig.getMaxPartitionsPerInstance(); assignNewBatch(existingAssignment); }</code><technical_language>typo</technical_language>

Target:
private void refresh(ClusterConfig clusterConfig, InstanceConfig instanceConfig, Collection<AssignableReplica> existingAssignment) { reset(); Map<String, Integer> instanceCapacity = instanceConfig.getInstanceCapacityMap(); if (instanceCapacity.isEmpty()) { instanceCapacity = clusterConfig.getDefaultInstanceCapacityMap(); } _currentCapacity.putAll(instanceCapacity); _faultZone = computeFaultZone(clusterConfig, instanceConfig); _instanceTags = new HashSet<>(instanceConfig.getTags()); _disabledPartitionsMap = instanceConfig.getDisabledPartitionsMap(); _maxCapacity = instanceCapacity; _maxPartition = clusterConfig.getMaxPartitionsPerInstance(); assignNewBatch(existingAssignment); }
Source:
<code>protected void onAttach() { String loaded = $(image).parent().data("loaded"); if (loaded != null) { return; } $(image).parent().css("display", "none"); $(image).parent().data("loaded", ""); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { <START> $(image).parent().first().css("display", "block"); <END> } }); }</code><technical_language>first() removed</technical_language>

Target:
protected void onAttach() { String loaded = $(image).parent().data("loaded"); if (loaded != null) { return; } $(image).parent().css("display", "none").data("loaded", ""); Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { $(image).parent().css("display", "block"); } }); }
Source:
<code>static void validatePartitioner(String partitioner, CassandraKeyValueServiceConfig config) { <START> if (!(config.safetyDisabled() || config.ignorePartitionerChecks())) { <END> Verify.verify( CassandraConstants.ALLOWED_PARTITIONERS.contains(partitioner), "Invalid partitioner. Allowed: %s, but partitioner is: %s", CassandraConstants.ALLOWED_PARTITIONERS, partitioner); } }</code><technical_language>mention config set ignore this if throwing</technical_language>

Target:
static void validatePartitioner(String partitioner, CassandraKeyValueServiceConfig config) { if (!config.ignorePartitionerChecks()) { Verify.verify( CassandraConstants.ALLOWED_PARTITIONERS.contains(partitioner), "Invalid partitioner. Allowed: %s, but partitioner is: %s. " + "If you fully understand how it will affect range scan performance and vnode generation, " + "you can set 'ignorePartitionerChecks' in your config.", CassandraConstants.ALLOWED_PARTITIONERS, partitioner); } }
Source:
<code>public synchronized boolean hasChanged() { <START> final boolean snapExist = contentFile.exists(); <END> final long snapLastModified = snapExist ? contentFile.lastModified() : 0; final boolean snapOrigDirectory = snapExist && contentFile.isDirectory(); final long snapLength = getLength(); return exists != snapExist || lastModified != snapLastModified || directory != snapOrigDirectory || length != snapLength; }</code><technical_language>Suggestion: Instead of compiling current values comparing values end, easier/clearer do this? suggestion if (contentFile.exists() != exists) { return false; } if (contentFile.lastModified() != lastModified ) { return false; } // Etc</technical_language>

Target:
public boolean hasChanged() { return exists != snapExist() || lastModified != snapLastModified() || directory != snapDirectory() || length != snapLength(); }
Source:
<code>public void testGetAuthTokenInBackgroundVerifyErrorMessageBadAuth() throws IllegalAccessException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, InstantiationException, OperationCanceledException, IOException, NoSuchFieldException, AuthenticatorException { Object brokerProxy = ReflectionUtils.getInstance("com.microsoft.aad.adal.BrokerProxy"); String acctName = "testAcct123"; Object authRequest = createAuthenticationRequest("<LINK_0>", "resource", "client", "redirect", acctName.toLowerCase(Locale.US), PromptBehavior.Auto, "", UUID.randomUUID(), false); <START> setMockProxyForErrorCheck(brokerProxy, acctName, AccountManager.ERROR_CODE_BAD_ARGUMENTS, <END> "testErrorMessage"); try { Method m = ReflectionUtils.getTestMethod(brokerProxy, "getAuthTokenInBackground", authRequest.getClass()); AuthenticationResult result = (AuthenticationResult) m.invoke(brokerProxy, authRequest); Assert.fail("should throw"); } catch (Exception ex) { assertTrue("Exception type check", ex.getCause() instanceof AuthenticationException); assertEquals("check error code", ADALError.BROKER_AUTHENTICATOR_BAD_ARGUMENTS, ((AuthenticationException) ex.getCause()).getCode()); } }</code><technical_language>changing error_code_bad_authentication error_code_bad_arguments? #Closed</technical_language>

Target:
public void testGetAuthTokenInBackgroundVerifyErrorMessageBadAuth() throws IllegalAccessException, InvocationTargetException, ClassNotFoundException, NoSuchMethodException, InstantiationException, OperationCanceledException, IOException, NoSuchFieldException, AuthenticatorException { Object brokerProxy = ReflectionUtils.getInstance("com.microsoft.aad.adal.BrokerProxy"); String acctName = "testAcct123"; Object authRequest = createAuthenticationRequest("<LINK_0>", "resource", "client", "redirect", acctName.toLowerCase(Locale.US), PromptBehavior.Auto, "", UUID.randomUUID(), false); setMockProxyForErrorCheck(brokerProxy, acctName, AccountManager.ERROR_CODE_BAD_AUTHENTICATION, "testErrorMessage"); try { Method m = ReflectionUtils.getTestMethod(brokerProxy, "getAuthTokenInBackground", authRequest.getClass()); AuthenticationResult result = (AuthenticationResult) m.invoke(brokerProxy, authRequest); Assert.fail("should throw"); } catch (Exception ex) { assertTrue("Exception type check", ex.getCause() instanceof AuthenticationException); assertEquals("check error code", ADALError.BROKER_AUTHENTICATOR_BAD_AUTHENTICATION, ((AuthenticationException) ex.getCause()).getCode()); } }
Source:
<code>private IPersonAttributesGroupDefinition getPagsGroupDefByName(String name) { Set<IPersonAttributesGroupDefinition> pagsGroups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(name); if (pagsGroups.size() > 1) { <START> logger.warn("More than one PAGS group with name found.", name); <END> } return pagsGroups.isEmpty() ? null : pagsGroups.iterator().next(); }</code><technical_language>warn insufficiently dire for a violation of a fundamental assumption of groups system. error least? returning is effectively a random selection illegally multiple groups name is right behavior. I fail exception. exception results in entire portal falling dead, of course, exception fails specific group operation computed. Multiple groups name is, alas, okay</technical_language>

Target:
private IPersonAttributesGroupDefinition getPagsGroupDefByName(String name) { Set<IPersonAttributesGroupDefinition> pagsGroups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(name); if (pagsGroups.size() > 1) { logger.error("More than one PAGS group with name found.", name); } return pagsGroups.isEmpty() ? null : pagsGroups.iterator().next(); }
Source:
<code>protected boolean isConnWithSameDetailsExists() { String connection = getParameters().getStorageServerConnection().getconnection(); <START> if ((getDbFacade().getStorageServerConnectionDao().getAllForStorage(connection)).size() != 0) { <END> return true; } return false; }</code><technical_language>return (getDbFacade().getStorageServerConnectionDao().getAllForStorage(connection)).size() != 0</technical_language>

Target:
protected boolean isConnWithSameDetailsExists() { String connection = getConnection().getconnection(); return getDbFacade().getStorageServerConnectionDao().getAllForStorage(connection).size() != 0; }
Source:
<code><START> public CreateTopicsResult(Map<String, KafkaFuture<TopicMetadataAndConfig>> futures) { <END> this.futures = futures; }</code><technical_language>making protected instead mock a sub-class? CreateTopicsResults is part of public API want public (would this a public API change?)</technical_language>

Target:
protected CreateTopicsResult(Map<String, KafkaFuture<TopicMetadataAndConfig>> futures) { this.futures = futures; }
Source:
<code>private String normalizeBranchName(String name) { String normalized = Repository <START> .normalizeBranchName(name.replaceAll("[#$!]", "_")); END> if (normalized != null && normalized.length() > 30) { normalized = Repository .normalizeBranchName(normalized.substring(0, 30)); } return normalized; }</code><technical_language>I substitute a blank instead of underscore. Avoids initial underscores, normalizeBranchName trims, replaces blanks underscores</technical_language>

Target:
private String normalizeBranchName(String name) { String normalized = Repository .normalizeBranchName(name.replaceAll("[#$!]", " ")); if (normalized.length() > 30) { normalized = Repository .normalizeBranchName(normalized.substring(0, 30)); } return normalized; }
Source:
<code>public static String injectContextDependentValuesForTest(String content) { Date now = new Date(); Instant nowInstant = Instant.now(); return content.replace("<!-- test.url -->", TestProperties.TEAMMATES_URL) .replace("<!-- studentmotd.url -->", Config.STUDENT_MOTD_URL) .replace("<!-- support.email -->", Config.SUPPORT_EMAIL) .replace("<!-- version -->", TestProperties.TEAMMATES_VERSION) .replace("<!-- test.student1 -->", TestProperties.TEST_STUDENT1_ACCOUNT) .replace("<!-- test.student1.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_STUDENT1_ACCOUNT)) .replace("<!-- test.student2 -->", TestProperties.TEST_STUDENT2_ACCOUNT) .replace("<!-- test.student2.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_STUDENT2_ACCOUNT)) .replace("<!-- test.instructor -->", TestProperties.TEST_INSTRUCTOR_ACCOUNT) .replace("<!-- test.instructor.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_INSTRUCTOR_ACCOUNT)) .replace("<!-- test.admin -->", TestProperties.TEST_ADMIN_ACCOUNT) .replace("<!-- test.admin.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_ADMIN_ACCOUNT)) <START> .replace("<!-- now.datetime -->", TimeHelper.formatTime12H(TimeHelper.convertDateToLocalDateTime(now))) <END> .replace("<!-- now.datetime.sessions -->", TimeHelper.formatDateTimeForSessions(nowInstant, ZoneId.of("UTC"))) .replace("<!-- now.datetime.iso8601utc -->", TimeHelper.formatInstantToIso8601Utc(nowInstant)) .replace("<!-- now.datetime.courses -->", TimeHelper.formatDateTimeForInstructorCoursesPage(nowInstant, ZoneId.of("UTC"))); }</code><technical_language>refer patch</technical_language>

Target:
public static String injectContextDependentValuesForTest(String content) { Instant now = Instant.now(); return content.replace("<!-- test.url -->", TestProperties.TEAMMATES_URL) .replace("<!-- studentmotd.url -->", Config.STUDENT_MOTD_URL) .replace("<!-- support.email -->", Config.SUPPORT_EMAIL) .replace("<!-- version -->", TestProperties.TEAMMATES_VERSION) .replace("<!-- test.student1 -->", TestProperties.TEST_STUDENT1_ACCOUNT) .replace("<!-- test.student1.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_STUDENT1_ACCOUNT)) .replace("<!-- test.student2 -->", TestProperties.TEST_STUDENT2_ACCOUNT) .replace("<!-- test.student2.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_STUDENT2_ACCOUNT)) .replace("<!-- test.instructor -->", TestProperties.TEST_INSTRUCTOR_ACCOUNT) .replace("<!-- test.instructor.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_INSTRUCTOR_ACCOUNT)) .replace("<!-- test.admin -->", TestProperties.TEST_ADMIN_ACCOUNT) .replace("<!-- test.admin.truncated -->", StringHelper.truncateLongId(TestProperties.TEST_ADMIN_ACCOUNT)) .replace("<!-- now.datetime -->", TimeHelper.formatTime12H(LocalDateTime.now(ZoneId.of("UTC")))) .replace("<!-- now.datetime.sessions -->", TimeHelper.formatDateTimeForSessions(now, ZoneId.of("UTC"))) .replace("<!-- now.datetime.iso8601utc -->", TimeHelper.formatInstantToIso8601Utc(now)) .replace("<!-- now.datetime.courses -->", TimeHelper.formatDateTimeForInstructorCoursesPage(now, ZoneId.of("UTC"))); }
Source:
<code>private void moveSegments( final DruidServer server, final Set<BalancerSegmentHolder> segments, final DruidMasterRuntimeParams params ) { String toServer = server.getName(); LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer); for (final BalancerSegmentHolder segment : Sets.newHashSet(segments)) { String fromServer = segment.getServer().getName(); DataSegment segmentToMove = segment.getSegment(); final String segmentName = segmentToMove.getIdentifier(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (server.getSegment(segmentName) == null) && new ServerHolder(server, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.info( "Moving [%s] from [%s] to [%s]", segmentName, fromServer, toServer ); try { master.moveSegment( fromServer, toServer, segmentToMove.getIdentifier(), new LoadPeonCallback() { @Override protected void execute() { <START> currentlyMovingSegments.get(server.getSubType()).remove(segmentName, segment); <END> } } ); currentlyMovingSegments.get(server.getSubType()).put(segmentName, segment); } catch (Exception e) { log.makeAlert(e, String.format("[%s] : Moving exception", segmentName)).emit(); } } else { currentlyMovingSegments.get(server.getSubType()).remove(segment); } } }</code><technical_language>guaranteed this string of 3 get().remove() calls NPE get() remove()</technical_language>

Target:
private void moveSegments( final DruidServer server, final Set<BalancerSegmentHolder> segments, final DruidMasterRuntimeParams params ) { String toServer = server.getName(); LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer); for (final BalancerSegmentHolder segment : Sets.newHashSet(segments)) { String fromServer = segment.getServer().getName(); DataSegment segmentToMove = segment.getSegment(); final String segmentName = segmentToMove.getIdentifier(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (server.getSegment(segmentName) == null) && new ServerHolder(server, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.info( "Moving [%s] from [%s] to [%s]", segmentName, fromServer, toServer ); try { master.moveSegment( fromServer, toServer, segmentToMove.getIdentifier(), new LoadPeonCallback() { @Override protected void execute() { Map<String, BalancerSegmentHolder> movingSegments = currentlyMovingSegments.get(server.getTier()); if (movingSegments != null) { movingSegments.remove(segmentName); } } } ); currentlyMovingSegments.get(server.getTier()).put(segmentName, segment); } catch (Exception e) { log.makeAlert(e, String.format("[%s] : Moving exception", segmentName)).emit(); } } else { currentlyMovingSegments.get(server.getTier()).remove(segment); } } }
Source:
<code>private void navigate(@NonNull NavDestination node, @Nullable Bundle args, @Nullable NavOptions navOptions, @Nullable Navigator.Extras navigatorExtras) { boolean popped = false; if (navOptions != null) { if (navOptions.getPopUpTo() != -1) { popped = popBackStackInternal(navOptions.getPopUpTo(), navOptions.isPopUpToInclusive()); } } Navigator<NavDestination> navigator = mNavigatorProvider.getNavigator( node.getNavigatorName()); Bundle finalArgs = node.addInDefaultArgs(args); NavDestination newDest = navigator.navigate(node, finalArgs, navOptions, navigatorExtras); if (newDest != null) { ArrayDeque<NavBackStackEntry> hierarchy = new ArrayDeque<>(); NavGraph parent = newDest.getParent(); <START> while (parent != null) { <END> hierarchy.addFirst(new NavBackStackEntry(parent, finalArgs)); if (parent.getId() == node.getId() && !mBackStack.isEmpty()) { break; } parent = parent.getParent(); } if (!mBackStack.isEmpty() && mBackStack.getFirst().getDestination().getId() == hierarchy.getFirst().getDestination().getId()) { hierarchy.removeFirst(); } mBackStack.addAll(hierarchy); mBackStack.add(new NavBackStackEntry(newDest, newDest.addInDefaultArgs(finalArgs))); } mOnBackPressedCallback.setEnabled(getDestinationCountOnBackStack() > 1); if (popped || newDest != null) { dispatchOnDestinationChanged(); } }</code><technical_language>This code a lot more complex is hard understand. Is simplify this code</technical_language>

Target:
private void navigate(@NonNull NavDestination node, @Nullable Bundle args, @Nullable NavOptions navOptions, @Nullable Navigator.Extras navigatorExtras) { boolean popped = false; if (navOptions != null) { if (navOptions.getPopUpTo() != -1) { popped = popBackStackInternal(navOptions.getPopUpTo(), navOptions.isPopUpToInclusive()); } } Navigator<NavDestination> navigator = mNavigatorProvider.getNavigator( node.getNavigatorName()); Bundle finalArgs = node.addInDefaultArgs(args); NavDestination newDest = navigator.navigate(node, finalArgs, navOptions, navigatorExtras); if (newDest != null) { ArrayDeque<NavBackStackEntry> hierarchy = new ArrayDeque<>(); NavGraph parent = newDest.getParent(); boolean addNextParent = parent != null; while (addNextParent) { hierarchy.addFirst(new NavBackStackEntry(parent, finalArgs)); parent = parent.getParent(); addNextParent = parent != null; if (!mBackStack.isEmpty()) { addNextParent = addNextParent && parent.getId() != node.getId(); } } if (!mBackStack.isEmpty() && parent == null) { hierarchy.removeFirst(); } mBackStack.addAll(hierarchy); mBackStack.add(new NavBackStackEntry(newDest, newDest.addInDefaultArgs(finalArgs))); } mOnBackPressedCallback.setEnabled(getDestinationCountOnBackStack() > 1); if (popped || newDest != null) { dispatchOnDestinationChanged(); } }
Source:
<code>protected boolean isValidConnection(StorageServerConnections conn) { StorageType storageType = conn.getstorage_type(); if (storageType == StorageType.NFS && !new NfsMountPointConstraint().isValid(conn.getconnection(), null)) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID); } if (storageType == StorageType.POSIXFS && (StringUtils.isEmpty(conn.getVfsType()))) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if ((storageType == StorageType.POSIXFS || storageType == StorageType.NFS) && !validate(validateMountOptions())) { return false; } if (storageType == StorageType.ISCSI) { if (StringUtils.isEmpty(conn.getiqn())) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_IQN); } if (!isValidStorageConnectionPort(conn.getport())) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID_PORT); } } if (storageType == StorageType.GLUSTERFS) { StorageConnectionValidator validator = new StorageConnectionValidator(conn); ValidationResult validionResult = validator.isGlusterfsCliPackageInstalled(getVds()); if (!validionResult.isValid()) { <START> return failCanDoAction(validionResult.getMessage(), validionResult.getVariableReplacements().toArray(new String[validionResult.getVariableReplacements().size()])); <END> } } if (checkIsConnectionFieldEmpty(conn)) { return false; } return true; }</code><technical_language>This duplicates code in infrastructure: if (!validate(validator.isGlusterfsCliPackageInstalled(getVds())) { return false; }</technical_language>

Target:
protected boolean isValidConnection(StorageServerConnections conn) { StorageType storageType = conn.getstorage_type(); if (storageType == StorageType.NFS && !new NfsMountPointConstraint().isValid(conn.getconnection(), null)) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID); } if (storageType == StorageType.POSIXFS && (StringUtils.isEmpty(conn.getVfsType()))) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if ((storageType == StorageType.POSIXFS || storageType == StorageType.NFS) && !validate(validateMountOptions())) { return false; } if (storageType == StorageType.ISCSI) { if (StringUtils.isEmpty(conn.getiqn())) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_EMPTY_IQN); } if (!isValidStorageConnectionPort(conn.getport())) { return failCanDoAction(EngineMessage.VALIDATION_STORAGE_CONNECTION_INVALID_PORT); } } if (storageType == StorageType.GLUSTERFS) { StorageConnectionValidator validator = new StorageConnectionValidator(conn); if (!validate(validator.isGlusterfsCliPackageInstalled(getVds()))) { return false; } } if (checkIsConnectionFieldEmpty(conn)) { return false; } return true; }
Source:
<code>public void connect() throws IOException { <START> client = getManagementClient(); <END> ops = new Operations(client); }</code><technical_language>Is getManagementClient method elsewhere? I here, in case please inline it</technical_language>

Target:
public void connect() throws IOException { client = ManagementClient.online(OnlineOptions .standalone() .localDefault() .build()); ops = new Operations(client); }
Source:
<code>public void run() { <START> Map<String, Object> validatedNumaMap = Utils.getNumaMap(conf); <END> Map<String, SupervisorInfo> supervisorInfoList = buildSupervisorInfo(conf, supervisor, validatedNumaMap); for (Map.Entry<String, SupervisorInfo> supervisorInfoEntry: supervisorInfoList.entrySet()) { stormClusterState.supervisorHeartbeat(supervisorInfoEntry.getKey(), supervisorInfoEntry.getValue()); } }</code><technical_language>I line pulled buildSupervisorInfo(). appears intent is create supervisorInfo records Config.SUPERVISOR_NUMA_META entries leftover creating another SupervisorInfo(). private buildSupervisorInfo() method is called validatedNumaMap of null. of supervisorInfos creating a heartbeat-er</technical_language>

Target:
public void run() { Map<String, Object> validatedNumaMap = SupervisorUtils.getNumaMap(conf); Map<String, SupervisorInfo> supervisorInfoList = buildSupervisorInfo(conf, supervisor, validatedNumaMap); for (Map.Entry<String, SupervisorInfo> supervisorInfoEntry: supervisorInfoList.entrySet()) { stormClusterState.supervisorHeartbeat(supervisorInfoEntry.getKey(), supervisorInfoEntry.getValue()); } }