auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String getUsage() { StringBuilder help = new StringBuilder(String.format("Options:%n")); for(String arg : getPrefixArguments()) { Argument argument = this.arguments.get(arg); help.append( String.format( " --%s%n" + " %s%n" + "%n", arg + (argument.getType() != Argument.Type.NO_ARGUMENT ? "=[" + argument.getMetavar() + "]" : ""), argument.getHelp() <START> .replace("@CLI_PRM_DEFAULT@", argument.getDefaultValue() == null ? "" : argument.getDefaultValue()) <END> .replace("@CLI_PRM_PATTERN@", argument.getMatcher().pattern()) ) ); } return doSubstitutions( String.format("%1$s%n%2$s%n%n%3$s%4$s%n", properties.getProperty( prefix + ".help.usage", (String) defaultProperties.get("help.usage") ), properties.getProperty( prefix + ".help.header", (String) defaultProperties.get("help.header") ), help.toString(), properties.getProperty( prefix + ".help.footer", (String) defaultProperties.get("help.footer") ) ) ); }</code><technical_language>StringUtils.defaultString(argument.getDefaultValue())</technical_language>

Target:
public String getUsage() { StringBuilder help = new StringBuilder(String.format("Options:%n")); for(String arg : getPrefixArguments()) { Argument argument = this.arguments.get(arg); help.append( String.format( " --%s%n" + " %s%n" + "%n", arg + (argument.getType() != Argument.Type.NO_ARGUMENT ? "=[" + argument.getMetavar() + "]" : ""), argument.getHelp() .replace("@CLI_PRM_DEFAULT@", StringUtils.defaultString(argument.getDefaultValue())) .replace("@CLI_PRM_PATTERN@", argument.getMatcher().pattern()) ) ); } String usage = String.format("%1$s%n%2$s%n%n%3$s%4$s%n", properties.getProperty( prefix + ".help.usage", (String) defaultProperties.get("help.usage") ), properties.getProperty( prefix + ".help.header", (String) defaultProperties.get("help.header") ), help.toString(), properties.getProperty( prefix + ".help.footer", (String) defaultProperties.get("help.footer") ) ); for (Map.Entry<String, String> substitution : substitutions.entrySet()) { usage = usage.replaceAll(substitution.getKey(), substitution.getValue()); } return usage; }
Source:
<code>private void connectServiceRequestPerSecondSensor() { <START> serverLatencyFeed = FunctionFeed.builder() <END> .entity(this) .period(Duration.seconds(1)) .poll(new FunctionPollConfig<Double, Double>(REQUEST_PER_SECOND) .onException(Functions.constant(0.0)) .callable(new Callable<Double>() { public Double call() { Double currentRequestPerSecond = getAttribute(SERVER_REQUESTS) - lastTotalRequest; if (currentRequestPerSecond >= 0) { lastTotalRequest = getAttribute(SERVER_REQUESTS); return currentRequestPerSecond; } else { return getAttribute(SERVER_REQUESTS); } } })) .build(); }</code><technical_language>overwriting of serverLatencyFeed calculated in connectServiceLatencySensor(). Why</technical_language>

Target:
private void connectServiceRequestPerSecondSensor() { requestPerSecondLatencyFeed = FunctionFeed.builder() .entity(this) .period(Duration.seconds(1)) .poll(new FunctionPollConfig<Double, Double>(REQUEST_PER_SECOND) .onException(Functions.constant(0.0)) .callable(new Callable<Double>() { public Double call() { Double currentRequestPerSecond = getAttribute(SERVER_REQUESTS) - lastTotalRequest; if (currentRequestPerSecond >= 0) { lastTotalRequest = getAttribute(SERVER_REQUESTS); return currentRequestPerSecond; } else { return getAttribute(SERVER_REQUESTS); } } })) .build(); }
Source:
<code>private boolean entityDataStatement(Statement statement) { boolean knownPredicate = false; <START> String predicate = statement.getPredicate().stringValue(); <END> switch (predicate) { case SchemaDotOrg.VERSION: knownPredicate = true; revisionId = objectAsLiteral(statement); break; case SchemaDotOrg.DATE_MODIFIED: knownPredicate = true; lastModified = objectAsLiteral(statement); break; case SchemaDotOrg.SOFTWARE_VERSION: setFormatVersion(objectAsLiteral(statement).stringValue()); break; default: if (predicate.startsWith(Ontology.NAMESPACE)) { knownPredicate = true; } } if (knownPredicate) { dataStatements.add(new ImmutablePair<>( statement.getPredicate(), objectAsLiteral(statement))); } return false; }</code><technical_language>a bit worried performance impact of this. Is Java smart enough this recreate anew time? This is a hotspot code</technical_language>

Target:
private boolean entityDataStatement(Statement statement) { boolean knownPredicate = false; String predicate = statement.getPredicate().stringValue(); switch (predicate) { case SchemaDotOrg.VERSION: knownPredicate = true; revisionId = objectAsLiteral(statement); break; case SchemaDotOrg.DATE_MODIFIED: knownPredicate = true; lastModified = objectAsLiteral(statement); break; case SchemaDotOrg.SOFTWARE_VERSION: setFormatVersion(objectAsLiteral(statement).stringValue()); break; default: if (predicate.startsWith(Ontology.NAMESPACE)) { knownPredicate = true; } } if (knownPredicate) { dataStatements.add(new ImmutablePair<>( statement.getPredicate(), objectAsLiteral())); } return false; }
Source:
<code>protected void createButtonsForButtonBar(Composite parent) { Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); selectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(true); } }); Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); deselectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(false); } }); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); <START> createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); <END> }</code><technical_language>call updateOKButtonEnablement() OK button disabled traces available</technical_language>

