Browse Source

checkstyle - javadoc + change name of _catalog

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277894 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
0773ce82fc
2 changed files with 16 additions and 8 deletions
  1. +5
    -1
      src/main/org/apache/tools/ant/types/resolver/ApacheCatalog.java
  2. +11
    -7
      src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java

+ 5
- 1
src/main/org/apache/tools/ant/types/resolver/ApacheCatalog.java View File

@@ -51,6 +51,7 @@ public class ApacheCatalog extends Catalog {
* instance of itself for each external catalog file processed. * instance of itself for each external catalog file processed.
* That is, if two external catalog files are processed, there * That is, if two external catalog files are processed, there
* will be a total of two ApacheCatalog instances, and so on.</p> * will be a total of two ApacheCatalog instances, and so on.</p>
* @return the catalog.
*/ */
protected Catalog newCatalog() { protected Catalog newCatalog() {
ApacheCatalog cat = (ApacheCatalog) super.newCatalog(); ApacheCatalog cat = (ApacheCatalog) super.newCatalog();
@@ -58,7 +59,10 @@ public class ApacheCatalog extends Catalog {
return cat; return cat;
} }


/** Set the resolver object to callback. */
/**
* Set the resolver object to callback.
* @param resolver the apache catalog resolver.
*/
public void setResolver(ApacheCatalogResolver resolver) { public void setResolver(ApacheCatalogResolver resolver) {
this.resolver = resolver; this.resolver = resolver;
} }


+ 11
- 7
src/main/org/apache/tools/ant/types/resolver/ApacheCatalogResolver.java View File

@@ -89,7 +89,10 @@ public class ApacheCatalogResolver extends CatalogResolver {
// CatalogManager.getStaticManager().setVerbosity(4); // CatalogManager.getStaticManager().setVerbosity(4);
} }


/** Set the XMLCatalog object to callback. */
/**
* Set the XMLCatalog object to callback.
* @param xmlCatalog the XMLCatalog to use.
*/
public void setXMLCatalog(XMLCatalog xmlCatalog) { public void setXMLCatalog(XMLCatalog xmlCatalog) {
this.xmlCatalog = xmlCatalog; this.xmlCatalog = xmlCatalog;
} }
@@ -97,20 +100,21 @@ public class ApacheCatalogResolver extends CatalogResolver {
/** /**
* XMLCatalog calls this to add an external catalog file for each * XMLCatalog calls this to add an external catalog file for each
* file within a <code>&lt;catalogfiles&gt;</code> fileset. * file within a <code>&lt;catalogfiles&gt;</code> fileset.
* @param file the external catalog file.
*/ */
public void parseCatalog(String file) { public void parseCatalog(String file) {


Catalog _catalog = getCatalog();
if (!(_catalog instanceof ApacheCatalog)) {
throw new BuildException("Wrong catalog type found: " + _catalog.getClass().getName());
Catalog catalog = getCatalog();
if (!(catalog instanceof ApacheCatalog)) {
throw new BuildException("Wrong catalog type found: " + catalog.getClass().getName());
} }
ApacheCatalog catalog = (ApacheCatalog) _catalog;
ApacheCatalog apacheCatalog = (ApacheCatalog) catalog;


// Pass in reference to ourselves so we can be called back. // Pass in reference to ourselves so we can be called back.
catalog.setResolver(this);
apacheCatalog.setResolver(this);


try { try {
catalog.parseCatalog(file);
apacheCatalog.parseCatalog(file);
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
throw new BuildException(ex); throw new BuildException(ex);
} catch (IOException ex) { } catch (IOException ex) {


Loading…
Cancel
Save