auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); updateParameters(completedChildren, parameters.getDestinationImageId()); <START> persistCommand(getParameters().getParentCommand(), true); <END> CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }</code><technical_language>replace persistCommandIfNeeded</technical_language>

Target:
private boolean performNextOperationLiveMerge(int completedChildren) { if (completedChildren != 0) { checkImageIdConsistency(completedChildren - 1); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskLiveParameters(nextImageId, completedChildren); updateParameters(completedChildren, parameters.getDestinationImageId()); persistCommandIfNeeded(); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDiskLive, parameters, cloneContextAndDetachFromParent()); return true; }
Source:
<code>public static String[] getRecurrenceDates(String recurrentEventIdentifier){ String[] recDates = null; if(recurrentEventIdentifier==null) { <START> return null; <END> } if(recurrentEventIdentifier.contains(RECURRENCE_PREFIX) && recurrentEventIdentifier.contains(RECURRENCE_SEPARATOR)){ String idAux = ""; try{ idAux = recurrentEventIdentifier.substring(recurrentEventIdentifier.indexOf(RECURRENCE_SEPARATOR)+1); }catch(IndexOutOfBoundsException e){} if(UtilMethods.isSet(idAux)){ recDates = idAux.split(RECURRENCE_SEPARATOR); } } return recDates; }</code><technical_language>return empty array</technical_language>