Target:
protected void createButtonsForButtonBar(Composite parent) { Button selectAllButton = createButton(parent, IDialogConstants.SELECT_ALL_ID, Messages.TraceControl_ImportDialog_SelectAll, true); selectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(true); } }); Button deselectAllButton = createButton(parent, IDialogConstants.DESELECT_ALL_ID, Messages.TraceControl_ImportDialog_DeselectAll, true); deselectAllButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { setFolderChildrenChecked(false); } }); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); updateOKButtonEnablement(); }
Source:
<code>public DependencyPair executePlanFragment(Map<Integer, List<VoltTable>> dependencies, long fragmentId, ParameterSet params, SystemProcedureExecutionContext context) { VoltTable dummy = new VoltTable(STATUS_SCHEMA); dummy.addRow(STATUS_OK); if (fragmentId == SysProcFragmentId.PF_swapTables) { if (context.isLowestSiteId()) { UndoAction undoSwapDR = new UndoAction() { @Override public void release() <START> @Override <END> public void undo() { VoltDB.instance().swapTables((String) params.getParam(0), (String) params.getParam(1)); } }; registerUndoAction(undoSwapDR); VoltDB.instance().swapTables((String) params.getParam(0), (String) params.getParam(1)); SysprocFaultInjection.check(FaultType.SwapTablesCoreFragment); } return new TableDependencyPair(SysProcFragmentId.PF_swapTables, dummy); } else if (fragmentId == SysProcFragmentId.PF_swapTablesAggregate) { return new TableDependencyPair(SysProcFragmentId.PF_swapTablesAggregate, VoltTableUtil.unionTables(dependencies.get(SysProcFragmentId.PF_swapTables))); } assert false; return null; }</code><technical_language>Is a test confirms this UndoAction undo changes in EE</technical_language>

Target:
public DependencyPair executePlanFragment(Map<Integer, List<VoltTable>> dependencies, long fragmentId, ParameterSet params, SystemProcedureExecutionContext context) { VoltTable dummy = new VoltTable(STATUS_SCHEMA); dummy.addRow(STATUS_OK); if (fragmentId == SysProcFragmentId.PF_swapTables) { if (context.isLowestSiteId()) { UndoAction undoSwapDR = new UndoAction() { @Override public void release() @Override public void undo() { VoltDB.instance().swapTables((String) params.getParam(0), (String) params.getParam(1)); } }; registerUndoAction(undoSwapDR); VoltDB.instance().swapTables((String) params.getParam(0), (String) params.getParam(1)); } return new TableDependencyPair(SysProcFragmentId.PF_swapTables, dummy); } else if (fragmentId == SysProcFragmentId.PF_swapTablesAggregate) { return new TableDependencyPair(SysProcFragmentId.PF_swapTablesAggregate, VoltTableUtil.unionTables(dependencies.get(SysProcFragmentId.PF_swapTables))); } assert false; return null; }
Source:
<code>public @NonNull List<@NonNull IDataChartDescriptor<Object, ?>> getDataDescriptors() { <START> return new ArrayList<>(); <END> }</code><technical_language>Collections.EMPTY_LIST;</technical_language>

Target:
public @NonNull List<@NonNull IDataChartDescriptor<Object, ?>> getDataDescriptors() { return Collections.EMPTY_LIST; }
Source:
<code>private static ArrayList<String> parse(String str) { ArrayList<String> resArray = new ArrayList<String>(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < str.length(); ++i) { <START> if (str.charAt(i) == ',') { <END> resArray.add(builder.toString()); builder = new StringBuilder(); } else { builder.append(str.charAt(i)); } } return resArray; }</code><technical_language>String.split</technical_language>

Target:
private static String[] parse(String str) { String[] resArray = str.split(","); return resArray; }
Source:
<code>public void deactivate() { <START> logger.debug("neohub deactivated"); <END> }</code><technical_language>please decrease log level trace remove statement</technical_language>

Target:
public void deactivate() { }
Source:
<code>public List<Result> execute(IotasEvent input) { List<Result> results = new ArrayList<>(); for (ActionRuntime action : actions) { <START> results.add(action.execute(input)); <END> } return results; }</code><technical_language>Please add logging in for idea of is on</technical_language>

Target:
public List<Result> execute(IotasEvent input) { LOG.debug("execute invoked with IotasEvent {}", input); List<Result> results = new ArrayList<>(); for (ActionRuntime action : actions) { Result result = action.execute(input); LOG.debug("Applied action {}, Result {}", action, result); results.add(result); } LOG.debug("Returning results {}", results); return results; }
Source:
<code>public void sendSerialDataAsync(XBee16BitAddress address, byte[] data) throws XBeeException { if (address == null) throw new NullPointerException("Address cannot be null"); if (data == null) throw new NullPointerException("Data cannot be null"); if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); XBeePacket xbeePacket; logger.info(toString() + "Sending serial data asynchronously to >> {}.", address, HexUtils.prettyHexString(data)); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX16Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); <START> try { <END> sendXBeePacketAsync(xbeePacket); } catch (IOException e) { throw new XBeeException("Error writing in the communication interface.", e); } break; default: xbeePacket = new TransmitPacket(getNextFrameID(), XBee64BitAddress.UNKNOWN_ADDRESS, address, 0, XBeeTransmitOptions.NONE, data); try { sendXBeePacketAsync(xbeePacket); } catch (IOException e) { throw new XBeeException("Error writing in the communication interface.", e); } } }</code><technical_language>Duplicated code, move this switch switch generate packet: java try { sendXBeePacketAsync(xbeePacket); } catch (IOException e) { throw new XBeeException("Error writing in communication interface.", e); }</technical_language>

