auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void writeFeatures() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } boolean acpiEnabled = vm.getAcpiEnable(); boolean kaslrEnabled = vmInfoBuildUtils.isKASLRDumpEnabled(vm.getVmOsId()); boolean secureBootEnabled = vm.getBiosType() == BiosType.Q35_SECURE_BOOT; if (!acpiEnabled && !hypervEnabled && !kaslrEnabled && !secureBootEnabled) { return; } writer.writeStartElement("features"); if (acpiEnabled) { writer.writeElement("acpi"); } if (hypervEnabled) { writer.writeStartElement("hyperv"); writer.writeStartElement("relaxed"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("vapic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("spinlocks"); writer.writeAttributeString("state", "on"); writer.writeAttributeString("retries", "8191"); writer.writeEndElement(); Version version = vm.getCompatibilityVersion(); if (version.getMajor() == 4 && version.getMinor() >= 3) { writer.writeStartElement("synic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("stimer"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); } if (kaslrEnabled) { writer.writeElement("vmcoreinfo"); } if (secureBootEnabled) { writer.writeStartElement("smm"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); }

Target:
private void writeFeatures() { if (vm.getClusterArch().getFamily() != ArchitectureType.x86) { return; } boolean acpiEnabled = vm.getAcpiEnable(); boolean kaslrEnabled = vmInfoBuildUtils.isKASLRDumpEnabled(vm.getVmOsId()); boolean secureBootEnabled = vm.getBiosType() == BiosType.Q35_SECURE_BOOT; if (!acpiEnabled && !hypervEnabled && !kaslrEnabled && !secureBootEnabled) { return; } writer.writeStartElement("features"); if (acpiEnabled) { writer.writeElement("acpi"); } if (hypervEnabled) { writer.writeStartElement("hyperv"); writer.writeStartElement("relaxed"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("vapic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("spinlocks"); writer.writeAttributeString("state", "on"); writer.writeAttributeString("retries", "8191"); writer.writeEndElement(); if (vm.getCompatibilityVersion().greaterOrEquals(Version.v4_3)) { writer.writeStartElement("synic"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); writer.writeStartElement("stimer"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); } if (kaslrEnabled) { writer.writeElement("vmcoreinfo"); } if (secureBootEnabled) { writer.writeStartElement("smm"); writer.writeAttributeString("state", "on"); writer.writeEndElement(); } writer.writeEndElement(); }
Source:
public MutableMessageHeaders(@Nullable Map<String, Object> headers) { super(headers, null, headers != null ? (Long) headers.get(MessageHeaders.TIMESTAMP) : null); if (headers!=null && headers.containsKey(MessageHeaders.ID)) { Object uuid = headers.get(MessageHeaders.ID); if (uuid instanceof String) { this.put(MessageHeaders.ID, UUID.fromString((String) uuid)); } else { this.put(MessageHeaders.ID, (UUID) uuid); } } }

Target:
public MutableMessageHeaders(@Nullable Map<String, Object> headers) { super(headers, MutableMessageHeaders.extractId(headers), MutableMessageHeaders.extractTimestamp(headers)); }
Source:
public List<DataPartition> findMatchingPartitions(FileFilter filter) throws HpccFileException { createDataParts(); List<DataPartition> matchedPartitions = this.partitionProcessor.findMatchingPartitions(filter); for (DataPartition partition : matchedPartitions) { partition.setFilter(filter); } return matchedPartitions; }

Target:
public List<DataPartition> findMatchingPartitions(FileFilter filter) throws HpccFileException { createDataParts(); List<DataPartition> matchedPartitions = this.partitionProcessor.findMatchingPartitions(filter); return matchedPartitions; }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitCallExpr(@NotNull GoCallExpr o) { PsiReference psiReference = o.getExpression().getReference(); PsiElement resolved = psiReference != null ? psiReference.resolve() : null; if (!(resolved instanceof GoFunctionOrMethodDeclaration)) return; String functionName = ((GoFunctionOrMethodDeclaration)resolved).getName(); if (functionName == null) return; functionName = StringUtil.toLowerCase(functionName); GoPlaceholderChecker checker = new GoPlaceholderChecker(holder, o, (GoFunctionOrMethodDeclaration)resolved); if (FORMATTING_FUNCTIONS.containsKey(functionName)) { checker.checkPrintf(); } else if (PRINT_FUNCTIONS.contains(functionName)) { checker.checkPrint(); } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitCallExpr(@NotNull GoCallExpr o) { PsiReference psiReference = o.getExpression().getReference(); PsiElement resolved = psiReference != null ? psiReference.resolve() : null; if (!(resolved instanceof GoFunctionOrMethodDeclaration)) return; String functionName = StringUtil.toLowerCase(((GoFunctionOrMethodDeclaration)resolved).getName()); if (functionName == null) return; if (GoPlaceholderChecker.isFormattingFunction(functionName)) { checkPrintf(holder, o, (GoFunctionOrMethodDeclaration)resolved); } else if (GoPlaceholderChecker.isPrintingFunction(functionName)) { checkPrint(holder, o, (GoFunctionOrMethodDeclaration)resolved); } } }; }
Source:
private void removeFromCache(Set<IResource> toRemove) { Set<IContainer> dirtyLeafContainers = new HashSet<>(); for (IResource resource : toRemove) { final IContainer initialContainer = resource instanceof IContainer ? (IContainer) resource : resource.getParent(); dirtyLeafContainers .removeIf(leafContainer -> leafContainer.getLocation().isPrefixOf(initialContainer.getLocation())); if (dirtyLeafContainers.stream().noneMatch( leafContainer -> initialContainer.getLocation().isPrefixOf(leafContainer.getLocation()))) { dirtyLeafContainers.add(initialContainer); } if (resource.getType() == IResource.FILE) { cache.remove(resource); modifiedSeveritySinceLastRun.add(resource); } IContainer container = initialContainer; while (container != null && cache.containsKey(container)) { cache.remove(container); modifiedSeveritySinceLastRun.add(container); container = getParentInView(container); } } dirtyLeafContainers.forEach(leafContainer -> { IContainer container = leafContainer; while (container != null) { int severity = getMaxChildrenSeverityInCache(container); if (severity >= 0) { propagateSeverityToCache(container, severity); } container = getParentInView(container); } }); }

Target:
private void removeFromCache(Set<IResource> toRemove) { Set<IContainer> dirtyLeafContainers = new HashSet<>(); for (IResource resource : toRemove) { final IContainer currentContainer = resource instanceof IContainer ? (IContainer) resource : resource.getParent(); if (currentContainer == null) { continue; } IPath currentLocation = currentContainer.getLocation(); if (currentLocation == null) { continue; } dirtyLeafContainers .removeIf(leafContainer -> { IPath leafLocation = leafContainer.getLocation(); return leafLocation != null && leafLocation.isPrefixOf(currentLocation); }); if (dirtyLeafContainers.stream().noneMatch( leafContainer -> { IPath leafLocation = leafContainer.getLocation(); return leafLocation != null && currentLocation.isPrefixOf(leafLocation); })) { dirtyLeafContainers.add(currentContainer); } if (resource.getType() == IResource.FILE) { cache.remove(resource); modifiedSeveritySinceLastRun.add(resource); } IContainer container = currentContainer; while (container != null && cache.containsKey(container)) { cache.remove(container); modifiedSeveritySinceLastRun.add(container); container = getParentInView(container); } } dirtyLeafContainers.forEach(leafContainer -> { IContainer container = leafContainer; while (container != null) { int severity = getMaxChildrenSeverityInCache(container); if (severity >= 0) { propagateSeverityToCache(container, severity); } container = getParentInView(container); } }); }
Source:
public boolean equals(final Object other) { if (this == other) { return true; } if (other == null) { return false; } if (this.getClass() != other.getClass()) { return false; } Interval that = (Interval)other; return (this.compareTo(that) == 0); }

Target:
public boolean equals(final Object other) { if (this == other) return true; if (other == null) return false; if (this.getClass() != other.getClass()) return false; Interval that = (Interval)other; return (this.compareTo(that) == 0); }
Source:
@Override public void onPartitionsRevoked(Collection<TopicPartition> partitions) { log.debug("controlLoop partitions revoked"); try { Map<TopicPartition, OffsetAndMetadata> removedOffsetData = acknowlegmentHandler.removePartitions(partitions); for (TopicPartition partition : partitions) { flowControl.remove(partition); } kafkaConsumer.commitSync(removedOffsetData); } catch (InterruptedException e) { log.debug("controlLoop partition rebalance interrupted", e); Thread.currentThread().interrupt(); } }

Target:
public void onPartitionsRevoked(Collection<TopicPartition> partitions) { log.debug("controlLoop partitions revoked"); try { Map<TopicPartition, OffsetAndMetadata> removedOffsets = acknowledgmentHandler.removePartitions(partitions); for (TopicPartition partition : partitions) { flowControl.remove(partition); } kafkaConsumer.commitSync(removedOffsets); } catch (InterruptedException e) { log.debug("controlLoop partition rebalance interrupted", e); Thread.currentThread().interrupt(); } }
Source:
private void assembleInheritance( List<ModelData> lineage, ModelBuildingRequest request, ModelProblemCollector problems ) { for ( int i = lineage.size() - 2; i >= 1; i-- ) { Model parent = lineage.get( i + 1 ).getModel(); Model child = lineage.get( i ).getModel(); inheritanceAssembler.assembleModelInheritance( child, parent, request, problems ); } if ( Boolean.getBoolean( "maven.experimental.buildconsumer" ) && request.isTransformPom() ) { try { Model parent = lineage.get( 1 ).getModel(); Model child = modelProcessor.read( transformData( lineage.get( 0 ) ), null ); inheritanceAssembler.assembleModelInheritance( child, parent, request, problems ); child.setPomFile( lineage.get( 0 ).getModel().getPomFile() ); lineage.get( 0 ).setModel( child ); } catch ( IOException | TransformException | SAXException | ParserConfigurationException e ) { e.printStackTrace(); } } else { Model parent = lineage.get( 1 ).getModel(); Model child = lineage.get( 0 ).getModel(); inheritanceAssembler.assembleModelInheritance( child, parent, request, problems ); } }

Target:
private void assembleInheritance( List<ModelData> lineage, ModelBuildingRequest request, ModelProblemCollector problems ) { for ( int i = lineage.size() - 2; i >= 0; i-- ) { Model parent = lineage.get( i + 1 ).getModel(); Model child = lineage.get( i ).getModel(); inheritanceAssembler.assembleModelInheritance( child, parent, request, problems ); } }
Source:
public void visit(LwM2mResourceInstance instance) { LOG.trace("Encoding resource instance into JSON", instance); if (!requestPath.isResourceInstance()) { throw new CodecException("Invalid request path %s for JSON resource instance encoding", requestPath); } baseName = new LwM2mPath(requestPath.getObjectId(), requestPath.getObjectInstanceId(), requestPath.getResourceId()).toString(); ResourceModel rSpec = model.getResourceModel(objectId, instance.getId()); Type expectedType = rSpec != null ? rSpec.type : instance.getType(); JsonArrayEntry jsonArrayEntry = resourceElement(new LwM2mPath(instance.getId()).toString(), timestamp, instance.getType(), expectedType, instance.getValue()); resourceList = new ArrayList<>(); resourceList.add(jsonArrayEntry); }

Target:
public void visit(LwM2mResourceInstance instance) { LOG.trace("Encoding resource instance into JSON", instance); if (!requestPath.isResourceInstance()) { throw new CodecException("Invalid request path %s for JSON resource instance encoding", requestPath); } baseName = requestPath.toString(); ResourceModel rSpec = model.getResourceModel(objectId, instance.getId()); Type expectedType = rSpec != null ? rSpec.type : instance.getType(); JsonArrayEntry jsonArrayEntry = createJsonArrayEntry(null, timestamp, instance.getType(), expectedType, instance.getValue()); resourceList = new ArrayList<>(); resourceList.add(jsonArrayEntry); }
Source:
protected void startBackgroundDiscovery() { for (MDNSDiscoveryParticipant participant : participants) { mdnsClient.addServiceListener(participant.getServiceType(), this); } }

Target:
protected void startBackgroundDiscovery() { for (MDNSDiscoveryParticipant participant : participants) { mdnsClient.addServiceListener(participant.getServiceType(), this); } startScan(); }
Source:
private FeedbackResultsQuestionDetails createQuestionDetails( int questionIndex, FeedbackQuestionAttributes question, FeedbackQuestionDetails questionDetailsBundle, List<FeedbackResponseAttributes> responsesBundle) { String questionText = questionDetailsBundle.questionText; String additionalInfo = questionDetailsBundle.getQuestionAdditionalInfoHtml(questionIndex, ""); String studentEmail; try { studentEmail = this.student.email; } catch (NullPointerException e) { studentEmail = null; } String questionResultStatistics = questionDetailsBundle.getQuestionResultStatisticsHtml( responsesBundle, question, studentEmail, bundle, "student"); boolean isIndividualResponsesShownToStudents = questionDetailsBundle.isIndividualResponsesShownToStudents(); return new FeedbackResultsQuestionDetails(Integer.toString(questionIndex), questionText, additionalInfo, questionResultStatistics, isIndividualResponsesShownToStudents); }

Target:
private FeedbackResultsQuestionDetails createQuestionDetails( int questionIndex, FeedbackQuestionAttributes question, FeedbackQuestionDetails questionDetailsBundle, List<FeedbackResponseAttributes> responsesBundle) { String questionText = questionDetailsBundle.questionText; String additionalInfo = questionDetailsBundle.getQuestionAdditionalInfoHtml(questionIndex, ""); String studentEmail = (student != null) ? student.email : null; String questionResultStatistics = questionDetailsBundle.getQuestionResultStatisticsHtml( responsesBundle, question, studentEmail, bundle, "student"); boolean isIndividualResponsesShownToStudents = questionDetailsBundle.isIndividualResponsesShownToStudents(); return new FeedbackResultsQuestionDetails(Integer.toString(questionIndex), questionText, additionalInfo, questionResultStatistics, isIndividualResponsesShownToStudents); }
Source:
private boolean correctStorageDomainFormat() { final Set<StorageFormatType> supportedStorageFormats = getSupportedStorageFormatSet(getVds().getvds_group_compatibility_version()); final StorageFormatType storageFormat = getStorageDomain().getStorageFormat(); final StorageType storageType = getStorageDomain().getstorage_type(); if (!supportedStorageFormats.contains(storageFormat)) { return false; } if ((storageFormat == StorageFormatType.V2) && (storageType != StorageType.ISCSI) && (storageType != StorageType.FCP)) { return false; } return true; }

Target:
private boolean correctStorageDomainFormat() { final Set<StorageFormatType> supportedStorageFormats = getSupportedStorageFormatSet(getVds().getvds_group_compatibility_version()); final StorageFormatType storageFormat = getStorageDomain().getStorageFormat(); if (!supportedStorageFormats.contains(storageFormat)) { return false; } if (storageFormat == StorageFormatType.V2) { final StorageType storageType = getStorageDomain().getstorage_type(); if (storageType != StorageType.ISCSI && storageType != StorageType.FCP) { return false } } return true; }
Source:
protected List<Field> createFields(HttpServletRequest request, boolean retainPassword) { List<Field> fields = new ArrayList<>(); for (Field templateField : formFields) { Field clone = templateField.copy(); if (clone.isEnabled()) { String val = fieldValueResolver.getValue(request, clone.getName()); if (clone.getName().equals("password") && retainPassword) { clone.setValue(val); } else { clone.setValue(val); } String label = i18n(request, clone.getLabel()); if (!label.startsWith("!")) { ((DefaultField) clone).setLabel(label); } String placeholder = i18n(request, clone.getPlaceholder()); if (!placeholder.startsWith("!")) { ((DefaultField) clone).setPlaceholder(placeholder); } fields.add(clone); } } return fields; }

Target:
protected List<Field> createFields(HttpServletRequest request, boolean retainPassword) { List<Field> fields = new ArrayList<>(); for (Field templateField : formFields) { Field clone = templateField.copy(); if (clone.isEnabled()) { String val = fieldValueResolver.getValue(request, clone.getName()); if (retainPassword && "password".equals(clone.getName())) { clone.setValue(val); } else { clone.setValue(val); } ((DefaultField) clone).setLabel(i18n(request, clone.getLabel(), clone.getLabel())); ((DefaultField) clone).setPlaceholder(i18n(request, clone.getPlaceholder(), clone.getPlaceholder())); fields.add(clone); } } return fields; }
Source:
public synchronized void close() { if (closed) { return; } closed = true; log.info("Firehose closing."); Uninterruptibles.putUninterruptibly(buffer, FIREHOSE_CLOSED); eventReceiverFirehoseRegister.unregister(serviceName); if (chatHandlerProvider != null) { chatHandlerProvider.unregister(serviceName); } Thread delayedCloseExecutor = this.delayedCloseExecutor; if (delayedCloseExecutor != null && !delayedCloseExecutor.equals(Thread.currentThread())) { delayedCloseExecutor.interrupt(); } }

Target:
public synchronized void close() { if (closed) { return; } closed = true; log.info("Firehose closing."); Uninterruptibles.putUninterruptibly(buffer, FIREHOSE_CLOSED); eventReceiverFirehoseRegister.unregister(serviceName); if (chatHandlerProvider != null) { chatHandlerProvider.unregister(serviceName); } if (delayedCloseExecutor != null && !delayedCloseExecutor.equals(Thread.currentThread())) { delayedCloseExecutor.interrupt(); } }
Source:
public static <T> Predicate<T> instantiatePredicateClass(Class<? extends Predicate<T>> clazz) { try { Constructor<? extends Predicate> c = clazz.getConstructor(); if (c != null) { return c.newInstance(); } else { return null; } } catch (Exception e) { throw new RuntimeException("Unable to create instance of class: " + clazz.getName()); } }

Target:
public static <T> Predicate<T> instantiatePredicateClass(Class<? extends Predicate<T>> clazz) { try { Constructor<? extends Predicate> c = clazz.getConstructor(); if (c != null) { return c.newInstance(); } else { return null; } } catch (Exception e) { throw new InstantiationException("Unable to create instance of class: " + clazz.getName(), e); } }
Source:
public void testNopPaddingWithAnnotation() throws Exception { myExpectedException.expect(IonException.class); myExpectedException.expectMessage("Annotations are not allowed for NOP padding"); IonDatagram datagram = loadTestFile("bad/nopPadWithAnnotations.10n"); assertEquals(1, datagram.size()); final IonStruct struct = (IonStruct) datagram.get(0); assertTrue(struct.isEmpty()); }

Target:
public void testNopPaddingWithAnnotation() throws Exception { myExpectedException.expect(IonException.class); myExpectedException.expectMessage("NOP padding is not allowed within annotation wrappers."); loadTestFile("bad/nopPadWithAnnotations.10n"); }
Source:
public void testSingleParentFamily() throws IOException { final IntegrationTestSpec spec = new IntegrationTestSpec( " -O %s" + " -ped " + threeMemberNonTrioFamilyFile + " -V " + getThreeMemberNonTrioTest + " -skipPop", Collections.singletonList(dir + "expectedCGP_testSingleParentFamily.vcf") ); spec.executeTest("testFamilyPriors", this); }

Target:
public void testSingleParentFamily() throws IOException { final IntegrationTestSpec spec = new IntegrationTestSpec( " -O %s" + " -ped " + threeMemberNonTrioFamilyFile + " -V " + getThreeMemberNonTrioTest + " -skipPop", Collections.singletonList(dir + "expectedCGP_testSingleParentFamily_chr1.vcf") ); spec.executeTest("testFamilyPriors", this); }
Source:
public List<Container> getContainersInTemplate(Template template, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> pages = APILocator.getHTMLPageAssetAPI().findPagesByTemplate(template, user, respectFrontendRoles, 100); List<Container> containers = new ArrayList<>(); for (Contentlet page : pages) { Set<String> containerId = MultiTreeFactory.getMultiTrees(page.getIdentifier()) .stream() .map(mtree -> mtree.getContainer()) .collect(Collectors.toSet()); for (String cont : containerId) { Container container = APILocator.getContainerAPI().getWorkingContainerById(cont, user, false); if(container==null) { continue; } containers.add(container); } } return containers; }

Target:
public List<Container> getContainersInTemplate(Template template, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> pages = APILocator.getHTMLPageAssetAPI().findPagesByTemplate(template, user, respectFrontendRoles, 100); List<Container> containers = new ArrayList<>(); for (Contentlet page : pages) { Set<String> containerId = MultiTreeFactory.getMultiTrees(page.getIdentifier()) .stream() .map(MultiTree::getContainer) .collect(Collectors.toSet()); for (String cont : containerId) { Container container = APILocator.getContainerAPI().getWorkingContainerById(cont, user, false); if(container==null) { continue; } containers.add(container); } } return containers; }
Source:
static @Nullable IChartViewer createChart(Composite parent, ChartData data, ChartModel model) { switch (model.getChartType()) { case BAR_CHART: SwtXYChartViewer barChart = new SwtBarChart(parent, data, model); barChart.populate(); return barChart; case SCATTER_CHART: SwtXYChartViewer scatterChart = new SwtScatterChart(parent, data, model); scatterChart.populate(); return scatterChart; case PIE_CHART: default: return null; } }

Target:
static @Nullable IChartViewer createChart(Composite parent, ChartData data, ChartModel model) { switch (model.getChartType()) { case BAR_CHART: return new SwtBarChart(parent, data, model); case SCATTER_CHART: return new SwtScatterChart(parent, data, model); case PIE_CHART: default: return null; } }
Source:
public void unsubscribe() { if (unsubscribed) { return; } unsubscribed = true; unsubscribeFromAll(subscriptions); }

Target:
public void unsubscribe() { if (unsubscribed) { return; } unsubscribed = true; unsubscribeFromAll(subscriptions); subscriptions = null; }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } IscsiBondValidator validator = new IscsiBondValidator(); return validate(validator.isIscsiBondExist(getIscsiBond())); }

Target:
protected boolean canDoAction() { IscsiBondValidator validator = new IscsiBondValidator(); return validate(validator.isIscsiBondExist(getIscsiBond())); }
Source:
public Valid(T value) { this.value = value; }

Target:
private Valid(T value) { this.value = value; }
Source:
private void collectStackFrame(boolean endOfTrace, StackFrame stackFrame) { long methodId = stackFrame.getMethodId(); callCountsByMethodId.onFrameAppearance(methodId, endOfTrace); callCountsByFrame.onFrameAppearance(stackFrame, endOfTrace); if (currentTreeNode == null) { currentTreeNode = treesByThreadId.compute(currentThread, (id, previous) -> { if (previous != null) { return previous.callAgain(); } return new NodeCollector(methodId); }); } else { currentTreeNode = currentTreeNode.newChildCall(methodId); } }

Target:
private void collectStackFrame(boolean endOfTrace, StackFrame stackFrame) { long methodId = stackFrame.getMethodId(); callCountsByMethodId.onFrameAppearance(methodId, endOfTrace); callCountsByFrame.onFrameAppearance(stackFrame, endOfTrace); if (currentTreeNode == null) { currentTreeNode = treesByThreadId.compute(currentThread, (id, previous) -> { if (previous != null) return previous.callAgain(); return new NodeCollector(methodId); }); } else { currentTreeNode = currentTreeNode.newChildCall(methodId); } }
Source:
public void run() { ConfigContext config = buildConfig(); try (MantaClient client = new MantaClient(config)) { OutputStream out = System.out; if (inferOutputFileName) { outputFileName = MantaUtils.lastItemInPath(filePath); } if (outputFileName != null) { out = new FileOutputStream(outputFileName); } BufferedOutputStream bout = new BufferedOutputStream(out, 1024); InputStream objectStream = client.getAsInputStream(filePath); int oneByte; while ((oneByte = objectStream.read()) != -1) { bout.write(oneByte); } objectStream.close(); bout.flush(); out.flush(); bout.close(); if (outputFileName != null) { out.close(); } } catch (IOException e) { throw new UncheckedIOException(e); } }

Target:
public void run() { ConfigContext config = buildConfig(); try (MantaClient client = new MantaClient(config)) { OutputStream out = System.out; if (inferOutputFileName) { outputFileName = MantaUtils.lastItemInPath(filePath); } if (outputFileName != null) { out = new FileOutputStream(outputFileName); } InputStream objectStream = client.getAsInputStream(filePath); IOUtils.copyLarge(objectStream, out); objectStream.close(); out.flush(); if (outputFileName != null) { out.close(); } } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
public ModuleDeclaration(String name, List imports, List<GenericParameter> generics, List<NameBindingImpl> args, TypedAST inner, NamedType type, FileLocation location, boolean isResource, boolean isAnnotated, String effects) { this.name = name; this.inner = inner; this.location = location; this.resourceFlag = isResource; ascribedType = type; this.args = args; this.imports = imports; this.generics = generics; this.isAnnotated = isAnnotated; this.effectSet = EffectSet.parseEffects(name, effects, false, location); if (args.isEmpty() && imports.isEmpty() && this.effectSet != null && !this.effectSet.getEffects().isEmpty()) { ToolError.reportError(ErrorMessage.PURE_MODULE_ANNOTATION, FileLocation.UNKNOWN); } }

Target:
public ModuleDeclaration(String name, List imports, List<GenericParameter> generics, List<NameBindingImpl> args, TypedAST inner, NamedType type, FileLocation location, boolean isResource, boolean isAnnotated, String effects) { this.name = name; this.inner = inner; this.location = location; this.resourceFlag = isResource; ascribedType = type; this.args = args; this.imports = imports; this.generics = generics; this.isAnnotated = isAnnotated; this.effectSet = EffectSet.parseEffects(name, effects, false, location); if (args.isEmpty() && imports.isEmpty() && this.effectSet != null && !this.effectSet.getEffects().isEmpty()) { ToolError.reportError(ErrorMessage.PURE_MODULE_ANNOTATION, location); } }
Source:
public void asyncTryReadLastConfirmed(final ReadLastConfirmedCallback cb, final Object ctx) { if (clientCtx.getConf().useExplicitLacForReads) { asyncTryReadExplicitLastConfirmed(cb, ctx); } else { asyncTryReadLastConfirmedInternal(cb, ctx); } }

Target:
public void asyncTryReadLastConfirmed(final ReadLastConfirmedCallback cb, final Object ctx) { if (clientCtx.getConf().useExplicitLacForReads) { asyncTryReadExplicitLastConfirmed(cb, ctx); } else { asyncTryReadPiggybackLastConfirmed(cb, ctx); } }
Source:
private void close_sub() { Options.saveOptions(); UI.getCursor().reset(); InternalTextureLoader.get().clear(); GameImage.clearReferences(); GameData.Grade.clearReferences(); Beatmap.clearBackgroundImageCache(); MusicController.reset(); SoundController.stopTrack(); BeatmapGroup.set(BeatmapGroup.ALL); BeatmapSortOrder.set(BeatmapSortOrder.TITLE); if (BeatmapSetList.get() != null) BeatmapSetList.get().reset(); CurveRenderState.shutdown(); LegacyCurveRenderState.shutdown(); if (!Options.isWatchServiceEnabled()) BeatmapWatchService.destroy(); BeatmapWatchService.removeListeners(); Utils.deleteDirectory(Options.TEMP_DIR); Log.info("opsu! is closing"); }

Target:
private void close_sub() { Options.saveOptions(); UI.getCursor().reset(); InternalTextureLoader.get().clear(); GameImage.clearReferences(); GameData.Grade.clearReferences(); Beatmap.clearBackgroundImageCache(); MusicController.reset(); SoundController.stopTrack(); BeatmapGroup.set(BeatmapGroup.ALL); BeatmapSortOrder.set(BeatmapSortOrder.TITLE); if (BeatmapSetList.get() != null) BeatmapSetList.get().reset(); CurveRenderState.shutdown(); LegacyCurveRenderState.shutdown(); if (!Options.isWatchServiceEnabled()) BeatmapWatchService.destroy(); BeatmapWatchService.removeListeners(); Utils.deleteDirectory(Options.TEMP_DIR); }
Source:
public void testMakeCellRenderContextThreeRows() { final double headerRowsHeight = 100.0; final BaseGridRow row1 = new BaseGridRow(); final BaseGridRow row2 = new BaseGridRow(); final BaseGridRow row3 = new BaseGridRow(); final List<GridColumn<?>> allColumns = new ArrayList<>(); final List<Double> allRowHeights = new ArrayList<>(Collections.nCopies(3, row1.getHeight())); final GridColumn<?> uiColumn1 = mockGridColumn(25.0); final GridColumn<?> uiColumn2 = mockGridColumn(60.0); final GridColumn<?> uiColumn3 = mockGridColumn(100.0); allColumns.add(uiColumn1); allColumns.add(uiColumn2); allColumns.add(uiColumn3); gridWidget.getModel().appendRow(row1); gridWidget.getModel().appendRow(row2); gridWidget.getModel().appendRow(row3); doReturn(allColumns).when(ri).getAllColumns(); doReturn(headerRowsHeight).when(ri).getHeaderRowsHeight(); doReturn(allRowHeights).when(ri).getAllRowHeights(); doReturn(uiColumn3).when(ci).getColumn(); doReturn(25.0).when(ci).getOffsetX(); doReturn(3).when(ci).getUiColumnIndex(); final GridBodyCellEditContext context = CellContextUtilities.makeCellRenderContext(gridWidget, ri, ci, 2); assertNotNull(context); assertThat(context.getAbsoluteCellX()) .as("Should be column offset") .isEqualTo(25.0); assertThat(context.getAbsoluteCellY()) .as("Should be sum of header height plus preceding row heights") .isEqualTo(headerRowsHeight + row1.getHeight() + row2.getHeight()); }

Target:
public void testMakeCellRenderContextThreeRows() { final double headerRowsHeight = 100.0; final BaseGridRow row1 = new BaseGridRow(); final BaseGridRow row2 = new BaseGridRow(); final BaseGridRow row3 = new BaseGridRow(); final List<GridColumn<?>> allColumns = new ArrayList<>(); final List<Double> allRowHeights = Collections.nCopies(3, row1.getHeight()); final GridColumn<?> uiColumn1 = mockGridColumn(25.0); final GridColumn<?> uiColumn2 = mockGridColumn(60.0); final GridColumn<?> uiColumn3 = mockGridColumn(100.0); allColumns.add(uiColumn1); allColumns.add(uiColumn2); allColumns.add(uiColumn3); gridWidget.getModel().appendRow(row1); gridWidget.getModel().appendRow(row2); gridWidget.getModel().appendRow(row3); doReturn(allColumns).when(ri).getAllColumns(); doReturn(headerRowsHeight).when(ri).getHeaderRowsHeight(); doReturn(allRowHeights).when(ri).getAllRowHeights(); doReturn(uiColumn3).when(ci).getColumn(); doReturn(25.0).when(ci).getOffsetX(); doReturn(3).when(ci).getUiColumnIndex(); final GridBodyCellEditContext context = CellContextUtilities.makeCellRenderContext(gridWidget, ri, ci, 2); assertNotNull(context); assertThat(context.getAbsoluteCellX()) .as("Should be column offset") .isEqualTo(25.0); assertThat(context.getAbsoluteCellY()) .as("Should be sum of header height plus preceding row heights") .isEqualTo(headerRowsHeight + row1.getHeight() + row2.getHeight()); }
Source:
public CoordinateReferenceSystem readPrjToCRS() throws IOException { Resource prj = getPrjFile(); if (prj == null || !Resources.exists(prj)) { return null; } InputStream is = prj.in(); String wkt = IOUtils.toString(is); is.close(); try { return CRS.parseWKT(wkt); } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }

Target:
public CoordinateReferenceSystem readPrjToCRS() throws IOException { Resource prj = getPrjFile(); if (prj == null || !Resources.exists(prj)) { return null; } try (InputStream is = prj.in()) { return CRS.parseWKT(IOUtils.toString(is)); } catch (Exception e) { throw (IOException) new IOException().initCause(e); } }
Source:
public @Nullable Hashtable<String,RangeSet> getUsages() { return usages; }

Target:
public @CheckForNull Hashtable<String,RangeSet> getUsages() { return usages; }
Source:
private boolean hasBundleLocation(Map<String, Object> service, Set<String> bundleLocations) { return Stream.of(service) .filter(m -> m.containsKey("configurations")) .map(m -> m.get("configurations")) .map(List.class::cast) .flatMap(List::stream) .map(Map.class::cast) .filter(m -> m.containsKey("bundle_location")) .map(m -> m.get("bundle_location")) .map(String.class::cast) .anyMatch(bundleLocations::contains); }

Target:
private boolean hasBundleLocation(Map<String, Object> service, Set<String> bundleLocations) { return Stream.of(service) .map(m -> m.get("configurations")) .filter(Objects::nonNull) .map(List.class::cast) .flatMap(List::stream) .map(Map.class::cast) .map(m -> m.get("bundle_location")) .filter(Objects::nonNull) .map(String.class::cast) .anyMatch(bundleLocations::contains); }
Source:
public void testConfigure_WithPropertyValues() throws PropertyAccessException { final CONNECTTestClient<TestServicePortType> testClient = new CONNECTTestClient<>( new TestServicePortDescriptor()); final ServiceEndpoint<TestServicePortType> serviceEndpoint = testClient.getServiceEndpoint(); final PropertyAccessor mockPropAccessor = mock(PropertyAccessor.class); final AssertionType assertion = new AssertionType(); final HttpHeaderServiceEndpointDecorator headerDecorator = new HttpHeaderServiceEndpointDecorator( serviceEndpoint, assertion) { @Override protected PropertyAccessor getPropertyAccessor() { return mockPropAccessor; } }; final String customHeaderName = "customName"; final String customHeaderValue = "customValue"; final Set<String> headerNames = new HashSet<>(); headerNames.add(NhincConstants.CUSTOM_HTTP_HEADERS + "." + customHeaderName); when(mockPropAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP)) .thenReturn("True"); when(mockPropAccessor.getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE)).thenReturn(headerNames); when(mockPropAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.CUSTOM_HTTP_HEADERS + "." + customHeaderName)).thenReturn(customHeaderValue); headerDecorator.configure(); validateConfiguration(headerDecorator); final BindingProvider bp = (BindingProvider) headerDecorator.getPort(); final Map<String, List<String>> bpMap = (Map<String, List<String>>) bp.getRequestContext() .get(NhincConstants.CUSTOM_HTTP_HEADERS); assert bpMap.containsKey("customName"); }

Target:
public void testConfigure_WithPropertyValues() throws PropertyAccessException { final CONNECTTestClient<TestServicePortType> testClient = new CONNECTTestClient<>( new TestServicePortDescriptor()); final ServiceEndpoint<TestServicePortType> serviceEndpoint = testClient.getServiceEndpoint(); final PropertyAccessor mockPropAccessor = mock(PropertyAccessor.class); final AssertionType assertion = new AssertionType(); final HttpHeaderServiceEndpointDecorator headerDecorator = new HttpHeaderServiceEndpointDecorator( serviceEndpoint, assertion) { @Override protected PropertyAccessor getPropertyAccessor() { return mockPropAccessor; } }; final String customHeaderName = "customName"; final String customHeaderValue = "customValue"; final Set<String> headerNames = new HashSet<>(); headerNames.add(NhincConstants.CUSTOM_HTTP_HEADERS + "." + customHeaderName); when(mockPropAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.KEEP_ALIVE_PROP)) .thenReturn("True"); when(mockPropAccessor.getPropertyNames(NhincConstants.GATEWAY_PROPERTY_FILE)).thenReturn(headerNames); when(mockPropAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.CUSTOM_HTTP_HEADERS + "." + customHeaderName)).thenReturn(customHeaderValue); headerDecorator.configure(); validateConfiguration(headerDecorator); final BindingProvider bp = (BindingProvider) headerDecorator.getPort(); final Map<String, List<String>> bpMap = (Map<String, List<String>>) bp.getRequestContext() .get(NhincConstants.CUSTOM_HTTP_HEADERS); assertTrue(bpMap.containsKey("customName")); }
Source:
private static Optional<ExecutableElement> findDefaultBuilder(TypeElement autoValueClass, TypeElement builderClass) { return ElementFilter.methodsIn(autoValueClass.getEnclosedElements()) .stream() .filter(e -> MoreElements.isAnnotationPresent(e, GsonDefaultBuilder.class)) .filter(MoreElements.hasModifiers(Modifier.STATIC)::apply) .filter(e -> MoreTypes.equivalence().equivalent(e.getReturnType(), builderClass.asType())) .filter(e -> e.getParameters().isEmpty()) .findFirst(); }