Target:
public static String[] getRecurrenceDates(String recurrentEventIdentifier){ String[] recDates = null; if(recurrentEventIdentifier==null) { return new String[]{}; } if(recurrentEventIdentifier.contains(RECURRENCE_PREFIX) && recurrentEventIdentifier.contains(RECURRENCE_SEPARATOR)){ String idAux = ""; try{ idAux = recurrentEventIdentifier.substring(recurrentEventIdentifier.indexOf(RECURRENCE_SEPARATOR)+1); }catch(IndexOutOfBoundsException e){} if(UtilMethods.isSet(idAux)){ recDates = idAux.split(RECURRENCE_SEPARATOR); } } return recDates; }
Source:
<code>public Long scheduleRequest(String containerId, JobRequestInstance jobRequest) { Object result = null; if( config.isRest() ) { Map<String, Object> valuesMap = new HashMap<String, Object>(); String queryString = ""; if (containerId != null && !containerId.isEmpty()) { <START> valuesMap.put(CONTAINER_ID, containerId); <END> queryString = "?containerId=" + containerId; } result = makeHttpPostRequestAndCreateCustomResponse( build(loadBalancer.getUrl(), JOB_URI, valuesMap) + queryString, jobRequest, Object.class); } else { if (containerId == null) { containerId = ""; } CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new DescriptorCommand( "JobService", "scheduleRequest", serialize(jobRequest), marshaller.getFormat().getType(), new Object[]{containerId}) ) ); ServiceResponse<String> response = (ServiceResponse<String>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM" ).getResponses().get(0); throwExceptionOnFailure(response); if (shouldReturnWithNullResponse(response)) { return null; } result = deserialize(response.getResult(), Object.class); } if (result instanceof Wrapped) { return (Long) ((Wrapped) result).unwrap(); } return ((Number) result).longValue(); }</code><technical_language>this is needed, containerId added values map sit is a path param query param only</technical_language>

Target:
public Long scheduleRequest(String containerId, JobRequestInstance jobRequest) { Object result = null; if( config.isRest() ) { Map<String, Object> valuesMap = new HashMap<String, Object>(); String queryString = ""; if (containerId != null && !containerId.isEmpty()) { queryString = "?containerId=" + containerId; } result = makeHttpPostRequestAndCreateCustomResponse( build(loadBalancer.getUrl(), JOB_URI, valuesMap) + queryString, jobRequest, Object.class); } else { if (containerId == null) { containerId = ""; } CommandScript script = new CommandScript( Collections.singletonList( (KieServerCommand) new DescriptorCommand( "JobService", "scheduleRequest", serialize(jobRequest), marshaller.getFormat().getType(), new Object[]{containerId}) ) ); ServiceResponse<String> response = (ServiceResponse<String>) executeJmsCommand( script, DescriptorCommand.class.getName(), "BPM" ).getResponses().get(0); throwExceptionOnFailure(response); if (shouldReturnWithNullResponse(response)) { return null; } result = deserialize(response.getResult(), Object.class); } if (result instanceof Wrapped) { return (Long) ((Wrapped) result).unwrap(); } return ((Number) result).longValue(); }
Source:
<code>public String setInputCommand(Command command){ <START> switch(((StringType) command).toString().toLowerCase()){ <END> case "btaudio": return "extInput:btAudio"; case "tv": return "extInput:tv"; case "hdmi1": return "extInput:hdmi?port=1"; case "hdmi2": return "extInput:hdmi?port=2"; case "hdmi3": return "extInput:hdmi?port=3"; case "analog": return "extInput:line"; case "usb": return "storage:usb1"; case "network": return "dlna:music"; } return ((StringType) command).toString(); }</code><technical_language>need cast StringType here</technical_language>

Target:
public String setInputCommand(Command command) { switch (command.toString().toLowerCase()) { case "btaudio": return "extInput:btAudio"; case "tv": return "extInput:tv"; case "hdmi1": return "extInput:hdmi?port=1"; case "hdmi2": return "extInput:hdmi?port=2"; case "hdmi3": return "extInput:hdmi?port=3"; case "analog": return "extInput:line"; case "usb": return "storage:usb1"; case "network": return "dlna:music"; case "cast": return "cast:audio"; } return command.toString(); }
Source:
<code>private V pull(final EncodedKey<K> encodedKey) { try { <START> workerClock.waitIfExceedingStalenessBound(); <END> } catch (final InterruptedException e) { throw new RuntimeException(e); } final PullOp pullOp = new PullOp(encodedKey); final int partitionId = getPartitionIndex(encodedKey.getHash()); final int threadId = partitionId % numThreads; threads[threadId].enqueue(pullOp); return pullOp.get(); }</code><technical_language>waitIfExceedingStalenessBound() throws InterruptedException interrupt occurs. However, wait staleness condition is met, if interrupt unexpected need handled explicitly. discuss tomorrow if clear enough</technical_language>

Target:
private V pull(final EncodedKey<K> encodedKey) { workerClock.waitIfExceedingStalenessBound(); final PullOp pullOp = new PullOp(encodedKey); final int partitionId = getPartitionIndex(encodedKey.getHash()); final int threadId = partitionId % numThreads; threads[threadId].enqueue(pullOp); return pullOp.get(); }
Source:
<code>public void testReplicatedJoin() { JoinNode join = join("join", tableScan("ts1", "orderkey"), tableScan("ts2", "orderkey_0"), JoinNode.DistributionType.REPLICATED, "orderkey", "orderkey_0"); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of( "ts1", cpuCost(6000), "ts2", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of( "join", statsEstimate(12000), "ts1", statsEstimate(6000), "ts2", statsEstimate(1000)); assertCost( join, costs, stats) .cpu(12000 + 6000 + 10000 + 6000 + 1000 + 1000 * (NUMBER_OF_NODES - 1)); assertCostEstimatedExchanges( join, costs, <START> stats) <END> .cpu(12000 + 6000 + 10000 + 6000 + 1000 + 1000 * NUMBER_OF_NODES); assertCostHasUnknownComponentsForUnknownStats(join); }</code><technical_language>memory/network cost</technical_language>

Target:
public void testReplicatedJoin() { TableScanNode ts1 = tableScan("ts1", "orderkey"); TableScanNode ts2 = tableScan("ts2", "orderkey_0"); JoinNode join = join("join", ts1, ts2, JoinNode.DistributionType.REPLICATED, "orderkey", "orderkey_0"); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of( "ts1", cpuCost(6000), "ts2", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of( "join", statsEstimate(join, 12000), "ts1", statsEstimate(ts1, 6000), "ts2", statsEstimate(ts2, 1000)); assertCost(join, costs, stats) .cpu(12000 + 6000 + 10000 + 6000 + 1000 + 1000 * (NUMBER_OF_NODES - 1)) .memory(1000 * NUMBER_OF_NODES) .network(0); assertCostEstimatedExchanges(join, costs, stats) .cpu(12000 + 6000 + 10000 + 6000 + 1000 + 1000 * NUMBER_OF_NODES) .memory(1000 * NUMBER_OF_NODES) .network(1000 * NUMBER_OF_NODES); assertCostHasUnknownComponentsForUnknownStats(join); }
Source:
<code>private void close() { stop(); <START> process.close(); <END> }</code><technical_language>change semantics of this class is crossing thread boundaries unnecessarily, need worry SubscribeProcessor synchronization. I add fields: private Publisher pub; private List<SubscribeCommand> cmds; AtomicBoolean exit = new AtomicBoolean(); methods task become: private void setData(Publisher pub, List<SubscribeCommand>> cmds) { // TODO: check null synchronized (this) { this.pub = pub; this.cmds = cmds; } thread.interrupt(); } private void exit() { exit.set(true); thread.interrupt(); } private boolean isRunning() { return (thread != null) && !exit.get(); } of other operations needs anymore run() method a loop: try { while (!exit.get()) { try { Publisher p; List<SubscribeCommand>> c; synchronized (SubscribeTask.this) { p = pub; c = cmds; } // execute .... } catch (InterruptedException e) { // re-execute updated commands } ... } } finally { process.close(); }</technical_language>

Target:
private void close() { exit.set(true); thread.interrupt(); }
Source:
<code>public Result refresh() { <START> refreshableCategoryTree.refresh(); <END> return ok("Fetched " + refreshableCategoryTree.getAllAsFlatList().size() + " categories"); }</code><technical_language>( NPE</technical_language>

Target:
public Result refresh() { return refreshableCategoryTree.map(tree -> { tree.refresh(); return ok("Fetched " + tree.getAllAsFlatList().size() + " categories"); }).orElseThrow(() -> new RuntimeException("Not found refreshable category tree")); }
Source:
<code>private static void addCustomAnnotationsToSpan(@Nullable Span span, @NotNull PhoenixConnection conn) { Preconditions.checkNotNull(conn); <START> if (span != null) { <END> Map<String, String> annotations = conn.getCustomTracingAnnotations(); for (Map.Entry<String, String> annotation : annotations.entrySet()) { span.addKVAnnotation(StringUtil.toBytes(annotation.getKey()), StringUtil.toBytes(annotation.getValue())); } } }</code><technical_language>nit: flip logic save indent for readabililty</technical_language>

Target:
private static void addCustomAnnotationsToSpan(@Nullable Span span, @NotNull PhoenixConnection conn) { Preconditions.checkNotNull(conn); if (span == null) { return; } Map<String, String> annotations = conn.getCustomTracingAnnotations(); for (Map.Entry<String, String> annotation : annotations.entrySet()) { span.addKVAnnotation(toBytes(annotation.getKey()), toBytes(annotation.getValue())); } }
Source:
<code>private List<String> getActiveBoundaryNodesSignals(ProcessInstance processInstance, Collection<NodeInstance> activeNodes) { WorkflowProcessInstance workflowProcessInstance = (WorkflowProcessInstance) processInstance; ArrayList<Node> processNodesList = new ArrayList(Arrays.asList(((RuleFlowProcessInstance) workflowProcessInstance).getNodeContainer().getNodes())); List<String> activeBoundaryNodesSignals = new ArrayList<>(); Map<String, NodeInstance> uniqueIdNodeInstanceMap = new HashMap<>(); for(NodeInstance activeNode : activeNodes) { uniqueIdNodeInstanceMap.put((String) activeNode.getNode().getMetaData().get("UniqueId"), activeNode); } try { for(Node processNode : processNodesList) { if(processNode instanceof BoundaryEventNode) { activeBoundaryNodesSignals.add(VariableUtil.resolveVariable((String) processNode.getMetaData().get("SignalName"), <START> uniqueIdNodeInstanceMap.get(((BoundaryEventNode) processNode).getAttachedToNodeId()))); <END> } } return activeBoundaryNodesSignals; } catch(Exception e) { logger.debug("Unable to retrieve boundary event nodes for active nodes in processInstance {}", processInstance.getId()); return new ArrayList<>(); } }</code><technical_language>part uniqueIdNodeInstanceMap.get return null resolveVariable throw NPE? avoid that... exceptions expensive ..</technical_language>

Target:
protected List<String> getActiveBoundaryNodesSignals(ProcessInstance processInstance, Collection<NodeInstance> activeNodes) { WorkflowProcessInstance workflowProcessInstance = (WorkflowProcessInstance) processInstance; ArrayList<Node> processNodesList = new ArrayList(Arrays.asList(((RuleFlowProcessInstance) workflowProcessInstance).getNodeContainer().getNodes())); List<String> activeBoundaryNodesSignals = new ArrayList<>(); Map<String, NodeInstance> uniqueIdNodeInstanceMap = new HashMap<>(); for(NodeInstance activeNode : activeNodes) { uniqueIdNodeInstanceMap.put((String) activeNode.getNode().getMetaData().get("UniqueId"), activeNode); } try { for(Node processNode : processNodesList) { if(processNode instanceof BoundaryEventNode && uniqueIdNodeInstanceMap.containsKey(((BoundaryEventNode) processNode).getAttachedToNodeId())) { activeBoundaryNodesSignals.add(VariableUtil.resolveVariable((String) processNode.getMetaData().get("SignalName"), uniqueIdNodeInstanceMap.get(((BoundaryEventNode) processNode).getAttachedToNodeId()))); } } return activeBoundaryNodesSignals; } catch(Exception e) { logger.debug("Unable to retrieve boundary event nodes for active nodes in processInstance {}", processInstance.getId()); return new ArrayList<>(); } }
Source:
<code>public String getRawName() { <START> return name().toLowerCase(Locale.US); <END> }</code><technical_language>suggestion is a <LINK_0> move this change insto single class is executed JSON is created instead of fix in places invoked times report creation</technical_language>

Target:
public String getRawName() { return name().toLowerCase(); }
Source:
<code>protected void setCommandCriteria(final String commandCriteria) { <START> if (StringUtils.isEmpty(commandCriteria)) { <END> this.commandCriteria = EMPTY_JSON_ARRAY; } else { this.commandCriteria = commandCriteria; } }</code><technical_language>Ternary</technical_language>

Target:
protected void setCommandCriteria(final String commandCriteria) { this.commandCriteria = StringUtils.isBlank(commandCriteria) ? EMPTY_JSON_ARRAY : commandCriteria; }
Source:
<code>private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { <START> String message = "Unable to retrieve access token from AuthServer " + authServerHome; <END> LOGGER.warn(message); throw new InvalidTokenException(message); } catch (Exception e) { throw new InvalidTokenException("Your token is not valid", e); } return accessToken; }</code><technical_language>Please write auth-server instead of AuthServer this is default name</technical_language>

Target:
private AccessToken validateAccessToken(String token) { AccessToken accessToken; try { accessToken = connector.validateAccessToken(new AccessToken.Builder(token).build()); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to retrieve access token from auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch (Exception e) { throw new InvalidTokenException("Your token is not valid", e); } return accessToken; }
Source:
<code>private static void parseCommandLineOptions(Options options, String... args) throws ParseException { CommandLine commandLine = new DefaultParser().parse(options, args); if (commandLine.hasOption(HELP_OPTION)) { printHelp(options); <START> System.exit(0); <END> } if (commandLine.hasOption(SLEEP_OPTION)) { sleep = parseInt(commandLine.getOptionValue(SLEEP_OPTION)); } if (commandLine.hasOption(BATCH_SIZE_OPTION)) { batchSize = parseInt(commandLine.getOptionValue(BATCH_SIZE_OPTION)); } if (commandLine.hasOption(THREADS_OPTION)) { threads = parseInt(commandLine.getOptionValue(THREADS_OPTION)); } }</code><technical_language>a suggestion, a change request: I expect a negative exit code here. If parameter is given, other parameters task stopped done anything. a successful run me</technical_language>

Target:
private static void parseCommandLineOptions(Options options, String... args) throws ParseException { CommandLine commandLine = new DefaultParser().parse(options, args); if (commandLine.hasOption(HELP_OPTION)) { printHelp(options); System.exit(-1); } if (commandLine.hasOption(SLEEP_OPTION)) { sleep = parseInt(commandLine.getOptionValue(SLEEP_OPTION)); } if (commandLine.hasOption(BATCH_SIZE_OPTION)) { batchSize = parseInt(commandLine.getOptionValue(BATCH_SIZE_OPTION)); } if (commandLine.hasOption(THREADS_OPTION)) { threads = parseInt(commandLine.getOptionValue(THREADS_OPTION)); } }
Source:
<code>public void visitAssignmentExpression(AssignmentExpressionTree tree) { <START> if (tree.getParent() instanceof ExpressionTree && !tree.operator().startsWith("=")) { <END> visitReadAssignedVariable(tree.variable()); } else { visitAssignedVariable(tree.variable()); } super.visitAssignmentExpression(tree); }</code><technical_language>I test parent improved. code example [ticket](<LINK_0> exhibits a FP parent of compound assignment is a return statement</technical_language>

Target:
public void visitAssignmentExpression(AssignmentExpressionTree tree) { if (!tree.getParent().is(Kind.EXPRESSION_STATEMENT) && !tree.operator().startsWith("=")) { visitReadAssignedVariable(tree.variable()); } else { visitAssignedVariable(tree.variable()); } super.visitAssignmentExpression(tree); }
Source:
<code>public void testEmbeddedBeelineOutputs() throws Throwable{ String embeddedJdbcURL = Utils.URL_PREFIX+"/Default"; List<String> argList = getBaseArgs(embeddedJdbcURL); final String SCRIPT_TEXT = "set hive.lock.manager=org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager;\n" + "set hive.compute.query.using.stats=false;\n" + "create table if not exists embeddedBeelineOutputs(d int);\n" <START> + "set a=1;\nselect count(*) from embeddedBeelineOutputs;\n"; <END> final String EXPECTED_PATTERN = "Stage-1 map ="; testScriptFile(SCRIPT_TEXT, EXPECTED_PATTERN, true, argList, OUTSTREAM.ERR); }</code><technical_language>drop table</technical_language>

Target:
public void testEmbeddedBeelineOutputs() throws Throwable{ String embeddedJdbcURL = Utils.URL_PREFIX+"/Default"; List<String> argList = getBaseArgs(embeddedJdbcURL); final String SCRIPT_TEXT = "set hive.lock.manager=org.apache.hadoop.hive.ql.lockmgr.EmbeddedLockManager;\n" + "set hive.compute.query.using.stats=false;\n" + "create table if not exists embeddedBeelineOutputs(d int);\n" + "set a=1;\nselect count(*) from embeddedBeelineOutputs;\n" + "drop table embeddedBeelineOutputs;\n"; final String EXPECTED_PATTERN = "Stage-1 map ="; testScriptFile(SCRIPT_TEXT, EXPECTED_PATTERN, true, argList, OutStream.ERR); }
Source:
<code><START> private TypedOutput buildBody() { <END> switch (methodInfo.requestType) { case SIMPLE: { int bodyIndex = methodInfo.bodyIndex; if (bodyIndex == NO_BODY) { return null; } Object body = args[bodyIndex]; if (body instanceof TypedOutput) { return (TypedOutput) body; } else { return converter.toBody(body); } } case FORM_ENCODED: { FormEncodedTypedOutput body = new FormEncodedTypedOutput(); String[] requestFormPair = methodInfo.requestFormPair; for (int i = 0; i < requestFormPair.length; i++) { String name = requestFormPair[i]; if (name != null) { body.addPair(name, String.valueOf(args[i])); } } return body; } case MULTIPART: { MultipartTypedOutput body = new MultipartTypedOutput(); String[] requestMultipartPart = methodInfo.requestMultipartPart; for (int i = 0; i < requestMultipartPart.length; i++) { String name = requestMultipartPart[i]; if (name != null) { Object value = args[i]; if (value instanceof TypedOutput) { body.addPart(name, (TypedOutput) value); } else { body.addPart(name, converter.toBody(value)); } } } return body; } default: throw new IllegalArgumentException("Unknown request type " + methodInfo.requestType); } }</code><technical_language>nice, clearer</technical_language>

Target:
private TypedOutput buildBody() { switch (methodInfo.requestType) { case SIMPLE: { int bodyIndex = methodInfo.bodyIndex; if (bodyIndex == NO_BODY) { return null; } Object body = args[bodyIndex]; if (body instanceof TypedOutput) { return (TypedOutput) body; } else { return converter.toBody(body); } } case FORM_URL_ENCODED: { FormUrlEncodedTypedOutput body = new FormUrlEncodedTypedOutput(); String[] requestFormPair = methodInfo.requestFormPair; for (int i = 0; i < requestFormPair.length; i++) { String name = requestFormPair[i]; if (name != null) { body.addPair(name, String.valueOf(args[i])); } } return body; } case MULTIPART: { MultipartTypedOutput body = new MultipartTypedOutput(); String[] requestMultipartPart = methodInfo.requestMultipartPart; for (int i = 0; i < requestMultipartPart.length; i++) { String name = requestMultipartPart[i]; if (name != null) { Object value = args[i]; if (value instanceof TypedOutput) { body.addPart(name, (TypedOutput) value); } else { body.addPart(name, converter.toBody(value)); } } } return body; } default: throw new IllegalArgumentException("Unknown request type " + methodInfo.requestType); } }
Source:
<code>protected static ILock getSecurePreferencesRootLock() { try { @SuppressWarnings("restriction") Field lockField = SecurePreferencesRoot.class.getDeclaredField("lock"); lockField.setAccessible(true); return (ILock) lockField.get(null); <START> } catch (ClassCastException e) { <END> handleErrorGettingLockField(e); } catch (SecurityException e) { handleErrorGettingLockField(e); } catch (IllegalArgumentException e) { handleErrorGettingLockField(e); } catch (NoSuchFieldException e) { handleErrorGettingLockField(e); } catch (IllegalAccessException e) { handleErrorGettingLockField(e); } return null; }</code><technical_language>I catch (Exception) is reasonable here</technical_language>

Target:
protected static ILock getSecurePreferencesRootLock() { try { @SuppressWarnings("restriction") Field lockField = SecurePreferencesRoot.class.getDeclaredField("lock"); lockField.setAccessible(true); return (ILock) lockField.get(null); } catch (Exception e) { if (!loggedDeadlockDetectionFailure.getAndSet(true)) { StatusHandler.log(new Status(IStatus.ERROR, RepositoriesUiPlugin.ID_PLUGIN, "Deadlock detection failed", e)); } } return null; }
Source:
<code>protected void finished(StepContext context) throws Exception { Cloud c = Jenkins.get().getCloud(cloudName); String parentLabel = taskTemplate.getInheritFrom(); if (c == null) { LOGGER.log(Level.WARNING, "Cloud {0} no longer exists, cannot delete task template {1}", new Object[] { cloudName, taskTemplate.getTemplateName() }); return; } if (c instanceof ECSCloud) { ECSCloud ecsCloud = (ECSCloud) c; if (ecsCloud.isCustomTaskDefinition(parentLabel)){ <START> LOGGER.log(Level.INFO, "Don't remove custom task template from cloud"); <END> return; } else { LOGGER.log(Level.INFO, "Removing task template {1} from cloud {0}", new Object[] { c.name, taskTemplate.getTemplateName() }); ecsCloud.removeDynamicTemplate(taskTemplate); } } else { LOGGER.log(Level.WARNING, "Cloud is not an ECSCloud: {0} {1}", new String[] { c.name, c.getClass().getName() }); } }</code><technical_language>sense put name / ARN of task definition log? this log message unclear, people do relates</technical_language>

Target:
protected void finished(StepContext context) throws Exception { Cloud c = Jenkins.get().getCloud(cloudName); String parentLabel = taskTemplate.getInheritFrom(); if (c == null) { LOGGER.log(Level.WARNING, "Cloud {0} no longer exists, cannot delete task template {1}", new Object[] { cloudName, taskTemplate.getTemplateName() }); return; } if (c instanceof ECSCloud) { ECSCloud ecsCloud = (ECSCloud) c; String customTaskDefinition = ecsCloud.isCustomTaskDefinition(parentLabel); if (customTaskDefinition != null){ LOGGER.log(Level.INFO, "Do not remove custom task template {1} from cloud {0}", new Object[] { c.name, customTaskDefinition }); return; } else { LOGGER.log(Level.INFO, "Removing task template {1} from cloud {0}", new Object[] { c.name, taskTemplate.getTemplateName() }); ecsCloud.removeDynamicTemplate(taskTemplate); } } else { LOGGER.log(Level.WARNING, "Cloud is not an ECSCloud: {0} {1}", new String[] { c.name, c.getClass().getName() }); } }
Source:
<code>public Collection<Ingredient> getChildren() { <START> return this.children; <END> }</code><technical_language>return Collections.unmodifiableCollection(this.children);</technical_language>

Target:
public Collection<Ingredient> getChildren() { return Collections.unmodifiableCollection(this.children); }
Source:
<code>public ImmutableValue<Vector3d> headDirection() { <START> return new ImmutableSpongeValue<>(Keys.HEAD_ROTATION, this.rotations.get(BodyParts.HEAD)); <END> }</code><technical_language>ImmutableSpongeValues put fields</technical_language>

Target:
public ImmutableValue<Vector3d> headDirection() { return this.headRotationValue; }
Source:
<code>public FileBasedConfig openJGitConfig(Config parent, FS fs) { <START> return null; <END> }</code><technical_language>Is this intentionally returning null</technical_language>

Target:
public FileBasedConfig openJGitConfig(Config parent, FS fs) { return jgitConfig; }
Source:
<code>private void doScan(Exchange exchange, String tableName) throws KuduException { KuduClient connection = endpoint.getKuduClient(); KuduTable table = connection.openTable(tableName); List<String> projectColumns = new ArrayList<>(1); for (ColumnSchema columnSchema : table.getSchema().getColumns()) { projectColumns.add(columnSchema.getName()); } <START> <END> KuduScanner scanner = connection.newScannerBuilder(table) .setProjectedColumnNames(projectColumns) .build(); exchange.getIn().setBody(scanner); }</code><technical_language>Is required doScan(...) for producer consumer</technical_language>

Target:
private void doScan(Exchange exchange, String tableName) throws KuduException { exchange.getIn().setBody(KuduUtils.doScan(tableName, endpoint.getKuduClient())); }
Source:
<code>public void run() { while(true) { if (etc.getEditorState().isDirty()) { try { etc.getEditorState().setDirty(false); <START> etc.spellCheckAllText(); <END> } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } } try { Thread.sleep(1000); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } } }</code><technical_language>move "spellCheckAllText" method this class? I else</technical_language>

Target:
public void run() { while(true) { if (etc.getEditorState().isDirty()) { try { etc.getEditorState().setDirty(false); spellCheckAllText(); } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } } try { Thread.sleep(1000); } catch (InterruptedException ex) { Exceptions.printStackTrace(ex); } } }
Source:
<code>public String getProfileName() { Properties config = (Properties) context.get(ExtensionProperties.CONFIGURATION); <START> return config.getProperty("ovirt.engine.aaa.authz.profile.name"); <END> }</code><technical_language>do need config temp variable</technical_language>

Target:
public String getProfileName() { return ((Properties) context.get(ExtensionProperties.CONFIGURATION)).getProperty("ovirt.engine.aaa.authz.profile.name"); }
Source:
<code>public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) { Set<String> completions = Sets.newHashSet(); for (CommandElement element : elements) { Object start = args.getState(); <START> try { <END> element.parse(src, args, context); if (start.equals(args.getState())) { completions.addAll(element.complete(src, args, context)); } else if (!completions.isEmpty()) { completions.clear(); } if (!args.hasNext()) { args.setState(start); completions.addAll(element.complete(src, args, context)); break; } } catch (ArgumentParseException ignored) { args.setState(start); return element.complete(src, args, context); } } return Lists.newArrayList(completions); }</code><technical_language>remove this behaviour</technical_language>

Target:
public List<String> complete(CommandSource src, CommandArgs args, CommandContext context) { Set<String> completions = Sets.newHashSet(); for (CommandElement element : elements) { Object state = args.getState(); try { element.parse(src, args, context); if (state.equals(args.getState())) { completions.addAll(element.complete(src, args, context)); args.setState(state); } else if (args.hasNext()) { completions.clear(); } else { args.setState(state); completions.addAll(element.complete(src, args, context)); if (!(element instanceof OptionalCommandElement)) { break; } args.setState(state); } } catch (ArgumentParseException ignored) { args.setState(state); completions.addAll(element.complete(src, args, context)); break; } } return Lists.newArrayList(completions); }
Source:
<code>public Throwable rewriteException(Throwable throwable) { if (throwable instanceof FrameTooLargeException || throwable instanceof MessageTooLargeException) { <START> return new PageTooLargeException(); <END> } return throwable; }</code><technical_language>Do want include original throwable shown in stacktrace "caused by"</technical_language>

Target:
public Throwable rewriteException(Throwable throwable) { if (throwable instanceof MessageTooLargeException) { return new PageTooLargeException(throwable); } return throwable; }
Source:
<code>public Replicas pendingEndpointsFor(Token token, String keyspaceName) { PendingRangeMaps pendingRangeMaps = this.pendingRanges.get(keyspaceName); if (pendingRangeMaps == null) <START> return new ReplicaList(0); <END> return pendingRangeMaps.pendingEndpointsFor(token); }</code><technical_language>a singleton immutable empty list</technical_language>

Target:
public ReplicaCollection pendingEndpointsFor(Token token, String keyspaceName) { PendingRangeMaps pendingRangeMaps = this.pendingRanges.get(keyspaceName); if (pendingRangeMaps == null) return Replicas.empty(); return pendingRangeMaps.pendingEndpointsFor(token); }
Source:
<code>void hash(byte[] raw, int ptr, final int end) throws TableFullException { final boolean text = !RawText.isBinary(raw); hashedCnt = 0; while (ptr < end) { int hash = 5381; int hashedCnt = 0; int start = ptr; do { int c = raw[ptr++] & 0xff; if (text && c == '\r' && ptr < end && raw[ptr] == '\n') continue; hashedCnt++; if (c == '\n') break; hash = (hash << 5) + hash + c; } while (ptr < end && ptr - start < 64); <START> this.hashedCnt += hashedCnt; <END> add(hash, hashedCnt); } }</code><technical_language>This is a bit confusing (also initializations beginning). rename variable else, e.g. count blockHashedCount? for other method</technical_language>

Target:
void hash(byte[] raw, int ptr, final int end) throws TableFullException { final boolean text = !RawText.isBinary(raw); hashedCnt = 0; while (ptr < end) { int hash = 5381; int blockHashedCnt = 0; int start = ptr; do { int c = raw[ptr++] & 0xff; if (text && c == '\r' && ptr < end && raw[ptr] == '\n') continue; blockHashedCnt++; if (c == '\n') break; hash = (hash << 5) + hash + c; } while (ptr < end && ptr - start < 64); hashedCnt += blockHashedCnt; add(hash, blockHashedCnt); } }
Source:
<code>public Boolean runAsync() { <START> return true; <END> }</code><technical_language>this NEED async</technical_language>

Target:
public Boolean runAsync() { return false; }
Source:
<code>private static int calculateCorePoolSize() { int definedSize = Integer.parseInt(System.getProperty("dsa.shared.threadPoolSize", "0")); if (definedSize == 0) { int processors = Runtime.getRuntime().availableProcessors(); if (processors <= 2) { definedSize = 16; } else { <START> definedSize = Math.min(64, processors * 8); <END> } } return definedSize; }</code><technical_language>constants, clearer</technical_language>

Target:
private static int calculateCorePoolSize() { int definedSize = Integer.parseInt(System.getProperty("dsa.shared.threadPoolSize", "0")); if (definedSize == 0) { int processors = Runtime.getRuntime().availableProcessors(); if (processors <= CORE_POOL_FEW_PROCESSORS_THRESHOLD) { definedSize = MIN_CORE_POOL_SIZE; } else { definedSize = Math.min(MAX_CORE_POOL_SIZE, processors * CORE_POOL_MANY_PROCESSORS_MULTIPLIER); } } return definedSize; }
Source:
<code>private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> <START> diskIds = <END> null; if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); diskIds = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskIds); }</code><technical_language>imageIds, diskIds (imageGroupIds)</technical_language>

