auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>@Override protected WORKFLOWAPP getWorkflow(Cluster src, Cluster target) throws FalconException { WORKFLOWAPP workflow = new WORKFLOWAPP(); String wfName = EntityUtil.getWorkflowName(Tag.REPLICATION, Arrays.asList(src.getName()), entity).toString(); String start = REPLICATION_ACTION_NAME; if (shouldPreProcess()) { ACTION action = getPreProcessingAction(false, Tag.REPLICATION); addHDFSServersConfig(action, src, target); addTransition(action, REPLICATION_ACTION_NAME, FAIL_POSTPROCESS_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(action); start = PREPROCESS_ACTION_NAME; } ACTION replication = unmarshalAction(REPLICATION_ACTION_TEMPLATE); addHDFSServersConfig(replication, src, target); addAdditionalReplicationProperties(replication); enableCounters(replication); <START> if (!Boolean.parseBoolean(ENABLE_POSTPROCESSING)){ <END> addTransition(replication, OK_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(replication); }else { addTransition(replication, SUCCESS_POSTPROCESS_ACTION_NAME, FAIL_POSTPROCESS_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(replication); ACTION success = getSuccessPostProcessAction(); addHDFSServersConfig(success, src, target); addTransition(success, OK_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(success); ACTION fail = getFailPostProcessAction(); addHDFSServersConfig(fail, src, target); addTransition(fail, FAIL_ACTION_NAME, FAIL_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(fail); } decorateWorkflow(workflow, wfName, start); return workflow; }</code><technical_language>add a method in super class FSReplicationWorkflowBuilder, FeedRetentionWorkflowBuilder ProcessExecutionWorkflowBuilder</technical_language>

Target:
@Override protected WORKFLOWAPP getWorkflow(Cluster src, Cluster target) throws FalconException { WORKFLOWAPP workflow = new WORKFLOWAPP(); String wfName = EntityUtil.getWorkflowName(Tag.REPLICATION, Arrays.asList(src.getName()), entity).toString(); String start = REPLICATION_ACTION_NAME; if (shouldPreProcess()) { ACTION action = getPreProcessingAction(false, Tag.REPLICATION); addHDFSServersConfig(action, src, target); addTransition(action, REPLICATION_ACTION_NAME, FAIL_POSTPROCESS_ACTION_NAME); workflow.getDecisionOrForkOrJoin().add(action); start = PREPROCESS_ACTION_NAME; } ACTION replication = unmarshalAction(REPLICATION_ACTION_TEMPLATE); addHDFSServersConfig(replication, src, target); addAdditionalReplicationProperties(replication); enableCounters(replication); enableTDE(replication); addPostProcessing(workflow, replication); decorateWorkflow(workflow, wfName, start); return workflow; }
Source:
<code><START> protected ApiConnection( <END> @JsonProperty("baseUrl") String apiBaseUrl, @JsonProperty("cookies") Map<String, String> cookies, @JsonProperty("username") String username, @JsonProperty("loggedIn") boolean loggedIn) { this.apiBaseUrl = apiBaseUrl; this.username = username; this.cookies = cookies; this.loggedIn = loggedIn; }</code><technical_language>making package-private? cleaner protected</technical_language>

Target:
private ApiConnection( @JsonProperty("baseUrl") String apiBaseUrl, @JsonProperty("cookies") Map<String, String> cookies, @JsonProperty("username") String username, @JsonProperty("loggedIn") boolean loggedIn) { this.apiBaseUrl = apiBaseUrl; this.username = username; this.cookies = cookies; this.loggedIn = loggedIn; }
Source:
<code>protected void onPostExecute(String templatesList) { super.onPostExecute(templatesList); if (progressDialog != null && progressDialog.isShowing() && !((Activity) context).isFinishing()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && !((Activity) context).isDestroyed()) { progressDialog.dismiss(); } else { <START> progressDialog.dismiss(); <END> } } if (Utils.checkForNetworkError(exception)) { showDialog(R.string.error_internet_connection); return; } if (onFetchTemplatesCompleteListener != null) { onFetchTemplatesCompleteListener.onFetchTemplatesComplete(templatesList); } }</code><technical_language>if else construct is redundant ;)</technical_language>

Target:
protected void onPostExecute(String templatesList) { super.onPostExecute(templatesList); if (progressDialog != null && progressDialog.isShowing() && !((Activity) context).isFinishing()) { progressDialog.dismiss(); } if (!networkAvailable) { ToastUtil.showError(context, R.string.error_internet_connection); return; } else if (message != null) { ToastUtil.showError(context, message); return; } onFetchTemplatesCompleteListener.onFetchTemplatesComplete(templatesList); }
Source:
<code>public String getAsHtml() throws OseeCoreException { <START> BranchQuery query = orcsApi.getQueryFactory().branchQuery(); <END> ResultSet<BranchReadable> results = query.andUuids(branchId.getId()).getResults(); HtmlWriter writer = new HtmlWriter(uriInfo); return writer.toHtml(results); }</code><technical_language>do need getId() here</technical_language>

Target:
public String getAsHtml() throws OseeCoreException { BranchQuery query = orcsApi.getQueryFactory().branchQuery(); ResultSet<BranchReadable> results = query.andIds(branchId).getResults(); HtmlWriter writer = new HtmlWriter(uriInfo); return writer.toHtml(results); }
Source:
<code>private void addEntryAddressToEnd(long entryAddress) { if (trace) { <START> log.tracef("Updating LRU contents for new entry 0x%016x", entryAddress); <END> } if (lastAddress == 0) { firstAddress = entryAddress; lastAddress = entryAddress; OffHeapLruNode.setPrevious(entryAddress, 0); } else { OffHeapLruNode.setPrevious(entryAddress, lastAddress); OffHeapLruNode.setNext(lastAddress, entryAddress); lastAddress = entryAddress; } OffHeapLruNode.setNext(entryAddress, 0); }</code><technical_language>too, "Adding entry 0x%016x end of LRU list"</technical_language>

Target:
private void addEntryAddressToEnd(long entryAddress) { if (trace) { log.tracef("Adding entry 0x%016x to the end of the LRU list", entryAddress); } if (lastAddress == 0) { firstAddress = entryAddress; lastAddress = entryAddress; OffHeapLruNode.setPrevious(entryAddress, 0); } else { OffHeapLruNode.setPrevious(entryAddress, lastAddress); OffHeapLruNode.setNext(lastAddress, entryAddress); lastAddress = entryAddress; } OffHeapLruNode.setNext(entryAddress, 0); }
Source:
<code>private Span serverRequest(Tracing brave, String serviceName, Exchange exchange) { ZipkinState state = exchange.getProperty(ZipkinState.KEY, ZipkinState.class); if (state == null) { state = new ZipkinState(); exchange.setProperty(ZipkinState.KEY, state); } Span span = null; if (ObjectHelper.isEmpty(EXTRACTOR.extract(exchange.getIn()))) { span = brave.tracer().nextSpan(); INJECTOR.inject(span.context(), exchange.getIn()); <START> <END> } else { span = brave.tracer().nextSpan(EXTRACTOR.extract(exchange.getIn())); } span.kind(Span.Kind.SERVER).start(); ZipkinServerRequestAdapter parser = new ZipkinServerRequestAdapter(this, exchange); parser.onRequest(exchange, span.customizer()); state.pushServerSpan(span); if (LOG.isDebugEnabled()) { TraceContext context = span.context(); String traceId = "" + context.traceIdString(); String spanId = "" + context.spanId(); String parentId = context.parentId() != null ? "" + context.parentId() : null; if (parentId != null) { LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId)); } else { LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId)); } } return span; }</code><technical_language>Remove empty line</technical_language>

