auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void visitMethodInvocation(MethodInvocationTree tree) { IdentifierTree methodIdentifier = null; boolean isInvocationOnSelf = false; ExpressionTree methodSelect = tree.methodSelect(); if (methodSelect.is(Tree.Kind.IDENTIFIER)) { methodIdentifier = (IdentifierTree) methodSelect; isInvocationOnSelf = !isThisOrSuper(methodIdentifier); } else if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) methodSelect; methodIdentifier = memberSelect.identifier(); isInvocationOnSelf = isThis(memberSelect.expression()); } if (isInvocationOnSelf) { Symbol symbol = methodIdentifier.symbol(); <START> if (isOverridableMethod(symbol) && isMethodDefinedOnConstructedType(symbol) &&!isInsideAnonymousClass(methodIdentifier)) { <END> reportIssue(methodIdentifier, "Remove this call from a constructor to the overridable \"" + methodIdentifier.name() + "\" method."); } } super.visitMethodInvocation(tree); }</code><technical_language>is a simpler approach implemented. works perfectly, advantage of ConstuctorBodyVisitor a BaseTreeVisitor. I remove condition added here, require exploring parents in order determine if part of a lambda a new class tree, replace simply overriding tree visitors of lambda newClassTree visitors, skipping analysis: @Override public void visitLambdaExpression(LambdaExpressionTree lambdaExpressionTree) { // skip lambdas } @Override public void visitNewClass(NewClassTree tree) { // skip new class } done, need add extra logic, exploration of trees skipped, avoiding raising FPs in process. rest of code removed</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { IdentifierTree methodIdentifier = null; boolean isInvocationOnSelf = false; ExpressionTree methodSelect = tree.methodSelect(); if (methodSelect.is(Tree.Kind.IDENTIFIER)) { methodIdentifier = (IdentifierTree) methodSelect; isInvocationOnSelf = !isThisOrSuper(methodIdentifier); } else if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) methodSelect; methodIdentifier = memberSelect.identifier(); isInvocationOnSelf = isThis(memberSelect.expression()); } if (isInvocationOnSelf) { Symbol symbol = methodIdentifier.symbol(); if (isOverridableMethod(symbol) && isMethodDefinedOnConstructedType(symbol)) { reportIssue(methodIdentifier, "Remove this call from a constructor to the overridable \"" + methodIdentifier.name() + "\" method."); } } super.visitMethodInvocation(tree); }
Source:
<code>public ConnectorSplitManager getSplitManager() { <START> return (transactionHandle, session, layout, splitSchedulingStrategy, locationBasedScheduler) -> { <END> throw new UnsupportedOperationException(); }; }</code><technical_language>Rename this parameter, consistent</technical_language>

Target:
public ConnectorSplitManager getSplitManager() { return (transactionHandle, session, layout, splitSchedulingContext) -> { throw new UnsupportedOperationException(); }; }
Source:
<code>public static File getDiskCacheDir(Context context, String uniqueName) { final String cachePath; <START> if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) <END> && context.getExternalCacheDir() != null) { cachePath = context.getExternalCacheDir().getPath(); } else { cachePath = context.getCacheDir().getPath(); } return new File(cachePath + File.separator + uniqueName); }</code><technical_language>prefer order Environment.getExternalStorageState() return null get NPE</technical_language>

Target:
public static File getDiskCacheDir(Context context, String uniqueName) { final String cachePath; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) && context.getExternalCacheDir() != null) { cachePath = context.getExternalCacheDir().getPath(); } else { cachePath = context.getCacheDir().getPath(); } return new File(cachePath + File.separator + uniqueName); }
Source:
<code><START> MakeBucketArgs(Builder builder) { <END> this.bucket = new BucketName(builder.bucketName); this.bucketName = builder.bucketName; this.region = builder.region; this.objectLock = builder.objectLock; }</code><technical_language>need newBuilder() method create Builder</technical_language>

Target:
MakeBucketArgs(Builder builder) { super(builder); this.objectLock = builder.objectLock; }
Source:
<code>public void initDefaultContainers(ModelDelta parentDelta) { if (fNesting != null && fNesting.length > 0) { IAdaptable[] emptyCategories = fNesting[0].getCategories(); if (emptyCategories != null) { for (IAdaptable <START> empty : <END> emptyCategories) { BreakpointContainer container = findExistingContainer(fChildContainers, empty); if (container == null) { IBreakpointOrganizer[] siblings = new IBreakpointOrganizer[fNesting.length - 1]; System.arraycopy(fNesting, 1, siblings, 0, siblings.length); container = new BreakpointContainer(this, empty, fNesting[0], fComparator, siblings); insertChildContainer(container); container.fDefaultContainer = true; int size = container.getChildren().length; parentDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.INSTALL|IModelDelta.ADDED|IModelDelta.EXPAND, size); } } } } }</code><technical_language>rename category</technical_language>

Target:
public void initDefaultContainers(ModelDelta parentDelta) { if (fNesting != null && fNesting.length > 0) { IAdaptable[] emptyCategories = fNesting[0].getCategories(); if (emptyCategories != null) { for (IAdaptable category : emptyCategories) { BreakpointContainer container = findExistingContainer(fChildContainers, category); if (container == null) { IBreakpointOrganizer[] siblings = new IBreakpointOrganizer[fNesting.length - 1]; System.arraycopy(fNesting, 1, siblings, 0, siblings.length); container = new BreakpointContainer(this, category, fNesting[0], fComparator, siblings); insertChildContainer(container); container.fDefaultContainer = true; int size = container.getChildren().length; parentDelta.addNode(container, fChildContainers.indexOf(container), IModelDelta.INSTALL|IModelDelta.ADDED|IModelDelta.EXPAND, size); } } } } }
Source:
<code>public Option<Instant> getEnd() { return this.repeat == -1 ? None.instance() : new Some<>(Instant.ofEpochMilli(this.start + this.repeat * this.period + this.duration)); <START> } <END></code><technical_language>A couple notes this: * Compare repeat count TimingWindow.REPEAT_FOREVER instead of -1 is clearer is * If duration == TimingWindow.WINDOW_REMAINS_OPEN_FOREVER (which is -1), end</technical_language>

