Reduce importance of parser options

This commit is contained in:
Clément Fournier
2020-12-12 21:13:12 +01:00
parent 83edce05c1
commit 79def1b51d
25 changed files with 182 additions and 459 deletions

View File

@ -5,7 +5,6 @@
package net.sourceforge.pmd.lang.xml;
import java.io.ByteArrayInputStream;
import java.util.Objects;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@ -199,8 +198,7 @@ public class XmlParserOptions extends ParserOptions {
return false;
}
final XmlParserOptions that = (XmlParserOptions) obj;
return Objects.equals(this.getSuppressMarker(), that.getSuppressMarker())
&& this.coalescing == that.coalescing && this.expandEntityReferences == that.expandEntityReferences
return this.coalescing == that.coalescing && this.expandEntityReferences == that.expandEntityReferences
&& this.ignoringComments == that.ignoringComments
&& this.ignoringElementContentWhitespace == that.ignoringElementContentWhitespace
&& this.namespaceAware == that.namespaceAware && this.validating == that.validating

View File

@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.xml;
import static net.sourceforge.pmd.lang.ParserOptionsTestUtils.verifyOptionsEqualsHashcode;
import static net.sourceforge.pmd.util.CollectionUtil.listOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@ -86,9 +85,6 @@ public class XmlParserOptionsTest {
public void testSetters() {
XmlParserOptions options = new XmlParserOptions();
options.setSuppressMarker("foo");
assertEquals("foo", options.getSuppressMarker());
options.setCoalescing(true);
assertTrue(options.isCoalescing());
options.setCoalescing(false);
@ -148,15 +144,6 @@ public class XmlParserOptionsTest {
verifyOptionsEqualsHashcode(options1, options2, options3, options4);
}
XmlParserOptions options1 = new XmlParserOptions();
options1.setSuppressMarker("foo");
XmlParserOptions options2 = new XmlParserOptions();
options2.setSuppressMarker("bar");
XmlParserOptions options3 = new XmlParserOptions();
options3.setSuppressMarker("foo");
XmlParserOptions options4 = new XmlParserOptions();
options4.setSuppressMarker("bar");
verifyOptionsEqualsHashcode(options1, options2, options3, options4);
}
private static final class MyRule extends AbstractXmlRule {