Target:
private Span serverRequest(Tracing brave, String serviceName, Exchange exchange) { ZipkinState state = exchange.getProperty(ZipkinState.KEY, ZipkinState.class); if (state == null) { state = new ZipkinState(); exchange.setProperty(ZipkinState.KEY, state); } Span span = null; TraceContextOrSamplingFlags sampleFlag = EXTRACTOR.extract(exchange.getIn()); if (ObjectHelper.isEmpty(sampleFlag)) { span = brave.tracer().nextSpan(); INJECTOR.inject(span.context(), exchange.getIn()); } else { span = brave.tracer().nextSpan(sampleFlag); } span.kind(Span.Kind.SERVER).start(); ZipkinServerRequestAdapter parser = new ZipkinServerRequestAdapter(this, exchange); parser.onRequest(exchange, span.customizer()); state.pushServerSpan(span); if (LOG.isDebugEnabled()) { TraceContext context = span.context(); String traceId = "" + context.traceIdString(); String spanId = "" + context.spanId(); String parentId = context.parentId() != null ? "" + context.parentId() : null; if (parentId != null) { LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s, parentId=%20s]", serviceName, traceId, spanId, parentId)); } else { LOG.debug(String.format("serverRequest [service=%s, traceId=%20s, spanId=%20s]", serviceName, traceId, spanId)); } } return span; }
Source:
<code><START> public JSON getRepositories(String path) throws IOException { <END> final List<JSON> repositories = new ArrayList<>(addresses.length); for (String address : addresses) { repositories.add(getJSON(address + path)); } final JSONArray result = new JSONArray(); final List<String> pluginsIDs = new ArrayList<>(); for (JSON json : repositories) { if (!(json instanceof JSONArray)) { throw new RuntimeException("Result is not array"); } for (Object elm : (JSONArray) json) { String id = ((JSONObject) elm).getString("id"); if (!pluginsIDs.contains(id)) { pluginsIDs.add(id); result.add(elm); } else { log.info("Plugin " + id + " will be skipped, because it is duplicated."); } } } return result; }</code><technical_language>protected</technical_language>

Target:
protected JSONArray getRepositories(String path) throws IOException { final List<JSON> repositories = new ArrayList<>(addresses.length); for (String address : addresses) { repositories.add(getJSON(address + path)); } final JSONArray result = new JSONArray(); final List<String> pluginsIDs = new ArrayList<>(); for (JSON json : repositories) { if (!(json instanceof JSONArray)) { throw new RuntimeException("Result is not array"); } for (Object elm : (JSONArray) json) { String id = ((JSONObject) elm).getString("id"); if (!pluginsIDs.contains(id)) { pluginsIDs.add(id); result.add(elm); } else { log.info("Plugin " + id + " will be skipped, because it is duplicated."); } } } return result; }
Source:
<code>public final RedirectAction getLogoutRedirectAction(final WebContext context) { <START> if (ajaxRequestResolver.isAjax(context)) { <END> logger.info("AJAX request detected -> returning 401"); cleanRequestedUrl(context); return null; } final String attemptedAuth = (String) context.getSessionAttribute(getName() + ATTEMPTED_AUTHENTICATION_SUFFIX); if (CommonHelper.isNotBlank(attemptedAuth)) { return null; } init(context); return retrieveLogoutRedirectAction(context); }</code><technical_language>checks necessary for logout</technical_language>

Target:
public final RedirectAction getLogoutRedirectAction(final WebContext context) { init(context); return retrieveLogoutRedirectAction(context); }
Source:
<code>private void processBundle(Bundle bundle, int state) { <START> boolean isActive = true; <END> boolean isStopping = false; if (state == Bundle.ACTIVE || state == Bundle.STARTING || state == Bundle.INSTALLED || state == Bundle.RESOLVED) { isActive = true; } else if (state == Bundle.STOPPING) { isStopping = true; } if (isActive && hasWebResourceHeader(bundle)) { addBundle(bundle); } else if (isStopping && hasWebResourceHeader(bundle)) { removeBundle(bundle); } }</code><technical_language>this initialized false</technical_language>

Target:
private void processBundle(Bundle bundle, int state) { boolean isActive = false; boolean isStopping = false; if (state == Bundle.ACTIVE || state == Bundle.STARTING || state == Bundle.INSTALLED || state == Bundle.RESOLVED) { isActive = true; } else if (state == Bundle.STOPPING) { isStopping = true; } if (isActive && hasWebResourceHeader(bundle)) { addBundle(bundle); } else if (isStopping && hasWebResourceHeader(bundle)) { removeBundle(bundle); } }
Source:
<code>public HtmlMetacardUtility(String htmlTemplate) { try { this.mimeType = new MimeType("text/html"); } catch (MimeTypeParseException e) { LOGGER.warn("Failed to apply mimetype text/html"); <START> } <END> this.htmlTemplate = htmlTemplate; this.templateLoader = new ClassPathTemplateLoader(); this.templateLoader.setPrefix(TEMPLATE_DIRECTORY); this.templateLoader.setSuffix(TEMPLATE_SUFFIX); this.handlebars = new Handlebars(this.templateLoader); this.resolvers = new ValueResolver[] { FieldValueResolver.INSTANCE, MapValueResolver.INSTANCE, JavaBeanValueResolver.INSTANCE }; this.registerHelpers(); try { this.template = this.handlebars.compile(htmlTemplate); } catch (IOException e) { LOGGER.warn("Failed to compile handlebars template {}", HTML_TEMPLATE, e); } }</code><technical_language>Mimetype change, pull this a static block</technical_language>

Target:
public HtmlMetacardUtility(String htmlTemplate) { this.htmlTemplate = htmlTemplate; this.templateLoader = new ClassPathTemplateLoader(); this.templateLoader.setPrefix(TEMPLATE_DIRECTORY); this.templateLoader.setSuffix(TEMPLATE_SUFFIX); this.handlebars = new Handlebars(this.templateLoader); this.resolvers = new ValueResolver[] { FieldValueResolver.INSTANCE, MapValueResolver.INSTANCE, JavaBeanValueResolver.INSTANCE, MethodValueResolver.INSTANCE }; try { this.template = this.handlebars.compile(htmlTemplate); } catch (IOException e) { LOGGER.warn("Failed to compile handlebars template {}", HTML_TEMPLATE, e); } }
Source:
<code>public static KafkaDestination parse(String uri) { Validate.isTrue(uri.startsWith(SCHEME_KAFKA) || uri.startsWith(SCHEME_SECURE_KAFKA), "Invalid scheme in URI: " + uri); try { uri = URIUtil.decode(uri); } catch (Exception e) { throw new DatastreamRuntimeException("Failed to decode Kafka destination URI: " + uri, e); } URI u = URI.create(uri); String scheme = u.getScheme(); <START> String address = u.getAuthority(); <END> String path = u.getPath(); String topicName; int lastSlash = path.lastIndexOf("/"); if (lastSlash > 0) { address += path.substring(0, lastSlash); topicName = path.substring(lastSlash + 1); } else { topicName = path.substring(1); } long portNo = u.getPort(); Validate.notBlank(address, "Missing zkAddress in URI: " + uri); Validate.notBlank(topicName, "Missing topic name in URI: " + uri); Validate.isTrue(portNo != -1, "Missing port number in URI: " + uri); boolean isSecure = scheme.equals(SCHEME_SECURE_KAFKA); return new KafkaDestination(address, topicName, isSecure); }</code><technical_language>call zkAddress</technical_language>

Target:
public static KafkaDestination parse(String uri) { Validate.isTrue(uri.startsWith(SCHEME_KAFKA) || uri.startsWith(SCHEME_SECURE_KAFKA), "Invalid scheme in URI: " + uri); try { uri = URIUtil.decode(uri); } catch (Exception e) { throw new DatastreamRuntimeException("Failed to decode Kafka destination URI: " + uri, e); } URI u = URI.create(uri); String scheme = u.getScheme(); String zkAddress = u.getAuthority(); String path = u.getPath(); String topicName; int lastSlash = path.lastIndexOf("/"); if (lastSlash > 0) { zkAddress += path.substring(0, lastSlash); topicName = path.substring(lastSlash + 1); } else { topicName = path.substring(1); } long portNo = u.getPort(); Validate.notBlank(zkAddress, "Missing zkAddress in URI: " + uri); Validate.notBlank(topicName, "Missing topic name in URI: " + uri); Validate.isTrue(portNo != -1, "Missing port number in URI: " + uri); boolean isSecure = scheme.equals(SCHEME_SECURE_KAFKA); return new KafkaDestination(zkAddress, topicName, isSecure); }
Source:
<code>protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { boolean isTracing = frame.header.flags.contains(Frame.Header.Flag.TRACING); boolean isCustomPayload = frame.header.flags.contains(Frame.Header.Flag.CUSTOM_PAYLOAD); UUID tracingId = isTracing ? CBUtil.readUUID(frame.body) : null; Map<String, ByteBuffer> customPayload = isCustomPayload ? CBUtil.readBytesMap(frame.body) : null; if (customPayload != null && logger.isTraceEnabled()) { logger.trace("Received payload: ({} bytes total)", printPayload(customPayload), CBUtil.sizeOfBytesMap(customPayload)); } boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING); List<String> warnings = hasWarnings ? CBUtil.readStringList(frame.body) : Collections.<String>emptyList(); try { CodecRegistry codecRegistry = ctx.channel().attr(CODEC_REGISTRY_ATTRIBUTE_KEY).get(); <START> if (codecRegistry == null) <END> codecRegistry = CodecRegistry.DEFAULT_INSTANCE; Response response = Response.Type.fromOpcode(frame.header.opcode).decoder.decode(frame.body, frame.header.version, codecRegistry); response .setTracingId(tracingId) .setWarnings(warnings) .setCustomPayload(customPayload) .setStreamId(frame.header.streamId); out.add(response); } finally { frame.body.release(); } }</code><technical_language>codecRegistry realistically null? good this assert instead of falling DEFAULT_INSTANCE</technical_language>

Target:
protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception { boolean isTracing = frame.header.flags.contains(Frame.Header.Flag.TRACING); boolean isCustomPayload = frame.header.flags.contains(Frame.Header.Flag.CUSTOM_PAYLOAD); UUID tracingId = isTracing ? CBUtil.readUUID(frame.body) : null; Map<String, ByteBuffer> customPayload = isCustomPayload ? CBUtil.readBytesMap(frame.body) : null; if (customPayload != null && logger.isTraceEnabled()) { logger.trace("Received payload: ({} bytes total)", printPayload(customPayload), CBUtil.sizeOfBytesMap(customPayload)); } boolean hasWarnings = frame.header.flags.contains(Frame.Header.Flag.WARNING); List<String> warnings = hasWarnings ? CBUtil.readStringList(frame.body) : Collections.<String>emptyList(); try { CodecRegistry codecRegistry = ctx.channel().attr(CODEC_REGISTRY_ATTRIBUTE_KEY).get(); assert codecRegistry != null; Response response = Response.Type.fromOpcode(frame.header.opcode).decoder.decode(frame.body, frame.header.version, codecRegistry); response .setTracingId(tracingId) .setWarnings(warnings) .setCustomPayload(customPayload) .setStreamId(frame.header.streamId); out.add(response); } finally { frame.body.release(); } }
Source:
<code>public static String locationToString(Location location) { <START> return location.getLatitude() + " " + location.getLongitude() + " " + location.getAltitude() + " " + location.getAccuracy(); <END> }</code><technical_language>Is String.format a option here</technical_language>

Target:
public static String locationToString(Location location) { return String.format("%s %s %s %s", location.getLatitude(), location.getLongitude(), location.getAltitude(), location.getAccuracy()); }
Source:
<code>public CharSequence toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this); if (height != null && width != null) { <START> xml.attribute(attribute_height, Integer.toString(height)); <END> xml.attribute(attribute_width, Integer.toString(width)); } xml.rightAngleBracket(); xml.append(getMediaXML()); return xml.closeElement(getElementName()); }</code><technical_language>xml.attribute(name, height) sufficient. I.e. Integer.toString() is unnecessary</technical_language>

