auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void switchView(final ActiveScan scanner) { if (View.isInitialised() && !EventQueue.isDispatchThread()) { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { switchView(scanner); } }); } catch (InvocationTargetException | InterruptedException e) { LOGGER.error("Failed to switch view: " + e.getMessage(), e); } return; } if (scanner != null) { getMessagesTable().setModel(scanner.getMessagesTableModel()); this.getNumRequests().setText(Integer.toString(scanner.getTotalRequests())); this.getProgressButton().setEnabled(true); if (scanner instanceof AttackScan) { this.getProgressBar().setEnabled(false); this.getProgressButton().setEnabled(false); this.getPauseScanButton().setEnabled(false); this.getStopScanButton().setEnabled(false); } } else { resetMessagesTable(); this.getNumRequests().setText(ZERO_REQUESTS_LABEL_TEXT); this.getNumNewAlerts().setText(ZERO_NEW_ALERTS_LABEL_TEXT); <START> this.getProgressButton().setEnabled(false); <END> } }</code><technical_language>missing update in branch</technical_language>

Target:
public void switchView(final ActiveScan scanner) { if (View.isInitialised() && !EventQueue.isDispatchThread()) { try { EventQueue.invokeAndWait(new Runnable() { @Override public void run() { switchView(scanner); } }); } catch (InvocationTargetException | InterruptedException e) { LOGGER.error("Failed to switch view: " + e.getMessage(), e); } return; } if (scanner != null) { getMessagesTable().setModel(scanner.getMessagesTableModel()); this.getNumRequests().setText(Integer.toString(scanner.getTotalRequests())); this.getNumNewAlerts().setText(Integer.toString(scanner.getTotalNewAlerts())); this.getProgressButton().setEnabled(true); if (scanner instanceof AttackScan) { this.getProgressBar().setEnabled(false); this.getProgressButton().setEnabled(false); this.getPauseScanButton().setEnabled(false); this.getStopScanButton().setEnabled(false); } } else { resetMessagesTable(); this.getNumRequests().setText(ZERO_REQUESTS_LABEL_TEXT); this.getNumNewAlerts().setText(ZERO_NEW_ALERTS_LABEL_TEXT); this.getProgressButton().setEnabled(false); } }
Source:
<code>public static Slice serialize(OGCGeometry input) { DynamicSliceOutput sliceOutput = new DynamicSliceOutput(100); <START> sliceOutput.appendByte(valueOf(input.geometryType()).getCode()); <END> GeometryCursor cursor = input.getEsriGeometryCursor(); while (true) { Geometry geometry = cursor.next(); if (geometry == null) { break; } byte[] shape = geometryToEsriShape(geometry); if (input.geometryType().equals(GEOMETRY_COLLECTION)) { sliceOutput.appendInt(shape.length); } sliceOutput.appendBytes(shape); } return sliceOutput.slice(); }</code><technical_language>build-in enum method ordinal() revert changes GeometryTypeName enum</technical_language>

Target:
public static Slice serialize(OGCGeometry input) { DynamicSliceOutput sliceOutput = new DynamicSliceOutput(100); sliceOutput.appendByte(valueOf(input.geometryType()).code()); GeometryCursor cursor = input.getEsriGeometryCursor(); boolean isGeometryCollection = input.geometryType().equals(GEOMETRY_COLLECTION); while (true) { Geometry geometry = cursor.next(); if (geometry == null) { break; } byte[] shape = geometryToEsriShape(geometry); if (isGeometryCollection) { sliceOutput.appendInt(shape.length); } sliceOutput.appendBytes(shape); } return sliceOutput.slice(); }
Source:
<code>public void shouldRetainOrderWhenQueryingViewOrdered() { ViewQuery q = ViewQuery.from("test_beers", "by_name"); q.descending() <START> .includeDocsOrdered(true); <END> String prev = null; List<Beer> beers = template.findByView(q, Beer.class); for (Beer beer : beers) { if (prev != null) { assertThat(beer.getName() + " not alphabetically < to " + prev, beer.getName().compareTo(prev) < 0); } prev = beer.getName(); } }</code><technical_language>formatting</technical_language>

Target:
public void shouldRetainOrderWhenQueryingViewOrdered() { ViewQuery q = ViewQuery.from("test_beers", "by_name"); q.descending().includeDocsOrdered(true); String prev = null; List<Beer> beers = template.findByView(q, Beer.class); assertTrue(q.isIncludeDocs()); assertTrue(q.isOrderRetained()); assertEquals(RawJsonDocument.class, q.includeDocsTarget()); for (Beer beer : beers) { if (prev != null) { assertThat(beer.getName() + " not alphabetically < to " + prev, beer.getName().compareTo(prev) < 0); } prev = beer.getName(); } }
Source:
<code>public static Map<String, ObjectType> getConcreteTagTypes() { Map<String, ObjectType> tagTypes = new LinkedHashMap<>(); ObjectType.getInstance(RichTextElement.class).findConcreteTypes().forEach(type -> { String tagName = type.as(ToolUi.class).getRichTextElementTagName(); if (tagName != null && type.getObjectClass() != null) { ObjectType existingType = tagTypes.putIfAbsent(tagName, type); if (existingType != null) { <START> LoggerFactory.getLogger(RichTextElement.class).warn(String.format( <END> "Ignoring RichTextElement [%s] with conflicting tag name [%s] as [%s].", type.getInternalName(), tagName, existingType.getInternalName())); } } }); return tagTypes; }</code><technical_language>Logger instance cached in a static variable. Logging avoid String.format instead do warn("Ignoring [{}]", type.getInternalName())</technical_language>

