auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void start() { PathHandler pathHandler = Handlers.path().addExactPath("/", this); AllowedMethodsHandler allowedMethodsHandler = new AllowedMethodsHandler(pathHandler, Methods.GET); gracefulShutdownHandler = Handlers.gracefulShutdown(allowedMethodsHandler); <START> server = Undertow.builder() <END> .addHttpListener(0, "localhost") .setHandler(gracefulShutdownHandler).build(); server.start(); }</code><technical_language>set a single IO/Worker thread follows: .setIoThreads(1) .setWorkerThreads(1)</technical_language>

Target:
public void start() { PathHandler pathHandler = Handlers.path().addExactPath("/", this); AllowedMethodsHandler allowedMethodsHandler = new AllowedMethodsHandler(pathHandler, Methods.GET); gracefulShutdownHandler = Handlers.gracefulShutdown(allowedMethodsHandler); server = Undertow.builder() .setIoThreads(1) .setWorkerThreads(1) .addHttpListener(0, "localhost") .setHandler(gracefulShutdownHandler) .build(); server.start(); }
Source:
<code>protected IStatus validate() { final Boolean unixSocketBindingMode = (Boolean) this.unixSocketBindingModeModelObservable .getValue(); final String unixSocketPath = (String) this.unixSocketPathModelObservable .getValue(); if (unixSocketBindingMode) { if (unixSocketPath == null || unixSocketPath.isEmpty()) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.missingUnixSocket.msg")); } try { final URI unixSocketURI = new URI(unixSocketPath); if (unixSocketURI.getScheme() != null && !unixSocketURI.getScheme().equals("unix")) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketScheme.msg")); } if (unixSocketURI.getPath() != null) { final File unixSocket = new File( unixSocketURI.getPath()); if (!unixSocket.exists()) { return ValidationStatus .error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } else if <START> (!unixSocket.canRead() <END> || !unixSocket.canRead()) { return ValidationStatus .error(WizardMessages.getString( "NewDockerConnectionPage.validation.unreadableUnixSocket.msg")); } } else { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } } catch (URISyntaxException e) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } } return ValidationStatus.ok(); }</code><technical_language>This '!unixSocket.canRead()'</technical_language>

Target:
protected IStatus validate() { final Boolean unixSocketBindingMode = (Boolean) this.unixSocketBindingModeModelObservable .getValue(); final String unixSocketPath = (String) this.unixSocketPathModelObservable .getValue(); if (unixSocketBindingMode) { if (unixSocketPath == null || unixSocketPath.isEmpty()) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.missingUnixSocket.msg")); } try { final URI unixSocketURI = new URI(unixSocketPath); if (unixSocketURI.getScheme() != null && !unixSocketURI.getScheme().equals("unix")) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketScheme.msg")); } if (unixSocketURI.getPath() != null) { final File unixSocket = new File( unixSocketURI.getPath()); if (!unixSocket.exists()) { return ValidationStatus .error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } else if (!unixSocket.canRead() || !unixSocket.canWrite()) { return ValidationStatus .error(WizardMessages.getString( "NewDockerConnectionPage.validation.unreadableUnixSocket.msg")); } } else { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } } catch (URISyntaxException e) { return ValidationStatus.error(WizardMessages.getString( "NewDockerConnectionPage.validation.invalidUnixSocketPath.msg")); } } return ValidationStatus.ok(); }
Source:
<code>private CompletionStage<RestResponse> getInfo(RestRequest request) { <START> NettyRestResponse.Builder responseBuilder = checkCacheManager(request); <END> if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); CacheManagerInfo cacheManagerInfo = Security.doAs(request.getSubject(), (PrivilegedAction<CacheManagerInfo>) () -> cacheManager.getCacheManagerInfo()); try { byte[] bytes = objectMapper.writeValueAsBytes(cacheManagerInfo); responseBuilder.contentType(APPLICATION_JSON) .entity(bytes) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }</code><technical_language>suggestion cacheManager::getCacheManagerInfo);</technical_language>

