auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Method findMatchingMethod(Class<?> receiver, String method, Object[] args) { Method candidate = null; for (Method m : receiver.getDeclaredMethods()) { if (m.getName().equals(method) && (matches(m.getParameterTypes(), args, isVargsMethod(m, args)))) { <START> if (candidate == null || isMoreSpecific(m, m.getParameterTypes(), isVargsMethod(m, args), candidate, <END> candidate.getParameterTypes(), isVargsMethod(candidate, args))) { candidate = m; } } } return candidate; }</code><technical_language>introduce variable for varargs check, is longer trivial</technical_language>

Target:
private static Method findMatchingMethod(Class<?> receiver, String method, Object[] args) { Method candidate = null; for (Method m : receiver.getDeclaredMethods()) { boolean isVarArgs = isVarArgsMethod(m, args); if (m.getName().equals(method) && (matches(m.getParameterTypes(), args, isVarArgs))) { if (candidate == null || isMoreSpecific(m, m.getParameterTypes(), isVarArgs, candidate, candidate.getParameterTypes(), isVarArgsMethod(candidate, args))) { candidate = m; } } } return candidate; }
Source:
<code>private static HiveConf createHiveConf(@Nullable String hiveConfDir, @Nullable String hadoopConfDir) { Configuration hadoopConf = null; if (isNullOrWhitespaceOnly(hadoopConfDir)) { for (String possibleHadoopConfPath : HadoopUtils.possibleHadoopConfPaths(new org.apache.flink.configuration.Configuration())) { hadoopConf = getHadoopConfiguration(possibleHadoopConfPath); if (hadoopConf != null) { break; } } } else { hadoopConf = getHadoopConfiguration(hadoopConfDir); } HiveConf hiveConf = new HiveConf(hadoopConf == null ? new Configuration() : hadoopConf, HiveConf.class); LOG.info("Setting hive conf dir as {}", hiveConfDir); if (hiveConfDir != null) { Path hiveSite = new Path(hiveConfDir, "hive-site.xml"); if (!hiveSite.toUri().isAbsolute()) { hiveSite = new Path("file", null, hiveSite.toString()); } hiveConf.addResource(hiveSite); <START> } <END> return hiveConf; }</code><technical_language>new File(..).toURI()</technical_language>

Target:
private static HiveConf createHiveConf(@Nullable String hiveConfDir, @Nullable String hadoopConfDir) { Configuration hadoopConf = null; if (isNullOrWhitespaceOnly(hadoopConfDir)) { for (String possibleHadoopConfPath : HadoopUtils.possibleHadoopConfPaths(new org.apache.flink.configuration.Configuration())) { hadoopConf = getHadoopConfiguration(possibleHadoopConfPath); if (hadoopConf != null) { break; } } } else { hadoopConf = getHadoopConfiguration(hadoopConfDir); } if (hadoopConf == null) { hadoopConf = new Configuration(); } HiveConf hiveConf = new HiveConf(hadoopConf, HiveConf.class); LOG.info("Setting hive conf dir as {}", hiveConfDir); if (hiveConfDir != null) { Path hiveSite = new Path(hiveConfDir, "hive-site.xml"); if (!hiveSite.toUri().isAbsolute()) { hiveSite = new Path(new File(hiveSite.toString()).toURI()); } try (InputStream inputStream = hiveSite.getFileSystem(hadoopConf).open(hiveSite)) { hiveConf.addResource(inputStream, hiveSite.toString()); isEmbeddedMetastore(hiveConf); } catch (IOException e) { throw new CatalogException("Failed to load hive-site.xml from specified path:" + hiveSite, e); } } return hiveConf; }
Source:
<code>public ITmfTimestamp getInitialRangeOffset() { final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); <START> return createTimestamp(DEFAULT_INITIAL_OFFSET_VALUE); <END> }</code><technical_language>if fParser != this? this fParser.createTimestamp</technical_language>

Target:
public ITmfTimestamp getInitialRangeOffset() { final long DEFAULT_INITIAL_OFFSET_VALUE = (1L * 100 * 1000 * 1000); return new TmfNanoTimestamp(DEFAULT_INITIAL_OFFSET_VALUE); }
Source:
<code>public static String getKafkaGroupId(DatastreamTask task, GroupIdConstructor groupIdConstructor, CommonConnectorMetrics consumerMetrics, Logger logger) { try { <START> String result = groupIdConstructor.getTaskGroupId(task, Optional.of(logger)); <END> return result; } catch (Exception e) { consumerMetrics.updateErrorRate(1, "Can't find group ID", e); throw e; } }</code><technical_language>nit: omit result</technical_language>

Target:
public static String getKafkaGroupId(DatastreamTask task, GroupIdConstructor groupIdConstructor, CommonConnectorMetrics consumerMetrics, Logger logger) { try { return groupIdConstructor.getTaskGroupId(task, Optional.of(logger)); } catch (Exception e) { consumerMetrics.updateErrorRate(1, "Can't find group ID", e); throw e; } }
Source:
<code>public boolean processRow(ExportRow rd) throws RestartBlockException { if (!m_primed) checkOnFirstRow(); String pval = (rd.partitionValue == null) ? String.valueOf(rd.partitionId) : rd.partitionValue.toString(); ProducerRecord<String, Object> krec; if (m_encodeType == EncodeType.AVRO) { <START> GenericRecord avroRecord = (GenericRecord) m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names, null, rd.values); <END> krec = new ProducerRecord<>(m_topic, pval, avroRecord); } else { String decoded = (String) m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names, null, rd.values); krec = new ProducerRecord<>(m_topic, pval, decoded); } try { m_futures.add(m_producer.send(krec, new Callback() { @Override public void onCompletion(RecordMetadata metadata, Exception e) { if (e != null){ LOG.warn("Failed to send data. Verify if the kafka server matches bootstrap.servers %s", e, m_decoderProducerConfig.getProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG)); m_failure.compareAndSet(false, true); } } })); } catch (KafkaException e) { LOG.warn("Unable to send %s", e, krec); throw new RestartBlockException("Unable to send message", e, true); } catch (IllegalStateException e) { LOG.warn("Unable to send %s", e, krec); if (m_producer != null) try { m_producer.close(); } catch (Exception ignoreIt) m_primed = false; throw new RestartBlockException("Unable to send message", e, true); } return true; }</code><technical_language>I do understand handle changes in schema. I explicit handling of schema change, is initiated E3Target::processBlock calling ExportDecoderBase::setExportRowSchema</technical_language>

