auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void processRequest(HttpExchange httpExchange, HashMap<String, String> paramMap) { Debug.println("/test/vertex", paramMap.toString()); String jobId = paramMap.get(ServerUtils.JOB_ID_KEY); String superstepId = paramMap.get(ServerUtils.SUPERSTEP_ID_KEY); String vertexId = paramMap.get(ServerUtils.VERTEX_ID_KEY); try { if (jobId == null || superstepId == null || vertexId == null) { throw new IllegalArgumentException("Missing mandatory parameters"); } Long superstepNo = Long.parseLong(paramMap.get(ServerUtils.SUPERSTEP_ID_KEY)); if (superstepNo < -1) { this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; this.response = String.format("%s must be an integer >= -1.", ServerUtils.SUPERSTEP_ID_KEY); return; } GiraphVertexScenarioWrapper giraphScenarioWrapper = ServerUtils.readScenarioFromTrace(jobId, superstepNo, vertexId.trim(), DebugTrace.VERTEX_ALL); ComputationComputeTestGenerator testGenerator = new ComputationComputeTestGenerator(); this.statusCode = HttpURLConnection.HTTP_OK; this.response = testGenerator.generateTest(giraphScenarioWrapper, null ); this.responseContentType = MediaType.TEXT_PLAIN; <START> } catch (IllegalArgumentException e) { <END> this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; this.response = String.format("Invalid parameters. %s, %s and %s are mandatory parameter.", ServerUtils.JOB_ID_KEY, ServerUtils.SUPERSTEP_ID_KEY, ServerUtils.VERTEX_ID_KEY); } catch (ClassNotFoundException e) { this.statusCode = HttpURLConnection.HTTP_INTERNAL_ERROR; this.response = "Internal Server Error"; } catch (IOException|InstantiationException|IllegalAccessException e) { this.statusCode = HttpURLConnection.HTTP_BAD_REQUEST; this.response = "Could not read the debug trace for this vertex."; } }</code><technical_language>refactor a handleException(Exception e) method some optional parameters</technical_language>

Target:
public void processRequest(HttpExchange httpExchange, HashMap<String, String> paramMap) { Debug.println("/test/vertex", paramMap.toString()); String jobId = paramMap.get(ServerUtils.JOB_ID_KEY); String superstepId = paramMap.get(ServerUtils.SUPERSTEP_ID_KEY); String vertexId = paramMap.get(ServerUtils.VERTEX_ID_KEY); try { if (jobId == null || superstepId == null || vertexId == null) { throw new IllegalArgumentException("Missing mandatory parameters"); } Long superstepNo = Long.parseLong(paramMap.get(ServerUtils.SUPERSTEP_ID_KEY)); if (superstepNo < -1) { throw new NumberFormatException(); } GiraphVertexScenarioWrapper giraphScenarioWrapper = ServerUtils.readScenarioFromTrace(jobId, superstepNo, vertexId.trim(), DebugTrace.VERTEX_ALL); ComputationComputeTestGenerator testGenerator = new ComputationComputeTestGenerator(); this.statusCode = HttpURLConnection.HTTP_OK; this.response = testGenerator.generateTest(giraphScenarioWrapper, null ); this.responseContentType = MediaType.TEXT_PLAIN; } catch (Exception e) { this.handleException(e, String.format("Invalid parameters. %s, %s and %s are mandatory parameter.", ServerUtils.JOB_ID_KEY, ServerUtils.SUPERSTEP_ID_KEY, ServerUtils.VERTEX_ID_KEY)); } }
Source:
<code>public void unschedule(String scheduleName) { final ScheduleInfo scheduleInfo = getSchedule(scheduleName); if (scheduleInfo != null) { <START> Launcher launcher = this.taskPlatform.getLaunchers().get(0); <END> launcher.getScheduler().unschedule(scheduleInfo.getScheduleName()); this.auditRecordService.populateAndSaveAuditRecord( AuditOperationType.SCHEDULE, AuditActionType.DELETE, scheduleInfo.getScheduleName(), scheduleInfo.getTaskDefinitionName()); } }</code><technical_language>this getDefaultLauncher well, instead of taskPlatform.getLaunchers().get(0)</technical_language>

Target:
public void unschedule(String scheduleName) { final ScheduleInfo scheduleInfo = getSchedule(scheduleName); if (scheduleInfo != null) { Launcher launcher = getDefaultLauncher(); launcher.getScheduler().unschedule(scheduleInfo.getScheduleName()); this.auditRecordService.populateAndSaveAuditRecord( AuditOperationType.SCHEDULE, AuditActionType.DELETE, scheduleInfo.getScheduleName(), scheduleInfo.getTaskDefinitionName()); } }
Source:
<code>private CMSFeatureFlags() { this.isDatasetImportEnabled = Boolean.valueOf(getConfigValue(ENABLE_DATASET_IMPORT)); this.isCMDAuthEnabled = Boolean.valueOf(getConfigValue(ENABLE_CMD_AUTH)); <START> info().data(ENABLE_DATASET_IMPORT, isDatasetImportEnabled).log("CMS feature flags configurations"); <END> }</code><technical_language>is worth logging if new flag is off</technical_language>

Target:
private CMSFeatureFlags() { this.isDatasetImportEnabled = Boolean.valueOf(getConfigValue(ENABLE_DATASET_IMPORT)); this.isCMDAuthEnabled = Boolean.valueOf(getConfigValue(ENABLE_CMD_AUTH)); info().data(ENABLE_DATASET_IMPORT, isDatasetImportEnabled) .data(ENABLE_CMD_AUTH, isCMDAuthEnabled) .log("CMS feature flags configurations"); }
Source:
<code>public void fire(Project.NameKey project, String ref, ObjectId oldObjectId, ObjectId newObjectId) { <START> ObjectId old = oldObjectId != null ? oldObjectId : ObjectId.zeroId(); <END> Event event = new Event(project, ref, old.name(), newObjectId.name()); for (GitReferenceUpdatedListener l : listeners) { l.onGitReferenceUpdated(event); } }</code><technical_language>If a branch deleted newObjectId null in this case ObjectId.zeroId() new objectId</technical_language>

