com.jcabi.xml.XML Java Examples

The following examples show how to use com.jcabi.xml.XML. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Lcom4Test.java    From jpeek with MIT License 7 votes vote down vote up
@ParameterizedTest
@Disabled
@CsvFileSource(resources = "/org/jpeek/calculus/java/lcom4-params.csv")
public void calculatesValue(final String file, final String value) throws Exception {
    final XML result = new Lcom4().node(
        "", new HashMap<>(0), new Skeleton(
            new FakeBase(file)
        ).xml()
    );
    new Assertion<>(
        "Must create LCOM4 value",
        new ItemAt<>(0, result.xpath("/metric/app/package/class/@value")),
        new ScalarHasValue<>(value)
    ).affirm();
}
 
Example #2
Source File: Lcom4Test.java    From jpeek with MIT License 6 votes vote down vote up
@Test
@Disabled
public void createsXmlCalculusWithXpaths() throws IOException {
    final XML result = new Lcom4().node(
        "LCOM", new HashMap<>(0), new Skeleton(
            new FakeBase(
                "NoMethods", "Bar", "OverloadMethods",
                "OnlyOneMethodWithParams", "WithoutAttributes"
            )
        ).xml()
    );
    new Assertion<>(
        "Must create LCOM report",
        result.toString(),
        XhtmlMatchers.hasXPaths(
            "/metric/app/package/class/vars",
            "/metric/app/package/class/vars/var",
            "/metric/app/package/class[@value]"
        )
    ).affirm();
}
 
Example #3
Source File: Lcom4.java    From jpeek with MIT License 6 votes vote down vote up
@Override
public XML node(final String metric, final Map<String, Object> params,
    final XML skeleton) throws IOException {
    final XML result = new XSLDocument(
        new TextOf(
            new ResourceOf("org/jpeek/metrics/LCOM4.xsl")
        ).asString(),
        Sources.DUMMY,
        params
    ).transform(skeleton);
    final List<XML> packages = result.nodes("//package");
    for (final XML elt : packages) {
        final String pack = elt.xpath("/@id").get(0);
        final List<XML> classes = elt.nodes("//class");
        for (final XML clazz : classes) {
            this.update(skeleton, pack, clazz);
        }
    }
    return result;
}
 
Example #4
Source File: XslCalculusTest.java    From jpeek with MIT License 6 votes vote down vote up
@Test
public void createsXmlCalculusWithXpaths() throws IOException {
    final XML result = new XslCalculus().node(
        "LCOM", new HashMap<>(0), new Skeleton(
            new FakeBase(
                "NoMethods", "Bar", "OverloadMethods",
                "OnlyOneMethodWithParams", "WithoutAttributes"
            )
        ).xml()
    );
    new Assertion<>(
        "Must create LCOM report",
        result.toString(),
        XhtmlMatchers.hasXPaths(
            "/metric/app/package/class/vars",
            "/metric/app/package/class/vars/var",
            "/metric/app/package/class[@value]"
        )
    ).affirm();
}
 
Example #5
Source File: Ccm.java    From jpeek with MIT License 6 votes vote down vote up
@Override
public XML node(
    final String metric,
    final Map<String, Object> params,
    final XML skeleton
) {
    if (!"ccm".equalsIgnoreCase(metric)) {
        throw new IllegalArgumentException(
            new FormattedText(
                "This metric is CCM, not %s.", metric
            ).toString()
        );
    }
    return Ccm.withFixedNcc(
        new XSLDocument(
            new UncheckedInput(
                new ResourceOf("org/jpeek/metrics/CCM.xsl")
            ).stream()
        ).transform(skeleton),
        skeleton
    );
}
 
Example #6
Source File: AppTest.java    From jpeek with MIT License 6 votes vote down vote up
@Test
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public void isXsdDocumented() throws IOException {
    final List<XML> elements = new XMLDocument(
        AppTest.class.getResourceAsStream("xsd/metric.xsd")
    ).nodes("//node()[@name]");
    final IsNot<? super List<?>> populated = new IsNot<>(
        new IsEmptyIterable<>()
    );
    new Assertion<>(
        "Nodes must not be empty",
        elements,
        populated
    ).affirm();
    for (final XML element : elements) {
        new Assertion<>(
            String.format(
                "element '%s' must have a documentation",
                element.xpath("@name").get(0)
            ),
            element.xpath("xs:annotation/xs:documentation/text()"),
            populated
        ).affirm();
    }
}
 
