auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ConcurSAEDetailLineFixture(ConcurSAEDetailLineFixture baseFixture, ConcurSAEFileFixture extractFile, ConcurEmployeeFixture employee, String journalDebitCredit, double journalAmount, EnumMap<LineField,String> overrideMap) { this(extractFile, employee, overrideMap.getOrDefault(LineField.REPORT_ID, baseFixture.reportId), overrideMap.getOrDefault(LineField.PAYMENT_CODE, baseFixture.paymentCode), overrideMap.getOrDefault(LineField.CHART_OF_ACCOUNTS_CODE, baseFixture.chartOfAccountsCode), overrideMap.getOrDefault(LineField.JOURNAL_ACCOUNT_CODE, baseFixture.journalAccountCode), overrideMap.getOrDefault(LineField.ACCOUNT_NUMBER, baseFixture.accountNumber), overrideMap.getOrDefault(LineField.SUB_ACCOUNT_NUMBER, baseFixture.subAccountNumber), overrideMap.getOrDefault(LineField.SUB_OBJECT_CODE, baseFixture.subObjectCode), overrideMap.getOrDefault(LineField.PROJECT_CODE, baseFixture.projectCode), overrideMap.getOrDefault(LineField.ORG_REF_ID, baseFixture.orgRefId), journalDebitCredit, journalAmount, overrideMap.getOrDefault(LineField.REPORT_END_DATE, baseFixture.reportEndDate), overrideMap.getOrDefault(LineField.CASH_ADVANCE_CA_KEY, ""), <START> overrideMap.getOrDefault(LineField.REPORT_ENTRY_ID, "")); <END> }</code><technical_language>default baseFixture field values instead of defaulting ""</technical_language>

Target:
private ConcurSAEDetailLineFixture(ConcurSAEDetailLineFixture baseFixture, ConcurSAEFileFixture extractFile, ConcurEmployeeFixture employee, String journalDebitCredit, double journalAmount, EnumMap<LineField,String> overrideMap) { this(extractFile, employee, overrideMap.getOrDefault(LineField.REPORT_ID, baseFixture.reportId), overrideMap.getOrDefault(LineField.PAYMENT_CODE, baseFixture.paymentCode), overrideMap.getOrDefault(LineField.CHART_OF_ACCOUNTS_CODE, baseFixture.chartOfAccountsCode), overrideMap.getOrDefault(LineField.JOURNAL_ACCOUNT_CODE, baseFixture.journalAccountCode), overrideMap.getOrDefault(LineField.ACCOUNT_NUMBER, baseFixture.accountNumber), overrideMap.getOrDefault(LineField.SUB_ACCOUNT_NUMBER, baseFixture.subAccountNumber), overrideMap.getOrDefault(LineField.SUB_OBJECT_CODE, baseFixture.subObjectCode), overrideMap.getOrDefault(LineField.PROJECT_CODE, baseFixture.projectCode), overrideMap.getOrDefault(LineField.ORG_REF_ID, baseFixture.orgRefId), journalDebitCredit, journalAmount, overrideMap.getOrDefault(LineField.REPORT_END_DATE, baseFixture.reportEndDate), overrideMap.getOrDefault(LineField.CASH_ADVANCE_KEY, baseFixture.cashAdvanceKey), overrideMap.getOrDefault(LineField.REPORT_ENTRY_ID, baseFixture.reportEntryId)); }
Source:
<code>public void testSimpleFile() throws Exception { File file = atomicFileCreate("test.txt"); File hidden = atomicFileCreate("test.foo"); Message<?> received = messageCollector.forChannel(source.output()).poll(10, TimeUnit.SECONDS); assertNotNull(received); assertEquals(file, received.getPayload()); <START> received = messageCollector.forChannel(source.output()).poll(300, TimeUnit.MILLISECONDS); <END> assertNull(received); file.delete(); hidden.delete(); }</code><technical_language>Apparently I wrong above. I thought timeout threw exception. nvm</technical_language>

Target:
public void testSimpleFile() throws Exception { File file = atomicFileCreate("test.txt"); File hidden = atomicFileCreate("test.foo"); assertTrue(new File(ROOT_DIR, "test.foo").exists()); Message<?> received = messageCollector.forChannel(source.output()).poll(10, TimeUnit.SECONDS); assertNotNull(received); assertEquals(file, received.getPayload()); received = messageCollector.forChannel(source.output()).poll(300, TimeUnit.MILLISECONDS); assertNull(received); file.delete(); hidden.delete(); }
Source:
<code>private IFormatReader setupReader(boolean flattened, boolean initialize) { IFormatReader ir = null; if (flattened) { ir = new ImageReader(); ir = new BufferedImageReader(new FileStitcher(new Memoizer(ir, Memoizer.DEFAULT_MINIMUM_ELAPSED, new File("")))); ir.setMetadataOptions(new DefaultMetadataOptions(MetadataLevel.NO_OVERLAYS)); } else { ir = new BufferedImageReader(new FileStitcher()); ir.setFlattenedResolutions(false); } MetadataStore store = null; try { store = omexmlService.createOMEXMLMetadata(); } catch (ServiceException e) { LOGGER.warn("Could not parse OME-XML", e); } ir.setMetadataStore(store); ir.setNormalized(true); ir.setOriginalMetadataPopulated(false); ir.setMetadataFiltered(true); if (initialize) { try { ir.setId(id); } catch (FormatException e) { LOGGER.error("Could not initialize " + id, e); } <START> catch (IOException e) { <END> LOGGER.error("Could not initialize " + id, e); } } if (flattened) { reader = (BufferedImageReader) ir; } return ir; }</code><technical_language>days multi-catch if like</technical_language>