Target:
private static ExecutableElement findDefaultBuilder(TypeElement autoValueClass, TypeElement builderClass) { Set<ExecutableElement> builderMethods = ElementFilter.methodsIn(autoValueClass.getEnclosedElements()) .stream() .filter(MoreElements.hasModifiers(PRIVATE).negate()) .filter(MoreElements.hasModifiers(Modifier.STATIC)) .filter(e -> e.getParameters().isEmpty()) .filter(e -> MoreTypes.equivalence().equivalent(e.getReturnType(), builderClass.asType())) .collect(Collectors.toSet()); if (builderMethods.isEmpty()) { return null; } else if (builderMethods.size() == 1) { return Iterables.getOnlyElement(builderMethods); } else { return builderMethods.stream() .filter(e -> MoreElements.isAnnotationPresent(e, AutoValueGsonBuilder.class)) .findFirst().orElse(null); } }
Source:
private void handleAJAXAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final HashMap<String, Object> ret = new HashMap<>(); final String ajaxName = getParam(req, "ajax"); if (ajaxName.equals("fetchTrigger")) { if (checkProjectIdAndFlowId(req)) { final int projectId = getIntParam(req, "projectId"); final String flowId = getParam(req, "flowId"); ajaxFetchTrigger(projectId, flowId, session, ret); } } else if (ajaxName.equals("pauseTrigger") || ajaxName.equals("resumeTrigger")) { if (checkProjectIdAndFlowId(req)) { final int projectId = getIntParam(req, "projectId"); final String flowId = getParam(req, "flowId"); final Project project = this.projectManager.getProject(projectId); if (project == null) { ret.put("error", "please specify a valid project id"); } else if (!hasPermission(project, session.getUser(), Type.ADMIN)) { ret.put("error", "Permission denied. Need ADMIN access."); } else { try { if(ajaxName.equals("pauseTrigger")) { this.scheduler.pauseFlowTrigger(projectId, flowId); } else { this.scheduler.resumeFlowTrigger(projectId, flowId); } ret.put("status", "success"); } catch (SchedulerException ex) { ret.put("status", "error"); ret.put("message", ex); } } } } if (ret != null) { this.writeJSON(resp, ret); } }