Target:
public void fire(Project.NameKey project, String ref, ObjectId oldObjectId, ObjectId newObjectId) { ObjectId o = oldObjectId != null ? oldObjectId : ObjectId.zeroId(); ObjectId n = newObjectId != null ? newObjectId : ObjectId.zeroId(); Event event = new Event(project, ref, o.name(), n.name()); for (GitReferenceUpdatedListener l : listeners) { l.onGitReferenceUpdated(event); } }
Source:
<code>public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) <START> throws TableNotExistException, TableNotPartitionedException, PartitionNotExistException, CatalogException { <END> checkNotNull(tablePath, "Table path cannot be null"); checkNotNull(partitionSpec, "CatalogPartitionSpec cannot be null"); Table hiveTable = getHiveTable(tablePath); ensurePartitionedTable(tablePath, hiveTable); try { List<String> partialVals = HiveReflectionUtils.getPvals(hiveShim, hiveTable.getPartitionKeys(), partitionSpec.getPartitionSpec()); if (partialVals.size() == 1 && StringUtils.isNullOrWhitespaceOnly(partialVals.get(0))) { throw new PartitionNotExistException(getName(), tablePath, partitionSpec); } else { return client.listPartitionNames(tablePath.getDatabaseName(), tablePath.getObjectName(), partialVals, (short) -1).stream().map(HiveCatalog::createPartitionSpec).collect(Collectors.toList()); } } catch (PartitionNotExistException e) { throw new PartitionNotExistException(getName(), tablePath, partitionSpec, e); } catch (TException e) { throw new CatalogException( String.format("Failed to list partitions of table %s", tablePath), e); } }</code><technical_language>In case of invalid partition spec, throw PartitionSpecInvalidException</technical_language>

Target:
public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) throws TableNotExistException, TableNotPartitionedException, PartitionSpecInvalidException, CatalogException { checkNotNull(tablePath, "Table path cannot be null"); checkNotNull(partitionSpec, "CatalogPartitionSpec cannot be null"); Table hiveTable = getHiveTable(tablePath); ensurePartitionedTable(tablePath, hiveTable); checkValidPartitionSpec(partitionSpec, getFieldNames(hiveTable.getPartitionKeys()), tablePath); try { List<String> partialVals = HiveReflectionUtils.getPvals(hiveShim, hiveTable.getPartitionKeys(), partitionSpec.getPartitionSpec()); return client.listPartitionNames(tablePath.getDatabaseName(), tablePath.getObjectName(), partialVals, (short) -1).stream().map(HiveCatalog::createPartitionSpec).collect(Collectors.toList()); } catch (TException e) { throw new CatalogException( String.format("Failed to list partitions of table %s", tablePath), e); } }
Source:
<code>private String getBrowserAcceptHeader(EpdqTemplateData templateData) { <START> return Optional.ofNullable(templateData.getAuthCardDetails().getAcceptHeader()).orElse(DEFAULT_BROWSER_ACCEPT_HEADER); <END> }</code><technical_language>DEFAULT_BROWSER_ACCEPT_HEADER if submitted is empty string</technical_language>

Target:
String getBrowserAcceptHeader(EpdqTemplateData templateData) { return super.getBrowserAcceptHeader(templateData); }
Source:
<code>public void itemizeTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(); TimeChartEvent event = null; boolean hasNext = true; while (hasNext) { synchronized (timeAnalysisEntry) { hasNext = iterator.hasNext(); while (true) { <START> event = (TimeChartEvent) iterator.next(); <END> if (event.getTime() + event.getDuration() > startTime && event.getTime() < stopTime && event.getDuration() > fMaxDuration && event.getNbEvents() > 1) { break; } } } if (hasNext) { if (event.getItemizedEntry() == null) { itemizeEvent(event); } else { itemizeTraceEntry(event.getItemizedEntry()); } } } }</code><technical_language>NoSuchElementException thrown</technical_language>

Target:
public void itemizeTraceEntry(TimeChartAnalysisEntry timeAnalysisEntry) { Iterator<ITimeEvent> iterator = timeAnalysisEntry.getTimeEventsIterator(); TimeChartEvent event = null; boolean hasNext = true; while (hasNext) { synchronized (timeAnalysisEntry) { while ((hasNext = iterator.hasNext()) == true) { event = (TimeChartEvent) iterator.next(); if (event.getTime() + event.getDuration() > startTime && event.getTime() < stopTime && event.getDuration() > fMaxDuration && event.getNbEvents() > 1) { break; } } } if (hasNext && event != null) { if (event.getItemizedEntry() == null) { itemizeEvent(event); } else { itemizeTraceEntry(event.getItemizedEntry()); } } } }
Source:
<code>public PageProperties getProperties() { if (hasProperties()) { <START> return properties; <END> } else { return null; } }</code><technical_language>Super minor conditional needed properties is null non-null</technical_language>

Target:
public PageProperties getProperties() { return properties; }
Source:
<code>@Override public Object execute(GridClientConfiguration clientCfg, Logger log) throws Exception { try (GridClient client = Command.startClient(clientCfg)) { VisorCacheGroupEncryptionTaskResult<Double> res = executeTaskByNameOnNode( client, VisorReencryptionRateTask.class.getName(), taskArg, BROADCAST_UUID, clientCfg ); boolean read = taskArg.rate() == null; Map<UUID, IgniteException> exceptions = res.exceptions(); for (Map.Entry<UUID, IgniteException> entry : exceptions.entrySet()) { log.info(INDENT + "Node " + entry.getKey() + ":"); <START> log.info(String.format("%sfailed to %s re-encryption rate: %s.", <END> DOUBLE_INDENT, (read ? "get" : "limit"), entry.getValue().getMessage())); } Map<UUID, Double> results = res.results(); for (Map.Entry<UUID, Double> entry : results.entrySet()) { log.info(INDENT + "Node " + entry.getKey() + ":"); double rateLimit = read ? entry.getValue() : taskArg.rate(); if (rateLimit == 0) log.info(DOUBLE_INDENT + "re-encryption rate is not limited."); else { log.info(String.format("%sre-encryption rate %s limited to %.2f MB/s.", DOUBLE_INDENT, (read ? "is" : "has been"), rateLimit)); } } return null; } catch (Throwable e) { log.severe("Failed to perform operation."); log.severe(CommandLogger.errorMessage(e)); throw e; } }</code><technical_language>'failed get/set re-encryption rate limit'</technical_language>