Target:
public static Map<String, ObjectType> getConcreteTagTypes() { return CONCRETE_TAG_TYPES.get(); }
Source:
<code>public List<SchematicEntry> load( Collection<String> keys ) { final TransactionStore.TransactionMap<String, Document> txContent = transactionalContent(false); final TransactionStore.TransactionMap<String, Document> actualContent = txContent != null ? txContent : persistedContent; return keys.stream() .map(actualContent::get) .filter(Objects::nonNull) <START> .map(document -> (SchematicEntry) () -> document) <END> .collect(Collectors.toList()); }</code><technical_language>is .map(SchematicEntry.class::cast) instead. if more readable, though. _Updated cast. Stupid autocorrect._</technical_language>

Target:
public List<SchematicEntry> load( Collection<String> keys ) { final TransactionStore.TransactionMap<String, Document> txContent = transactionalContent(false); final TransactionStore.TransactionMap<String, Document> actualContent = txContent != null ? txContent : persistedContent; return keys.stream() .map(actualContent::get) .filter(Objects::nonNull) .map(SchematicEntry::fromDocument) .collect(Collectors.toList()); }
Source:
<code>public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; ITmfEventProvider provider = this; while (provider != null) { if (provider == signal.getTrace()) { signalIsForUs = true; break; } provider = provider.getParent(); } if (!signalIsForUs) { return; } IStatus status = executeAnalysis(); if (!status.isOK()) { Activator.log(status); } new Thread() { <START> @Override <END> public void run() { TmfTraceManager.refreshSupplementaryFiles(TmfTrace.this); } }.start(); if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } if (isComplete()) { final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); broadcastAsync(rangeUpdatedsignal); } return; } }</code><technical_language>style question, set thread name easier debug</technical_language>

Target:
public void traceOpened(TmfTraceOpenedSignal signal) { boolean signalIsForUs = false; ITmfEventProvider provider = this; while (provider != null) { if (provider == signal.getTrace()) { signalIsForUs = true; break; } provider = provider.getParent(); } if (!signalIsForUs) { return; } IStatus status = executeAnalysis(); if (!status.isOK()) { Activator.log(status); } new Thread("Refresh supplementary files") { @Override public void run() { TmfTraceManager.refreshSupplementaryFiles(TmfTrace.this); } }.start(); if (signal.getTrace() == this) { if (getNbEvents() == 0) { return; } if (getStreamingInterval() > 0) { return; } if (isComplete()) { final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(), TmfTimestamp.BIG_CRUNCH); final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange); broadcastAsync(rangeUpdatedsignal); } return; } }
Source:
<code>public Query withContentType(String contentType) { <START> checkNotEmpty(contentType, "contentType may not be empty."); <END> if (hasContentTypeSet()) { throw new IllegalStateException( format("ContentType \"%s\" is already present in query.", contentType) ); } else { params.put(PARAMETER_CONTENT_TYPE, contentType); } return (Query) this; }</code><technical_language>"may" -> "must" "may" means allowed empty</technical_language>

Target:
public Query withContentType(String contentType) { checkNotEmpty(contentType, "ContentType must not be empty."); if (hasContentTypeSet()) { throw new IllegalStateException( format("ContentType \"%s\" is already present in query.", contentType) ); } else { params.put(PARAMETER_CONTENT_TYPE, contentType); } return (Query) this; }
Source:
<code>public void accept(final MethodNode methodNode, final MethodVisitor methodVisitor) { this.ignored.clear(); for (final IFilter filter : FILTERS) { filter.filter(methodNode, this); } for (final TryCatchBlockNode n : methodNode.tryCatchBlocks) { n.accept(methodVisitor); } <START> for (int i = 0; i < methodNode.instructions.size(); i++) { <END> final AbstractInsnNode instruction = methodNode.instructions.get(i); currentNode = instruction; instruction.accept(methodVisitor); } methodVisitor.visitEnd(); }</code><technical_language>If a InsnList is traversed index internal array is created lazily. This avoided linked list API</technical_language>

Target:
public void accept(final MethodNode methodNode, final MethodVisitor methodVisitor) { this.ignored.clear(); for (final IFilter filter : FILTERS) { filter.filter(methodNode, this); } for (final TryCatchBlockNode n : methodNode.tryCatchBlocks) { n.accept(methodVisitor); } currentNode = methodNode.instructions.getFirst(); while (currentNode != null) { currentNode.accept(methodVisitor); currentNode = currentNode.getNext(); } methodVisitor.visitEnd(); }
Source:
<code>protected HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) throws HttpException { String targetHostName = target.getHostName(); HttpHost proxy = proxyMappings.getProxyFor(targetHostName); String[] proxyCredentials = proxyMappings.getProxyCredentialsFor(targetHostName); LOG.debugf("Returning proxy=%s for targetHost=%s", proxy, targetHostName); if (proxyCredentials != null && proxyCredentials.length == 2) { <START> NTCredentials ntCreds = new NTCredentials(proxyCredentials[0], proxyCredentials[1], null, null); <END> CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(proxy.getHostName(), proxy.getPort()), ntCreds); context.setAttribute(HttpClientContext.CREDS_PROVIDER, credsProvider); } return proxy; }</code><technical_language>Please 4 space indentation suggestion NTCredentials ntCreds = new NTCredentials(proxyCredentials[0], proxyCredentials[1], null, null);</technical_language>