Target:
private CompletionStage<RestResponse> getInfo(RestRequest request) { NettyRestResponse.Builder responseBuilder = checkCacheManager(request); if (responseBuilder.getHttpStatus() == NOT_FOUND) return completedFuture(responseBuilder.build()); try { byte[] bytes = objectMapper.writeValueAsBytes(cacheManager.getCacheManagerInfo()); responseBuilder.contentType(APPLICATION_JSON) .entity(bytes) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return completedFuture(responseBuilder.build()); }
Source:
<code>public void put(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { Patient patient = Context.getPatientService().getPatientByUuid(parentUniqueId); if (patient == null) { throw new ObjectNotFoundException(); } if (post.size() != 0) { <START> throw new ObjectNotFoundException(); <END> } Allergies allergies = Context.getPatientService().getAllergies(patient); if (allergies.size() != 0) { throw new ObjectNotFoundException(); } allergies.confirmNoKnownAllergies(); Context.getPatientService().setAllergies(patient, allergies); }</code><technical_language>this ObjectNotFoundException? operation allowed exception some sort of message</technical_language>

Target:
public void put(String parentUniqueId, SimpleObject post, RequestContext context) throws ResponseException { Patient patient = Context.getPatientService().getPatientByUuid(parentUniqueId); if (patient == null) { throw new ObjectNotFoundException(); } if (post.size() != 0) { throw new ResourceDoesNotSupportOperationException(); } Allergies allergies = Context.getPatientService().getAllergies(patient); if (allergies.size() != 0) { throw new ResourceDoesNotSupportOperationException(); } allergies.confirmNoKnownAllergies(); Context.getPatientService().setAllergies(patient, allergies); }
Source:
<code>private void startAMQPServer() throws ConfigurationException { boolean isServerStarted = false; int port; if (brokerService.getIfSSLOnly()) { port = brokerService.getAMQPSSLPort(); } else { port = brokerService.getAMQPPort(); } if (AndesConfigurationManager.<Boolean>readValue(AndesConfiguration.TRANSPORTS_AMQP_ENABLED)) { while (!isServerStarted) { Socket socket = null; try { InetAddress address = InetAddress.getByName(getAMQPTransportBindAddress()); socket = new Socket(address, port); log.info("AMQP Host Address : " + address.getHostAddress() + " Port : " + port); isServerStarted = socket.isConnected(); if (isServerStarted) { log.info("Successfully connected to AMQP server " + "on port " + port); } } catch (IOException e) { log.error("Wait until Qpid server starts on port " + port, e); try { Thread.sleep(500); } catch (InterruptedException ignore) { } } finally { try { if ((socket != null) && (socket.isConnected())) { socket.close(); } } catch (IOException e) { <START> log.error("Can not close the socket which is used to check the server " + "status ", e); <END> } } } } else { log.warn("AMQP Transport is disabled as per configuration."); } }</code><technical_language>do break string ? a string</technical_language>

Target:
private void startAMQPServer() throws ConfigurationException { boolean isServerStarted = false; int port; if (brokerService.getIfSSLOnly()) { port = brokerService.getAMQPSSLPort(); } else { port = brokerService.getAMQPPort(); } if (AndesConfigurationManager.<Boolean>readValue(AndesConfiguration.TRANSPORTS_AMQP_ENABLED)) { while (!isServerStarted) { Socket socket = null; try { InetAddress address = InetAddress.getByName(getAMQPTransportBindAddress()); socket = new Socket(address, port); log.info("AMQP Host Address : " + address.getHostAddress() + " Port : " + port); isServerStarted = socket.isConnected(); if (isServerStarted) { log.info("Successfully connected to AMQP server " + "on port " + port); } } catch (IOException e) { log.error("Wait until Qpid server starts on port " + port, e); try { Thread.sleep(500); } catch (InterruptedException ignore) { } } finally { try { if ((socket != null) && (socket.isConnected())) { socket.close(); } } catch (IOException e) { log.error("Can not close the socket which is used to check the server status ", e); } } } } else { log.warn("AMQP Transport is disabled as per configuration."); } }
Source:
<code>public void handle(Patient patient, User originalVoidingUser, Date origParentVoidedDate, String unused) { if (patient.getId() != null) { EncounterService es = Context.getEncounterService(); EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder() .setPatient(patient) .setIncludeVoided(true) .createEncounterSearchCriteria(); List<Encounter> encounters = es.getEncounters(encounterSearchCriteria); if (CollectionUtils.isNotEmpty(encounters)) { for (Encounter encounter : encounters) { if (encounter.isVoided() && encounter.getDateVoided().equals(origParentVoidedDate) && encounter.getVoidedBy().equals(originalVoidingUser)) { es.unvoidEncounter(encounter); } } } OrderService os = Context.getOrderService(); List<Order> orders = os.getAllOrdersByPatient(patient); if (CollectionUtils.isNotEmpty(orders)) { for (Order order : orders) { if (order.isVoided() && order.getDateVoided().equals(origParentVoidedDate) && order.getVoidedBy().equals(originalVoidingUser)) { os.unvoidOrder(order); } } } if (!patient.getVoided()) { CohortService cs = Context.getCohortService(); <START> cs.patientVoided(patient); <END> } } }</code><technical_language>This is incorrect, unvoid handler unvoid memberships of patient endDate matches patient's dateVoided</technical_language>

Target:
public void handle(Patient patient, User originalVoidingUser, Date origParentVoidedDate, String unused) { if (patient.getId() != null) { EncounterService es = Context.getEncounterService(); EncounterSearchCriteria encounterSearchCriteria = new EncounterSearchCriteriaBuilder() .setPatient(patient) .setIncludeVoided(true) .createEncounterSearchCriteria(); List<Encounter> encounters = es.getEncounters(encounterSearchCriteria); if (CollectionUtils.isNotEmpty(encounters)) { for (Encounter encounter : encounters) { if (encounter.isVoided() && encounter.getDateVoided().equals(origParentVoidedDate) && encounter.getVoidedBy().equals(originalVoidingUser)) { es.unvoidEncounter(encounter); } } } OrderService os = Context.getOrderService(); List<Order> orders = os.getAllOrdersByPatient(patient); if (CollectionUtils.isNotEmpty(orders)) { for (Order order : orders) { if (order.isVoided() && order.getDateVoided().equals(origParentVoidedDate) && order.getVoidedBy().equals(originalVoidingUser)) { os.unvoidOrder(order); } } } CohortService cs = Context.getCohortService(); cs.patientUnvoided(patient, patient.getVoidedBy(), patient.getDateVoided(), patient.getVoidReason()); } }
Source:
<code>private OBrowsePage nextPage(int clusterId, long lastPosition) { try { checkOpenness(); stateLock.acquireReadLock(); try { checkOpenness(); final OCluster cluster = doGetAndCheckCluster(clusterId); <START> OPhysicalPosition[] nexts = cluster.higherPositions(new OPhysicalPosition(lastPosition)); <END> if (nexts.length > 0) { lastPosition = nexts[nexts.length - 1].clusterPosition; List<OBrowsePage.OBrowseEntry> nexv = new ArrayList<>(); for (OPhysicalPosition pos : nexts) { final ORawBuffer buff = cluster.readRecord(pos.clusterPosition, false); nexv.add(new OBrowsePage.OBrowseEntry(pos.clusterPosition, buff)); } return new OBrowsePage(nexv, lastPosition); } else { return null; } } finally { stateLock.releaseReadLock(); } } catch (RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (Error ee) { throw logAndPrepareForRethrow(ee); } catch (Throwable t) { throw logAndPrepareForRethrow(t); } }</code><technical_language>higherPositions call, means passed in position, omitted lastPosition's default equal 0. call of next method, record position 0 read. change default -1 explain is case</technical_language>

Target:
private OClusterBrowsePage nextPage(int clusterId, long lastPosition) { try { checkOpenness(); stateLock.acquireReadLock(); try { checkOpenness(); final OCluster cluster = doGetAndCheckCluster(clusterId); OPhysicalPosition[] nextPositions = cluster.higherPositions(new OPhysicalPosition(lastPosition)); if (nextPositions.length > 0) { long newLastPosition = nextPositions[nextPositions.length - 1].clusterPosition; List<OClusterBrowseEntry> nexv = new ArrayList<>(); for (OPhysicalPosition pos : nextPositions) { final ORawBuffer buff = cluster.readRecord(pos.clusterPosition, false); nexv.add(new OClusterBrowseEntry(pos.clusterPosition, buff)); } return new OClusterBrowsePage(nexv, newLastPosition); } else { return null; } } finally { stateLock.releaseReadLock(); } } catch (RuntimeException ee) { throw logAndPrepareForRethrow(ee); } catch (Error ee) { throw logAndPrepareForRethrow(ee); } catch (Throwable t) { throw logAndPrepareForRethrow(t); } }
Source:
<code>private Map<String, String> covertRichUserToSubject(RichUser richUser) throws InternalErrorException { Map<String,String> richUserInMap = new HashMap<String,String>(); String mapping = getAttributes().get("xmlMapping"); String[] mappingArray = mapping.split(",\n"); String login = ""; for(UserExtSource ues: richUser.getUserExtSources()) { if(ues.getExtSource() != null && ues.getExtSource().getName().equals(extSourceNameForLogin)) { login = ues.getLogin(); break; } } <START> if(login == null) throw new InternalErrorException("Login can't be null."); <END> for(int i=0; i<mappingArray.length; i++) { String attr = mappingArray[i].trim(); int index = attr.indexOf("="); if(index <= 0) throw new InternalErrorException("There is no text in xmlMapping attribute or there is no '=' character."); String name = attr.substring(0, index); String value = attr.substring(index +1); Matcher attributeMatcher = attributePattern.matcher(value); if (attributeMatcher.find()) { if(attributeMatcher.group(1).equals("login")) { value = attributeMatcher.replaceFirst(login); } else { String replacement = lookingForValueInRichUserAttributes(attributeMatcher.group(1), richUser); if(replacement != null) { value = attributeMatcher.replaceFirst(replacement); } else { value = attributeMatcher.replaceFirst(""); } if(value.isEmpty()) value = null; } } else if (value.startsWith("urn:perun:")) { value = lookingForValueInRichUserAttributes(value, richUser); } richUserInMap.put(name.trim(), value); } return richUserInMap; }</code><technical_language>handy log related richUser well. debug if this error occurs</technical_language>

Target:
private Map<String, String> covertRichUserToSubject(RichUser richUser) throws InternalErrorException { Map<String,String> richUserInMap = new HashMap<String,String>(); String mapping = getAttributes().get("xmlMapping"); String[] mappingArray = mapping.split(",\n"); String login = ""; for(UserExtSource ues: richUser.getUserExtSources()) { if(ues.getExtSource() != null && ues.getExtSource().getName().equals(extSourceNameForLogin)) { login = ues.getLogin(); break; } } if(login == null) throw new InternalErrorException("There is missing login for user " + richUser + " and extSource " + extSourceNameForLogin); for(int i=0; i<mappingArray.length; i++) { String attr = mappingArray[i].trim(); int index = attr.indexOf("="); if(index <= 0) throw new InternalErrorException("There is no text in xmlMapping attribute or there is no '=' character."); String name = attr.substring(0, index); String value = attr.substring(index +1); Matcher attributeMatcher = attributePattern.matcher(value); if (attributeMatcher.find()) { if(attributeMatcher.group(1).equals("login")) { value = attributeMatcher.replaceFirst(login); } else { String replacement = lookingForValueInRichUserAttributes(attributeMatcher.group(1), richUser); if(replacement == null) replacement = ""; value = attributeMatcher.replaceFirst(replacement); if(value.isEmpty()) value = null; } } else if (value.startsWith("urn:perun:")) { value = lookingForValueInRichUserAttributes(value, richUser); } richUserInMap.put(name.trim(), value); } return richUserInMap; }
Source:
<code>protected void channelRead0(ChannelHandlerContext ctx, Http2Frame frame) throws Exception { ReferenceCountUtil.retain(frame); RequestInfo requestInfo = ctx.channel().attr(Http2NetworkClient.REQUEST_INFO).get(); requestInfo.responseFramesCount++; if (frame instanceof Http2HeadersFrame) { requestInfo.setStreamHeaderFrameReceiveTime(System.currentTimeMillis()); http2NetworkClient.getHttp2ClientMetrics().http2StreamRoundTripTime.update( System.currentTimeMillis() - requestInfo.getStreamSendTime()); <START> logger.debug("Header Frame received. Request: {}", requestInfo.toString()); <END> } else if (frame instanceof Http2DataFrame) { logger.debug("Data Frame size: {}. Request: {}", ((Http2DataFrame) frame).content().readableBytes(), requestInfo.toString()); } if (frame instanceof Http2DataFrame && ((Http2DataFrame) frame).isEndStream()) { long time = System.currentTimeMillis() - requestInfo.getStreamHeaderFrameReceiveTime(); http2NetworkClient.getHttp2ClientMetrics().http2StreamFirstToLastFrameTime.update(time); http2NetworkClient.getHttp2ClientMetrics().http2ResponseFrameCount.update(requestInfo.responseFramesCount); logger.debug("All Frame received. Time: {}ms. Request: {}", time, requestInfo.toString()); } ctx.fireChannelRead(frame); }</code><technical_language>I suggest passing requestInfo requestInfo.toString() this logger calls. avoid string concatenation debug logging is enabled method calls a bit verbose</technical_language>

Target:
protected void channelRead0(ChannelHandlerContext ctx, Http2Frame frame) throws Exception { ReferenceCountUtil.retain(frame); RequestInfo requestInfo = ctx.channel().attr(Http2NetworkClient.REQUEST_INFO).get(); requestInfo.responseFramesCount++; if (frame instanceof Http2HeadersFrame) { requestInfo.setStreamHeaderFrameReceiveTime(System.currentTimeMillis()); http2NetworkClient.getHttp2ClientMetrics().http2StreamRoundTripTime.update( System.currentTimeMillis() - requestInfo.getStreamSendTime()); logger.debug("Header Frame received. Request: {}", requestInfo); } else if (frame instanceof Http2DataFrame) { logger.debug("Data Frame size: {}. Request: {}", ((Http2DataFrame) frame).content().readableBytes(), requestInfo); } if (frame instanceof Http2DataFrame && ((Http2DataFrame) frame).isEndStream()) { long time = System.currentTimeMillis() - requestInfo.getStreamHeaderFrameReceiveTime(); http2NetworkClient.getHttp2ClientMetrics().http2StreamFirstToLastFrameTime.update(time); http2NetworkClient.getHttp2ClientMetrics().http2ResponseFrameCount.update(requestInfo.responseFramesCount); logger.debug("All Frame received. Time: {}ms. Request: {}", time, requestInfo); } ctx.fireChannelRead(frame); }
Source:
<code>public static String generateName(String desiredName, List<String> existingNames) { String availableName = desiredName; if (existingNames.contains(desiredName)) { List<String> existingSuffixes = existingNames.stream() .filter(existing -> existing.startsWith(desiredName) && !existing.equalsIgnoreCase(desiredName)) .map(existing -> existing.substring(existing.indexOf(desiredName, 0) + desiredName.length())) .collect(Collectors.toList()); int index = 1; while (existingSuffixes.contains(Integer.toString(index))) { index++; } availableName = desiredName + Integer.toString(index); } <START> return availableName; <END> }</code><technical_language>put other, easier case first, get out of quickly</technical_language>

Target:
public static String generateName(String desiredName, List<String> existingNames) { String availableName = desiredName; if (!existingNames.contains(desiredName)) { return availableName; } List<String> existingSuffixes = existingNames.stream() .filter(existing -> existing.startsWith(desiredName) && !existing.equalsIgnoreCase(desiredName)) .map(existing -> existing.substring(existing.indexOf(desiredName, 0) + desiredName.length())) .collect(Collectors.toList()); int index = 1; while (existingSuffixes.contains(Integer.toString(index))) { index++; } availableName = desiredName + Integer.toString(index); return availableName; }
Source:
<code>public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context) { Assert.notNull(context, "context cannot be null"); ClientRegistration clientRegistration = context.getClientRegistration(); OAuth2AuthorizedClient authorizedClient = context.getAuthorizedClient(); <START> if (!AuthorizationGrantType.CLIENT_CREDENTIALS.equals(clientRegistration.getAuthorizationGrantType()) || <END> (authorizedClient != null && !hasTokenExpired(authorizedClient.getAccessToken()))) { return null; } OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest = new OAuth2ClientCredentialsGrantRequest(clientRegistration); OAuth2AccessTokenResponse tokenResponse = this.accessTokenResponseClient.getTokenResponse(clientCredentialsGrantRequest); return new OAuth2AuthorizedClient(clientRegistration, context.getPrincipal().getName(), tokenResponse.getAccessToken()); }</code><technical_language>is a lot happening here. nice break this multiple statements improve readability. this: java ClientRegistration clientRegistration = context.getClientRegistration(); boolean isClientCredentials = AuthorizationGrantType.CLIENT_CREDENTIALS .equals(clientRegistration.getAuthorizationGrantType()); if (!isClientCredentials) { return null; } OAuth2AuthorizedClient authorizedClient = context.getAuthorizedClient(); if (!shouldRequestToken(authorizedClient)) { return null; }</technical_language>

Target:
public OAuth2AuthorizedClient authorize(OAuth2AuthorizationContext context) { Assert.notNull(context, "context cannot be null"); ClientRegistration clientRegistration = context.getClientRegistration(); if (!AuthorizationGrantType.CLIENT_CREDENTIALS.equals(clientRegistration.getAuthorizationGrantType())) { return null; } OAuth2AuthorizedClient authorizedClient = context.getAuthorizedClient(); if (authorizedClient != null && !hasTokenExpired(authorizedClient.getAccessToken())) { return null; } OAuth2ClientCredentialsGrantRequest clientCredentialsGrantRequest = new OAuth2ClientCredentialsGrantRequest(clientRegistration); OAuth2AccessTokenResponse tokenResponse = this.accessTokenResponseClient.getTokenResponse(clientCredentialsGrantRequest); return new OAuth2AuthorizedClient(clientRegistration, context.getPrincipal().getName(), tokenResponse.getAccessToken()); }
Source:
<code>@Override public boolean moveNext() { if (!isInitialized) { isInitialized = true; return enumerator.moveNext(); } else { <START> return curAccumulator != null; <END> } }</code><technical_language>for a key null? Do need add a check for that</technical_language>

Target:
@Override public boolean moveNext() { if (!isInitialized) { isInitialized = true; if (!enumerator.moveNext()) { isLastMoveNextFalse = true; return false; } } else if (curAccumulator == null) { isLastMoveNextFalse = true; return false; } if (curAccumulator == null) { curAccumulator = accumulatorInitializer.apply(); } curResult = null; TSource o = enumerator.current(); TKey prevKey = keySelector.apply(o); curAccumulator = accumulatorAdder.apply(curAccumulator, o); while (enumerator.moveNext()) { o = enumerator.current(); TKey curKey = keySelector.apply(o); if (comparator.compare(prevKey, curKey) != 0) { curResult = resultSelector.apply(prevKey, curAccumulator); curAccumulator = accumulatorInitializer.apply(); break; } curAccumulator = accumulatorAdder.apply(curAccumulator, o); prevKey = curKey; } if (curResult == null) { curResult = resultSelector.apply(prevKey, curAccumulator); curAccumulator = null; } return true; }
Source:
<code>public void onClick(View view) { if (eventListener != null && batchSelected.isEmpty() && messageRecord.isMms() && !((MmsMessageRecord) messageRecord).getSharedContacts().isEmpty()) { <START> eventListener.onSharedContactDetailsClicked(((SharedContactView) view).getContact(), ((SharedContactView) view).getAvatarView()); <END> } else { passthroughClickListener.onClick(view); } }</code><technical_language>this need change</technical_language>

Target:
public void onClick(View view) { if (eventListener != null && batchSelected.isEmpty() && messageRecord.isMms() && !((MmsMessageRecord) messageRecord).getSharedContacts().isEmpty()) { eventListener.onSharedContactDetailsClicked(((MmsMessageRecord) messageRecord).getSharedContacts().get(0), sharedContactStub.get().getAvatarView()); } else { passthroughClickListener.onClick(view); } }
Source:
<code>public void test_contains_Currency() { CurrencyPair test = CurrencyPair.of(GBP, USD); assertEquals(test.contains(GBP), true); assertEquals(test.contains(USD), true); assertEquals(test.contains(EUR), false); <START> } <END></code><technical_language>contains(null) case</technical_language>

Target:
public void test_contains_Currency() { CurrencyPair test = CurrencyPair.of(GBP, USD); assertEquals(test.contains(GBP), true); assertEquals(test.contains(USD), true); assertEquals(test.contains(EUR), false); assertEquals(test.contains(null), false); }
Source:
<code>private int lockAndUnlockAndCountExceptions(List<LockService> lockServices, int numRequestsPerClient) throws Exception { ExecutorService executorService = Executors.newFixedThreadPool(lockServices.size() * numRequestsPerClient); Map<LockService, LockRefreshToken> tokenMap = new HashMap<>(); for (LockService service : lockServices) { LockRefreshToken token = service.lock(CLIENT_1, REQUEST_LOCK_WITH_LONG_TIMEOUT); assertNotNull(token); tokenMap.put(service, token); } List<Future<LockRefreshToken>> futures = Lists.newArrayList(); for (LockService lockService : lockServices) { for (int i = 0; i < numRequestsPerClient; i++) { int currentTrial = i; futures.add(executorService.submit(() -> lockService.lock(CLIENT_2 + String.valueOf(currentTrial), REQUEST_LOCK_WITH_LONG_TIMEOUT)) ); } } executorService.shutdown(); executorService.awaitTermination(2, TimeUnit.SECONDS); AtomicInteger exceptionCounter = new AtomicInteger(0); futures.forEach(future -> { try { LockRefreshToken test = future.get(); <START> assertNull(test); <END> } catch (ExecutionException e) { Throwable cause = e.getCause(); assertThat(cause.getClass().getName()).contains("RetryableException"); assertRemoteExceptionWithStatus(cause.getCause(), HttpStatus.TOO_MANY_REQUESTS_429); exceptionCounter.getAndIncrement(); } catch (InterruptedException e) { throw Throwables.propagate(e); } }); tokenMap.forEach((service, token) -> assertTrue(service.unlock(token))); return exceptionCounter.get(); }</code><technical_language>assertThat(test).isNull() 2 instances of assertNull assertTrue assertNotNull, assertj-ize</technical_language>

Target:
private int lockAndUnlockAndCountExceptions(List<LockService> lockServices, int numRequestsPerClient) throws Exception { ExecutorService executorService = Executors.newFixedThreadPool(lockServices.size() * numRequestsPerClient); Map<LockService, LockRefreshToken> tokenMap = new HashMap<>(); for (LockService service : lockServices) { LockRefreshToken token = service.lock(CLIENT_1, REQUEST_LOCK_WITH_LONG_TIMEOUT); assertThat(token).isNotNull(); tokenMap.put(service, token); } List<Future<LockRefreshToken>> futures = Lists.newArrayList(); for (LockService lockService : lockServices) { for (int i = 0; i < numRequestsPerClient; i++) { int currentTrial = i; futures.add(executorService.submit(() -> lockService.lock(CLIENT_2 + String.valueOf(currentTrial), REQUEST_LOCK_WITH_LONG_TIMEOUT)) ); } } executorService.shutdown(); executorService.awaitTermination(2, TimeUnit.SECONDS); AtomicInteger exceptionCounter = new AtomicInteger(0); futures.forEach(future -> { try { assertThat(future.get()).isNull(); } catch (ExecutionException e) { Throwable cause = e.getCause(); assertThat(cause.getClass().getName()).contains("RetryableException"); assertRemoteExceptionWithStatus(cause.getCause(), HttpStatus.TOO_MANY_REQUESTS_429); exceptionCounter.getAndIncrement(); } catch (InterruptedException e) { throw Throwables.propagate(e); } }); tokenMap.forEach((service, token) -> assertThat(service.unlock(token)).isTrue()); return exceptionCounter.get(); }
Source:
<code>private void updateData(OCShare share) { share.setPath(mPath); <START> if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) { <END> share.setIsFolder(true); } else { share.setIsFolder(false); } share.setPermissions(READ_ONLY); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { file.setShareWithSharee(true); getStorageManager().saveFile(file); } }</code><technical_language>This Block shortened share.setIsFolder(mPath.endsWith(FileUtils.PATH_SEPARATOR))</technical_language>

Target:
private void updateData(OCShare share) { share.setPath(mPath); share.setIsFolder(mPath.endsWith(FileUtils.PATH_SEPARATOR)); share.setPermissions(READ_ONLY); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { file.setShareWithSharee(true); getStorageManager().saveFile(file); } }
Source:
<code>public DbBenchmarkSuiteSupplier(Jdbi jdbi, BenchmarkSuiteConfig config) { this.jdbi = requireNonNull(jdbi, "jdbi is null"); <START> this.suitesTableName = config.getSuitesTableName(); this.queriesTableName = config.getQueriesTableName(); this.suite = config.getSuite(); <END> }</code><technical_language>RequireNonNull for 3 lines</technical_language>

Target:
public DbBenchmarkSuiteSupplier(Jdbi jdbi, BenchmarkSuiteConfig config) { this.jdbi = requireNonNull(jdbi, "jdbi is null"); this.suitesTableName = requireNonNull(config.getSuitesTableName(), "suites-table-name is null"); this.queriesTableName = requireNonNull(config.getQueriesTableName(), "queries-table-name is null"); this.suite = requireNonNull(config.getSuite(), "suite name is null"); }
Source:
<code>protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { try { return super.buildResult(cmdOutput, cmdParams); } finally { <START> Path path = userInstallationDir.get(); <END> if (path != null && Files.exists(path)) { try { FileUtils.deleteDirectory(path.toFile()); } catch (IOException e) { log.error(e); log.debug(e, e); } } } }</code><technical_language>USER_INSTALLATION_PATH_KEY present in cmdParams,</technical_language>

Target:
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { try { return super.buildResult(cmdOutput, cmdParams); } finally { String userInstallationPath = cmdParams.getParameter(USER_INSTALLATION_PATH_KEY); if (userInstallationPath != null) { deleteTempDirectory(userInstallationPath); } } }
Source:
<code>public static Test suite() { <START> return new TestSuite(TextViewerUndoManagerTest.class); <END> }</code><technical_language>This is a copy&paste failure: class TextViewerTest.class</technical_language>

Target:
public static Test suite() { return new TestSuite(TextViewerTest.class); }
Source:
<code>public OnkyoConnection(String serialPortName) { this.serialPortName = serialPortName; <START> connection = (EiscpInterface)new EiscpSerial(serialPortName); <END> }</code><technical_language>casting necessary here, is it</technical_language>

Target:
public OnkyoConnection(String serialPortName) { this.serialPortName = serialPortName; connection = new EiscpSerial(serialPortName); }
Source:
<code>public Builder<ExecutorFactoryConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { int maxThreads = this.definition.getMaxThreads().resolveModelAttribute(context, model).asInt(); int minThreads = this.definition.getMinThreads().resolveModelAttribute(context, model).asInt(); int queueLength = this.definition.getQueueLength().resolveModelAttribute(context, model).asInt(); long keepAliveTime = this.definition.getKeepAliveTime().resolveModelAttribute(context, model).asLong(); <START> ExecutorFactory factory = new DefaultAsyncExecutorFactory() { <END> @Override public ExecutorService getExecutor(Properties p) { ThreadFactory clThreadFactory = new ClassLoaderThreadFactory(runnable -> { Thread thread = new Thread(runnable, THREAD_NAME + "-" + counter.getAndIncrement()); thread.setDaemon(true); return thread; }, AccessController.doPrivileged((PrivilegedAction<ClassLoader>) ClassLoaderThreadFactory.class::getClassLoader)); return new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(queueLength), clThreadFactory); } }; this.builder.factory(factory); return this; }</code><technical_language>need extend DefaultAsyncExecutorFactory</technical_language>