Target:
private IFormatReader setupReader(boolean flattened, boolean initialize) { IFormatReader ir = null; if (flattened) { ir = new ImageReader(); ir = new BufferedImageReader(new FileStitcher(new Memoizer(ir, Memoizer.DEFAULT_MINIMUM_ELAPSED, new File("")))); ir.setMetadataOptions(new DefaultMetadataOptions(MetadataLevel.NO_OVERLAYS)); } else { ir = new BufferedImageReader(new FileStitcher()); ir.setFlattenedResolutions(false); } MetadataStore store = null; try { store = omexmlService.createOMEXMLMetadata(); } catch (ServiceException e) { LOGGER.warn("Could not parse OME-XML", e); } ir.setMetadataStore(store); ir.setNormalized(true); ir.setOriginalMetadataPopulated(false); ir.setMetadataFiltered(true); if (initialize) { try { ir.setId(id); } catch (FormatException | IOException e) { LOGGER.error("Could not initialize " + id, e); } } if (flattened) { reader = (BufferedImageReader) ir; } return ir; }
Source:
<code>public void testTwoConnectionsSameIDThroughCFWithShareClientIDEnabeld() throws Exception { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?clientID=myid;enableSharedClientID=true"); conn = connectionFactory.createConnection(); try { conn2 = connectionFactory.createConnection(); } catch (InvalidClientIDException expected) { Assert.fail("Should allow sharing of client IDs among the same CF"); } Session session1 = conn.createSession(); <START> Session session2 = conn.createSession(); <END> Session session3 = conn.createSession(); Session session4 = conn.createSession(); session1.close(); session2.close(); session3.close(); session4.close(); }</code><technical_language>test conn2 here? test conn</technical_language>

Target:
public void testTwoConnectionsSameIDThroughCFWithShareClientIDEnabeld() throws Exception { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?clientID=myid;enableSharedClientID=true"); conn = connectionFactory.createConnection(); try { conn2 = connectionFactory.createConnection(); } catch (InvalidClientIDException expected) { Assert.fail("Should allow sharing of client IDs among the same CF"); } Session session1 = conn.createSession(); Session session2 = conn.createSession(); Session session3 = conn2.createSession(); Session session4 = conn2.createSession(); session1.close(); session2.close(); session3.close(); session4.close(); }
Source:
<code><START> private static void incrementIV(byte[] iv, int i) { <END> iv[i]++; if (iv[i] == 0) { if (i != 0) { incrementIV(iv, i - 1); } else return; } }</code><technical_language>This implementation correct me, I unit test, sure, prevent regressions. I testing boundary cases for arrays of length 1, 2, 3, sufficient cover cases. (i == 0, i == a.len-1, 0 < i < a.len-1)</technical_language>

Target:
static void incrementIV(byte[] iv, int i) { iv[i]++; if (iv[i] == 0) { if (i != 0) { incrementIV(iv, i - 1); } else return; } }
Source:
<code>private boolean isTargetRowFound() { try (ResultInterface rows = targetMatchQuery.query(0)) { if (!rows.next()) { return false; } Value targetRowId = rows.currentRow()[0]; Integer number = targetRowidsRemembered.get(targetRowId); if (number != null) { throw DbException.get(ErrorCode.DUPLICATE_KEY_1, "Merge using ON column expression, " + "duplicate _ROWID_ target record already updated, deleted or inserted:_ROWID_=" + targetRowId + ":in:" + targetTableFilter.getTable() + ":conflicting source row number:" + number); } targetRowidsRemembered.put(targetRowId, sourceQueryRowNumber); <START> if (rows.next()) { <END> throw DbException.get(ErrorCode.DUPLICATE_KEY_1, "Duplicate key updated " + rows.getRowCount() + " rows at once, only 1 expected:_ROWID_=" + targetRowId + ":in:" + targetTableFilter.getTable() + ":conflicting source row number:" + targetRowidsRemembered.get(targetRowId)); } return true; } }</code><technical_language>calling next() now</technical_language>

Target:
private boolean isTargetRowFound() { try (ResultInterface rows = targetMatchQuery.query(0)) { if (!rows.next()) { return false; } Value targetRowId = rows.currentRow()[0]; Integer number = targetRowidsRemembered.get(targetRowId); if (number != null) { throw DbException.get(ErrorCode.DUPLICATE_KEY_1, "Merge using ON column expression, " + "duplicate _ROWID_ target record already updated, deleted or inserted:_ROWID_=" + targetRowId + ":in:" + targetTableFilter.getTable() + ":conflicting source row number:" + number); } targetRowidsRemembered.put(targetRowId, sourceQueryRowNumber); if (rows.next()) { int rowCount; if (rows.isLazy()) { for (rowCount = 2; rows.next(); rowCount++) { } } else { rowCount = rows.getRowCount(); } throw DbException.get(ErrorCode.DUPLICATE_KEY_1, "Duplicate key updated " + rowCount + " rows at once, only 1 expected:_ROWID_=" + targetRowId + ":in:" + targetTableFilter.getTable() + ":conflicting source row number:" + targetRowidsRemembered.get(targetRowId)); } return true; } }
Source:
<code>public void unlock(T id) { log.trace("{} trying to unlock {}", Thread.currentThread().getName(), id.toString()); synchronized (locked) { if (locked.remove(id)) { log.trace("{} unlocked {}", Thread.currentThread().getName(), id.toString()); <START> idsLocked.update(-1); <END> locked.notifyAll(); } } }</code><technical_language>idsLocked is a histogram records Ids locked a time time someones calls lock(). a counter. This statement effectively means lock -1 ids</technical_language>

Target:
public void unlock(T id) { log.trace("{} trying to unlock {}", Thread.currentThread().getName(), id.toString()); synchronized (locked) { if (locked.remove(id)) { log.trace("{} unlocked {}", Thread.currentThread().getName(), id.toString()); locked.notifyAll(); } } }
Source:
<code>public void setMaxRowSize(int rowSize) { <START> if (maxRowSize == -1) { <END> maxRowSize = rowSize; } else { if (maxRowSize < rowSize) { maxRowSize = rowSize; } } }</code><technical_language>if rowsize is positive check for -1 is necessary</technical_language>

Target:
public void setMaxRowSize(int rowSize) { if (rowSize > maxRowSize) { maxRowSize = rowSize; } }
Source:
<code>public EhcacheEntityResponse invoke(ClientDescriptor clientDescriptor, EhcacheEntityMessage message) { try { switch (message.getType()) { case LIFECYCLE_OP: return invokeLifeCycleOperation(clientDescriptor, (LifecycleMessage) message); case SERVER_STORE_OP: return invokeServerStoreOperation(clientDescriptor, (ServerStoreOpMessage) message); default: throw new IllegalMessageException("Unknown message : " + message); } } catch (ClusteredEhcacheException e) { return responseFactory.failure(e); } catch (Exception e) { <START> LOGGER.error("Unexpected exception raised during LifeCycle operation: " + e, e); <END> return responseFactory.failure(e); } }</code><technical_language>is error message LifeCycleOperation? ServerStoreOperations excluded</technical_language>

Target:
public EhcacheEntityResponse invoke(ClientDescriptor clientDescriptor, EhcacheEntityMessage message) { try { switch (message.getType()) { case LIFECYCLE_OP: return invokeLifeCycleOperation(clientDescriptor, (LifecycleMessage) message); case SERVER_STORE_OP: return invokeServerStoreOperation(clientDescriptor, (ServerStoreOpMessage) message); default: throw new IllegalMessageException("Unknown message : " + message); } } catch (ClusteredEhcacheException e) { return responseFactory.failure(e); } catch (Exception e) { LOGGER.error("Unexpected exception raised during operation: " + message, e); return responseFactory.failure(e); } }
Source:
<code>public void testScanTableWithIterSetWithoutProfile() throws Exception { final String table = name.getMethodName(); ts.exec("createtable " + table, true); ts.exec("insert foo a b c", true); ts.exec("scan", true, "foo a:b c"); <START> ts.input.set("\n5000\n\n"); <END> ts.exec("setiter -scan -n itname -p 10 -ageoff", true); ts.exec("sleep 6", true); ts.exec("scan", true, "", true); ts.exec("deletetable -f " + table); ts.exec("createtable " + table, true); ts.exec("insert foo a b c", true); ts.exec("notable"); ts.exec("scan -t " + table, true, "foo a:b c"); ts.input.set("\n5000\n\n"); ts.exec("setiter -scan -n itname -p 10 -ageoff -t " + table, true); ts.exec("sleep 6", true); ts.exec("scan -t " + table, true, "", true); ts.exec("deletetable -f " + table); }</code><technical_language>set timeout sleep for seconds</technical_language>

Target:
public void testScanTableWithIterSetWithoutProfile() throws Exception { final String table = name.getMethodName(); ts.exec("createtable " + table, true); ts.exec("insert foo a b c", true); ts.exec("scan", true, "foo a:b c"); ts.input.set("\n1000\n\n"); ts.exec("setiter -scan -n itname -p 10 -ageoff", true); ts.exec("sleep 2", true); ts.exec("scan", true, "", true); ts.exec("deletetable -f " + table); ts.exec("createtable " + table, true); ts.exec("insert foo a b c", true); ts.exec("notable"); ts.exec("scan -t " + table, true, "foo a:b c"); ts.input.set("\n1000\n\n"); ts.exec("setiter -scan -n itname -p 10 -ageoff -t " + table, true); ts.exec("sleep 2", true); ts.exec("scan -t " + table, true, "", true); ts.exec("deletetable -f " + table); }
Source:
<code>public long countStocksByDatasetId(int datasetId) throws MiddlewareQueryException { final StringBuilder sql = new StringBuilder(); sql.append("SELECT COUNT(DISTINCT es.stock_id) FROM nd_experiment_project ep ") .append(" INNER JOIN nd_experiment_stock es ON es.nd_experiment_id = ep.nd_experiment_id ").append(" WHERE ep.project_id = ") <START> .append(datasetId); <END> try { SQLQuery query = this.getSession().createSQLQuery(sql.toString()); BigInteger count = (BigInteger) query.uniqueResult(); return count.longValue(); } catch (HibernateException e) { this.logAndThrowException("Error at countStocksByDatasetId=" + datasetId + " query at ExperimentDao: " + e.getMessage(), e); } return 0; }</code><technical_language>Instead of appending datasetId, added a parameter creating SQLQuery more legible</technical_language>

Target:
public long countStocksByDatasetId(int datasetId) throws MiddlewareQueryException { final StringBuilder sql = new StringBuilder(); sql.append("SELECT COUNT(DISTINCT es.stock_id) FROM nd_experiment_project ep ") .append(" INNER JOIN nd_experiment_stock es ON es.nd_experiment_id = ep.nd_experiment_id ") .append(" WHERE ep.project_id = :datasetId"); try { SQLQuery query = this.getSession().createSQLQuery(sql.toString()); query.setParameter("datasetId", datasetId); BigInteger count = (BigInteger) query.uniqueResult(); return count.longValue(); } catch (HibernateException e) { this.logAndThrowException("Error at countStocksByDatasetId=" + datasetId + " query at ExperimentDao: " + e.getMessage(), e); } return 0; }
Source:
<code><START> private MessageHandler createDirectHandlerIfPossible(final Object targetObject, String targetMethodName) { <END> MessageHandler handler = null; if (targetObject instanceof MessageHandler && this.isHandleRequestMethod(targetMethodName)) { handler = new AbstractReplyProducingMessageHandler() { @Override protected Object handleRequestMessage(Message<?> requestMessage) { ((MessageHandler) targetObject).handleMessage(requestMessage); return null; } }; } return handler; }</code><technical_language>OK: returns instance of anonimus implementation of ARPMH</technical_language>

Target:
private MessageHandler createDirectHandlerIfPossible(final Object targetObject, String targetMethodName) { MessageHandler handler = null; if (targetObject instanceof MessageHandler && this.methodIsHandleMessageOrEmpty(targetMethodName)) { if (targetObject instanceof AbstractReplyProducingMessageHandler) { return (MessageHandler) targetObject; } handler = new AbstractReplyProducingMessageHandler() { @Override protected Object handleRequestMessage(Message<?> requestMessage) { ((MessageHandler) targetObject).handleMessage(requestMessage); return null; } }; } return handler; }
Source:
<code>public void testReplaceLabel() throws UnsupportedOperationException, Exception { PID pid = makePid(); String oldLabel = "old_work_label"; <START> Model fileModel = ModelFactory.createDefaultModel(); <END> fileModel.add(fileModel.createResource(pid.getRepositoryPath()), Ebucore.filename, oldLabel); Path file = createTempFile("test", "txt"); FileObject fileObj = repositoryObjectFactory.createFileObject(pid, fileModel); fileObj.addOriginalFile(file.toUri(), filename, mimetype, null, null); String newLabel = "new_work_filename"; MvcResult result = mvc.perform(put("/edit/filename/" + pid.getUUID()) .param("label", newLabel)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(pid.getUUID(), respMap.get("pid")); assertEquals("editLabel", respMap.get("action")); assertEquals(newLabel, fileObj.getOriginalFile().getModel().getRequiredProperty( fileObj.getOriginalFile().getResource(), Ebucore.filename).getLiteral().toString()); }</code><technical_language>filename set FileObject. ebucore:filename automatically generated binary passing filename parameter in addOriginalFile, remove model stuff for fileobj</technical_language>

Target:
public void testReplaceLabel() throws UnsupportedOperationException, Exception { PID pid = makePid(); Path file = createTempFile("test", "txt"); FileObject fileObj = repositoryObjectFactory.createFileObject(pid, null); fileObj.addOriginalFile(file.toUri(), filename, mimetype, null, null); String newLabel = "new_work_filename"; MvcResult result = mvc.perform(put("/edit/filename/" + pid.getUUID()) .param("label", newLabel)) .andExpect(status().is2xxSuccessful()) .andReturn(); Map<String, Object> respMap = getMapFromResponse(result); assertEquals(pid.getUUID(), respMap.get("pid")); assertEquals("editLabel", respMap.get("action")); assertEquals(newLabel, fileObj.getOriginalFile().getResource().getProperty(Ebucore.filename) .getLiteral().toString()); }
Source:
<code><START> public DeclarationGenerator(Options opts) { <END> this.opts = opts; }</code><technical_language>s/public//</technical_language>

Target:
DeclarationGenerator(Options opts) { this.opts = opts; }
Source:
<code>public void start() { <START> if (listenBacklog > 0) { <END> bootstrap.option(ChannelOption.SO_BACKLOG, listenBacklog); } LOG.info("binding to port {}", localAddress); parentChannel = bootstrap.bind(localAddress).syncUninterruptibly().channel(); localAddress = (InetSocketAddress) parentChannel.localAddress(); LOG.info("bound to port " + getLocalPort()); }</code><technical_language>difference, nice for this condition consistent NIO implementation. e.g. listenBacklog != -1 similar</technical_language>

Target:
public void start() { if (listenBacklog != -1) { bootstrap.option(ChannelOption.SO_BACKLOG, listenBacklog); } LOG.info("binding to port {}", localAddress); parentChannel = bootstrap.bind(localAddress).syncUninterruptibly().channel(); localAddress = (InetSocketAddress) parentChannel.localAddress(); LOG.info("bound to port " + getLocalPort()); }
Source:
<code>public String toString() { <START> return new StringBuilder("SyncInvocationStage{").append(rv).append('}').toString(); <END> }</code><technical_language>I prefer () a single multiple properties, a matter of personal taste</technical_language>

Target:
public String toString() { return new StringBuilder("SyncInvocationStage(").append(rv).append(')').toString(); }
Source:
<code>public CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot(PhysicalSlotRequest physicalSlotRequest) { <START> LOG.debug("Received a slot request {}.", physicalSlotRequest.getSlotRequestId()); <END> SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); SlotProfile slotProfile = physicalSlotRequest.getSlotProfile(); ResourceProfile resourceProfile = slotProfile.getPhysicalSlotResourceProfile(); LOG.debug("Received slot request with resource requirements: {}", slotRequestId, resourceProfile); Optional<PhysicalSlot> availablePhysicalSlot = tryAllocateFromAvailable(slotRequestId, slotProfile); CompletableFuture<PhysicalSlot> slotFuture; slotFuture = availablePhysicalSlot .map(CompletableFuture::completedFuture) .orElseGet(() -> requestNewSlot( slotRequestId, resourceProfile, physicalSlotRequest.willSlotBeOccupiedIndefinitely())); return slotFuture.thenApply(physicalSlot -> new PhysicalSlotRequest.Result(slotRequestId, physicalSlot)); }</code><technical_language>This log is redundant one</technical_language>

Target:
public CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot(PhysicalSlotRequest physicalSlotRequest) { SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); SlotProfile slotProfile = physicalSlotRequest.getSlotProfile(); ResourceProfile resourceProfile = slotProfile.getPhysicalSlotResourceProfile(); LOG.debug("Received slot request with resource requirements: {}", slotRequestId, resourceProfile); Optional<PhysicalSlot> availablePhysicalSlot = tryAllocateFromAvailable(slotRequestId, slotProfile); CompletableFuture<PhysicalSlot> slotFuture; slotFuture = availablePhysicalSlot .map(CompletableFuture::completedFuture) .orElseGet(() -> requestNewSlot( slotRequestId, resourceProfile, physicalSlotRequest.willSlotBeOccupiedIndefinitely())); return slotFuture.thenApply(physicalSlot -> new PhysicalSlotRequest.Result(slotRequestId, physicalSlot)); }
Source:
<code>public Response getXY(@PathParam(value = "name") String traceName, @PathParam(value = "providerId") String providerId, @QueryParam(value = "start") long start, @QueryParam(value = "end") long end, @QueryParam(value = "nb") @Min(1) int nb, @QueryParam(value = "ids") @NotNull Set<Long> ids) { TraceModel traceModel = traceManager.get(traceName); if (traceModel == null) { return Response.status(Status.NOT_FOUND).entity("No Such Trace").build(); } ITmfTreeXYDataProvider<@NonNull ITmfTreeDataModel> provider = manager.getDataProvider(traceModel.getTrace(), providerId, ITmfTreeXYDataProvider.class); if (provider == null) { return Response.status(Status.METHOD_NOT_ALLOWED).entity("Analysis cannot run").build(); } TmfModelResponse<@NonNull ITmfCommonXAxisModel> response = provider.fetchXY(new SelectionTimeQueryFilter(start, end, nb, ids), null); if (response.getStatus() == TmfModelResponse.Status.CANCELLED || response.getStatus() == TmfModelResponse.Status.FAILED) { return Response.serverError().entity(response.getStatusMessage()).build(); } return <START> Response.ok().entity(new XYView(traceModel, response.getModel())).build(); <END> }</code><technical_language>return ModelResponse directly</technical_language>

Target:
public Response getXY(@PathParam(value = "name") String traceName, @PathParam(value = "providerId") String providerId, @QueryParam(value = "start") long start, @QueryParam(value = "end") long end, @QueryParam(value = "nb") @Min(1) int nb, @QueryParam(value = "ids") @NotNull Set<Long> ids) { TraceModel traceModel = traceManager.get(traceName); if (traceModel == null) { return Response.status(Status.NOT_FOUND).entity("No Such Trace").build(); } ITmfTreeXYDataProvider<@NonNull ITmfTreeDataModel> provider = manager.getDataProvider(traceModel.getTrace(), providerId, ITmfTreeXYDataProvider.class); if (provider == null) { return Response.status(Status.METHOD_NOT_ALLOWED).entity("Analysis cannot run").build(); } TmfModelResponse<@NonNull ITmfCommonXAxisModel> response = provider.fetchXY(new SelectionTimeQueryFilter(start, end, nb, ids), null); return Response.ok().entity(new XYView(traceModel, response)).build(); }
Source:
<code>public Map<String, List<DataPointAssignmentDto>> listSomeOrAll( @RequestParam(value = "surveyAssignmentId", required = false) Long surveyAssignmentId, @RequestParam(value = "deviceId", required = false) Long deviceId ) { final HashMap<String, List<DataPointAssignmentDto>> response = new HashMap<String, List<DataPointAssignmentDto>>(); final List<DataPointAssignmentDto> results = new ArrayList<DataPointAssignmentDto>(); if (surveyAssignmentId != null) { for (DataPointAssignment dpa : dataPointAssignmentDao.listBySurveyAssignment(surveyAssignmentId)) { results.add(marshallToDto(dpa)); } } else if (deviceId != null) { for (DataPointAssignment dpa : dataPointAssignmentDao.listByDevice(deviceId)) { results.add(marshallToDto(dpa)); } } else { <START> for (DataPointAssignment dpa : dataPointAssignmentDao.list(Constants.ALL_RESULTS)) { <END> results.add(marshallToDto(dpa)); } } response.put("data_point_assignments", results); return response; }</code><technical_language>Do a case need list of them</technical_language>

Target:
public Map<String, List<DataPointAssignmentDto>> listSomeOrAll( @RequestParam(value = "surveyAssignmentId", required = false) Long surveyAssignmentId, @RequestParam(value = "deviceId", required = false) Long deviceId ) { final HashMap<String, List<DataPointAssignmentDto>> response = new HashMap<String, List<DataPointAssignmentDto>>(); final List<DataPointAssignmentDto> results = new ArrayList<DataPointAssignmentDto>(); if (deviceId != null && surveyAssignmentId != null) { for (DataPointAssignment dpa : dataPointAssignmentDao.listByDeviceAndSurveyAssignment(deviceId,surveyAssignmentId)) { results.add(marshallToDto(dpa)); } } else if (surveyAssignmentId != null) { for (DataPointAssignment dpa : dataPointAssignmentDao.listBySurveyAssignment(surveyAssignmentId)) { results.add(marshallToDto(dpa)); } } else if (deviceId != null) { for (DataPointAssignment dpa : dataPointAssignmentDao.listByDevice(deviceId)) { results.add(marshallToDto(dpa)); } } else { for (DataPointAssignment dpa : dataPointAssignmentDao.list(Constants.ALL_RESULTS)) { results.add(marshallToDto(dpa)); } } response.put("data_point_assignments", results); return response; }
Source:
<code>public void focus() { widgets_.forEach(widget -> { if (widget.isVisible()) { <START> widget.focus(); <END> } }); }</code><technical_language>this exit finding visible widget focused</technical_language>

Target:
public void focus() { widgets_.forEach(widget -> { if (widget.isVisible()) { widget.focus(); return; } }); }
Source:
<code>private boolean backupTable(String fileName, UUID uuid) throws IOException { FileOutputStream fileOutput = null; try { <START> fileOutput = new FileOutputStream(fileName); <END> } catch (FileNotFoundException e) { log.error("failed to create the temp file for table {}", fileName, uuid); return false; } StreamOptions options = StreamOptions.builder() .ignoreTrimmed(false) .cacheEntries(false) .build(); Stream<OpaqueEntry> stream = (new OpaqueStream(runtime, runtime.getStreamsView().get(uuid, options))).streamUpTo(timestamp); Iterator<OpaqueEntry> iterator = stream.iterator(); try { while (iterator.hasNext()) { OpaqueEntry lastEntry = iterator.next(); List<SMREntry> smrEntries = lastEntry.getEntries().get(uuid); if (smrEntries != null) { Map<UUID, List<SMREntry>> map = new HashMap<>(); map.put(uuid, smrEntries); OpaqueEntry newOpaqueEntry = new OpaqueEntry(lastEntry.getVersion(), map); OpaqueEntry.write(fileOutput, newOpaqueEntry); } } fileOutput.flush(); fileOutput.close(); } catch (IOException e) { log.error("failed to write the table to temp backup file {}", uuid, fileName); return false; } log.debug("{} table is backed up and stored to temp file {}", uuid, fileName); return true; }</code><technical_language>try-with-resources close in a finally block</technical_language>

Target:
private void backupTable(String fileName, UUID uuid) throws IOException { try (FileOutputStream fileOutput = new FileOutputStream(fileName)) { StreamOptions options = StreamOptions.builder() .ignoreTrimmed(false) .cacheEntries(false) .build(); Stream<OpaqueEntry> stream = (new OpaqueStream(runtime, runtime.getStreamsView().get(uuid, options))).streamUpTo(timestamp); writeTableToFile(fileOutput, stream, uuid); } catch (IOException e) { log.error("failed to back up table to file {}", uuid, fileName); throw e; } catch (TrimmedException e) { log.error("failed to back up tables as log was trimmed after back up starts."); throw e; } log.info("{} table is backed up and stored to temp file {}", uuid, fileName); }
Source:
<code>public static void main(String[] args) throws Exception { AbstractApplicationContext context = new AnnotationConfigApplicationContext(Launch.class.getPackage().getName()); ExampleService service = context.getBean(ExampleService.class); if(args.length == 1) { RecoveryManagerService recoveryManagerService = context.getBean(RecoveryManagerService.class); if(args[0].equals("-f")) { System.out.println("Generate something to recovery ..."); service.testRecovery(); } else if(args[0].equals("-r")) { System.out.println("start the recovery manager"); recoveryManagerService.create(); recoveryManagerService.start(); System.out.println("recovery manager scan ..."); recoveryManagerService.scan(); service.checkRecord(); recoveryManagerService.stop(); System.out.println("stop the recovery manager"); } } else { <START> try { <END> service.testRollback(); } catch (Exception e) { System.out.println("testRollback OK"); service.checkRecord(); } service.testCommit(); service.checkRecord(); try { service.testTimeout(); } catch (Exception e) { System.out.println("testTimeout OK"); service.checkRecord(); } } service.shutdownDatabase(); TxControl.disable(true); TransactionReaper.terminate(true); }</code><technical_language>I tempted remove testRollback testTimeout methods main example topic clear</technical_language>

Target:
public static void main(String[] args) throws Exception { AbstractApplicationContext context = new AnnotationConfigApplicationContext(Launch.class.getPackage().getName()); ExampleService service = context.getBean(ExampleService.class); if (args.length == 1) { RecoveryManagerService recoveryManagerService = context.getBean(RecoveryManagerService.class); if (args[0].equals("-f")) { System.out.println("Generate something to recovery ..."); service.testRecovery(); } else if (args[0].equals("-r")) { System.out.println("start the recovery manager"); recoveryManagerService.start(); System.out.println("recovery manager scan ..."); while (DummyXAResource.getCommitRequests() == 0) { Thread.sleep(1000); } System.out.println("stop the recovery manager"); recoveryManagerService.stop(); } else if (args[0].equals("-c")) { service.checkRecord(); } } else { service.testCommit(); service.checkRecord(); } service.shutdownDatabase(); TxControl.disable(true); TransactionReaper.terminate(true); }
Source:
<code>MetricConfigDTO generateMetricConfig(JsonNode payloadNode, String suffix) { MetricConfigDTO metricConfigDTO = new MetricConfigDTO(); <START> metricConfigDTO.setName(DEFAULT_METRIC_NAME); <END> metricConfigDTO.setDataset(DEFAULT_DATASET_NAME + suffix); metricConfigDTO.setAlias(ThirdEyeUtils .constructMetricAlias(DEFAULT_DATASET_NAME + suffix, DEFAULT_METRIC_NAME)); metricConfigDTO.setDatatype(MetricType.DOUBLE); metricConfigDTO.setDefaultAggFunction(MetricAggFunction.SUM); metricConfigDTO.setActive(true); if (payloadNode.has(METRIC_FIELD)) { Map<String, Object> metricYaml = ConfigUtils.getMap(yaml.load(payloadNode.get(METRIC_FIELD).textValue())); if (metricYaml.containsKey("metricColumn")) { metricConfigDTO.setName((String) metricYaml.get("metricColumn")); } if (metricYaml.containsKey("datatype")) { metricConfigDTO .setDatatype(MetricType.valueOf((String) metricYaml.get("datatype"))); } } metricConfigDAO.save(metricConfigDTO); LOG.info("Created metric with config {}", metricConfigDTO); return metricConfigDTO; }</code><technical_language>reason need hardcode this here</technical_language>

Target:
MetricConfigDTO generateMetricConfig(JsonNode payloadNode, String suffix) { MetricConfigDTO metricConfigDTO = new MetricConfigDTO(); metricConfigDTO.setName(DEFAULT_METRIC_NAME); metricConfigDTO.setDataset(DEFAULT_DATASET_NAME + suffix); metricConfigDTO.setAlias(ThirdEyeUtils .constructMetricAlias(DEFAULT_DATASET_NAME + suffix, DEFAULT_METRIC_NAME)); metricConfigDTO.setDatatype(MetricType.DOUBLE); metricConfigDTO.setDefaultAggFunction(MetricAggFunction.SUM); metricConfigDTO.setActive(true); if (payloadNode.has(METRIC_FIELD)) { updateMetricCustomFields(payloadNode, metricConfigDTO); } metricConfigDAO.save(metricConfigDTO); LOG.info("Created metric with config {}", metricConfigDTO); return metricConfigDTO; }
Source:
<code>private boolean isSelected(EditPart part) { boolean result; <START> result = part != null && part.getSelected() == EditPart.SELECTED_PRIMARY || part.getSelected() == EditPart.SELECTED; <END> return result; }</code><technical_language>Introducing a local variable for this is justified</technical_language>

Target:
private boolean isSelected(EditPart part) { return part != null && part.getSelected() == EditPart.SELECTED_PRIMARY || part.getSelected() == EditPart.SELECTED; }
Source:
<code>private byte[] draw(final List<String> infos) throws IOException { final BufferedImage img = ImageIO <START> .read(this.getClass().getResourceAsStream("/build_health.png")); <END> final BufferedImage image = new BufferedImage( img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_ARGB ); final Graphics2D gfx = image.createGraphics(); gfx.drawImage(img, 0, 0, null); gfx.setFont(new Font("Serif", Font.PLAIN, Tv.TEN)); this.drawString(gfx, infos); gfx.dispose(); final ByteArrayOutputStream stream = new ByteArrayOutputStream(); ImageIO.write(image, "png", stream); return stream.toByteArray(); }</code><technical_language>a good practice resource related some class in src/main/resources/com/rultor/web. In case get rid of this leading slash avoid collisions resources. If some other package resource build_health.png - is a high chance of collision. But, if resources prefixed package names, collisions avoided</technical_language>

Target:
private byte[] draw(final List<String> infos) throws IOException { final BufferedImage img = ImageIO.read( this.getClass().getResourceAsStream("build_health.png") ); final BufferedImage image = new BufferedImage( img.getWidth(), img.getHeight(), BufferedImage.TYPE_INT_ARGB ); final Graphics2D gfx = image.createGraphics(); gfx.drawImage(img, 0, 0, null); gfx.setFont(new Font("Serif", Font.PLAIN, Tv.TEN)); this.drawString(gfx, infos); gfx.dispose(); final ByteArrayOutputStream stream = new ByteArrayOutputStream(); ImageIO.write(image, "png", stream); return stream.toByteArray(); }
Source:
<code>public String getIconFilePath(String size) { <START> if (getIconFilePathPattern().isEmpty()) { <END> return getIconFilePathPattern().replace(":size", size); } return null; }</code><technical_language>bug: checking for null, this is (forgotten !). do of methods? I expect one, preferably size. if a derivative is in fact needed (by what?), final</technical_language>

Target:
public String getIconFilePath(String size) { if (!StringUtils.isBlank(getIconFilePathPattern())) { return getIconFilePathPattern().replace(":size", size); } return null; }
Source:
<code>private static void validatePage(String pageNumber, List<String> validationErrors) { <START> if (pageNumber!=null && Long.valueOf(pageNumber) < 1) { <END> validationErrors.add(PAGE); } }</code><technical_language>isNotBlank() better? - Long? for integer is enough. - Check safely if is a number</technical_language>

Target:
private static void validatePage(String pageNumber, List<String> validationErrors) { if (isNotBlank(pageNumber) && Integer.valueOf(pageNumber) < 1) { validationErrors.add(PAGE); } }
Source:
<code>public V get(Object key) { <START> InternalCacheEntry<K, V> ice = syncGet(key); <END> if (ice != null) { return ice.getValue(); } return null; }</code><technical_language>inline syncGet() in getCacheEntry() here</technical_language>

Target:
public V get(Object key) { InternalCacheEntry<K, V> ice = getCacheEntry(key); if (ice != null) { return ice.getValue(); } return null; }
Source:
<code>public RelationalInput generateNewCopy() throws InputGenerationException { try { <START> FileIterator iterator = new FileIterator(inputFile.getName()); <END> return iterator.setSeparator(this.separator) .setQuoteChar(this.quotechar) .setEscapeChar(this.escape) .setSkipLines(this.skipLines) .setStrictQuotes(this.strictQuotes) .setIgnoreLeadingWhiteSpace(this.ignoreLeadingWhiteSpace) .setHasHeader(this.hasHeader) .setSkipDifferingLines(this.skipDifferingLines) .setReader(new FileReader(inputFile)); } catch (FileNotFoundException e) { throw new InputGenerationException("File not found.", e.getCause()); } catch (InputIterationException e) { throw new InputGenerationException("Could not iterate over the first line of the csv file.", e.getCause()); } }</code><technical_language>new FileIterator(inputFile.getName(), this.settings);</technical_language>

Target:
public RelationalInput generateNewCopy() throws InputGenerationException { try { return new FileIterator(inputFile.getName(), new FileReader(inputFile), setting); } catch (FileNotFoundException e) { throw new InputGenerationException("File not found.", e.getCause()); } catch (InputIterationException e) { throw new InputGenerationException("Could not iterate over the first line of the csv file.", e.getCause()); } }
Source:
<code>@Override public void onNewToken(String token) { super.onNewToken(token); ((Application) getApplicationContext()).getPreferenceManager().setToken(token); CountlyPush.onTokenRefresh(token); <START> Log.i(TAG, "CountlyPush onNewToken " + token); } <END></code><technical_language>this Log.d</technical_language>

Target:
public void onNewToken(String token) { super.onNewToken(token); ((Application) getApplicationContext()).getPreferenceManager().setToken(token); CountlyPush.onTokenRefresh(token); }
Source:
<code>private List<EvalHierarchyRule> getAllByNodeID( Long nodeID ) { logIfDebugEnabled( "getAllByNodeID( " + nodeID + " )" ); Search searchObj = new Search(); searchObj.addRestriction( new Restriction( "nodeID", nodeID ) ); List<EvalHierarchyRule> rules = dao.findBySearch( EvalHierarchyRule.class, searchObj ); if( rules == null ) { <START> return Collections.EMPTY_LIST; <END> } else { return rules; } }</code><technical_language>Collections.emptyList() is preferred here, for generics support</technical_language>

Target:
private List<EvalHierarchyRule> getAllByNodeID( Long nodeID ) { if( LOG.isDebugEnabled() ) { LOG.debug( "getAllByNodeID( " + nodeID + " )" ); } Search searchObj = new Search(); searchObj.addRestriction( new Restriction( "nodeID", nodeID ) ); List<EvalHierarchyRule> rules = dao.findBySearch( EvalHierarchyRule.class, searchObj ); if( rules == null ) { return Collections.emptyList(); } else { return rules; } }
Source:
<code><START> protected boolean <END> containsFilterExpressionChange(final ResourceSetChangeEvent event) { List<Notification> notifications = event.getNotifications(); for (Notification current : notifications) { if (current.getNotifier() instanceof TreeFillingConfiguration) { return true; } } return false; }</code><technical_language>please private, remove @since 5.0</technical_language>

Target:
private boolean containsFilterExpressionChange(final ResourceSetChangeEvent event) { List<Notification> notifications = event.getNotifications(); for (Notification current : notifications) { if (current.getNotifier() instanceof TreeFillingConfiguration && current.getFeature() == NattableaxisconfigurationPackage.eINSTANCE.getTreeFillingConfiguration_FilterRule()) { return true; } } return false; }
Source:
<code>private String digestToString(byte[] computedDigest) { StringBuilder sb = new StringBuilder(); for (byte <START> aComputedDigest : <END> computedDigest) { String res = Integer.toHexString(aComputedDigest & 0xFF); sb.append(res.length() == 1 ? "0" : "").append(res); } return sb.toString(); }</code><technical_language>nit: naming: "b"</technical_language>

Target:
private String digestToString(byte[] computedDigest) { StringBuilder sb = new StringBuilder(); for (byte b : computedDigest) { sb.append(String.format(Locale.US, "%02x", b)); } return sb.toString(); }
Source:
<code><START> TmfXmlStateAttribute(Element attribute, XmlStateProvider provider) { <END> fProvider = provider; String type = attribute.getAttribute(TmfXmlStrings.TYPE); if (type.equals(TmfXmlStrings.TYPE_CONSTANT)) { fType = StateAttributeType.ATTRIBUTE_TYPE_CONSTANT; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); } else if (type.equals(TmfXmlStrings.EVENT_FIELD)) { fType = StateAttributeType.ATTRIBUTE_TYPE_EVENTFIELD; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); } else if (type.equals(TmfXmlStrings.TYPE_LOCATION)) { fType = StateAttributeType.ATTRIBUTE_TYPE_LOCATION; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); } else if (type.equals(TmfXmlStrings.TYPE_QUERY)) { List<Element> childElements = XmlUtils.getChildElements(attribute); for (Element subAttributeNode : childElements) { TmfXmlStateAttribute subAttribute = new TmfXmlStateAttribute(subAttributeNode, fProvider); fQueryList.add(subAttribute); } fType = StateAttributeType.ATTRIBUTE_TYPE_QUERY; fName = null; } else if (type.equals(TmfXmlStrings.NULL)) { fType = StateAttributeType.ATTRIBUTE_TYPE_NONE; fName = null; } else { throw new IllegalArgumentException("TmfXmlStateAttribute constructor: The XML element is not of the right type"); } }</code><technical_language>reason this is public? "default" visibility is bad design in general... This is in internal package, part of API. public visibility allows in tests</technical_language>