Target:
protected HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context) throws HttpException { String targetHostName = target.getHostName(); ProxyMapping proxyMapping = proxyMappings.getProxyFor(targetHostName); LOG.debugf("Returning proxyMapping=%s for targetHost=%s", proxyMapping, targetHostName); UsernamePasswordCredentials proxyCredentials = proxyMapping.getProxyCredentials(); HttpHost proxyHost = proxyMapping.getProxyHost(); if (proxyCredentials != null) { CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(proxyHost.getHostName(), proxyHost.getPort()), proxyCredentials); context.setAttribute(HttpClientContext.CREDS_PROVIDER, credsProvider); } return proxyHost; }
Source:
<code>public void unexpectedEOFs() { try { Parser.parse("a:."); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("a:"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("~"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("a(b) ||"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("a:b; c:d;e"); <START> fail("Inputs which end unexpectedly should throw a parse exception"); <END> } catch (ParseException ignored) }</code><technical_language>This a case of input unexpectedly. Rather, some kind of content is expected input qualifier a, c: (the start of a new qualifier) content. a useful test, assertion message more accurate place other related tests</technical_language>

Target:
public void unexpectedEOFs() { try { Parser.parse("a:."); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("a:"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("~"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) try { Parser.parse("a(b) ||"); fail("Inputs which end unexpectedly should throw a parse exception"); } catch (ParseException ignored) }
Source:
<code>public void jobsUpdated(Map<Integer, Job> jobs) { <START> ArrayList selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); <END> RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setTestData(data.toArray()); applyCurrentLocalFilter(); }</code><technical_language>is ArrayList List</technical_language>

Target:
public void jobsUpdated(Map<Integer, Job> jobs) { List<Integer> selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setTestData(data.toArray()); applyCurrentLocalFilter(); }
Source:
<code>private SpELContext(PropertyAccessor accessor, @Nullable SpelExpressionParser parser, @Nullable BeanFactory factory) { <START> <END> this.parser = parser == null ? new SpelExpressionParser() : parser; this.accessor = accessor; this.factory = factory; }</code><technical_language>Is accessor != null in getEvaluationContex( ) required? (see below)</technical_language>

Target:
private SpELContext(PropertyAccessor accessor, @Nullable SpelExpressionParser parser, @Nullable BeanFactory factory) { Assert.notNull(accessor, "PropertyAccessor must not be null!"); this.parser = parser == null ? new SpelExpressionParser() : parser; this.accessor = accessor; this.factory = factory; }
Source:
<code>public Double getValue() { double aggregatedValue = 0.0D; final Iterator<MetricsGauge> iterator = gauges.iterator(); while (iterator.hasNext()) { final MetricsGauge gauge = iterator.next(); if (gauge.hasExpired()) { iterator.remove(); } else { final double gaugeVal = gauge.value(); <START> if (Double.isFinite(gaugeVal)) <END> aggregatedValue += gaugeVal; } } return aggregatedValue; }</code><technical_language>a note self, behavior for non-finite values is clarified in user a clear expectation</technical_language>

Target:
public Double getValue() { double aggregatedValue = Double.NaN; final Iterator<MetricsGauge> iterator = gauges.iterator(); while (iterator.hasNext()) { final MetricsGauge gauge = iterator.next(); if (gauge.hasExpired()) { iterator.remove(); } else { final double gaugeVal = gauge.value(); if (!Double.isNaN(gaugeVal)) aggregatedValue = (Double.isNaN(aggregatedValue) ? 0 : aggregatedValue) + gaugeVal; } } return aggregatedValue; }
Source:
<code>private Diagram doTransformation(final String xml) { final String defSetId = getDefinitionSetId(dmnBackendService); final Metadata metadata = buildMetadataInstance(defSetId); final InputStream is = new ByteArrayInputStream(xml.getBytes()); <START> try { <END> final DMNMarshallerStandalone dmnMarshaller = (DMNMarshallerStandalone) dmnBackendService.getDiagramMarshaller(); final Graph<DefinitionSet, ?> graph = dmnMarshaller.unmarshall(metadata, is); final Node<Definition<DMNDiagram>, ?> diagramNode = GraphUtils.getFirstNode((Graph<?, Node>) graph, DMNDiagram.class); final String title = diagramNode.getContent().getDefinition().getDefinitions().getName().getValue(); metadata.setTitle(title); return dmnDiagramFactory.build(title, metadata, graph); } catch (Exception e) { LOG.error("Error whilst converting XML to DMNDiagram.", e); throw new DiagramParsingException(metadata, xml); } }</code><technical_language>java try (final InputStream is = new ByteArrayInputStream(xml.getBytes())) { // ... }</technical_language>

Target:
private Diagram doTransformation(final String xml) { final String defSetId = getDefinitionSetId(dmnBackendService); final Metadata metadata = buildMetadataInstance(defSetId); try (final InputStream is = new ByteArrayInputStream(xml.getBytes())) { final DMNMarshallerStandalone dmnMarshaller = (DMNMarshallerStandalone) dmnBackendService.getDiagramMarshaller(); final Graph<DefinitionSet, ?> graph = dmnMarshaller.unmarshall(metadata, is); final Node<Definition<DMNDiagram>, ?> diagramNode = GraphUtils.getFirstNode((Graph<?, Node>) graph, DMNDiagram.class); final String title = diagramNode.getContent().getDefinition().getDefinitions().getName().getValue(); metadata.setTitle(title); return dmnDiagramFactory.build(title, metadata, graph); } catch (Exception e) { LOG.error("Error whilst converting XML to DMNDiagram.", e); throw new DiagramParsingException(metadata, xml); } }
Source:
<code>public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(ESM.ACTION_AWARE_ESM_QUEUE_COMPLETE)) { <START> Log.d("NIELS", "Complete intent caught!"); <END> getContentResolver().delete(ESM_Data.CONTENT_URI, ESM_Data.TRIGGER + " LIKE 'TRIAL'", null); } if (intent.getAction().equals(ESM.ACTION_AWARE_ESM_TIMEOUT)) { Log.d("NIELS", "Dropped intent caught!"); getContentResolver().delete(ESM_Data.CONTENT_URI, ESM_Data.TRIGGER + " LIKE 'TRIAL'", null); } finish(); }</code><technical_language>Remove</technical_language>

Target:
public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(ESM.ACTION_AWARE_ESM_QUEUE_COMPLETE)) { getContentResolver().delete(ESM_Data.CONTENT_URI, ESM_Data.TRIGGER + " LIKE 'TRIAL'", null); } finish(); }
Source:
<code>public static IncrementalIndex createIndex( AggregatorFactory[] aggregatorFactories, DimensionsSpec dimensionsSpec ) { if (null == aggregatorFactories) { <START> aggregatorFactories = DEAFAULT_AGGREGATOR_FACTORIES; <END> } return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(dimensionsSpec) .withMetrics(aggregatorFactories) .build() ) .setMaxRowCount(1000000) .buildOnheap(); }</code><technical_language>Typo, DEFAULT</technical_language>

