auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void onSelectionChanged(int selStart, int selEnd) { if (hintVisible) { selStart = 0; } selEnd = selStart; if (tokenClickStyle != null && tokenClickStyle.isSelectable()) { Editable text = getText(); if (text != null) { clearSelections(); } } if (prefix != null && (selStart < prefix.length() || selEnd < prefix.length())) { setSelection(prefix.length()); } else { Editable text = getText(); if (text != null) { TokenImageSpan[] spans = text.getSpans(selStart, selEnd, TokenImageSpan.class); for (TokenImageSpan span: spans) { int spanEnd = text.getSpanEnd(span); if (selStart <= spanEnd && text.getSpanStart(span) < selStart) { <START> setSelection(spanEnd); <END> return; } } } super.onSelectionChanged(selStart, selEnd); } }</code><technical_language>add span end in cases (otherwise wind extra spaces in text field deletes some circumstances). check if spanEnd is equal length, add if is not</technical_language>

Target:
protected void onSelectionChanged(int selStart, int selEnd) { if (hintVisible) { selStart = 0; } selEnd = selStart; if (tokenClickStyle != null && tokenClickStyle.isSelectable()) { Editable text = getText(); if (text != null) { clearSelections(); } } if (prefix != null && (selStart < prefix.length() || selEnd < prefix.length())) { setSelection(prefix.length()); } else { Editable text = getText(); if (text != null) { TokenImageSpan[] spans = text.getSpans(selStart, selEnd, TokenImageSpan.class); for (TokenImageSpan span: spans) { int spanEnd = text.getSpanEnd(span); if (selStart <= spanEnd && text.getSpanStart(span) < selStart) { if(spanEnd==text.length()) setSelection(spanEnd); else setSelection(spanEnd+1); return; } } } super.onSelectionChanged(selStart, selEnd); } }
Source:
<code>public ByteBuffer getResponseBodyAsByteBuffer() { int length = 0; for (HttpResponseBodyPart part : bodyParts) length += part.length(); ByteBuffer target = ByteBuffer.wrap(new byte[length]); for (HttpResponseBodyPart part : bodyParts) target.put(part.getBodyPartBytes()); <START> target.rewind(); <END> return target; }</code><technical_language>flip</technical_language>

Target:
public ByteBuffer getResponseBodyAsByteBuffer() { int length = 0; for (HttpResponseBodyPart part : bodyParts) length += part.length(); ByteBuffer target = ByteBuffer.wrap(new byte[length]); for (HttpResponseBodyPart part : bodyParts) target.put(part.getBodyPartBytes()); target.flip(); return target; }
Source:
<code>public void abort() <START> { <END> this.a=true; }</code><technical_language>bracket previous line</technical_language>

Target:
public void abort() { this.shouldAbort=true; }
Source:
<code>public void createControls(Composite parent, EEFTabbedPropertySheetPage tabbedPropertySheetPage) { if (EEFCommonPreferences.isDebugEnabled()) { <START> EEFIdeUiPlugin.getPlugin().info("EEFSection#createControls(...)"); <END> } EEFPage eefPage = this.eefSectionDescriptor.getEEFPage(); List<EEFGroup> eefGroups = eefPage.getGroups(); for (EEFGroup eefGroup : eefGroups) { EEFGroupLifecycleManager groupLifecycleManager = new EEFGroupLifecycleManager(eefGroup.getDescription(), eefGroup.getVariableManager(), eefGroup.getInterpreter(), eefGroup.getEditingDomain()); groupLifecycleManager.createControl(parent, tabbedPropertySheetPage); this.lifecycleManagers.add(groupLifecycleManager); } }</code><technical_language>EEFIdeUiPlugin.getPlugin().debug debug method tests EEFCommonPreferences.isDebugEnabled(). do</technical_language>

Target:
public void createControls(Composite parent, EEFTabbedPropertySheetPage tabbedPropertySheetPage) { EEFIdeUiPlugin.getPlugin().debug("EEFSection#createControls(...)"); EEFPage eefPage = this.eefSectionDescriptor.getEEFPage(); List<EEFGroup> eefGroups = eefPage.getGroups(); for (EEFGroup eefGroup : eefGroups) { EEFGroupLifecycleManager groupLifecycleManager = new EEFGroupLifecycleManager(eefGroup.getDescription(), eefGroup.getVariableManager(), eefGroup.getInterpreter(), eefGroup.getEditingDomain()); groupLifecycleManager.createControl(parent, tabbedPropertySheetPage); this.lifecycleManagers.add(groupLifecycleManager); } }
Source:
<code>private String writeCriticalityWithDesignCheck(ArtifactReadable art, String criticality, IAttributeType thisType, IRelationTypeSide relType, IAttributeType otherType) throws IOException { String current = art.getSoleAttributeAsString(thisType, "Error"); if ("Error".equals(criticality) || "Error".equals(current)) { writer.writeCell("Error: invalid content"); return "Error"; } <START> <END> if ("Unspecified".equals(current)) { writer.writeCell("Unspecified"); return "Unspecified"; } if ("Unspecified".equals(criticality)) { criticality = "E"; } int parentValue = SafetyCriticalityLookup.getDALLevel(criticality); int childValue = SafetyCriticalityLookup.getDALLevel(current); if (parentValue < childValue) { writer.writeCell(String.format("%s [Error:<%s]", current, criticality)); } else { checkBackTrace(art, childValue, thisType, relType, otherType); } return current; }</code><technical_language>org.eclipse.osee.framework.core.model.IAttribute.UNSPECIFIED for strings below</technical_language>