Target:
private void handleAJAXAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final HashMap<String, Object> ret = new HashMap<>(); final String ajaxName = getParam(req, "ajax"); if (ajaxName.equals("fetchTrigger")) { if (checkProjectIdAndFlowId(req)) { final int projectId = getIntParam(req, "projectId"); final String flowId = getParam(req, "flowId"); ajaxFetchTrigger(projectId, flowId, session, ret); } } else if (ajaxName.equals("pauseTrigger") || ajaxName.equals("resumeTrigger")) { if (checkProjectIdAndFlowId(req)) { final int projectId = getIntParam(req, "projectId"); final String flowId = getParam(req, "flowId"); final Project project = this.projectManager.getProject(projectId); if (project == null) { ret.put("error", "please specify a valid project id"); } else if (!hasPermission(project, session.getUser(), Type.ADMIN)) { ret.put("error", "Permission denied. Need ADMIN access."); } else { try { if(ajaxName.equals("pauseTrigger")) { this.scheduler.pauseFlowTrigger(projectId, flowId); } else { this.scheduler.resumeFlowTrigger(projectId, flowId); } ret.put("status", "success"); } catch (SchedulerException ex) { ret.put("error", ex.getMessage()); } } } } if (ret != null) { this.writeJSON(resp, ret); } }
Source:
public static String replaceNodeName(Document document, String containerNodeName, String childNodeNameToReplace, String childNodeNameReplacement) throws Exception { final NodeList containerNodes = document.getElementsByTagName(containerNodeName); for (int i = 0; i < containerNodes.getLength(); i ++) { Node containerNode = containerNodes.item(i); final NodeList childNodes = containerNode.getChildNodes(); for (int j = 0; j < childNodes.getLength(); j ++) { Node childNode = childNodes.item(j); if (childNode.getNodeName().equals(childNodeNameToReplace)) { document.renameNode(childNode, null, childNodeNameReplacement); } } } return getString(document); }