Target:
public Builder<ExecutorFactoryConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { int maxThreads = this.definition.getMaxThreads().resolveModelAttribute(context, model).asInt(); int minThreads = this.definition.getMinThreads().resolveModelAttribute(context, model).asInt(); int queueLength = this.definition.getQueueLength().resolveModelAttribute(context, model).asInt(); long keepAliveTime = this.definition.getKeepAliveTime().resolveModelAttribute(context, model).asLong(); ExecutorFactory factory = properties -> { ThreadFactory clThreadFactory = new ClassLoaderThreadFactory(runnable -> { Thread thread = new Thread(runnable, DefaultAsyncExecutorFactory.THREAD_NAME + "-" + DefaultAsyncExecutorFactory.counter.getAndIncrement()); thread.setDaemon(true); return thread; }, AccessController.doPrivileged((PrivilegedAction<ClassLoader>) ClassLoaderThreadFactory.class::getClassLoader)); return new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(queueLength), clThreadFactory); }; this.builder.factory(factory); return this; }
Source:
<code>private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; String content = composeSquashMessage(isSquash, commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, content); <START> if (messageFixup.exists()) { <END> rebaseState.createFile(MESSAGE_FIXUP, content); } return squashIntoPrevious( !messageFixup.exists(), nextStep); }</code><technical_language>style nit: braces single line block</technical_language>

Target:
private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; String content = composeSquashMessage(isSquash, commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, content); if (messageFixup.exists()) rebaseState.createFile(MESSAGE_FIXUP, content); return squashIntoPrevious( !messageFixup.exists(), nextStep); }
Source:
<code>public void updateInstanceMaxUsage(Map<String, Double> maxUsageMap) { for (Map.Entry<String, Double> entry : maxUsageMap.entrySet()) { <START> InstanceMonitor monitor = _instanceMonitorMap.get(entry.getKey()); <END> if (monitor == null || !monitor.isRegister()) { LOG.warn("Failed to update max usage because instance monitor is not found, instance: {}.", entry.getKey()); continue; } monitor.updateMaxCapacityUsage(entry.getValue()); } }</code><technical_language>Sync _instanceMonitorMap while reading map</technical_language>

Target:
public void updateInstanceMaxUsage(Map<String, Double> maxUsageMap) { synchronized (_instanceMonitorMap) { for (Map.Entry<String, Double> entry : maxUsageMap.entrySet()) { InstanceMonitor monitor = _instanceMonitorMap.get(entry.getKey()); if (monitor == null) { LOG.warn("Failed to update max usage because instance monitor is not found, instance: {}.", entry.getKey()); continue; } monitor.updateMaxCapacityUsage(entry.getValue()); } } }
Source:
<code>public static SandboxedInstance createSandboxedInstance(RuntimeInfo runtimeInfo, ClassLoader parentClassLoader, boolean useCurrentJvmProperties) { if (runtimeInfo.getRuntimeClassName() == null) { throw new IllegalArgumentException("classToInstantiate should not be null"); } if (classLoaderCache.containsKey(runtimeInfo) && classLoaderCache.get(runtimeInfo) != null) { <START> return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, <END> classLoaderCache.get(runtimeInfo)); } else { ClassLoader sandboxClassLoader = new URLClassLoader( runtimeInfo.getMavenUrlDependencies().toArray(new URL[runtimeInfo.getMavenUrlDependencies().size()]), parentClassLoader); classLoaderCache.put(runtimeInfo, sandboxClassLoader); return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, sandboxClassLoader); } }</code><technical_language>a concurent issue test true a *classLoaderCache.get(runtimeInfo) != null* this null if removed another thread</technical_language>

Target:
public static SandboxedInstance createSandboxedInstance(RuntimeInfo runtimeInfo, ClassLoader parentClassLoader, boolean useCurrentJvmProperties) { if (runtimeInfo.getRuntimeClassName() == null) { throw new IllegalArgumentException("classToInstantiate should not be null"); } synchronized (classLoaderCache) { if (classLoaderCache.containsKey(runtimeInfo) && classLoaderCache.get(runtimeInfo) != null) { return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, classLoaderCache.get(runtimeInfo)); } else { ClassLoader sandboxClassLoader = new URLClassLoader( runtimeInfo.getMavenUrlDependencies().toArray(new URL[runtimeInfo.getMavenUrlDependencies().size()]), parentClassLoader) { @Override public void close() throws IOException { super.close(); ClassLoaderIsolatedSystemProperties.getInstance().stopIsolateClassLoader(this); } }; classLoaderCache.put(runtimeInfo, sandboxClassLoader); return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, sandboxClassLoader); } } }
Source:
<code>public static void createIndex(final SeekableStream in, final OutputStream out, final long granularity) throws IOException { long recordStart = SAMUtils.findVirtualOffsetOfFirstRecordInBam(in); try (BlockCompressedInputStream blockIn = new BlockCompressedInputStream(in)) { blockIn.seek(recordStart); final ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN); <START> SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); <END> while (true) { try { recordStart = blockIn.getFilePointer(); InputStreamUtils.readFully(blockIn, byteBuffer.array(), 0, 4); final int blockSize = byteBuffer.getInt(0); indexWriter.processRecord(recordStart); InputStreamUtils.skipFully(blockIn, blockSize); } catch (EOFException e) { break; } } indexWriter.finish(recordStart, in.length()); } }</code><technical_language>final</technical_language>

Target:
public static void createIndex(final SeekableStream in, final OutputStream out, final long granularity) throws IOException { long recordStart = SAMUtils.findVirtualOffsetOfFirstRecordInBam(in); try (BlockCompressedInputStream blockIn = new BlockCompressedInputStream(in)) { blockIn.seek(recordStart); final ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN); final SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); while (true) { try { recordStart = blockIn.getFilePointer(); InputStreamUtils.readFully(blockIn, byteBuffer.array(), 0, 4); final int blockSize = byteBuffer.getInt(0); indexWriter.processRecord(recordStart); InputStreamUtils.skipFully(blockIn, blockSize); } catch (EOFException e) { break; } } indexWriter.finish(recordStart, in.length()); } }
Source:
<code>public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml"), isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(repository, "category.xml"), isFile()); Map<String, String> expected = new HashMap<>(3, 1.f); expected.put("p2.statsURI", "<LINK_0>"); expected.put("p2.mirrorsURL", "<LINK_0>.else"); expected.put("foo", "bar"); Document artifactsDocument = XMLParser.parse(artifactXml); artifactsDocument.getChild("repository").getChild("properties").getChildren("property").forEach(element -> { String propertyName = element.getAttributeValue("name"); if (expected.containsKey(propertyName) && expected.get(propertyName).equals(element.getAttributeValue("value"))) { expected.remove(propertyName); } }); <START> assertEquals("Missing properties in artifact repository", Collections.emptyMap(), expected); <END> }</code><technical_language>need remove parts property instead for other nodes in metadata</technical_language>