Target:
public void sendSerialDataAsync(XBee16BitAddress address, byte[] data) throws XBeeException { if (address == null) throw new NullPointerException("Address cannot be null"); if (data == null) throw new NullPointerException("Data cannot be null"); if (!connectionInterface.isOpen()) throw new InterfaceNotOpenException(); XBeePacket xbeePacket; logger.info(toString() + "Sending serial data asynchronously to >> {}.", address, HexUtils.prettyHexString(data)); switch (getXBeeProtocol()) { case RAW_802_15_4: xbeePacket = new TX16Packet(getNextFrameID(), address, XBeeTransmitOptions.NONE, data); break; default: xbeePacket = new TransmitPacket(getNextFrameID(), XBee64BitAddress.UNKNOWN_ADDRESS, address, 0, XBeeTransmitOptions.NONE, data); } sendAndCheckXBeePacket(xbeePacket, true); }
Source:
<code>static void writePubKeyContentsIntoBuffer(PublicKey publicKey, KeyType innerKeyType, Buffer<?> buf) { Certificate<PublicKey> certificate = toCertificate(publicKey); buf.putString(certificate.getNonce()); innerKeyType.writePubKeyContentsIntoBuffer(certificate.getKey(), buf); buf.putUInt64(certificate.getSerial()) .putUInt32(certificate.getType()) .putString(certificate.getId()) .putString(packList(certificate.getValidPrincipals())) .putUInt64(epochFromDate(certificate.getValidAfter())) .putUInt64(epochFromDate(certificate.getValidBefore())) .putString(packMap(certificate.getCritOptions())) .putString(packMap(certificate.getExtensions())) .putString("") <START> .putString(certificate.getSignatureKey()) <END> .putString(certificate.getSignature()); }</code><technical_language>putBytes (also for other places). Esp. signatures keys strings byte[]. implementation in buffer differ, semantics different</technical_language>

Target:
static void writePubKeyContentsIntoBuffer(PublicKey publicKey, KeyType innerKeyType, Buffer<?> buf) { Certificate<PublicKey> certificate = toCertificate(publicKey); buf.putBytes(certificate.getNonce()); innerKeyType.writePubKeyContentsIntoBuffer(certificate.getKey(), buf); buf.putUInt64(certificate.getSerial()) .putUInt32(certificate.getType()) .putString(certificate.getId()) .putBytes(packList(certificate.getValidPrincipals())) .putUInt64(epochFromDate(certificate.getValidAfter())) .putUInt64(epochFromDate(certificate.getValidBefore())) .putBytes(packMap(certificate.getCritOptions())) .putBytes(packMap(certificate.getExtensions())) .putString("") .putBytes(certificate.getSignatureKey()) .putBytes(certificate.getSignature()); }
Source:
<code>private String readIdentifierWithSchema2(String s) { schemaName = s; s = readColumnIdentifier(); if (currentTokenType == DOT) { <START> if (equalsToken(schemaName, database.getShortName()) || database.getIgnoreCatalogs()) { <END> read(); schemaName = s; s = readColumnIdentifier(); } } return s; }</code><technical_language>If a catalog name is equal a schema name, happen</technical_language>

Target:
private String readIdentifierWithSchema2(String s) { schemaName = s; if (database.getMode().allowEmptySchemaValuesAsDefaultSchema && readIf(DOT)) { if (equalsToken(schemaName, database.getShortName()) || database.getIgnoreCatalogs()) { schemaName = session.getCurrentSchemaName(); s = readColumnIdentifier(); } } else { s = readColumnIdentifier(); if (currentTokenType == DOT) { if (equalsToken(schemaName, database.getShortName()) || database.getIgnoreCatalogs()) { read(); schemaName = s; s = readColumnIdentifier(); } } } return s; }
Source:
<code>public void doRun() throws Exception { long iteration = 0; while (!context.isStopped()) { int partitionId = nextPartitionId(); ICompletableFuture f = invoke(partitionId); latency.started(); if (syncInvocation) { if (syncFrequency == 1) { f.get(); } else { if (iteration > 0 && iteration % syncFrequency == 0) { for (ICompletableFuture future : futureList) { future.get(); } futureList.clear(); } else { futureList.add(f); } } } else { f.andThen(this); } latency.done(); if (iteration % logFrequency == 0) { log.info(Thread.currentThread().getName() + " At iteration: " + iteration); } if (iteration % performanceUpdateFrequency == 0) { if (syncInvocation) { operations.addAndGet(performanceUpdateFrequency); } } iteration++; } <START> operations.addAndGet(iteration % performanceUpdateFrequency); <END> }</code><technical_language>I move java iteration++; java if (iteration % performanceUpdateFrequency == 0) { if (syncInvocation) { operations.addAndGet(performanceUpdateFrequency); } }</technical_language>

Target:
public void doRun() throws Exception { long iteration = 0; while (!context.isStopped()) { int partitionId = nextPartitionId(); ICompletableFuture f = invoke(partitionId); latency.started(); if (syncInvocation) { if (syncFrequency == 1) { f.get(); } else { if (iteration > 0 && iteration % syncFrequency == 0) { for (ICompletableFuture future : futureList) { future.get(); } futureList.clear(); } else { futureList.add(f); } } } else { f.andThen(this); } latency.done(); iteration++; if (iteration % logFrequency == 0) { log.info(Thread.currentThread().getName() + " At iteration: " + iteration); } if (iteration % performanceUpdateFrequency == 0) { if (syncInvocation) { operations.addAndGet(performanceUpdateFrequency); } } } operations.addAndGet(iteration % performanceUpdateFrequency); }
Source:
<code>public String getDescription() { <START> return ""; <END> }</code><technical_language>+ desc</technical_language>

