auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void initializeReadMany( IDocumentQueryClient queryClient, String collectionResourceId, SqlQuerySpec sqlQuerySpec, Map<PartitionKeyRange, SqlQuerySpec> rangeQueryMap, FeedOptions feedOptions, UUID activityId, String collectionRid) { Map<String, String> commonRequestHeaders = createCommonHeadersAsync(this.getFeedOptions(null, null)); for (Map.Entry<PartitionKeyRange, SqlQuerySpec> entry : rangeQueryMap.entrySet()) { final PartitionKeyRange targetRange = entry.getKey(); final SqlQuerySpec query = entry.getValue(); TriFunction<PartitionKeyRange, String, Integer, RxDocumentServiceRequest> createRequestFunc = ( partitionKeyRange, continuationToken, pageSize) -> { Map<String, String> headers = new HashMap<>(commonRequestHeaders); headers.put(HttpConstants.HttpHeaders.CONTINUATION, continuationToken); headers.put(HttpConstants.HttpHeaders.PAGE_SIZE, Strings.toString(pageSize)); return this.createDocumentServiceRequest(headers, <START> query, <END> null, partitionKeyRange, collectionRid); }; Function<RxDocumentServiceRequest, Mono<FeedResponse<T>>> executeFunc = (request) -> { return this.executeRequestAsync(request); }; DocumentProducer<T> dp = createDocumentProducer(collectionRid, targetRange, null, -1, feedOptions, query, commonRequestHeaders, createRequestFunc, executeFunc, () -> client.getResetSessionTokenRetryPolicy() .getRequestPolicy()); documentProducers.add(dp); } }</code><technical_language>name this querySpec instead query querySpec different</technical_language>

Target:
protected void initializeReadMany( IDocumentQueryClient queryClient, String collectionResourceId, SqlQuerySpec sqlQuerySpec, Map<PartitionKeyRange, SqlQuerySpec> rangeQueryMap, FeedOptions feedOptions, UUID activityId, String collectionRid) { Map<String, String> commonRequestHeaders = createCommonHeadersAsync(this.getFeedOptions(null, null)); for (Map.Entry<PartitionKeyRange, SqlQuerySpec> entry : rangeQueryMap.entrySet()) { final PartitionKeyRange targetRange = entry.getKey(); final SqlQuerySpec querySpec = entry.getValue(); TriFunction<PartitionKeyRange, String, Integer, RxDocumentServiceRequest> createRequestFunc = ( partitionKeyRange, continuationToken, pageSize) -> { Map<String, String> headers = new HashMap<>(commonRequestHeaders); headers.put(HttpConstants.HttpHeaders.CONTINUATION, continuationToken); headers.put(HttpConstants.HttpHeaders.PAGE_SIZE, Strings.toString(pageSize)); return this.createDocumentServiceRequest(headers, querySpec, null, partitionKeyRange, collectionRid); }; Function<RxDocumentServiceRequest, Mono<FeedResponse<T>>> executeFunc = (request) -> { return this.executeRequestAsync(request); }; DocumentProducer<T> dp = createDocumentProducer(collectionRid, targetRange, null, -1, feedOptions, querySpec, commonRequestHeaders, createRequestFunc, executeFunc, () -> client.getResetSessionTokenRetryPolicy() .getRequestPolicy()); documentProducers.add(dp); } }
Source:
<code>public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); Elevator.raising.setFalseWhen(BooleanMixing.onRelease(b)); <START> <END> return b; }</code><technical_language>Lowering set true here, elevator holding unnecessary weight</technical_language>

Target:
public static BooleanStatus create() { BooleanStatus b = new BooleanStatus(false); AutoLoader a = new AutoLoader(); a.setShouldBeRunning(b); a.updateWhen(Igneous.globalPeriodic); Elevator.raising.setFalseWhen(BooleanMixing.onRelease(b)); Elevator.lowering.setTrueWhen(BooleanMixing.onRelease(b)); return b; }
Source:
<code>public static void main(String[] args) { JCommanderTwitterStream jcts = new JCommanderTwitterStream(); new JCommander(jcts, args); if (jcts.isHelp()) { JCommander jc = new JCommander(jcts, args); jc.usage(); return; } String[] keywords; if (jcts.getKeywords().size() > 0) { <START> keywords = jcts.getKeywords().toArray(new String[jcts.getKeywords().size()]); <END> } else { keywords = new String[1]; keywords[0] = ""; } String stringKeywords = String.join(" ", keywords); if (jcts.isStream()) { if (jcts.getLimit() < Integer.MAX_VALUE) { System.err.println("You can't have stream with limit."); System.exit(-1); } streamTweets(stringKeywords, jcts.getLocation(), jcts.isHideRetweets()); } else { printTweets(stringKeywords, jcts.getLocation(), jcts.getLimit(), jcts.isHideRetweets()); } return; }</code><technical_language>getKeywords().stream().collect(joining(" "))</technical_language>

Target:
public static void main(String[] args) { JCommanderTwitterStream jcts = new JCommanderTwitterStream(); new JCommander(jcts, args); if (jcts.isHelp()) { JCommander jc = new JCommander(jcts, args); jc.usage(); return; } String stringKeywords = jcts.getKeywords().stream().collect(joining(" ")); if (jcts.isStream()) { try { if (jcts.getLimit() < Integer.MAX_VALUE) { throw new ParameterException("You can't have stream with limit."); } streamTweets(stringKeywords, jcts.getLocation(), jcts.isHideRetweets()); } catch (URLs.ConnectionException | URLs.HTTPQueryException | MalformedURLException | ParameterException | GeolocationSearch.NoKeyException | GeolocationSearch.SearchLocationException e) { System.err.println(e.getMessage()); System.exit(1); } } else { try { printTweets(stringKeywords, jcts.getLocation(), jcts.getLimit(), jcts.isHideRetweets()); } catch (TwitterException | URLs.ConnectionException | GeolocationSearch.SearchLocationException | MalformedURLException | GeolocationSearch.NoKeyException | URLs.HTTPQueryException e) { System.err.println(e.getMessage()); System.exit(1); } } }
Source:
<code>public String toString() { <START> return "FittingOrgWordsMatchVoter [charsToFilter=" + charsToFilter <END> + ", minFittingOrgWordsRatio=" + minFittingOrgWordsRatio + ", minFittingWordSimilarity=" + minFittingWordSimilarity + ", wordToRemoveMaxLength=" + wordToRemoveMaxLength + "]"; }</code><technical_language>consider guava's MoreObjects.toStringHelper() ToStringBuilder commons-lang</technical_language>