Target:
public Option<Instant> getEnd() { return repeat == REPEAT_FOREVER || duration == WINDOW_REMAINS_OPEN_FOREVER ? None.instance() : new Some<>(Instant.ofEpochMilli(start + repeat * period + duration)); }
Source:
<code>public static void register() { CapabilityManager.INSTANCE.register(IItemHandler.class, new Capability.IStorage<IItemHandler>() { @Override public NBTBase writeNBT(Capability<IItemHandler> capability, IItemHandler instance, EnumFacing side) { if (!(instance instanceof INBTSerializable)) <START> throw new RuntimeException(); <END> else return ((INBTSerializable) instance).serializeNBT(); } @Override @SuppressWarnings("unchecked") public void readNBT(Capability<IItemHandler> capability, IItemHandler instance, EnumFacing side, NBTBase base) { if (!(instance instanceof INBTSerializable)) throw new RuntimeException(); else ((INBTSerializable) instance).deserializeNBT(base); } }, () -> new ItemHandler(new ItemHolder(1))); }</code><technical_language>illegalargumentexception more clear</technical_language>

Target:
public static void register() { CapabilityManager.INSTANCE.register(IItemHandler.class, new Capability.IStorage<IItemHandler>() { @Override public NBTBase writeNBT(Capability<IItemHandler> capability, IItemHandler instance, EnumFacing side) { if (!(instance instanceof INBTSerializable)) throw new IllegalArgumentException("the IItemHandler must implement INBTSerializable"); else return ((INBTSerializable) instance).serializeNBT(); } @Override @SuppressWarnings("unchecked") public void readNBT(Capability<IItemHandler> capability, IItemHandler instance, EnumFacing side, NBTBase base) { if (!(instance instanceof INBTSerializable)) throw new IllegalArgumentException("the IItemHandler must implement INBTSerializable"); else ((INBTSerializable) instance).deserializeNBT(base); } }, () -> new ItemStackHandler((1))); }
Source:
<code>public void onFailed(Guid cmdId, List<Guid> childCmdIds) { super.onFailed(cmdId, childCmdIds); <START> getCommand().unlockImageInDb(); <END> log.error("Failed extending disk. ID: {}", getDiskId()); updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getCommand().getNewDiskSizeInGB()); getCommand().endAction(); CommandCoordinatorUtil.removeAllCommandsInHierarchy(cmdId); }</code><technical_language>calling this unlock, done in getCommand().endAction();</technical_language>

Target:
public void onFailed(Guid cmdId, List<Guid> childCmdIds) { super.onFailed(cmdId, childCmdIds); log.error("Failed extending disk. ID: {}", getDiskId()); updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getCommand().getNewDiskSizeInGB()); getCommand().endAction(); CommandCoordinatorUtil.removeAllCommandsInHierarchy(cmdId); }
Source:
<code>public Optional<StoredObject> findByKey(@Nullable Tenant tenant, String bucket, String key) { VirtualObject cachedObject = virtualObjectCache.get(key); if (cachedObject != null) { <START> if ((tenant == null || cachedObject.getTenant().is(tenant)) && cachedObject.getBucket().equals(bucket)) { <END> return Optional.of(cachedObject); } return Optional.empty(); } VirtualObject virtualObject = oma.select(VirtualObject.class) .eqIgnoreNull(VirtualObject.TENANT, tenant) .eq(VirtualObject.BUCKET, bucket) .eq(VirtualObject.OBJECT_KEY, key) .queryFirst(); if (virtualObject != null && !virtualObject.isTemporary()) { virtualObjectCache.put(key, virtualObject); } return Optional.ofNullable(virtualObject); }</code><technical_language>checkIntegrity()</technical_language>

Target:
public Optional<StoredObject> findByKey(@Nullable Tenant tenant, String bucket, String key) { VirtualObject cachedObject = virtualObjectCache.get(key); if (cachedObject != null) { if (checkIntegrity(cachedObject, tenant, bucket)) { return Optional.of(cachedObject); } return Optional.empty(); } VirtualObject virtualObject = oma.select(VirtualObject.class) .eqIgnoreNull(VirtualObject.TENANT, tenant) .eq(VirtualObject.BUCKET, bucket) .eq(VirtualObject.OBJECT_KEY, key) .queryFirst(); if (virtualObject != null && !virtualObject.isTemporary()) { virtualObjectCache.put(key, virtualObject); } return Optional.ofNullable(virtualObject); }
Source:
<code>private static void printMetacardData( final CSVPrinter csvPrinter, final Iterator iterator, Metacard metacard) { try { csvPrinter.printRecord(() -> iterator); } catch (IOException ioe) { LOGGER.debug( <START> "Failed to print the CSV data for metacard with id {}: {}", metacard.getId(), ioe); <END> } }</code><technical_language>Remove {}, stack trace printed</technical_language>

Target:
private static void printMetacardData( final CSVPrinter csvPrinter, final Iterator iterator, Metacard metacard) { try { csvPrinter.printRecord(() -> iterator); } catch (IOException ioe) { LOGGER.debug("Failed to print the CSV data for metacard with id: {}", metacard.getId(), ioe); } }
Source:
<code>public TableInputHandler getTableInputHandler(String tableId) { TableInputHandler tableInputHandler = tableInputHandlerMap.get(tableId); if (tableInputHandler == null) { <START> synchronized (this) { tableInputHandler = tableInputHandlerMap.get(tableId); if (tableInputHandler == null) { TableInputHandler newTableInputHandler = constructTableInputHandler(tableId); return newTableInputHandler; } else { return tableInputHandler; } } <END> } else { return tableInputHandler; } }</code><technical_language>optimize this follows? synchronized (this) { tableInputHandler = tableInputHandlerMap.get(tableId); if (tableInputHandler == null) { return constructTableInputHandler(tableId); } return tableInputHandler; }</technical_language>