Target:
private void onPreview() { Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } VM vm = getEntity(); SnapshotModel snapshotModel = (SnapshotModel) getWindow(); boolean memory = false; List<DiskImage> disks; Set<Guid> diskImageIds = null; if (snapshotModel.isShowPartialSnapshotWarning()) { switch (snapshotModel.getPartialPreviewSnapshotOptions().getSelectedItem()) { case preserveActiveDisks: disks = snapshotModel.getDisks(); disks.addAll(imagesSubtract(getVmDisks(), disks)); diskImageIds = disks.stream().map(DiskImage::getImageId).collect(Collectors.toSet()); break; case excludeActiveDisks: break; case openCustomPreviewDialog: setWindow(null); getCustomPreviewCommand().execute(); return; } } if (snapshotModel.isShowMemorySnapshotWarning()) { memory = snapshotModel.getMemory().getEntity(); } runTryBackToAllSnapshotsOfVm(snapshotModel, vm, snapshot, memory, diskImageIds); }
Source:
<code>public void sendsMessageToBout() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff1"); final Alias alias = user.aliases().iterate().iterator().next(); final long number = alias.inbox().start(); final Bout bout = alias.inbox().bout(number); bout.friends().invite(alias.name()); final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(number), new RqWithHeaders( <START> new Request() { <END> @Override public Iterable<String> head() throws IOException { return new LinkedList<>(); } @Override public InputStream body() throws IOException { return new ByteArrayInputStream( "non-zero".getBytes() ); } }, String.format(TkAttachTest.POST_URL, number), "Content-Disposition: form-data; name=\"file\"; filename=\"some.xml\"", "Content-Type: application/xml", "Content-Length: 8" ) ) ); try { new FkBout(".+", new TkAttach(base)).route(request); } catch (final RsForward response) { MatcherAssert.assertThat( response, new HmRsStatus(HttpURLConnection.HTTP_SEE_OTHER) ); } MatcherAssert.assertThat( bout.messages().iterate().iterator().next().text(), Matchers.containsString("attachment \"some.xml\"") ); }</code><technical_language>@exper0 move creation of request static method in ignoresWrongFile</technical_language>

Target:
public void sendsMessageToBout() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:1"; final User user = base.user(new URN(urn)); user.aliases().add("jeff1"); final Alias alias = user.aliases().iterate().iterator().next(); final long number = alias.inbox().start(); final Bout bout = alias.inbox().bout(number); bout.friends().invite(alias.name()); final RqWithAuth request = new RqWithAuth( urn, new RqMultipart.Fake( TkAttachTest.fake(number), new RqWithHeaders( TkAttachTest.body("non-zero"), String.format(TkAttachTest.POST_URL, number), "Content-Disposition: form-data; name=\"file\"; filename=\"some.xml\"", "Content-Type: application/xml", "Content-Length: 8" ) ) ); try { new FkBout(".+", new TkAttach(base)).route(request); } catch (final RsForward response) { MatcherAssert.assertThat( response, new HmRsStatus(HttpURLConnection.HTTP_SEE_OTHER) ); } MatcherAssert.assertThat( bout.messages().iterate().iterator().next().text(), Matchers.containsString("attachment \"some.xml\"") ); }
Source:
<code>private Model createPomFromManifest(File manifestFile) throws IOException, ModelParseException { Attributes headers = readManifestHeaders(manifestFile); String bundleSymbolicName = getBundleSymbolicName(headers, manifestFile); Model model = createModel(); model.setParent(findParent(manifestFile.getParentFile().getParentFile())); model.setArtifactId(bundleSymbolicName); String bundleVersion = getRequiredHeaderValue("Bundle-Version", headers, manifestFile); model.setVersion(getPomVersion(bundleVersion)); model.setPackaging(getPackagingType(bundleSymbolicName)); setLocation(model, manifestFile); String bundleName = headers.getValue("Bundle-Name"); if (bundleName != null && !bundleName.isEmpty()) { model.setName(bundleName); } else { model.setName(bundleSymbolicName); } <START> String vendorName = headers.getValue("Bundle-Vendor"); <END> if (vendorName != null && !vendorName.isEmpty()) { Organization organization = new Organization(); organization.setName(vendorName); model.setOrganization(organization); } return model; }</code><technical_language>values externalized (in a plugin.properties, some other file pointed Bundle-Localization). need skip case this is externalized (ie starts '%') resolve symbol in locaiton file it</technical_language>

Target:
private Model createPomFromManifest(File manifestFile) throws IOException, ModelParseException { Attributes headers = readManifestHeaders(manifestFile); String bundleSymbolicName = getBundleSymbolicName(headers, manifestFile); Model model = createModel(); model.setParent(findParent(manifestFile.getParentFile().getParentFile())); model.setArtifactId(bundleSymbolicName); String bundleVersion = getRequiredHeaderValue("Bundle-Version", headers, manifestFile); model.setVersion(getPomVersion(bundleVersion)); model.setPackaging(getPackagingType(bundleSymbolicName)); setLocation(model, manifestFile); String bundleName = getManifestAttributeValue(headers, "Bundle-Name", manifestFile); if (bundleName != null) { model.setName(bundleName); } else { model.setName(bundleSymbolicName); } String vendorName = getManifestAttributeValue(headers, "Bundle-Vendor", manifestFile); if (vendorName != null) { Organization organization = new Organization(); organization.setName(vendorName); model.setOrganization(organization); } return model; }
Source:
<code>public static void handleIoTune(VmDevice vmDevice, Guid diskProfileId, QosCache cache) { <START> if (cache == null) { cache = new QosCache(); } <END> Map<String, Long> ioTune = buildIoTune(diskProfileId, cache); if (ioTune == null) { return; } if (vmDevice.getSpecParams() == null) { vmDevice.setSpecParams(new HashMap<>()); } vmDevice.getSpecParams().put(VdsProperties.Iotune, ioTune); }</code><technical_language>move "buildIoTune" method, cache is used. method is called is chance of falling null cache</technical_language>