Target:
public static IncrementalIndex createIndex( AggregatorFactory[] aggregatorFactories, DimensionsSpec dimensionsSpec ) { if (null == aggregatorFactories) { aggregatorFactories = DEFAULT_AGGREGATOR_FACTORIES; } return new IncrementalIndex.Builder() .setIndexSchema( new IncrementalIndexSchema.Builder() .withDimensionsSpec(dimensionsSpec) .withMetrics(aggregatorFactories) .build() ) .setMaxRowCount(1000000) .buildOnheap(); }
Source:
<code>public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates) { List<String> completions = null; try { completions = server.getScheduler().syncIfNeeded(() -> server.getCommandMap() <START> .tabComplete(sender, line.line())); <END> } catch (Exception e) { LocalizedStrings.Console.Error.Manager.TAB_COMPLETE.log(e); } if (completions != null) { completions.forEach(completion -> candidates.add(new Candidate(completion))); } }</code><technical_language>lambda line</technical_language>

Target:
public void complete(LineReader reader, ParsedLine line, List<Candidate> candidates) { List<String> completions = null; try { completions = server.getScheduler().syncIfNeeded( () -> server.getCommandMap().tabComplete(sender, line.line())); } catch (Exception e) { ConsoleMessages.Warn.Manager.TAB_COMPLETE.log(e); } if (completions != null) { completions.forEach(completion -> candidates.add(new Candidate(completion))); } }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash_screen); WebView wv = (WebView) findViewById(R.id.splash_webview); wv.loadUrl("file:/ <START> final Deferred<Bundle, Throwable, Integer> deferred = new DeferredObject<Bundle, Throwable, Integer>(); <END> final Promise<Bundle, Throwable, Integer> promise = deferred.promise(); App.getLoginManager().autoLogin(new Callback() { @Override public boolean handleMessage(final Message msg) { deferred.resolve(msg.getData()); return true; } }); Handler splashHandler = new Handler() { @Override public void handleMessage(Message msg) { promise.done(new DoneCallback<Bundle>() { @Override public void onDone(Bundle args) { if (args != null && args.getBoolean(RestHandler.SUCCESS_KEY)) { redirect(App.hasInstanceCode()); } else { redirect(App.hasSkinCode()); } } }); } }; splashHandler.sendMessageDelayed(Message.obtain(), SPLASH_SCREEN_DELAY_MILIS); }</code><technical_language>deferred promise real names. a hard time coming some, I this a lot easier understand</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash_screen); WebView wv = (WebView) findViewById(R.id.splash_webview); wv.loadUrl("file:/ final Deferred<Bundle, Throwable, Integer> deferred = new DeferredObject<Bundle, Throwable, Integer>(); final Promise<Bundle, Throwable, Integer> promise = deferred.promise(); App.getLoginManager().autoLogin(new Callback() { @Override public boolean handleMessage(final Message msg) { deferred.resolve(msg.getData()); return true; } }); Handler splashHandler = new Handler() { @Override public void handleMessage(Message msg) { promise.done(new DoneCallback<Bundle>() { @Override public void onDone(Bundle args) { if (args != null && args.getBoolean(RestHandler.SUCCESS_KEY)) { redirect(App.hasInstanceCode()); } else { redirect(App.hasSkinCode()); } } }); } }; splashHandler.sendMessageDelayed(Message.obtain(), SPLASH_SCREEN_DELAY_MILLIS); }
Source:
<code>private Schema applyRegexReplaceRule(Schema inputSchema, RegexReplaceRule rule) { final String match = rule.getMatch(); final String replace = rule.getReplace(); Schema.Builder builder = Schema.builder(); for (Column column : inputSchema.getColumns()) { <START> builder.add(column.getName().replaceAll(match, replace), column.getType()); <END> } return builder.build(); }</code><technical_language>wrap PatternSyntaxException ConfigException? replaceAll throw exception</technical_language>