Target:
public static String replaceNodeName(Document document, String containerNodeName, String childNodeNameToReplace, String childNodeNameReplacement) throws Exception { final NodeList containerNodes = document.getElementsByTagName(containerNodeName); if (containerNodes != null) { for (int i = 0; i < containerNodes.getLength(); i++) { Node containerNode = containerNodes.item(i); final NodeList childNodes = containerNode.getChildNodes(); for (int j = 0; j < childNodes.getLength(); j++) { Node childNode = childNodes.item(j); if (Objects.equals(childNode.getNodeName(), childNodeNameToReplace)) { document.renameNode(childNode, null, childNodeNameReplacement); } } } } return getString(document); }
Source:
public static boolean canApplyExtractionInPost(TopNQuery query) { return query != null && query.getDimensionSpec() != null && query.getDimensionSpec().getExtractionFn() != null && ExtractionFn.ExtractionType.ONE_TO_ONE.equals(query.getDimensionSpec().getExtractionFn().getExtractionType()) && query.getTopNMetricSpec().canBeOptimizedUnordered(); }

Target:
public static boolean canApplyExtractionInPost(TopNQuery query) { return query.getDimensionSpec() != null && query.getDimensionSpec().getExtractionFn() != null && ExtractionFn.ExtractionType.ONE_TO_ONE.equals(query.getDimensionSpec().getExtractionFn().getExtractionType()) && query.getTopNMetricSpec().canBeOptimizedUnordered(); }
Source:
public BioWorkflow initializeWorkflowFromGitHub(String repositoryId, String subclass, String workflowName) { BioWorkflow workflow = (BioWorkflow)initializeWorkflow(repositoryId, new BioWorkflow()); workflow.setWorkflowName(workflowName); workflow.setMode(WorkflowMode.DOCKSTORE_YML); if (Objects.equals(DescriptorLanguage.CWL.getLowerShortName(), subclass)) { workflow.setDescriptorType(DescriptorLanguage.CWL); } else if (Objects.equals(DescriptorLanguage.WDL.getLowerShortName(), subclass)) { workflow.setDescriptorType(DescriptorLanguage.WDL); } else if (Objects.equals(DescriptorLanguage.NEXTFLOW.getLowerShortName(), subclass)) { workflow.setDescriptorType(DescriptorLanguage.NEXTFLOW); } else { LOG.info("Invalid descriptor type " + subclass); } workflow.setDefaultWorkflowPath("/.dockstore.yml"); return workflow; }