Target:
public CharSequence toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this); if (height != null && width != null) { xml.attribute(ATTRIBUTE_HEIGHT, height); xml.attribute(ATTRIBUTE_WIDTH, width); } xml.rightAngleBracket(); xml.append(getMediaXML()); return xml.closeElement(getElementName()); }
Source:
<code>public void index(ObjectStream<Event> eventStream) throws IOException{ int cutoff=parameters.getIntParam(CUTOFF_PARAM, CUTOFF_DEFAULT); boolean sort=parameters.getBooleanParam(SORT_PARAM, SORT_DEFAULT); Map<String, Integer> predicateIndex = new HashMap<>(); <START> LinkedList<Event> events; <END> List<ComparableEvent> eventsToCompare; System.out.println("Indexing events using cutoff of " + cutoff + "\n"); System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream, predicateIndex, cutoff); System.out.println("done. " + events.size() + " events"); System.out.print("\tIndexing... "); eventsToCompare = index(events, predicateIndex); events = null; predicateIndex = null; System.out.println("done."); System.out.print("Sorting and merging events... "); sortAndMerge(eventsToCompare, sort); System.out.println("Done indexing."); }</code><technical_language>interface List LHS</technical_language>

Target:
public void index(ObjectStream<Event> eventStream) throws IOException { int cutoff = parameters.getIntParam(CUTOFF_PARAM, CUTOFF_DEFAULT); boolean sort = parameters.getBooleanParam(SORT_PARAM, SORT_DEFAULT); Map<String, Integer> predicateIndex = new HashMap<>(); List<Event> events; List<ComparableEvent> eventsToCompare; System.out.println("Indexing events using cutoff of " + cutoff + "\n"); System.out.print("\tComputing event counts... "); events = computeEventCounts(eventStream, predicateIndex, cutoff); System.out.println("done. " + events.size() + " events"); System.out.print("\tIndexing... "); eventsToCompare = index(events, predicateIndex); events = null; predicateIndex = null; System.out.println("done."); System.out.print("Sorting and merging events... "); sortAndMerge(eventsToCompare, sort); System.out.println("Done indexing."); }
Source:
<code>public void testPrivateMethod() throws Exception { class Foo { @ServiceActivator private String service(String payload) { return payload.toUpperCase(); } } MessagingMethodInvokerHelper helper = new MessagingMethodInvokerHelper(new Foo(), ServiceActivator.class, false); <START> assertEquals("FOO", helper.process(new GenericMessage<>("foo"))); <END> }</code><technical_language>add assertEquals("BAR", helper.process(new GenericMessage<>("bar"))); exhibit caching problem (in a debugger)</technical_language>