Target:
public String toString() { return Objects.toStringHelper(this).add("matchStength", getMatchStrength()) .add("charsToFilter", charsToFilter) .add("minFittingOrgWordsRatio", minFittingOrgWordsRatio) .add("minFittingOrgWordSimilarity", minFittingWordSimilarity) .add("wordToRemoveMaxLength", wordToRemoveMaxLength) .toString(); }
Source:
<code>default boolean isAppRunning(String apk) { <START> AndroidService androidService = AndroidService.getInstance(); <END> String res = androidService.getCurrentDeviceFocus(); if (res.contains(apk)) { LOGGER.info("Actual device focus is as expected and contains package or activity: '" + apk + "'."); return true; } else { LOGGER.error("Not expected apk '" + apk + "' is in focus. Actual result is: " + res); return false; } }</code><technical_language>remove reference AbdroidService please. functionality step-by-step moved interface</technical_language>

Target:
default boolean isAppRunning(String apk) { String res = getCurrentDeviceFocus(); if (res.contains(apk)) { LOGGER.info("Actual device focus is as expected and contains package or activity: '" + apk + "'."); return true; } else { LOGGER.error("Not expected apk '" + apk + "' is in focus. Actual result is: " + res); return false; } }
Source:
<code>public Status deserialize(JsonNode rootNode, Configuration configuration) { String status = rootNode.asText(); if (UNKNOWN_STATUSES.contains(status)) { return Status.UNDEFINED; } else { <START> return Status.valueOf(status.toUpperCase(Locale.US)); <END> } }</code><technical_language>Modify sample.json is status for this fix is applied</technical_language>

Target:
public Status deserialize(JsonNode rootNode, Configuration configuration) { Locale.setDefault(Locale.US); String status = rootNode.asText(); if (UNKNOWN_STATUSES.contains(status)) { return Status.UNDEFINED; } else { return Status.valueOf(status.toUpperCase()); } }
Source:
<code>private Resource.ResourceType getResourceTypeEnum() { Resource.ResourceType resourceTypeResult = null; if (resourceTypeName != null) { try { resourceTypeResult = Resource.ResourceType.valueOf(resourceTypeName); } catch (IllegalArgumentException e) { throw new InvalidParameterValueException("Please specify a valid resource type name."); } } else if (resourceType != null) { try { <START> resourceTypeResult = Resource.ResourceType.values()[resourceType]; <END> } catch (ArrayIndexOutOfBoundsException e) { throw new InvalidParameterValueException("Please specify a valid resource type."); } } return resourceTypeResult; }</code><technical_language>code assumes ResourceType.getOrdinal() is in order enum values. This moment case.. I prefer search for ResourceType returning correct calling type.getOrdinal()</technical_language>

Target:
private Resource.ResourceType getResourceTypeEnum() { Resource.ResourceType resourceTypeResult = null; if (resourceTypeName != null) { try { resourceTypeResult = Resource.ResourceType.valueOf(resourceTypeName); } catch (IllegalArgumentException e) { throw new InvalidParameterValueException("Please specify a valid resource type name."); } } else if (resourceType != null) { resourceTypeResult = Resource.ResourceType.fromOrdinal(resourceType); if (resourceTypeResult == null) { throw new InvalidParameterValueException("Please specify a valid resource type."); } } return resourceTypeResult; }
Source:
<code>public void testRequirementVersionMatcherOnPreciseMatch() { <START> RequirementMatcher matcher = new RequirementMatcher(SimpleReq.class, "ersion", new VersionMatcher("1.1")); <END> assertTrue("Version attribute should be matched to version matcher with value 1.1", matcher.matches(simpleConfig)); }</code><technical_language>typo, s/ersion/version/</technical_language>

Target:
public void testRequirementVersionMatcherOnPreciseMatch() { RequirementMatcher matcher = new RequirementMatcher(SimpleReq.class, "version", new VersionMatcher("1.1")); assertTrue("Version attribute should be matched to version matcher with value 1.1", matcher.matches(simpleConfig)); }
Source:
<code>public void testCreateDynamicGraphAllIndependent() { DynamicGraph<ITestNGMethod> graph = newGraph(IndependentTestClassSample.class); assertThat(graph.getFreeNodes()).hasSize(2); <START> assertThat(graph.getEdges().isEmpty()); <END> }</code><technical_language>assertThat(graph.getEdges()).isEmpty()</technical_language>

Target:
public void testCreateDynamicGraphAllIndependent() { DynamicGraph<ITestNGMethod> graph = newGraph(IndependentTestClassSample.class); assertThat(graph.getFreeNodes()).hasSize(2); assertThat(graph.getEdges()).isEmpty(); }
Source:
<code>private boolean notNullSeqContainsOnlyWhitespaces(CharSequence actual) { for (int i = 0; i < actual.length(); i++) { <START> if (!Character.isWhitespace(actual.charAt(i))) return false; <END> } return true; }</code><technical_language>minor static import isWhitespace for readability</technical_language>

Target:
private boolean notNullSeqContainsOnlyWhitespaces(CharSequence actual) { for (int i = 0; i < actual.length(); i++) { if (!isWhitespace(actual.charAt(i))) return false; } return true; }
Source:
<code>private void setupMyId() throws IOException { File myIdFile = new File(dataDir, "myid"); if (!myIdFile.isFile()) { return; } BufferedReader br = new BufferedReader(new FileReader(myIdFile)); String myIdString; try { myIdString = br.readLine(); } finally { br.close(); } try { serverId = Long.parseLong(myIdString); MDC.put("myid", myIdString); } catch (NumberFormatException e) { throw new IllegalArgumentException("serverid " + myIdString + " is not a number"); } <START> if (serverId < 1 || serverId > 255) { <END> throw new IllegalArgumentException("myid must have a value between 1 and 255."); } }</code><technical_language>is a validateServerId logic in EphemeralType, is check serverId is [1, 254] of conflict TTL node, logic in place</technical_language>