Example #7
Source File: XslReport.java    From jpeek with MIT License 6 votes vote down vote up
/**
 * Make XML.
 * @return XML
 * @throws IOException If fails
 * @todo #227:30min Add a test to check whether passing params to
 *  XSLDocument really works. Currently only C3 metric template
 *  is known to use parameter named 'ctors'. However C3.xsl is a
 *  work in progress and has impediments, see #175. In case the
 *  parameter becomes obsolete, consider simplifying construction
 *  of XSLDocument without params (see reviews to #326).
 */
private XML xml() throws IOException {
    return new XMLDocument(
        new Xembler(
            new Directives()
                .xpath("/metric")
                .attr(
                    "xmlns:xsi",
                    "http://www.w3.org/2001/XMLSchema-instance"
                )
                .attr(
                    "xsi:noNamespaceSchemaLocation",
                    XslReport.SCHEMA_FILE
                )
        ).applyQuietly(
            this.calculus.node(
                this.metric, this.params, this.skeleton
            ).node()
        )
    );
}
 
Example #8
Source File: Sigmas.java    From jpeek with MIT License 6 votes vote down vote up
/**
 * Add result.
 * @param dir Directory with files
 * @throws IOException If fails
 */
public void add(final Path dir) throws IOException {
    final XML index = new XMLDocument(
        dir.resolve("index.xml").toFile()
    );
    final double defects = Double.parseDouble(
        index.xpath("/index/@defects").get(0)
    );
    final int classes = Integer.parseInt(
        index.xpath("/index/metric[1]/classes/text()").get(0)
    );
    // @checkstyle MagicNumber (1 line)
    if (defects < 0.15d && classes > 200) {
        for (final XML metric : index.nodes("//metric")) {
            this.add(metric);
        }
    }
}
 
Example #9
Source File: XmlMethodSignatureTest.java    From jpeek with MIT License 6 votes vote down vote up
@Test
void givesArgsForMultipleArgs() throws Exception {
    final XML skeleton = new Skeleton(
        new FakeBase("MethodsWithDiffParamTypes")
    ).xml();
    new Assertion<>(
        "Must create method signature with multiple arguments.",
        new XmlMethodSignature(
            skeleton.nodes("//class").get(0),
            skeleton.nodes("//method[@name='methodThree']").get(0)
        ).asString(),
        new IsEqual<>(
            "MethodsWithDiffParamTypes.methodThree.Ljava/lang/String:I"
        )
    ).affirm();
}
 
Example #10
Source File: XmlMethodSignature.java    From jpeek with MIT License 5 votes vote down vote up
/**
 * Ctor.
 * @param clazz The class element of XML skeleton.
 * @param method The method element of XML skeleton.
 */
public XmlMethodSignature(final XML clazz, final XML method) {
    super(
        new Joined(
            new TextOf("."),
            new TextOf(clazz.xpath("./@id").get(0)),
            new TextOf(method.xpath("@name").get(0)),
            new XmlMethodArgs(method)
        )
    );
}
 
Example #11
Source File: XslCalculusTest.java    From jpeek with MIT License 5 votes vote down vote up
@Test
public void createsXmlCalculusWithEmptyProject() throws IOException {
    final XML result = new XslCalculus().node(
        "LCOM2", new HashMap<>(0), new Skeleton(new FakeBase()).xml()
    );
    new Assertion<>(
        "Report for empty project created",
        result.toString(),
        XhtmlMatchers.hasXPaths(
            "/metric[title='LCOM2']/app[@id]"
        )
    ).affirm();
}
 
Example #12
Source File: XslReport.java    From jpeek with MIT License 5 votes vote down vote up
/**
 * Save report.
 * @param target Target dir
 * @throws IOException If fails
 */
@SuppressWarnings("PMD.GuardLogStatement")
public void save(final Path target) throws IOException {
    final long start = System.currentTimeMillis();
    final XML xml = new StrictXML(
        new ReportWithStatistics(
            this.post.transform(this.xml())
        ),
        XslReport.SCHEMA
    );
    new LengthOf(
        new TeeInput(
            xml.toString(),
            target.resolve(
                String.format("%s.xml", this.metric)
            )
        )
    ).intValue();
    new LengthOf(
        new TeeInput(
            XslReport.STYLESHEET.transform(xml).toString(),
            target.resolve(
                String.format("%s.html", this.metric)
            )
        )
    ).intValue();
    Logger.debug(
        this, "%s.xml generated in %[ms]s",
        this.metric, System.currentTimeMillis() - start
    );
}
 