Target:
public void testPrivateMethod() throws Exception { class Foo { @ServiceActivator private String service(String payload) { return payload.toUpperCase(); } } MessagingMethodInvokerHelper helper = new MessagingMethodInvokerHelper(new Foo(), ServiceActivator.class, false); assertEquals("FOO", helper.process(new GenericMessage<>("foo"))); assertEquals("BAR", helper.process(new GenericMessage<>("bar"))); }
Source:
<code>public Set<ModelElementId> getAllInvolvedModelElements(AbstractChangePackage changePackage) { final Set<ModelElementId> result = new LinkedHashSet<ModelElementId>(); final <START> ESCloseableIterable<AbstractOperation> <END> operations = changePackage.operations(); for (final AbstractOperation op : operations.iterable()) { result.addAll(op.getAllInvolvedModelElements()); } return result; }</code><technical_language>closed</technical_language>

Target:
public Set<ModelElementId> getAllInvolvedModelElements(AbstractChangePackage changePackage) { final Set<ModelElementId> result = new LinkedHashSet<ModelElementId>(); final ESCloseableIterable<AbstractOperation> operations = changePackage.operations(); try { for (final AbstractOperation op : operations.iterable()) { result.addAll(op.getAllInvolvedModelElements()); } } finally { operations.close(); } return result; }
Source:
<code>private String determineHeliosHost(final Info dockerInfo) throws HeliosDeploymentException { <START> if (dockerHostAddressIsLocalhost() && !isDockerForMac(dockerInfo)) { <END> log.info("checking that docker can be reached from within a container"); return checkDockerAndGetGateway(); } return dockerHost.address(); }</code><technical_language>need determine gateway, in running probe container Docker for Mac? For context, checkDockerAndGetGateway() separate methods distinct responsibilities - test communicate Docker container another determine gateway IP container. merged spun Docker image for reasons</technical_language>