Target:
public BioWorkflow initializeWorkflowFromGitHub(String repositoryId, String subclass, String workflowName) { BioWorkflow workflow = new BioWorkflow(); workflow.setOrganization(repositoryId.split("/")[0]); workflow.setRepository(repositoryId.split("/")[1]); workflow.setSourceControl(SourceControl.GITHUB); workflow.setGitUrl("git@github.com:" + repositoryId + ".git"); workflow.setLastUpdated(new Date()); workflow.setMode(WorkflowMode.DOCKSTORE_YML); workflow.setWorkflowName(workflowName); DescriptorLanguage descriptorLanguage; try { descriptorLanguage = DescriptorLanguage.convertShortStringToEnum(subclass); workflow.setDescriptorType(descriptorLanguage); } catch (UnsupportedOperationException ex) { String msg = "The given descriptor type is not supported: " + subclass; LOG.info(msg); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } workflow.setDefaultWorkflowPath("/.dockstore.yml"); return workflow; }
Source:
public AbstractPartTreeBlazePersistenceQuery(EntityViewAwareJpaQueryMethod method, EntityManager em, PersistenceProvider persistenceProvider, CriteriaBuilderFactory cbf, EntityViewManager evm) { super(method, em); this.cbf = cbf; this.evm = evm; this.entityViewClass = method.getEntityViewClass(); this.domainClass = method.getEntityInformation().getJavaType(); this.tree = new PartTree(method.getName(), domainClass); this.parameters = method.getJpaParameters(); boolean recreateQueries = parameters.potentiallySortsDynamically(); this.query = isCountProjection(tree) ? new AbstractPartTreeBlazePersistenceQuery.CountQueryPreparer(persistenceProvider, recreateQueries) : new AbstractPartTreeBlazePersistenceQuery.QueryPreparer(persistenceProvider, recreateQueries); }