Target:
private Schema applyRegexReplaceRule(Schema inputSchema, RegexReplaceRule rule) { final String match = rule.getMatch(); final String replace = rule.getReplace(); Schema.Builder builder = Schema.builder(); for (Column column : inputSchema.getColumns()) { try { builder.add(column.getName().replaceAll(match, replace), column.getType()); } catch (PatternSyntaxException ex) { throw new ConfigException(ex); } } return builder.build(); }
Source:
<code>public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { BigDecimal totalWorth = BigDecimal.ZERO; String type = ""; if (args.length < 1) { throw new NotEnoughArgumentsException(); } if (args[0].equalsIgnoreCase("hand") && !user.isAuthorized("essentials.sell.hand")) { throw new Exception(tl("sellHandPermission")); } else if ((args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("invent") || args[0].equalsIgnoreCase("all")) && !user.isAuthorized("essentials.sell.bulk")) { throw new Exception(tl("sellBulkPermission")); } List<ItemStack> is = ess.getItemDb().getMatching(user, args); int count = 0; boolean isBulk = is.size() > 1; for (ItemStack stack : is) { <START> if (!ess.getSettings().allowSellNamedItems()) { <END> if (stack.getItemMeta().hasDisplayName()) { if (!isBulk) { throw new Exception(tl("cannotSellNamedItem")); } else { user.sendMessage(tl("cannotSellThisNamedItem", stack.getItemMeta().getDisplayName())); continue; } } } try { if (stack.getAmount() > 0) { totalWorth = totalWorth.add(sellItem(user, stack, args, isBulk)); stack = stack.clone(); count++; for (ItemStack zeroStack : is) { if (zeroStack.isSimilar(stack)) { zeroStack.setAmount(0); } } } } catch (Exception e) { if (!isBulk) { throw e; } } } if (count != 1) { if (args[0].equalsIgnoreCase("blocks")) { user.sendMessage(tl("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); } else { user.sendMessage(tl("totalWorthAll", type, NumberUtil.displayCurrency(totalWorth, ess))); } } }</code><technical_language>This send individual message for stack in a bulk sell. I this is desirable behaviour</technical_language>

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { BigDecimal totalWorth = BigDecimal.ZERO; String type = ""; if (args.length < 1) { throw new NotEnoughArgumentsException(); } if (args[0].equalsIgnoreCase("hand") && !user.isAuthorized("essentials.sell.hand")) { throw new Exception(tl("sellHandPermission")); } else if ((args[0].equalsIgnoreCase("inventory") || args[0].equalsIgnoreCase("invent") || args[0].equalsIgnoreCase("all")) && !user.isAuthorized("essentials.sell.bulk")) { throw new Exception(tl("sellBulkPermission")); } List<ItemStack> is = ess.getItemDb().getMatching(user, args); int count = 0; boolean isBulk = is.size() > 1; for (ItemStack stack : is) { try { if (stack.getAmount() > 0) { totalWorth = totalWorth.add(sellItem(user, stack, args, isBulk)); stack = stack.clone(); count++; for (ItemStack zeroStack : is) { if (zeroStack.isSimilar(stack)) { zeroStack.setAmount(0); } } } } catch (Exception e) { if (!isBulk) { throw e; } } } if (count != 1) { if (args[0].equalsIgnoreCase("blocks")) { user.sendMessage(tl("totalWorthBlocks", type, NumberUtil.displayCurrency(totalWorth, ess))); } else { user.sendMessage(tl("totalWorthAll", type, NumberUtil.displayCurrency(totalWorth, ess))); } } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; <START> result = prime * result + Arrays.hashCode(tagField); <END> return result; }</code><technical_language>simply return Arrays.hascode put add offset 31 is recalculated time</technical_language>

Target:
public int hashCode() { return Arrays.hashCode(tagField); }
Source:
<code>public void deployAfterRestart() { if (restarted) { <START> LOG.info("App will be deployed from the previous checkpoint."); <END> try { this.deployChangeInProgress.set(true); for (PTContainer c : getPhysicalPlan().getContainers()) { c.setState(PTContainer.State.NEW); requestContainer(c); for (PTOperator ptOperator : c.getOperators()) { ptOperator.setState(State.PENDING_DEPLOY); } } } finally { this.deployChangeCnt++; this.deployChangeInProgress.set(false); } } }</code><technical_language>"Redeploying application previous checkpoint"? provide more metadata checkpoint, for example a timestamp</technical_language>

Target:
public void deployAfterRestart() { if (startedFromCheckpoint) { try { this.deployChangeInProgress.set(true); for (PTContainer c : getPhysicalPlan().getContainers()) { c.setState(PTContainer.State.NEW); requestContainer(c); for (PTOperator ptOperator : c.getOperators()) { ptOperator.setState(State.PENDING_DEPLOY); } } } finally { this.deployChangeCnt++; this.deployChangeInProgress.set(false); } } }
Source:
<code>private Blob buildResult() throws IOException { Map<String, Object> result = new HashMap<>(); result.put("total", countTotal); result.put("success", countSuccess); <START> return Blobs.createJSONBlobFromValue(Collections.singletonList(result)); <END> }</code><technical_language>a list</technical_language>

Target:
private Blob buildResult() throws IOException { Map<String, Object> result = new HashMap<>(); result.put("total", countTotal); result.put("success", countSuccess); return Blobs.createJSONBlobFromValue(result); }
Source:
<code><START> public JSONObjectResponse doInstallPlugins(StaplerRequest req) throws IOException { <END> String payload = IOUtils.toString(req.getInputStream(), req.getCharacterEncoding()); JSONObject request = JSONObject.fromObject(payload); JSONArray pluginListJSON = request.getJSONArray("plugins"); List<String> plugins = new ArrayList<>(); for (int i = 0; i < pluginListJSON.size(); i++) { plugins.add(pluginListJSON.getString(i)); } UUID correlationId = UUID.randomUUID(); try { boolean dynamicLoad = request.getBoolean("dynamicLoad"); install(plugins, dynamicLoad, correlationId); JSONObject responseData = new JSONObject(); responseData.put("correlationId", correlationId.toString()); return new JSONObjectResponse(responseData); } catch (Exception e) { return new JSONObjectResponse().error(e.getMessage()); } }</code><technical_language>@Restricted(NoExternalUse.class)</technical_language>

Target:
public HttpResponse doInstallPlugins(StaplerRequest req) throws IOException { String payload = IOUtils.toString(req.getInputStream(), req.getCharacterEncoding()); JSONObject request = JSONObject.fromObject(payload); JSONArray pluginListJSON = request.getJSONArray("plugins"); List<String> plugins = new ArrayList<>(); for (int i = 0; i < pluginListJSON.size(); i++) { plugins.add(pluginListJSON.getString(i)); } UUID correlationId = UUID.randomUUID(); try { boolean dynamicLoad = request.getBoolean("dynamicLoad"); install(plugins, dynamicLoad, correlationId); JSONObject responseData = new JSONObject(); responseData.put("correlationId", correlationId.toString()); return hudson.util.HttpResponses.okJSON(responseData); } catch (Exception e) { return hudson.util.HttpResponses.errorJSON(e.getMessage()); } }
Source:
<code>public Pool<Jedis> build(String name, JedisDriverProperties properties) { if (properties.connection == null || "".equals(properties.connection)) { throw new MissingRequiredConfiguration("Jedis client must have a connection defined"); } URI redisConnection = URI.create(properties.connection); String host = redisConnection.getHost(); int port = redisConnection.getPort() == -1 ? Protocol.DEFAULT_PORT : redisConnection.getPort(); int database = parseDatabase(redisConnection.getPath()); String password = parsePassword(redisConnection.getUserInfo()); GenericObjectPoolConfig objectPoolConfig = properties.poolConfig; return new InstrumentedJedisPool( <START> new NoopRegistry(), <END> new JedisPool(objectPoolConfig, host, port, properties.timeoutMs, password, database, name), idPrefix(name) ); }</code><technical_language>usage of JedisPoolFactory I in clouddriver do new JedisPoolFactory().build(name, properties) tempted move JedisPoolFactory a component autowire in it, in case making Registry a constructor arg for JedisPoolFactory defaulting arg constructor NoopRegistry. (Otherwise autowire in Registry anyways)</technical_language>

Target:
public Pool<Jedis> build(String name, JedisDriverProperties properties) { if (properties.connection == null || "".equals(properties.connection)) { throw new MissingRequiredConfiguration("Jedis client must have a connection defined"); } URI redisConnection = URI.create(properties.connection); String host = redisConnection.getHost(); int port = redisConnection.getPort() == -1 ? Protocol.DEFAULT_PORT : redisConnection.getPort(); int database = parseDatabase(redisConnection.getPath()); String password = parsePassword(redisConnection.getUserInfo()); GenericObjectPoolConfig objectPoolConfig = properties.poolConfig; return new InstrumentedJedisPool( registry, new JedisPool(objectPoolConfig, host, port, properties.timeoutMs, password, database, name), name ); }
Source:
<code>public Object execute(ExecutionEvent aEvent) throws ExecutionException { GerritTask item = null; GerritTableView reviewTableView = GerritTableView .getActiveView(); TableViewer viewer = reviewTableView.getTableViewer(); ISelection tableSelection = viewer.getSelection(); if (tableSelection.isEmpty()) { GerritUi.Ftracer.traceInfo("Selected table selection is EMPTY " ); } else { if (tableSelection instanceof IStructuredSelection ) { Object obj = ((IStructuredSelection) tableSelection).getFirstElement(); if (obj instanceof GerritTask) { item = (GerritTask) obj; try { <START> reviewTableView.setStarred(item.getTaskId(), !item.getStarred(), new NullProgressMonitor() {}); <END> item.toggleStarred(GerritTask.IS_STARRED, Boolean.toString(!Boolean.valueOf(item.getAttribute(GerritTask.IS_STARRED)))); } catch (CoreException e) { UIUtils.showErrorDialog(e.getMessage(), e.getStatus().getException().getMessage()); } viewer.update(item, null); } } } return item; }</code><technical_language>chance for a real progress monitor</technical_language>

Target:
public Object execute(ExecutionEvent aEvent) throws ExecutionException { final GerritTableView reviewTableView = GerritTableView .getActiveView(); final TableViewer viewer = reviewTableView.getTableViewer(); final ISelection tableSelection = viewer.getSelection(); final Job job = new Job(COMMAND_MESSAGE) { @Override protected IStatus run(IProgressMonitor monitor) { if (tableSelection.isEmpty()) { GerritUi.Ftracer.traceInfo("Selected table selection is EMPTY " ); } else { if (tableSelection instanceof IStructuredSelection ) { Object obj = ((IStructuredSelection) tableSelection).getFirstElement(); if (obj instanceof GerritTask) { item = (GerritTask) obj; try { reviewTableView.setStarred(item.getTaskId(), !item.getStarred(), monitor); item.toggleStarred(GerritTask.IS_STARRED, Boolean.toString(!Boolean.valueOf(item.getAttribute(GerritTask.IS_STARRED)))); } catch (CoreException e) { UIUtils.showErrorDialog(e.getMessage(), e.getStatus().getException().getMessage()); } Display.getDefault().asyncExec(new Runnable() { public void run() { viewer.update(item, null); } }); } } } return Status.OK_STATUS; }}; job.setUser(false); job.schedule(); return null; }
Source:
<code>public void onFailed(final AvroElasticMemoryMessage msg) { if (msg.getOperationId() == null) { <START> LOG.warning("No operationId provided. Ignoring msg " + msg); <END> return; } final String operationId = msg.getOperationId().toString(); final EventHandler<AvroElasticMemoryMessage> handler = handlerMap.remove(operationId); if (handler == null) { LOG.warning("Failed to find callback for " + operationId + ". Ignoring msg " + msg); } else { handler.onNext(msg); } }</code><technical_language>interpolation, e.g. Ignoring msg {0}</technical_language>

Target:
public void onFailed(final AvroElasticMemoryMessage msg) { if (msg.getOperationId() == null) { LOG.log(Level.WARNING, "No operationId provided. Ignoring msg {0}", msg); return; } final String operationId = msg.getOperationId().toString(); final EventHandler<AvroElasticMemoryMessage> handler = handlerMap.remove(operationId); if (handler == null) { LOG.log(Level.WARNING, "Failed to find callback for {0}. Ignoring msg {1}", new Object[]{operationId, msg}); } else { handler.onNext(msg); } }
Source:
<code>public void trainModels(String trainingData) { Parser trainingParser = new POSBracketToToken(trainingData); Parser trainingParserUnknown = new POSLabeledUnknownWordParser(trainingData); MikheevTable.isTraining = true; BaselineTarget.isTraining = true; Object ex; while ((ex = trainingParser.next()) != null) { baselineTarget.learn(ex); mikheevTable.learn(ex); } baselineTarget.doneLearning(); mikheevTable.doneLearning(); trainingParser.reset(); POSTaggerUnknown.isTraining = true; POSTaggerKnown.isTraining = true; for (int i = 0; i < iter; i++) { <START> logger.info("Training round " + i); <END> while ((ex = trainingParser.next()) != null) { taggerKnown.learn(ex); } logger.info("\tFinished training " + rm.getString("knownName")); while ((ex = trainingParserUnknown.next()) != null) { taggerUnknown.learn(ex); } logger.info("\tFinished training " + rm.getString("unknownName")); trainingParser.reset(); trainingParserUnknown.reset(); taggerKnown.doneWithRound(); taggerUnknown.doneWithRound(); } taggerUnknown.doneLearning(); taggerKnown.doneLearning(); }</code><technical_language>STDOUT instead of logger -- a huge amount of output, run infrequently in a setting user wants on</technical_language>

Target:
public void trainModels(String trainingData) { Parser trainingParser = new POSBracketToToken(trainingData); Parser trainingParserUnknown = new POSLabeledUnknownWordParser(trainingData); MikheevTable.isTraining = true; BaselineTarget.isTraining = true; Object ex; while ((ex = trainingParser.next()) != null) { baselineTarget.learn(ex); mikheevTable.learn(ex); } baselineTarget.doneLearning(); mikheevTable.doneLearning(); trainingParser.reset(); POSTaggerUnknown.isTraining = true; POSTaggerKnown.isTraining = true; for (int i = 0; i < iter; i++) { System.out.println("Training round " + i); while ((ex = trainingParser.next()) != null) { taggerKnown.learn(ex); } System.out.println("\tFinished training " + rm.getString("knownName")); while ((ex = trainingParserUnknown.next()) != null) { taggerUnknown.learn(ex); } System.out.println("\tFinished training " + rm.getString("unknownName")); trainingParser.reset(); trainingParserUnknown.reset(); taggerKnown.doneWithRound(); taggerUnknown.doneWithRound(); } taggerUnknown.doneLearning(); taggerKnown.doneLearning(); }
Source:
<code>private void render(DiffInfo diff) { JsArray<Region> regions = diff.content(); <START> int lineA = 0, lineB = 0; <END> for (int i = 0; i < regions.length(); i++) { Region current = regions.get(i); if (current.ab() != null) { lineA += current.ab().length(); lineB += current.ab().length(); } else if (current.a() == null && current.b() != null) { int delta = current.b().length(); insertEmptyLines(cmA, delta, lineA - 1); lineB = colorLine(cmB, delta, lineB); } else if (current.a() != null && current.b() == null) { int delta = current.a().length(); insertEmptyLines(cmB, delta, lineB - 1); lineA = colorLine(cmA, delta, lineA); } else { int aLength = current.a().length(); int bLength = current.b().length(); lineA = colorLine(cmA, aLength, lineA); lineB = colorLine(cmB, bLength, lineB); if (aLength < bLength) { insertEmptyLines(cmA, bLength - aLength, lineA - 1); } else if (aLength > bLength) { insertEmptyLines(cmB, aLength - bLength, lineB - 1); } } } }</code><technical_language>need handle 1) lines in file. 2) inserting empty divs line e.g. -1 (i handle this special)</technical_language>

Target:
private void render(DiffInfo diff) { JsArray<Region> regions = diff.content(); int lineA = 0, lineB = 0; for (int i = 0; i < regions.length(); i++) { Region current = regions.get(i); if (current.ab() != null) { lineA += current.ab().length(); lineB += current.ab().length(); } else if (current.a() == null && current.b() != null) { int delta = current.b().length(); insertEmptyLines(cmA, lineA, delta); lineB = colorLines(cmB, lineB, delta); } else if (current.a() != null && current.b() == null) { int delta = current.a().length(); insertEmptyLines(cmB, lineB, delta); lineA = colorLines(cmA, lineA, delta); } else { int aLength = current.a().length(); int bLength = current.b().length(); lineA = colorLines(cmA, lineA, aLength); lineB = colorLines(cmB, lineB, bLength); if (aLength < bLength) { insertEmptyLines(cmA, lineA, bLength - aLength); } else if (aLength > bLength) { insertEmptyLines(cmB, lineB, aLength - bLength); } } } }
Source:
<code>public EventAuthHeader(final String value) { <START> super(HEADER_KEY, value.getBytes(Charsets.UTF_8)); <END> }</code><technical_language>If is null, NPE here, I guess, check instantiating header (before publishing), right</technical_language>

Target:
public EventAuthHeader(final String value) { super(HEADER_KEY, value == null ? null : value.getBytes(Charsets.UTF_8)); }
Source:
<code>public void onReceive(Context context, Intent intent) { if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) { Log.v(TAG, "Intent received: " + intent); } String action = intent.getAction(); if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) { Uri changed = (Uri) intent.getParcelableExtra(Mms.Intents.DELETED_CONTENTS); MmsApp.getApplication().getPduLoaderManager().removePdu(changed); } else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { if (mConnMgr == null) { mConnMgr = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); } NetworkInfo mmsNetworkInfo = mConnMgr .getNetworkInfo(ConnectivityManager.TYPE_MOBILE_MMS); <START> if (mmsNetworkInfo == null) <END> return; boolean available = mmsNetworkInfo.isAvailable(); boolean isConnected = mmsNetworkInfo.isConnected(); if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) { Log.v(TAG, "TYPE_MOBILE_MMS available = " + available + ", isConnected = " + isConnected); } if (available && !isConnected) { wakeUpService(context); } } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { MessagingNotification.nonBlockingUpdateNewMessageIndicator( context, MessagingNotification.THREAD_NONE, false); wakeUpService(context); } }</code><technical_language>follow Android coding style guidelines, add braces change? i.e. if () { do something; } Thanks</technical_language>