Target:
@Override public Object execute(GridClientConfiguration clientCfg, Logger log) throws Exception { try (GridClient client = Command.startClient(clientCfg)) { VisorCacheGroupEncryptionTaskResult<Double> res = executeTaskByNameOnNode( client, VisorReencryptionRateTask.class.getName(), taskArg, BROADCAST_UUID, clientCfg ); Map<UUID, IgniteException> exceptions = res.exceptions(); for (Map.Entry<UUID, IgniteException> entry : exceptions.entrySet()) { log.info(INDENT + "Node " + entry.getKey() + ":"); log.info(DOUBLE_INDENT + "failed to get/set re-encryption rate limit: " + entry.getValue().getMessage()); } Map<UUID, Double> results = res.results(); boolean read = taskArg.rate() == null; for (Map.Entry<UUID, Double> entry : results.entrySet()) { log.info(INDENT + "Node " + entry.getKey() + ":"); double rateLimit = read ? entry.getValue() : taskArg.rate(); if (rateLimit == 0) log.info(DOUBLE_INDENT + "re-encryption rate is not limited."); else { log.info(String.format("%sre-encryption rate %s limited to %.2f MB/s.", DOUBLE_INDENT, (read ? "is" : "has been"), rateLimit)); } } if (read) return null; log.info(""); log.info("Note: the changed value of the re-encryption rate limit is not persisted. " + "When the node is restarted, the value will be set from the configuration."); log.info(""); return null; } catch (Throwable e) { log.severe("Failed to perform operation."); log.severe(CommandLogger.errorMessage(e)); throw e; } }
Source:
<code>public void testTLSDefaults() throws Exception { final LogContext logContext = new LogContext(); sslServerConfigs = serverCertStores.getTrustingConfig(clientCertStores); sslClientConfigs = clientCertStores.getTrustingConfig(serverCertStores); assertEquals(SslConfigs.DEFAULT_SSL_PROTOCOL, sslServerConfigs.get(SslConfigs.SSL_PROTOCOL_CONFIG)); assertEquals(SslConfigs.DEFAULT_SSL_PROTOCOL, sslClientConfigs.get(SslConfigs.SSL_PROTOCOL_CONFIG)); channelBuilder = new SslChannelBuilder(Mode.CLIENT, null, false, logContext); channelBuilder.configure(sslServerConfigs); selector = new Selector(5000, new Metrics(), time, "MetricGroup", channelBuilder, logContext); server = createEchoServer(SecurityProtocol.SSL); createSelector(sslClientConfigs); final String node = "0"; InetSocketAddress addr = new InetSocketAddress("localhost", server.port()); selector.connect(node, addr, BUFFER_SIZE, BUFFER_SIZE); <START> NetworkTestUtils.waitForChannelClose(selector, node, ChannelState.State.READY); <END> server.verifyAuthenticationMetrics(1, 0); }</code><technical_language>NetworkTestUtils.checkClientConnection(selector, node, 100, 10); connection</technical_language>

Target:
public void testTLSDefaults() throws Exception { sslServerConfigs = serverCertStores.getTrustingConfig(clientCertStores); sslClientConfigs = clientCertStores.getTrustingConfig(serverCertStores); assertEquals(SslConfigs.DEFAULT_SSL_PROTOCOL, sslServerConfigs.get(SslConfigs.SSL_PROTOCOL_CONFIG)); assertEquals(SslConfigs.DEFAULT_SSL_PROTOCOL, sslClientConfigs.get(SslConfigs.SSL_PROTOCOL_CONFIG)); server = createEchoServer(SecurityProtocol.SSL); createSelector(sslClientConfigs); InetSocketAddress addr = new InetSocketAddress("localhost", server.port()); selector.connect("0", addr, BUFFER_SIZE, BUFFER_SIZE); NetworkTestUtils.checkClientConnection(selector, "0", 10, 100); server.verifyAuthenticationMetrics(1, 0); selector.close(); checkAuthentiationFailed("1", "TLSv1.1"); server.verifyAuthenticationMetrics(1, 1); checkAuthentiationFailed("2", "TLSv1"); server.verifyAuthenticationMetrics(1, 2); }
Source:
<code>private List<ProgramEnrollment> filterPrograms(List<ProgramEnrollment> programEnrollments, String programName, String activeProgram) { List<ProgramEnrollment> programEnrollmentsList; List<ProgramEnrollment> result; <START> programEnrollmentsList = filterByProgramName(programEnrollments, programName); <END> result = isActiveProgram(activeProgram) ? filterByActiveProgramOnly(programEnrollmentsList) : programEnrollmentsList; return result; }</code><technical_language>do in line</technical_language>

Target:
private List<ProgramEnrollment> filterPrograms(List<ProgramEnrollment> programEnrollments, String programName, String activeProgram) { List<ProgramEnrollment> programEnrollmentsList = filterByProgramName(programEnrollments, programName); List<ProgramEnrollment> result; result = isActiveProgram(activeProgram) ? filterByActiveProgramOnly(programEnrollmentsList) : programEnrollmentsList; return result; }
Source:
<code><START> public static Instant parseInstant(String value) { <END> DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT; try { return Instant.parse( value ); } catch (DateTimeParseException e) { throw log.unableToParseTemporal( Instant.class, value, formatter, e ); } }</code><technical_language>I noticed displaying formatter in error message, wanted formatter parsing. sense. Anyway, changed it, work :)</technical_language>

Target:
public static Instant parseInstant(String value) { try { return Instant.parse( value ); } catch (DateTimeParseException e) { throw log.unableToParseTemporal( Instant.class, value, DateTimeFormatter.ISO_INSTANT, e ); } }
Source:
<code>public void fetchLogs() { try { HttpResponse resp = client.execute(getLogRequest(false)); parseResponse(resp); } catch (IOException exp) { callback.error(exp.getMessage()); } finally { <START> callback.close(); <END> } }</code><technical_language>ensure, that, callback is closed this call LogRequestors method is invalid (by throwing exception). nice responsibilities for creating callback (== caller of constructor of LogRequestor) closing callback (== LogRequestor) objects. LogRequestor complete control allocation closing of print stream. I suggest therefor introduce a LogCallback open() allocates stream instead of automatically allocating in constructor. method close a stream open before</technical_language>

