[GitHub] ant pull request #79: Make DataType and Reference generic

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
GitHub user twogee opened a pull request:

    https://github.com/apache/ant/pull/79

    Make DataType and Reference generic

   

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/twogee/ant checked-reference

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ant/pull/79.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #79
   
----
commit 92fa54249840615df5658c5eb4b27bdb0700810f
Author: twogee <g.grigelionis@...>
Date:   2018-08-26T05:42:26Z

    Make DataType and Reference generic

commit 53dfa2cd3168cd3bba10ef4dd526add2b7169721
Author: twogee <g.grigelionis@...>
Date:   2018-11-07T06:48:44Z

    Deprecate the old API

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Windows/91/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Linux/85/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Windows/93/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Linux/87/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232665835
 
    --- Diff: src/main/org/apache/tools/ant/taskdefs/optional/extension/ExtensionSet.java ---
    @@ -34,8 +34,7 @@
      *
      * @ant.datatype name="extension-set"
      */
    -public class ExtensionSet
    -    extends DataType {
    +public class ExtensionSet extends DataType {
    --- End diff --
   
    please keep whitespace changes separate from PRs (or better just don't create them at all)



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232666118
 
    --- Diff: src/main/org/apache/tools/ant/types/AbstractFileSet.java ---
    @@ -915,7 +920,7 @@ public String toString() {
         @Override
         public synchronized Object clone() {
             if (isReference()) {
    -            return (getRef(getProject())).clone();
    +            return getRef(getProject()).clone();
    --- End diff --
   
    please keep style changes separate from PRs (or better just don't create them at all)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232667496
 
    --- Diff: src/main/org/apache/tools/ant/types/ArchiveFileSet.java ---
    @@ -574,11 +570,8 @@ public int getDirMode() {
          * fileset if the project has been set).
          */
         private void checkArchiveAttributesAllowed() {
    -        if (getProject() == null
    -            || (isReference()
    -                && (getRefid().getReferencedObject(
    -                        getProject())
    -                    instanceof ArchiveFileSet))) {
    +        if (getProject() == null || (isReference()
    +                && getRefid().getReferencedObject(getProject()) instanceof ArchiveFileSet)) {
    --- End diff --
   
    please keep whitespace changes separate from PRs (or better just don't create them at all)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232667773
 
    --- Diff: src/main/org/apache/tools/ant/types/DataType.java ---
    @@ -196,24 +196,44 @@ public static void pushAndInvokeCircularReferenceCheck(DataType dt,
         /**
          * Performs the check for circular references and returns the
          * referenced object.
    +     * @param <T> required reference type
          * @return the dereferenced object.
          * @throws BuildException if the reference is invalid (circular ref, wrong class, etc).
          * @since Ant 1.7
    +     * @deprecated use getCheckedRef(Class)
          */
    -    protected Object getCheckedRef() {
    +    @Deprecated
    +    protected <T> T getCheckedRef() {
             return getCheckedRef(getProject());
         }
     
         /**
          * Performs the check for circular references and returns the
          * referenced object.
    +     * @param <T> required reference type
    +     * @param requiredClass the class that this reference should be a subclass of.
    +     * @return the dereferenced object.
    +     * @throws BuildException if the reference is invalid (circular ref, wrong class, etc).
    +     * @since Ant 1.10
    --- End diff --
   
    needs the patch version


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232668389
 
    --- Diff: src/main/org/apache/tools/ant/types/FileList.java ---
    @@ -98,6 +98,13 @@ public File getDir(Project p) {
             return dir;
         }
     
    +    /**
    --- End diff --
   
    please remove the unrelated new method


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232668570
 
    --- Diff: src/main/org/apache/tools/ant/types/FileList.java ---
    @@ -137,13 +144,10 @@ public void setFiles(String filenames) {
         }
     
         /**
    -     * Performs the check for circular references and returns the
    -     * referenced FileList.
    -     * @param p the current project
    -     * @return the FileList represented by a referenced filelist.
    +     * @return the list of files represented by this FileList.
          */
    -    protected FileList getRef(Project p) {
    -        return (FileList) getCheckedRef(p);
    +    public String[] getFiles() {
    --- End diff --
   
    please remove the unrelated new method


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232669102
 
    --- Diff: src/main/org/apache/tools/ant/types/FilterSet.java ---
    @@ -235,8 +235,8 @@ protected FilterSet(FilterSet filterset) {
          *
          * @return the filterset from the reference.
          */
    -    protected FilterSet getRef() {
    --- End diff --
   
    this is not backwards compatible


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232669259
 
    --- Diff: src/main/org/apache/tools/ant/types/Path.java ---
    @@ -721,7 +721,7 @@ public synchronized boolean isFilesystemOnly() {
          * @return the passed in ResourceCollection.
          */
         protected ResourceCollection assertFilesystemOnly(ResourceCollection rc) {
    -        if (rc != null && !(rc.isFilesystemOnly())) {
    +        if (rc != null && !rc.isFilesystemOnly()) {
    --- End diff --
   
    please keep style changes separate from PRs (or better just don't create them at all)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232669396
 
    --- Diff: src/main/org/apache/tools/ant/types/PropertySet.java ---
    @@ -424,8 +424,8 @@ private void addPropertyNames(Set<String> names, Map<String, Object> props) {
          * referenced PropertySet.
          * @return the referenced PropertySet.
          */
    -    protected PropertySet getRef() {
    -        return getCheckedRef(PropertySet.class, "propertyset");
    +    private PropertySet getRef() {
    --- End diff --
   
    this is not backwards compatible


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant pull request #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/79#discussion_r232669831
 
    --- Diff: src/main/org/apache/tools/ant/types/TarFileSet.java ---
    @@ -263,9 +273,7 @@ public Object clone() {
         private void checkTarFileSetAttributesAllowed() {
             if (getProject() == null
                 || (isReference()
    -                && (getRefid().getReferencedObject(
    --- End diff --
   
    please keep whitespace changes separate from PRs (or better just don't create them at all)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user bodewig commented on the issue:

    https://github.com/apache/ant/pull/79
 
    Apart from my comments this looks good to me, thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Windows/96/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Linux/90/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Windows/97/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] ant issue #79: Make DataType and Reference generic

asfgit
In reply to this post by asfgit
Github user asfgit commented on the issue:

    https://github.com/apache/ant/pull/79
 
   
    Refer to this link for build results (access rights to CI server needed):
    https://builds.apache.org/job/Ant%20Github-PR-Linux/91/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12