Example #13
Source File: XslReport.java    From jpeek with MIT License 5 votes vote down vote up
/**
 * Ctor.
 * @param xml Skeleton
 * @param calc Calculus
 * @param data Report data
 * @checkstyle ParameterNumberCheck (10 lines)
 */
XslReport(final XML xml, final Calculus calc, final ReportData data) {
    this.skeleton = xml;
    this.metric = data.metric();
    this.params = data.params();
    this.calculus = calc;
    this.post = new XSLChain(
        new CollectionOf<>(
            new XSLDocument(
                XslReport.class.getResourceAsStream(
                    "xsl/metric-post-colors.xsl"
                )
            ).with("low", data.mean() - data.sigma())
            .with("high", data.mean() + data.sigma()),
            new XSLDocument(
                XslReport.class.getResourceAsStream(
                    "xsl/metric-post-range.xsl"
                )
            ),
            new XSLDocument(
                XslReport.class.getResourceAsStream(
                    "xsl/metric-post-bars.xsl"
                )
            )
        )
    );
}
 
Example #14
Source File: ReportWithStatisticsTest.java    From jpeek with MIT License 5 votes vote down vote up
@Test
public void createsXml() {
    final XML xml = new ReportWithStatistics(
        new XMLDocument("<metric/>")
    );
    final int threads = 10;
    final ExecutorService service = Executors.newFixedThreadPool(threads);
    final CountDownLatch latch = new CountDownLatch(1);
    for (int thread = 0; thread < threads; ++thread) {
        service.submit(
            () -> {
                latch.await();
                xml.toString();
                return null;
            }
        );
    }
    latch.countDown();
    service.shutdown();
    new Assertion<>(
        "Must create report with statics",
        XhtmlMatchers.xhtml(
            xml.toString()
        ),
        XhtmlMatchers.hasXPaths("/metric/statistics[total='0']")
    ).affirm();
}
 
Example #15
Source File: Mistakes.java    From jpeek with MIT License 5 votes vote down vote up
/**
 * Add result.
 * @param dir Directory with files
 * @throws IOException If fails
 */
public void add(final Path dir) throws IOException {
    final XML index = new XMLDocument(
        dir.resolve("index.xml").toFile()
    );
    for (final XML metric : index.nodes("//metric")) {
        this.add(
            metric.xpath("@name").get(0),
            Double.parseDouble(metric.xpath("@diff").get(0))
        );
    }
}
 
Example #16
Source File: XslCalculus.java    From jpeek with MIT License 5 votes vote down vote up
@Override
public XML node(final String metric, final Map<String, Object> params,
    final XML skeleton) throws IOException {
    return new XSLDocument(
        new TextOf(
            new ResourceOf(
                new FormattedText("org/jpeek/metrics/%s.xsl", metric)
            )
        ).asString(),
        Sources.DUMMY,
        params
    ).transform(skeleton);
}
 
Example #17
Source File: XmlMethodArgsTest.java    From jpeek with MIT License 5 votes vote down vote up
@Test
void returnsEmptyStringWhenNoArgsSpecificied() throws IOException {
    final XML method = new Skeleton(new FakeBase("MethodMethodCalls")).xml().nodes(
        "//method[@name='methodOne']"
    ).get(0);
    new Assertion<>(
        "Must returns empty string when method has no arguments",
        new XmlMethodArgs(method).asString(),
        new IsEqual<>("")
    ).affirm();
}
 
Example #18
Source File: XmlMethodArgsTest.java    From jpeek with MIT License 5 votes vote down vote up
@Test
void givesArgsForMultipleArgs() throws IOException {
    final XML method = new Skeleton(new FakeBase("MethodsWithDiffParamTypes")).xml().nodes(
        "//method[@name='methodThree']"
    ).get(0);
    new Assertion<>(
        "Must serialize args when multiple arguments are in the method node",
        new XmlMethodArgs(method).asString(),
        new IsEqual<>(
            "Ljava/lang/String:I"
        )
    ).affirm();
}
 