Target:
public AbstractPartTreeBlazePersistenceQuery(EntityViewAwareJpaQueryMethod method, EntityManager em, PersistenceProvider persistenceProvider, CriteriaBuilderFactory cbf, EntityViewManager evm) { super(method, em); this.cbf = cbf; this.evm = evm; this.entityViewClass = method.getEntityViewClass(); this.domainClass = method.getEntityInformation().getJavaType(); this.tree = new PartTree(method.getName(), domainClass); this.parameters = method.getJpaParameters(); boolean recreateQueries = parameters.potentiallySortsDynamically() || entityViewClass != null; this.query = isCountProjection(tree) ? new AbstractPartTreeBlazePersistenceQuery.CountQueryPreparer(persistenceProvider, recreateQueries) : new AbstractPartTreeBlazePersistenceQuery.QueryPreparer(persistenceProvider, recreateQueries); }
Source:
public static List<OvfEntityData> getOvfEntities(byte[] tarByte, Guid storageDomainId) { List<OvfEntityData> ovfEntityDataFromTar = new ArrayList<>(); InputStream is = new ByteArrayInputStream(tarByte); Map<String, String> filesFromTar; try (OutMemoryTar memoryTar = new OutMemoryTar(is)) { filesFromTar = memoryTar.unTar(); } catch (IOException e) { throw new RuntimeException(String.format("Exception while getting OVFs files from tar file for domain %s", storageDomainId), e); } for (String fileName : filesFromTar.keySet()) { if (fileName.contains(OVF_FILE_EXT)) { String ovfData = filesFromTar.get(fileName); OvfEntityData ovfEntityData = createOvfEntityData(storageDomainId, ovfData, getVmEntityType(ovfData), getEntityName(ovfData), storageDomainId); ovfEntityDataFromTar.add(ovfEntityData); } } return ovfEntityDataFromTar; }