Target:
private String determineHeliosHost(final Info dockerInfo) throws HeliosDeploymentException { final String probeContainerGateway = checkDockerAndGetGateway(); if (dockerHostAddressIsLocalhost() && !isDockerForMac(dockerInfo)) { log.info("checking that docker can be reached from within a container"); return probeContainerGateway; } return dockerHost.address(); }
Source:
<code>void shouldWriteMultiplePolygonsPerName() throws Exception { final Map<String, List<Polygon>> polygonListsByName = Map.of( "Belarus", List.of(polygon(new Point(1011, 1021), new Point(1012, 1022), new Point(1013, 1023))), "54 Sea Zone", List.of( polygon(new Point(2011, 2021), new Point(2012, 2022), new Point(2013, 2023)), polygon(new Point(2111, 2121), new Point(2112, 2122), new Point(2113, 2123))), "Philippines", List.of( polygon(new Point(3011, 3021), new Point(3012, 3022), new Point(3013, 3023)), polygon(new Point(3111, 3121), new Point(3112, 3122)), polygon(new Point(3211, 3221)))); final String content = writeToString(os -> PointFileReaderWriter.writeOneToManyPolygons(os, polygonListsByName)); assertThat(content, containsString("Belarus < (1011,1021) (1012,1022) (1013,1023) > ")); assertThat( content, containsString( "54 Sea Zone < (2011,2021) (2012,2022) (2013,2023) > " + " < (2111,2121) (2112,2122) (2113,2123) > ")); assertThat( content, <START> containsString( <END> "Philippines < (3011,3021) (3012,3022) (3013,3023) > " + " < (3111,3121) (3112,3122) > < (3211,3221) > ")); }</code><technical_language>line endings</technical_language>

Target:
void shouldWriteMultiplePolygonsPerName() throws Exception { final Map<String, List<Polygon>> polygonListsByName = ImmutableMap.of( "Belarus", List.of(polygon(new Point(1011, 1021), new Point(1012, 1022), new Point(1013, 1023))), "54 Sea Zone", List.of( polygon(new Point(2011, 2021), new Point(2012, 2022), new Point(2013, 2023)), polygon(new Point(2111, 2121), new Point(2112, 2122), new Point(2113, 2123))), "Philippines", List.of( polygon(new Point(3011, 3021), new Point(3012, 3022), new Point(3013, 3023)), polygon(new Point(3111, 3121), new Point(3112, 3122)), polygon(new Point(3211, 3221)))); final String content = writeToString(os -> PointFileReaderWriter.writeOneToManyPolygons(os, polygonListsByName)); assertThat( content, is( "" + "Belarus < (1011,1021) (1012,1022) (1013,1023) > \r\n" + "54 Sea Zone < (2011,2021) (2012,2022) (2013,2023) > " + " < (2111,2121) (2112,2122) (2113,2123) > \r\n" + "Philippines < (3011,3021) (3012,3022) (3013,3023) > " + " < (3111,3121) (3112,3122) > < (3211,3221) > ")); }
Source:
<code>public void deleteUnauthorizedEPersonNoAdminRights() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) <START> .build(); <END> String token = getAuthToken(eperson.getEmail(), password); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient(token) .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }</code><technical_language>turn auth system creating test data</technical_language>

Target:
public void deleteUnauthorizedEPersonNoAdminRights() throws Exception { context.turnOffAuthorisationSystem(); MetadataField metadataField = MetadataFieldBuilder.createMetadataField(context, ELEMENT, QUALIFIER, SCOPE_NOTE) .build(); context.restoreAuthSystemState(); String token = getAuthToken(eperson.getEmail(), password); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); getClient(token) .perform(delete("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isForbidden()); getClient().perform(get("/api/core/metadatafields/" + metadataField.getID())) .andExpect(status().isOk()); }
Source:
<code>public void saveConfig(DiskQuotaConfig config) throws IOException, ConfigurationException { if (!resourceProvider.hasOutput()) { log.error("Unable to save DiskQuota to resource :" + resourceProvider.getLocation()); return; } XStream xStream = getConfiguredXStream(new GeoWebCacheXStream()); log.debug("Saving disk quota config to " + resourceProvider.getLocation()); <START> OutputStream configOut = resourceProvider.out(); <END> try { xStream.toXML(config, new OutputStreamWriter(configOut, "UTF-8")); } catch (RuntimeException e) { log.error("Error saving DiskQuota config to file :" + resourceProvider.getLocation()); } finally { configOut.close(); } }</code><technical_language>try-with-resources</technical_language>

Target:
public void saveConfig(DiskQuotaConfig config) throws IOException, ConfigurationException { if (!resourceProvider.hasOutput()) { log.error("Unable to save DiskQuota to resource :" + resourceProvider.getLocation()); return; } XStream xStream = getConfiguredXStream(new GeoWebCacheXStream()); log.debug("Saving disk quota config to " + resourceProvider.getLocation()); try (OutputStream configOut = resourceProvider.out()) { xStream.toXML(config, new OutputStreamWriter(configOut, "UTF-8")); } catch (RuntimeException e) { log.error("Error saving DiskQuota config to file :" + resourceProvider.getLocation()); } }
Source:
<code>public void evacuateServer() throws Exception { respondWith(JSON_SERVER_EVACUATE); ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); <START> assertNotNull(password.getPassword()); <END> }</code><technical_language>thing: Instead of assertNotNull(..)maybe assertEquals(password.getPassword(), "MySecretPass")</technical_language>

Target:
public void evacuateServer() throws Exception { respondWith(JSON_SERVER_EVACUATE); ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false)); assertEquals(password.getPassword(), "MySecretPass"); }
Source:
<code>private void updateLogPanel(Integer days) { logPanel.clearLogPanel(); Date trackDay = null; for (int i = gui.getCampaign().inMemoryLogHistory.size()-1; i >= 0; i--) { <START> long diff = gui.getCampaign().getDate().getTime() - gui.getCampaign().inMemoryLogHistory.get(i).getDate().getTime(); <END> if (TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS) < days) { if (!gui.getCampaign().inMemoryLogHistory.get(i).getDate().equals(trackDay)) { logPanel.appendLog(Collections.singletonList("<hr>")); logPanel.appendLog(Collections.singletonList("<b>"+dateFormat.format(gui.getCampaign().inMemoryLogHistory.get(i).getDate())+"</b>")); logPanel.appendLog(Collections.singletonList("<br><br>")); trackDay = gui.getCampaign().inMemoryLogHistory.get(i).getDate(); } logPanel.appendLog(Collections.singletonList(gui.getCampaign().inMemoryLogHistory.get(i).getDesc()+"<br>")); } } }</code><technical_language>Avoid indexers get(n) a linked list, traverse index n get there. Switch a for loop elements instead</technical_language>