Target:
public TableInputHandler getTableInputHandler(String tableId) { TableInputHandler tableInputHandler = tableInputHandlerMap.get(tableId); synchronized (this) { if (tableInputHandler == null) { return constructTableInputHandler(tableId); } return tableInputHandler; } }
Source:
<code>public static <T> T getValue(ExpressionTree expression, Function<ExpressionTree,T> resolver) { T value = resolver.apply(expression); if (value == null && expression.is(Tree.Kind.IDENTIFIER)) { ExpressionTree last = ReassignmentFinder.getClosestReassignmentOrDeclarationExpression(expression, ((IdentifierTree) expression).symbol()); <START> value = last == null || !isStrictAssignmentOrDeclaration(last) || last == expression ? null : getValue(last, resolver); <END> } return value; }</code><technical_language>This ternary operator barely readable me. I I prefer a plain if/else</technical_language>

Target:
public static <T> T getValue(ExpressionTree expression, Function<ExpressionTree,T> resolver) { T value = resolver.apply(expression); if (value == null && expression.is(Tree.Kind.IDENTIFIER)) { ExpressionTree last = ReassignmentFinder.getClosestReassignmentOrDeclarationExpression(expression, ((IdentifierTree) expression).symbol()); if (last == null || !isStrictAssignmentOrDeclaration(last) || last == expression) { value = null; } else { value = getValue(last, resolver); } } return value; }
Source:
<code>@Test public void testElementSizeCorruptionCheckNoProblem() throws IOException { QueueFile queueFile = new QueueFile(file); try { queueFile.peek(); } catch (IOException e) { <START> fail("Peek found corruption.", e); <END> } }</code><technical_language>remove try/catch/fail. If exception is thrown fail test</technical_language>

Target:
@Test public void testElementSizeCorruptionCheckNoProblem() throws IOException { QueueFile queueFile = new QueueFile(file); queueFile.peek(); }
Source:
<code>public ParameterValue getDefaultParameterValue() { if (runId != null) { return createValue(runId); } Run<?,?> lastBuild = null; Job project = getProject(); if (project == null) { <START> LOGGER.log(WARNING, "project should not be null when retrieving default parameter value"); <END> return null; } switch (getFilter()) { case COMPLETED: lastBuild = project.getLastCompletedBuild(); break; case SUCCESSFUL: lastBuild = project.getLastSuccessfulBuild(); break; case STABLE : lastBuild = project.getLastStableBuild(); break; default: lastBuild = project.getLastBuild(); break; } if (lastBuild != null) { return createValue(lastBuild.getExternalizableId()); } else { return null; } }</code><technical_language>print stacktrace IMHO. hard track down. E.g. if (project == null) { if (LOOGER.isLoggable(WARNING)) { LOGGER.log(WARNING, "project null retrieving default parameter value", new IllegalStateException()); } return null; }</technical_language>

Target:
public ParameterValue getDefaultParameterValue() { if (runId != null) { return createValue(runId); } Run<?,?> lastBuild = null; Job project = getProject(); if (project == null) { return null; } switch (getFilter()) { case COMPLETED: lastBuild = project.getLastCompletedBuild(); break; case SUCCESSFUL: lastBuild = project.getLastSuccessfulBuild(); break; case STABLE : lastBuild = project.getLastStableBuild(); break; default: lastBuild = project.getLastBuild(); break; } if (lastBuild != null) { return createValue(lastBuild.getExternalizableId()); } else { return null; } }
Source:
<code>private static void replaceIdeaActions() { replaceAction("NewProject", new AndroidNewProjectAction()); replaceAction("WelcomeScreen.CreateNewProject", new AndroidNewProjectAction()); replaceAction("NewModule", new AndroidNewModuleAction()); replaceAction("NewModuleInGroup", new AndroidNewModuleInGroupAction()); replaceAction("ImportProject", new AndroidImportProjectAction()); replaceAction("WelcomeScreen.ImportProject", new AndroidImportProjectAction()); <START> replaceAction("ImportModule", new AndroidActionRemover("Import Module...", new ImportModuleAction())); <END> replaceAction("MakeModule", new AndroidActionRemover("Make Module", new MakeModuleAction())); replaceAction("Compile", new AndroidActionRemover("Compile", new CompileAction())); replaceAction("GenerateAntBuild", new AndroidActionRemover("Generate Ant Build...", new GenerateAntBuildAction())); }</code><technical_language>Inlining text risky. I some of actions change text dynamically (for example, I Compile show name of file compiled a file is active). pass label of action here, in update(Presentation) method, do a presentation.setText(myDelegate.getText())</technical_language>

Target:
private static void replaceIdeaActions() { replaceAction("NewProject", new AndroidNewProjectAction()); replaceAction("WelcomeScreen.CreateNewProject", new AndroidNewProjectAction()); replaceAction("NewModule", new AndroidNewModuleAction()); replaceAction("NewModuleInGroup", new AndroidNewModuleInGroupAction()); replaceAction("ImportProject", new AndroidImportProjectAction()); replaceAction("WelcomeScreen.ImportProject", new AndroidImportProjectAction()); replaceAction("ImportModule", new AndroidActionRemover(new ImportModuleAction(), "Import Module...")); replaceAction("MakeModule", new AndroidActionRemover(new MakeModuleAction(), "Make Module")); replaceAction("Compile", new AndroidActionRemover(new CompileAction(), "Compile")); replaceAction("GenerateAntBuild", new AndroidActionRemover(new GenerateAntBuildAction(), "Generate Ant Build...")); }
Source:
<code><START> private boolean isApiProduct(Object object) { try { APIProduct apiProduct = (APIProduct) object; return (apiProduct != null) ? true : false; } catch (Exception e) { return false; <END> } }</code><technical_language>instanceOf? Also, catch generic "Exception"s is a specific need</technical_language>

