auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static long getMobileRxBytes() { long total = 0; for (String iface : getMobileIfaces()) { long stat = UNSUPPORTED; stat = getRxBytes(iface); if (stat != UNSUPPORTED) { total += stat; <START> } <END> } return total; }</code><technical_language>I de-dup this similar code a private static function, like: private static long addIfSupported(long stat) { return (stat == UNSUPPORTED) ? 0 : stat; } be: total += addIfSupported(getRxBytes(iface)); on</technical_language>

Target:
public static long getMobileRxBytes() { long total = 0; for (String iface : getMobileIfaces()) { total += addIfSupported(getRxBytes(iface)); } return total; }
Source:
<code>public void handleGetConfigurationObjectResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final GetConfigurationObjectResponseDto resultData) { <START> LOGGER.info("handle SetConfigurationObject response for MessageType: {}", <END> deviceMessageMetadata.getMessageType()); final GetConfigurationObjectResponse response = this.configurationMapper.map(resultData, GetConfigurationObjectResponse.class); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), result, exception, response, deviceMessageMetadata.getMessagePriority()), deviceMessageMetadata.getMessageType()); }</code><technical_language>This is "GetConfigurationObject", "SetConfigurationObject" in log message</technical_language>

Target:
public void handleGetConfigurationObjectResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final GetConfigurationObjectResponseDto resultData) { LOGGER.info("handle GetConfigurationObject response for MessageType: {}", deviceMessageMetadata.getMessageType()); final GetConfigurationObjectResponse response = this.configurationMapper.map(resultData, GetConfigurationObjectResponse.class); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(deviceMessageMetadata.getCorrelationUid(), deviceMessageMetadata.getOrganisationIdentification(), deviceMessageMetadata.getDeviceIdentification(), result, exception, response, deviceMessageMetadata.getMessagePriority()), deviceMessageMetadata.getMessageType()); }
Source:
<code>public Route(String id, String path, String location, String prefix, <START> Boolean retryable, Set<String> ignoredHeaders, boolean prefixStripped) { <END> this.id = id; this.prefix = StringUtils.hasText(prefix) ? prefix : ""; this.path = path; this.fullPath = prefix + path; this.location = location; this.retryable = retryable; this.sensitiveHeaders = new LinkedHashSet<>(); if (ignoredHeaders != null) { this.customSensitiveHeaders = true; for (String header : ignoredHeaders) { this.sensitiveHeaders.add(header.toLowerCase()); } } this.prefixStripped = prefixStripped; }</code><technical_language>constructor delegate new one</technical_language>

Target:
public Route(String id, String path, String location, String prefix, Boolean retryable, Set<String> ignoredHeaders, boolean prefixStripped) { this(id, path, location, prefix, retryable, ignoredHeaders); this.prefixStripped = prefixStripped; }
Source:
<code>private RassXmlDocumentWrapperFixture(String extractDateString, RassXmlAwardEntryFixture[] awardsArray, RassXmlAgencyEntryFixture[] agencyArray) { <START> extractDate = new DateTime(RassStringToJavaLongDateTimeAdapter.parseToDateTime(extractDateString).toDate()); <END> awards = XmlDocumentFixtureUtils.toImmutableList(awardsArray); agencies = XmlDocumentFixtureUtils.toImmutableList(agencyArray); }</code><technical_language>Another potential redundant re-wrap of a DateTime value</technical_language>

Target:
private RassXmlDocumentWrapperFixture(String extractDateString, RassXmlAwardEntryFixture[] awardsArray, RassXmlAgencyEntryFixture[] agencyArray) { extractDate = RassStringToJavaLongDateTimeAdapter.parseToDateTime(extractDateString); awards = XmlDocumentFixtureUtils.toImmutableList(awardsArray); agencies = XmlDocumentFixtureUtils.toImmutableList(agencyArray); }
Source:
<code>default BitSet<T> takeUntil(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); final BitSet<T> result = takeWhile(predicate.negate()); <START> return (result.length() == length()) ? this : result; <END> }</code><technical_language>takeWhile care of this already</technical_language>

Target:
default BitSet<T> takeUntil(Predicate<? super T> predicate) { Objects.requireNonNull(predicate, "predicate is null"); return takeWhile(predicate.negate()); }
Source:
<code>public TimberClientHandler(TimberClient client, ClientBootstrap bootstrap) { <START> super(); <END> this.client = client; this.bootstrap = bootstrap; timer = new HashedWheelTimer(); }</code><technical_language>Redundant - super() is called anyway</technical_language>

Target:
public TimberClientHandler(TimberClient client, ClientBootstrap bootstrap) { this.client = client; this.bootstrap = bootstrap; timer = new HashedWheelTimer(); }
Source:
<code>public static void tearDown() throws IOException, TimeoutException, InterruptedException, OperationException, CommandFailedException { operations.removeIfExists(LOGGER_ADDRESS); <START> administration.reloadIfRequired(); <END> operations.removeIfExists(LOGGER_TO_BE_REMOVED_ADDRESS); administration.reloadIfRequired(); }</code><technical_language>consecutive reloads necessary reload end sufficient</technical_language>

Target:
public static void tearDown() throws IOException, TimeoutException, InterruptedException, OperationException, CommandFailedException { operations.removeIfExists(LOGGER_ADDRESS); operations.removeIfExists(LOGGER_TO_BE_REMOVED_ADDRESS); administration.reloadIfRequired(); }
Source:
<code>public void testExecuteQueryCommand() { Guid networkId = Guid.NewGuid(); when(params.getNetworkId()).thenReturn(networkId); VDSGroup cluster = new VDSGroup(); List<VDSGroup> expected = Collections.singletonList(cluster); <START> VdsGroupDAO VdsGroupDAOMock = mock(VdsGroupDAO.class); <END> when(VdsGroupDAOMock.getAllForNetwork(networkId)).thenReturn(expected); when(getDbFacadeMockInstance().getVdsGroupDao()).thenReturn(VdsGroupDAOMock); GetVdsGroupsByNetworkIdQuery<GetVdsGroupsByNetworkIdParameters> query = getQuery(); query.executeQueryCommand(); assertEquals("Wrong result returned", expected, getQuery().getQueryReturnValue().getReturnValue()); }</code><technical_language>named vdsGroupDAOMock (I Dao wince more readable, you)</technical_language>

Target:
public void testExecuteQueryCommand() { Guid networkId = Guid.NewGuid(); when(params.getNetworkId()).thenReturn(networkId); VDSGroup cluster = new VDSGroup(); List<VDSGroup> expected = Collections.singletonList(cluster); VdsGroupDAO vdsGroupDaoMock = mock(VdsGroupDAO.class); when(vdsGroupDaoMock.getAllForNetwork(networkId)).thenReturn(expected); when(getDbFacadeMockInstance().getVdsGroupDao()).thenReturn(vdsGroupDaoMock); GetVdsGroupsByNetworkIdQuery<GetVdsGroupsByNetworkIdParameters> query = getQuery(); query.executeQueryCommand(); assertEquals("Wrong result returned", expected, getQuery().getQueryReturnValue().getReturnValue()); }
Source:
<code>public void testRemoveWithSpuriousNotify() throws Exception { final ReferenceQueue<Object> referenceQueue = new ReferenceQueue<Object>(); runLater(new Runnable() { @Override public void run() { synchronized (referenceQueue) { referenceQueue.notifyAll(); } } }, 500); long startNanos = System.nanoTime(); referenceQueue.remove(1000); long durationNanos = System.nanoTime() - startNanos; long durationMillis = TimeUnit.NANOSECONDS.toMillis(durationNanos); <START> checkDuration(1000, durationMillis); <END> }</code><technical_language>Do rationale for assuming time 1s? duration check fundamentally broken unscalable</technical_language>

Target:
public void testRemoveWithSpuriousNotify() throws Exception { final ReferenceQueue<Object> referenceQueue = new ReferenceQueue<Object>(); runLater(new Runnable() { @Override public void run() { synchronized (referenceQueue) { referenceQueue.notifyAll(); } } }, 500); final long startNanos = System.nanoTime(); final long timeoutMsec = 1000L; referenceQueue.remove(timeoutMsec); final long durationNanos = System.nanoTime() - startNanos; final long durationMillis = TimeUnit.NANOSECONDS.toMillis(durationNanos); checkDuration(timeoutMsec, durationMillis); }
Source:
<code>public EditMaskVariables createEditMaskVariables() { <START> EditMaskVariablesImpl editMaskVariables = new EditMaskVariablesImpl(); <END> return editMaskVariables; }</code><technical_language>Lost @not-generated. "{0}" default in viewpoint.ecore</technical_language>

Target:
public EditMaskVariables createEditMaskVariables() { EditMaskVariablesImpl editMaskVariables = new EditMaskVariablesImpl(); editMaskVariables.setMask("{0}"); return editMaskVariables; }
Source:
<code>public static int compareVersion(String version, String value) { <START> String alphaVersion = ""; <END> String alphaValue = ""; try { if (version == null || value == null) return 0; List<String> versions = new Vector<String>(); List<String> values = new Vector<String>(); if (checkForAlphaVersion(version)) { alphaVersion = version.substring(version.indexOf('-')); version = version.replace(alphaVersion, ".0"); } if (checkForAlphaVersion(value)) { alphaValue = value.substring(value.indexOf('-')); value = value.replace(alphaValue, ".0"); } Collections.addAll(versions, version.split("\\.")); Collections.addAll(values, value.split("\\.")); while (versions.size() < values.size()) { versions.add("0"); } while (values.size() < versions.size()) { values.add("0"); } for (int x = 0; x < versions.size(); x++) { String verNum = versions.get(x).trim(); String valNum = values.get(x).trim(); Integer ver = NumberUtils.toInt(verNum, 0); Integer val = NumberUtils.toInt(valNum, 0); int ret = ver.compareTo(val); if (ret != 0) return ret; } } catch (NumberFormatException e) { log.error("Error while converting a version/value to an integer: " + version + "/" + value, e); } return 0; }</code><technical_language>I call alpha, a qualifier maven version conventions. Please change places alpha qualifier</technical_language>

Target:
public static int compareVersion(String version, String value) { String qualifierVersion = ""; String qualifierValue = ""; try { if (version == null || value == null) return 0; List<String> versions = new Vector<String>(); List<String> values = new Vector<String>(); if (isVersionWithQualifier(version)) { qualifierVersion = version.substring(version.indexOf('-')); version = version.replace(qualifierVersion, ".0"); } if (isVersionWithQualifier(value)) { qualifierValue = value.substring(value.indexOf('-')); value = value.replace(qualifierValue, ".0"); } Collections.addAll(versions, version.split("\\.")); Collections.addAll(values, value.split("\\.")); while (versions.size() < values.size()) { versions.add("0"); } while (values.size() < versions.size()) { values.add("0"); } for (int x = 0; x < versions.size(); x++) { String verNum = versions.get(x).trim(); String valNum = values.get(x).trim(); Integer ver = NumberUtils.toInt(verNum, 0); Integer val = NumberUtils.toInt(valNum, 0); int ret = ver.compareTo(val); if (ret != 0) return ret; } } catch (NumberFormatException e) { log.error("Error while converting a version/value to an integer: " + version + "/" + value, e); } return 0; }
Source:
<code>private boolean leaderChanged( Outcome outcome, MemberId oldLeader ) { Optional<MemberId> oldLeaderOpt = Optional.ofNullable( oldLeader ); Optional<MemberId> outcomeLeaderOpt = Optional.ofNullable( outcome.getLeader() ); <START> return !oldLeaderOpt.equals( outcomeLeaderOpt ); <END> }</code><technical_language>!Objects.equals( oldLeader, outcome.getLeader() )</technical_language>

Target:
private boolean leaderChanged( Outcome outcome, MemberId oldLeader ) { return !Objects.equals( oldLeader, outcome.getLeader() ); }
Source:
<code>public InjectorRunner(final BundleContext bundleContext, final String injectorName, final String bundleNameFilter, final String basePackage) { this.bundleContext = bundleContext; this.injectorName = injectorName; this.bundleNameFilter = bundleNameFilter; this.basePackage = basePackage; <START> this.injectorPath = injectorName; <END> }</code><technical_language>purpose of this assignment</technical_language>

Target:
public InjectorRunner(final BundleContext bundleContext, final String injectorName, final String bundleNameFilter, final String basePackage) { this.bundleContext = bundleContext; this.injectorName = injectorName; this.bundleNameFilter = bundleNameFilter; this.basePackage = basePackage; }
Source:
<code>public void renameTable(String databaseName, String tableName, String newDatabaseName, String newTableName) { <START> throw new GlueUnsupportedException(HIVE_METASTORE_ERROR, "Table rename is not yet supported by Glue service"); <END> }</code><technical_language>This a PrestoException(NOT_SUPPORTED) error, operation user requested is supported. HIVE_METASTORE_ERROR is is a (normally transient) metastore error</technical_language>

Target:
public void renameTable(String databaseName, String tableName, String newDatabaseName, String newTableName) { throw new PrestoException(NOT_SUPPORTED, "Table rename is not yet supported by Glue service"); }
Source:
<code>public static void closeAndCheckForSuspects() { if (!isLaunched()) { return; } List<File> suspectFiles = getDunitSuspectFiles(); if (suspectFiles.isEmpty()) { throw new IllegalStateException("No dunit suspect log files found in '" + getDunitSuspectsDir().getAbsolutePath() + "' - perhaps a rule that is cleaning up before suspect processing has already run."); } <START> boolean ok = true; <END> for (File suspect : suspectFiles) { ok &= checkSuspectFile(suspect); } if (!ok) { Assert.fail("Suspicious messages or exceptions were generated during this run.\n" + "Fix the problems or use IgnoredException.addIgnoredException to ignore."); } }</code><technical_language>alternative is create a StringBuilder pass checkSuspectFile() collect suspects. strings included in assertion failure message</technical_language>

Target:
public static void closeAndCheckForSuspects() { if (!isLaunched()) { return; } List<File> suspectFiles = getDunitSuspectFiles(); if (suspectFiles.isEmpty()) { throw new IllegalStateException("No dunit suspect log files found in '" + getDunitSuspectsDir().getAbsolutePath() + "' - perhaps a rule that is cleaning up before suspect processing has already run."); } StringBuilder suspectStringCollector = new StringBuilder(); for (File suspect : suspectFiles) { checkSuspectFile(suspect, suspectStringCollector); } if (suspectStringCollector.length() != 0) { System.err.println("Suspicious strings were written to the log during this run.\n" + "Fix the strings or use IgnoredException.addIgnoredException to ignore.\n" + suspectStringCollector); Assert.fail("Suspicious strings were written to the log during this run.\n" + "Fix the strings or use IgnoredException.addIgnoredException to ignore.\n" + suspectStringCollector); } }
Source:
<code>public void writeToChannel(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { <START> <END> if (!requireMultipleFiles) { try (ReadableByteChannel from = Channels.newChannel(combineStreams().getInput())) { ByteStreams.copy(from, channel); return; } } if (smoosher == null) { throw new IAE("version 2 GenericIndexedWriter requires FileSmoosher."); } File f = ioPeon.getFile(makeFilename("headerLong")); Preconditions.checkNotNull(f, "header file missing."); int bagSizePower = bagSizePower(); OutputStream metaOut = Channels.newOutputStream(channel); metaOut.write(0x2); metaOut.write(objectsSorted ? 0x1 : 0x0); metaOut.write(Ints.toByteArray(bagSizePower)); metaOut.write(Ints.toByteArray(Ints.saturatedCast(numWritten))); metaOut.write(Ints.toByteArray(fileNameByteArray.length)); metaOut.write(fileNameByteArray); try (RandomAccessFile headerFile = new RandomAccessFile(f, "r")) { long previousValuePosition = 0; int bagSize = 1 << bagSizePower; int filesRequired = (int) Math.ceil((float) numWritten / bagSize); try (InputStream is = new FileInputStream(ioPeon.getFile(makeFilename("values")))) { int counter = -1; byte[] buffer = new byte[1 << 16]; for (int i = 0; i < filesRequired; i++) { if (i != filesRequired - 1) { headerFile.seek((bagSize + counter) * Longs.BYTES); counter = counter + bagSize; } else { headerFile.seek((numWritten - 1) * Longs.BYTES); } long valuePosition = headerFile.readLong(); long numBytesToPutInFile = valuePosition - previousValuePosition; try (SmooshedWriter smooshChannel = smoosher .addWithSmooshedWriter(generateValueFileName(filenameBase, i), numBytesToPutInFile)) { writeBytesIntoSmooshedChannel(numBytesToPutInFile, buffer, smooshChannel, is); previousValuePosition = valuePosition; } } } writeHeader(smoosher, headerFile, bagSizePower); } }</code><technical_language>Consider extracting methods: writeToChannelVersionOne version</technical_language>

Target:
public void writeToChannel(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { if (!requireMultipleFiles) { writeToChannelVersionOne(channel); } else { writeToChannelVersionTwo(channel, smoosher); } }
Source:
<code>public CodecRegistry(ClassLoader cl) { codecs = new HashMap<String, Codec>(); <START> Iterator<Codec> it = ServiceFinder.load(Codec.class).iterator(); <END> for(;;) { try { Codec codec = it.next(); String name = codec.getName(); if (codecs.containsKey(name)) { log.duplicateCodec(codec.getClass().getName(), codecs.get(name).getClass().getName()); } else { codecs.put(name, codec); } } catch (ServiceConfigurationError e) { log.loadingCodecFailed(e); } catch (NoSuchElementException e) { break; } } }</code><technical_language>specific classloader cl is longer in new call</technical_language>

Target:
public CodecRegistry(ClassLoader cl) { codecs = new HashMap<String, Codec>(); Iterator<Codec> it = ServiceFinder.load(Codec.class, cl).iterator(); for(;;) { try { Codec codec = it.next(); String name = codec.getName(); if (codecs.containsKey(name)) { log.duplicateCodec(codec.getClass().getName(), codecs.get(name).getClass().getName()); } else { codecs.put(name, codec); } } catch (ServiceConfigurationError e) { log.loadingCodecFailed(e); } catch (NoSuchElementException e) { break; } } }
Source:
<code>public void rollback_DELETED_FILES() throws IOException { ContentFileTransactionContext context = new ContentFileTransactionContext(contentDir, deletedTmpDir); File file1 = new File(deletedTmpDir, "file1.txt"); File file2 = new File(deletedTmpDir, "file2.txt"); file1.createNewFile(); file2.createNewFile(); contentFileCommitRollbackService.rollback(context); assertTrue(new File(contentDir, "file1.txt").exists()); <START> assertTrue(new File(contentDir, "file2.txt").exists()); <END> assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(deletedTmpDir.exists()); }</code><technical_language>I check if content of files in delete directory in content directory equal</technical_language>

Target:
public void rollback_DELETED_FILES() throws IOException { ContentFileTransactionContext context = new ContentFileTransactionContext(contentDir, deletedTmpDir); File file1 = createFile(deletedTmpDir, "file1.txt", "content1"); File file2 = createFile(deletedTmpDir, "file2.txt", "content2"); contentFileCommitRollbackService.rollback(context); assertFile(new File(contentDir, "file1.txt"), "content1"); assertFile(new File(contentDir, "file2.txt"), "content2"); assertFalse(file1.exists()); assertFalse(file2.exists()); assertFalse(deletedTmpDir.exists()); }
Source:
<code>protected void paint(Graphics g) { g.setColor(0x00FFFFFF); <START> g.fillRect(0, 0, getWidth() - 1, getHeight() - 1); <END> g.setColor(0x00FF0000); g.setStrokeStyle(Graphics.SOLID); g.drawString("Red top left", 0, 0, Graphics.TOP | Graphics.LEFT); System.out.println("PAINTED"); }</code><technical_language>Is a reason rect a single pixel shorter narrower graphics object? a black border right bottom sides of display, affect test fidelity unrelated functionality tested</technical_language>

Target:
protected void paint(Graphics g) { g.setColor(0x00FFFFFF); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0x00FF0000); g.setStrokeStyle(Graphics.SOLID); g.drawString("Red top left", 0, 0, Graphics.TOP | Graphics.LEFT); System.out.println("PAINTED"); }
Source:
<code>public PagedFlux<PathItem> listPaths() { try { return this.listPaths(false, false, null); <START> } catch (RuntimeException ex) { <END> return pagedFluxError(logger, ex); } }</code><technical_language>move this try/catch deeper call stack, public overload in package-private method need put in multiple locations</technical_language>

Target:
public PagedFlux<PathItem> listPaths() { return this.listPaths(false, false, null); }
Source:
<code>public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { if (LOGGER.isLoggable(java.util.logging.Level.FINE)) { LOGGER.fine("Incoming message event of type " + event.getClass().getSimpleName() + " from Catalog"); } if (!isEnabled()) { if (LOGGER.isLoggable(java.util.logging.Level.FINE)) { LOGGER.fine("skipping incoming event: context is not initted"); } return; } Properties options = getProperties(); try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); final CatalogInfo info = event.getSource(); if (info instanceof StyleInfo) { final String canonicalStyleFileName = File.separator + "styles" + File.separator + ((StyleInfo) info).getFilename(); Resource styleFile = loader.get(canonicalStyleFileName); <START> if ( !Resources.exists(styleFile) ) { <END> final String workspace = ((StyleInfo) info).getWorkspace().getName(); final String styleFileName = File.separator + "workspaces" + File.separator + workspace + File.separator + "styles" + File.separator + ((StyleInfo) info).getFilename(); styleFile = loader.get(styleFileName); } jmsPublisher.publish(getTopic(), getJmsTemplate(), options, new DocumentFile( styleFile)); } jmsPublisher.publish(getTopic(), getJmsTemplate(), options, event); } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) { LOGGER.severe(e.getLocalizedMessage()); } final CatalogException ex = new CatalogException(e); throw ex; } }</code><technical_language>tabs hiding in this method. Please fix formatting</technical_language>

Target:
public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { if (LOGGER.isLoggable(java.util.logging.Level.FINE)) { LOGGER.fine("Incoming message event of type " + event.getClass().getSimpleName() + " from Catalog"); } if (!isEnabled()) { if (LOGGER.isLoggable(java.util.logging.Level.FINE)) { LOGGER.fine("skipping incoming event: context is not initted"); } return; } Properties options = getProperties(); try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); final CatalogInfo info = event.getSource(); if (info instanceof StyleInfo) { Resource styleFile = loader.get("styles").get(((StyleInfo) info).getFilename()); if (!Resources.exists(styleFile)) { final String workspace = ((StyleInfo) info).getWorkspace().getName(); styleFile = loader.get(Paths.path("workspaces", workspace, "styles", ((StyleInfo) info).getFilename())); } jmsPublisher.publish(getTopic(), getJmsTemplate(), options, new DocumentFile(styleFile)); } jmsPublisher.publish(getTopic(), getJmsTemplate(), options, event); } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) { LOGGER.severe(e.getLocalizedMessage()); } final CatalogException ex = new CatalogException(e); throw ex; } }
Source:
<code><START> public long getTimelineWaitTimeoutMs() { <END> return 1000; }</code><technical_language>This replaced <LINK_0></technical_language>

Target:
public long getTimelineWaitTimeoutMs() { return timelineWaitTimeoutMs; }
Source:
<code>public GlusterTasksListReturnForXmlRpc(Map<String, Object> innerMap) { super(innerMap); if (mStatus.mCode != 0) { return; } Map<String, Object> tasksMap = (Map<String, Object>) innerMap.get(TASKS_LIST); if (tasksMap != null) { <START> Iterator<Entry<String, Object>> iter=tasksMap.entrySet().iterator(); <END> while (iter.hasNext()) { Entry<String, Object> entry=iter.next(); tasks.add(getTask(entry.getKey(),(Map<String, Object>)entry.getValue())); } } }</code><technical_language>critical , for (Entry<String,object> entry: tasksMa.entrySet() ) instead of iterator</technical_language>

Target:
public GlusterTasksListReturnForXmlRpc(Map<String, Object> innerMap) { super(innerMap); if (mStatus.mCode != 0) { return; } Map<String, Object> tasksMap = (Map<String, Object>) innerMap.get(TASKS_LIST); if (tasksMap != null) { for (Entry<String, Object> entry: tasksMap.entrySet()) { tasks.add(getTask(entry.getKey(),(Map<String, Object>)entry.getValue())); } } }
Source:
<code>protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.CommitRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_COMMIT_FAILED, returnValue.getVdsError() .getMessage()); return; } endStepJobCommitted(); releaseVolumeLock(); getDbUtils().removeBricksFromVolumeInDb(volume, getParameters().getBricks(), <START> getParameters().getReplicaCount()); <END> getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }</code><technical_language>release lock bricks removed</technical_language>

Target:
protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.CommitRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_COMMIT_FAILED, returnValue.getVdsError() .getMessage()); return; } endStepJobCommitted(); getDbUtils().removeBricksFromVolumeInDb(volume, getParameters().getBricks(), getParameters().getReplicaCount()); releaseVolumeLock(); getGlusterVolumeDao().updateVolumeTask(volume.getId(), null); getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }
Source:
<code>public void run() { super.run(); EObject target; DTable columnContainer; if <START> (getColumn() <END> != null) { target = getColumn().getTarget(); columnContainer = (DTable) getColumn().eContainer(); } else { target = table.getTarget(); columnContainer = table; } CompoundCommand compoundCommand = new CompoundCommand(getText()); Command cmd = tableCommandFactory.buildCreateColumnCommandFromTool(columnContainer, target, getCreateTool()); compoundCommand.append(cmd); getEditingDomain().getCommandStack().execute(compoundCommand); }</code><technical_language>getColumn() is called times. a variable instead</technical_language>

Target:
public void run() { super.run(); EObject target; DTable columnContainer; DTargetColumn dTargetColumn = getColumn(); if (dTargetColumn != null) { target = dTargetColumn.getTarget(); columnContainer = (DTable) dTargetColumn.eContainer(); } else { target = table.getTarget(); columnContainer = table; } Command cmd = tableCommandFactory.buildCreateColumnCommandFromTool(columnContainer, target, getCreateTool()); String label = getText(); cmd = new CommandWrapper(label, label, cmd); getEditingDomain().getCommandStack().execute(cmd); }
Source:
<code>private Widget getRadioGroupPanel() { buttonToType = new LinkedHashMap<>(); <START> RadioButton allButton = new RadioButton("diskContentTypeView"); END> buttonToType.put(allButton, null); allButton.setText(constants.allDisksLabel()); for (DiskContentType contentType : DiskContentType.values()) { RadioButton button = new RadioButton("diskContentTypeView"); buttonToType.put(button, contentType); } FlowPanel buttonsPanel = new FlowPanel(); buttonsPanel.getElement().getStyle().setProperty("marginLeft", "auto"); buttonsPanel.getElement().getStyle().setProperty("marginRight", "auto"); for (RadioButton button : buttonToType.keySet()) { button.getElement().getStyle().setMarginRight(20, Style.Unit.PX); buttonsPanel.add(button); } setDiskContentType(null); localize(); return buttonsPanel; }</code><technical_language>Please bootstrap radio buttons instead of GWT radio buttons. For examples here: <LINK_0> <LINK_1> (which is a patch converted radio buttons, introducing new GWT radio buttons counter productive)</technical_language>

Target:
private Widget getRadioGroupPanel() { buttonToType = new LinkedHashMap<>(); RadioButton allButton = new RadioButton(BUTTON_GROUP_NAME); buttonToType.put(allButton, null); allButton.setText(constants.allDisksLabel()); for (DiskContentType contentType : DiskContentType.values()) { RadioButton button = new RadioButton(BUTTON_GROUP_NAME); buttonToType.put(button, contentType); } ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.setDataToggle(Toggle.BUTTONS); buttonToType.entrySet().forEach(e -> { buttonGroup.add(e.getKey()); e.getKey().addClickHandler(event -> fireChangeHandlers(e.getValue())); }); setDiskContentType(null); localize(); buttonGroup.addStyleName("disk-type-buttons-group"); return buttonGroup; }
Source:
<code>public boolean onDeleteAccount(PaymentAccount paymentAccount) { try { <START> paymentAccountManager.removePaymentAccount(paymentAccount.getId()); <END> return false; } catch(PaymentAccountInUseException e) { return true; } }</code><technical_language>pass paymentAccount avoid extra lookup null check in paymentAccountManager.removePaymentAccount</technical_language>

Target:
public boolean onDeleteAccount(PaymentAccount paymentAccount) { return paymentAccountManager.removePaymentAccount(paymentAccount); }
Source:
<code>public void shutdownFramework() { Status driverStatus = driverManager.getDriverStatus(); if (Status.DRIVER_RUNNING != driverStatus) { LOGGER.warn("Driver is not running. Status: " + driverStatus); } else { driverStatus = driverManager.stopDriver(false); LOGGER.info("Myriad driver was shutdown with status " + driverStatus); } <START> <END> try { myriadWebServer.stop(); LOGGER.info("Myriad webserver was shutdown successfully"); } catch (Exception e) { LOGGER.info("Failed to shutdown Myriad webserver: " + e.getMessage()); } try { myriadStateStore.removeMyriadState(); LOGGER.info("Myriad State store was removed successfully."); } catch (Exception e) { LOGGER.info("Failed to remove Myriad state store: " + e.getMessage()); } }</code><technical_language>Please include a log statement reads "Received request shutdown Myriad Framework.."</technical_language>

Target:
public void shutdownFramework() { LOGGER.info("Received request to shutdown Myriad Framework.."); Status driverStatus = driverManager.getDriverStatus(); if (Status.DRIVER_RUNNING != driverStatus) { LOGGER.warn("Driver is not running. Status: " + driverStatus); } else { driverStatus = driverManager.stopDriver(false); LOGGER.info("Myriad driver was shutdown with status " + driverStatus); } try { myriadWebServer.stop(); LOGGER.info("Myriad webserver was shutdown successfully"); } catch (Exception e) { LOGGER.info("Failed to shutdown Myriad webserver: " + e.getMessage()); } try { myriadStateStore.removeMyriadState(); LOGGER.info("Myriad State store was removed successfully."); } catch (Exception e) { LOGGER.info("Failed to remove Myriad state store: " + e.getMessage()); } }
Source:
<code>public static PublicKey loadPublicKey(String publicKey) throws GeneralSecurityException { Matcher matcher = PUBLIC_KEY_PATTERN.matcher(publicKey); if (!matcher.find()) { <START> throw new KeyStoreException("found no public key"); <END> } String data = matcher.group(1); byte[] encodedKey = base64Decode(data); X509EncodedKeySpec encodedKeySpec = new X509EncodedKeySpec(encodedKey); try { KeyFactory keyFactory = KeyFactory.getInstance("RSA"); return keyFactory.generatePublic(encodedKeySpec); } catch (InvalidKeySpecException ignore) { } try { KeyFactory keyFactory = KeyFactory.getInstance("EC"); return keyFactory.generatePublic(encodedKeySpec); } catch (InvalidKeySpecException ignore) { } KeyFactory keyFactory = KeyFactory.getInstance("DSA"); return keyFactory.generatePublic(encodedKeySpec); }</code><technical_language>"did find public key"</technical_language>

Target:
public static PublicKey loadPublicKey(String publicKey) throws GeneralSecurityException { Matcher matcher = PUBLIC_KEY_PATTERN.matcher(publicKey); if (!matcher.find()) { throw new KeyStoreException("did not find a public key"); } String data = matcher.group(1); byte[] encodedKey = base64Decode(data); X509EncodedKeySpec encodedKeySpec = new X509EncodedKeySpec(encodedKey); try { KeyFactory keyFactory = KeyFactory.getInstance("RSA"); return keyFactory.generatePublic(encodedKeySpec); } catch (InvalidKeySpecException ignore) { } try { KeyFactory keyFactory = KeyFactory.getInstance("EC"); return keyFactory.generatePublic(encodedKeySpec); } catch (InvalidKeySpecException ignore) { } KeyFactory keyFactory = KeyFactory.getInstance("DSA"); return keyFactory.generatePublic(encodedKeySpec); }
Source:
<code>public void workingDirectoryDelete() throws Exception { deleteTrashFile(PATH); assertFalse(committedFile.exists()); RevCommit stashed = git.stashCreate().call(); assertNotNull(stashed); assertEquals("content", read(committedFile)); recorder.assertEvent(new String[] { PATH }, <START> new String[0]); <END> ObjectId unstashed = git.stashApply().call(); assertEquals(stashed, unstashed); assertFalse(committedFile.exists()); recorder.assertEvent(new String[0], new String[] { PATH }); Status status = git.status().call(); assertTrue(status.getAdded().isEmpty()); assertTrue(status.getChanged().isEmpty()); assertTrue(status.getConflicting().isEmpty()); assertTrue(status.getModified().isEmpty()); assertTrue(status.getUntracked().isEmpty()); assertTrue(status.getRemoved().isEmpty()); assertEquals(1, status.getMissing().size()); assertTrue(status.getMissing().contains(PATH)); }</code><technical_language>this a constant EMPTY</technical_language>

Target:
public void workingDirectoryDelete() throws Exception { deleteTrashFile(PATH); assertFalse(committedFile.exists()); RevCommit stashed = git.stashCreate().call(); assertNotNull(stashed); assertEquals("content", read(committedFile)); recorder.assertEvent(new String[] { PATH }, ChangeRecorder.EMPTY); ObjectId unstashed = git.stashApply().call(); assertEquals(stashed, unstashed); assertFalse(committedFile.exists()); recorder.assertEvent(ChangeRecorder.EMPTY, new String[] { PATH }); Status status = git.status().call(); assertTrue(status.getAdded().isEmpty()); assertTrue(status.getChanged().isEmpty()); assertTrue(status.getConflicting().isEmpty()); assertTrue(status.getModified().isEmpty()); assertTrue(status.getUntracked().isEmpty()); assertTrue(status.getRemoved().isEmpty()); assertEquals(1, status.getMissing().size()); assertTrue(status.getMissing().contains(PATH)); }
Source:
<code>public GenericUrl(String encodedUrl, boolean verbatim) { <START> this(parseURL(encodedUrl), true); <END> }</code><technical_language>this(parseURL(encodedUrl), verbatim);</technical_language>

Target:
public GenericUrl(String encodedUrl, boolean verbatim) { this(parseURL(encodedUrl), verbatim); }
Source:
<code>private void processInheritedPermissions(DocId docId, ActiveMarkingList activeMarkings, Permissions.Acl permissions, Response response) { String fragment = null; <START> Iterator<?> iterator = (activeMarkings == null) <END> ? Collections.emptyIterator() : activeMarkings.iterator(); while (iterator.hasNext()) { ActiveMarking activeMarking = (ActiveMarking) iterator.next(); Marking marking = activeMarking.get_Marking(); Permissions.Acl markingPerms = new Permissions(marking.get_Permissions()).getAcl(); Acl markingAcl = createAcl(docId, fragment, Acl.InheritanceType.AND_BOTH_PERMIT, markingPerms.getAllowUsers(), markingPerms.getDenyUsers(), markingPerms.getAllowGroups(), markingPerms.getDenyGroups()); fragment = SEC_MARKING_POSTFIX + percentEscape(marking.get_Id().toString()); logger.log(Level.FINEST, "Create ACL for active marking {0} {1}#{2}: {3}", new Object[] {activeMarking.get_PropertyDisplayName(), docId, fragment, markingAcl}); response.putNamedResource(fragment, markingAcl); } Acl folderAcl = createAcl(docId, permissions, PermissionSource.SOURCE_PARENT, fragment); fragment = SEC_FOLDER_POSTFIX; logger.log(Level.FINEST, "Create ACL for folder {0}#{1}: {2}", new Object[] {docId, fragment, folderAcl}); response.putNamedResource(fragment, folderAcl); Acl secAcl = createAcl(docId, permissions, PermissionSource.SOURCE_TEMPLATE, fragment); fragment = SEC_POLICY_POSTFIX; logger.log(Level.FINEST, "Create ACL for security template {0}#{1}: {2}", new Object[] {docId, fragment, secAcl}); response.putNamedResource(fragment, secAcl); }</code><technical_language>This change avoid null check resolve conflicts</technical_language>

Target:
private void processInheritedPermissions(DocId docId, ActiveMarkingList activeMarkings, Permissions.Acl permissions, Response response) { String fragment = null; Iterator<?> iterator = activeMarkings.iterator(); while (iterator.hasNext()) { ActiveMarking activeMarking = (ActiveMarking) iterator.next(); Marking marking = activeMarking.get_Marking(); Permissions.Acl markingPerms = new Permissions(marking.get_Permissions()).getAcl(); Acl markingAcl = createAcl(docId, fragment, Acl.InheritanceType.AND_BOTH_PERMIT, markingPerms.getAllowUsers(), markingPerms.getDenyUsers(), markingPerms.getAllowGroups(), markingPerms.getDenyGroups()); fragment = SEC_MARKING_POSTFIX + percentEscape(marking.get_Id().toString()); logger.log(Level.FINEST, "Create ACL for active marking {0} {1}#{2}: {3}", new Object[] {activeMarking.get_PropertyDisplayName(), docId, fragment, markingAcl}); response.putNamedResource(fragment, markingAcl); } Acl folderAcl = createAcl(docId, permissions, PermissionSource.SOURCE_PARENT, fragment); fragment = SEC_FOLDER_POSTFIX; logger.log(Level.FINEST, "Create ACL for folder {0}#{1}: {2}", new Object[] {docId, fragment, folderAcl}); response.putNamedResource(fragment, folderAcl); Acl secAcl = createAcl(docId, permissions, PermissionSource.SOURCE_TEMPLATE, fragment); fragment = SEC_POLICY_POSTFIX; logger.log(Level.FINEST, "Create ACL for security template {0}#{1}: {2}", new Object[] {docId, fragment, secAcl}); response.putNamedResource(fragment, secAcl); }
Source:
<code>public PipelineConfig pipelineConfigNamed(final String name) { <START> return getCurrentConfig().pipelineConfigByName(new CaseInsensitiveString(name)); <END> }</code><technical_language>call method pipelineConfigNamed(new CaseInsensitiveString(name))</technical_language>

Target:
public PipelineConfig pipelineConfigNamed(final String name) { return pipelineConfigNamed(new CaseInsensitiveString(name)); }
Source:
<code>public org.neo4j.internal.kernel.api.Session beginSession( SecurityContext securityContext ) { return new KernelSession( engine, kernel, securityContext ); <START> } <END></code><technical_language>Java supports covariant return types, this method return KernelSession breaking type safety of interface. easier eye</technical_language>

Target:
public KernelSession beginSession( SecurityContext securityContext ) { return new KernelSession( engine, kernel, securityContext ); }
Source:
<code>public boolean isPositive() { <START> return compareTo(ZERO) > 0; <END> }</code><technical_language>Please sigNum() for positive/negative/zero tests</technical_language>

Target:
public boolean isPositive() { return signum() == 1; }
Source:
<code>private void setLoginTimeout(final DataSource dataSource, final long connectionTimeout) { if (connectionTimeout != Integer.MAX_VALUE) { try { dataSource.setLoginTimeout((int) TimeUnit.MILLISECONDS.toSeconds(Math.max(1000L, connectionTimeout))); } catch (SQLException e) { LOGGER.warn("{} - Unable to set DataSource login timeout", poolName, e); } <START> catch (UnsupportedOperationException e) { <END> LOGGER.warn("{} - Unable to set DataSource login timeout", poolName, e); } } }</code><technical_language>this is a pull request _dev_, _dev_ is Java 7/8 only, please combine this catch a multi-catch statement</technical_language>

Target:
private void setLoginTimeout(final DataSource dataSource, final long connectionTimeout) { if (connectionTimeout != Integer.MAX_VALUE) { try { dataSource.setLoginTimeout((int) TimeUnit.MILLISECONDS.toSeconds(Math.max(1000L, connectionTimeout))); } catch (SQLException | UnsupportedOperationException e) { LOGGER.warn("{} - Unable to set DataSource login timeout", poolName, e); } } }
Source:
<code>private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(JobConfig.JOB_NAME(), JOB_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATION_UTILS_FACTORY, PassthroughCoordinationUtilsFactory.class.getName()); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); <START> configs.put(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); <END> addConfig(ClusterManagerConfig.CLUSTER_MANAGER_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); putIfAbsentConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).toConfig()); }</code><technical_language>this need addConfig well? Users setting a default system descriptor in application themselves</technical_language>

Target:
private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(JobConfig.JOB_NAME(), JOB_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATION_UTILS_FACTORY, PassthroughCoordinationUtilsFactory.class.getName()); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); addConfig(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); addConfig(ClusterManagerConfig.CLUSTER_MANAGER_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); addConfig(InMemorySystemConfig.INMEMORY_SCOPE, inMemoryScope); addConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).withInMemoryScope(inMemoryScope).toConfig()); }
Source:
<code>public void request(final long requested) { if (requested < 0) { throw new IllegalArgumentException("Requested items can not be negative."); } if (requested == 0) { return; } boolean requestToAlternate = false; synchronized (this) { if (null == altProducer) { long r = this.missedRequested; long u = r + requested; if (u < 0) { u = Long.MAX_VALUE; } this.missedRequested = u; } else { requestToAlternate = true; } } if (requestToAlternate) { <START> altProducer.request(requested); <END> } }</code><technical_language>access altProducer of guard</technical_language>

Target:
public void request(final long requested) { if (requested < 0) { throw new IllegalArgumentException("Requested items can not be negative."); } if (requested == 0) { return; } boolean requestToAlternate = false; Producer _altProducer; synchronized (this) { if (null == altProducer) { long r = this.missedRequested; long u = r + requested; if (u < 0) { u = Long.MAX_VALUE; } this.missedRequested = u; } else { requestToAlternate = true; } _altProducer = altProducer; } if (requestToAlternate) { _altProducer.request(requested); } }
Source:
<code>public void visibleGroups(final AsyncCallback<List<AccountGroup>> callback) { run(callback, new Action<List<AccountGroup>>() { public List<AccountGroup> run(ReviewDb db) throws OrmException { final IdentifiedUser user = identifiedUser.get(); final List<AccountGroup> result; if (user.isAdministrator()) { result = db.accountGroups().all().toList(); } else { final HashSet<AccountGroup.Id> seen = new HashSet<AccountGroup.Id>(); result = new ArrayList<AccountGroup>(); for (final AccountGroup.Id myGroup : user.getEffectiveGroups()) { for (AccountGroup group : db.accountGroups().ownedByGroup(myGroup)) { final AccountGroup.Id id = group.getId(); if (!seen.add(id)) { continue; } try { GroupControl c = groupControlFactory.controlFor(id); if (c.isOwner()) { result.add(c.getAccountGroup()); } } catch (NoSuchGroupException e) { continue; } } } } <START> for(final AccountGroup group : db.accountGroups().all().toList()) { <END> if (group.isVisibleToAll() && !result.contains(group)) { result.add(group); } } Collections.sort(result, new Comparator<AccountGroup>() { public int compare(final AccountGroup a, final AccountGroup b) { return a.getName().compareTo(b.getName()); } }); return result; } }); }</code><technical_language>I prefer combine this loop. loop this for construct iterates groups, if (c.isOwner()) line add a || c.isVisible(). Move isVisibleToAll check GroupControl.isVisible method</technical_language>

Target:
public void visibleGroups(final AsyncCallback<List<AccountGroup>> callback) { run(callback, new Action<List<AccountGroup>>() { public List<AccountGroup> run(ReviewDb db) throws OrmException { final IdentifiedUser user = identifiedUser.get(); final List<AccountGroup> result; if (user.isAdministrator()) { result = db.accountGroups().all().toList(); } else { result = new ArrayList<AccountGroup>(); for(final AccountGroup group : db.accountGroups().all().toList()) { final GroupControl c = groupControlFactory.controlFor(group); if (c.isVisible()) { result.add(c.getAccountGroup()); } } } Collections.sort(result, new Comparator<AccountGroup>() { public int compare(final AccountGroup a, final AccountGroup b) { return a.getName().compareTo(b.getName()); } }); return result; } }); }
Source:
<code>@Override public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedException { switch (type) { case OP_GET_IGNITE_CONFIGURATION: { PlatformConfigurationUtils.writeIgniteConfiguration(writer, ignite().configuration(), CURRENT_VER); return; } case OP_GET_CACHE_NAMES: { Collection<String> names = ignite().cacheNames(); writer.writeInt(names.size()); for (String name : names) writer.writeString(name); return; } case OP_GET_BASELINE_TOPOLOGY: { Collection<BaselineNode> blt = ignite().cluster().currentBaselineTopology(); writer.writeInt(blt.size()); for (BaselineNode n : blt) { writer.writeObjectDetached(n.consistentId()); PlatformUtils.writeNodeAttributes(writer, n.attributes()); } return; } case OP_NODE_VERSION: { IgniteProductVersion productVersion = ignite().cluster().node().version(); <START> writer.writeByte(productVersion.major()); <END> writer.writeByte(productVersion.minor()); writer.writeByte(productVersion.maintenance()); writer.writeLong(productVersion.revisionTimestamp()); writer.writeByteArray(productVersion.revisionHash()); return; } } PlatformAbstractTarget.throwUnsupported(type); }</code><technical_language>Duplicates code above. Please extract PlatformUtils.writeProductVersion method</technical_language>

Target:
@Override public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedException { switch (type) { case OP_GET_IGNITE_CONFIGURATION: { PlatformConfigurationUtils.writeIgniteConfiguration(writer, ignite().configuration(), CURRENT_VER); return; } case OP_GET_CACHE_NAMES: { Collection<String> names = ignite().cacheNames(); writer.writeInt(names.size()); for (String name : names) writer.writeString(name); return; } case OP_GET_BASELINE_TOPOLOGY: { Collection<BaselineNode> blt = ignite().cluster().currentBaselineTopology(); writer.writeInt(blt.size()); for (BaselineNode n : blt) { writer.writeObjectDetached(n.consistentId()); PlatformUtils.writeNodeAttributes(writer, n.attributes()); } return; } case OP_NODE_VERSION: { IgniteProductVersion productVersion = ignite().cluster().node().version(); PlatformUtils.writeNodeVersion(writer, productVersion); return; } } PlatformAbstractTarget.throwUnsupported(type); }