Target:
private void updateLogPanel(Integer days) { logPanel.clearLogPanel(); Date trackDay = null; long currentTime = gui.getCampaign().getDate().getTime(); for (LogEntry log : gui.getCampaign().inMemoryLogHistory) { long diff = currentTime - log.getDate().getTime(); if (TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS) < days) { if (!log.getDate().equals(trackDay)) { logPanel.appendLog(Collections.singletonList("<hr>")); logPanel.appendLog(Collections.singletonList("<b>"+dateFormat.format(log.getDate())+"</b>")); logPanel.appendLog(Collections.singletonList("<br><br>")); trackDay = log.getDate(); } logPanel.appendLog(Collections.singletonList(log.getDesc()+"<br>")); } } }
Source:
<code>public static SnomedIdentifier of(String componentId) { checkArgument(!Strings.isNullOrEmpty(componentId), "ComponentId must be defined"); <START> checkArgument(componentId.length() >= 6 && componentId.length() <= 18, "ComponentID's length should be between 6-18 character length"); <END> final int checkDigit = Character.getNumericValue(componentId.charAt(componentId.length() - 1)); final int componentIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 2)); final int partitionIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 3)); final String namespace = partitionIdentifier == 0 ? null : componentId.substring(componentId.length() - 10, componentId.length() - 3); final long itemId = partitionIdentifier == 0 ? Long.parseLong(componentId.substring(0, componentId.length() - 3)) : Long .parseLong(componentId.substring(0, componentId.length() - 10)); return new SnomedIdentifierImpl(itemId, namespace, partitionIdentifier, componentIdentifier, checkDigit); }</code><technical_language>Additional validation candidates: - ID start leading zeroes; - Check digit passes Verhoeff-check; - parse a long ParseException</technical_language>

Target:
public static SnomedIdentifier of(String componentId) { validate(componentId); final int checkDigit = Character.getNumericValue(componentId.charAt(componentId.length() - 1)); final int componentIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 2)); final int partitionIdentifier = Character.getNumericValue(componentId.charAt(componentId.length() - 3)); final String namespace = partitionIdentifier == 0 ? null : componentId.substring(componentId.length() - 10, componentId.length() - 3); final long itemId = partitionIdentifier == 0 ? Long.parseLong(componentId.substring(0, componentId.length() - 3)) : Long .parseLong(componentId.substring(0, componentId.length() - 10)); return new SnomedIdentifierImpl(itemId, namespace, partitionIdentifier, componentIdentifier, checkDigit); }
Source:
<code>public boolean onPrepareOptionsMenu(Menu menu) { invalidateOptionsMenu(); <START> if (measurement.hasLogFile(this)) <END> menu.findItem(R.id.viewLog).setVisible(false); if (measurement.report_id == null || measurement.report_id.isEmpty()) menu.findItem(R.id.copyExplorerUrl).setVisible(false); return super.onPrepareOptionsMenu(menu); }</code><technical_language>this !measurement.hasLogFile(this)</technical_language>

Target:
public boolean onPrepareOptionsMenu(Menu menu) { invalidateOptionsMenu(); if (!measurement.hasLogFile(this)) menu.findItem(R.id.viewLog).setVisible(false); if (measurement.report_id == null || measurement.report_id.isEmpty()) menu.findItem(R.id.copyExplorerUrl).setVisible(false); return super.onPrepareOptionsMenu(menu); }
Source:
<code>private void preparePOIDialog(int dialogId, Dialog dlg, Bundle args, int title) { Amenity a = (Amenity) args.getSerializable(KEY_AMENITY); Node n = (Node) args.getSerializable(KEY_AMENITY_NODE); dlg.setTitle(title); EditText nameText = ((EditText)dlg.findViewById(R.id.Name)); nameText.setText(a.getName()); EditText openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours)); openingHours.setText(a.getOpeningHours()); EditText streetnameText = ((EditText)dlg.findViewById(R.id.Phone)); streetnameText.setText(a.getPhone()); <START> EditText housenumberText = ((EditText)dlg.findViewById(R.id.housenumber)); <END> housenumberText.setText(a.getSite()); final TableLayout layout = ((TableLayout)dlg.findViewById(R.id.advancedModeTable)); layout.setVisibility(View.GONE); updateType(a); attachListeners(dialogId, dlg, a, n); }</code><technical_language>I R.id.housenumber is correct I layout xml update . good update replace R.id.Phone -> R.id.StreetName well. I this is more a direction commit a working patch</technical_language>

Target:
private void preparePOIDialog(int dialogId, Dialog dlg, Bundle args, int title) { Amenity a = (Amenity) args.getSerializable(KEY_AMENITY); Node n = (Node) args.getSerializable(KEY_AMENITY_NODE); dlg.setTitle(title); EditText nameText = ((EditText)dlg.findViewById(R.id.Name)); nameText.setText(a.getName()); EditText openingHours = ((EditText)dlg.findViewById(R.id.OpeningHours)); openingHours.setText(a.getOpeningHours()); EditText streetnameText = ((EditText)dlg.findViewById(R.id.Streetname)); streetnameText.setText(a.getStreetname()); EditText housenumberText = ((EditText)dlg.findViewById(R.id.Housenumber)); housenumberText.setText(a.getHousenumber()); final TableLayout layout = ((TableLayout)dlg.findViewById(R.id.advancedModeTable)); layout.setVisibility(View.GONE); updateType(a); attachListeners(dialogId, dlg, a, n); }
Source:
<code>void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError( String.format("Attempted to complete action with no result!\n%s", this)); <START> } <END> if (callback != null) { callback.onSuccess(); } }</code><technical_language>nit: spacing is wrong</technical_language>