Target:
private boolean isApiProduct(Object object) { return (object) instanceof APIProduct; }
Source:
<code>public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { OpenShiftServerBehaviour beh = getOpenShiftServerBehaviour(configuration); IServer server = beh.getServer(); launch.addProcess(new ServerProcess(launch, server, getLabel(launch.getLaunchMode()))); beh.setServerStarting(); waitForDeploymentConfigAndPods(server, monitor); <START> enableDevModeForNodeJsProject(OpenShiftServerUtils.getDeploymentConfig(server), server); <END> try { IReplicationController rc = OpenShiftServerUtils.getReplicationController(server); toggleDebugging(mode, monitor, beh, server, rc); } catch (CoreException e) { beh.setServerStopped(); throw e; } }</code><technical_language>if server is a DC RC</technical_language>

Target:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { OpenShiftServerBehaviour beh = getOpenShiftServerBehaviour(configuration); IServer server = beh.getServer(); launch.addProcess(new ServerProcess(launch, server, getLabel(launch.getLaunchMode()))); beh.setServerStarting(); waitForDeploymentConfigAndPods(server, monitor); enableDevModeForNodeJsProject(OpenShiftServerUtils.getReplicationController(server), server); try { IReplicationController rc = OpenShiftServerUtils.getReplicationController(server); toggleDebugging(mode, monitor, beh, server, rc); } catch (CoreException e) { beh.setServerStopped(); throw e; } }
Source:
<code>public void putAlias(String alias, List<String> jobs) { mapLock.lock(); try { alias2jobs.put(alias, jobs); job2alias.put(jobs.get(0), alias); StringWriter sw = new StringWriter(); <START> mapper.writeValue(sw, jobs); <END> spawnDataStore.putAsChild(ALIAS_PATH, alias, sw.toString()); } catch (Exception e) { log.warn("failed to put alias: {}", alias, e); throw Throwables.propagate(e); } finally { mapLock.unlock(); } }</code><technical_language>If writeValueAsString(jobs) wont need a StringWriter</technical_language>

Target:
public void putAlias(String alias, List<String> jobs) { mapLock.lock(); try { alias2jobs.put(alias, jobs); job2alias.put(jobs.get(0), alias); spawnDataStore.putAsChild(ALIAS_PATH, alias, mapper.writeValueAsString(jobs)); } catch (Exception e) { log.warn("failed to put alias: {}", alias, e); throw Throwables.propagate(e); } finally { mapLock.unlock(); } }
Source:
<code>public IgniteTestResources(IgniteLogger log) throws IgniteCheckedException { assert log != null; this.log = log.getLogger(getClass()); <START> jmx = prepareMBeanServer(); <END> ctx = new GridTestKernalContext(log); rsrcProc = new GridResourceProcessor(ctx); }</code><technical_language>this change</technical_language>

Target:
public IgniteTestResources(IgniteLogger log) throws IgniteCheckedException { assert log != null; this.log = log.getLogger(getClass()); this.jmx = prepareMBeanServer(); this.ctx = new GridTestKernalContext(log); this.rsrcProc = new GridResourceProcessor(ctx); }
Source:
<code>protected void storeDialog(IDialogSettings settings) { super.storeDialog(settings); settings.put(SHOW_DERIVED, showDerivedResourcesAction.isChecked()); <START> if (groupResourcesByLocationAction.didRun()) <END> { settings.put(FILTER_BY_LOCATION, this.groupResourcesByLocationAction.isChecked()); } XMLMemento memento = XMLMemento.createWriteRoot("workingSet"); workingSetFilterActionGroup.saveState(memento); workingSetFilterActionGroup.dispose(); StringWriter writer = new StringWriter(); try { memento.save(writer); settings.put(WORKINGS_SET_SETTINGS, writer.getBuffer().toString()); } catch (IOException e) { StatusManager.getManager() .handle(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "", e)); } }</code><technical_language>This is unexpected least. I remember code save part of settings conditionally, depending UI triggered user before</technical_language>

Target:
protected void storeDialog(IDialogSettings settings) { super.storeDialog(settings); settings.put(SHOW_DERIVED, showDerivedResourcesAction.isChecked()); settings.put(FILTER_BY_LOCATION, this.groupResourcesByLocationAction.isChecked()); XMLMemento memento = XMLMemento.createWriteRoot("workingSet"); workingSetFilterActionGroup.saveState(memento); workingSetFilterActionGroup.dispose(); StringWriter writer = new StringWriter(); try { memento.save(writer); settings.put(WORKINGS_SET_SETTINGS, writer.getBuffer().toString()); } catch (IOException e) { StatusManager.getManager() .handle(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "", e)); } }
Source:
<code>public AbstractLunRemoveColumn(SanStorageModelBase model) { super(new AbstractToggleButtonCell<LunModel>() { @Override public void onClickEvent(LunModel lunModel) { if (lunModel != null && !model.getMetadataDevices().contains(lunModel.getLunId())) { lunModel.setRemoveLunSelected(!lunModel.isRemoveLunSelected()); } } @Override public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { <START> String inputId = id + "_input"; SafeHtml input; <END> boolean lastLunAvailable = false; if (model.getMetadataDevices().size() == 0) { lastLunAvailable = model.getNumOfLUNsToRemove() == model.getItems().size() - 1; } model.getRequireTableRefresh().setEntity(lastLunAvailable); if (model.getMetadataDevices().contains(value.getLunId()) || model.getSelectedLuns().size() == 1 || lastLunAvailable) { input = templates.disabled(inputId, constants.notAvailableLabel()); } else if (value.isRemoveLunSelected()) { input = templates.toggledDown(inputId, "Remove"); } else { input = templates.toggledUp(inputId, "Remove"); } sb.append(templates.span(id, input)); } }); }</code><technical_language>move line 35 (before if)</technical_language>