Target:
public String getDescription() { return "Spás ar iarraidh"; }
Source:
<code>public LoadQueuePeon giveMePeon(ImmutableDruidServer server) { if ("http".equalsIgnoreCase(config.getLoadQueuePeonType())) { return new HttpLoadQueuePeon(server.getURL(), jsonMapper, httpClient, config, peonExec, callbackExec); } else { <START> return new CuratorLoadQueuePeonV2( <END> curator, ZKPaths.makePath(zkPaths.getLoadQueuePath(), server.getName()), jsonMapper, Executors.newFixedThreadPool( config.getCreateZkNodeNumThreads(), new ThreadFactoryBuilder().setNameFormat( "CuratorLoadQueuePeon--%d").build() ), callbackExec, config ); } }</code><technical_language>reason CuratorLoadQueuePeon if replacing CuratorLoadQueuePeonV2 here. This is usage. replace V2 code completely</technical_language>

Target:
public LoadQueuePeon giveMePeon(ImmutableDruidServer server) { if ("http".equalsIgnoreCase(config.getLoadQueuePeonType())) { return new HttpLoadQueuePeon(server.getURL(), jsonMapper, httpClient, config, peonExec, callbackExec); } else { return new CuratorLoadQueuePeon( curator, ZKPaths.makePath(zkPaths.getLoadQueuePath(), server.getName()), jsonMapper, peonExec, callbackExec, config ); } }
Source:
<code>public void responseToDeadVertexAndUpdateEdges(BubbleMergeMessage incomingMsg) { VertexValueWritable vertex = getVertexValue(); EDGETYPE meToNeighborDir = EDGETYPE.fromByte(incomingMsg.getFlag()); EDGETYPE neighborToMeDir = meToNeighborDir.mirror(); <START> if (vertex.getEdges(neighborToMeDir).contains(incomingMsg.getSourceVertexId())) { <END> vertex.getEdges(neighborToMeDir).remove(incomingMsg.getSourceVertexId()); } }</code><technical_language>if !contains(), throw exception! Neighber edge vertex sends msg it</technical_language>

Target:
public void responseToDeadVertexAndUpdateEdges(BubbleMergeMessage incomingMsg) { VertexValueWritable vertex = getVertexValue(); EDGETYPE meToNeighborDir = EDGETYPE.fromByte(incomingMsg.getFlag()); EDGETYPE neighborToMeDir = meToNeighborDir.mirror(); if (vertex.getEdges(neighborToMeDir).contains(incomingMsg.getSourceVertexId())) { vertex.getEdges(neighborToMeDir).remove(incomingMsg.getSourceVertexId()); } else { throw new IllegalStateException("Tried to remove an edge that doesn't exist! I am " + vertex + " incomingMsg is " + incomingMsg); } }
Source:
<code>public void unsupportedType() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported("SOMETHING_OTHER"); will(returnValue(false)); <START> oneOf(validatorContext).getDefaultConstraintMessageTemplate(); <END> oneOf(validatorContext).buildConstraintViolationWithTemplate(with(any(String.class))); }}); boolean isValid = validator.isValid("SOMETHING_OTHER", validatorContext); assertFalse(isValid); }</code><technical_language>return massing passed buildConstraintViolationWithTemplate</technical_language>

Target:
public void unsupportedType() throws Exception { context.checking(new Expectations() {{ oneOf(catalog).isSupported("SOMETHING_OTHER"); will(returnValue(false)); oneOf(validatorContext).getDefaultConstraintMessageTemplate(); will(returnValue("unsupported operation")); oneOf(validatorContext).buildConstraintViolationWithTemplate(with("unsupported operation")); }}); boolean isValid = validator.isValid("SOMETHING_OTHER", validatorContext); assertFalse(isValid); }
Source:
<code>public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); ResourceValue resourceValue = mySelectedStyle.getConfiguration().getResourceResolver().resolveResValue(item.getItemResourceValue()); if (resourceValue == null) { LOG.error("Unable to resolve " + item.getValue()); return null; } ResourceType urlType = resourceValue.getResourceType(); String value = resourceValue.getValue(); if (value == null) { if <START> (urlType == ResourceType.STYLE && <END> column == 1) { return ThemeEditorStyle.class; } return String.class; } if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } if (urlType == ResourceType.COLOR || (value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (column == 1) { if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || ((value.equals("true") || value.equals("false")) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }</code><technical_language>dont get this check done col == 1 section</technical_language>

Target:
public Class<?> getCellClass(int column) { EditedStyleItem item = myAttributes.get(myRowIndex); String name = item.getName(); AttributeDefinition attrDefinition = myAttributeDefinitions.getAttrDefByName(name); ResourceValue resourceValue = mySelectedStyle.getConfiguration().getResourceResolver().resolveResValue(item.getItemResourceValue()); if (resourceValue == null) { LOG.error("Unable to resolve " + item.getValue()); return null; } ResourceType urlType = resourceValue.getResourceType(); String value = resourceValue.getValue(); if (urlType == ResourceType.DRAWABLE) { return DrawableDomElement.class; } if (urlType == ResourceType.COLOR || (value != null && value.startsWith("#") && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Color))) { return Color.class; } if (column == 1) { if (urlType == ResourceType.STYLE) { return ThemeEditorStyle.class; } if (urlType == ResourceType.INTEGER || ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Integer)) { return Integer.class; } if (urlType == ResourceType.BOOL || (("true".equals(value) || "false".equals(value)) && ThemeEditorUtils.acceptsFormat(attrDefinition, AttributeFormat.Boolean))) { return Boolean.class; } } return String.class; }
Source:
<code>public CohortDefinition getCodedObsSearchAdvanced() { CodedObsCohortDefinition cd = new CodedObsCohortDefinition(); cd.addParameter(new Parameter("timeModifier", "reporting.parameter.timeModifier", CodedObsCohortDefinition.TimeModifier.class)); cd.addParameter(new Parameter("question", "reporting.parameter.question", Concept.class)); <START> cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.startDate", Date.class)); <END> cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.endDate", Date.class)); return cd; }</code><technical_language>Label reporting.parameter.onOrAfter</technical_language>