Example #19
Source File: Ccm.java    From jpeek with MIT License 5 votes vote down vote up
/**
 * Updates the transformed xml with proper NCC value.
 * @param transformed The transformed XML skeleton.
 * @param skeleton XML Skeleton
 * @return XML with fixed NCC.
 */
private static XML withFixedNcc(final XML transformed, final XML skeleton) {
    final List<XML> packages = transformed.nodes("//package");
    for (final XML elt : packages) {
        final String pack = elt.xpath("/@id").get(0);
        final List<XML> classes = elt.nodes("//class");
        for (final XML clazz : classes) {
            Ccm.updateNcc(skeleton, pack, clazz);
        }
    }
    return transformed;
}
 
Example #20
Source File: DyUsage.java    From jare with MIT License 5 votes vote down vote up
@Override
public void add(final Date date, final long bytes) throws IOException {
    final int day = DyUsage.asNumber(date);
    final XML xml = this.xml();
    final String xpath = String.format("/usage/day[@id='%d']/text()", day);
    final List<String> items = xml.xpath(xpath);
    final long before;
    if (items.isEmpty()) {
        before = 0L;
    } else {
        before = Long.parseLong(items.get(0));
    }
    final Node node = xml.node();
    new Xembler(
        new Directives()
            .xpath(xpath).up().remove()
            .xpath("/usage").add("day").attr("id", day).set(before + bytes)
    ).applyQuietly(node);
    new Xembler(
        new Directives().xpath(
            String.format(
                "/usage/day[number(@id) < %d]",
                DyUsage.asNumber(DateUtils.addDays(new Date(), -Tv.THIRTY))
            )
        ).remove()
    ).applyQuietly(node);
    final XML after = new XMLDocument(node);
    this.save(after.toString());
    this.save(Long.parseLong(after.xpath("sum(/usage/day)").get(0)));
}
 
Example #21
Source File: DyUsage.java    From jare with MIT License 5 votes vote down vote up
@Override
public SortedMap<Date, Long> history() throws IOException {
    final SortedMap<Date, Long> map = new TreeMap<>();
    for (final XML day : this.xml().nodes("/usage/day")) {
        map.put(
            DyUsage.asDate(Integer.parseInt(day.xpath("@id").get(0))),
            Long.parseLong(day.xpath("text()").get(0))
        );
    }
    return map;
}
 
Example #22
Source File: DyUsage.java    From jare with MIT License 5 votes vote down vote up
/**
 * Load XML.
 * @return The XML with usage
 * @throws IOException If fails
 */
private XML xml() throws IOException {
    if (!this.item.has("usage")) {
        this.save("<usage/>");
    }
    return new XMLDocument(this.item.get("usage").getS());
}
 
Example #23
Source File: ReportWithStatistics.java    From jpeek with MIT License 4 votes vote down vote up
@Override
public List<XML> nodes(final String query) {
    return this.output.value().nodes(query);
}
 
Example #24
Source File: ReportWithStatistics.java    From jpeek with MIT License 4 votes vote down vote up
@Override
public XML merge(final NamespaceContext context) {
    return this.output.value().merge(context);
}
 
Example #25
Source File: ReportWithStatistics.java    From jpeek with MIT License 4 votes vote down vote up
@Override
public XML registerNs(final String prefix, final Object uri) {
    return this.output.value().registerNs(prefix, uri);
}
 
Example #26
Source File: ReportWithStatistics.java    From jpeek with MIT License 4 votes vote down vote up
/**
 * Ctor.
 * @param xml The XML
 */