Target:
public AbstractLunRemoveColumn(SanStorageModelBase model) { super(new AbstractToggleButtonCell<LunModel>() { @Override public void onClickEvent(LunModel lunModel) { if (lunModel != null && !model.getMetadataDevices().contains(lunModel.getLunId())) { lunModel.setRemoveLunSelected(!lunModel.isRemoveLunSelected()); } } @Override public void render(Context context, LunModel value, SafeHtmlBuilder sb, String id) { String inputId = id + "_input"; SafeHtml input; boolean lastLunAvailable = false; if (model.getMetadataDevices().size() == 0) { lastLunAvailable = model.getNumOfLUNsToRemove() == model.getItems().size() - 1; } model.getRequireTableRefresh().setEntity(lastLunAvailable); if (model.getMetadataDevices().contains(value.getLunId()) || model.getSelectedLuns().size() == 1 || lastLunAvailable) { input = templates.disabled(inputId, uiConstants.notAvailableLabel()); } else if (value.isRemoveLunSelected()) { input = templates.toggledDown(inputId, constants.removeSanStorage()); } else { input = templates.toggledUp(inputId, constants.removeSanStorage()); } sb.append(templates.span(id, input)); } }); }
Source:
<code>public void whitelistSanity() throws Exception { try (InputStream is = ClassFilterImpl.class.getResourceAsStream("whitelisted-classes.txt")) { <START> List<String> lines = IOUtils.readLines(is); <END> assertThat("whitelist is ordered", new TreeSet<>(lines), contains(lines.toArray(new String[0]))); for (String line : lines) { try { Class.forName(line); } catch (ClassNotFoundException x) { System.err.println("skipping checks of unknown class " + line); } } } }</code><technical_language>readLines(InputStream) platform default charset UTF-8. this test platform dependant</technical_language>

Target:
public void whitelistSanity() throws Exception { try (InputStream is = ClassFilterImpl.class.getResourceAsStream("whitelisted-classes.txt")) { List<String> lines = IOUtils.readLines(is, StandardCharsets.UTF_8).stream().filter(line -> !line.matches("#.*|\\s*")).collect(Collectors.toList()); assertThat("whitelist is ordered", new TreeSet<>(lines), contains(lines.toArray(new String[0]))); for (String line : lines) { try { Class.forName(line); } catch (ClassNotFoundException x) { System.err.println("skipping checks of unknown class " + line); } } } }
Source:
<code>private PrestoThriftService openClient(PrestoThriftSplit split) { if (split.getHosts().isEmpty()) { return client.get(thriftHeader); } <START> return client.get(Optional.of(split.getHosts().stream() <END> .map(host -> host.toHostAddress().toString()) .collect(joining(","))), thriftHeader); }</code><technical_language>extract a variable hosts for parameter</technical_language>

Target:
private PrestoThriftService openClient(PrestoThriftSplit split) { if (split.getHosts().isEmpty()) { return client.get(thriftHeaders); } String hosts = split.getHosts().stream() .map(host -> host.toHostAddress().toString()) .collect(joining(",")); return client.get(Optional.of(hosts), thriftHeaders); }
Source:
<code>public void testLoadCommodityCodeFile() { byte[] content = commodityCodeUpdateService.getFileContent(DATA_FILE_PATH); ArrayList<CommodityCode> someCommodityCodes = (ArrayList<CommodityCode>) commodityCodeUpdateService.parseCommodityCodeList(content); <START> assertNotSame(content.length, 0); <END> assertEquals(NUMBER_OF_RECORDS_IN_DATA_FILE, someCommodityCodes.size()); }</code><technical_language>this test "assertNotSame"? I a "object1 != object2" check instead of a "!object1.equals(object2)" check. (Note "assertNotSame" Object-comparing variants, primitives "boxed" prior comparsion.) "assertNotEquals" instead</technical_language>

Target:
public void testLoadCommodityCodeFile() { assertTrue(commodityCodeUpdateService.loadCommodityCodeFile(DATA_FILE_PATH)); }
Source:
<code>public void clearAddressOnInterfaceChange() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setDiskInterface(DiskInterface.VirtIO_SCSI); when(diskDao.get(diskImageGuid)).thenAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { final DiskImage oldDisk = createDiskImage(); oldDisk.setDiskInterface(DiskInterface.VirtIO); assertNotSame (oldDisk.getDiskInterface(), parameters.getDiskInfo().getDiskInterface()); return oldDisk; } }); initializeCommand(parameters); <START> VmDevice device = createVmDevice(diskImageGuid, vmId); <END> command.executeVmCommand(); verify(vmDeviceDAO, times(1)).clearDeviceAddress(device.getDeviceId()); }</code><technical_language>remove this statement now? device unused</technical_language>