Target:
private String writeCriticalityWithDesignCheck(ArtifactReadable art, String criticality, IAttributeType thisType, IRelationTypeSide relType, IAttributeType otherType) throws IOException { String current = art.getSoleAttributeAsString(thisType, "Error"); if ("Error".equals(criticality) || "Error".equals(current)) { writer.writeCell("Error: invalid content"); return "Error"; } if (IAttribute.UNSPECIFIED.equals(current)) { writer.writeCell(IAttribute.UNSPECIFIED); return IAttribute.UNSPECIFIED; } if (IAttribute.UNSPECIFIED.equals(criticality)) { criticality = "E"; } int parentValue = SafetyCriticalityLookup.getDALLevel(criticality); int childValue = SafetyCriticalityLookup.getDALLevel(current); if (parentValue < childValue) { writer.writeCell(String.format("%s [Error:<%s]", current, criticality)); } else { checkBackTrace(art, childValue, thisType, relType, otherType); } return current; }
Source:
<code>public EList<CommentInfo> getAllComments() { EList<CommentInfo> allComments = new BasicEList<>(); <START> System.err.println("Getting all comments"); <END> allComments.addAll(getComments()); System.err.println("Getting all drafts"); allComments.addAll(getDraftComments()); return allComments; }</code><technical_language>forget remove system.out (line 25 27)</technical_language>

Target:
public EList<CommentInfo> getAllComments() { EList<CommentInfo> allComments = new BasicEList<>(); allComments.addAll(getComments()); allComments.addAll(getDraftComments()); return allComments; }
Source:
<code>protected String colorize(String string) { if (string.indexOf(ChatColor.COLOR_CHAR) < 0) { return string; } for (ChatColor color : colors) { if (this.color && replacements.containsKey(color)) { string = string.replaceAll("(?i)" + color, replacements.get(color)); <START> } else { <END> string = string.replaceAll("(?i)" + color, ""); } } return string; }</code><technical_language>ternary operator here</technical_language>

Target:
protected String colorize(String string) { if (string.indexOf(ChatColor.COLOR_CHAR) < 0) { return string; } for (ChatColor color : colors) { string = string.replaceAll("(?i)" + color, this.color ? replacements.getOrDefault(color, "") : ""); } return string; }
Source:
<code>public Long toModelValue(final String time) { if (time == null || time.trim().equals("")) { <START> return 0l; <END> } return Long.valueOf(time); }</code><technical_language>recommend upperace L denote long literals. l similar 1 lead confusion</technical_language>

Target:
public Long toModelValue(final String time) { if (time == null || time.trim().equals("")) { return 0L; } try { return Long.valueOf(time); } catch (NumberFormatException ex){ return 0L; } }
Source:
<code>public void init(FilterConfig filterConfig) throws ServletException { <START> String schemes = filterConfig.getInitParameter("schemes"); <END> if (schemes == null) { schemes = ""; } additionalSchemes = Arrays.asList(schemes.split(",")); }</code><technical_language>I thinking if get init parameter of form: schemes.* instead of split... do getInitParameters() enumerate extract is prefix schemes.x sorted. critical, allow comma name..</technical_language>

Target:
public void init(FilterConfig filterConfig) throws ServletException { for (String paramName : Collections.list(filterConfig.getInitParameterNames())) { if (paramName.startsWith("scheme")) { additionalSchemes.add(filterConfig.getInitParameter(paramName)); } } }
Source:
<code>public void fillRubricColumn(int qnNumber, int choiceIndex, String[] values) { fillRubricChoiceBox(values[0], qnNumber, choiceIndex); <START> int rubDescIndex = 1; <END> if (isRubricWeightsEnabled(qnNumber)) { fillRubricWeightBox(values[1], qnNumber, choiceIndex); rubDescIndex = 2; } int subQnIndex = 0; while (rubDescIndex < values.length) { fillRubricDescriptionBox(values[rubDescIndex], qnNumber, subQnIndex, choiceIndex); subQnIndex++; rubDescIndex++; } }</code><technical_language>rubDescIndex renamed</technical_language>

Target:
public void fillRubricColumn(int qnNumber, int choiceIndex, String[] values) { fillRubricChoiceBox(values[0], qnNumber, choiceIndex); int rubDescriptionIndex = 1; if (isRubricWeightsEnabled(qnNumber)) { fillRubricWeightBox(values[1], qnNumber, choiceIndex); rubDescriptionIndex = 2; } int subQnIndex = 0; while (rubDescriptionIndex < values.length) { fillRubricDescriptionBox(values[rubDescriptionIndex], qnNumber, subQnIndex, choiceIndex); subQnIndex++; rubDescriptionIndex++; } }
Source:
<code>private void setProperties(final int tableId, final KeyValueSetProto properties) { final String updateSql = "UPDATE " + TB_OPTIONS + " SET VALUE_=? WHERE TID=? AND KEY_=?"; final String insertSql = "INSERT INTO " + TB_OPTIONS + " (TID, KEY_, VALUE_) VALUES(?, ?, ?)"; PreparedStatement pstmt = null; Map<String, String> oldProperties = getTableOptions(tableId); <START> try (Connection conn = getConnection()) { <END> conn.setAutoCommit(false); for (KeyValueProto entry : properties.getKeyvalList()) { if (oldProperties.containsKey(entry.getKey())) { pstmt = conn.prepareStatement(updateSql); pstmt.setString(1, entry.getValue()); pstmt.setInt(2, tableId); pstmt.setString(3, entry.getKey()); pstmt.executeUpdate(); pstmt.close(); } else { pstmt = conn.prepareStatement(insertSql); pstmt.setInt(1, tableId); pstmt.setString(2, entry.getKey()); pstmt.setString(3, entry.getValue()); pstmt.executeUpdate(); pstmt.close(); } } conn.commit(); } catch (Throwable sqlException) { throw new TajoInternalError(sqlException); } finally { CatalogUtil.closeQuietly(pstmt); } }</code><technical_language>do close connection here</technical_language>