Target:
public static List<OvfEntityData> getOvfEntities(byte[] tarByte, Guid storageDomainId) { List<OvfEntityData> ovfEntityDataFromTar = new ArrayList<>(); InputStream is = new ByteArrayInputStream(tarByte); Map<String, String> filesFromTar; try (OutMemoryTar memoryTar = new OutMemoryTar(is)) { filesFromTar = memoryTar.unTar(); } catch (IOException e) { throw new RuntimeException(String.format("Exception while getting OVFs files from tar file for domain %s", storageDomainId), e); } for (Entry<String, String> fileEntry : filesFromTar.entrySet()) { if (fileEntry.getKey().endsWith(OVF_FILE_EXT)) { String ovfData = fileEntry.getValue(); OvfEntityData ovfEntityData = createOvfEntityData(storageDomainId, ovfData, getVmEntityType(ovfData), getEntityName(ovfData), storageDomainId); ovfEntityDataFromTar.add(ovfEntityData); } } return ovfEntityDataFromTar; }
Source:
public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { JavascriptExecutor js = (JavascriptExecutor)driver; headers.get(index).click(); wait.forElementVisible(collapsibilityCheckbox); collapsibilityCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = js.executeScript(script).toString(); if (collapsibilityCheckbox.isSelected()) { Assertion.assertTrue(!chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }

Target:
public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { JavascriptExecutor js = (JavascriptExecutor)driver; headers.get(index).click(); wait.forElementVisible(collapsibilityCheckbox); collapsibilityCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = js.executeScript(script).toString(); if (collapsibilityCheckbox.isSelected()) { Assertion.assertFalse(chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }