diff --git a/README.md b/README.md index 388ec7f3..30fb1464 100644 --- a/README.md +++ b/README.md @@ -482,7 +482,7 @@ pmd_binary( | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name | The name of the target | none | -| main_class | The main class to use for PMD. | `"net.sourceforge.pmd.PMD"` | +| main_class | The main class to use for PMD. | `"net.sourceforge.pmd.cli.PmdCli"` | | deps | The deps required for compiling this binary. May be omitted. | `None` | | runtime_deps | The deps required by PMD at runtime. May be omitted. | `None` | | srcs | If you're compiling your own PMD binary, the sources to use. | `None` | diff --git a/java/test/com/github/bazel_contrib/contrib_rules_jvm/junit5/SafeXmlTest.java b/java/test/com/github/bazel_contrib/contrib_rules_jvm/junit5/SafeXmlTest.java index 6d4c2e3b..427a6b9a 100644 --- a/java/test/com/github/bazel_contrib/contrib_rules_jvm/junit5/SafeXmlTest.java +++ b/java/test/com/github/bazel_contrib/contrib_rules_jvm/junit5/SafeXmlTest.java @@ -1,48 +1,47 @@ package com.github.bazel_contrib.contrib_rules_jvm.junit5; -import org.junit.jupiter.api.Test; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; +import static org.junit.jupiter.api.Assertions.assertEquals; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.io.StringWriter; +import java.io.Writer; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; - -import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; public class SafeXmlTest { - @Test - public void properlyEscapesCDataSection() - throws XMLStreamException, ParserConfigurationException, IOException, SAXException { - try (Writer writer = new StringWriter()) { - XMLStreamWriter xml = XMLOutputFactory.newDefaultFactory().createXMLStreamWriter(writer); + @Test + public void properlyEscapesCDataSection() + throws XMLStreamException, ParserConfigurationException, IOException, SAXException { + try (Writer writer = new StringWriter()) { + XMLStreamWriter xml = XMLOutputFactory.newDefaultFactory().createXMLStreamWriter(writer); - xml.writeStartDocument("UTF-8", "1.0"); - // Output the "end of cdata" marker - SafeXml.writeTextElement(xml, "container", "]]>"); - xml.writeEndDocument(); + xml.writeStartDocument("UTF-8", "1.0"); + // Output the "end of cdata" marker + SafeXml.writeTextElement(xml, "container", "]]>"); + xml.writeEndDocument(); - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder builder; - try (Reader reader = new StringReader(writer.toString())) { - builder = factory.newDocumentBuilder(); - Document parsed = builder.parse(new InputSource(reader)); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder; + try (Reader reader = new StringReader(writer.toString())) { + builder = factory.newDocumentBuilder(); + Document parsed = builder.parse(new InputSource(reader)); - Node container = parsed.getElementsByTagName("container").item(0); + Node container = parsed.getElementsByTagName("container").item(0); - assertEquals("]]>", container.getTextContent()); - } - } + assertEquals("]]>", container.getTextContent()); + } } -} \ No newline at end of file + } +}