Target:
private void setProperties(final int tableId, final KeyValueSetProto properties) { final String updateSql = "UPDATE " + TB_OPTIONS + " SET VALUE_=? WHERE TID=? AND KEY_=?"; final String insertSql = "INSERT INTO " + TB_OPTIONS + " (TID, KEY_, VALUE_) VALUES(?, ?, ?)"; Connection conn; PreparedStatement pstmt = null; Map<String, String> oldProperties = getTableOptions(tableId); try { conn = getConnection(); conn.setAutoCommit(false); for (KeyValueProto entry : properties.getKeyvalList()) { if (oldProperties.containsKey(entry.getKey())) { pstmt = conn.prepareStatement(updateSql); pstmt.setString(1, entry.getValue()); pstmt.setInt(2, tableId); pstmt.setString(3, entry.getKey()); pstmt.executeUpdate(); pstmt.close(); } else { pstmt = conn.prepareStatement(insertSql); pstmt.setInt(1, tableId); pstmt.setString(2, entry.getKey()); pstmt.setString(3, entry.getValue()); pstmt.executeUpdate(); pstmt.close(); } } conn.commit(); } catch (Throwable sqlException) { throw new TajoInternalError(sqlException); } finally { CatalogUtil.closeQuietly(pstmt); } }
Source:
<code>protected boolean querySettingsEquals(Query that) { boolean criteriaEqual = this.criteria.equals(that.criteria); <START> boolean fieldsEqual = this.fieldSpec == null ? that.fieldSpec == null : this.fieldSpec.equals(that.fieldSpec); <END> boolean sortEqual = this.sort == null ? that.sort == null : this.sort.equals(that.sort); boolean hintEqual = this.hint == null ? that.hint == null : this.hint.equals(that.hint); boolean skipEqual = this.skip == that.skip; boolean limitEqual = this.limit == that.limit; boolean metaEqual = nullSafeEquals(this.meta, that.meta); return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual; }</code><technical_language>ObjectUtils.nullSafeEquals well</technical_language>

Target:
protected boolean querySettingsEquals(Query that) { boolean criteriaEqual = this.criteria.equals(that.criteria); boolean fieldsEqual = nullSafeEquals(this.fieldSpec, that.fieldSpec); boolean sortEqual = nullSafeEquals(this.sort, that.sort); boolean hintEqual = nullSafeEquals(this.hint, that.hint); boolean skipEqual = this.skip == that.skip; boolean limitEqual = this.limit == that.limit; boolean metaEqual = nullSafeEquals(this.meta, that.meta); return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual; }
Source:
<code>public ProtobufMessageParser(SecorConfig config) { super(config); String messageClassName = mConfig.getProtobufMessageClass(); if (messageClassName != null) { try { Class<?> messageClass = (Class<?>) Class.forName(messageClassName); messageParseMethod = messageClass.getDeclaredMethod("parseFrom", new Class<?>[] { byte[].class }); String timestampFieldName = mConfig.getMessageTimestampName(); String timestampFieldSeparator = mConfig.getMessageTimestampNameSeparator(); if (timestampFieldSeparator == null || timestampFieldSeparator.isEmpty()) { <START> timestampFieldSeparator = "."; <END> } timestampFieldPath = timestampFieldName.split(Pattern.quote(timestampFieldSeparator)); } catch (ClassNotFoundException e) { LOG.error("Unable to load protobuf message class", e); } catch (NoSuchMethodException e) { LOG.error("Unable to find parseFrom() method in protobuf message class", e); } catch (SecurityException e) { LOG.error("Unable to use parseFrom() method from protobuf message class", e); } } }</code><technical_language>a LOG.info of timestampFieldName, seperator</technical_language>

Target:
public ProtobufMessageParser(SecorConfig config) { super(config); String messageClassName = mConfig.getProtobufMessageClass(); if (messageClassName != null) { try { Class<?> messageClass = (Class<?>) Class.forName(messageClassName); messageParseMethod = messageClass.getDeclaredMethod("parseFrom", new Class<?>[] { byte[].class }); String timestampFieldName = mConfig.getMessageTimestampName(); String timestampFieldSeparator = mConfig.getMessageTimestampNameSeparator(); if (timestampFieldSeparator == null || timestampFieldSeparator.isEmpty()) { timestampFieldSeparator = "."; } LOG.info("Using protobuf timestamp field path: with separator: {}", timestampFieldName, timestampFieldSeparator); timestampFieldPath = timestampFieldName.split(Pattern.quote(timestampFieldSeparator)); } catch (ClassNotFoundException e) { LOG.error("Unable to load protobuf message class", e); } catch (NoSuchMethodException e) { LOG.error("Unable to find parseFrom() method in protobuf message class", e); } catch (SecurityException e) { LOG.error("Unable to use parseFrom() method from protobuf message class", e); } } }
Source:
<code>public void receive(final String name, final String value, final NamedValueSource source, final int recordCount, final int entityCount) { matcher.reset(value); if (null == format) { while (matcher.find()) { final String group = matcher.group(); if (!group.isEmpty()) { getNamedValueReceiver().receive(name, group, source, recordCount, entityCount); } } } else { while (matcher.find()) { <START> if (!matchAndFormatIsEmpty()) { <END> getNamedValueReceiver().receive(name, StringUtil.format(format, tempVars), source, recordCount, entityCount); } } } }</code><technical_language>I think, code easier understand if populating tempVars testing is empty separated: java populateVars(); // instead of matchAndFormatIsEmpty() if (tempVars.isEmpty()) { // ... }</technical_language>

Target:
public void receive(final String name, final String value, final NamedValueSource source, final int recordCount, final int entityCount) { matcher.reset(value); if (null == format) { while (matcher.find()) { final String group = matcher.group(); if (!group.isEmpty()) { getNamedValueReceiver().receive(name, group, source, recordCount, entityCount); } } } else { while (matcher.find()) { populateVars(); if (!tempVars.isEmpty()) { getNamedValueReceiver().receive(name, StringUtil.format(format, tempVars), source, recordCount, entityCount); } } } }
Source:
<code>private synchronized void sendUpdate(Update update, PilightConnection connection) { if (connection.getDelay() != null) { Date now = new Date(); long delayBetweenUpdates = connection.getDelay(); if (connection.getLastUpdate() != null) { long diff = now.getTime() - connection.getLastUpdate().getTime(); if (diff < delayBetweenUpdates) { try { Thread.sleep(delayBetweenUpdates-diff); } catch (InterruptedException e) { logger.error("Error while processing pilight throttling delay"); <START> } <END> } } } doUpdateCall(update, connection); }</code><technical_language>sending Thread sleep avoided internalReceiveCommand is called synchronously. implement a method "delayedUpdateCall()" of concurrent Classes Quartz Scheduler</technical_language>

Target:
private void sendUpdate(Update update, PilightConnection connection) { if (connection.getDelay() != null) { delayedUpdateCall(update, connection); } else { doUpdateCall(update, connection); } }
Source:
<code>public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); <START> if (dataType.hasPriority()) { checkPriorityXorAnnouncement(buffer); firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); channelStatePersister.maybePersist(buffer); if (dataType.requiresAnnouncement()) { checkPriorityXorAnnouncement(buffer); <END> firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }</code><technical_language>if (dataType.hasPriority() || dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } if (!dataType.hasPriority()) { receivedBuffers.add(sequenceBuffer); channelStatePersister.maybePersist(buffer); }</technical_language>

Target:
public void onBuffer(Buffer buffer, int sequenceNumber, int backlog) throws IOException { boolean recycleBuffer = true; try { if (expectedSequenceNumber != sequenceNumber) { onError(new BufferReorderingException(expectedSequenceNumber, sequenceNumber)); return; } final boolean wasEmpty; boolean firstPriorityEvent = false; synchronized (receivedBuffers) { if (isReleased.get()) { return; } wasEmpty = receivedBuffers.isEmpty(); SequenceBuffer sequenceBuffer = new SequenceBuffer(buffer, sequenceNumber); DataType dataType = buffer.getDataType(); if (dataType.hasPriority()) { firstPriorityEvent = addPriorityBuffer(sequenceBuffer); } else { receivedBuffers.add(sequenceBuffer); channelStatePersister.maybePersist(buffer); if (dataType.requiresAnnouncement()) { firstPriorityEvent = addPriorityBuffer(announce(sequenceBuffer)); } } ++expectedSequenceNumber; } recycleBuffer = false; if (firstPriorityEvent) { notifyPriorityEvent(sequenceNumber); } if (wasEmpty) { notifyChannelNonEmpty(); } if (backlog >= 0) { onSenderBacklog(backlog); } } finally { if (recycleBuffer) { buffer.recycleBuffer(); } } }
Source:
<code>protected void adjustManifests(IProgressMonitor monitor, IProject project, IPluginBase base) throws CoreException { super.adjustManifests(monitor, project, base); int units = fData.doFindDependencies() ? 4 : 2; units += fData.isUpdateReferences() ? 1 : 0; SubMonitor subMonitor = SubMonitor.convert(monitor, new String(), units); IBundle bundle = (base instanceof BundlePluginBase) ? ((BundlePluginBase) base).getBundle() : null; if (bundle != null) { adjustExportRoot(project, bundle); monitor.worked(1); addExportedPackages(project, bundle); monitor.worked(1); if (fData.doFindDependencies()) { addDependencies(project, base.getModel(), subMonitor.newChild(2)); } if (fData.isUpdateReferences()) { <START> updateReferences(monitor, project); <END> monitor.worked(1); } } }</code><technical_language>This subMonitor.newChild(1) monitor</technical_language>

Target:
protected void adjustManifests(IProgressMonitor monitor, IProject project, IPluginBase base) throws CoreException { super.adjustManifests(monitor, project, base); int units = fData.doFindDependencies() ? 4 : 2; units += fData.isUpdateReferences() ? 1 : 0; SubMonitor subMonitor = SubMonitor.convert(monitor, units); IBundle bundle = (base instanceof BundlePluginBase) ? ((BundlePluginBase) base).getBundle() : null; if (bundle != null) { adjustExportRoot(project, bundle); subMonitor.worked(1); addExportedPackages(project, bundle); subMonitor.worked(1); if (fData.doFindDependencies()) { addDependencies(project, base.getModel(), subMonitor.newChild(2)); } if (fData.isUpdateReferences()) { updateReferences(subMonitor.newChild(1), project); } } }
Source:
<code>public ValidationResult isReadOnlyPropertyCompatibleWithInterface() { if (Boolean.TRUE.equals(disk.getReadOnly())) { DiskInterface diskInterface = disk.getDiskInterface(); if (diskInterface == DiskInterface.IDE) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR, String.format("$interface %1$s", diskInterface)); } boolean isVirtioScsiDirectLunPassthrough = diskInterface == DiskInterface.VirtIO_SCSI && <START> disk.getDiskStorageType() == DiskStorageType.LUN && disk.isScsiPassthrough(); <END> if (isVirtioScsiDirectLunPassthrough) { return new ValidationResult(VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK); } } return ValidationResult.VALID; }</code><technical_language>check is disk.isScsiPassthrough()? If rest of condition true get thrown validation failure</technical_language>

Target:
public ValidationResult isReadOnlyPropertyCompatibleWithInterface() { if (Boolean.TRUE.equals(disk.getReadOnly())) { DiskInterface diskInterface = disk.getDiskInterface(); if (diskInterface == DiskInterface.IDE) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR, String.format("$interface %1$s", diskInterface)); } if (disk.isScsiPassthrough()) { return new ValidationResult(VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK); } } return ValidationResult.VALID; }
Source:
<code>protected void updateInstanceToTaskAssignmentsFromContext(JobContext jobCtx, Map<String, SortedSet<Integer>> prevInstanceToTaskAssignments) { for (Integer partition : jobCtx.getPartitionSet()) { if (jobCtx.getPartitionState(partition) == TaskPartitionState.RUNNING || jobCtx.getPartitionState(partition) == TaskPartitionState.INIT) { String instance = jobCtx.getAssignedParticipant(partition); <START> if (prevInstanceToTaskAssignments.containsKey(instance) <END> && !prevInstanceToTaskAssignments.get(instance).contains(partition)) { prevInstanceToTaskAssignments.get(instance).add(partition); } } } }</code><technical_language>other states? Is necessary add updated</technical_language>

Target:
protected void updateInstanceToTaskAssignmentsFromContext(JobContext jobCtx, Map<String, SortedSet<Integer>> prevInstanceToTaskAssignments) { for (Integer partition : jobCtx.getPartitionSet()) { if (jobCtx.getPartitionState(partition) == TaskPartitionState.RUNNING || jobCtx.getPartitionState(partition) == TaskPartitionState.INIT) { String instance = jobCtx.getAssignedParticipant(partition); if (instance != null) { if (prevInstanceToTaskAssignments.containsKey(instance) && !prevInstanceToTaskAssignments.get(instance).contains(partition)) { prevInstanceToTaskAssignments.get(instance).add(partition); } } } } }
Source:
<code>public QueryBuilder byId(Iterable<?> ids) { <START> this.ids = ImmutableSet.builder() <END> .add(ids) .build(); return this; }</code><technical_language>checkNonNull() params of builder, null</technical_language>

Target:
public QueryBuilder byId(Iterable<?> ids) { checkNotNull(ids); this.ids = ImmutableSet.builder() .addAll(ids) .build(); return this; }
Source:
<code>private AsyncRetryMetrics(String prefix, Iterable<AsyncRetry> retries) { requireNonNull(prefix); requireNonNull(retries); retries.forEach(retry -> { String name = retry.getName(); <START> metricRegistry.register(name(prefix, name, AsyncRetry.class.getSimpleName(), SUCCESSFUL_CALLS_WITHOUT_RETRY), <END> (Gauge<Long>) () -> retry.getMetrics().getNumberOfSuccessfulCallsWithoutRetryAttempt()); metricRegistry.register(name(prefix, name, AsyncRetry.class.getSimpleName(), SUCCESSFUL_CALLS_WITH_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfSuccessfulCallsWithRetryAttempt()); metricRegistry.register(name(prefix, name, AsyncRetry.class.getSimpleName(), FAILED_CALLS_WITHOUT_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfFailedCallsWithoutRetryAttempt()); metricRegistry.register(name(prefix, name, AsyncRetry.class.getSimpleName(), FAILED_CALLS_WITH_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfFailedCallsWithRetryAttempt()); }); }</code><technical_language>I automatically append provided name</technical_language>

Target:
private AsyncRetryMetrics(String prefix, Iterable<AsyncRetry> retries) { requireNonNull(prefix); requireNonNull(retries); retries.forEach(retry -> { String name = retry.getName(); metricRegistry.register(name(prefix, name, SUCCESSFUL_CALLS_WITHOUT_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfSuccessfulCallsWithoutRetryAttempt()); metricRegistry.register(name(prefix, name, SUCCESSFUL_CALLS_WITH_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfSuccessfulCallsWithRetryAttempt()); metricRegistry.register(name(prefix, name, FAILED_CALLS_WITHOUT_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfFailedCallsWithoutRetryAttempt()); metricRegistry.register(name(prefix, name, FAILED_CALLS_WITH_RETRY), (Gauge<Long>) () -> retry.getMetrics().getNumberOfFailedCallsWithRetryAttempt()); }); }
Source:
<code>public boolean performNextOperation(int completedChildCount) { restoreCommandState(); switch (getParameters().getPhase()) { case CREATE_TEMPLATE: <START> if (!getParameters().isSealTemplate()) { <END> return false; } getParameters().setPhase(Phase.ASSIGN_ILLEGAL); break; case ASSIGN_ILLEGAL: getParameters().setPhase(Phase.SEAL); break; case SEAL: getParameters().setPhase(Phase.ASSIGN_LEGAL_SHARED); break; case ASSIGN_LEGAL_SHARED: return false; } persistCommandIfNeeded(); executeNextOperation(); return true; }</code><technical_language>this condition needs switch command? If Template is seal need return false before</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { if (!getParameters().isSealTemplate()) { return false; } restoreCommandState(); switch (getParameters().getPhase()) { case CREATE_TEMPLATE: getParameters().setPhase(Phase.ASSIGN_ILLEGAL); break; case ASSIGN_ILLEGAL: getParameters().setPhase(Phase.SEAL); break; case SEAL: getParameters().setPhase(Phase.ASSIGN_LEGAL_SHARED); break; case ASSIGN_LEGAL_SHARED: return false; } persistCommandIfNeeded(); executeNextOperation(); return true; }
Source:
<code>public VeluxGwState getState() { String deviceStatus = this.getDeviceStatus(); byte stateValue = (byte) VeluxGatewayState.GW_S_GWM.getStateValue(); byte subStateValue; if (deviceStatus.equals("discovering")) { subStateValue = (byte) VeluxGatewaySubState.GW_SS_P1.getStateValue(); } else if (deviceStatus.equals("IDLE")) { subStateValue = (byte) VeluxGatewaySubState.GW_SS_IDLE.getStateValue(); } else { subStateValue = (byte) VeluxGatewaySubState.GW_SS_P2.getStateValue(); } <START> VeluxGwState thisGwState = new VeluxGwState(stateValue, subStateValue); <END> return thisGwState; }</code><technical_language>Combine this line line below</technical_language>

Target:
public VeluxGwState getState() { String deviceStatus = this.getDeviceStatus(); byte stateValue = (byte) VeluxGatewayState.GW_S_GWM.getStateValue(); byte subStateValue; if (deviceStatus.equals("discovering")) { subStateValue = (byte) VeluxGatewaySubState.GW_SS_P1.getStateValue(); } else if (deviceStatus.equals("IDLE")) { subStateValue = (byte) VeluxGatewaySubState.GW_SS_IDLE.getStateValue(); } else { subStateValue = (byte) VeluxGatewaySubState.GW_SS_P2.getStateValue(); } return new VeluxGwState(stateValue, subStateValue); }
Source:
<code>public PaxosResponses<PaxosPromise> prepare(long seq, PaxosProposalId proposalId) { try { return prepare.apply(Maps.immutableEntry(client, WithSeq.of(seq, proposalId))).get(); } catch (ExecutionException e) { <START> Throwable cause = e.getCause(); <END> if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } catch (InterruptedException e) { throw new RuntimeException(e); } }</code><technical_language>a static method in ExecutionExceptions similar class</technical_language>

Target:
public PaxosResponses<PaxosPromise> prepare(long seq, PaxosProposalId proposalId) { try { return prepare.apply(Maps.immutableEntry(client, WithSeq.of(seq, proposalId))).get(); } catch (ExecutionException | InterruptedException e) { throw AutobatcherExecutionExceptions.handleAutobatcherExceptions(e); } }
Source:
<code>void unregister() { checkLocked(); try { owner.mbeanServer.unregisterMBean(objectName); } catch (Exception e) { <START> throw new RuntimeException("Failed to reregister bean " + mbeanName, e); <END> } }</code><technical_language>a typo "reregister -> unregister"</technical_language>

Target:
void unregister() { checkLocked(); try { owner.mbeanServer.unregisterMBean(objectName); } catch (Exception e) { throw new KafkaException("Failed to unreregister bean " + mbeanName, e); } }
Source:
<code>@Override public SelectSpanNames clone() { <START> return new AutoValue_SelectSpanNames(session(), preparedStatement(), service()); <END> }</code><technical_language>I un-autovalue some of I need override toString preparedStatement's toString is crap</technical_language>

Target:
@Override public SelectSpanNames clone() { return new SelectSpanNames(factory, service); }
Source:
<code>public List<Contributor> getContributors() { return this.configuration.get(List.class, <START> "contributors", <END> new ArrayList<Contributor>()); }</code><technical_language>constant</technical_language>

Target:
public List<Contributor> getContributors() { return this.configuration.get(List.class, CONTRIBUTORS, new ArrayList<Contributor>()); }
Source:
<code>public Collection<GrantedAuthority> convert(Jwt jwt) { Collection<GrantedAuthority> grantedAuthorities = new ArrayList<>(); for (String authority : getAuthorities(jwt)) { <START> grantedAuthorities.add(new SimpleGrantedAuthority(authorityPrefix + authority)); <END> } return grantedAuthorities; }</code><technical_language>conform team standard, please prefix field this.</technical_language>

Target:
public Collection<GrantedAuthority> convert(Jwt jwt) { Collection<GrantedAuthority> grantedAuthorities = new ArrayList<>(); for (String authority : getAuthorities(jwt)) { grantedAuthorities.add(new SimpleGrantedAuthority(this.authorityPrefix + authority)); } return grantedAuthorities; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (fDeclarationToPopulate == null) { if (other.fDeclarationToPopulate != null) { return false; } } else if (!fDeclarationToPopulate.equals(other.fDeclarationToPopulate)) { return false; } if (!NonNullUtils.equalsNullable(fFields, other.fFields)) { return false; } if (!NonNullUtils.equalsNullable(fPrevDefinitionScope, other.fPrevDefinitionScope)) { return false; } if (!NonNullUtils.equalsNullable(fTag, other.fTag)) { return false; } <START> return NonNullUtils.equalsNullable(fTagDef, other.fTagDef); <END> }</code><technical_language>previous patch (keep check). I tempting REMOVE LIIIIIINES, get crazy :P</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } VariantDeclaration other = (VariantDeclaration) obj; if (fDeclarationToPopulate == null) { if (other.fDeclarationToPopulate != null) { return false; } } else if (!fDeclarationToPopulate.equals(other.fDeclarationToPopulate)) { return false; } if (!equalsNullable(fFields, other.fFields)) { return false; } if (!equalsNullable(fPrevDefinitionScope, other.fPrevDefinitionScope)) { return false; } if (!equalsNullable(fTag, other.fTag)) { return false; } if (!equalsNullable(fTagDef, other.fTagDef)){ return false; } return true; }
Source:
<code>public void sendSmallEventsFullBatchPartitionKey() { <START> final EventDataBatch batch = new EventDataBatch(ClientConstants.MAX_MESSAGE_LENGTH_BYTES, null, PARTITION_KEY, contextProvider, null); <END> int count = 0; while (batch.tryAdd(createData())) { if (count % 100 == 0) { logger.verbose("Batch size: {}", batch.getSize()); } count++; } StepVerifier.create(producer.send(batch.getEvents())) .verifyComplete(); }</code><technical_language>is this result in a null reference exception? I mock for this</technical_language>

Target:
public void sendSmallEventsFullBatchPartitionKey() { final EventDataBatch batch = new EventDataBatch(ClientConstants.MAX_MESSAGE_LENGTH_BYTES, null, PARTITION_KEY, contextProvider, new TracerProvider(Collections.emptyList())); int count = 0; while (batch.tryAdd(createData())) { if (count % 100 == 0) { logger.verbose("Batch size: {}", batch.getCount()); } count++; } StepVerifier.create(producer.send(batch.getEvents())) .verifyComplete(); }
Source:
<code>public Iterator<SpreadsheetRecord> iterator() { Iterator<SpreadsheetRecord> iterator = null; if(myBook.getNumberOfSheets() > 1) { Iterator<SpreadsheetRecord> it = null; for (int i = 0; i < myBook.getNumberOfSheets(); ++i) { Sheet sheet = myBook.getSheetAt(i); if (i < myBook.getNumberOfSheets() - 1) { int lastRow = sheet.getPhysicalNumberOfRows(); sheet.createRow(lastRow + 1); sheet.createRow(lastRow + 2); } it = Iterators.transform(sheet.iterator(), (input) -> new XlsRecordImpl(getCellValues(input), myHeaders)); iterator = (iterator == null) ? it : Iterators.concat(iterator, it); } } <START> else { <END> iterator = Iterators.transform(myBook.getSheetAt(0).iterator(), (input) -> new XlsRecordImpl(getCellValues(input), myHeaders)); } return iterator; }</code><technical_language>safely remove else block if condition do is written in true-case block matter if 1 sheet more 1</technical_language>

Target:
public Iterator<SpreadsheetRecord> iterator() { Iterator<SpreadsheetRecord> iterator = null; Iterator<SpreadsheetRecord> it = null; for (int i = 0; i < myBook.getNumberOfSheets(); ++i) { Sheet sheet = myBook.getSheetAt(i); if (i < myBook.getNumberOfSheets() - 1) { int lastRow = sheet.getPhysicalNumberOfRows(); sheet.createRow(lastRow + 1); sheet.createRow(lastRow + 2); } it = Iterators.transform(sheet.iterator(), (input) -> new XlsRecordImpl(getCellValues(input), myHeaders)); iterator = (iterator == null) ? it : Iterators.concat(iterator, it); } return iterator; }
Source:
<code>public void invalidInlineScript() throws Exception { Message<?> message = new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!")); try { <START> this.invalidInlineScript.send(message); <END> fail("MessageHandlingException expected!"); } catch (MessageHandlingException e) { Throwable cause = e.getCause(); assertEquals(MissingPropertyException.class, cause.getClass()); assertThat(cause.getMessage(), Matchers.containsString("No such property: ReplyRequiredException for class: script")); } }</code><technical_language>Gary, I this test like: java //INT-2399 @Test public void invalidInlineScript() { Message<?> message = new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!")); try { this.invalidInlineScript.send(message); fail("MessageHandlingException expected!"); } catch (MessageHandlingException e) { Throwable = e.getCause(); assertEquals(ScriptCompilationException.class, cause.getClass()); assertThat(cause.getMessage(), Matchers.containsString("No property: ReplyRequiredException for class: script")); } } works for Java versions, IDE Gradle. this fixes Travis failure</technical_language>

Target:
public void invalidInlineScript() throws Exception { Message<?> message = new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!")); try { this.invalidInlineScript.send(message); fail("MessageHandlingException expected!"); } catch (MessageHandlingException e) { Throwable cause = e.getCause(); assertEquals(ScriptCompilationException.class, cause.getClass()); assertThat(cause.getMessage(), Matchers.containsString("No such property: ReplyRequiredException for class: script")); } }
Source:
<code>protected ValidationInfo doValidate() { Component selectedComponent = myContentPanel.getSelectedComponent(); if (selectedComponent != myColorPickerPanel) { <START> <END> boolean isProjectPanel = selectedComponent == myProjectPanel.myComponent; ResourcePanel panel = isProjectPanel ? myProjectPanel : mySystemPanel; ResourceItem element = getSelectedElement(panel.myTreeBuilder, ResourceItem.class); if (element == null) { return new ValidationInfo("Select a color", panel.myComponent); } else { return null; } } if (myResourceNameVisibility == ResourceNameVisibility.HIDE) { return null; } final String errorText = getErrorString(); if (errorText == null) { myResourceNameMessage.setText(""); return null; } else { if (myOverwriteResource) { myResourceNameMessage.setText(errorText); return null; } else { myResourceNameMessage.setText(""); return new ValidationInfo(errorText, myResourceNameField); } } }</code><technical_language>nit: empty line</technical_language>

Target:
protected ValidationInfo doValidate() { Component selectedComponent = myContentPanel.getSelectedComponent(); if (selectedComponent != myColorPickerPanel) { boolean isProjectPanel = selectedComponent == myProjectPanel.myComponent; ResourcePanel panel = isProjectPanel ? myProjectPanel : mySystemPanel; ResourceItem element = getSelectedElement(panel.myTreeBuilder, ResourceItem.class); setOKActionEnabled(element != null); return null; } if (myResourceNameVisibility == ResourceNameVisibility.HIDE) { setOKActionEnabled(true); return null; } final String errorText = getErrorString(); if (errorText == null) { myResourceNameMessage.setText(""); setOKActionEnabled(true); return null; } if (myOverwriteResource) { myResourceNameMessage.setText(errorText); setOKActionEnabled(true); return null; } myResourceNameMessage.setText(""); setOKActionEnabled(false); return new ValidationInfo(errorText, myResourceNameField); }
Source:
<code>public void setUp() { final TestCommandFactory commandFactory = <START> TestCommandFactory.newInstance(newUuid(), <END> ZoneOffset.getDefaultInstance()); this.command = commandFactory.create(newStringValue(newUuid()), Timestamps2.getCurrentTime()); }</code><technical_language>method fit this test suite? public static TestCommandFactory newInstance(Class<?> testClass)</technical_language>

Target:
public void setUp() { final TestCommandFactory commandFactory = TestCommandFactory.newInstance(FailureThrowable.class); this.command = commandFactory.create(newUuidValue()); }
Source:
<code>private boolean shouldShowGutenbergEditor() { return AppPrefs.isGutenbergEditorEnabled() && <START> (mIsNewPost || TextUtils.isEmpty(mPost.getContent()) || <END> GutenbergEditorFragment.contentContainsGutenbergBlocks(mPost.getContent())); }</code><technical_language>TextUtils.isEmpty(mPost.getContent()) user flow this condition capture? I wonder, check for mIsNewPost contentContainsGutenbergBlocks in onCreate set a mShowGutenbergEditor flag true? impression need shouldShowGutenbergEditor dynamic OK computed once, in beginning. I missing some case</technical_language>

Target:
private boolean shouldShowGutenbergEditor() { return AppPrefs.isGutenbergEditorEnabled() && (mIsNewPost || GutenbergEditorFragment.contentContainsGutenbergBlocks(mPost.getContent())); }
Source:
<code>public void init(final ConsolePopupModel model) { this.model = model; initView(model); initListeners(model); <START> String vmName = model.getModel().getVM().getName(); <END> getView().setVmName(vmName); super.init(model); }</code><technical_language>I understand this popup works for VM for pool, fact model.getModel().getVM() returns null for pool is handled here. still, is invariant for this class works for VM guard it. for easier debugging in future I start this init method if(model.getModel().isPool()) { throw new IllegalArgumentException("The console popup pool, VM") } this</technical_language>

Target:
public void init(final ConsolePopupModel model) { if (model.getModel().isPool()) { throw new IllegalArgumentException("The console popup can not be used with pool, only with VM"); } this.model = model; initView(model); initListeners(model); String vmName = model.getModel().getVM().getName(); getView().setVmName(vmName); super.init(model); }
Source:
<code>private CQMResultDetails buildCqmDetails(CQMCriterionDTO cqmDto) { <START> CQMResultDetails cqmDetails = new CQMResultDetails(); cqmDetails.setCmsId(cqmDto.getCmsId()); cqmDetails.setNqfNumber(cqmDto.getNqfNumber()); cqmDetails.setNumber(cqmDto.getNumber()); cqmDetails.setTitle(cqmDto.getTitle()); cqmDetails.setDescription(cqmDto.getDescription()); cqmDetails.setSuccess(Boolean.FALSE); cqmDetails.getAllVersions().add(cqmDto.getCqmVersion()); cqmDetails.setTypeId(cqmDto.getCqmCriterionTypeId()); <END> return cqmDetails; }</code><technical_language>Builder</technical_language>

Target:
private CQMResultDetails buildCqmDetails(CQMCriterionDTO cqmDto) { CQMResultDetails cqmDetails = CQMResultDetails.builder() .cmsId(cqmDto.getCmsId()) .nqfNumber(cqmDto.getNqfNumber()) .number(cqmDto.getNumber()) .title(cqmDto.getTitle()) .description(cqmDto.getDescription()) .success(Boolean.FALSE) .typeId(cqmDto.getCqmCriterionTypeId()) .build(); cqmDetails.getAllVersions().add(cqmDto.getCqmVersion()); return cqmDetails; }
Source:
<code>protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (!actionReturnValue.getSucceeded()) { return; } if (proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { actionReturnValue = runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); if <START> (actionReturnValue == null || <END> !actionReturnValue.getSucceeded()) { return; } } else { log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); } setSucceeded(true); }</code><technical_language>Based logic in Backend#runActionImpl this null</technical_language>

Target:
protected void executeCommand() { Guid storageDomainId = getStorageDomainId(); StoragePoolParametersBase parameters = new StoragePoolParametersBase(getStoragePoolId()); ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext()); Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue(); if (!actionReturnValue.getSucceeded()) { return; } if (proccessedDomains != null && proccessedDomains.contains(storageDomainId)) { actionReturnValue = runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams()); if (!actionReturnValue.getSucceeded()) { return; } } else { log.info("OVFs update was ignored - nothing to update for storage domain '{}'", storageDomainId); } setSucceeded(true); }
Source:
<code>private void loadImplementationsInJar(final ResolverUtil.Test test, final String parent, final URLConnection connection) { JarFile jarFile = null; try { if (connection != null && connection instanceof JarURLConnection) { JarURLConnection jarURLConnection = (JarURLConnection) connection; jarFile = jarURLConnection.getJarFile(); final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (!entry.isDirectory() && name.startsWith(parent) && this.isTestApplicable(test, name)) { this.addIfMatching(test, name); } } } }catch (IOException e){ LOGGER.error("Could not search JAR file '{}' for classes matching criteria {}, file not found", jarFile, test, e); }finally { if (jarFile != null){ <START> try { <END> jarFile.close(); } catch (IOException ignored) { LOGGER.error("Error closing JAR file stream for {}", jarFile, ignored); } } } }</code><technical_language>Is simplify a try-with-resources block</technical_language>

Target:
private void loadImplementationsInJar(final ResolverUtil.Test test, final String parent, final URLConnection connection) { if (connection != null && connection instanceof JarURLConnection) { JarURLConnection jarURLConnection = (JarURLConnection) connection; try (JarFile jarFile = jarURLConnection.getJarFile()) { final Enumeration<JarEntry> entries = jarFile.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String name = entry.getName(); if (!entry.isDirectory() && name.startsWith(parent) && this.isTestApplicable(test, name)) { this.addIfMatching(test, name); } } } catch (IOException e) { LOGGER.error("Could not search JAR file '{}' for classes matching criteria {}, file not found", connection.getURL().getPath(), test, e); } } }
Source:
<code>public Optional<ImmutableSneakingData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableSneakingData immutable) { if (!key.equals(Keys.IS_SNEAKING)) { return Optional.absent(); } <START> final ImmutableSneakingData data = new ImmutableSpongeSneakingData(((Boolean) value).booleanValue()); <END> return Optional.of(data); }</code><technical_language>caching util I mentioned before</technical_language>

Target:
public Optional<ImmutableSneakingData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableSneakingData immutable) { if (!key.equals(Keys.IS_SNEAKING)) { return Optional.absent(); } final ImmutableSneakingData data = ImmutableDataCachingUtil.getManipulator(ImmutableSpongeSneakingData.class, value); return Optional.of(data); }