Target:
private void setupMyId() throws IOException { File myIdFile = new File(dataDir, "myid"); if (!myIdFile.isFile()) { return; } BufferedReader br = new BufferedReader(new FileReader(myIdFile)); String myIdString; try { myIdString = br.readLine(); } finally { br.close(); } try { serverId = Long.parseLong(myIdString); MDC.put("myid", myIdString); } catch (NumberFormatException e) { throw new IllegalArgumentException("serverid " + myIdString + " is not a number"); } validateMyid(serverId); }
Source:
<code>public static String encodeBase64String(byte[] binaryData) { <START> if(binaryData == null){ <END> return null; } return com.google.common.io.BaseEncoding.base64().encode(binaryData); }</code><technical_language>space if (, so: if (binaryData == null) {</technical_language>

Target:
public static String encodeBase64String(byte[] binaryData) { if (binaryData == null) { return null; } return BaseEncoding.base64().encode(binaryData); }
Source:
<code>Set<String> getValidHosts() { <START> return AAD_WHITELIST_HOSTS; <END> }</code><technical_language>nit: this AAD_WHITELISTED_HOSTS? curious</technical_language>

Target:
Set<String> getValidHosts() { return AAD_WHITELISTED_HOSTS; }
Source:
<code>public final Integer read() { int length = 1; final boolean lenCodingBit = false; try { while (coreBlockInputStream.readBit() == lenCodingBit) { length++; } final int readBits = coreBlockInputStream.readBits(length - 1); final int value = readBits | 1 << (length - 1); return value - offset; } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>>RuntimeIOException</technical_language>

Target:
public final Integer read() { int length = 1; final boolean lenCodingBit = false; try { while (coreBlockInputStream.readBit() == lenCodingBit) { length++; } final int readBits = coreBlockInputStream.readBits(length - 1); final int value = readBits | 1 << (length - 1); return value - offset; } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
<code><START> public void testRegisterLoadBalancerWithIP() { <END> LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setType(LoadBalancerType.PUBLIC); loadBalancer.setIp(LB_IP); loadBalancer.setEndpoint(LB_ENDPOINT); when(loadBalancerPersistenceService.findByStackId(any())).thenReturn(Set.of(loadBalancer)); ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.registerLoadBalancerDomainWithFreeIPA(stack)); verify(dnsV1Endpoint, times(1)).addDnsARecord(any()); }</code><technical_language>this jut a is more correct AddDnsCnameRecordRequest AddDns**C**NameRecordRequest @lacikaaa</technical_language>

Target:
public void testRegisterLoadBalancerWithIP() { LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setType(LoadBalancerType.PUBLIC); loadBalancer.setIp(LB_IP); loadBalancer.setEndpoint(LB_ENDPOINT); when(loadBalancerPersistenceService.findByStackId(any())).thenReturn(Set.of(loadBalancer)); when(loadBalancerConfigService.selectLoadBalancer(any(), any())).thenReturn(Optional.of(loadBalancer)); ThreadBasedUserCrnProvider.doAs(TEST_USER_CRN, () -> underTest.registerLoadBalancerDomainWithFreeIPA(stack)); verify(dnsV1Endpoint, times(1)).addDnsARecord(any()); }
Source:
<code>public void cancelPendingRequests(Client client) { if (client.usesQueueMode()) { queuedRequestSender.cancelPendingRequests(client); } else { defaultRequestSender.cancelPendingRequests(client); } <START> } <END></code><technical_language>cancel request 2 senders because, for registration pending request in queuemode queuemode (as binding mode change) (I agree this Far-fetched I problem call cancelPendingRequests sender)</technical_language>

Target:
public void cancelPendingRequests(Client client) { defaultRequestSender.cancelPendingRequests(client); queuedRequestSender.cancelPendingRequests(client); }
Source:
<code>public IResource[] getSupplementaryResources() { IFolder supplFolder = getTraceSupplementaryFolder(getResourceName()); if (supplFolder.exists()) { try { return supplFolder.members(); } catch (CoreException e) { <START> Activator.getDefault().logError("Error deleting supplementary folder " + supplFolder, e); END> } } return new IResource[0]; }</code><technical_language>externalize</technical_language>

Target:
public IResource[] getSupplementaryResources() { IFolder supplFolder = getTraceSupplementaryFolder(getResourceName()); if (supplFolder.exists()) { try { return supplFolder.members(); } catch (CoreException e) { Activator.getDefault().logError(Messages.TmfCommonProjectElement_ErrorDeletingSF + supplFolder, e); } } return new IResource[0]; }
Source:
<code>static String gatherRevision(ExecutionEvent event) throws IOException { final GitFlowRepository gfRepo = GitFlowHandlerUtil .getRepository(event); Ref <START> exactRef = <END> gfRepo.getRepository() .exactRef(gfRepo.getConfig().getDevelopFull()); if (exactRef == null) { throw new IllegalStateException( "Gitflow command called on non-Gitflow repository"); } return exactRef.getName(); }</code><technical_language>s/exactRef/develop/</technical_language>

Target:
static String gatherRevision(ExecutionEvent event) throws IOException { final GitFlowRepository gfRepo = GitFlowHandlerUtil .getRepository(event); Ref develop = gfRepo.getRepository() .exactRef(gfRepo.getConfig().getDevelopFull()); if (develop == null) { throw new IllegalStateException( "Gitflow command called on non-Gitflow repository"); } return develop.getName(); }
Source:
<code>public LocalReplayInfo parseMetaData(Path replayFile) { logger.debug("Parsing metadata of replay file: {}", replayFile); Optional<String> metadata = Files.lines(replayFile).findFirst(); if (metadata.isPresent()) { return gson.fromJson(metadata.get(), LocalReplayInfo.class); } <START> throw new IOException(String.format("Failed to extract metadata from replay file: {}", replayFile)); <END> }</code><technical_language>Instead of if map(metadata -> gson.fromJson...).orElseThrow(new IOException...) put Files.lines a try-with-resources ensure closing of file</technical_language>

Target:
public LocalReplayInfo parseMetaData(Path replayFile) { logger.debug("Parsing metadata of replay file: {}", replayFile); try (Stream<String> stream = Files.lines(replayFile)) { return stream .findFirst() .map(jsonString -> gson.fromJson(jsonString, LocalReplayInfo.class)) .orElseThrow(() -> new IOException(String.format("Failed to extract metadata from replay file: {}", replayFile))); } }
Source:
<code><START> public SpecificSegmentsSpec(@JsonProperty("segments") List<String> segments) <END> { this.segments = segments; }</code><technical_language>Is a serde test for this</technical_language>

Target:
public SpecificSegmentsSpec(@JsonProperty("segments") List<String> segments) { this.segments = segments; Collections.sort(this.segments); }
Source:
<code>private static String[] explode(String pattern) { if (pattern == null) { <START> return new String[]{}; <END> } return pattern.split(","); }</code><technical_language>a constant for that</technical_language>

Target:
private static String[] explode(String pattern) { if (pattern == null) { return EMPTY_PATHS; } return pattern.split(","); }
Source:
<code>@Override public <T> TypeAdapter<T> create(final Gson gson, TypeToken<T> type) { if (type.getRawType() != Device.class || recursiveCall.get() != null) { recursiveCall.set(null); return null; } recursiveCall.set(Boolean.TRUE); final TypeAdapter<Device> delegate = (TypeAdapter) gson.getDelegateAdapter(this, type); return (TypeAdapter) new TypeAdapter<Device>() { @Override public void write(JsonWriter out, Device value) throws IOException { delegate.write(out, value); } @Override public Device read(JsonReader in) throws IOException { String json = in.nextString(); JsonParser parser = new JsonParser(); JsonElement root = parseString(parser, json, null); return root == null ? null : delegate.fromJsonTree(root); } private JsonElement parseString(JsonParser parser, String json, String prevJson) throws IOException { <START> if (json == null || json.trim().isEmpty()) { <END> return null; } JsonElement root = parser.parse(json); if (root instanceof JsonPrimitive) { prevJson = json; json = root.getAsString(); if (Objects.equals(json, prevJson)) { throw new JsonSyntaxException("Unexpected Json: " + json); } return parseString(parser, json, prevJson); } return root; } }; }</code><technical_language>Do cases happen in tests</technical_language>

Target:
@Override public <T> TypeAdapter<T> create(final Gson gson, TypeToken<T> type) { if (type.getRawType() != Device.class || recursiveCall.get() != null) { recursiveCall.set(null); return null; } recursiveCall.set(Boolean.TRUE); return (TypeAdapter) gson.getDelegateAdapter(this, type); }
Source:
<code>public HttpConnection setRequestBody(final String input) { this.input = new InputStreamGenerator() { @Override public InputStream getInputStream() { <START> return new ByteArrayInputStream(input.getBytes()); <END> } }; this.inputLength = input.getBytes().length; return this; }</code><technical_language>This platforms default charset, I more explicit getBytes("UTF-8")</technical_language>

Target:
public HttpConnection setRequestBody(final String input) { try { final byte[] bytes = input.getBytes("UTF-8"); this.inputLength = bytes.length; this.input = new InputStreamGenerator() { @Override public InputStream getInputStream() { return new ByteArrayInputStream(bytes); } }; } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } return this; }
Source:
<code>public void invalidTeamDomainShouldFail() { <START> StandardSlackService service = new StandardSlackService("", "my", false, "#general", false,"token"); <END> service.publish("message"); }</code><technical_language>suggestion StandardSlackService service = new StandardSlackService("", "my", false, "#general", false, "token");</technical_language>

Target:
public void invalidTeamDomainShouldFail() { StandardSlackService service = new StandardSlackService( StandardSlackService.builder() .withBaseUrl("") .withTeamDomain("my") .withBotUser(false) .withRoomId("#general") .withReplyBroadcast(false) .withPopulatedToken("token")); service.publish("message"); }
Source:
<code>public String getUsageTips() { int defaultHttpPort = 9763; int defaultHttpsPort = 9443; int httpPort; int httpsPort; int portOffset = getPortOffset(); if (portOffset == 0) { httpPort = defaultHttpPort; httpsPort = defaultHttpsPort; } else { httpPort = defaultHttpPort + portOffset; httpsPort = defaultHttpsPort + portOffset; <START> } <END> return resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_PREFIX) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID1) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID2) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID3) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_POSTFIX); }</code><technical_language>@thiliA set default ports a constant set port offset initialization (since port offset change server runtime). values calculated time getUsageTips() method is called</technical_language>