Target:
public void onReceive(Context context, Intent intent) { if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) { Log.v(TAG, "Intent received: " + intent); } String action = intent.getAction(); if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) { Uri changed = (Uri) intent.getParcelableExtra(Mms.Intents.DELETED_CONTENTS); MmsApp.getApplication().getPduLoaderManager().removePdu(changed); } else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) { if (mConnMgr == null) { mConnMgr = (ConnectivityManager) context .getSystemService(Context.CONNECTIVITY_SERVICE); } NetworkInfo mmsNetworkInfo = mConnMgr .getNetworkInfo(ConnectivityManager.TYPE_MOBILE_MMS); if (mmsNetworkInfo == null) { return; } boolean available = mmsNetworkInfo.isAvailable(); boolean isConnected = mmsNetworkInfo.isConnected(); if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE)) { Log.v(TAG, "TYPE_MOBILE_MMS available = " + available + ", isConnected = " + isConnected); } if (available && !isConnected) { wakeUpService(context); } } else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) { MessagingNotification.nonBlockingUpdateNewMessageIndicator( context, MessagingNotification.THREAD_NONE, false); wakeUpService(context); } }
Source:
<code>public Node visitUpdate(SqlBaseParser.UpdateContext context) { var assignments = Lists2.map(context.assignment(), x -> (Assignment<Expression>) visit(x)); return new Update( (Relation) visit(context.aliasedRelation()), assignments, visitIfPresent(context.where(), Expression.class), <START> getReturningClause(context.returning()) <END> ); }</code><technical_language>getReturningItems, clause suffix is informative</technical_language>

