Report the start of a CDATA section.

@see #endCDATA
484025
public void startCDATA() throws org.xml.sax.SAXException
  {
    m_inCData = true;
    append(m_doc.createCDATASection(""));
  }
1077735
protected void fireCDATAEvent(char[] chars, int start, int length)
        throws org.xml.sax.SAXException
    {
		if (m_tracer != null)
        {
            flushMyWriter();
			m_tracer.fireGenerateEvent(SerializerTrace.EVENTTYPE_CDATA, chars, start,length);
        }     	        	    	
    }
454614
private function cdataHandler($xmlParser, $cdata) {
		//Last element in stack = parent element of the CDATA.
		$currentElement = $this->stack[count($this->stack)-1];
		$currentElement->appendCDataChild($cdata);

		// hhvm invokes several cdata chunks if they contain \n
        $this->previousCData .= $cdata;
	}
1168061
public void endProcessingNode() {
        if (nodeCount.decrementAndGet() == 0 && recorder != null) {
            Node node = rootNode.build();

            trace.setTimestamp(node.getTimestamp());
            trace.setTransaction(getTransaction());
            trace.getNodes().add(node);

            if (checkForSamplingProperties(node)) {
                reportingLevel = ReportingLevel.All;
            }

            boolean sampled = sampler.isSampled(trace, reportingLevel);
            if (sampled && reportingLevel == null) {
                reportingLevel = ReportingLevel.All;
            }

            if (sampled) {
                recorder.record(trace);
            }
        }
    }
1207569
def finish(self):
		""""""
		self.report(fraction=1.0)
		key = self.stack_key
		if key is not None:
			if self.data.get(key) is None:
				self.data[key] = []
			start_time = self.current_times.get(key) or time()
			self.data[key].append(Dict(runtime=time()-start_time, **self.params))
720232
public function end()
	{
		if ($this->config['layout'] !== false && is_file($file = $this->getLayoutPath()) ) {
			extract($this->data, EXTR_OVERWRITE|EXTR_REFS);
            require($this->cache($file, true));
		}
	}
1065772
protected void finish() {
        Reporter reporter = this.reporterThreadLocal.get();
        assertEquals("Detailed results found at: " + reporter.getFileName(), "0 errors",
                Integer.toString(reporter.getFails()) + ERRORS_CHECK);
    }
1089418
function (start, end) {
            var ret = null, l;
            l = end - start;
            if (l > 0) {
                ret = this.nodeFactory.createCDataNode(this.page, start, end);
            }
            return ret;
        }
953958
public function on_root_element_end() {
        global $CFG;

        // restore the stashes prepared by other handlers for us
        $backupinfo         = $this->converter->get_stash('backup_info');
        $originalcourseinfo = $this->converter->get_stash('original_course_info');

        ////////////////////////////////////////////////////////////////////////
        // write moodle_backup.xml
        ////////////////////////////////////////////////////////////////////////
        $this->open_xml_writer('moodle_backup.xml');

        $this->xmlwriter->begin_tag('moodle_backup');
        $this->xmlwriter->begin_tag('information');

        // moodle_backup/information
        $this->xmlwriter->full_tag('name', $backupinfo['name']);
        $this->xmlwriter->full_tag('moodle_version', $backupinfo['moodle_version']);
        $this->xmlwriter->full_tag('moodle_release', $backupinfo['moodle_release']);
        $this->xmlwriter->full_tag('backup_version', $CFG->backup_version); // {@see restore_prechecks_helper::execute_prechecks}
        $this->xmlwriter->full_tag('backup_release', $CFG->backup_release);
        $this->xmlwriter->full_tag('backup_date', $backupinfo['date']);
        // see the commit c0543b - all backups created in 1.9 and later declare the
        // information or it is considered as false
        if (isset($backupinfo['mnet_remoteusers'])) {
            $this->xmlwriter->full_tag('mnet_remoteusers', $backupinfo['mnet_remoteusers']);
        } else {
            $this->xmlwriter->full_tag('mnet_remoteusers', false);
        }
        $this->xmlwriter->full_tag('original_wwwroot', $backupinfo['original_wwwroot']);
        // {@see backup_general_helper::backup_is_samesite()}
        if (isset($backupinfo['original_site_identifier_hash'])) {
            $this->xmlwriter->full_tag('original_site_identifier_hash', $backupinfo['original_site_identifier_hash']);
        } else {
            $this->xmlwriter->full_tag('original_site_identifier_hash', null);
        }
        $this->xmlwriter->full_tag('original_course_id', $originalcourseinfo['original_course_id']);
        $this->xmlwriter->full_tag('original_course_fullname', $originalcourseinfo['original_course_fullname']);
        $this->xmlwriter->full_tag('original_course_shortname', $originalcourseinfo['original_course_shortname']);
        $this->xmlwriter->full_tag('original_course_startdate', $originalcourseinfo['original_course_startdate']);
        $this->xmlwriter->full_tag('original_system_contextid', $this->converter->get_contextid(CONTEXT_SYSTEM));
        // note that even though we have original_course_contextid available, we regenerate the
        // original course contextid using our helper method to be sure that the data are consistent
        // within the MBZ file
        $this->xmlwriter->full_tag('original_course_contextid', $this->converter->get_contextid(CONTEXT_COURSE));

        // moodle_backup/information/details
        $this->xmlwriter->begin_tag('details');
        $this->write_xml('detail', array(
            'backup_id'     => $this->converter->get_id(),
            'type'          => backup::TYPE_1COURSE,
            'format'        => backup::FORMAT_MOODLE,
            'interactive'   => backup::INTERACTIVE_YES,
            'mode'          => backup::MODE_CONVERTED,
            'execution'     => backup::EXECUTION_INMEDIATE,
            'executiontime' => 0,
        ), array('/detail/backup_id'));
        $this->xmlwriter->end_tag('details');

        // moodle_backup/information/contents
        $this->xmlwriter->begin_tag('contents');

        // moodle_backup/information/contents/activities
        $this->xmlwriter->begin_tag('activities');
        $activitysettings = array();
        foreach ($this->converter->get_stash('coursecontents') as $activity) {
            $modinfo = $this->converter->get_stash('modinfo_'.$activity['modulename']);
            $modinstance = $modinfo['instances'][$activity['instanceid']];
            $this->write_xml('activity', array(
                'moduleid'      => $activity['cmid'],
                'sectionid'     => $activity['sectionid'],
                'modulename'    => $activity['modulename'],
                'title'         => $modinstance['name'],
                'directory'     => 'activities/'.$activity['modulename'].'_'.$activity['cmid']
            ));
            $activitysettings[] = array(
                'level'     => 'activity',
                'activity'  => $activity['modulename'].'_'.$activity['cmid'],
                'name'      => $activity['modulename'].'_'.$activity['cmid'].'_included',
                'value'     => (($modinfo['included'] === 'true' and $modinstance['included'] === 'true') ? 1 : 0));
            $activitysettings[] = array(
                'level'     => 'activity',
                'activity'  => $activity['modulename'].'_'.$activity['cmid'],
                'name'      => $activity['modulename'].'_'.$activity['cmid'].'_userinfo',
                //'value'     => (($modinfo['userinfo'] === 'true' and $modinstance['userinfo'] === 'true') ? 1 : 0));
                'value'     => 0); // todo hardcoded non-userinfo for now
        }
        $this->xmlwriter->end_tag('activities');

        // moodle_backup/information/contents/sections
        $this->xmlwriter->begin_tag('sections');
        $sectionsettings = array();
        foreach ($this->converter->get_stash_itemids('sectioninfo') as $sectionid) {
            $sectioninfo = $this->converter->get_stash('sectioninfo', $sectionid);
            $sectionsettings[] = array(
                'level'     => 'section',
                'section'   => 'section_'.$sectionid,
                'name'      => 'section_'.$sectionid.'_included',
                'value'     => 1);
            $sectionsettings[] = array(
                'level'     => 'section',
                'section'   => 'section_'.$sectionid,
                'name'      => 'section_'.$sectionid.'_userinfo',
                'value'     => 0); // @todo how to detect this from moodle.xml?
            $this->write_xml('section', array(
                'sectionid' => $sectionid,
                'title'     => $sectioninfo['number'], // because the title is not available
                'directory' => 'sections/section_'.$sectionid));
        }
        $this->xmlwriter->end_tag('sections');

        // moodle_backup/information/contents/course
        $this->write_xml('course', array(
            'courseid'  => $originalcourseinfo['original_course_id'],
            'title'     => $originalcourseinfo['original_course_shortname'],
            'directory' => 'course'));
        unset($originalcourseinfo);

        $this->xmlwriter->end_tag('contents');

        // moodle_backup/information/settings
        $this->xmlwriter->begin_tag('settings');

        // fake backup root seetings
        $rootsettings = array(
            'filename'         => $backupinfo['name'],
            'users'            => 0, // @todo how to detect this from moodle.xml?
            'anonymize'        => 0,
            'role_assignments' => 0,
            'activities'       => 1,
            'blocks'           => 1,
            'filters'          => 0,
            'comments'         => 0,
            'userscompletion'  => 0,
            'logs'             => 0,
            'grade_histories'  => 0,
        );
        unset($backupinfo);
        foreach ($rootsettings as $name => $value) {
            $this->write_xml('setting', array(
                'level' => 'root',
                'name'  => $name,
                'value' => $value));
        }
        unset($rootsettings);

        // activity settings populated above
        foreach ($activitysettings as $activitysetting) {
            $this->write_xml('setting', $activitysetting);
        }
        unset($activitysettings);

        // section settings populated above
        foreach ($sectionsettings as $sectionsetting) {
            $this->write_xml('setting', $sectionsetting);
        }
        unset($sectionsettings);

        $this->xmlwriter->end_tag('settings');

        $this->xmlwriter->end_tag('information');
        $this->xmlwriter->end_tag('moodle_backup');

        $this->close_xml_writer();

        ////////////////////////////////////////////////////////////////////////
        // write files.xml
        ////////////////////////////////////////////////////////////////////////
        $this->open_xml_writer('files.xml');
        $this->xmlwriter->begin_tag('files');
        foreach ($this->converter->get_stash_itemids('files') as $fileid) {
            $this->write_xml('file', $this->converter->get_stash('files', $fileid), array('/file/id'));
        }
        $this->xmlwriter->end_tag('files');
        $this->close_xml_writer('files.xml');

        ////////////////////////////////////////////////////////////////////////
        // write scales.xml
        ////////////////////////////////////////////////////////////////////////
        $this->open_xml_writer('scales.xml');
        $this->xmlwriter->begin_tag('scales_definition');
        foreach ($this->converter->get_stash_itemids('scales') as $scaleid) {
            $this->write_xml('scale', $this->converter->get_stash('scales', $scaleid), array('/scale/id'));
        }
        $this->xmlwriter->end_tag('scales_definition');
        $this->close_xml_writer('scales.xml');

        ////////////////////////////////////////////////////////////////////////
        // write course/inforef.xml
        ////////////////////////////////////////////////////////////////////////
        $this->open_xml_writer('course/inforef.xml');
        $this->xmlwriter->begin_tag('inforef');

        $this->xmlwriter->begin_tag('fileref');
        // legacy course files
        $fileids = $this->converter->get_stash('course_files_ids');
        if (is_array($fileids)) {
            foreach ($fileids as $fileid) {
                $this->write_xml('file', array('id' => $fileid));
            }
        }
        // todo site files
        // course summary files
        $fileids = $this->converter->get_stash('course_summary_files_ids');
        if (is_array($fileids)) {
            foreach ($fileids as $fileid) {
                $this->write_xml('file', array('id' => $fileid));
            }
        }
        $this->xmlwriter->end_tag('fileref');

        $this->xmlwriter->begin_tag('question_categoryref');
        foreach ($this->converter->get_stash_itemids('question_categories') as $questioncategoryid) {
            $this->write_xml('question_category', array('id' => $questioncategoryid));
        }
        $this->xmlwriter->end_tag('question_categoryref');

        $this->xmlwriter->end_tag('inforef');
        $this->close_xml_writer();

        // make sure that the files required by the restore process have been generated.
        // missing file may happen if the watched tag is not present in moodle.xml (for example
        // QUESTION_CATEGORIES is optional in moodle.xml but questions.xml must exist in
        // moodle2 format) or the handler has not been implemented yet.
        // apparently this must be called after the handler had a chance to create the file.
        $this->make_sure_xml_exists('questions.xml', 'question_categories');
        $this->make_sure_xml_exists('groups.xml', 'groups');
        $this->make_sure_xml_exists('outcomes.xml', 'outcomes_definition');
        $this->make_sure_xml_exists('users.xml', 'users');
        $this->make_sure_xml_exists('course/roles.xml', 'roles',
            array('role_assignments' => array(), 'role_overrides' => array()));
        $this->make_sure_xml_exists('course/enrolments.xml', 'enrolments',
            array('enrols' => array()));
    }
744750
protected final void verifyWriteCData()
        throws XMLStreamException
    {
        // Not legal outside main element tree:
        if (mCheckStructure) {
            if (inPrologOrEpilog()) {
                reportNwfStructure(ErrorConsts.WERR_PROLOG_CDATA);
            }
        }
        // 08-Dec-2005, TSa: validator-based validation?
        if (mVldContent <= XMLValidator.CONTENT_ALLOW_WS) {
            // there's no ignorable white space CDATA...
            reportInvalidContent(CDATA);
        }
    }
184318
public synchronized void endInit() {
		if (win == null) return;
		progressText.setText("Starting framework...");
		progressBar.setMinimum(0);
		progressBar.setMaximum(10050);
		progressBar.setValue(50);
		bottom.invalidate();
	}
1289731
@Override
  public void part(int start, int end) {
    blockNumbers[count][0] = start;
    blockNumbers[count][1] = end - 1;
    count++;
  }
446180
function (out) {
            if (this._cfgOk) {
                var cfg = this._cfg;
                var sectionCfg = {
                    id : this._sectionId,
                    type : cfg.type,
                    attributes : cfg.attributes
                };

                out.beginSection(sectionCfg);
                this._writePlaceholderContent(out);
                out.endSection();
            }
        }
103312
public void endDocument()
    {
        logger.debug("****   endDoc   ****");
        for (Iterator iterator = conDesList.iterator(); iterator.hasNext();)
        {
            JdbcConnectionDescriptor jcd = (JdbcConnectionDescriptor) iterator.next();
            con_repository.addDescriptor(jcd);
        }
    }
1195654
public void endDTD() throws org.xml.sax.SAXException
    {
        try
        {
            if (m_needToOutputDocTypeDecl)
            {
                outputDocTypeDecl(m_elemContext.m_elementName, false);
                m_needToOutputDocTypeDecl = false;
            }
            final java.io.Writer writer = m_writer;
            if (!m_inDoctype)
                writer.write("]>");
            else
            {
                writer.write('>');
            }

            writer.write(m_lineSep, 0, m_lineSepLen);
        }
        catch (IOException e)
        {
            throw new SAXException(e);
        }

    }
730088
private int nextFromTreeCommentOrCData()
        throws XMLStreamException
    {
        char c = getNextCharFromCurrent(SUFFIX_IN_DOC);
        if (c == '[') {
            checkCData();
            /* Good enough; it is a CDATA section... but let's just also
             * parse the easy ("free") stuff:
             */
            c = (mInputPtr < mInputEnd) ? mInputBuffer[mInputPtr++]
                : getNextCharFromCurrent(SUFFIX_IN_CDATA);
            readCDataPrimary(c); // sets token state appropriately...
            return CDATA;
        }
        if (c == '-' && getNextCharFromCurrent(SUFFIX_IN_DOC) == '-') {
            mTokenState = TOKEN_STARTED;
            return COMMENT;
        }
        throwParseError("Unrecognized XML directive; expected CDATA or comment ('<![CDATA[' or '<!--').");
        return 0; // never gets here, but compilers don't know it...
    }
611154
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
    {
        if (localName.equalsIgnoreCase(TABLE))
        {
            if (startTable)
                if (m_record.getEditMode() == DBConstants.EDIT_ADD)
                {
                    try {
                        m_record.add();
                    } catch (DBException e) {
                        e.printStackTrace();
                    }
                }
            startTable = false;
        }
    }