Target:
public CohortDefinition getCodedObsSearchAdvanced() { CodedObsCohortDefinition cd = new CodedObsCohortDefinition(); cd.addParameter(new Parameter("timeModifier", "reporting.parameter.timeModifier", CodedObsCohortDefinition.TimeModifier.class)); cd.addParameter(new Parameter("question", "reporting.parameter.question", Concept.class)); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class)); return cd; }
Source:
<code>public <C, R> void dispatch(CommandMessage<C> command, CommandCallback<? super C, R> callback) { CommandMessage<? extends C> interceptedCommand = intercept(command); MessageMonitor.MonitorCallback messageMonitorCallback = messageMonitor.onMessageIngested(interceptedCommand); Member destination = commandRouter.findDestination(interceptedCommand) .orElseThrow(() -> { NoHandlerForCommandException exception = new NoHandlerForCommandException( <START> "No node known to accept " + interceptedCommand.getCommandName()); <END> messageMonitorCallback.reportFailure(exception); return exception; }); try { connector.send(destination, interceptedCommand, new MonitorAwareCallback<>(callback, messageMonitorCallback)); } catch (Exception e) { destination.suspect(); throw new CommandDispatchException(DISPATCH_ERROR_MESSAGE + ": " + e.getMessage(), e); } }</code><technical_language>exception text adjustment suggestion above</technical_language>

Target:
public <C, R> void dispatch(CommandMessage<C> command, CommandCallback<? super C, R> callback) { CommandMessage<? extends C> interceptedCommand = intercept(command); MessageMonitor.MonitorCallback messageMonitorCallback = messageMonitor.onMessageIngested(interceptedCommand); Member destination = commandRouter.findDestination(interceptedCommand) .orElseThrow(() -> { NoHandlerForCommandException exception = new NoHandlerForCommandException( format("No node known to accept [%s]", interceptedCommand.getCommandName())); messageMonitorCallback.reportFailure(exception); return exception; }); try { connector.send(destination, interceptedCommand, new MonitorAwareCallback<>(callback, messageMonitorCallback)); } catch (Exception e) { messageMonitorCallback.reportFailure(e); destination.suspect(); throw new CommandDispatchException(DISPATCH_ERROR_MESSAGE + ": " + e.getMessage(), e); } }
Source:
<code>public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); <START> ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; <END> if (trace != null) { layout = trace.getEventLayout(); } requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout)); fAnalysisRequirements = requirements; } return requirements; }</code><technical_language>here, avoid assignation, (trace != null) ? trace.getEventLayout : ILttngUst...</technical_language>

Target:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = (trace != null) ? trace.getEventLayout() : ILttngUstEventLayout.DEFAULT_LAYOUT; requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout)); fAnalysisRequirements = requirements; } return requirements; }
Source:
<code>public void bindHeaderView(View view, Recipient recipient) { RecipientTokenHolder holder = (RecipientTokenHolder) view.getTag(); holder.setShowAsHeader(true); holder.headerName.setText(recipient.getNameOrUnknown(context)); if (!TextUtils.isEmpty(recipient.addressLabel)) { holder.headerAddressLabel.setText(recipient.addressLabel); holder.headerAddressLabel.setVisibility(View.VISIBLE); } else { holder.headerAddressLabel.setVisibility(View.GONE); } RecipientAdapter.setContactPhotoOrPlaceholder(context, holder.headerPhoto, recipient); holder.headerPhoto.assignContactUri(recipient.getContactLookupUri()); holder.headerName.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { String recipentEmail = listener.getRecipentEmail(currentRecipient); <START> copy_to_ClipBoard(getContext(),recipentEmail); <END> Toast toast = Toast.makeText(context, "Address Copied to Clip Board", Toast.LENGTH_LONG); toast.show(); listener.setRecipientPopupVisibileFalse(currentRecipient); } }); holder.headerRemove.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { listener.onRecipientRemove(currentRecipient); } }); }</code><technical_language>Follow code style for naming function separating function arguments</technical_language>

Target:
public void bindHeaderView(View view, Recipient recipient) { RecipientTokenHolder holder = (RecipientTokenHolder) view.getTag(); holder.setShowAsHeader(true); holder.headerName.setText(recipient.getNameOrUnknown(context)); if (!TextUtils.isEmpty(recipient.addressLabel)) { holder.headerAddressLabel.setText(recipient.addressLabel); holder.headerAddressLabel.setVisibility(View.VISIBLE); } else { holder.headerAddressLabel.setVisibility(View.GONE); } RecipientAdapter.setContactPhotoOrPlaceholder(context, holder.headerPhoto, recipient); holder.headerPhoto.assignContactUri(recipient.getContactLookupUri()); holder.copyButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { String recipentEmail = listener.getRecipentEmail(currentRecipient); copy_to_ClipBoard(context, recipentEmail); Toast.makeText(context, R.string.address_copied, Toast.LENGTH_LONG).show(); listener.setRecipientPopupVisibileFalse(currentRecipient); } }); holder.headerRemove.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { listener.onRecipientRemove(currentRecipient); } }); }
Source:
<code>public final boolean doesProvideNewPage() { if (provision == null) { <START> throw new IllegalStateException("Page instance not yet resolved"); <END> } return getProvision().doesProvideNewPage(); }</code><technical_language>bad indeed, I fixed work branch: <LINK_0> states overcomplicated. place in Wicket core needing test flag for "OLD"</technical_language>

Target:
public final boolean doesProvideNewPage() { return getProvision().doesProvideNewPage(); }
Source:
<code>public void test() throws IOException { boolean soundEnabled = State.isSoundEnabled(); clickOn(stage, MouseButton.PRIMARY); sleep(SHORT); mainMenu(1); settings(1); assertFalse(State.isSoundEnabled() == soundEnabled); settings(1); assertTrue(State.isSoundEnabled() == soundEnabled); settings(0); mainMenu(5); typeName(); mainMenu(0); sleep(COUNTDOWN); keyboard(KeyCode.ESCAPE); pausePopup(0); sleep(COUNTDOWN); moveAround(); keyboard(KeyCode.ESCAPE); pausePopup(1); mainMenu(3); loadMenu(0); mainMenu(3); loadMenu(2); loadMenu(1); mainMenu(0); playerDies(); sleep(COUNTDOWN); <START> deathPopup(0); END> playerDies(); sleep(COUNTDOWN); deathPopup(1); mainMenu(2); outputEventLog(); }</code><technical_language>In opinion, sleep(COUNTDOWN) right mainMenu(0). In code, player dies countdown ended. <logic,review</technical_language>

Target:
public void test() throws IOException { clickOn(stage, MouseButton.PRIMARY); sleep(SHORT); mainMenu(MAIN_SETTINGS); clickAllSettings(); mainMenu(MAIN_TEXTFIELD); typeName(); mainMenu(MAIN_START); sleep(COUNTDOWN); keyboard(KeyCode.ESCAPE); pausePopup(PAUSE_RESUME); sleep(COUNTDOWN); moveAround(); keyboard(KeyCode.ESCAPE); pausePopup(PAUSE_TOMAIN); mainMenu(MAIN_LOADGAME); loadMenu(LOAD_BACK); mainMenu(MAIN_LOADGAME); loadMenu(LOAD_NAMECONTAINER); loadMenu(LOAD_START); mainMenu(MAIN_START); sleep(COUNTDOWN); playerDies(); deathPopup(DEATH_RETRY); sleep(COUNTDOWN); playerDies(); deathPopup(DEATH_TOMAIN); mainMenu(MAIN_QUIT); outputEventLog(); }
Source:
<code>public CompletionStage<EntryVersionsMap> createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { if (configuration.persistence().usingStores()) { return CompletableFutures.supplyAsyncAndContinue(CompletableFuture.supplyAsync(() -> totalOrder ? totalOrderCreateNewVersionsAndCheckForWriteSkews(versionGenerator, context, prepareCommand) : <START> clusteredCreateNewVersionsAndCheckForWriteSkews(versionGenerator, context, prepareCommand), persistenceExecutor), cpuExecutor, prepareCommand); <END> } else { return CompletableFuture.completedFuture(totalOrder ? totalOrderCreateNewVersionsAndCheckForWriteSkews(versionGenerator, context, prepareCommand) : clusteredCreateNewVersionsAndCheckForWriteSkews(versionGenerator, context, prepareCommand)); } }</code><technical_language>break this a bit more? making eyes bleed atm</technical_language>