ReportWithStatistics(final XML xml) {
    this.output = new Unchecked<>(
        new Solid<XML>(
            () -> {
                final Collection<Double> values = new Mapped<>(
                    Double::parseDouble,
                    xml.xpath(
                        // @checkstyle LineLength (1 line)
                        "//class[@value<=/metric/max and @value>=/metric/min]/@value"
                    )
                );
                final double total = (double) values.size();
                double sum = 0.0d;
                for (final Double value : values) {
                    sum += value;
                }
                final double mean = sum / total;
                double squares = 0.0d;
                for (final Double value : values) {
                    squares += Math.pow(value - mean, 2.0d);
                }
                final double variance = squares / total;
                final double sigma = Math.sqrt(variance);
                double defects = 0.0d;
                for (final Double value : values) {
                    if (value < mean - sigma || value > mean + sigma) {
                        ++defects;
                    }
                }
                return new XMLDocument(
                    new Xembler(
                        new Directives()
                            .xpath("/metric")
                            .add("statistics")
                            .add("total").set(xml.nodes("//class").size())
                            .up()
                            .add("elements").set((long) total).up()
                            .add("mean").set(Double.toString(mean)).up()
                            .add("sigma").set(Double.toString(sigma)).up()
                            .add("variance").set(Double.toString(variance))
                            .up()
                            .add("defects")
                            .set(Double.toString(defects / total)).up()
                    ).applyQuietly(xml.node())
                );
            }
        )
    );
}
 
Example #27
Source File: Index.java    From jpeek with MIT License 4 votes vote down vote up
/**
 * Metric to Xembly.
 * @param file The XML file with metric report
 * @return Xembly
 * @throws FileNotFoundException If fails
 */
private static Iterable<Directive> metric(final Path file)
    throws FileNotFoundException {
    final String name = file.getFileName()
        .toString().replaceAll("\\.xml$", "");
    final XML xml = new XMLDocument(file.toFile());
    final List<Double> values = new Sorted<>(
        new org.cactoos.list.Mapped<>(
            Double::parseDouble,
            xml.xpath("//class[@element='true' and @value!='NaN']/@value")
        )
    );
    final double green = (double) xml.nodes(
        "//*[@element='true' and @color='green']"
    ).size();
    final double yellow = (double) xml.nodes(
        "//*[@element='true' and @color='yellow']"
    ).size();
    final double red = (double) xml.nodes(
        "//*[@element='true' and @color='red']"
    ).size();
    double all = green + yellow + red;
    if (all == 0.0d) {
        all = 1.0d;
    }
    final double score = 10.0d
        * (green + yellow * 0.25d + red * 0.05d) / all;
    final Directives dirs = new Directives()
        .add("metric")
        .attr("name", name)
        .add("html").set(String.format("%s.html", name)).up()
        .add("xml").set(String.format("%s.xml", name)).up()
        .add("elements").set(values.size()).up()
        .add("classes").set(xml.nodes("//class").size()).up()
        .add("green").set((int) green).up()
        .add("yellow").set((int) yellow).up()
        .add("red").set((int) red).up()
        .add("score").set(score).up()
        .add("reverse")
        .set(
            Boolean.toString(
                Double.parseDouble(xml.xpath("/metric/colors/@high").get(0))
                > Double.parseDouble(
                    xml.xpath("/metric/colors/@low").get(0)
                )
            )
        )
        .up();
    if (!values.isEmpty()) {
        dirs.add("min").set(values.get(0)).up()
            .add("max").set(values.get(values.size() - 1)).up();
    }
    final Iterator<XML> bars = xml.nodes("/metric/bars").iterator();
    if (bars.hasNext()) {
        dirs.add("bars").append(Directives.copyOf(bars.next().node())).up();
    }
    final Iterator<XML> stats = xml.nodes("/metric/statistics").iterator();
    if (stats.hasNext()) {
        final XML stat = stats.next();
        dirs.add("defects").set(stat.xpath("defects/text()").get(0)).up()
            .add("sigma").set(stat.xpath("sigma/text()").get(0)).up()
            .add("mean").set(stat.xpath("mean/text()").get(0)).up();
    }
    return dirs.up();
}
 
Example #28
Source File: Results.java    From jpeek with MIT License 4 votes vote down vote up
/**
 * Add result.
 * @param artifact The artifact, like "org.jpeek:jpeek"
 * @param dir Directory with files
 * @throws IOException If fails
 */