Target:
@Override void complete(Bitmap result, Picasso.LoadedFrom from) { if (result == null) { throw new AssertionError("Attempted to complete action with no result!\n" + this); } if (callback != null) { callback.onSuccess(); } }
Source:
<code>private static long timeout(Properties props) { int result = 0; String timeout = PGProperty.LOGIN_TIMEOUT.get(props); if (timeout != null) { try { result = Integer.parseInt(timeout); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Couldn't parse loginTimeout value: {0}", timeout); } } <START> if (result == 0) { <END> result = DriverManager.getLoginTimeout(); } return result * 1000L; }</code><technical_language>Pease org.postgresql.PGProperty#isPresent check property presence. result != 0 is a proper check user loginTimeout=0 explicitly disable login timeout</technical_language>

Target:
private static long timeout(Properties props) throws PSQLException { String timeoutVal = props.getProperty(PGProperty.LOGIN_TIMEOUT.getName()); boolean isPresent = (timeoutVal != null) && !timeoutVal.equals(PGProperty.LOGIN_TIMEOUT.getDefaultValue()); long result; if (isPresent) { result = (long) PGProperty.LOGIN_TIMEOUT.getFloat(props) * 1000L; } else { result = DriverManager.getLoginTimeout() * 1000L; } return result; }
Source:
<code>public void start(ComponentContext context) { super.start(context); Collection<MongoDBConnectionConfig> confs = getDescriptors(XP_CONNECTION); confs.forEach(c -> { <START> log.debug("Initializing MongoClient with id={}", c.getId()); <END> clients.put(c.getId(), MongoDBConnectionHelper.newMongoClient(c.server)); }); }</code><technical_language>c::getId</technical_language>

Target:
public void start(ComponentContext context) { super.start(context); Collection<MongoDBConnectionConfig> confs = getDescriptors(XP_CONNECTION); confs.forEach(c -> { log.debug("Initializing MongoClient with id={}", c::getId); clients.put(c.getId(), MongoDBConnectionHelper.newMongoClient(c.server)); }); }
Source:
<code>private List<EntityType> getEntityTypes() { Fetch fetch = new Fetch(); fetch.field(ID); fetch.field(IS_ABSTRACT); fetch.field(INDEXING_DEPTH); Fetch extendsFetch = new Fetch(); extendsFetch.field(ID); fetch.field(EXTENDS, extendsFetch); Fetch attributesFetch = new Fetch(); Fetch refEntityFetch = new Fetch(); refEntityFetch.field(ID); attributesFetch.field(AttributeMetadata.REF_ENTITY_TYPE, refEntityFetch); <START> fetch.field(ATTRIBUTES, attributesFetch); <END> QueryImpl<EntityType> query = new QueryImpl<>(); query.setPageSize(ENTITY_FETCH_PAGE_SIZE); query.setFetch(fetch); List<EntityType> result = newArrayList(); for (int pageNum = 0; result.size() == pageNum * ENTITY_FETCH_PAGE_SIZE; pageNum++) { query.offset(pageNum * ENTITY_FETCH_PAGE_SIZE); dataService.findAll(ENTITY_TYPE_META_DATA, query, EntityType.class).forEach(result::add); } return result; }</code><technical_language>put creation of Fetch in a static initializer block need create time. This clean method a bit</technical_language>

Target:
private List<EntityType> getEntityTypes() { QueryImpl<EntityType> query = new QueryImpl<>(); query.setPageSize(ENTITY_FETCH_PAGE_SIZE); query.setFetch(ENTITY_TYPE_FETCH); List<EntityType> result = newArrayList(); for (int pageNum = 0; result.size() == pageNum * ENTITY_FETCH_PAGE_SIZE; pageNum++) { query.offset(pageNum * ENTITY_FETCH_PAGE_SIZE); dataService.findAll(ENTITY_TYPE_META_DATA, query, EntityType.class).forEach(result::add); } return result; }
Source:
<code>private void generateEclipseRepositoryPom(Model parent, File basedir) throws MojoExecutionException { if (groupId == null) { throw new MojoExecutionException( "groupId parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } if (version == null) { throw new MojoExecutionException( "version parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } Model model = readPomTemplate("repository-pom.xml"); setParent(basedir, model, parent); model.setGroupId(groupId); model.setArtifactId(basedir.getName()); model.setVersion(version); writePom(basedir, model); <START> updateSites.put(basedir, parent); <END> }</code><technical_language>remove this line. needed for aggregator poms I want/need for eclipse-repository</technical_language>

Target:
private void generateEclipseRepositoryPom(Model parent, File basedir) throws MojoExecutionException { if (groupId == null) { throw new MojoExecutionException( "groupId parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } if (version == null) { throw new MojoExecutionException( "version parameter is required to generate pom.xml for Eclipse Repository project " + basedir.getName()); } Model model = readPomTemplate("repository-pom.xml"); setParent(basedir, model, parent); model.setGroupId(groupId); model.setArtifactId(basedir.getName()); model.setVersion(version); writePom(basedir, model); }
Source:
<code>private void onGenerateMap() { try { String generatorVersion = mapGeneratorService.queryMaxSupportedVersion(); String majorVersion = generatorVersion.split("\\.")[0]; <START> if (majorVersion.equals("1")) { <END> GenerateMapController generateMapController = uiService.loadFxml("theme/play/generate_map.fxml"); Pane root = generateMapController.getRoot(); generateMapController.setCreateGameController(this); JFXDialog dialog = uiService.showInDialog(gamesRoot, root, i18n.get("game.generate.dialog")); generateMapController.setOnCloseButtonClickedListener(dialog::close); root.requestFocus(); } else { mapGeneratorService.generateMap().thenAccept(mapName -> { Platform.runLater(() -> { initMapSelection(); mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny().ifPresent(mapBean -> { mapListView.getSelectionModel().select(mapBean); mapListView.scrollTo(mapBean); setSelectedMap(mapBean); }); }); }); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); logger.error("Map generation failed", e); } }</code><technical_language>Doesnt this imply this code needs adjusted major version changes? check for 0 do way, dont need adjust this version 2,3 etc.</technical_language>

Target:
private void onGenerateMap() { try { mapGeneratorService.setGeneratorVersion(mapGeneratorService.queryMaxSupportedVersion()); if (mapGeneratorService.getGeneratorVersion().compareTo(new ComparableVersion("1")) < 0) { mapGeneratorService.generateMap().thenAccept(mapName -> { Platform.runLater(() -> { initMapSelection(); mapListView.getItems().stream() .filter(mapBean -> mapBean.getFolderName().equalsIgnoreCase(mapName)) .findAny() .ifPresent(mapBean -> { mapListView.getSelectionModel().select(mapBean); mapListView.scrollTo(mapBean); setSelectedMap(mapBean); }); }); }); } else { GenerateMapController generateMapController = uiService.loadFxml("theme/play/generate_map.fxml"); Pane root = generateMapController.getRoot(); generateMapController.setCreateGameController(this); JFXDialog dialog = uiService.showInDialog(gamesRoot, root, i18n.get("game.generate.dialog")); generateMapController.setOnCloseButtonClickedListener(dialog::close); root.requestFocus(); } } catch (Exception e) { notificationService.addImmediateErrorNotification(e, "mapGenerator.generationFailed"); log.error("Map generation failed", e); } }
Source:
<code>public static boolean isTransientError(int code) { <START> return code == 406 || code == 408 || code == 500 || code == 502 || code == 503 || code == 504; <END> }</code><technical_language>In general a transient error means temporary recoverable. For 406 CouchDB, is recoverable</technical_language>

Target:
public static boolean isTransientError(int code) { return code == 408 || code == 500 || code == 502 || code == 503 || code == 504; }
Source:
<code>public int compareTo(@NonNull AppIconHandle o) { <START> return 0; <END> }</code><technical_language>Why? This is missing some explanation for AppIconHandles equal</technical_language>

Target:
public int compareTo(@NonNull AppIconHandle o) { return userHandle.equals(o.userHandle) ? componentName.compareTo(o.componentName) : (userHandle.hashCode() - o.userHandle.hashCode()); }
Source:
<code>public String fromBytes(byte[] bytes) { Map<String, Object> values = messageSerde.fromBytes(bytes); CoordinatorStreamMessage message = new CoordinatorStreamMessage(new Object[]{}, values); if (type.equalsIgnoreCase(SetContainerHostMapping.TYPE)) { SetContainerHostMapping hostMapping = new SetContainerHostMapping(message); return hostMapping.getHostLocality(); } else if (type.equalsIgnoreCase(SetTaskContainerMapping.TYPE)) { SetTaskContainerMapping setTaskContainerMapping = new SetTaskContainerMapping(message); return setTaskContainerMapping.getTaskAssignment(); } else if (type.equalsIgnoreCase(SetChangelogMapping.TYPE)) { SetChangelogMapping changelogMapping = new SetChangelogMapping(message); return String.valueOf(changelogMapping.getPartition()); } else if (type.equalsIgnoreCase(SetConfig.TYPE)) { SetConfig setConfig = new SetConfig(message); return setConfig.getConfigValue(); } else if (type.equalsIgnoreCase(SetTaskModeMapping.TYPE)) { SetTaskModeMapping setTaskModeMapping = new SetTaskModeMapping(message); return String.valueOf(setTaskModeMapping.getTaskMode()); } else if (type.equalsIgnoreCase(SetTaskPartitionMapping.TYPE)) { SetTaskPartitionMapping setTaskPartitionMapping = new SetTaskPartitionMapping(message); <START> return setTaskPartitionMapping.getTaskName(); <END> } else { throw new SamzaException(String.format("Unknown coordinator stream message type: %s", type)); } }</code><technical_language>if store array of tasks - method named getTaskNames()</technical_language>

Target:
public String fromBytes(byte[] bytes) { Map<String, Object> values = messageSerde.fromBytes(bytes); CoordinatorStreamMessage message = new CoordinatorStreamMessage(new Object[]{}, values); if (type.equalsIgnoreCase(SetContainerHostMapping.TYPE)) { SetContainerHostMapping hostMapping = new SetContainerHostMapping(message); return hostMapping.getHostLocality(); } else if (type.equalsIgnoreCase(SetTaskContainerMapping.TYPE)) { SetTaskContainerMapping setTaskContainerMapping = new SetTaskContainerMapping(message); return setTaskContainerMapping.getTaskAssignment(); } else if (type.equalsIgnoreCase(SetChangelogMapping.TYPE)) { SetChangelogMapping changelogMapping = new SetChangelogMapping(message); return String.valueOf(changelogMapping.getPartition()); } else if (type.equalsIgnoreCase(SetConfig.TYPE)) { SetConfig setConfig = new SetConfig(message); return setConfig.getConfigValue(); } else if (type.equalsIgnoreCase(SetTaskModeMapping.TYPE)) { SetTaskModeMapping setTaskModeMapping = new SetTaskModeMapping(message); return String.valueOf(setTaskModeMapping.getTaskMode()); } else if (type.equalsIgnoreCase(SetTaskPartitionMapping.TYPE)) { SetTaskPartitionMapping setTaskPartitionMapping = new SetTaskPartitionMapping(message); return setTaskPartitionMapping.getTaskNames(); } else { throw new SamzaException(String.format("Unknown coordinator stream message type: %s", type)); } }
Source:
<code><START> protected List<SortInfo> getSortInfo(MultivaluedMap<String, String> queryParams) { <END> String sortBy = queryParams.getFirst(SORT_BY); String sortOrder = queryParams.getFirst(SORT_ORDER); List<SortInfo> sortInfoList = null; if (!StringUtils.isBlank(sortBy)) { sortInfoList = new ArrayList<>(); String[] sorts = sortBy.split(","); String[] orders = null; if (!StringUtils.isBlank(sortOrder)) { orders = sortOrder.split(","); } for (int i = 0; i < sorts.length; i++) { String sort = sorts[i]; boolean sortAscending = (orders != null && orders.length > i && "asc".equals(orders[i].toLowerCase())); sortInfoList.add(new SortInfo(sort, sortAscending)); } } return sortInfoList; }</code><technical_language>#getSortInfo(String sortBy, String sortOrder) patched? Apparently saved searches</technical_language>

Target:
protected List<SortInfo> getSortInfo(MultivaluedMap<String, String> queryParams) { String sortBy = queryParams.getFirst(SORT_BY); String sortOrder = queryParams.getFirst(SORT_ORDER); return getSortInfo(sortBy, sortOrder); }