Target:
public static void handleIoTune(VmDevice vmDevice, Guid diskProfileId, QosCache cache) { Map<String, Long> ioTune = buildIoTune(diskProfileId, cache); if (ioTune == null) { return; } if (vmDevice.getSpecParams() == null) { vmDevice.setSpecParams(new HashMap<>()); } vmDevice.getSpecParams().put(VdsProperties.Iotune, ioTune); }
Source:
<code>public void writeData(GeoJsonDiseaseOccurrenceFeatureCollection occurrenceData, File dataDirectory) throws IOException { if (!occurrenceData.getCrs().equals(GeoJsonNamedCrs.createEPSG4326())) { <START> throw new IllegalArgumentException("Only EPSG4326 is supported."); <END> } File outbreakFile = Paths.get(dataDirectory.toString(), OUTBREAK_CSV).toFile(); BufferedWriter writer = null; try { writer = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(outbreakFile.getAbsoluteFile()), UTF_8)); for (GeoJsonDiseaseOccurrenceFeature occurrence : occurrenceData.getFeatures()) { if (occurrence.getCrs() != null) { throw new IllegalArgumentException("Feature level CRS are not supported."); } writer.write(StringUtils.join(new String[]{ occurrence.getGeometry().getCoordinates().get(0).toString(), occurrence.getGeometry().getCoordinates().get(1).toString(), occurrence.getProperties().getLocationPrecision().toString(), occurrence.getProperties().getWeighting().toString() }, ',')); writer.newLine(); } } finally { if (writer != null) { writer.close(); } } }</code><technical_language>Another minute thing, change "Only EPSG:4326 is supported."</technical_language>