Target:
public boolean processRow(ExportRow rd) throws RestartBlockException { if (!m_primed) checkOnFirstRow(); String pval = (rd.partitionValue == null) ? String.valueOf(rd.partitionId) : rd.partitionValue.toString(); ProducerRecord<String, Object> krec; if (m_encodeFormat == EncodeFormat.AVRO) { AvroDecoder decoder = m_tableAvroDecoderMap.computeIfAbsent(rd.tableName, k -> new AvroDecoder.Builder().build()); GenericRecord avroRecord = decoder.decode(rd.generation, rd.tableName, rd.types, rd.names, null, rd.values); krec = new ProducerRecord<>(m_topic, pval, avroRecord); } else { String decoded = m_csvDecoder.decode(rd.generation, rd.tableName, rd.types, rd.names, null, rd.values); krec = new ProducerRecord<>(m_topic, pval, decoded); } try { m_futures.add(m_producer.send(krec, new Callback() { @Override public void onCompletion(RecordMetadata metadata, Exception e) { if (e != null){ LOG.warn("Failed to send data. Verify if the kafka server matches bootstrap.servers %s", e, m_decoderProducerConfig.getProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG)); m_failure.compareAndSet(false, true); } } })); } catch (KafkaException e) { LOG.warn("Unable to send %s", e, krec); throw new RestartBlockException("Unable to send message", e, true); } catch (IllegalStateException e) { LOG.warn("Unable to send %s", e, krec); if (m_producer != null) try { m_producer.close(); } catch (Exception ignoreIt) m_primed = false; throw new RestartBlockException("Unable to send message", e, true); } return true; }
Source:
<code>public void onClearFieldAnchorClick(final ClickEvent e) { <START> presenter.setValue(""); <END> }</code><technical_language>removing reference presenter.moveDown presenter.moveUp, important remove methods in presenter related code, finish clean up</technical_language>

Target:
public void onClearFieldAnchorClick(final ClickEvent e) { presenter.setValue(""); typedValueSelector.select(); }
Source:
<code>public void test() { ServiceAmbassador ambassador = new ServiceAmbassador(); <START> long result = ambassador.doRemoteFunction(10); <END> assert result == 100 || result == -1; }</code><technical_language>written line</technical_language>

Target:
public void test() { long result = new ServiceAmbassador().doRemoteFunction(10); assert result == 100 || result == -1; }
Source:
<code>public static List<String> getStringsFromJSONArray(JSONArray jsonStringArray) throws JSONException { <START> List<String> stringArray = Lists.newArrayList(); <END> for (int stringIndex = 0; stringIndex < jsonStringArray.length(); stringIndex++) { stringArray.add(jsonStringArray.getString(stringIndex)); } return stringArray; }</code><technical_language>Lists.newArrayListWithCapacity() length of List is known</technical_language>

Target:
public static List<String> getStringsFromJSONArray(JSONArray jsonStringArray) throws JSONException { List<String> stringArray = Lists.newArrayListWithCapacity(jsonStringArray.length()); for (int stringIndex = 0; stringIndex < jsonStringArray.length(); stringIndex++) { stringArray.add(jsonStringArray.getString(stringIndex)); } return stringArray; }
Source:
<code>private boolean checkForOverwrite() { List<TmfTraceElement> traces = fTmfTraceFolder.getTraces(); TracePackageElement[] traceElements = (TracePackageElement[]) getElementViewer().getInput(); for (TracePackageElement packageElement : traceElements) { TracePackageTraceElement traceElement = (TracePackageTraceElement) packageElement; if (!AbstractTracePackageOperation.isFilesChecked(traceElement)) { continue; } for (TmfTraceElement t : traces) { String traceName = traceElement.getText(); if (t.getName().equals(traceName)) { final MessageDialog dialog = new MessageDialog(getContainer() .getShell(), null, null, MessageFormat.format(Messages.ImportTracePackageWizardPage_AlreadyExists, traceName), MessageDialog.QUESTION, new String[] { IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.YES_LABEL, }, 2) { @Override protected int getShellStyle() { return super.getShellStyle() | SWT.SHEET; } }; int code = dialog.open(); final String[] response = new String[] { IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.YES_LABEL }; if (response[code].equals(IDialogConstants.YES_TO_ALL_LABEL)) { return true; } else if (response[code].equals(IDialogConstants.NO_LABEL)) { <START> return false; <END> } } } } return true; }</code><technical_language>a bit strange, if multiple overwrites, if other, operation is cancelled... this behavior button NO_TO_ALL</technical_language>

Target:
private boolean checkForOverwrite() { TracePackageElement[] traceElements = (TracePackageElement[]) getElementViewer().getInput(); List<TracePackageTraceElement> noImportTraces = new ArrayList<TracePackageTraceElement>(); boolean noToAll = false; for (TracePackageElement packageElement : traceElements) { TracePackageTraceElement traceElement = (TracePackageTraceElement) packageElement; if (!AbstractTracePackageOperation.isFilesChecked(traceElement)) { continue; } if (noToAll) { noImportTraces.add(traceElement); continue; } String traceName = traceElement.getText(); if (traceExists(traceName)) { int returnCode = promptForOverwrite(traceName); final String[] response = new String[] { IDialogConstants.NO_TO_ALL_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.YES_TO_ALL_LABEL, IDialogConstants.YES_LABEL }; if (response[returnCode].equals(IDialogConstants.YES_TO_ALL_LABEL)) { break; } else if (response[returnCode].equals(IDialogConstants.NO_TO_ALL_LABEL)) { noToAll = true; noImportTraces.add(traceElement); } else if (response[returnCode].equals(IDialogConstants.NO_LABEL)) { noImportTraces.add(traceElement); } } } for (TracePackageTraceElement t : noImportTraces) { for (TracePackageElement e : t.getChildren()) { if (e instanceof TracePackageFilesElement) { ((TracePackageFilesElement) e).setChecked(false); } } } return true; }
Source:
<code>public List<MemberCandidate> getCompleteCandidates(PerunSession sess, Vo vo, Group group, List<String> attrNames, String searchString, List<ExtSource> extSources) throws InternalErrorException { List<RichUser> richUsers = getRichUsersForMemberCandidates(sess, vo, attrNames, searchString); List<Candidate> candidates = findCandidates(sess, group, searchString, extSources, false); <START> <END> return createMemberCandidates(sess, richUsers, vo, group, candidates, attrNames); }</code><technical_language>adding members group, VO is null call createMemberCandidates() ends null pointer in members manager impl layer. re-get VO a Group pass createMemberCandidates() behavior differ VO is expected non-null</technical_language>

Target:
public List<MemberCandidate> getCompleteCandidates(PerunSession sess, Vo vo, Group group, List<String> attrNames, String searchString, List<ExtSource> extSources) throws InternalErrorException { List<RichUser> richUsers = getRichUsersForMemberCandidates(sess, vo, attrNames, searchString); List<Candidate> candidates = findCandidates(sess, group, searchString, extSources, false); if (vo == null) { vo = getPerunBl().getGroupsManagerBl().getVo(sess, group); } return createMemberCandidates(sess, richUsers, vo, group, candidates, attrNames); }
Source:
<code>private void initEditMessageAction() { NativeMap<ActionInfo> actions = changeInfo.revision(revision).actions(); if (actions != null && actions.containsKey("message")) { editMessage.setVisible(true); <START> editMessageAction = <END> new EditMessageAction(changeInfo.legacy_id(), revision, changeInfo.revision(revision).commit().message(), style, editMessage, reply); keysAction.add(new KeyCommand(0, 'e', Util.C.keyEditMessage()) { @Override public void onKeyPress(KeyPressEvent event) { editMessageAction.onEdit(); } }); } else { editMessage.setVisible(false); } }</code><technical_language>nit: line break arguments = editMessageAction = new EditMessageAction( changeInfo.legacy_id(), ..</technical_language>

Target:
private void initEditMessageAction() { NativeMap<ActionInfo> actions = changeInfo.revision(revision).actions(); if (actions != null && actions.containsKey("message")) { editMessage.setVisible(true); editMessageAction = new EditMessageAction( changeInfo.legacy_id(), revision, changeInfo.revision(revision).commit().message(), style, editMessage, reply); keysAction.add(new KeyCommand(0, 'e', Util.C.keyEditMessage()) { @Override public void onKeyPress(KeyPressEvent event) { editMessageAction.onEdit(); } }); } }
Source:
<code>private void completeInner() { if (WIP_FOR_UNSUBSCRIBE_UPDATER.decrementAndGet(this) == 0) { <START> unsubscribe(); <END> } if (groups.isEmpty() && (terminated == 1 || child.isUnsubscribed())) { if (COMPLETION_EMITTED_UPDATER.compareAndSet(this, 0, 1)) { if (child.isUnsubscribed()) { unsubscribe(); } else if (!errorEmitted) { child.onCompleted(); } } } }</code><technical_language>I understand this is done conditional block calls unsubscribe line 352/403. call unsubscribe emitting onCompleted</technical_language>

Target:
private void completeInner() { if (WIP_FOR_UNSUBSCRIBE_UPDATER.decrementAndGet(this) == 0) { unsubscribe(); } else if (groups.isEmpty() && terminated == TERMINATED_WITH_COMPLETED) { if (COMPLETION_EMITTED_UPDATER.compareAndSet(this, 0, 1)) { child.onCompleted(); } } }
Source:
<code>public void onWireReceive(final WireEnvelope wireEnvelope) { requireNonNull(wireEnvelope, message.wireEnvelopeNonNull()); logger.debug(message.wireEnvelopeReceived(), wireEnvelope); if (isCacheExpired()) { refreshCachedRecords(); } if (nonNull(this.lastRecords)) { this.wireSupport.emit(this.lastRecords); } else { <START> this.wireSupport.emit(new ArrayList<WireRecord>()); <END> } }</code><technical_language>Emit immutable list instead</technical_language>

Target:
public void onWireReceive(final WireEnvelope wireEnvelope) { requireNonNull(wireEnvelope, message.wireEnvelopeNonNull()); logger.debug(message.wireEnvelopeReceived(), wireEnvelope); if (isCacheExpired()) { refreshCachedRecords(); } List<WireRecord> result; if (nonNull(this.lastRecords)) { result = Collections.unmodifiableList(this.lastRecords); } else { result = Collections.unmodifiableList(new ArrayList<WireRecord>()); } this.wireSupport.emit(result); }
Source:
<code>private void onFragmentLoaded() { if (searchAdapter == null) { searchAdapter = new SearchlistAdapter(getActivity(), itemAccess); setListAdapter(searchAdapter); } searchAdapter.notifyDataSetChanged(); setListShown(true); String query = getArguments().getString(ARG_QUERY); <START> setEmptyText(getString(R.string.no_results_for_query) + " \"" + query + "\""); <END> }</code><technical_language>need in mind sentence construction in other languages different, query string show end. %1$s in string values/strings.xml pass query term extra argument getString()</technical_language>

Target:
private void onFragmentLoaded() { if (searchAdapter == null) { searchAdapter = new SearchlistAdapter(getActivity(), itemAccess); setListAdapter(searchAdapter); } searchAdapter.notifyDataSetChanged(); setListShown(true); String query = getArguments().getString(ARG_QUERY); setEmptyText(getString(R.string.no_results_for_query, query)); }
Source:
<code>private void search() { logger.debug("start search"); try { runQuery( getExtensionByName((String)this.actionArgs.get("authz-name")) ); } catch (Exception ex) { throw new RuntimeException(ex); <START> } <END> logger.info("search action completed"); }</code><technical_language>do else RuntimeException</technical_language>

Target:
private void search() { logger.debug("start search"); try { runQuery( getExtensionManager().getExtensionByName((String) this.actionArgs.get("authz-name")) ); } catch (Exception ex) { throw new RuntimeException(ex); } logger.info("search action completed"); }
Source:
<code><START> public void testGetAppointmentByIDAndExpectIsOk() throws Exception { <END> List<String> applicants = new ArrayList<>(); applicants.add("testApplicantId"); List<String> users = new ArrayList<>(); users.add("testUserId"); Appointment appointment = new Appointment(users, applicants, 1401866602 + TOMORROW); String appointmentJson = jsonUtil.toJson(appointment); mockMvc.perform( get("/appointments/0/") ) .andExpect(content().string(appointmentJson)) .andExpect(status().isOk()); }</code><technical_language>need in this test, is post appointment (it return id you), in this case get appointments id. in mind, DB record id equal 0 tests more flexible hardcoded</technical_language>

Target:
public void testGetAppointmentByIDAndExpectIsOk() throws Exception { List<String> applicants2 = new ArrayList<>(); applicants2.add("My test Appointment"); List<String> users2 = new ArrayList<>(); users2.add("testUserId"); Appointment appointment2 = new Appointment(users2, applicants2, 555); String appointmentJson2 = jsonUtil.toJson(appointment2); MvcResult TestAppointmentID = mockMvc.perform( post("/appointments") .contentType(MediaType.APPLICATION_JSON) .content(appointmentJson2) ) .andExpect(content().contentType("application/json")) .andExpect(status().isAccepted()) .andReturn(); String AppointmentID = TestAppointmentID.getResponse().getContentAsString(); mockMvc.perform( get("/appointments/" + AppointmentID) .contentType(MediaType.APPLICATION_JSON) ) .andExpect(content().contentType("application/json;charset=UTF-8")) .andExpect(content().string(appointmentJson2)) .andExpect(status().isOk()); }
Source:
<code>public void shouldNotHitCacheLoaderWhenWarm() throws Throwable { recursiveFileRemove(indexDir); Cache<Object, Object> cache = cacheManagers.get(0).getCache(); Directory directory = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME).create(); <START> assertTrue(LuceneUtils.readTerms("main", directory).contains("500")); <END> assertEquals(TERMS_NUMBER + 1, LuceneUtils.numDocs(directory)); LuceneUtils.collect(directory, TERMS_NUMBER); }</code><technical_language>if this strategy give a strong guarantee of some loading happening: - Windows remove memory mapped files JVM shuts - if test is working try load first, succeeding hits entries in datacontainer choice want avoid deleting this stage access some statistics; if a statistic this, worst case wrap CacheLoader a decorator.. Byteman write code :)</technical_language>