Target:
public void clearAddressOnInterfaceChange() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setDiskInterface(DiskInterface.VirtIO_SCSI); when(diskDao.get(diskImageGuid)).thenAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocationOnMock) throws Throwable { final DiskImage oldDisk = createDiskImage(); oldDisk.setDiskInterface(DiskInterface.VirtIO); assertNotSame (oldDisk.getDiskInterface(), parameters.getDiskInfo().getDiskInterface()); return oldDisk; } }); initializeCommand(parameters); command.executeVmCommand(); verify(vmDeviceDAO).clearDeviceAddress(diskImageGuid); }
Source:
<code>private static boolean hasCaption(TagNode node) { if (node.getChildren().stream().anyMatch(TableWithoutCaptionCheck::isCaption)) { return true; } else { <START> return node.getChildren().stream().filter(child -> !isTable(child)).anyMatch(TableWithoutCaptionCheck::hasCaption); <END> } }</code><technical_language>[html spec](<LINK_0> child of <table> element. need recurse children. (you update RSPEC of rule this)</technical_language>

Target:
private static boolean hasCaption(TagNode node) { return !node.getChildren().isEmpty() && isCaption(node.getChildren().get(0)); }
Source:
<code>FileExtensionFilter(String ext) { <START> extension = "."+ext; <END> }</code><technical_language>Do need "." (dot)? if files extension</technical_language>

Target:
FileExtensionFilter(String ext) { extension = ext; }
Source:
<code>public void define(NewController context) { NewAction action = context.createAction("add_user") .setDescription(format("Add a user to a group.<br />" + "'%s' or '%s' must be provided.<br />" + "Requires the following permission: 'Administer System'.", PARAM_GROUP_ID, PARAM_GROUP_NAME)) .setHandler(this) .setPost(true) .setSince("5.2") <START> .setChangelog(new Change("6.4", "It's no more possible to add a user to the default group")); <END> defineGroupWsParameters(action); defineLoginWsParameter(action); }</code><technical_language>more -> longer</technical_language>

Target:
public void define(NewController context) { NewAction action = context.createAction("add_user") .setDescription(format("Add a user to a group.<br />" + "'%s' or '%s' must be provided.<br />" + "Requires the following permission: 'Administer System'.", PARAM_GROUP_ID, PARAM_GROUP_NAME)) .setHandler(this) .setPost(true) .setSince("5.2") .setChangelog(new Change("6.4", "It's no longer possible to add a user to the default group")); defineGroupWsParameters(action); defineLoginWsParameter(action); }
Source:
<code>public ClusterTopology getClusterTopology(String clusterName) { Map<String, InstanceConfig> instanceConfigMap = new HashMap<>(); String path = PropertyPathBuilder.instanceConfig(clusterName); BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<>(_zkClient); List<ZNRecord> znRecords = baseAccessor.getChildren(path, null, 0, 0, 0); for (ZNRecord record : znRecords) { if (record != null) { InstanceConfig instanceConfig = new InstanceConfig(record); instanceConfigMap.put(instanceConfig.getInstanceName(), instanceConfig); } } HelixDataAccessor accessor = <START> new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient)); <END> PropertyKey.Builder keyBuilder = accessor.keyBuilder(); List<LiveInstance> liveInstances = accessor.getChildValues(keyBuilder.liveInstances(), true); List<String> liveNodes = new ArrayList<>(); liveInstances.forEach(liveInstance -> liveNodes.add(liveInstance.getInstanceName())); ConfigAccessor configAccessor = new ConfigAccessor(_zkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(clusterName); return new ClusterTopology(liveNodes, instanceConfigMap, clusterConfig); }</code><technical_language>need 2 ZkBaseDataAccessors here</technical_language>

Target:
public ClusterTopology getClusterTopology(String clusterName) { Map<String, InstanceConfig> instanceConfigMap = new HashMap<>(); String path = PropertyPathBuilder.instanceConfig(clusterName); BaseDataAccessor<ZNRecord> baseAccessor = new ZkBaseDataAccessor<>(_zkClient); List<ZNRecord> znRecords = baseAccessor.getChildren(path, null, 0, 0, 0); for (ZNRecord record : znRecords) { if (record != null) { InstanceConfig instanceConfig = new InstanceConfig(record); instanceConfigMap.put(instanceConfig.getInstanceName(), instanceConfig); } } path = PropertyPathBuilder.liveInstance(clusterName); List<String> liveNodes = baseAccessor.getChildNames(path, 0); ConfigAccessor configAccessor = new ConfigAccessor(_zkClient); ClusterConfig clusterConfig = configAccessor.getClusterConfig(clusterName); return new ClusterTopology(liveNodes, instanceConfigMap, clusterConfig); }
Source:
<code>public SingularMatrixException(){ <START> super("Singular matrix expected."); <END> }</code><technical_language>This "Regular (or non-singular) matrix expected."</technical_language>

Target:
public SingularMatrixException() { super("Regular (or non-singular) matrix expected."); }
Source:
<code><START> private void appendRemarks(MutableColumn column, String remarks) { <END> final String existingRemarks = column.getRemarks(); if (existingRemarks == null) { column.setRemarks(remarks); } else { column.setRemarks(existingRemarks + ", " + remarks); } }</code><technical_language>static, if blind</technical_language>

Target:
private static void appendRemarks(MutableColumn column, String remarks) { final String existingRemarks = column.getRemarks(); if (existingRemarks == null) { column.setRemarks(remarks); } else { column.setRemarks(existingRemarks + ", " + remarks); } }
Source:
<code>protected void handleJSON(HttpServletRequest request, HttpServletResponse response, JSONObject json) throws IOException { List<ScoreBoardJSONSetter.JSONSet> jsl = new ArrayList<ScoreBoardJSONSetter.JSONSet>(); JSONObject state = json.getJSONObject("state"); Flag flag = null; if (request.getPathInfo().equalsIgnoreCase("/load")) { <START> flag = Flag.FROM_AUTOSAVE; <END> } for (String key: state.keySet()) { Object value = state.get(key); String v; if (value == JSONObject.NULL) { v = null; } else { v = value.toString(); } jsl.add(new ScoreBoardJSONSetter.JSONSet(key, v, flag)); } if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, jsl); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { ScoreBoardJSONSetter.set(scoreBoard, jsl); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }</code><technical_language>This set for merge well. (The fact set for merging XML files is a bug .)</technical_language>