Target:
public void writeData(GeoJsonDiseaseOccurrenceFeatureCollection occurrenceData, File dataDirectory) throws IOException { if (!occurrenceData.getCrs().equals(GeoJsonNamedCrs.createEPSG4326())) { throw new IllegalArgumentException("Only EPSG:4326 is supported."); } File outbreakFile = Paths.get(dataDirectory.toString(), OUTBREAK_CSV).toFile(); BufferedWriter writer = null; try { writer = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(outbreakFile.getAbsoluteFile()), UTF_8)); for (GeoJsonDiseaseOccurrenceFeature occurrence : occurrenceData.getFeatures()) { if (occurrence.getCrs() != null) { throw new IllegalArgumentException("Feature level CRS are not supported."); } writer.write(extractCsvLine(occurrence)); writer.newLine(); } } finally { if (writer != null) { writer.close(); } } }
Source:
<code>public void testExecuteNullTable() throws Exception { GroupRequest groupRequest = new GroupRequest(); groupRequest.setTable(null); groupRequest.setNesting(Arrays.asList("os", "device", "version")); <START> queryExecutor.execute(groupRequest); <END> }</code><technical_language>Check for equality of error code</technical_language>

Target:
public void testExecuteNullTable() throws Exception { GroupRequest groupRequest = new GroupRequest(); groupRequest.setTable(null); groupRequest.setNesting(Arrays.asList("os", "device", "version")); try { queryExecutor.execute(groupRequest); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.INVALID_REQUEST, e.getErrorCode()); throw e; } }
Source:
<code>public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (player == null || targetPlayer == null) { return false; } targetPlayer.revealCards(source, targetPlayer.getHand(), game); if (targetPlayer.getHand().size() <= 2) { targetPlayer.discard(2, false, source, game); } TargetCard target = new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS); <START> player.choose(Outcome.Benefit, targetPlayer.getHand(), target, game); <END> targetPlayer.discard(new CardsImpl(target.getTargets()), source, game); return true; }</code><technical_language>bad outcome Outcome.Discard</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (player == null || targetPlayer == null) { return false; } targetPlayer.revealCards(source, targetPlayer.getHand(), game); if (targetPlayer.getHand().size() <= 2) { targetPlayer.discard(2, false, source, game); } TargetCard target = new TargetCardInHand(2, StaticFilters.FILTER_CARD_CARDS); player.choose(Outcome.Discard, targetPlayer.getHand(), target, game); targetPlayer.discard(new CardsImpl(target.getTargets()), source, game); return true; }
Source:
<code><START> public T call() throws Exception { <END> try (CloseableHttpResponse response = FastTextClient.getInstance().execute(this.getRequestBase())) { String jsonResponse = EntityUtils.toString(response.getEntity()); int code = response.getStatusLine().getStatusCode(); if (code != HttpStatus.SC_OK) { System.out.println("External search service returned non 200 response"); throw new FastTextServerError(jsonResponse, code, this.getRequestId()); } if (this.typeReference != null) { return MAPPER.readValue(jsonResponse, this.typeReference); } return MAPPER.readValue(jsonResponse, this.returnClass); } }</code><technical_language>Log message - include request ID, url, method etc</technical_language>