Target:
public void shouldNotHitCacheLoaderWhenWarm() throws Throwable { Cache<Object, Object> cache = cacheManagers.get(0).getCache(); Directory directory = DirectoryBuilder.newDirectoryInstance(cache, cache, cache, INDEX_NAME).create(); assertTrue(LuceneUtils.readTerms("main", directory).contains("500")); assertEquals(TERMS_NUMBER + 1, LuceneUtils.numDocs(directory)); LuceneUtils.collect(directory, TERMS_NUMBER); assertNoCacheLoaderInteractions(); }
Source:
<code>public void freeSlot(WorkerSlot slot) { <START> String nodeId = slot.getNodeId(); <END> for (SchedulerAssignmentImpl assignment : assignments.values()) { if (assignment.isSlotOccupied(slot)) { String topologyId = assignment.getTopologyId(); assertValidTopologyForModification(topologyId); assignment.unassignBySlot(slot); topoIdToNodeIdToSlotIdToExecutors.computeIfAbsent(topologyId, Cluster::makeMap).computeIfAbsent(nodeId, Cluster::makeMap) .computeIfAbsent(slot.getId(), Cluster::makeSet) .clear(); TopologyDetails td = topologies.getById(topologyId); assignment.setTotalSharedOffHeapNodeMemory( nodeId, calculateSharedOffHeapNodeMemory(nodeId, assignment, td)); nodeToScheduledResourcesCache.computeIfAbsent(nodeId, Cluster::makeMap).put(slot, new NormalizedResourceRequest()); nodeToUsedSlotsCache.computeIfAbsent(nodeId, Cluster::makeSet).remove(slot); } } totalResourcesPerNodeCache.remove(slot.getNodeId()); }</code><technical_language>this is added, Line 808 updated nodeId instead of slot.getNodeId()</technical_language>

Target:
public void freeSlot(WorkerSlot slot) { final String nodeId = slot.getNodeId(); for (SchedulerAssignmentImpl assignment : assignments.values()) { if (assignment.isSlotOccupied(slot)) { final String topologyId = assignment.getTopologyId(); assertValidTopologyForModification(topologyId); assignment.unassignBySlot(slot); topoIdToNodeIdToSlotIdToExecutors.computeIfAbsent(topologyId, Cluster::makeMap).computeIfAbsent(nodeId, Cluster::makeMap) .computeIfAbsent(slot.getId(), Cluster::makeSet) .clear(); TopologyDetails td = topologies.getById(topologyId); assignment.setTotalSharedOffHeapNodeMemory( nodeId, calculateSharedOffHeapNodeMemory(nodeId, assignment, td)); nodeToScheduledResourcesCache.computeIfAbsent(nodeId, Cluster::makeMap).put(slot, new NormalizedResourceRequest()); nodeToUsedSlotsCache.computeIfAbsent(nodeId, Cluster::makeSet).remove(slot); } } totalResourcesPerNodeCache.remove(nodeId); }
Source:
<code>private String secondaryMessage(int complexity) { if (complexity == 1) { return "+1"; } else{ <START> return String.format("+%s (incl %s for nesting)", complexity, complexity - 1); <END> } }</code><technical_language>@vilchik-elena adding a dot end of "incl", is "incl."</technical_language>