public void add(final String artifact, final Path dir)
    throws IOException {
    final XML index = new XMLDocument(
        dir.resolve("index.xml").toFile()
    );
    final int elements = Integer.parseInt(
        index.xpath("max(/index/metric/elements/number(text()))").get(0)
    );
    final Number diff = new DyNum(index.xpath("/index/@diff").get(0));
    final long score = new DyNum(
        index.xpath("/index/@score").get(0)
    ).longValue();
    final long rank = (long) ((double) score * (1.0d - diff.doubleValue()));
    // @checkstyle MagicNumber (1 line)
    if (elements < 100) {
        Logger.info(
            this, "%d elements NOT saved for %s by %s, rank=%d, score=%d, metrics=%d",
            elements, artifact, new Version().value(), rank, score,
            Integer.parseInt(index.xpath("count(/index/metric)").get(0))
        );
    } else {
        this.table.put(
            new Attributes()
                .with("good", "true")
                .with("artifact", artifact)
                .with("rank", rank)
                .with("score", score)
                .with("diff", diff.longValue())
                .with(
                    "defects",
                    new DyNum(
                        index.xpath("/index/@defects").get(0)
                    ).longValue()
                )
                .with("elements", elements)
                .with(
                    "classes",
                    Integer.parseInt(
                        index.xpath(
                            "/index/metric[1]/classes/text()"
                        ).get(0)
                    )
                )
                .with("version", new Version().value())
                .with("added", System.currentTimeMillis())
                .with(
                    "ttl",
                    System.currentTimeMillis()
                        / TimeUnit.SECONDS.toMillis(1L)
                        // @checkstyle MagicNumber (1 line)
                        + TimeUnit.DAYS.toSeconds(100L)
                )
        );
        Logger.info(
            this, "%d elements saved for %s by %s, rank=%d, score=%d",
            elements, artifact, new Version().value(), rank, score
        );
    }
}
 
Example #29
Source File: Sigmas.java    From jpeek with MIT License 4 votes vote down vote up
/**
 * Add one metric.
 * @param metric XML with metric
 * @throws IOException If fails
 */
private void add(final XML metric) throws IOException {
    final Item item;
    final Iterator<Item> items = this.table.frame()
        .through(
            new QueryValve()
                .withLimit(1)
                .withSelect(Select.ALL_ATTRIBUTES)
        )
        .where("metric", metric.xpath("@name").get(0))
        .where("version", new Version().value())
        .iterator();
    if (items.hasNext()) {
        item = items.next();
    } else {
        item = this.table.put(
            new Attributes()
                .with("metric", metric.xpath("@name").get(0))
                .with("version", new Version().value())
                .with("artifact", "?")
                .with("champions", 0L)
                // @checkstyle MagicNumber (2 lines)
                .with("mean", new DyNum(0.5d).longValue())
                .with("sigma", new DyNum(0.1d).longValue())
        );
    }
    final double mean = Double.parseDouble(
        metric.xpath("mean/text()").get(0)
    );
    final double sigma = Double.parseDouble(
        metric.xpath("sigma/text()").get(0)
    );
    final boolean reverse = Boolean.parseBoolean(
        metric.xpath("reverse/text()").get(0)
    );
    final double mbefore = new DyNum(item, "mean").doubleValue();
    final double sbefore = new DyNum(item, "sigma").doubleValue();
    // @checkstyle BooleanExpressionComplexityCheck (1 line)
    if (sigma < sbefore || mean < mbefore && reverse
        || mean > mbefore && !reverse) {
        item.put(
            new AttributeUpdates()
                .with("artifact", metric.xpath("/index/@artifact").get(0))
                .with(
                    "champions",
                    new AttributeValueUpdate()
                        .withValue(new AttributeValue().withN("1"))
                        .withAction(AttributeAction.ADD)
                )
                .with("mean", new DyNum(mean).update())
                .with("sigma", new DyNum(sigma).update())
        );
    }
}
 
Example #30
Source File: Ccm.java    From jpeek with MIT License 3 votes vote down vote up
/**
 * Updates the xml node of the class with proper NCC value.
 * @param skeleton XML Skeleton
 * @param pack Package name
 * @param clazz Class node in the resulting xml
 * @todo #449:30min Implement NCC calculation with `XmlGraph` and use this
 *  class to fix CCM metric (see issue #449). To do this, this class, once
 *  it works correctly, should be integrated with XSL based calculuses in
 *  `XslReport` (see `todo #449` in Calculus). Write a test to make sure
 *  the metric is calculated correctly. Also, decide whether the
 *  whole CCM metric should be implemented in Java, or only the NCC part.
 *  Update this `todo` accordingly.
 */
private static void updateNcc(
    final XML skeleton, final String pack, final XML clazz
) {
    throw new UnsupportedOperationException(
        new Joined(
            "",
            skeleton.toString(),
            pack,
            clazz.toString()
        ).toString()
    );
}