Skip to content

Commit bc5c85d

Browse files
Bananeweizenromani
authored andcommitted
infra: re-enable IllegalInstantiation check
1 parent c91505c commit bc5c85d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

config/checkstyle_checks.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,15 @@
202202
<property name="ignoreSetter" value="true"/>
203203
<property name="setterCanReturnItsClass" value="true"/>
204204
</module>
205+
<module name="IllegalInstantiation">
206+
<property name="classes"
207+
value="org.xml.sax.SAXException, org.xml.sax.SAXParseException,
208+
org.apache.commons.beanutils.ConversionException,
209+
org.antlr.v4.runtime.misc.ParseCancellationException,
210+
antlr.RecognitionException, antlr.TokenStreamException,
211+
antlr.TokenStreamRecognitionException, antlr.ANTLRException,
212+
java.lang.StringBuffer"/>
213+
</module>
205214
<module name="IllegalThrows"/>
206215
<module name="IllegalTokenText">
207216
<property name="tokens" value="STRING_LITERAL"/>

net.sf.eclipsecs.core/src/net/sf/eclipsecs/core/util/XMLUtil.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private XMLUtil() {
4545

4646
/**
4747
* Creates a pretty printed representation of the document as a byte array.
48-
*
48+
*
4949
* @param document
5050
* the document
5151
* @return the document as a byte array (UTF-8)
@@ -66,7 +66,7 @@ public static byte[] toByteArray(Document document) throws IOException {
6666

6767
/**
6868
* Entity resolver which handles mapping public DTDs to internal DTD resource.
69-
*
69+
*
7070
* @author Lars Ködderitzsch
7171
*/
7272
public static class InternalDtdEntityResolver implements EntityResolver {
@@ -75,7 +75,7 @@ public static class InternalDtdEntityResolver implements EntityResolver {
7575

7676
/**
7777
* Creates the entity resolver using a mapping of public DTD name to internal DTD resource.
78-
*
78+
*
7979
* @param public2InternalDtdMap
8080
* the public2internal DTD mapping
8181
*/
@@ -95,6 +95,7 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc
9595

9696
final InputStream dtdIS = getClass().getClassLoader().getResourceAsStream(dtdResourceName);
9797
if (dtdIS == null) {
98+
// -@cs[IllegalInstantiation] SAXException is in the overridden method signature
9899
throw new SAXException("Unable to load internal dtd " + dtdResourceName); //$NON-NLS-1$
99100
}
100101
return new InputSource(dtdIS);

0 commit comments

Comments
 (0)