Target:
public TmfXmlStateAttribute(Element attribute, XmlStateProvider provider) { fProvider = provider; switch (attribute.getAttribute(TmfXmlStrings.TYPE)) { case TmfXmlStrings.TYPE_CONSTANT: fType = StateAttributeType.CONSTANT; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); break; case TmfXmlStrings.EVENT_FIELD: fType = StateAttributeType.EVENTFIELD; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); break; case TmfXmlStrings.TYPE_LOCATION: fType = StateAttributeType.LOCATION; fName = fProvider.getAttributeValue(attribute.getAttribute(TmfXmlStrings.VALUE)); break; case TmfXmlStrings.TYPE_QUERY: List<Element> childElements = XmlUtils.getChildElements(attribute); for (Element subAttributeNode : childElements) { TmfXmlStateAttribute subAttribute = new TmfXmlStateAttribute(subAttributeNode, fProvider); fQueryList.add(subAttribute); } fType = StateAttributeType.QUERY; fName = null; break; case TmfXmlStrings.NULL: fType = StateAttributeType.NONE; fName = null; break; default: throw new IllegalArgumentException("TmfXmlStateAttribute constructor: The XML element is not of the right type"); } }
Source:
<code>public void onLoad(MatrixRun run){ ParametersAction action = run.getParentBuild().getAction(ParametersAction.class); if(action!=null){ parameters = new ArrayList<ParameterValue>(action.getParameters()); } else{ <START> parameters = Collections.EMPTY_LIST; <END> } }</code><technical_language>Collection.emptyList() is type-safe</technical_language>

