Skip to content

Commit 7d6443f

Browse files
committed
Deprecate DefaultEntityResolver.resolveEntity(String) for removal.
See #1
1 parent 4a0afad commit 7d6443f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

junit/io/sf/carte/doc/xml/dtd/DefaultEntityResolverTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public void resolveEntityStringStringRemote() throws SAXException, IOException {
164164

165165
@Test
166166
public void resolveEntityString() throws SAXException, IOException {
167+
@SuppressWarnings("removal")
167168
InputSource isrc = resolver.resolveEntity(DocumentTypeDeclaration.XHTML1_TRA_DTDECL);
168169
assertNotNull(isrc);
169170
assertNotNull(isrc.getPublicId());
@@ -173,6 +174,7 @@ public void resolveEntityString() throws SAXException, IOException {
173174
re.close();
174175
}
175176

177+
@SuppressWarnings("removal")
176178
@Test
177179
public void resolveNonexistentDeclaration() {
178180
try {

src/io/sf/carte/doc/xml/dtd/DefaultEntityResolver.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -516,18 +516,22 @@ public InputSource resolveEntity(DocumentType dtDecl) throws SAXException, IOExc
516516
}
517517

518518
/**
519-
* Resolve the given DTD.
520-
* <p>
521-
* This method is deprecated, use any of the other variants.
522-
* </p>
519+
* Resolve the given DTD string.
523520
*
524521
* @param documentTypeDeclaration the document type declaration.
525522
* @return an InputSource object describing the new input source to be used by
526523
* the parser.
527524
* @throws SAXException Any SAX exception, possibly wrapping another exception.
528525
* @throws IOException indicating a failure to create a new InputStream or
529526
* Reader, or an illegal URL.
527+
* @deprecated This method uses the {@link DocumentTypeDeclaration} type, which
528+
* carries a dependency with the {@code jclf-text} module, and is
529+
* going to be removed to make the class a bit lighter. People
530+
* needing this functionality can always parse the DTD string on
531+
* their own with {@link DocumentTypeDeclaration#parse(String)} and
532+
* then call {@link #resolveEntity(String, String, String, String)}.
530533
*/
534+
@Deprecated(forRemoval=true)
531535
public InputSource resolveEntity(String documentTypeDeclaration) throws SAXException, IOException {
532536
DocumentTypeDeclaration dtDecl = DocumentTypeDeclaration.parse(documentTypeDeclaration);
533537
return resolveEntity(dtDecl.getName(), dtDecl.getPublicId(), null, dtDecl.getSystemId());

0 commit comments

Comments
 (0)