[GitHub] ant-ivy pull request #52: Generics in core

2017-07-17 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/ant-ivy/pull/52


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127480601
  
--- Diff: src/java/org/apache/ivy/osgi/util/VersionRange.java ---
@@ -306,7 +306,7 @@ public boolean isClosedRange() {
 return startVersion.equals(endVersion);
 }
 
-public boolean contains(String versionStr) throws ParseException {
+public boolean contains(String versionStr) {
--- End diff --

Not sure about this one, either: it's a consequence of previous changes to 
Version which no longer throws exceptions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127475255
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

Agree. This change can stay. I missed this while reviewing.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127474316
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

This is a private method...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread twogee
Github user twogee commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127408025
  
--- Diff: 
src/java/org/apache/ivy/tools/analyser/JarJarDependencyAnalyser.java ---
@@ -39,21 +39,22 @@ public JarJarDependencyAnalyser(File jarjarjarLocation) 
{
 }
 
 public ModuleDescriptor[] analyze(JarModule[] modules) {
-
 StringBuilder jarjarCmd = new StringBuilder("java -jar \"").append(
 jarjarjarLocation.getAbsolutePath()).append("\" --find 
--level=jar ");
 Map jarModulesMap = new HashMap<>();
 Map mds = new 
HashMap<>();
 
-for (int i = 0; i < modules.length; i++) {
-jarModulesMap.put(modules[i].getJar().getAbsolutePath(), 
modules[i]);
+for (JarModule jarModule : modules) {
+jarModulesMap.put(jarModule.getJar().getAbsolutePath(), 
jarModule);
 DefaultModuleDescriptor md = 
DefaultModuleDescriptor.newBasicInstance(
-modules[i].getMrid(), new 
Date(modules[i].getJar().lastModified()));
-mds.put(modules[i].getMrid(), md);
-
jarjarCmd.append("\"").append(modules[i].getJar().getAbsolutePath()).append("\"");
-if (i + 1 < modules.length) {
-jarjarCmd.append(File.pathSeparator);
-}
+jarModule.getMrid(), new 
Date(jarModule.getJar().lastModified()));
+mds.put(jarModule.getMrid(), md);
+
jarjarCmd.append("\"").append(jarModule.getJar().getAbsolutePath()).append("\"");
+jarjarCmd.append(File.pathSeparator);
+}
+
+if (modules.length > 0) {
+jarjarCmd.setLength(jarjarCmd.length() - 1);
--- End diff --

It strips an extra pathSeparator character, but only if modules has any 
entries. It is an afterthought on my part...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127398802
  
--- Diff: src/java/org/apache/ivy/util/url/HttpClientHandler.java ---
@@ -177,7 +177,7 @@ public URLInfo getURLInfo(URL url, int timeout) {
 return UNAVAILABLE;
 }
 
-private boolean checkStatusCode(URL url, HttpMethodBase method) throws 
IOException {
+private boolean checkStatusCode(URL url, HttpMethodBase method) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127398451
  
--- Diff: 
src/java/org/apache/ivy/tools/analyser/JarJarDependencyAnalyser.java ---
@@ -39,21 +39,22 @@ public JarJarDependencyAnalyser(File jarjarjarLocation) 
{
 }
 
 public ModuleDescriptor[] analyze(JarModule[] modules) {
-
 StringBuilder jarjarCmd = new StringBuilder("java -jar \"").append(
 jarjarjarLocation.getAbsolutePath()).append("\" --find 
--level=jar ");
 Map jarModulesMap = new HashMap<>();
 Map mds = new 
HashMap<>();
 
-for (int i = 0; i < modules.length; i++) {
-jarModulesMap.put(modules[i].getJar().getAbsolutePath(), 
modules[i]);
+for (JarModule jarModule : modules) {
+jarModulesMap.put(jarModule.getJar().getAbsolutePath(), 
jarModule);
 DefaultModuleDescriptor md = 
DefaultModuleDescriptor.newBasicInstance(
-modules[i].getMrid(), new 
Date(modules[i].getJar().lastModified()));
-mds.put(modules[i].getMrid(), md);
-
jarjarCmd.append("\"").append(modules[i].getJar().getAbsolutePath()).append("\"");
-if (i + 1 < modules.length) {
-jarjarCmd.append(File.pathSeparator);
-}
+jarModule.getMrid(), new 
Date(jarModule.getJar().lastModified()));
+mds.put(jarModule.getMrid(), md);
+
jarjarCmd.append("\"").append(jarModule.getJar().getAbsolutePath()).append("\"");
+jarjarCmd.append(File.pathSeparator);
+}
+
+if (modules.length > 0) {
+jarjarCmd.setLength(jarjarCmd.length() - 1);
--- End diff --

I don't fully follow what this is block is meant for. Is it to 
conditionally include the `File.pathSeparator` character?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127397658
  
--- Diff: src/java/org/apache/ivy/plugins/repository/ssh/SshCache.java ---
@@ -263,9 +263,8 @@ public void clearSession(Session session) {
  * @param session
  *to connect to
  * @return channelSftp or null if not successful (channel not existent 
or dead)
- * @throws IOException if something goes wrong
  */
-public ChannelSftp getChannelSftp(Session session) throws IOException {
+public ChannelSftp getChannelSftp(Session session) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127397389
  
--- Diff: 
src/java/org/apache/ivy/plugins/repository/sftp/SFTPRepository.java ---
@@ -148,7 +142,7 @@ public void put(File source, String destination, 
boolean overwrite) throws IOExc
 }
 }
 
-private void mkdirs(String directory, ChannelSftp c) throws 
IOException, SftpException {
+private void mkdirs(String directory, ChannelSftp c) throws 
SftpException {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396424
  
--- Diff: src/java/org/apache/ivy/osgi/util/VersionRange.java ---
@@ -306,7 +306,7 @@ public boolean isClosedRange() {
 return startVersion.equals(endVersion);
 }
 
-public boolean contains(String versionStr) throws ParseException {
+public boolean contains(String versionStr) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396341
  
--- Diff: src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java 
---
@@ -59,11 +59,11 @@ protected InputStream getInputStream(String f) throws 
IOException {
 return repo.getResource(f).openStream();
 }
 
-protected List listBundleFiles(String dir) throws IOException {
+protected List listBundleFiles(String dir) {
 return asList(ResolverHelper.listAll(repo, dir));
 }
 
-protected List listDirs(String dir) throws IOException {
+protected List listDirs(String dir) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127396320
  
--- Diff: src/java/org/apache/ivy/osgi/repo/RepositoryManifestIterable.java 
---
@@ -59,11 +59,11 @@ protected InputStream getInputStream(String f) throws 
IOException {
 return repo.getResource(f).openStream();
 }
 
-protected List listBundleFiles(String dir) throws IOException {
+protected List listBundleFiles(String dir) {
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127395825
  
--- Diff: src/java/org/apache/ivy/osgi/repo/AbstractFSManifestIterable.java 
---
@@ -44,9 +44,9 @@ public AbstractFSManifestIterable(T root) {
 return new FSManifestIterator();
 }
 
-protected abstract List listBundleFiles(T dir) throws IOException;
+protected abstract List listBundleFiles(T dir);
 
-protected abstract List listDirs(T dir) throws IOException;
+protected abstract List listDirs(T dir);
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127395788
  
--- Diff: src/java/org/apache/ivy/osgi/repo/AbstractFSManifestIterable.java 
---
@@ -44,9 +44,9 @@ public AbstractFSManifestIterable(T root) {
 return new FSManifestIterator();
 }
 
-protected abstract List listBundleFiles(T dir) throws IOException;
+protected abstract List listBundleFiles(T dir);
--- End diff --

Similar comment as here 
https://github.com/apache/ant-ivy/pull/52/files#r127395633 applies to this line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-14 Thread jaikiran
Github user jaikiran commented on a diff in the pull request:

https://github.com/apache/ant-ivy/pull/52#discussion_r127395633
  
--- Diff: src/java/org/apache/ivy/osgi/p2/XMLInputParser.java ---
@@ -19,12 +19,11 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.text.ParseException;
 
 import org.xml.sax.SAXException;
 
 public interface XMLInputParser {
 
-void parse(InputStream in) throws ParseException, IOException, 
SAXException;
+void parse(InputStream in) throws IOException, SAXException;
--- End diff --

Given that `ParseException` is a checked exception, removing this from the 
throws clause can cause existing callers of this method (potentially outside of 
Ivy) to run into compile issues. Is there some specific reason why this is 
being removed from the throws clause? If not, can you please undo this change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org



[GitHub] ant-ivy pull request #52: Generics in core

2017-07-09 Thread twogee
GitHub user twogee opened a pull request:

https://github.com/apache/ant-ivy/pull/52

Generics in core

This is as far as I can get without significant changes to API.
Any remaining points of contention are annotated by `@SuppressWarnings` 
(and I'm not proud of what `NoFilter` looks like).
If you need proof that arrays of generics are broken, just change `List` 
back to `T[]` in `ModuleRules` and watch the fireworks.

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

$ git pull https://github.com/twogee/ant-ivy generics-in-core

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

https://github.com/apache/ant-ivy/pull/52.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 #52


commit cce62bb298d2af097a6b595a6f3f058ae6c4d3b7
Author: twogee 
Date:   2017-07-06T06:04:24Z

Add generics and Java 7 syntax to core

commit 91668c1ce81f396558be2e04542a9d95dbaed103
Author: twogee 
Date:   2017-07-09T10:01:05Z

Checkstyle




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org