Target:
public Node visitUpdate(SqlBaseParser.UpdateContext context) { var assignments = Lists2.map(context.assignment(), x -> (Assignment<Expression>) visit(x)); return new Update( (Relation) visit(context.aliasedRelation()), assignments, visitIfPresent(context.where(), Expression.class), visitCollection(context.selectItem(), SelectItem.class) ); }
Source:
<code>public List<MystromDevice> getDevices() { Reader reader = null; logger.info("get devices..."); try { HttpURLConnection httpURLConnection; <START> httpURLConnection = (HttpURLConnection) new URL(API_URL + "devices" + <END> "?authToken=" + this.authToken) .openConnection(); httpURLConnection.connect(); int responseCode = httpURLConnection.getResponseCode(); if (responseCode != HttpURLConnection.HTTP_OK) { logger.error("Get devices http code: '{}'", responseCode); return new ArrayList<MystromDevice>(); } InputStream inputStream = httpURLConnection.getInputStream(); reader = new InputStreamReader(inputStream, "UTF-8"); JsonObject jsonObject = (JsonObject) jsonParser.parse(reader); String status = jsonObject.get("status").getAsString(); if(!status.equals("ok")){ logger.error("Error while getting devices: '{}'", status); return new ArrayList<MystromDevice>(); } GetDevicesResult result = gson.fromJson(jsonObject, GetDevicesResult.class); logger.info("Devices discovery sucessfull, found '{}' devices", result.devices.size()); return result.devices; } catch(Exception ex){ logger.error("Error getting devices: '{}'", ex.toString()); return new ArrayList<MystromDevice>(); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }</code><technical_language>please assign URL a local variable opening connection? This helps while debugging problems</technical_language>

Target:
public List<MystromDevice> getDevices() { Reader reader = null; logger.info("get devices..."); try { String url = API_URL + "devices" + "?authToken=" + this.authToken; HttpURLConnection httpURLConnection; httpURLConnection = (HttpURLConnection) new URL(url) .openConnection(); httpURLConnection.connect(); int responseCode = httpURLConnection.getResponseCode(); if (responseCode != HttpURLConnection.HTTP_OK) { logger.error("Get devices http code: '{}'", responseCode); return new ArrayList<MystromDevice>(); } InputStream inputStream = httpURLConnection.getInputStream(); reader = new InputStreamReader(inputStream, "UTF-8"); JsonObject jsonObject = (JsonObject) jsonParser.parse(reader); String status = jsonObject.get("status").getAsString(); if (!status.equals("ok")) { logger.error("Error while getting devices: '{}'", status); return new ArrayList<MystromDevice>(); } GetDevicesResult result = gson.fromJson(jsonObject, GetDevicesResult.class); logger.info("Devices discovery sucessfull, found '{}' devices", result.devices.size()); return result.devices; } catch (Exception ex) { logger.error("Error getting devices: '{}'", ex.toString()); return new ArrayList<MystromDevice>(); } finally { if (reader != null) { try { reader.close(); } catch (IOException ignored) { } } } }
Source:
<code>static Object[] asArray(java.util.Iterator<?> it, int length) { <START> final Object[] array = copy(empty(), length); <END> for (int i = 0; i < length; i++) { array[i] = it.next(); } return array; }</code><technical_language>do java final Object[] array = new Object[length];</technical_language>

Target:
static Object[] asArray(java.util.Iterator<?> it, int length) { final Object[] array = newInstance(length); for (int i = 0; i < length; i++) { array[i] = it.next(); } return array; }
Source:
<code><START> public void testNonZeroExitCodeException() { <END> DoNothingSoftwareProcessDriver sshRunner = mock(DoNothingSoftwareProcessDriver.class); when(sshRunner.execute(any(Map.class), any(List.class), any(String.class))).thenReturn(1); ScriptHelper scriptHelper = new ScriptHelper(sshRunner, "test-zero-code-task") .failOnNonZeroResultCode() .body.append(NON_ZERO_CODE_COMMAND); Asserts.assertTrue(scriptHelper.executeInternal() != 0, "ScriptHelper return zero code for non-zero code task"); }</code><technical_language>This method's body testNonZeroExitCode. asserting expectedExceptions above, strip out extra code (e.g. assertTrue end of this method)</technical_language>

Target:
public void testNonZeroExitCodeException() { DoNothingSoftwareProcessDriver sshRunner = mock(DoNothingSoftwareProcessDriver.class); when(sshRunner.execute(any(Map.class), any(List.class), any(String.class))).thenReturn(1); ScriptHelper scriptHelper = new ScriptHelper(sshRunner, "test-zero-code-task") .failOnNonZeroResultCode() .body.append(NON_ZERO_CODE_COMMAND); scriptHelper.executeInternal(); }