Target:
public CompletionStage<EntryVersionsMap> createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { if (configuration.persistence().usingStores()) { CompletableFuture<EntryVersionsMap> cf = CompletableFuture.supplyAsync(() -> createNewVersionsMap(versionGenerator, context, prepareCommand), persistenceExecutor); return CompletionStages.continueOnExecutor(cf, cpuExecutor, prepareCommand); } return CompletableFuture.completedFuture(createNewVersionsMap(versionGenerator, context, prepareCommand)); }
Source:
<code>public TaskStats getTaskStats() { final List<Group> groupList = new ArrayList<>(); <START> final int numEventProcessors = groupAllocationTable.getKeys().size(); <END> for (final EventProcessor ep : groupAllocationTable.getKeys()) { groupList.addAll(groupAllocationTable.getValue(ep)); } double totalLoad = 0.0; final Map<String, GroupStats> groupStatsMap = new HashMap<>(); for (final Group group : groupList) { groupStatsMap.put( group.getGroupId(), GroupStats.newBuilder() .setGroupLoad(group.getLoad()) .setAppId(group.getApplicationInfo().getApplicationId()) .setGroupQueryNum(group.getQueries().size()) .build()); totalLoad += group.getLoad(); } final double taskCpuLoad = totalLoad / numEventProcessors; return TaskStats.newBuilder() .setTaskLoad(taskCpuLoad) .setGroupStatsMap(groupStatsMap) .build(); }</code><technical_language>final List<EventProcessor> eps = groupAllocationTable.getKeys(); final int numEventProcessors = eps.size(): In line 52: for (final EventProcessor ep : eps) { ..</technical_language>

Target:
public TaskStats getTaskStats() { final List<EventProcessor> epList = new ArrayList<>(groupAllocationTable.getKeys()); final int numEventProcessors = epList.size(); final List<Group> groupList = new ArrayList<>(); for (final EventProcessor ep : epList) { groupList.addAll(groupAllocationTable.getValue(ep)); } double totalLoad = 0.0; final Map<String, GroupStats> groupStatsMap = new HashMap<>(); for (final Group group : groupList) { groupStatsMap.put( group.getGroupId(), GroupStats.newBuilder() .setGroupLoad(group.getLoad()) .setAppId(group.getApplicationInfo().getApplicationId()) .setGroupQueryNum(group.getQueries().size()) .build()); totalLoad += group.getLoad(); } final double taskCpuLoad = totalLoad / numEventProcessors; return TaskStats.newBuilder() .setTaskLoad(taskCpuLoad) .setGroupStatsMap(groupStatsMap) .build(); }
Source:
<code>private static CompletableFuture<IMessage> receiveAsyncWrapper(IMessageReceiver receiver, Duration serverWaitTime) { try { return receiver.receiveAsync(serverWaitTime); } catch (Throwable t) { <START> CompletableFuture<IMessage> excetionalFuture = new CompletableFuture<IMessage>(); <END> excetionalFuture.completeExceptionally(t); return excetionalFuture; } }</code><technical_language>suggestion CompletableFuture<IMessage> exceptionalFuture = new CompletableFuture<IMessage>();</technical_language>

Target:
private static CompletableFuture<IMessage> receiveAsyncWrapper(IMessageReceiver receiver, Duration serverWaitTime) { try { return receiver.receiveAsync(serverWaitTime); } catch (Throwable t) { CompletableFuture<IMessage> exceptionalFuture = new CompletableFuture<IMessage>(); exceptionalFuture.completeExceptionally(t); return exceptionalFuture; } }
Source:
<code>public void remove() { <START> throw new UnsupportedOperationException(); <END> }</code><technical_language>I add some text here, explain rejecting remove() call. "this iterable is immutable, remove anything"</technical_language>

Target:
public void remove() { throw new UnsupportedOperationException( "This iterable is immutable and cannot remove anything" ); }
Source:
<code>public void close() { try { connection.close(); } catch (SQLException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Log a java.util.logging.Logger warning level swallow. done out</technical_language>

Target:
public void close() { try { connection.close(); } catch (SQLException e) { LOG.warning("SQL exception while closing JDBC Connection:" + e.getMessage()); } }
Source:
<code>private void loadContainers(final IDockerConnection connection) { final Job loadContainersJob = new Job(DVMessages .getFormattedString("ContainersLoadJob.msg", connection.getUri())) { @Override protected IStatus run(final IProgressMonitor monitor) { connection.getContainers(true); return Status.OK_STATUS; } }; <START> loadContainersJob.addJobChangeListener(new JobChangeAdapter() { <END> @Override public void done(IJobChangeEvent event) { Display.getDefault().asyncExec(() -> { viewer.refresh(); }); } }); loadContainersJob.schedule(); }</code><technical_language>This unnecessary. advantage is ? guarantee order is respected</technical_language>

Target:
private void loadContainers(final IDockerConnection connection) { final Job loadContainersJob = new Job(DVMessages .getFormattedString("ContainersLoadJob.msg", connection.getUri())) { @Override protected IStatus run(final IProgressMonitor monitor) { connection.getContainers(true); Display.getDefault().asyncExec(() -> { viewer.refresh(); }); return Status.OK_STATUS; } }; loadContainersJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent event) { } }); loadContainersJob.schedule(); }
Source:
<code>private static HttpResponse postRequestToOpenTsdb(MetricServiceAppConfiguration config, String jsonQueryString) throws IOException { String postUrl = String.format("%s/api/query", config.getMetricServiceConfig().getOpenTsdbUrl()); log.info("POSTing JSON to URL: {}", postUrl); DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost postRequest = new HttpPost(postUrl); log.info("Query to OpenTSDB: {}",jsonQueryString); StringEntity input = new StringEntity(jsonQueryString); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response; try { response = httpClient.execute(postRequest); } catch (IOException | RuntimeException e) { log.error("{} Exception caught executing HTTP Post: {}",e.getClass().getName(), e, e.getMessage()); throw e; } <START> log.info("Response from httpClient.execute was {}", response); <END> return response; }</code><technical_language>log.debug here, response chatty</technical_language>

Target:
private static HttpResponse postRequestToOpenTsdb(MetricServiceAppConfiguration config, String jsonQueryString) throws IOException { String postUrl = String.format("%s/api/query", config.getMetricServiceConfig().getOpenTsdbUrl()); log.info("POSTing JSON to URL: {}", postUrl); DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost postRequest = new HttpPost(postUrl); log.info("Query to OpenTSDB: {}",jsonQueryString); StringEntity input = new StringEntity(jsonQueryString); input.setContentType("application/json"); postRequest.setEntity(input); HttpResponse response; try { response = httpClient.execute(postRequest); } catch (IOException | RuntimeException e) { log.error("{} Exception caught executing HTTP Post: {}",e.getClass().getName(), e, e.getMessage()); throw e; } log.debug("Response from httpClient.execute was {}", response); return response; }
Source:
<code>public T call() throws Exception { <START> ServerTaskRegistry taskRegistry = componentRegistry.getComponent(ServerTaskRegistry.class); <END> ServerTaskWrapper<T> task = taskRegistry.getTask(taskName); task.inject(prepareContext()); return task.run(); }</code><technical_language>I ServerTaskRegistry obtained here, injected runner construction. Also, a cache is optional paramater in TaskContext rely presence here. of a current limitation in DefaultExecutorService, is a distexec a distributed cache, @wburns is adding a new implementation changes this</technical_language>

Target:
public T call() throws Exception { ServerTaskWrapper<T> task = taskRegistry.getTask(taskName); task.inject(prepareContext()); return task.run(); }
Source:
<code>public ResourcesPresentationProvider() { super(); for (int i = 0; i < NUM_COLORS; i++) { <START> RGB rgb = new RGB((int) (360.0 / NUM_COLORS * i), getSaturation(), getBrightness()); <END> fColors.add(rgb); } }</code><technical_language>inline this please (ctrl-alt-i)</technical_language>