Target:
public String getUsageTips() { return resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_PREFIX) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID1) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID2) + httpPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_MID3) + httpsPort + resourceBundle.getString(UIEventAdapterConstants.ADAPTER_USAGE_TIPS_POSTFIX); }
Source:
<code>public void refreshTabs() { boolean <START> iSCurrentDiagramClosed = <END> false; boolean isLastVistedDiagramShowed = false; INavigationHistory navigationHistory = this.getSite().getPage().getNavigationHistory(); INavigationLocation[] navigationLocations = navigationHistory.getLocations(); INavigationLocation currentLocation = navigationHistory.getCurrentLocation(); if (currentLocation != null && (currentLocation instanceof PapyrusNavigationLocation)) { URI currentPageURI = ((PapyrusNavigationLocation) currentLocation).getPageURI(); if (currentPageURI != null) { try { EObject currentDiagram = ServiceUtils.getInstance().getModelSet(((PapyrusMultiDiagramEditor) this).getServicesRegistry()).getEObject(currentPageURI, false); if (currentDiagram != null) { IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(currentDiagram); if (pageManager != null) { if (!pageManager.isOpen(currentDiagram)) { iSCurrentDiagramClosed = true; } } } } catch (ServiceException e) { Activator.log.error(e); } } } if (iSCurrentDiagramClosed && (navigationLocations.length > 2)) { isLastVistedDiagramShowed = findAndShowLastVisitedDiagram(navigationLocations, navigationLocations.length - 2); } if (!isLastVistedDiagramShowed) { super.refreshTabs(); } }</code><technical_language>isCurrent... (S in uppercase</technical_language>

Target:
public void refreshTabs() { boolean isCurrentDiagramClosed = false; boolean isLastVisitedDiagramShowed = false; INavigationHistory navigationHistory = this.getSite().getPage().getNavigationHistory(); INavigationLocation[] navigationLocations = navigationHistory.getLocations(); INavigationLocation currentLocation = navigationHistory.getCurrentLocation(); if (currentLocation != null && (currentLocation instanceof PapyrusNavigationLocation)) { URI currentPageURI = ((PapyrusNavigationLocation) currentLocation).getPageURI(); if (currentPageURI != null) { try { EObject currentDiagram = ServiceUtils.getInstance().getModelSet(((PapyrusMultiDiagramEditor) this).getServicesRegistry()).getEObject(currentPageURI, false); if (currentDiagram != null) { IPageManager pageManager = ServiceUtilsForEObject.getInstance().getIPageManager(currentDiagram); if (pageManager != null) { if (!pageManager.isOpen(currentDiagram)) { isCurrentDiagramClosed = true; } } } } catch (ServiceException e) { Activator.log.error(e); } } } if (isCurrentDiagramClosed && (navigationLocations.length > 2)) { isLastVisitedDiagramShowed = findAndShowLastVisitedDiagram(navigationLocations, navigationLocations.length - 2); } if (!isLastVisitedDiagramShowed) { super.refreshTabs(); } }
Source:
<code>public QueryAuditEventsResponseType retrieveAudits(QueryAuditEventsRequestType request) { QueryAuditEventsResponseType response = null; try { CONNECTClient<AuditQueryLogPortType> client = getCONNECTClient(getQueryAuditEventsPortDescriptor()); response = (QueryAuditEventsResponseType) client.invokePort(AuditQueryLogPortType.class, QUERY_AUDIT_EVENTS, request); } catch (Exception ex) { <START> LOG.debug("Failed to call the web service " + NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME <END> + ex.getLocalizedMessage(), ex); } return response; }</code><technical_language>This error level (there multiple instances of this)</technical_language>

Target:
public QueryAuditEventsResponseType retrieveAudits(QueryAuditEventsRequestType request) { QueryAuditEventsResponseType response = null; try { CONNECTClient<AuditQueryLogPortType> client = getCONNECTClient(getQueryAuditEventsPortDescriptor()); response = (QueryAuditEventsResponseType) client.invokePort(AuditQueryLogPortType.class, QUERY_AUDIT_EVENTS, request); } catch (Exception ex) { LOG.error("Failed to call the web service {}: {}", NhincConstants.ADAPTER_AUDIT_QUERY_LOG_SERVICE_NAME, ex.getLocalizedMessage(), ex); } return response; }
Source:
<code>public void testBlobNotFoundCase() throws Exception { doPut(); operationsCount.incrementAndGet(); GetBlobOperation op = new GetBlobOperation(routerConfig, routerMetrics, mockClusterMap, responseHandler, blobIdStr, operationFuture, null, operationCompleteCallback, time); ArrayList<RequestInfo> requestListToFill = new ArrayList<>(); requestRegistrationCallback.requestListToFill = requestListToFill; for (MockServer server : mockServerLayout.getMockServers()) { server.setServerErrorForAllRequests(ServerErrorCode.Blob_Not_Found); } while (!op.isOperationComplete()) { op.poll(requestRegistrationCallback); List<ResponseInfo> responses = sendAndWaitForResponses(requestListToFill); for (ResponseInfo response : responses) { op.handleResponse(response); if (op.isOperationComplete()) { break; } } } <START> Assert.assertEquals("Must have attempted sending requests to all replicas", replicasCount, <END> correlationIdToGetOperation.size()); Assert.assertTrue("Operation should be complete at this time", op.isOperationComplete()); RouterException routerException = (RouterException) op.getOperationException(); Assert.assertEquals(RouterErrorCode.BlobDoesNotExist, routerException.getErrorCode()); }</code><technical_language>this repeated thrice. calls for a utility function? Especially test for internal server errors, IO exceptions etc</technical_language>

Target:
public void testBlobNotFoundCase() throws Exception { doPut(); operationsCount.incrementAndGet(); GetBlobOperation op = new GetBlobOperation(routerConfig, routerMetrics, mockClusterMap, responseHandler, blobIdStr, operationFuture, null, operationCompleteCallback, blobIdFactory, time); ArrayList<RequestInfo> requestListToFill = new ArrayList<>(); requestRegistrationCallback.requestListToFill = requestListToFill; for (MockServer server : mockServerLayout.getMockServers()) { server.setServerErrorForAllRequests(ServerErrorCode.Blob_Not_Found); } while (!op.isOperationComplete()) { op.poll(requestRegistrationCallback); List<ResponseInfo> responses = sendAndWaitForResponses(requestListToFill); for (ResponseInfo response : responses) { op.handleResponse(response); if (op.isOperationComplete()) { break; } } } Assert.assertEquals("Must have attempted sending requests to all replicas", replicasCount, correlationIdToGetOperation.size()); Assert.assertTrue("Operation should be complete at this time", op.isOperationComplete()); RouterException routerException = (RouterException) op.getOperationException(); Assert.assertEquals(RouterErrorCode.BlobDoesNotExist, routerException.getErrorCode()); }
Source:
<code>public void testCreateRelationshipFieldWithDash_Return400() throws Exception { final FieldResource resource = new FieldResource(); final ContentType contentType = getContentType(); final String jsonField = "{"+ <START> " \"clazz\" : \"com.dotcms.contenttype.model.field.ImmutableRelationshipField\","+ <END> " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtube-videos\","+ " \"relationType\": \"Youtube\""+ " }"; final Response response = resource.createContentTypeField( contentType.id(), jsonField.replace("CONTENT_TYPE_ID", contentType.id()), getHttpRequest()); assertNotNull(response); assertEquals(400, response.getStatus()); assertTrue("Error: " + response.getEntity().toString(), response.getEntity().toString().contains("contains characters not allowed")); }</code><technical_language>this hardcoded replaced ImmutableRelationshipField.class.getCanonicalName()</technical_language>

Target:
public void testCreateRelationshipFieldWithDash_Return400() throws Exception { final FieldResource resource = new FieldResource(); final ContentType contentType = getContentType(); final String jsonField = "{"+ " \"clazz\" : \"" + ImmutableRelationshipField.class.getCanonicalName() +"\","+ " \"contentTypeId\" : \"CONTENT_TYPE_ID\","+ " \"name\" : \"YouTube Videos\","+ " \"values\" : 1," + " \"variable\": \"youtube-videos\","+ " \"relationType\": \"Youtube\""+ " }"; final Response response = resource.createContentTypeField( contentType.id(), jsonField.replace("CONTENT_TYPE_ID", contentType.id()), getHttpRequest()); assertNotNull(response); assertEquals(400, response.getStatus()); assertTrue("Error: " + response.getEntity().toString(), response.getEntity().toString().contains("contains characters not allowed")); }
Source:
<code>private void registerPanda() { <START> register(new PandaEntityEatingTimeProvider()); <END> register(PandaEntity.class, Keys.HIDDEN_GENE, p -> ((PandaGene) (Object) p.getHiddenGene()), (p, g) -> p.setHiddenGene((PandaEntity.Type) (Object) g)); register(PandaEntity.class, Keys.KNOWN_GENE, p -> ((PandaGene) (Object) p.getMainGene()), (p, g) -> p.setMainGene((PandaEntity.Type) (Object) g)); register(PandaEntity.class, Keys.IS_EATING, PandaEntity::func_213578_dZ, PandaEntity::func_213534_t); register(PandaEntity.class, Keys.IS_LYING_ON_BACK, PandaEntity::func_213567_dY, PandaEntity::func_213542_s); register(PandaEntity.class, Keys.IS_ROLLING_AROUND, PandaEntity::func_213564_eh, PandaEntity::func_213576_v); register(PandaEntity.class, Keys.SNEEZING_TIME, PandaEntity::func_213585_ee, PandaEntity::func_213562_s); register(PandaEntity.class, Keys.UNHAPPY_TIME, PandaEntity::func_213544_dV, PandaEntity::func_213588_r); }</code><technical_language>PandaEntityAccessor a target type, method references</technical_language>

Target:
private void registerPanda() { register(PandaEntityAccessor.class, Keys.EATING_TIME, PandaEntityAccessor::accessor$func_213559_es, PandaEntityAccessor::accessor$func_213571_t); register(PandaEntity.class, Keys.HIDDEN_GENE, p -> ((PandaGene) (Object) p.getHiddenGene()), (p, g) -> p.setHiddenGene((PandaEntity.Type) (Object) g)); register(PandaEntity.class, Keys.KNOWN_GENE, p -> ((PandaGene) (Object) p.getMainGene()), (p, g) -> p.setMainGene((PandaEntity.Type) (Object) g)); register(PandaEntity.class, Keys.IS_EATING, PandaEntity::func_213578_dZ, PandaEntity::func_213534_t); register(PandaEntity.class, Keys.IS_FRIGHTENED, PandaEntity::func_213566_eo); register(PandaEntity.class, Keys.IS_LYING_ON_BACK, PandaEntity::func_213567_dY, PandaEntity::func_213542_s); register(PandaEntity.class, Keys.IS_ROLLING_AROUND, PandaEntity::func_213564_eh, PandaEntity::func_213576_v); register(PandaEntity.class, Keys.IS_SNEEZING, PandaEntity::func_213539_dW, PandaEntity::func_213581_u); register(PandaEntity.class, Keys.IS_UNHAPPY, panda -> panda.func_213544_dV() > 0); register(PandaEntity.class, Keys.SNEEZING_TIME, PandaEntity::func_213585_ee, PandaEntity::func_213562_s); register(PandaEntity.class, Keys.UNHAPPY_TIME, PandaEntity::func_213544_dV, PandaEntity::func_213588_r); }
Source:
<code>private void send(String message, String vmID, boolean removeClient){ ReactorClient client; client = JsonRpcServer.getReacorsMap().get(vmID); if (client == null){ log.error("failed to sync reactors"); client = JsonRpcServer.getReactorClient(); if (client == null) { log.error("cannot initialize client, null pointer"); return; } } try { client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } <START> if (removeClient){ <END> JsonRpcServer.removeReactors(vmID); } }</code><technical_language>code is needed do this check here. more notification start stop a vm. need smart remove client map</technical_language>

Target:
private void send(String message, String vmID, boolean removeClient) throws ClientConnectionException{ try { ReactorClient client = JsonRpcServer.getReactorsMap().get(vmID); client.sendMessage(message.getBytes()); log.debug("sending events message {}", message); }catch (ClientConnectionException e) { log.error("Failure in sending response", e); } if (removeClient){ JsonRpcServer.removeReactorsMap(vmID); } }
Source:
<code>public static boolean validateFileType(final FileItemWrap newFile, final List<String> fileTypes) { if (newFile == null) { return false; } if (fileTypes == null || fileTypes.isEmpty()) { return true; } final List<String> fileMimes = fileTypes.stream() .filter(fileType -> fileType.matches("[^/\\n]+\\/[^/\\n]+")) .collect(Collectors.toList()); final List<String> fileExts = fileTypes.stream() .filter(fileType -> !fileMimes.contains(fileType)) .collect(Collectors.toList()); boolean extMatch = false; if (fileExts.size() > 0 && newFile.getName() != null) { String[] split = newFile.getName().split(("\\.(?=[^\\.]+$)")); if (split.length == 2) { extMatch = fileExts.stream().anyMatch(fileExt -> fileExt.equals("." + split[1])); } } <START> boolean mimeMatch = false; <END> if (!extMatch && fileMimes.size() > 0) { try { final String mimeType = getFileMimeType(newFile); LOG.debug("File mime-type is: " + mimeType); for (String fileMime : fileMimes) { if (StringUtils.equals(mimeType, fileMime)) { mimeMatch = true; } else if (fileMime.indexOf("*") == fileMime.length() - 1) { fileMime = fileMime.substring(0, fileMime.length() - 1); if (mimeType.indexOf(fileMime) == 0) { mimeMatch = true; } } } } catch (IOException e) { LOG.error("Invalid file type"); } } return extMatch || mimeMatch; }</code><technical_language>is initial strictly necessary</technical_language>

Target:
public static boolean validateFileType(final FileItemWrap newFile, final List<String> fileTypes) { if (newFile == null) { return false; } if (fileTypes == null || fileTypes.isEmpty()) { return true; } ; final List<String> fileExts = fileTypes.stream() .filter(fileType -> fileType.startsWith(".")) .collect(Collectors.toList()); final List<String> fileMimes = fileTypes.stream() .filter(fileType -> !fileExts.contains(fileType)) .collect(Collectors.toList()); if (fileExts.size() > 0 && newFile.getName() != null) { String[] split = newFile.getName().split(("\\.(?=[^\\.]+$)")); if (split.length == 2 && fileExts.stream().anyMatch(fileExt -> fileExt.equals("." + split[1]))) { return true; } } if (fileMimes.size() > 0) { final String mimeType = getFileMimeType(newFile); LOG.debug("File mime-type is: " + mimeType); for (String fileMime : fileMimes) { if (StringUtils.equals(mimeType, fileMime)) { return true; } if (fileMime.indexOf("*") == fileMime.length() - 1) { fileMime = fileMime.substring(0, fileMime.length() - 1); if (mimeType.indexOf(fileMime) == 0) { return true; } } } } return false; }
Source:
<code>public Response workflowsGet(Integer limit, Integer offset, String accept, String ifNoneMatch, String workflowType) { <START> limit = limit != null ? limit : RestApiConstants.PAGINATION_LIMIT_DEFAULT; <END> offset = offset != null ? offset : RestApiConstants.PAGINATION_OFFSET_DEFAULT; String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); WorkflowListDTO workflowListDTO; try { Workflow[] workflows; String status="CREATED"; APIAdmin apiAdmin = new APIAdminImpl(); workflows=apiAdmin.getworkflows(workflowType, status ,tenantDomain); try { workflowListDTO = WorkflowMappingUtil.fromWorkflowsToDTO(workflows, limit, offset); WorkflowMappingUtil.setPaginationParams(workflowListDTO, limit, offset, workflows.length); return Response.ok().entity(workflowListDTO).build(); } catch( NullPointerException e){ RestApiUtil.handleInternalServerError("Error while retrieving workflow requests" , e, log); } } catch(APIManagementException e){ RestApiUtil.handleInternalServerError("Error while retrieving workflow requests" , e, log); } return null; }</code><technical_language>format method. remove unnecessary spaces</technical_language>

Target:
public Response workflowsGet(Integer limit, Integer offset, String accept, String ifNoneMatch, String workflowType) { limit = limit != null ? limit : RestApiConstants.PAGINATION_LIMIT_DEFAULT; offset = offset != null ? offset : RestApiConstants.PAGINATION_OFFSET_DEFAULT; String tenantDomain = RestApiUtil.getLoggedInUserTenantDomain(); WorkflowListDTO workflowListDTO; try { Workflow[] workflows; String status = "CREATED"; APIAdmin apiAdmin = new APIAdminImpl(); workflows = apiAdmin.getworkflows(workflowType, status, tenantDomain); workflowListDTO = WorkflowMappingUtil.fromWorkflowsToDTO(workflows, limit, offset); WorkflowMappingUtil.setPaginationParams(workflowListDTO, limit, offset, workflows.length); return Response.ok().entity(workflowListDTO).build(); } catch (APIManagementException e) { RestApiUtil.handleInternalServerError("Error while retrieving workflow requests. ", e, log); } return null; }
Source:
<code>public List<SimpleEntity> createSimpleEntities() { SimpleEntity entityOne = new SimpleEntity(); <START> SimpleEntity divisionTwo = new SimpleEntity(); <END> entityOne.setId(1); entityOne.setName("Wydzial 1"); divisionTwo.setId(23); divisionTwo.setName("Wydział 23 Karny"); return Lists.newArrayList(entityOne, divisionTwo); }</code><technical_language>strange object is named entityOne other divisionTwo</technical_language>

Target:
public List<SimpleEntity> createSimpleEntities() { SimpleEntity entityOne = new SimpleEntity(); SimpleEntity entityTwo = new SimpleEntity(); entityOne.setId(1); entityOne.setName("Wydzial 1"); entityTwo.setId(23); entityTwo.setName("Wydział 23 Karny"); return Lists.newArrayList(entityOne, entityTwo); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { <START> getSupportActionBar().setElevation(0); <END> getSupportActionBar().setDisplayHomeAsUpEnabled(true); } SettingsFragment settingsFragment = (SettingsFragment) getSupportFragmentManager().findFragmentById(R.id.settingsContentFrame); if (settingsFragment == null) { settingsFragment = SettingsFragment.newInstance(); } if (!settingsFragment.isActive()) { addFragmentToActivity(getSupportFragmentManager(), settingsFragment, R.id.settingsContentFrame); } new SettingsPresenter(settingsFragment, mOpenMRSLogger); }</code><technical_language>@tmarzeion calling a method instead of actionBar</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_settings); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setElevation(0); actionBar.setDisplayHomeAsUpEnabled(true); } SettingsFragment settingsFragment = (SettingsFragment) getSupportFragmentManager().findFragmentById(R.id.settingsContentFrame); if (settingsFragment == null) { settingsFragment = SettingsFragment.newInstance(); } if (!settingsFragment.isActive()) { addFragmentToActivity(getSupportFragmentManager(), settingsFragment, R.id.settingsContentFrame); } new SettingsPresenter(settingsFragment, mOpenMRSLogger); }
Source:
<code>protected void meetSP(final StatementPattern node) throws Exception { final StatementPattern currentNode = node.clone(); final Var subVar = node.getSubjectVar(); final Var predVar = node.getPredicateVar(); final Var objVar = node.getObjectVar(); final Var conVar = node.getContextVar(); if (predVar != null && objVar != null && objVar.getValue() != null && RDF.TYPE.equals(predVar.getValue()) && !EXPANDED.equals(conVar)) { final List<Set<Resource>> intersections = inferenceEngine.getIntersectionsImplying((URI) objVar.getValue()); if (intersections != null && !intersections.isEmpty()) { <START> final Set<Resource> combinedIntersections = new TreeSet<>(new ResourceComparator()); <END> for (final Set<Resource> intersection : intersections) { combinedIntersections.addAll(intersection); } final TupleExpr joinTree = createJoinTree(new ArrayList<>(combinedIntersections), subVar, conVar); if (joinTree != null) { final Union union = new InferUnion(joinTree, currentNode); node.replaceWith(union); log.trace("Replacing node with inferred intersection union: " + union); } } } }</code><technical_language>If multiple intersections type, I want treat intersection a sufficient condition for inferring type, union separate join trees together, combining types join tree. E.g. if have: A intersectionOf (B C) A intersectionOf (D E F) I right interpretation is: A == (B intersect C) == (D intersect E intersect F). individual x is a member of A if: (x is A) (x is a B a C) (x is a D E F). query tree like: - Union - Union - Join - (x is a B) - (x is a C) - Join - Join - (x is a D) - (x is E) - (x is F) - (x is A)</technical_language>

Target:
protected void meetSP(final StatementPattern node) throws Exception { final StatementPattern currentNode = node.clone(); final Var subVar = node.getSubjectVar(); final Var predVar = node.getPredicateVar(); final Var objVar = node.getObjectVar(); final Var conVar = node.getContextVar(); if (predVar != null && objVar != null && objVar.getValue() != null && RDF.TYPE.equals(predVar.getValue()) && !EXPANDED.equals(conVar)) { final List<Set<Resource>> intersections = inferenceEngine.getIntersectionsImplying((URI) objVar.getValue()); if (intersections != null && !intersections.isEmpty()) { final List<TupleExpr> joins = new ArrayList<>(); for (final Set<Resource> intersection : intersections) { final Set<Resource> sortedIntersection = new TreeSet<>(new ResourceComparator()); sortedIntersection.addAll(intersection); final TupleExpr joinTree = createJoinTree(new ArrayList<>(sortedIntersection), subVar, conVar); if (joinTree != null) { joins.add(joinTree); } } if (!joins.isEmpty()) { final TupleExpr unionTree = createUnionTree(joins); final Union union = new InferUnion(unionTree, currentNode); node.replaceWith(union); log.trace("Replacing node with inferred intersection union: " + union); } } } }
Source:
<code>public Builder setDataForm(DataForm dataForm) { <START> if (dataForm.getTitle() != null || dataForm.getItems().size() != 0 <END> || dataForm.getReportedData() != null || dataForm.getInstructions().size() != 0) { throw new IllegalArgumentException("Illegal Arguements for SoftwareInformation"); } FormField field = dataForm.getHiddenFormTypeField(); if (field != null) { String value = field.getFirstValue(); if (value.equals(SoftwareInfoForm.FORM_TYPE)) { this.dataFormBuilder = dataForm.asBuilder(); return this; } else { throw new IllegalArgumentException("Malformed FORM_TYPE Formfield encountered"); } } else { throw new IllegalArgumentException("FORM_TYPE Formfield missing"); } }</code><technical_language>habit of size() == 0 (or inverse), isEmpty() more idiomatic (if availble)</technical_language>