Target:
public void onLoad(MatrixRun run){ ParametersAction action = run.getParentBuild().getAction(ParametersAction.class); if (action != null){ parameters = new ArrayList<ParameterValue>(action.getParameters()); } else{ parameters = Collections.emptyList(); } }
Source:
<code>public void execute(Environment environment, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { if (params.get("date") == null) { throw new TemplateModelException("date parameter is required"); } String jsonDate = params.get("date").toString(); if (params.get("format") == null) { throw new TemplateModelException("format parameter is required"); } DateTimeFormatter format = DateTimeFormatter.ofPattern(params.get("format").toString()); String formattedDate = (jsonDate.length() <= 10) ? LocalDate.parse(jsonDate).format(format) <START> : ZonedDateTime.parse(jsonDate).format(format); END> environment.getOut().write(formattedDate); }</code><technical_language>Hmm. OffsetDateTime for a reason; this is break things. If need support "Zulu time" format, I suppose falls umbrella (jsonDate.length() <= 10) above: need custom code parse detect 'Z' support formats. is a code smell indicating declare format expect (by calling individual directives perhaps). skeptical "if", however. Is this consuming a date Rhino? If so, is reason for Rhino print dates inconsistently OffsetDateTime worked before. Based <LINK_0>, is is naively serialized calling toString a bug a 'Z'-format time string</technical_language>

Target:
public void execute(Environment environment, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException { if (params.get("date") == null) { throw new TemplateModelException("date parameter is required"); } String jsonDate = params.get("date").toString(); if (params.get("format") == null) { throw new TemplateModelException("format parameter is required"); } DateTimeFormatter format = DateTimeFormatter.ofPattern(params.get("format").toString()); String formattedDate = (jsonDate.length() <= 10) ? LocalDate.parse(jsonDate).format(format) : Instant.parse(jsonDate).atZone(GMT).format(format); environment.getOut().write(formattedDate); }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartErrorEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, getStartEventType()); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertErrorEventExecutionSet(emptyTop.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, ""); <END> assertDataIOSet(emptyTop.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertErrorEventExecutionSet(emptyTop.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartErrorEvent emptyTop = getStartNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, getStartEventType()); assertGeneralSet(emptyTop.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertErrorEventExecutionSet(emptyTop.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE); assertDataIOSet(emptyTop.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>private void updateStates(Stack stack, Collection<InstanceMetaData> failedInstances, Set<String> newFailedNodeNames, Set<String> newHealtyHostNames, boolean hostCertExpiring) { clusterService.updateClusterCertExpirationState(stack.getCluster(), hostCertExpiring); clusterOperationService.reportHealthChange(stack.getResourceCrn(), newFailedNodeNames, newHealtyHostNames); if (!failedInstances.isEmpty()) { clusterService.updateClusterStatusByStackId(stack.getId(), Status.AMBIGUOUS); <START> } else if (statesFromAvailabeAllowed().contains(stack.getCluster().getStatus())) { <END> clusterService.updateClusterStatusByStackId(stack.getId(), Status.AVAILABLE); } }</code><technical_language>please add a log lines here</technical_language>

Target:
private void updateStates(Stack stack, Collection<InstanceMetaData> failedInstances, Set<String> newFailedNodeNames, Set<String> newHealtyHostNames, boolean hostCertExpiring) { LOGGER.info("Updating status: Failed instances: New failed node names: New healthy host name: Host cert expiring: {}", failedInstances, newFailedNodeNames, newHealtyHostNames, hostCertExpiring); clusterService.updateClusterCertExpirationState(stack.getCluster(), hostCertExpiring); clusterOperationService.reportHealthChange(stack.getResourceCrn(), newFailedNodeNames, newHealtyHostNames); if (!failedInstances.isEmpty()) { clusterService.updateClusterStatusByStackId(stack.getId(), Status.AMBIGUOUS); } else if (statesFromAvailabeAllowed().contains(stack.getCluster().getStatus())) { clusterService.updateClusterStatusByStackId(stack.getId(), Status.AVAILABLE); } }