Target:
public void fetchLogs() { try { callback.open(); HttpResponse resp = client.execute(getLogRequest(false)); parseResponse(resp); } catch (IOException exp) { callback.error(exp.getMessage()); } finally { callback.close(); } }
Source:
<code>public void testTransferSizeUploadFileCOW() { DiskImage readyImage = initReadyImageForUpload(); readyImage.setVolumeFormat(VolumeFormat.COW); readyImage.setStorageTypes(Collections.singletonList(StorageType.NFS)); transferImageCommand.getParameters().setTransferType(TransferType.Upload); transferImageCommand.handleImageIsReadyForTransfer(); assertEquals(transferImageCommand.getParameters().getTransferSize(), Math.ceil(readyImage.getSize() * StorageConstants.QCOW_OVERHEAD_FACTOR) <START> + StorageConstants.QCOW_MINIMAL_OVERHEAD); <END> }</code><technical_language>tests repeats code. a pre-calculated value(s)? generate values creating fully allocated qcow2 image in sizes, checking size return > actual size</technical_language>

Target:
public void testTransferSizeUploadFileCOW() { DiskImage readyImage = initReadyImageForUpload(); readyImage.setVolumeFormat(VolumeFormat.COW); readyImage.setStorageTypes(Collections.singletonList(StorageType.NFS)); readyImage.setSize(393216L); transferImageCommand.getParameters().setTransferType(TransferType.Upload); transferImageCommand.handleImageIsReadyForTransfer(); assertTrue(transferImageCommand.getParameters().getTransferSize() > readyImage.getSize() * StorageConstants.QCOW_OVERHEAD_FACTOR); }
Source:
<code>public void entryIngested( T entry, GeoWaveRow... rows ) { if (rows != null) { if (rows.length == 1) { getPartitionStatistic( getPartitionKey(rows[0].getPartitionKey())).entryIngested( entry, rows); } else { <START> Map<ByteArrayId, List<GeoWaveRow>> rowsPerPartition = new HashMap<>(); <END> for (final GeoWaveRow row : rows) { ByteArrayId p = getPartitionKey(row.getPartitionKey()); List<GeoWaveRow> r = rowsPerPartition.get(p); if (r == null) { r = new ArrayList<>(); rowsPerPartition.put( p, r); } r.add(row); } for (Entry<ByteArrayId, List<GeoWaveRow>> e : rowsPerPartition.entrySet()) { getPartitionStatistic( e.getKey()).entryIngested( entry, e.getValue().toArray( new GeoWaveRow[e.getValue().size()])); } } } }</code><technical_language>more efficient call entryIngested for row, building this intermediate Map of Lists? eliminate need separate logic for 1 row many. work map is avoid, histograms cached in histogramPerPartition anyways</technical_language>

Target:
public void entryIngested( T entry, GeoWaveRow... rows ) { if (rows != null) { for (final GeoWaveRow row : rows) { getPartitionStatistic( getPartitionKey(row.getPartitionKey())).entryIngested( entry, row); } } }
Source:
<code>public ScpCommand(String remoteHost, String fromFile, String toFile, boolean isDir) { super(new String[]{}); String template = "scp %s %s:%s localhost:%s"; if (isDir) { template = "scp -r %s %s:%s localhost:%s"; } <START> mCommand = new String[]{"bash", "-c", <END> String.format(template, ShellUtils.COMMON_SSH_OPTS, remoteHost, fromFile, toFile) }; mHostName = remoteHost; }</code><technical_language>this calling super constructor</technical_language>

Target:
public ScpCommand(String remoteHost, String fromFile, String toFile, boolean isDir) { super(new String[]{"bash", "-c", String.format(isDir ? "scp -r %s %s:%s localhost:%s" : "scp %s %s:%s localhost:%s", ShellUtils.COMMON_SSH_OPTS, remoteHost, fromFile, toFile) }); mHostName = remoteHost; }
Source:
<code><START> private CacheTopology buildCacheTopology(List<Address> clusterMembers, List<CacheTopology> partitionTopologies) { <END> log.trace("buildCacheTopology"); int unionTopologyId = 0; ConsistentHash currentCHUnion = null; ConsistentHashFactory chFactory = getJoinInfo().getConsistentHashFactory(); ConsistentHash latestTopologyCh = null; for (CacheTopology topology : partitionTopologies) { if (topology.getTopologyId() > unionTopologyId) { unionTopologyId = topology.getTopologyId(); latestTopologyCh = topology.getCurrentCH(); } if (currentCHUnion == null) { currentCHUnion = topology.getCurrentCH(); } else { currentCHUnion = chFactory.union(currentCHUnion, topology.getCurrentCH()); } } updateClusterMembers(clusterMembers); List<Address> members = getMembers(); if (members.isEmpty()) { log.tracef("Cache %s has no members left, skipping topology update", cacheName); return null; } if (currentCHUnion != null) { currentCHUnion = chFactory.updateMembers(currentCHUnion, members, getCapacityFactors()); } unionTopologyId += 2; return new CacheTopology(unionTopologyId, currentCHUnion, null, isMissingData(latestTopologyCh, clusterMembers)); }</code><technical_language>I gather this is of reconciling topologies members? If yes, I reason for keeping it, I of situation new strategy</technical_language>

Target:
private CacheTopology buildCacheTopology(List<Address> clusterMembers, List<CacheTopology> partitionTopologies) { log.trace("buildCacheTopology"); int unionTopologyId = 0; ConsistentHash currentCHUnion = null; ConsistentHashFactory chFactory = getJoinInfo().getConsistentHashFactory(); ConsistentHash latestTopologyCh = null; for (CacheTopology topology : partitionTopologies) { if (topology.getTopologyId() > unionTopologyId) { unionTopologyId = topology.getTopologyId(); latestTopologyCh = topology.getCurrentCH(); } if (currentCHUnion == null) { currentCHUnion = topology.getCurrentCH(); } else { currentCHUnion = chFactory.union(currentCHUnion, topology.getCurrentCH()); } } updateClusterMembers(clusterMembers); List<Address> members = getMembers(); if (members.isEmpty()) { log.tracef("Cache %s has no members left, skipping topology update", cacheName); return null; } if (currentCHUnion != null) { currentCHUnion = chFactory.updateMembers(currentCHUnion, members, getCapacityFactors()); } unionTopologyId += 2; return new CacheTopology(unionTopologyId, currentCHUnion, null, isDataLost(latestTopologyCh, clusterMembers)); }
Source:
<code>public Set<java.util.Map.Entry<K, V>> entrySet() { <START> return hashOps.entries().entrySet(); <END> }</code><technical_language>Nice optimization. retain check for pipelining/transaction checkResult( ) in like: entries = hashOps.entries(); checkResult(entries); return entries.entrySet();</technical_language>

Target:
public Set<java.util.Map.Entry<K, V>> entrySet() { Map<K, V> entries = hashOps.entries(); checkResult(entries); return entries.entrySet(); }
Source:
<code>protected String getQuickAccessTriggerSequenceFormat() { if (triggerSequenceFormat == null) { <START> IBindingService bindingService = SearchField.this.window.getContext().get(IBindingService.class); <END> for (Binding b : bindingService.getBindings()) { if (b.getParameterizedCommand() != null && QUICK_ACCESS_COMMAND_ID.equalsIgnoreCase(b.getParameterizedCommand().getId())) { this.triggerSequenceFormat = b.getTriggerSequence().format(); break; } } } return triggerSequenceFormat; }</code><technical_language>get IBindingService injected? @Inject IBindingService bindingService; field work</technical_language>

Target:
public String getQuickAccessTriggerSequenceFormat() { if (quickAccessTriggerSequenceFormat == null) { updateQuickAccessTriggerSequenceFormat(); } return quickAccessTriggerSequenceFormat; }
Source:
<code>public final void setup(final Channel channel, final CommandReceiver receiver) { this.channel = channel; setup(new ByteArrayReceiver() { public void handle(byte[] payload) { try { Command cmd = Command.readFrom(channel, payload); } catch (IOException | ClassNotFoundException e) { <START> LOGGER.log(Level.WARNING, "Failed to construct Command in channel " + channel.getName(), e); <END> } } public void terminate(IOException e) { receiver.terminate(e); } }); }</code><technical_language>Uh, happened CommandReceiver.handle call</technical_language>

Target:
public final void setup(final Channel channel, final CommandReceiver receiver) { this.channel = channel; setup(new ByteArrayReceiver() { public void handle(byte[] payload) { try { Command cmd = Command.readFrom(channel, payload); receiver.handle(cmd); } catch (IOException | ClassNotFoundException e) { LOGGER.log(Level.WARNING, "Failed to construct Command in channel " + channel.getName(), e); } } public void terminate(IOException e) { receiver.terminate(e); } }); }
Source:
<code>private List<Interval> getFilterTimeIntervals(FilterQueryTree filterQueryTree) { switch (filterQueryTree.getOperator()) { case AND: List<List<Interval>> andIntervals = new ArrayList<>(); for (FilterQueryTree child : filterQueryTree.getChildren()) { List<Interval> childIntervals = getFilterTimeIntervals(child); if (childIntervals != null) { andIntervals.add(childIntervals); } <START> } <END> return getIntersectionSortedIntervals(andIntervals); case OR: List<List<Interval>> orIntervals = new ArrayList<>(); for (FilterQueryTree child : filterQueryTree.getChildren()) { List<Interval> childIntervals = getFilterTimeIntervals(child); if (childIntervals == null) { return null; } else { orIntervals.add(childIntervals); } } return getUnionSortedIntervals(orIntervals); case EQUALITY: if (filterQueryTree.getColumn().equals(_timeColumn)) { long timeStamp = _timeFormatSpec.fromFormatToMillis(filterQueryTree.getValue().get(0)); return Collections.singletonList(new Interval(timeStamp, timeStamp)); } return null; case RANGE: if (filterQueryTree.getColumn().equals(_timeColumn)) { return parseInterval(filterQueryTree.getValue()); } return null; default: return null; } }</code><technical_language>check for empty intervals return empty list</technical_language>

Target:
private List<Interval> getFilterTimeIntervals(FilterQueryTree filterQueryTree) { switch (filterQueryTree.getOperator()) { case AND: List<List<Interval>> andIntervals = new ArrayList<>(); for (FilterQueryTree child : filterQueryTree.getChildren()) { List<Interval> childIntervals = getFilterTimeIntervals(child); if (childIntervals != null) { if (childIntervals.isEmpty()) { return Collections.emptyList(); } andIntervals.add(childIntervals); } } if (andIntervals.isEmpty()) { return null; } return getIntersectionSortedIntervals(andIntervals); case OR: List<List<Interval>> orIntervals = new ArrayList<>(); for (FilterQueryTree child : filterQueryTree.getChildren()) { List<Interval> childIntervals = getFilterTimeIntervals(child); if (childIntervals == null) { return null; } else { orIntervals.add(childIntervals); } } return getUnionSortedIntervals(orIntervals); case EQUALITY: if (filterQueryTree.getColumn().equals(_timeColumn)) { long timeStamp = _timeFormatSpec.fromFormatToMillis(filterQueryTree.getValue().get(0)); return Collections.singletonList(new Interval(timeStamp, timeStamp)); } return null; case RANGE: if (filterQueryTree.getColumn().equals(_timeColumn)) { return parseInterval(filterQueryTree.getValue()); } return null; default: return null; } }
Source:
<code><START> public PhoneHome(Node node, String baseurl) { <END> hazelcastNode = node; logger = hazelcastNode.getLogger(com.hazelcast.internal.util.phonehome.PhoneHome.class); basePhoneHomeUrl = baseurl; }</code><technical_language>Please this constructor package-private. tests, is need expose publicly</technical_language>

Target:
PhoneHome(Node node, String baseurl) { hazelcastNode = node; logger = hazelcastNode.getLogger(com.hazelcast.internal.util.phonehome.PhoneHome.class); basePhoneHomeUrl = baseurl; }
Source:
<code>public @ResponseBody SurveillanceResults getAllPendingSurveillanceForAcbUser() throws AccessDeniedException { <START> if(Util.isUserRoleAdmin()){ <END> throw new AccessDeniedException("Pending surveillances may only be viewed by the ACB Administrators that manage them."); } List<CertificationBodyDTO> acbs = acbManager.getAllForUser(false); List<Surveillance> pendingSurvs = new ArrayList<Surveillance>(); if (acbs != null) { for (CertificationBodyDTO acb : acbs) { try { List<Surveillance> survsOnAcb = survManager.getPendingByAcb(acb.getId()); pendingSurvs.addAll(survsOnAcb); } catch (final AccessDeniedException denied) { LOGGER.warn("Access denied to pending surveillance for acb " + acb.getName() + " and user " + Util.getUsername()); } } } SurveillanceResults results = new SurveillanceResults(); results.setPendingSurveillance(pendingSurvs); return results; }</code><technical_language>issue</technical_language>

Target:
public @ResponseBody SurveillanceResults getAllPendingSurveillanceForAcbUser() throws AccessDeniedException { if(!Util.isUserRoleAcbAdmin()){ throw new AccessDeniedException(String .format(messageSource.getMessage( new DefaultMessageSourceResolvable("access.pendingSurveillances"), LocaleContextHolder.getLocale()))); } List<CertificationBodyDTO> acbs = acbManager.getAllForUser(false); List<Surveillance> pendingSurvs = new ArrayList<Surveillance>(); if (acbs != null) { for (CertificationBodyDTO acb : acbs) { try { List<Surveillance> survsOnAcb = survManager.getPendingByAcb(acb.getId()); pendingSurvs.addAll(survsOnAcb); } catch (final AccessDeniedException denied) { LOGGER.warn("Access denied to pending surveillance for acb " + acb.getName() + " and user " + Util.getUsername()); } } } SurveillanceResults results = new SurveillanceResults(); results.setPendingSurveillance(pendingSurvs); return results; }
Source:
<code>Map<String, String> fetchAccountMetadata() { long startTimeMs = System.currentTimeMillis(); logger.trace("Start reading ZNRecord from path={}", znRecordPath); ZNRecord znRecord = helixStore.get(znRecordPath, null, AccessOption.PERSISTENT); logger.trace("Fetched ZNRecord from path={}, took time={} ms", znRecordPath, startTimeMs); if (znRecord == null) { <START> logger.debug("The ZNRecord to read does not exist on path={}", znRecordPath); <END> return null; } return fetchAccountMetadataFromZNRecord(znRecord); }</code><technical_language>minor: I warn</technical_language>

Target:
Map<String, String> fetchAccountMetadata() { long startTimeMs = System.currentTimeMillis(); logger.trace("Start reading ZNRecord from path={}", znRecordPath); ZNRecord znRecord = helixStore.get(znRecordPath, null, AccessOption.PERSISTENT); logger.trace("Fetched ZNRecord from path={}, took time={} ms", znRecordPath, startTimeMs); if (znRecord == null) { logger.info("The ZNRecord to read does not exist on path={}", znRecordPath); return null; } return fetchAccountMetadataFromZNRecord(znRecord); }
Source:
<code>public ActionForward chooseCycleForViewRegistrationCurriculum(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { final RegistrationCurriculumBean registrationCurriculumBean = getRegistrationCurriculumBeanFromViewState(); request.setAttribute("registrationCurriculumBean", registrationCurriculumBean); request.setAttribute("registration", registrationCurriculumBean.getRegistration()); final Person studentPerson = registrationCurriculumBean.getStudent().getPerson(); request.setAttribute("studentPerson", studentPerson); final EctsGraduationGradeConversionTable ectsGraduationGradeConversionTable = EctsTableIndex.getGraduationGradeConversionTable(registrationCurriculumBean.getRegistration().getDegree(), registrationCurriculumBean.getRegistration().getCycleType(ExecutionYear.readCurrentExecutionYear()), <START> ExecutionYear.readCurrentExecutionYear().getAcademicInterval(), new DateTime()); <END> request.setAttribute("ectsGradeConversionTable", ectsGraduationGradeConversionTable.getEctsTable().toString().split("")); request.setAttribute("ectsGradePercentagesTable", ectsGraduationGradeConversionTable.getPercentages().toString().split(":")); return mapping.findForward("view-registration-curriculum"); }</code><technical_language>this attribute next added viewRegistrationCurriculum method of class? methods JSP, this method provides attributes. rendering of JSP fail forwarded viewRegistrationCurriculum method</technical_language>

Target:
public ActionForward chooseCycleForViewRegistrationCurriculum(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { final RegistrationCurriculumBean registrationCurriculumBean = getRegistrationCurriculumBeanFromViewState(); request.setAttribute("registrationCurriculumBean", registrationCurriculumBean); request.setAttribute("registration", registrationCurriculumBean.getRegistration()); final Person studentPerson = registrationCurriculumBean.getStudent().getPerson(); request.setAttribute("studentPerson", studentPerson); setEctsGradeAttributes(request, registrationCurriculumBean); return mapping.findForward("view-registration-curriculum"); }
Source:
<code>private DataDependentEDDPAlgorithm(SolutionSpace space, TransformationChecker checker, boolean deterministic, int steps, double epsilonSearch) { super(space, checker); this.checker.getHistory().setStorageStrategy(StorageStrategy.ALL); this.propertyChecked = space.getPropertyChecked(); this.solutionSpace.setAnonymityPropertyPredictable(false); this.steps = steps; double epsilonPerStep; IntervalArithmeticDouble arithmetic = new IntervalArithmeticDouble(); try { epsilonPerStep = arithmetic.div(arithmetic.createInterval(epsilonSearch), arithmetic.createInterval(steps)).lower; <START> exponentialMechanism = new ExponentialMechanismReliable<Long>(epsilonPerStep, deterministic); <END> } catch (IntervalArithmeticException e) { throw new RuntimeException(e); } }</code><technical_language>include a non-reliable variant of Expontential Mechanism, right? This means class ExponentialMechanismReliable renamed ExponentialMechanism</technical_language>

Target:
private DataDependentEDDPAlgorithm(SolutionSpace space, TransformationChecker checker, boolean deterministic, int steps, double epsilonSearch) { super(space, checker); this.checker.getHistory().setStorageStrategy(StorageStrategy.ALL); this.propertyChecked = space.getPropertyChecked(); this.solutionSpace.setAnonymityPropertyPredictable(false); this.steps = steps; double epsilonPerStep; IntervalArithmeticDouble arithmetic = new IntervalArithmeticDouble(); try { epsilonPerStep = arithmetic.div(arithmetic.createInterval(epsilonSearch), arithmetic.createInterval(steps)).lower; exponentialMechanism = new ExponentialMechanism<Long>(epsilonPerStep, deterministic); } catch (IntervalArithmeticException e) { throw new RuntimeException(e); } }
Source:
<code>public void updateViewerInput() { if (session != null && treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { Object[] children = siriusCommonContentModelProvider.getChildren(session); List<Object> childrenList = new ArrayList<>(); Resource sessionResource = session.getSessionResource(); IFile file = WorkspaceSynchronizer.getFile(sessionResource); ProjectDependenciesItem projectDependenciesItem = new NoDynamicProjectDependencies(file.getProject(), session); childrenList.add(projectDependenciesItem); <START> childrenList.addAll(Arrays.stream(children).collect(Collectors.toList())); <END> List<Object> directChildOfProjectDependency = Arrays.asList(siriusCommonContentModelProvider.getChildren(projectDependenciesItem)); treeViewer.setInput(childrenList.stream().filter(input -> !(input instanceof ViewpointsFolderItemImpl) && !directChildOfProjectDependency.contains(input)).collect(Collectors.toList())); treeViewer.expandToLevel(2); treeViewer.expandToLevel(projectDependenciesItem, 2); } }</code><technical_language>Arrays.asList() enough, avoid allocating a full new temporary collection for sake of addAll</technical_language>

Target:
public void updateViewerInput() { if (session != null && treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()) { Object[] children = siriusCommonContentModelProvider.getChildren(session); List<Object> childrenList = new ArrayList<>(); Resource sessionResource = session.getSessionResource(); IFile file = WorkspaceSynchronizer.getFile(sessionResource); ProjectDependenciesItem projectDependenciesItem = new NoDynamicProjectDependencies(file.getProject(), session); childrenList.add(projectDependenciesItem); childrenList.addAll(Arrays.asList(children)); List<Object> directChildOfProjectDependency = Arrays.asList(siriusCommonContentModelProvider.getChildren(projectDependenciesItem)); treeViewer.setInput(childrenList.stream().filter(input -> !(input instanceof ViewpointsFolderItemImpl) && !directChildOfProjectDependency.contains(input)).collect(Collectors.toList())); treeViewer.expandToLevel(2); treeViewer.expandToLevel(projectDependenciesItem, 2); } }
Source:
<code>void togglePlayer(final CommandSource sender, final User user, Boolean enabled) { if (enabled == null) { enabled = !user.isVanished(); } final VanishStatusChangeEvent vanishEvent = new VanishStatusChangeEvent(sender.isPlayer() ? ess.getUser(sender.getPlayer()) : null, user, enabled); ess.getServer().getPluginManager().callEvent(vanishEvent); if (vanishEvent.isCancelled()) { return; } user.setVanished(enabled); user.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); if (enabled) { user.sendMessage(tl("vanished")); } if (ess.getSettings().isFakeMessageOnVanish()) { final Player player = user.getBase(); String msg; if (enabled) { if (ess.getSettings().isCustomQuitMessage()) { msg = ess.getSettings().getCustomQuitMessage(); } else { <START> msg = "&e{USERNAME} left the game."; <END> } } else { if (ess.getSettings().isCustomJoinMessage()) { msg = ess.getSettings().getCustomJoinMessage(); } else { msg = "&e{USERNAME} joined the game."; } } msg = msg.replace("{PLAYER}", player.getDisplayName()) .replace("{USERNAME}", player.getName()) .replace("{ONLINE}", NumberFormat.getInstance().format(ess.getOnlinePlayers().size())) .replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())); ess.getServer().broadcastMessage(msg); } if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); } }</code><technical_language>suggestion msg = "&e{USERNAME} left game";</technical_language>