Target:
public ResourcesPresentationProvider() { super(); for (int i = 0; i < NUM_COLORS; i++) { fColors.add(new RGB((int) (360.0 / NUM_COLORS * i), SATURATION, BRIGHTNESS)); } }
Source:
<code>public boolean deletePBDSegment(BinaryDequeValidator<M> validator) throws IOException { boolean segmentDeleted = false; if (m_closed) { <START> throw new IOException("Cannot scanForGap(): PBD has been closed"); <END> } assertions(); if (m_segments.isEmpty()) { if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug("PBD " + m_nonce + " has no finished segments"); } return segmentDeleted; } Iterator<PBDSegment<M>> iter = m_segments.values().iterator(); while (iter.hasNext()) { PBDSegment<M> segment = iter.next(); try { int entriesToDelete = segment.validate(validator); if (entriesToDelete != 0) { m_numObjects -= entriesToDelete; iter.remove(); closeAndDeleteSegment(segment); segmentDeleted = true; } } catch (IOException e) { m_usageSpecificLog.warn("Error validating segment: " + segment.file() + ". Quarantining segment."); quarantineSegment(segment); } } return segmentDeleted; }</code><technical_language>Fix message</technical_language>

Target:
public boolean deletePBDSegment(BinaryDequeValidator<M> validator) throws IOException { boolean segmentDeleted = false; if (m_closed) { throw new IOException("Cannot deletePBDSegment(): PBD has been closed"); } assertions(); if (m_segments.isEmpty()) { if (m_usageSpecificLog.isDebugEnabled()) { m_usageSpecificLog.debug("PBD " + m_nonce + " has no segments to delete."); } return segmentDeleted; } Iterator<PBDSegment<M>> iter = m_segments.values().iterator(); while (iter.hasNext()) { PBDSegment<M> segment = iter.next(); try { int entriesToDelete = segment.validate(validator); if (entriesToDelete != 0) { m_numObjects -= entriesToDelete; iter.remove(); closeAndDeleteSegment(segment); segmentDeleted = true; } } catch (IOException e) { m_usageSpecificLog.warn("Error validating segment: " + segment.file() + ". Quarantining segment."); quarantineSegment(segment); } } return segmentDeleted; }
Source:
<code><START> public @NonNull String getTraceHost() { <END> return fHostThread.getHost(); }</code><technical_language>add a package-info.java file package</technical_language>

Target:
public String getTraceHost() { return fHostThread.getHost(); }
Source:
<code>public URI getBundleURI(String id, String version) { SiteBundle[] entries = site.getBundles(); for (SiteBundle <START> entrie : <END> entries) { if (id.equals(entrie.getBundleIdentifier()) && version.equals(entrie.getBundleVersion())) { return getSiteBundleURI(entrie); } } URI base = getBaseURI(); URI url = getArchiveURI(base, FEATURE_DIR + id + VERSION_SEPARATOR + version + JAR_EXTENSION); if (url != null) return url; return URIUtil.append(base, FEATURE_DIR + id + VERSION_SEPARATOR + version + JAR_EXTENSION); }</code><technical_language>entry</technical_language>

Target:
public URI getBundleURI(String id, String version) { SiteBundle[] entries = site.getBundles(); for (SiteBundle entry : entries) { if (id.equals(entry.getBundleIdentifier()) && version.equals(entry.getBundleVersion())) { return getSiteBundleURI(entry); } } URI base = getBaseURI(); URI url = getArchiveURI(base, FEATURE_DIR + id + VERSION_SEPARATOR + version + JAR_EXTENSION); if (url != null) return url; return URIUtil.append(base, FEATURE_DIR + id + VERSION_SEPARATOR + version + JAR_EXTENSION); }
Source:
<code><START> private void next0() { if (listIt != null && listIt.hasNext()) row = listIt.next(); else { listIt = mapIt.next().getValue().iterator(); row = listIt.next(); } } <END></code><technical_language>suggestion private void next0() { if (listIt == null || !listIt.hasNext()) listIt = mapIt.next().getValue().iterator(); row = listIt.next(); }</technical_language>

Target:
private void next0() { if (listIt == null || !listIt.hasNext()) listIt = mapIt.next().getValue().iterator(); row = listIt.next(); }
Source:
<code>public static Slice trimTrailingSpaces(Slice slice) { requireNonNull(slice, "slice is null"); return slice.slice(0, sliceLengthWithoutTrailingSpaces(slice, 0, slice.length())); <START> } <END></code><technical_language>Changes this file in previous commit</technical_language>

Target:
public static Slice trimTrailingSpaces(Slice slice) { requireNonNull(slice, "slice is null"); return slice.slice(0, byteCountWithoutTrailingSpace(slice, 0, slice.length())); }
Source:
<code>List<Event> commitEvents() { final List<Event> result = ImmutableList.copyOf(uncommittedEvents); uncommittedEvents.clear(); <START> addToHistory(result); <END> return result; }</code><technical_language>This call a call of addToHistory of play(..) ambiguous. I feel a single place add events history. I concerned current implementation, a naked eye adding event twice</technical_language>

Target:
List<Event> commitEvents() { final List<Event> result = ImmutableList.copyOf(uncommittedEvents); uncommittedEvents.clear(); remember(result); return result; }
Source:
<code>public Future<Void> addColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { String columnName = columnFamily.getNameAsString(); Modification.Builder modification = Modification.newBuilder().setId(columnName) .setCreate(new ColumnDescriptorAdapter() <START> .adapt((HColumnDescriptor) columnFamily).build()); <END> return FutureUtils .toCompletableFuture(modifyColumnAsync(tableName, columnName, "add", modification)) .thenApply(r -> null); }</code><technical_language>cast HColumnDescriptor</technical_language>

Target:
public Future<Void> addColumnFamilyAsync(TableName tableName, ColumnFamilyDescriptor columnFamily) throws IOException { String columnName = columnFamily.getNameAsString(); Modification.Builder modification = Modification.newBuilder().setId(columnName) .setCreate(new ColumnDescriptorAdapter() .adapt((HColumnDescriptor) columnFamily).build()); return modifyColumnAsync(tableName, columnName, "add", modification); }