Target:
public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml"), isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(repository, "category.xml"), isFile()); Map<String, String> expected = new HashMap<>(2, 1.f); expected.put("<LINK_0>", "false"); expected.put("<LINK_0>.else", "true"); Document artifactsDocument = XMLParser.parse(artifactXml); artifactsDocument.getChild("repository").getChild("repository-references").getChildren("repository-reference") .forEach(element -> { String location = element.getAttributeValue("location"); if (expected.containsKey(location) && expected.get(location).equals(element.getAttributeValue("enabled"))) { expected.remove(location); } else { fail("Unexpected repository-reference in artifact repository " + element); } }); assertEquals("Missing repository-reference in artifact repository", Collections.emptyMap(), expected); }
Source:
<code>public void run() { Logging.putPrefix(Syslogd.LOG4J_CATEGORY); SimpleRegistry registry = new SimpleRegistry(); NettyComponent nettyComponent=new NettyComponent(); m_camel = new DefaultCamelContext(registry); m_camel.addComponent("netty", nettyComponent); try { m_camel.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { String from = String.format("netty:udp://%s:%s?sync=false&textline=true&receiveBufferSize=%d&connectTimeout=%d", InetAddressUtils.str(m_host), m_port, Integer.MAX_VALUE, SOCKET_TIMEOUT ); from(from) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { <START> ChannelBuffer buffer = ChannelBuffers.copiedBuffer(exchange.getIn().getBody().toString().getBytes()); <END> InetSocketAddress source = (InetSocketAddress)exchange.getIn().getHeader(NettyConstants.NETTY_REMOTE_ADDRESS); SyslogConnection connection = new SyslogConnection(source.getAddress(), source.getPort(), buffer.toByteBuffer(), m_config); try { for (SyslogConnectionHandler handler : m_syslogConnectionHandlers) { handler.handleSyslogConnection(connection); } } catch (Throwable e) { LOG.error("Handler execution failed in {}", this.getClass().getSimpleName(), e); } } }); } }); m_camel.start(); } catch (Exception e) { LOG.error("Could not configure Camel routes for syslog receiver", e); } }</code><technical_language>Is a reason this change is necessary? I original line message body a ChannelBuffer</technical_language>