Target:
void togglePlayer(final CommandSource sender, final User user, Boolean enabled) { if (enabled == null) { enabled = !user.isVanished(); } final VanishStatusChangeEvent vanishEvent = new VanishStatusChangeEvent(sender.isPlayer() ? ess.getUser(sender.getPlayer()) : null, user, enabled); ess.getServer().getPluginManager().callEvent(vanishEvent); if (vanishEvent.isCancelled()) { return; } user.setVanished(enabled); user.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); if (enabled) { user.sendMessage(tl("vanished")); } if (ess.getSettings().isFakeMessageOnVanish()) { final Player player = user.getBase(); String msg; if (enabled) { if (ess.getSettings().isCustomQuitMessage()) { msg = ess.getSettings().getCustomQuitMessage(); } else { msg = "&e{USERNAME} left the game"; } } else { if (ess.getSettings().isCustomJoinMessage()) { msg = ess.getSettings().getCustomJoinMessage(); } else { msg = "&e{USERNAME} joined the game"; } } msg = msg.replace("{PLAYER}", player.getDisplayName()) .replace("{USERNAME}", player.getName()) .replace("{ONLINE}", NumberFormat.getInstance().format(ess.getOnlinePlayers().size())) .replace("{UPTIME}", DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())); ess.getServer().broadcastMessage(msg); } if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(tl("vanish", user.getDisplayName(), enabled ? tl("enabled") : tl("disabled"))); } }
Source:
<code>public void testXpathSuppressions() throws Exception { <START> final String fn = getPath("suppressions_xpath_correct.xml"); <END> final Set<TreeWalkerFilter> filterSet = SuppressionsLoader.loadXpathSuppressions(fn); assertEquals("Invalid number of filters", 1, filterSet.size()); }</code><technical_language>new inputs named tests. file name start InputSuppressionsLoader. Please do this for new inputs</technical_language>

Target:
public void testXpathSuppressions() throws Exception { final String fn = getPath("InputSuppressionsLoaderXpathCorrect.xml"); final Set<TreeWalkerFilter> filterSet = SuppressionsLoader.loadXpathSuppressions(fn); assertEquals("Invalid number of filters", 1, filterSet.size()); }
Source:
<code>private String getProxyHostEnvironment() { if (getProtocol() == Protocol.HTTPS) { if (getHttpsProxyUrlFromEnvironment() != null) { return getHttpsProxyUrlFromEnvironment().getHost(); } } else { if (getHttpProxyUrlFromEnvironment() != null) { return getHttpProxyUrlFromEnvironment().getHost(); } } <START> return null; <END> }</code><technical_language>change logic match system property logic? For example, returning null catching higher</technical_language>

Target:
private String getProxyHostEnvironment() { try { return getProtocol() == Protocol.HTTPS ? new URL(getEnvironmentVariableCaseInsensitive("HTTPS_PROXY")).getHost() : new URL(getEnvironmentVariableCaseInsensitive("HTTP_PROXY")).getHost(); } catch (MalformedURLException e) { return null; } }
Source:
<code>public Pipeline createReplicationPipeline(HddsProtos.ReplicationType type, HddsProtos.ReplicationFactor factor, HddsProtos.NodePool nodePool) throws IOException { <START> AUDIT.logReadSuccess( <END> buildAuditMessageForSuccess(SCMAction.CREATE_PIPELINE, null)); return scm.getPipelineManager().createPipeline(type, factor); }</code><technical_language>log this a write success for pipeline creation</technical_language>

Target:
public Pipeline createReplicationPipeline(HddsProtos.ReplicationType type, HddsProtos.ReplicationFactor factor, HddsProtos.NodePool nodePool) throws IOException { Pipeline result = scm.getPipelineManager().createPipeline(type, factor); AUDIT.logWriteSuccess( buildAuditMessageForSuccess(SCMAction.CREATE_PIPELINE, null)); return result; }
Source:
<code>public RemoteFile readFileWithMode(String uri, String ref, String path) throws GitAPIException, IOException { Repository repo = uriRepoMap.get(uri); ObjectId refCommitId = sha1(uri, ref); RevCommit commit = repo.parseCommit(refCommitId); TreeWalk tw = TreeWalk.forPath(repo, path, commit.getTree()); <START> tw.setRecursive(true); <END> return new RemoteFile( readContent(repo, ref, path), tw.getFileMode(0)); }</code><technical_language>needed</technical_language>

Target:
public RemoteFile readFileWithMode(String uri, String ref, String path) throws GitAPIException, IOException { Repository repo = uriRepoMap.get(uri); ObjectId refCommitId = sha1(uri, ref); RevCommit commit = repo.parseCommit(refCommitId); TreeWalk tw = TreeWalk.forPath(repo, path, commit.getTree()); return new RemoteFile( tw.getObjectReader().open(tw.getObjectId(0)) .getCachedBytes(), tw.getFileMode(0)); }
Source:
<code>public void testdecompressCompressPointer() { byte[] compressionPointer = { 5, 'n', 'e', 't', 't', 'y', 2, 'i', 'o', 0, (byte) 0xC0, 0 }; ByteBuf buffer = Unpooled.wrappedBuffer(compressionPointer); ByteBuf uncomporessed = null; try { <START> uncomporessed = DnsCodecUtil.decompressDomainName(buffer.duplicate().setIndex(10, 12)); <END> assertEquals(0, ByteBufUtil.compare(buffer.duplicate().setIndex(0, 10), uncomporessed)); } finally { buffer.release(); if (uncomporessed != null) { uncomporessed.release(); } } }</code><technical_language>nit: typo... "uncompressed"</technical_language>

Target:
public void testdecompressCompressPointer() { byte[] compressionPointer = { 5, 'n', 'e', 't', 't', 'y', 2, 'i', 'o', 0, (byte) 0xC0, 0 }; ByteBuf buffer = Unpooled.wrappedBuffer(compressionPointer); ByteBuf uncompressed = null; try { uncompressed = DnsCodecUtil.decompressDomainName(buffer.duplicate().setIndex(10, 12)); assertEquals(0, ByteBufUtil.compare(buffer.duplicate().setIndex(0, 10), uncompressed)); } finally { buffer.release(); if (uncompressed != null) { uncompressed.release(); } } }
Source:
<code>public ValueMatcher makeValueMatcher(String dimension, final Comparable value) { <START> if (dimension.equals(Column.TIME_COLUMN_NAME)) { <END> final LongColumnSelector longSelector = cursor.makeLongColumnSelector(dimension); try { if (value == null) { return new BooleanValueMatcher(false); } final long longValue = Long.parseLong(value.toString()); return new ValueMatcher() { @Override public boolean matches() { long ts = longSelector.get(); return ts == longValue; } }; } catch (NumberFormatException nfe) { throw new ParseException("Cannot parse value [%s] as long: ", value); } } final DimensionSelector selector = cursor.makeDimensionSelector( new DefaultDimensionSpec(dimension, dimension) ); final boolean matchNull = isComparableNullOrEmpty(value); final int id = selector.lookupId((String) value); if (id < 0) { return new BooleanValueMatcher(false); } else { return new ValueMatcher() { @Override public boolean matches() { IndexedInts row = selector.getRow(); if (row.size() == 0) { return matchNull; } for (int i = 0; i < row.size(); i++) { if (row.get(i) == id) { return true; } } return false; } }; } }</code><technical_language>this block of code copy pasted, put a common location somewhere</technical_language>

Target:
public ValueMatcher makeValueMatcher(String dimension, final Comparable value) { if (getTypeForDimension(dimension) == ValueType.LONG) { return Filters.getLongValueMatcher( cursor.makeLongColumnSelector(dimension), value ); } final DimensionSelector selector = cursor.makeDimensionSelector( new DefaultDimensionSpec(dimension, dimension) ); final boolean matchNull = isComparableNullOrEmpty(value); final int id = selector.lookupId((String) value); if (id < 0) { return new BooleanValueMatcher(false); } else { return new ValueMatcher() { @Override public boolean matches() { IndexedInts row = selector.getRow(); if (row.size() == 0) { return matchNull; } for (int i = 0; i < row.size(); i++) { if (row.get(i) == id) { return true; } } return false; } }; } }
Source:
<code>public AuthConfigs getCredentials() { try { String encodedCredentials; String credentials; <START> encodedCredentials = preferenceDao.getPreferences(EnvironmentContext.getCurrent() <END> .getSubject() .getUserId(), DOCKER_REGISTRY_CREDENTIALS_KEY) .get(DOCKER_REGISTRY_CREDENTIALS_KEY); credentials = new String(Base64.getDecoder().decode(encodedCredentials), "UTF-8"); return DtoFactory.newDto(AuthConfigs.class).withConfigs( DtoFactory.getInstance().createMapDtoFromJson(credentials, AuthConfig.class)); } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); return null; } }</code><technical_language>variable declaration initialization splitted</technical_language>

Target:
public AuthConfigs getCredentials() { try { String encodedCredentials = preferenceDao.getPreferences(EnvironmentContext.getCurrent() .getSubject() .getUserId(), DOCKER_REGISTRY_CREDENTIALS_KEY) .get(DOCKER_REGISTRY_CREDENTIALS_KEY); String credentials = encodedCredentials != null ? new String(Base64.getDecoder().decode(encodedCredentials), "UTF-8") : "{}"; return DtoFactory.newDto(AuthConfigs.class).withConfigs( DtoFactory.getInstance().createMapDtoFromJson(credentials, AuthConfig.class)); } catch (Exception e) { LOG.warn(e.getLocalizedMessage()); return null; } }