Target:
public T call() throws Exception { HttpRequestBase requestBase = this.getRequestBase(); logInfo("Executing fastText request") .addParameter("method", requestBase.getMethod()) .addParameter("requestId", this.requestIdHeader.getRequestId()) .addParameter("uri", requestBase.getURI().toString()) .log(); try (CloseableHttpResponse response = FastTextClient.getInstance().execute(requestBase)) { String jsonResponse = EntityUtils.toString(response.getEntity()); int code = response.getStatusLine().getStatusCode(); if (code != HttpStatus.SC_OK) { FastTextServerError e = new FastTextServerError(jsonResponse, code, this.getRequestId()); logError(e) .addMessage("dp-fasttext returned non-200 response") .addParameter("status", code) .log(); throw e; } if (this.typeReference != null) { return MAPPER.readValue(jsonResponse, this.typeReference); } return MAPPER.readValue(jsonResponse, this.returnClass); } }
Source:
<code>public CollisionMap defaultCollisions() { final CollisionMap collisionMap = new CollisionMap(); collisionMap.onCollision(Player.class, AbstractObstacle.class, (collider, collidee) -> { if (!AbstractPowerup.isActive(PowerupInvulnerable.class)) { collider.die(); notifyCollide(AbstractObstacle.class); } }); collisionMap.onCollision(Player.class, Log.class, (collider, collidee) -> { if (AbstractPowerup.isActive(PowerupDestroy.class)) { collidee.selfDestruct(); notifyCollide(Log.class); State.addScore(Log.VALUE); <START> return; <END> } if (!AbstractPowerup.isActive(PowerupInvulnerable.class)) { collider.die(); notifyCollide(AbstractObstacle.class); } }); collisionMap.onCollision(Player.class, AbstractPickup.class, (collider, collidee) -> { collidee.doAction(); collidee.selfDestruct(); notifyCollide(collidee.getClass()); }); return collisionMap; }</code><technical_language>is this return statement present here? < review</technical_language>

Target:
public CollisionMap defaultCollisions() { final CollisionMap collisionMap = new CollisionMap(); collisionMap.onCollision(Player.class, AbstractObstacle.class, (collider, collidee) -> { if (!AbstractPowerup.isActive(PowerupInvulnerable.class)) { collider.die(); notifyCollide(AbstractObstacle.class); } }); collisionMap.onCollision(Player.class, Log.class, (collider, collidee) -> { if (AbstractPowerup.isActive(PowerupDestroy.class)) { collidee.selfDestruct(); notifyCollide(Log.class); State.addScore(Log.VALUE); } else if (!AbstractPowerup.isActive( PowerupInvulnerable.class)) { collider.die(); notifyCollide(AbstractObstacle.class); } }); collisionMap.onCollision(Player.class, AbstractPickup.class, (collider, collidee) -> { collidee.doAction(); collidee.selfDestruct(); notifyCollide(collidee.getClass()); }); return collisionMap; }
Source:
<code><START> public void setDebugACRAConfig(SharedPreferences prefs) { <END> setAcraReportingMode(FEEDBACK_REPORT_NEVER); prefs.edit().putString(FEEDBACK_REPORT_KEY, FEEDBACK_REPORT_NEVER).apply(); String logcatArgs = { "-t", "300", "-v", "long", "ACRA:S"}; setAcraConfigBuilder(getAcraCoreConfigBuilder().setLogcatArguments(logcatArgs)); }</code><technical_language>methods private? I in unit test, I deencapsulation feature of testing framework, right? interface of a class changed accommodate a unit test</technical_language>

Target:
private void setDebugACRAConfig(SharedPreferences prefs) { setAcraReportingMode(FEEDBACK_REPORT_NEVER); prefs.edit().putString(FEEDBACK_REPORT_KEY, FEEDBACK_REPORT_NEVER).apply(); String logcatArgs = { "-t", "300", "-v", "long", "ACRA:S"}; setAcraConfigBuilder(getAcraCoreConfigBuilder().setLogcatArguments(logcatArgs)); }