Target:
public void run() { Logging.putPrefix(Syslogd.LOG4J_CATEGORY); SimpleRegistry registry = new SimpleRegistry(); NettyComponent nettyComponent=new NettyComponent(); m_camel = new DefaultCamelContext(registry); m_camel.addComponent("netty", nettyComponent); try { m_camel.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { String from = String.format("netty:udp://%s:%s?sync=false&allowDefaultCodec=false&receiveBufferSize=%d&connectTimeout=%d", InetAddressUtils.str(m_host), m_port, Integer.MAX_VALUE, SOCKET_TIMEOUT ); from(from) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { ChannelBuffer buffer = exchange.getIn().getBody(ChannelBuffer.class); InetSocketAddress source = (InetSocketAddress)exchange.getIn().getHeader(NettyConstants.NETTY_REMOTE_ADDRESS); SyslogConnection connection = new SyslogConnection(source.getAddress(), source.getPort(), buffer.toByteBuffer(), m_config); try { for (SyslogConnectionHandler handler : m_syslogConnectionHandlers) { handler.handleSyslogConnection(connection); } } catch (Throwable e) { LOG.error("Handler execution failed in {}", this.getClass().getSimpleName(), e); } } }); } }); m_camel.start(); } catch (Exception e) { LOG.error("Could not configure Camel routes for syslog receiver", e); } }
Source:
<code>protected Directory readIndexDirectory() throws IOException { Directory dir = new RAMDirectory(); <START> byte[] buffer = new byte[BUFSIZ]; <END> ZipInputStream zip = new ZipInputStream( DocQueryLucene.class.getClass().getResourceAsStream(INDEX_PATH)); ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { IndexOutput out = dir.createOutput(entry.getName(), null); int count; while ((count = zip.read(buffer)) != -1) { out.writeBytes(buffer, count); } out.close(); } zip.close(); return dir; }</code><technical_language>s/BUFSIZ/BUFSIZE DocQueryLucene.java:146: error: find symbol byte[] buffer = new byte[BUFSIZ]; ^ symbol: variable BUFSIZ location: class com.google.gerrit.server.query.doc.DocQueryLucene</technical_language>

Target:
protected Directory readIndexDirectory() throws IOException { Directory dir = new RAMDirectory(); byte[] buffer = new byte[BUFSIZE]; ZipInputStream zip = new ZipInputStream( DocQueryLucene.class.getClass().getResourceAsStream(INDEX_PATH)); ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { IndexOutput out = dir.createOutput(entry.getName(), null); int count; while ((count = zip.read(buffer)) != -1) { out.writeBytes(buffer, count); } out.close(); } zip.close(); return dir; }
Source:
<code>protected void performAction() { <START> extFormHandler.addFormHandlerFieldName(getNameTextField().getText().toLowerCase(), <END> getValueField().getEditor().getItem().toString()); }</code><technical_language>No, class (or editor) track of edits</technical_language>

Target:
protected void performAction() { extFormHandler.addFormHandlerFieldName(getNameTextField().getText().toLowerCase(), getValueField().getSelectedItem().toString()); }
Source:
<code><START> public RealmFCMPushNotifications getFSMPushNotifications() { <END> return null; }</code><technical_language>Naming: I thought agreed Push Notification prefix</technical_language>

Target:
public RealmPushNotifications getFSMPushNotifications() { return null; }
Source:
<code>public ServiceStatus getStatus(Coordinate coordinate) { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkStatusEndpoint statusEndpoint = new ZkStatusEndpoint(zk, statusPath); <START> statusEndpoint.loadFromZooKeeper(); <END> return statusEndpoint.getStatus(); }</code><technical_language>overly fond of side-effects-only methods. I tempted break ZkStatusEndpoint is fetched a factory method emitted in uninitialized state</technical_language>

Target:
public ServiceStatus getStatus(Coordinate coordinate) { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkStatusAndEndpoints statusAndEndpoints = new ZkStatusAndEndpoints.Builder(zk, statusPath).load().build(); return statusAndEndpoints.getServiceStatus(); }