Return-Path: Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: (qmail 7906 invoked from network); 28 Jan 2010 18:57:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2010 18:57:12 -0000 Received: (qmail 73893 invoked by uid 500); 28 Jan 2010 18:57:12 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 73841 invoked by uid 500); 28 Jan 2010 18:57:12 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 73831 invoked by uid 99); 28 Jan 2010 18:57:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 18:57:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 18:57:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5823F23889DA; Thu, 28 Jan 2010 18:56:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r904214 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/resources: ArchiveResource.java CompressedResource.java ContentTransformingResource.java JavaConstantResource.java MappedResource.java MappedResourceCollection.java Date: Thu, 28 Jan 2010 18:56:51 -0000 To: notifications@ant.apache.org From: mbenson@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100128185651.5823F23889DA@eris.apache.org> Author: mbenson Date: Thu Jan 28 18:56:50 2010 New Revision: 904214 URL: http://svn.apache.org/viewvc?rev=904214&view=rev Log: javadoc/formatting/protected constructors for abstract classes Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ArchiveResource.java Thu Jan 28 18:56:50 2010 @@ -42,7 +42,7 @@ /** * Default constructor. */ - public ArchiveResource() { + protected ArchiveResource() { } /** @@ -50,7 +50,7 @@ * entry in the specified archive. * @param a the archive as File. */ - public ArchiveResource(File a) { + protected ArchiveResource(File a) { this(a, false); } @@ -60,7 +60,7 @@ * @param a the archive as File. * @param withEntry if the entry has been specified. */ - public ArchiveResource(File a, boolean withEntry) { + protected ArchiveResource(File a, boolean withEntry) { setArchive(a); haveEntry = withEntry; } @@ -71,7 +71,7 @@ * @param a the archive as Resource. * @param withEntry if the entry has been specified. */ - public ArchiveResource(Resource a, boolean withEntry) { + protected ArchiveResource(Resource a, boolean withEntry) { addConfigured(a); haveEntry = withEntry; } @@ -242,6 +242,10 @@ : getArchive().toString() + ':' + getName(); } + /** + * Validate settings and ensure that the represented "archive entry" + * has been established. + */ protected final synchronized void checkEntry() throws BuildException { dieOnCircularReference(); if (haveEntry) { @@ -266,10 +270,13 @@ } /** - * fetches information from the named entry inside the archive. + * Fetch information from the named entry inside the archive. */ protected abstract void fetchEntry(); + /** + * {@inheritDoc} + */ protected synchronized void dieOnCircularReference(Stack stk, Project p) { if (isChecked()) { return; Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/CompressedResource.java Thu Jan 28 18:56:50 2010 @@ -31,14 +31,14 @@ public abstract class CompressedResource extends ContentTransformingResource { /** no arg constructor */ - public CompressedResource() { + protected CompressedResource() { } /** * Constructor with another resource to wrap. * @param other the resource to wrap. */ - public CompressedResource(ResourceCollection other) { + protected CompressedResource(ResourceCollection other) { addConfigured(other); } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java Thu Jan 28 18:56:50 2010 @@ -26,7 +26,7 @@ import org.apache.tools.ant.util.FileUtils; /** - * A compressed resource. + * A resource that transforms the content of another resource. * *

Wraps around another resource, delegates all queries (except * getSize) to that other resource but transforms stream content @@ -39,14 +39,14 @@ private static final int BUFFER_SIZE = 8192; /** no arg constructor */ - public ContentTransformingResource() { + protected ContentTransformingResource() { } /** * Constructor with another resource to wrap. * @param other the resource to wrap. */ - public ContentTransformingResource(ResourceCollection other) { + protected ContentTransformingResource(ResourceCollection other) { super(other); } @@ -121,7 +121,7 @@ if (a != null) { return new Appendable() { public OutputStream getAppendOutputStream() - throws IOException { + throws IOException { OutputStream out = a.getAppendOutputStream(); if (out != null) { out = wrapStream(out); @@ -139,7 +139,7 @@ } /** - * whether the transformation performed allows appends. + * Learn whether the transformation performed allows appends. * *

In general compressed outputs will become invalid if they * are appended to, for example.

@@ -151,7 +151,7 @@ } /** - * Is supposed to wrap the stream. + * Get a content-filtering/transforming InputStream. * * @param in InputStream to wrap, will never be null. * @return a compressed inputstream. @@ -161,7 +161,7 @@ throws IOException; /** - * Is supposed to wrap the stream to allow transformation on the fly. + * Get a content-filtering/transforming OutputStream. * * @param out OutputStream to wrap, will never be null. * @return a compressed outputstream. Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/JavaConstantResource.java Thu Jan 28 18:56:50 2010 @@ -25,8 +25,7 @@ /** * A resource that is a java constant. * This lets you extract values off the classpath and use them elsewhere - * @since Ant1.7 - * + * @since Ant 1.7 */ public class JavaConstantResource extends AbstractClasspathResource { @@ -67,5 +66,4 @@ } } - } Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java Thu Jan 28 18:56:50 2010 @@ -35,6 +35,8 @@ /** * Wraps an existing resource. + * @param r Resource to wrap + * @param m FileNameMapper that handles mapping */ public MappedResource(Resource r, FileNameMapper m) { super(r); @@ -48,14 +50,14 @@ String name = getResource().getName(); if (isReference()) { return name; - } else { - String[] mapped = mapper.mapFileName(name); - return mapped != null && mapped.length > 0 ? mapped[0] : null; } + String[] mapped = mapper.mapFileName(name); + return mapped != null && mapped.length > 0 ? mapped[0] : null; } /** * Not really supported since mapper is never null. + * @param r reference to set */ public void setRefid(Reference r) { if (mapper != null) { @@ -66,10 +68,11 @@ /** * Suppress FileProvider + * @param clazz the type to implement */ public Object as(Class clazz) { return FileProvider.class.isAssignableFrom(clazz) - ? null : getResource().as(clazz); + ? null : getResource().as(clazz); } -} \ No newline at end of file +} Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java?rev=904214&r1=904213&r2=904214&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResourceCollection.java Thu Jan 28 18:56:50 2010 @@ -35,7 +35,7 @@ * @since Ant 1.8.0 */ public class MappedResourceCollection - extends DataType implements ResourceCollection, Cloneable { + extends DataType implements ResourceCollection, Cloneable { private ResourceCollection nested = null; private Mapper mapper = null; @@ -86,7 +86,7 @@ } /** - * @return false + * {@inheritDoc} */ public boolean isFilesystemOnly() { if (isReference()) { @@ -98,7 +98,7 @@ } /** - * @return size of the nested resource collection. + * {@inheritDoc} */ public int size() { if (isReference()) { @@ -108,6 +108,9 @@ return nested.size(); } + /** + * {@inheritDoc} + */ public Iterator iterator() { if (isReference()) { return ((MappedResourceCollection) getCheckedRef()).iterator(); @@ -128,8 +131,7 @@ } /** - * Implement clone. The nested resource collection and mapper are - * copied. + * Implement clone. The nested resource collection and mapper are copied. * @return a cloned instance. */ public Object clone() { @@ -204,4 +206,4 @@ throw new UnsupportedOperationException(); } } -} \ No newline at end of file +}