Target:
public Builder setDataForm(DataForm dataForm) { if (dataForm.getTitle() != null || !dataForm.getItems().isEmpty() || dataForm.getReportedData() != null || !dataForm.getInstructions().isEmpty()) { throw new IllegalArgumentException("Illegal Arguements for SoftwareInformation"); } String formTypeValue = dataForm.getFormType(); if (formTypeValue == null) { throw new IllegalArgumentException("FORM_TYPE Formfield missing"); } if (!formTypeValue.equals(SoftwareInfoForm.FORM_TYPE)) { throw new IllegalArgumentException("Malformed FORM_TYPE Formfield encountered"); } this.dataFormBuilder = dataForm.asBuilder(); return this; }
Source:
<code>private Image getEditorImage(StagingEntry diff) { if (diff.isSubmodule()) return SUBMODULE; Image image = DEFAULT; String name = new Path(diff.getPath()).lastSegment(); if (name != null) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry().getImageDescriptor(name); image = (Image) this.resourceManager.get(descriptor); } <START> if (diff.isSymlink()) { <END> image = addSymlinkDecorationToImage(image); } return image; }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
private Image getEditorImage(StagingEntry diff) { if (diff.isSubmodule()) return SUBMODULE; Image image = DEFAULT; String name = new Path(diff.getPath()).lastSegment(); if (name != null) { ImageDescriptor descriptor = PlatformUI.getWorkbench() .getEditorRegistry().getImageDescriptor(name); image = (Image) this.resourceManager.get(descriptor); } if (diff.isSymlink()) { try { IPath diffLocation = diff.getLocation(); if (diffLocation != null) { File diffFile = diffLocation.toFile(); if (diffFile.exists()) { String targetPath = FS.DETECTED.readSymLink(diffFile); if (targetPath != null && new File(diffFile, targetPath).isDirectory()) image = FOLDER; } } } catch (IOException e) { Activator .error(UIText.StagingViewLabelProvider_SymlinkError, e); } image = addSymlinkDecorationToImage(image); } return image; }
Source:
<code>public void toggleCheckMode() throws Exception { if (this.isCommOpen()) { String gcode = GrblUtils.getToggleCheckModeCommand(this.grblVersion, this.grblVersionLetter); if (!"".equals(gcode)) { GcodeCommand command = createCommand(gcode); this.sendCommandImmediately(command); <START> if (getControlState() == COMM_CHECK) { <END> setSingleStepMode(temporaryCheckSingleStepMode); } else if (getControlState() == COMM_IDLE) { temporaryCheckSingleStepMode = getSingleStepMode(); setSingleStepMode(true); } return; } } super.toggleCheckMode(); }</code><technical_language>This if/else in handleStatusString (i.e. in case a soft reset external button press changes state out of CHECK mode)</technical_language>

Target:
public void toggleCheckMode() throws Exception { if (this.isCommOpen()) { String gcode = GrblUtils.getToggleCheckModeCommand(this.grblVersion, this.grblVersionLetter); if (!"".equals(gcode)) { GcodeCommand command = createCommand(gcode); this.sendCommandImmediately(command); return; } } super.toggleCheckMode(); }