Target:
protected void handleJSON(HttpServletRequest request, HttpServletResponse response, JSONObject json) throws IOException { List<ScoreBoardJSONSetter.JSONSet> jsl = new ArrayList<>(); JSONObject state = json.getJSONObject("state"); for (String key: state.keySet()) { Object value = state.get(key); String v; if (value == JSONObject.NULL) { v = null; } else { v = value.toString(); } jsl.add(new ScoreBoardJSONSetter.JSONSet(key, v, Flag.FROM_AUTOSAVE)); } if (request.getPathInfo().equalsIgnoreCase("/load")) { scoreBoard.reset(); ScoreBoardJSONSetter.set(scoreBoard, jsl); } else if (request.getPathInfo().equalsIgnoreCase("/merge")) { ScoreBoardJSONSetter.set(scoreBoard, jsl); } else { response.sendError(HttpServletResponse.SC_NOT_FOUND, "Must specify to load or merge"); } response.setContentType("text/plain"); response.setStatus(HttpServletResponse.SC_OK); }
Source:
<code>public void testRemoveWebMessageListenerBasicUsage() throws Exception { WebkitUtils.checkFeature(WebViewFeature.WEB_MESSAGE_LISTENER); mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.removeWebMessageListener(JS_OBJECT_NAME); Assert.assertEquals("\"object\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); mWebViewOnUiThread.evaluateJavascript(JS_OBJECT_NAME + ".postMessage('hello2')", null); <START> Assert.assertTrue(mListener.hasNoMoreOnPostMessage()); <END> loadPage(BASIC_USAGE); Assert.assertEquals("\"undefined\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); }</code><technical_language>Supposing postMessage *would* plumb java, a good chance lose this race (the assert run event is visible java side). need evaluateJavascriptSync(), if enough guarantee lose race</technical_language>

Target:
public void testRemoveWebMessageListenerBasicUsage() throws Exception { mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.removeWebMessageListener(JS_OBJECT_NAME); Assert.assertEquals("\"object\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); mWebViewOnUiThread.evaluateJavascriptSync(JS_OBJECT_NAME + ".postMessage('hello2')"); Assert.assertTrue(mListener.hasNoMoreOnPostMessage()); loadPage(BASIC_USAGE); Assert.assertEquals("\"undefined\"", mWebViewOnUiThread.evaluateJavascriptSync("typeof " + JS_OBJECT_NAME + ";")); }
Source:
<code>public void handleChildChange(String parentPath, List<String> currentChildren) { if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } <START> LOG.debug("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); <END> LOG.debug("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.getZkClient().writeData(barrierDonePath, State.DONE); zkUtils.getZkClient().unsubscribeChildChanges(barrierDonePath, this); } }</code><technical_language>Please leave info for now. I is a lot of logging, is other debug now, for logs</technical_language>

Target:
public void handleChildChange(String parentPath, List<String> currentChildren) { if (currentChildren == null) { LOG.info("Got ZkBarrierChangeHandler handleChildChange with null currentChildren"); return; } LOG.info("list of children in the barrier = " + parentPath + ":" + Arrays.toString(currentChildren.toArray())); LOG.info("list of children to compare against = " + parentPath + ":" + Arrays.toString(names.toArray())); if (currentChildren.size() == names.size() && CollectionUtils.containsAll(currentChildren, names)) { String barrierDonePath = keyBuilder.getBarrierStatePath(barrierVersion); LOG.info("Writing BARRIER DONE to " + barrierDonePath); zkUtils.getZkClient().writeData(barrierDonePath, State.DONE); zkUtils.getZkClient().unsubscribeChildChanges(barrierDonePath, this); } }
Source:
<code>public static void tearDown() throws IOException { <START> if (socketFile != null && socketFile.exists()) { if (!socketFile.delete()) { String message = "Unable to delete file " + socketFile + "."; throw new IOException(message); } <END> } }</code><technical_language>This removal weird, throwing IOE checking this much. I checked other tests, of do : new File(socketFile).delete(); FileUtils.delete(..), check TestConfiguration.java for reference</technical_language>

Target:
public static void tearDown() throws IOException { if (testRoot != null) { FileUtils.deleteDirectory(testRoot); } }
Source:
<code>public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { VectorSource vectorSource = new VectorSource("population", "mapbox://peterqliu.d0vin3el"); <START> mapboxMap.getStyle().addSource(vectorSource); <END> addFillsLayer(); addExtrusionsLayer(); } }); }</code><technical_language>style provided callback instead</technical_language>

Target:
public void onMapReady(@NonNull final MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(Style.DARK, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource( new VectorSource("population", "mapbox://peterqliu.d0vin3el") ); addFillsLayer(style); addExtrusionsLayer(style); } }); }
Source:
<code>public void copy_shouldCopyAllFields() throws Exception { <START> assertThatAllFieldsAreCopied(new Order(), null, "orderGroup", "sortWeight"); <END> assertThatAllFieldsAreCopied(new TestOrder(), null, "orderGroup", "sortWeight"); }</code><technical_language>This needs undone</technical_language>

Target:
public void copy_shouldCopyAllFields() throws Exception { assertThatAllFieldsAreCopied(new Order(), null); assertThatAllFieldsAreCopied(new TestOrder(), null); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + sessionId.hashCode(); <START> result = prime * result + allowedValues.hashCode(); <END> result = prime * result + super.hashCode(); return result; }</code><technical_language>remove</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + sessionId.hashCode(); result = prime * result + super.hashCode(); return result; }
Source:
<code>public void setRelatedAlarms(Set<OnmsAlarm> alarms) { <START> this.m_relatedAlarms = alarms; <END> }</code><technical_language>Nit: this. is redundant a variable prefixed m_</technical_language>