Target:
private static String secondaryMessage(int complexity) { if (complexity == 1) { return "+1"; } else{ return String.format("+%s (incl. %s for nesting)", complexity, complexity - 1); } }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { File originalFile = ServletUtils.getFileFromString(request.getPathInfo(), base); Locale locale = getLocaleFromRequest(request); File file = determineActualFile(request, locale); file = checkForIndex(request, response, file, request.getPathInfo()); if(null == file) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else if(!response.isCommitted()){ <START> Object languagePageShown = request.getSession(true).getAttribute(LANG_PAGE_SHOWN); <END> if(!file.equals(originalFile)) { String redirect = request.getServletPath() + replaceLocaleWithUSLocale(request.getPathInfo(), locale); if((null == languagePageShown || !Boolean.parseBoolean(languagePageShown.toString()))) { request.getSession(true).setAttribute(LANG_PAGE_SHOWN, true); request.setAttribute(LOCALE, locale); request.setAttribute(ENGLISH_HREF, redirect); RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/help/no_lang.jsp"); if (dispatcher != null) { dispatcher.include(request, response); } } else { response.sendRedirect(redirect); } } else { ServletUtils.sendFile(request, response, file, type); } } }</code><technical_language>safe do this? Boolean languagePageShown = (Boolean) request...</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { File originalFile = ServletUtils.makeFileFromSanePath(request.getPathInfo(), base); Locale locale = getLocaleFromRequest(request); File file = determineActualFile(request, locale); file = checkForIndex(request, response, file, request.getPathInfo()); if(null == file) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else if(!response.isCommitted()){ Object languagePageShown = request.getSession(true).getAttribute(LANG_PAGE_SHOWN); if(!file.equals(originalFile)) { String redirect = request.getServletPath() + replaceLocaleWithUSLocale(request.getPathInfo(), locale); if((null == languagePageShown || !Boolean.parseBoolean(languagePageShown.toString()))) { request.getSession(true).setAttribute(LANG_PAGE_SHOWN, true); request.setAttribute(LOCALE, locale); request.setAttribute(ENGLISH_HREF, redirect); RequestDispatcher dispatcher = request.getRequestDispatcher(LANG_JSP); if (dispatcher != null) { dispatcher.include(request, response); } } else { response.sendRedirect(redirect); } } else { ServletUtils.sendFile(request, response, file, type); } } }
Source:
<code>public static void waitTillInstancesAreCreated(ColoHelper cluster, Entity entity, String startTime, String endTime) throws InterruptedException, IOException, AuthenticationException, URISyntaxException { int sleep = INSTANCES_CREATED_TIMEOUT * 60 / 5; <START> waitTillInstancesAreCreated(cluster, entity, startTime, endTime, sleep); <END> }</code><technical_language>INSTANCES_CREATED_TIMEOUT \* 60 / 5 - This intuitive. divide 5</technical_language>

Target:
public static void waitTillInstancesAreCreated(ColoHelper cluster, Entity entity, String startTime, String endTime) throws InterruptedException, IOException, AuthenticationException, URISyntaxException { waitTillInstancesAreCreated(cluster, entity, startTime, endTime, INSTANCES_CREATED_TIMEOUT); }
Source:
<code>public void setUp() throws Exception { <START> FileProvider fileProviderA = new FileProviderImpl("ontent-handler-a"); <END> handlerA = new MockFileContentReferenceHandlerImpl("content-handler-a"); ((FileContentReferenceHandlerImpl) handlerA).setFileProvider(fileProviderA); FileProvider fileProviderB = new FileProviderImpl("content-handler-b"); handlerB = new MockFileContentReferenceHandlerImpl("content-handler-b"); ((FileContentReferenceHandlerImpl) handlerB).setFileProvider(fileProviderB); ArrayList<ContentReferenceHandler> delegates = new ArrayList<ContentReferenceHandler>(); delegates.add(handlerA); delegates.add(handlerB); delegatingHandler = new DelegatingContentHandlerImpl(); ((DelegatingContentHandlerImpl) delegatingHandler).setDelegates(delegates); contentReferenceFile1a = getTextReference("/content-handler-a/file-a-1.txt"); contentReferenceFile1b = getTextReference("/content-handler-b/file-b-1.txt"); contentReferenceFile1c = getTextReference("/content-handler-c/file-c-1.txt"); }</code><technical_language>Small typo</technical_language>

Target:
public void setUp() throws Exception { FileProvider fileProviderA = new FileProviderImpl("content-handler-a"); handlerA = new MockFileContentReferenceHandlerImpl("content-handler-a"); ((FileContentReferenceHandlerImpl) handlerA).setFileProvider(fileProviderA); FileProvider fileProviderB = new FileProviderImpl("content-handler-b"); handlerB = new MockFileContentReferenceHandlerImpl("content-handler-b"); ((FileContentReferenceHandlerImpl) handlerB).setFileProvider(fileProviderB); ArrayList<ContentReferenceHandler> delegates = new ArrayList<ContentReferenceHandler>(); delegates.add(handlerA); delegates.add(handlerB); delegatingHandler = new DelegatingContentHandlerImpl(); ((DelegatingContentHandlerImpl) delegatingHandler).setDelegates(delegates); contentReferenceFile1a = getTextReference("/content-handler-a/file-a-1.txt"); contentReferenceFile1b = getTextReference("/content-handler-b/file-b-1.txt"); contentReferenceFile1c = getTextReference("/content-handler-c/file-c-1.txt"); }
Source:
<code>protected Guid getImageGroupId() { <START> if (_imageGroupId.equals(Guid.Empty)) { <END> _imageGroupId = getDiskImage().getId() != null ? getDiskImage().getId() : Guid.Empty; } return _imageGroupId; }</code><technical_language>Please fix _imageGroupId</technical_language>

Target:
protected Guid getImageGroupId() { if (imageGroupId.equals(Guid.Empty)) { imageGroupId = getDiskImage().getId() != null ? getDiskImage().getId() : Guid.Empty; } return imageGroupId; }
Source:
<code>public void testResponseTimeout() throws Exception { setServerResponse(false); testWithErrorCodes(Collections.singletonMap(ServerErrorCode.No_Error, 9), serverLayout, RouterErrorCode.OperationTimedOut, new ErrorCodeChecker() { @Override public void check(RouterErrorCode expectedError) throws Exception { future = router.deleteBlob(blobIdString, new ClientCallback()); do { mockTime.sleep(1000); <START> } while (!operationCompleteLatch.await(10, TimeUnit.MILLISECONDS)); <END> checkErrorCode(future, expectedError); } }); }</code><technical_language>if mockTime incremented time required trigger operation timed out error, need a loop</technical_language>

Target:
public void testResponseTimeout() throws Exception { setServerResponse(false); testWithErrorCodes(Collections.singletonMap(ServerErrorCode.No_Error, 9), serverLayout, RouterErrorCode.OperationTimedOut, new ErrorCodeChecker() { @Override public void testAndAssert(RouterErrorCode expectedError) throws Exception { CountDownLatch operationCompleteLatch = new CountDownLatch(1); future = router.deleteBlob(blobIdString, new ClientCallback(operationCompleteLatch)); do { mockTime.sleep(1000); } while (!operationCompleteLatch.await(10, TimeUnit.MILLISECONDS)); assertFailureAndCheckErrorCode(future, expectedError); } }); }
Source:
<code>private void initializeConfigRepositories() { if (this.hasConfigRepoInitializationCompleted) { return; } if (!this.isConfigLoaded) { return; } List<String> inUseConfigRepoPlugins = this.configRepoService.getConfigRepos().stream().map(RuleAwarePluginProfile::getPluginId).collect(Collectors.toList()); <START> if (this.loadedConfigRepoPlugins.containsAll(inUseConfigRepoPlugins)) { <END> LOGGER.info("[Config Repository Initializer] Start initializing all the config repositories"); this.configRepoService.getConfigRepos().forEach(this::initializeConfigRepository); LOGGER.info("[Config Repository Initializer] Done initializing all the config repositories"); this.hasConfigRepoInitializationCompleted = true; } }</code><technical_language>@GaneshSPatil this check, in cases multiple ConfigRepo plugins of repos parsed if a single plugin is missing. Guess this intended</technical_language>

Target:
private void initializeConfigRepositories() { if (!this.isConfigLoaded) { return; } synchronized (this.pluginsQueue) { while (!pluginsQueue.isEmpty()) { String pluginId = pluginsQueue.poll(); LOGGER.info("[Config Repository Initializer] Start initializing the config repositories for plugin '{}' ", pluginId); this.configRepoService.getConfigRepos().stream() .filter(configRepoConfig -> configRepoConfig.getPluginId().equalsIgnoreCase(pluginId)) .forEach(this::initializeConfigRepository); LOGGER.info("[Config Repository Initializer] Done initializing the config repositories for plugin '{}' ", pluginId); } } }
Source:
<code>private List<Future<Void>> executeTasksConcurrently(final List<ConcurrentTestWorker> testWorkers) throws InterruptedException { ExecutorService service = Executors.newFixedThreadPool(tasks.size()); <START> final List<Future<Void>> futures = service <END> .invokeAll(testWorkers, iterationTimeoutSeconds * iterations, TimeUnit.SECONDS); service.shutdown(); return futures; }</code><technical_language>![CRITICAL](<LINK_1> Result of integer multiplication cast long in org.sonatype.sisu.litmus.testsupport.concurrent.ConcurrentRunner.executeTasksConcurrently(List) [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private List<Future<Void>> executeTasksConcurrently(final List<ConcurrentTestWorker> testWorkers) throws InterruptedException { ExecutorService service = Executors.newFixedThreadPool(tasks.size()); final List<Future<Void>> futures = service .invokeAll(testWorkers, (long) iterationTimeoutSeconds * iterations, TimeUnit.SECONDS); service.shutdown(); return futures; }
Source:
<code>private static byte[] processArrayItem(byte[] bytes) { ArrayList<Byte> boxedBytes = new ArrayList<>(); int start = 0, end = bytes.length - 1; if (bytes[start] == '"') { start += 1; end -= 1; } for (int i = start; i <= end; i++) { if (i < end && (char) bytes[i] == '\\' && ((char) bytes[i + 1] == '\\' || (char) bytes[i + 1] == '\"')) { i++; } boxedBytes.add(bytes[i]); } byte[] unboxedBytes = new byte[boxedBytes.size()]; <START> for (int i = 0; i < boxedBytes.size(); i++) { <END> unboxedBytes[i] = boxedBytes.get(i); } return unboxedBytes; }</code><technical_language>Is this performing .toArray(new Byte[0]) ? of this result in implicit unboxing native methods for copying elements</technical_language>

Target:
private static byte[] processArrayItem(byte[] bytes) { var itemBytes = new ByteArrayList(); int start = 0, end = bytes.length - 1; if (bytes[start] == '"') { start += 1; end -= 1; } for (int i = start; i <= end; i++) { if (i < end && (char) bytes[i] == '\\' && ((char) bytes[i + 1] == '\\' || (char) bytes[i + 1] == '\"')) { i++; } itemBytes.add(bytes[i]); } return itemBytes.toArray(); }
Source:
<code>public List<TransactionAndImmutableTsLock> setupRunTaskBatchWithConditionThrowOnConflict( List<PreCommitCondition> conditions) { <START> Preconditions.checkArgument(!conditions.isEmpty(), "Trying to start an empty batch"); <END> try (StartIdentifiedAtlasDbTransactionResponseBatch responses = timelockService.startIdentifiedAtlasDbTransactionsBatch(conditions.size())) { if (responses.size() != conditions.size()) { throw new TransactionBatchFailedRetriableException( "The number of transactions started does not match the size of the batch."); } List<TransactionAndImmutableTsLock> transactions = Streams.zip( responses.getResponses().stream(), conditions.stream(), (response, condition) -> wrapResponse(condition, response)).collect(Collectors.toList()); return responses.successful(transactions); } }</code><technical_language>Generally nicer allow fall this (so allow empty list), I this is usage of this in internal ski product assumed</technical_language>

Target:
public List<TransactionAndImmutableTsLock> setupRunTaskBatchWithConditionThrowOnConflict( List<PreCommitCondition> conditions) { if (conditions.isEmpty()) { return ImmutableList.of(); } List<StartIdentifiedAtlasDbTransactionResponse> responses = timelockService.startIdentifiedAtlasDbTransactionBatch(conditions.size()); Preconditions.checkState(conditions.size() == responses.size(), "Different number of responses and conditions"); try { long immutableTs = Collections.max(responses.stream() .map(response -> response.immutableTimestamp().getImmutableTimestamp()) .collect(Collectors.toList())); recordImmutableTimestamp(immutableTs); cleaner.punch(responses.get(0).startTimestampAndPartition().timestamp()); return Streams.zip( responses.stream(), conditions.stream(), (response, condition) -> { LockToken immutableTsLock = response.immutableTimestamp().getLock(); Supplier<Long> startTimestampSupplier = Suppliers.ofInstance( response.startTimestampAndPartition().timestamp()); Transaction transaction = createTransaction( immutableTs, startTimestampSupplier, immutableTsLock, condition); return TransactionAndImmutableTsLock.of(transaction, immutableTsLock); }).collect(Collectors.toList()); } catch (Throwable t) { timelockService.tryUnlock( responses.stream() .map(response -> response.immutableTimestamp().getLock()) .collect(Collectors.toSet())); throw Throwables.rewrapAndThrowUncheckedException(t); } }
Source:
<code><START> public static SleepPeriodResults create(final MainEventTimes mainEventTimes, final Timeline timeline, final SleepScore sleepScore,final SleepStats sleepStats, final OneDaysSensorData sensorData, final TimeZoneOffsetMap timeZoneOffsetMap, final TimelineLog timelineLog, final DataCompleteness dataCompleteness, final boolean processed) { <END> final Results results = new Results(timeline, sleepScore,sleepStats, sensorData, timeZoneOffsetMap); return new SleepPeriodResults(mainEventTimes, Optional.of(results), timelineLog, dataCompleteness, processed); }</code><technical_language>parameters grouped smaller more meaningful objects</technical_language>

Target:
public static SleepPeriodResults create(final MainEventTimes mainEventTimes, final Timeline timeline, final SleepScore sleepScore,final SleepStats sleepStats, final OneDaysSensorData sensorData, final TimeZoneOffsetMap timeZoneOffsetMap, final TimelineLog timelineLog, final DataCompleteness dataCompleteness, final boolean processed) { final Results results = new Results(timeline, sleepScore,sleepStats); final Data data = new Data(sensorData, timeZoneOffsetMap); return new SleepPeriodResults(mainEventTimes, Optional.of(results),Optional.of(data), timelineLog, dataCompleteness, processed); }
Source:
<code>public void addGatewayPublishedAPIArtifacts(String APIId, String gatewayLabel, ByteArrayInputStream bais, int streamLength, String gatewayInstruction, String query) throws APIManagementException { <START> try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); <END> PreparedStatement statement = connection.prepareStatement(query)) { statement.setBinaryStream(1, bais, streamLength); statement.setString(2, gatewayInstruction); statement.setString(3, APIId); statement.setString(4, gatewayLabel); statement.executeUpdate(); } catch (SQLException e) { handleException("Failed to add artifacts for " + APIId, e); } }</code><technical_language>fix places GET</technical_language>

Target:
public void addGatewayPublishedAPIArtifacts(String APIId, String gatewayLabel, ByteArrayInputStream bais, int streamLength, String gatewayInstruction, String query) throws APIManagementException { try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection()) { connection.setAutoCommit(false); try (PreparedStatement statement = connection.prepareStatement(query)) { statement.setBinaryStream(1, bais, streamLength); statement.setString(2, gatewayInstruction); statement.setString(3, APIId); statement.setString(4, gatewayLabel); statement.executeUpdate(); } connection.commit(); } catch (SQLException e) { handleException("Failed to add artifacts for " + APIId, e); } }
Source:
<code>public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == AppCompatActivity.RESULT_OK) { <START> if (requestCode == REQUEST_ADD_EXCHANGE_RATE) { <END> update(); setResult(RESULT_OK); } } }</code><technical_language>flexible enough. need add another requestCode, need add another else if, a good practice</technical_language>

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == AppCompatActivity.RESULT_OK) { switch (requestCode) { case REQUEST_ADD_EXCHANGE_RATE: update(); setResult(RESULT_OK); break; default: break; } } }
Source:
<code>private static String getStringValue(ExpressionTree expression) { if (expression.is(Tree.Kind.IDENTIFIER)) { ExpressionTree last = ReassignmentFinder.getClosestReassignmentOrDeclarationExpression(expression, ((IdentifierTree) expression).symbol()); return last == null ? null : getStringValue(last); } <START> return ConstantUtils.resolveAsStringConstant(expression); <END> }</code><technical_language>a testcase expression lead this expression return null</technical_language>

Target:
private static String getStringValue(ExpressionTree expression) { String value = ConstantUtils.resolveAsStringConstant(expression); if (value == null && expression.is(Tree.Kind.IDENTIFIER)) { ExpressionTree last = ReassignmentFinder.getClosestReassignmentOrDeclarationExpression(expression, ((IdentifierTree) expression).symbol()); value = last == null ? null : getStringValue(last); } return value; }
Source:
<code>public long writeTo(WritableByteChannel channel) throws IOException { long written = 0; try { if (sentBytes < sizeInBytes()) { if (bufferToSend == null) { prepareBuffer(); } if (bufferToSend.hasRemaining()) { written = channel.write(bufferToSend); } if (!bufferToSend.hasRemaining() && blob != null) { int totalWrittenBytesForBlob = 0, currentWritten = -1; while (bufferIndex < nioBuffersFromBlob.length && currentWritten != 0) { ByteBuffer byteBuffer = nioBuffersFromBlob[bufferIndex]; currentWritten = channel.write(byteBuffer); totalWrittenBytesForBlob += currentWritten; <START> while (!byteBuffer.hasRemaining()) { <END> bufferIndex++; if (bufferIndex < nioBuffersFromBlob.length) { byteBuffer = nioBuffersFromBlob[bufferIndex]; } else { break; } } } blob.skipBytes(totalWrittenBytesForBlob); written += totalWrittenBytesForBlob; okayToWriteCrc = !blob.isReadable(); } if (okayToWriteCrc && crcBuf.hasRemaining()) { if (blob != null) { blob.release(); blob = null; } written += channel.write(crcBuf); } sentBytes += written; } } catch (Exception e) { if (blob != null) { blob.release(); blob = null; } } return written; }</code><technical_language>this work eliminate nested while loop? java while (bufferIndex < nioBuffersFromBlob.length && currentWritten != 0) { currentWritten = -1; ByteBuffer byteBuffer = nioBuffersFromBlob[bufferIndex]; if (!byteBuffer.hasRemaining()) { bufferIndex++; } else { currentWritten = channel.write(byteBuffer); totalWrittenBytesForBlob += currentWritten; } }</technical_language>

Target:
public long writeTo(WritableByteChannel channel) throws IOException { long written = 0; try { if (sentBytes < sizeInBytes()) { if (bufferToSend == null) { prepareBuffer(); } if (bufferToSend.hasRemaining()) { written = channel.write(bufferToSend); } if (!bufferToSend.hasRemaining() && blob != null) { int totalWrittenBytesForBlob = 0, currentWritten = -1; while (bufferIndex < nioBuffersFromBlob.length && currentWritten != 0) { currentWritten = -1; ByteBuffer byteBuffer = nioBuffersFromBlob[bufferIndex]; if (!byteBuffer.hasRemaining()) { bufferIndex ++; } else { currentWritten = channel.write(byteBuffer); totalWrittenBytesForBlob += currentWritten; } } blob.skipBytes(totalWrittenBytesForBlob); written += totalWrittenBytesForBlob; okayToWriteCrc = !blob.isReadable(); } if (okayToWriteCrc && crcBuf.hasRemaining()) { if (blob != null) { blob.release(); blob = null; } written += channel.write(crcBuf); } sentBytes += written; } } catch (Exception e) { if (blob != null) { blob.release(); blob = null; } } return written; }
Source:
<code>public void checkStorageDomainNotEqualWithStatusActive() { setStorageDomainStatus(StorageDomainStatus.Active); assertFalse(cmd.checkStorageDomainStatusNotEqual(StorageDomainStatus.Active)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); <START> assertEquals(2, messages.size()); <END> assertEquals(messages.get(0), VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString()); assertEquals(messages.get(1), String.format("$status %1$s", StorageDomainStatus.Active)); }</code><technical_language>actual <--> expected replaced</technical_language>

Target:
public void checkStorageDomainNotEqualWithStatusActive() { setStorageDomainStatus(StorageDomainStatus.Active); assertFalse(cmd.checkStorageDomainStatusNotEqual(StorageDomainStatus.Active)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); assertEquals(2, messages.size()); assertEquals(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString(), messages.get(0)); assertEquals(String.format("$status %1$s", StorageDomainStatus.Active), messages.get(1)); }
Source:
<code>void findMethodChooseSpecificOverGenericMethod() throws NoSuchMethodException { String methodName = "foo"; Class<?> parameterType = Double.class; Class<?> testClass = InterfaceWithSpecificAndGenericDefaultMethodImpl.class; Method specificMethod = testClass.getMethod(methodName, parameterType); Optional<Method> optional = findMethod(testClass, methodName, parameterType); <START> assertThat(optional).isEqualTo(specificMethod); <END> }</code><technical_language>fail comparing Optional a Method. I need assertThat(optional).contains(method)</technical_language>

Target:
void findMethodChooseSpecificOverGenericMethod() throws NoSuchMethodException { String methodName = "foo"; Class<?> parameterType = Double.class; Class<?> testClass = InterfaceWithSpecificAndGenericDefaultMethodImpl.class; Method specificMethod = testClass.getMethod(methodName, parameterType); Optional<Method> optional = findMethod(testClass, methodName, parameterType); assertThat(optional).contains(specificMethod); }
Source:
<code>public void testGetFlooders() throws Exception { final EventType eventType = NakadiTestUtils.createEventType(); blacklist(eventType.getName(), BlacklistService.Type.CONSUMER_ET); <START> Thread.sleep(TimeUnit.SECONDS.toMillis(1)); END> given() .contentType(ContentType.JSON) .get(BLACKLIST_URL) .then() .statusCode(HttpStatus.SC_OK) .content(JSON_HELPER.matchesObject( ImmutableMap.of( "consumers", ImmutableMap.of( "event_types", Collections.singleton(eventType.getName()), "apps", Collections.emptySet()), "producers", ImmutableMap.of( "event_types", Collections.emptySet(), "apps", Collections.emptySet())) ) ); }</code><technical_language><LINK_0></technical_language>

Target:
public void testGetFlooders() throws Exception { final EventType eventType = NakadiTestUtils.createEventType(); blacklist(eventType.getName(), BlacklistService.Type.CONSUMER_ET); TestUtils.waitFor(() -> given() .contentType(ContentType.JSON) .get(BLACKLIST_URL) .then() .statusCode(HttpStatus.SC_OK) .content(getFloodersMatcher(eventType)), 1000, 200); }
Source:
<code>private static Event toEvent(IntegrationEvent integrationEvent) { final IntegrationEventContext sourceContext = integrationEvent.getContext(); final EventContext context = EventContext.newBuilder() .setEventId(sourceContext.getEventId()) .setTimestamp(sourceContext.getTimestamp()) .setProducerId(sourceContext.getProducerId()) <START> .setBoundedContextName(sourceContext.getBoundedContextName()) <END> .build(); final Event.Builder result = Event.newBuilder() .setMessage(integrationEvent.getMessage()) .setContext(context); return result.build(); }</code><technical_language>I producerId is name of bounded context, event. boundedContextName attribute for regular events all. _All of them_ (apart integration events) this bounded context</technical_language>

Target:
private static Event toEvent(IntegrationEvent integrationEvent) { final IntegrationEventContext sourceContext = integrationEvent.getContext(); final StringValue producerId = newStringValue(sourceContext.getBoundedContextName()); final EventContext context = EventContext.newBuilder() .setEventId(sourceContext.getEventId()) .setTimestamp(sourceContext.getTimestamp()) .setProducerId(toAny(producerId)) .build(); final Event.Builder result = Event.newBuilder() .setMessage(integrationEvent.getMessage()) .setContext(context); return result.build(); }