Target:
public void setRelatedAlarms(Set<OnmsAlarm> alarms) { m_relatedAlarms = alarms; }
Source:
<code>private TextPainter buildWikiTextPainter(final Rectangle bounds, final boolean modulateWidth) throws InstantiationException, IllegalAccessException, ClassNotFoundException { final int width = bounds.width; final TextPainter painter = new TextPainter(this) .setTokenizer(TextTokenizerFactory.createTextTokenizer(TextTokenizerType.WIKI)) .setText( <START> "'''Lorem ipsum''' dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut... " <END> + "''Italic Text,'' '''Bold Text,''' and " + "'''''Bold and Italic Text'''''" + " naked url: <LINK_4>" + " wiki url: [<LINK_0> ReadyTalk]" + " url: [<LINK_0>]") .setDrawCalculatedBounds(false) .setClipping(true) .setBounds(bounds) .setDrawBounds(false) .addNavigationListener(new NavigationListener() { @Override public void navigate(NavigationEvent event) { System.out.println("Navigate to: " + event.getUrl()); } }); if (modulateWidth) { timer.scheduleAtFixedRate(new TimerTask() { double counter = 0.0; @Override public void run() { counter += 0.01; int w = (int) (width * Math.sin(counter)) + width * 2; bounds.width = w; painter.setBounds(bounds); Display.getDefault().syncExec(new Runnable() { public void run() { if (!isDisposed()) { redraw(); } } }); } }, 0, 40); } return painter; }</code><technical_language>[hipster ipsum](<LINK_2> kidding (kinda)..</technical_language>

Target:
private TextPainter buildWikiTextPainter(final Rectangle bounds, final boolean modulateWidth) throws InstantiationException, IllegalAccessException, ClassNotFoundException { final int width = bounds.width; final TextPainter painter = new TextPainter(this) .setTokenizer(TextTokenizerFactory.createTextTokenizer(TextTokenizerType.WIKI)) .setText( "''Williamsburg biodiesel cornhole tote bag. Butcher mlkshk Tumblr, Pinterest sweater'' " + "'''pickled pop-up. Deep v tattooed forage pickled tofu.''' " + "'''''Gastropub post-ironic Banksy, Vice swag Tumblr gentrify street''''' " + "drinking. Skateboard, [<LINK_1> Austin] Helvetica hoodie " + "distillery Cray. Meh scenester <LINK_5> mixtape " + "Etsy McSweeney's slow-carb [<LINK_3> Shoreditch]. Gluten-free pickled pug.") .setDrawCalculatedBounds(false) .setClipping(true) .setBounds(bounds) .setDrawBounds(false) .addNavigationListener(new NavigationListener() { @Override public void navigate(NavigationEvent event) { System.out.println("Navigate to: " + event.getUrl()); } }); if (modulateWidth) { timer.scheduleAtFixedRate(new TimerTask() { double counter = 0.0; @Override public void run() { counter += 0.01; int w = (int) (width * Math.sin(counter)) + width * 2; bounds.width = w; painter.setBounds(bounds); Display.getDefault().syncExec(new Runnable() { public void run() { if (!isDisposed()) { redraw(); } } }); } }, 0, 40); } return painter; }
Source:
<code>public void test_xor() throws Exception { int[] opcodes = new int[] {Opcodes.IXOR, Opcodes.LXOR}; long start = System.currentTimeMillis(); assertBinarySymbolicValue(opcodes, SymbolicValue.XorSymbolicValue.class); long end1 = System.currentTimeMillis(); System.out.println("test_xor = "+(end1-start)); assertThrowWhenInvalidStack(opcodes, " needs 2 values on stack"); long end2 = System.currentTimeMillis(); <START> System.out.println("test_xor2 = "+(end2-end1)); <END> }</code><technical_language>this println calls removed imo</technical_language>

Target:
public void test_xor() throws Exception { int[] opcodes = new int[] {Opcodes.IXOR, Opcodes.LXOR}; assertBinarySymbolicValue(opcodes, SymbolicValue.XorSymbolicValue.class); assertThrowWhenInvalidStack(opcodes, " needs 2 values on stack"); }
Source:
<code>public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) { return true; } <START> if (capability != null && (capability == MJ_CONN || capability == MJ_RECV)) { <END> return true; } return super.hasCapability(capability, facing); }</code><technical_language>need check for null</technical_language>

Target:
public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) { if (capability == CapabilityEnergy.ENERGY) { return true; } if (capability == MJ_CONN || capability == MJ_RECV) { return true; } return super.hasCapability(capability, facing); }
Source:
<code>private boolean addImageTicketToDaemon(Guid imagedTicketId, String imagePath) { if (getParameters().getTransferType() == TransferType.Upload && !setVolumeLegalityInStorage(ILLEGAL_IMAGE)) { return false; } int timeout = getClientTicketLifetime(); String[] transferOps = new String[] {getParameters().getTransferType().getAllowedOperation()}; AddImageTicketVDSCommandParameters transferCommandParams = new AddImageTicketVDSCommandParameters(getVdsId(), imagedTicketId, getParameters().getCommandId(), transferOps, timeout, getParameters().getTransferSize(), imagePath, getParameters().getDownloadFilename(), isSparseImage(), <START> isDirtyExtents()); <END> VDSReturnValue vdsRetVal; try { vdsRetVal = vdsBroker.runVdsCommand(VDSCommandType.AddImageTicket, transferCommandParams); } catch (RuntimeException e) { log.error("Failed to start image transfer session: {}", e.getMessage(), e); return false; } if (!vdsRetVal.getSucceeded()) { log.error("Failed to start image transfer session"); return false; } log.info("Started transfer session with ticket id {}, timeout seconds", imagedTicketId.toString(), timeout); return true; }</code><technical_language>meaning of ticket.dirty is "ticket supports querying dirty extents". maybe: supportsDirtyExtents()</technical_language>

Target:
private boolean addImageTicketToDaemon(Guid imagedTicketId, String imagePath) { if (getParameters().getTransferType() == TransferType.Upload && !setVolumeLegalityInStorage(ILLEGAL_IMAGE)) { return false; } int timeout = getClientTicketLifetime(); String[] transferOps = new String[] {getParameters().getTransferType().getAllowedOperation()}; AddImageTicketVDSCommandParameters transferCommandParams = new AddImageTicketVDSCommandParameters(getVdsId(), imagedTicketId, getParameters().getCommandId(), transferOps, timeout, getParameters().getTransferSize(), imagePath, getParameters().getDownloadFilename(), isSparseImage(), isSupportsDirtyExtents()); VDSReturnValue vdsRetVal; try { vdsRetVal = vdsBroker.runVdsCommand(VDSCommandType.AddImageTicket, transferCommandParams); } catch (RuntimeException e) { log.error("Failed to start image transfer session: {}", e.getMessage(), e); return false; } if (!vdsRetVal.getSucceeded()) { log.error("Failed to start image transfer session"); return false; } log.info("Started transfer session with ticket id {}, timeout seconds", imagedTicketId.toString(), timeout); return true; }