svn commit: r1788454 - /commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java

2017-03-24 Thread rmannibucau
Author: rmannibucau
Date: Fri Mar 24 14:14:03 2017
New Revision: 1788454

URL: http://svn.apache.org/viewvc?rev=1788454&view=rev
Log:
JCS-174 Serializable is not a constraint proxies should imply in jcache

Modified:

commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java

Modified: 
commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java?rev=1788454&r1=1788453&r2=1788454&view=diff
==
--- 
commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java
 (original)
+++ 
commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/proxy/ClassLoaderAwareCache.java
 Fri Mar 24 14:14:03 2017
@@ -34,7 +34,7 @@ import java.util.Map;
 import java.util.Set;
 
 // don't use a proxy, reflection is too slow here :(
-public class ClassLoaderAwareCache implements Cache
+public class ClassLoaderAwareCache implements Cache
 {
 private final ClassLoader loader;
 private final JCSCache delegate;




svn commit: r1788489 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 15:56:14 2017
New Revision: 1788489

URL: http://svn.apache.org/viewvc?rev=1788489&view=rev
Log:
NET-632 FTPHTTPClient - support for encoding other than UTF-8

This fixes #1

Modified:
commons/proper/net/trunk/src/changes/changes.xml

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1788489&r1=1788488&r2=1788489&view=diff
==
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Fri Mar 24 
15:56:14 2017
@@ -71,6 +71,9 @@ This is mainly a bug-fix release. See fu
  However it is not source compatible with releases before 3.4, as some methods 
were added to the interface NtpV3Packet in 3.4
 
 ">
+
+FTPHTTPClient - support for encoding other than UTF-8
+
 
 Bug in MVSFTPEntryParser.parseUnixList (FindBugs)
 

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java?rev=1788489&r1=1788488&r2=1788489&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
 Fri Mar 24 15:56:14 2017
@@ -27,6 +27,7 @@ import java.io.UnsupportedEncodingExcept
 import java.net.Inet6Address;
 import java.net.Socket;
 import java.net.SocketException;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,26 +43,67 @@ public class FTPHTTPClient extends FTPCl
 private final int proxyPort;
 private final String proxyUsername;
 private final String proxyPassword;
+private final Charset charset;
 
 private static final byte[] CRLF={'\r', '\n'};
 private final Base64 base64 = new Base64();
 
 private String tunnelHost; // Save the host when setting up a tunnel 
(needed for EPSV)
 
-public FTPHTTPClient(String proxyHost, int proxyPort, String proxyUser, 
String proxyPass) {
+/**
+ * Create an instance with the specified encoding
+ *
+ * @param proxyHost the hostname to use
+ * @param proxyPort the port to use
+ * @param proxyUser the user name for the proxy
+ * @param proxyPass the password for the proxy
+ * @param encoding the encoding to use
+ */
+public FTPHTTPClient(String proxyHost, int proxyPort, String proxyUser, 
String proxyPass, Charset encoding) {
 this.proxyHost = proxyHost;
 this.proxyPort = proxyPort;
 this.proxyUsername = proxyUser;
 this.proxyPassword = proxyPass;
 this.tunnelHost = null;
+this.charset = null;
+}
+
+/**
+ * Create an instance using the UTF-8 encoding
+ *
+ * @param proxyHost the hostname to use
+ * @param proxyPort the port to use
+ * @param proxyUser the user name for the proxy
+ * @param proxyPass the password for the proxy
+ */
+public FTPHTTPClient(String proxyHost, int proxyPort, String proxyUser, 
String proxyPass) {
+this(proxyHost, proxyPort, proxyUser, proxyPass, 
Charset.forName("UTF-8"));
 }
 
+/**
+ * Create an instance using the UTF-8 encoding, with no proxy credentials.
+ *
+ * @param proxyHost the hostname to use
+ * @param proxyPort the port to use
+ */
 public FTPHTTPClient(String proxyHost, int proxyPort) {
 this(proxyHost, proxyPort, null, null);
 }
 
 
 /**
+ * Create an instance using the specified encoding, with no proxy 
credentials.
+ *
+ * @param proxyHost the hostname to use
+ * @param proxyPort the port to use
+ * @param encoding the encoding to use
+ */
+public FTPHTTPClient(String proxyHost, int proxyPort, Charset encoding) {
+this(proxyHost, proxyPort, null, null, encoding);
+}
+
+
+/**
  * {@inheritDoc}
  *
  * @throws IllegalStateException if connection mode is not passive
@@ -150,16 +192,16 @@ public class FTPHTTPClient extends FTPCl
 final String hostString = "Host: " + host + ":" + port;
 
 this.tunnelHost = host;
-output.write(connectString.getBytes("UTF-8")); // TODO what is the 
correct encoding?
+output.write(connectString.getBytes(charset));
 output.write(CRLF);
-output.write(hostString.getBytes("UTF-8"));
+output.write(hostString.getBytes(charset));
 output.write(CRLF);
 
 if (proxyUsername != null && proxyPassword != null) {
 final String auth = proxyUser

svn commit: r1788491 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 16:00:29 2017
New Revision: 1788491

URL: http://svn.apache.org/viewvc?rev=1788491&view=rev
Log:
Correction of a typo in Javadoc

This fixes PR #11

Modified:

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1788491&r1=1788490&r2=1788491&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java
 Fri Mar 24 16:00:29 2017
@@ -1547,7 +1547,7 @@ implements Configurable
  * 
  * N.B. currently calling any connect method will reset the type to
  * FTP.ASCII_FILE_TYPE.
- * @param fileType The  _FILE_TYPE  constant indcating the
+ * @param fileType The  _FILE_TYPE  constant indicating the
  * type of file.
  * @return True if successfully completed, false if not.
  * @throws FTPConnectionClosedException
@@ -1591,7 +1591,7 @@ implements Configurable
  * N.B. currently calling any connect method will reset the type to
  * FTP.ASCII_FILE_TYPE and the formatOrByteSize to 
FTP.NON_PRINT_TEXT_FORMAT.
  *
- * @param fileType The  _FILE_TYPE  constant indcating the
+ * @param fileType The  _FILE_TYPE  constant indicating the
  * type of file.
  * @param formatOrByteSize  The format of the file (one of the
  *  _FORMAT constants.  In the case of




svn commit: r1788497 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java main/java/org/apache/commons/net/smtp/AuthenticatingSMT

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 16:19:38 2017
New Revision: 1788497

URL: http://svn.apache.org/viewvc?rev=1788497&view=rev
Log:
NET-633 Add XOAUTH2 to IMAP and SMTP\nThis fixes #2

Modified:
commons/proper/net/trunk/src/changes/changes.xml

commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java

commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1788497&r1=1788496&r2=1788497&view=diff
==
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Fri Mar 24 
16:19:38 2017
@@ -71,6 +71,9 @@ This is mainly a bug-fix release. See fu
  However it is not source compatible with releases before 3.4, as some methods 
were added to the interface NtpV3Packet in 3.4
 
 ">
+
+Add XOAUTH2 to IMAP and SMTP
+
 
 FTPHTTPClient - support for encoding other than UTF-8
 

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java?rev=1788497&r1=1788496&r2=1788497&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
 Fri Mar 24 16:19:38 2017
@@ -204,6 +204,7 @@ public class AuthenticatingIMAPClient ex
 return result == IMAPReply.OK;
 }
 case XOAUTH:
+case XOAUTH2:
 {
 int result = sendData(username);
 if (result == IMAPReply.OK)
@@ -248,7 +249,9 @@ public class AuthenticatingIMAPClient ex
 /** The unstandarised Microsoft LOGIN method, which sends the password 
unencrypted (insecure). */
 LOGIN("LOGIN"),
 /** XOAUTH */
-XOAUTH("XOAUTH");
+XOAUTH("XOAUTH"),
+/** XOAUTH 2 */
+XOAUTH2("XOAUTH2");
 
 private final String authName;
 

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java?rev=1788497&r1=1788496&r2=1788497&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
 Fri Mar 24 16:19:38 2017
@@ -190,10 +190,10 @@ public class AuthenticatingSMTPClient ex
  *
  * @param method the method to use, one of the {@link 
AuthenticatingSMTPClient.AUTH_METHOD} enum values
  * @param username the user name.
- *If the method is XOAUTH, then this is used as the plain text 
oauth protocol parameter string
+ *If the method is XOAUTH/XOAUTH2, then this is used as the plain 
text oauth protocol parameter string
  *which is Base64-encoded for transmission.
  * @param password the password for the username.
- *Ignored for XOAUTH.
+ *Ignored for XOAUTH/XOAUTH2.
  *
  * @return True if successfully completed, false if not.
  * @throws SMTPConnectionClosedException
@@ -257,7 +257,7 @@ public class AuthenticatingSMTPClient ex
 return SMTPReply.isPositiveCompletion(sendCommand(
 
Base64.encodeBase64StringUnChunked(password.getBytes(getCharset();
 }
-else if (method.equals(AUTH_METHOD.XOAUTH))
+else if (method.equals(AUTH_METHOD.XOAUTH) || 
method.equals(AUTH_METHOD.XOAUTH2))
 {
 return SMTPReply.isPositiveIntermediate(sendCommand(
 
Base64.encodeBase64StringUnChunked(username.getBytes(getCharset()))
@@ -299,7 +299,9 @@ public class AuthenticatingSMTPClient ex
 /** The unstandarised Microsoft LOGIN method, which sends the password 
unencrypted (insecure). */
 LOGIN,
 /** XOAuth method which accepts a signed and base64ed OAuth URL. */
-XOAUTH;
+XOAUTH,
+/** XOAuth 2 method which accepts a signed and base64ed OAuth JSON. */
+XOAUTH2;
 
 /**
  * Gets the name of the given authentication method suitable for the 
server.
@@ -316,6 +318,8 @@ public class AuthenticatingSMTPClient ex
 return "LOGIN";
 

svn propchange: r1788491 - svn:log

2017-03-24 Thread sebb
Author: sebb
Revision: 1788491
Modified property: svn:log

Modified: svn:log at Fri Mar 24 16:54:21 2017
--
--- svn:log (original)
+++ svn:log Fri Mar 24 16:54:21 2017
@@ -1,3 +1,3 @@
 Correction of a typo in Javadoc
 
-This fixes PR #11
+This fixes #11



svn propchange: r1782074 - svn:log

2017-03-24 Thread sebb
Author: sebb
Revision: 1782074
Modified property: svn:log

Modified: svn:log at Fri Mar 24 16:59:54 2017
--
--- svn:log (original)
+++ svn:log Fri Mar 24 16:59:54 2017
@@ -1 +1,3 @@
 NET-588 FTPClient.setPassiveNatWorkaround assumes host is outside site local 
range
+
+This fixes #5



svn commit: r1788521 - /commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:38:45 2017
New Revision: 1788521

URL: http://svn.apache.org/viewvc?rev=1788521&view=rev
Log:
(FindBugs) use %n rather than \n for locale-dependent EOLs

Modified:
commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java

Modified: 
commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java?rev=1788521&r1=1788520&r2=1788521&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java 
(original)
+++ 
commons/proper/net/trunk/src/main/java/examples/cidr/SubnetUtilsExample.java 
Fri Mar 24 18:38:45 2017
@@ -33,27 +33,27 @@ public class SubnetUtilsExample {
 SubnetUtils utils = new SubnetUtils(subnet);
 SubnetInfo info = utils.getInfo();
 
-System.out.printf("Subnet Information for %s:\n", subnet);
+System.out.printf("Subnet Information for %s:%n", subnet);
 System.out.println("--");
-System.out.printf("IP Address:\t\t\t%s\t[%s]\n", info.getAddress(),
+System.out.printf("IP Address:\t\t\t%s\t[%s]%n", info.getAddress(),
 Integer.toBinaryString(info.asInteger(info.getAddress(;
-System.out.printf("Netmask:\t\t\t%s\t[%s]\n", info.getNetmask(),
+System.out.printf("Netmask:\t\t\t%s\t[%s]%n", info.getNetmask(),
 Integer.toBinaryString(info.asInteger(info.getNetmask(;
-System.out.printf("CIDR Representation:\t\t%s\n\n", 
info.getCidrSignature());
+System.out.printf("CIDR Representation:\t\t%s%n%n", 
info.getCidrSignature());
 
-System.out.printf("Supplied IP Address:\t\t%s\n\n", info.getAddress());
+System.out.printf("Supplied IP Address:\t\t%s%n%n", info.getAddress());
 
-System.out.printf("Network Address:\t\t%s\t[%s]\n", 
info.getNetworkAddress(),
+System.out.printf("Network Address:\t\t%s\t[%s]%n", 
info.getNetworkAddress(),
 
Integer.toBinaryString(info.asInteger(info.getNetworkAddress(;
-System.out.printf("Broadcast Address:\t\t%s\t[%s]\n", 
info.getBroadcastAddress(),
+System.out.printf("Broadcast Address:\t\t%s\t[%s]%n", 
info.getBroadcastAddress(),
 
Integer.toBinaryString(info.asInteger(info.getBroadcastAddress(;
-System.out.printf("Low Address:\t\t\t%s\t[%s]\n", info.getLowAddress(),
+System.out.printf("Low Address:\t\t\t%s\t[%s]%n", info.getLowAddress(),
 Integer.toBinaryString(info.asInteger(info.getLowAddress(;
-System.out.printf("High Address:\t\t\t%s\t[%s]\n", 
info.getHighAddress(),
+System.out.printf("High Address:\t\t\t%s\t[%s]%n", 
info.getHighAddress(),
 Integer.toBinaryString(info.asInteger(info.getHighAddress(;
 
-System.out.printf("Total usable addresses: \t%d\n", 
Long.valueOf(info.getAddressCountLong()));
-System.out.printf("Address List: %s\n\n", 
Arrays.toString(info.getAllAddresses()));
+System.out.printf("Total usable addresses: \t%d%n", 
Long.valueOf(info.getAddressCountLong()));
+System.out.printf("Address List: %s%n%n", 
Arrays.toString(info.getAllAddresses()));
 
 final String prompt ="Enter an IP address (e.g. 192.168.0.10):";
 System.out.println(prompt);




svn commit: r1788522 - in /commons/proper/net/trunk/src/main/java/examples/unix: chargen.java echo.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:39:48 2017
New Revision: 1788522

URL: http://svn.apache.org/viewvc?rev=1788522&view=rev
Log:
(FindBugs) close resources

Modified:
commons/proper/net/trunk/src/main/java/examples/unix/chargen.java
commons/proper/net/trunk/src/main/java/examples/unix/echo.java

Modified: commons/proper/net/trunk/src/main/java/examples/unix/chargen.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/chargen.java?rev=1788522&r1=1788521&r2=1788522&view=diff
==
--- commons/proper/net/trunk/src/main/java/examples/unix/chargen.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/chargen.java Fri Mar 
24 18:39:48 2017
@@ -66,6 +66,7 @@ public final class chargen
 System.out.println(line);
 }
 
+chargenInput.close();
 client.disconnect();
 }
 

Modified: commons/proper/net/trunk/src/main/java/examples/unix/echo.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/echo.java?rev=1788522&r1=1788521&r2=1788522&view=diff
==
--- commons/proper/net/trunk/src/main/java/examples/unix/echo.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/echo.java Fri Mar 24 
18:39:48 2017
@@ -64,7 +64,9 @@ public final class echo
 echoOutput.println(line);
 System.out.println(echoInput.readLine());
 }
-
+echoOutput.close();
+echoInput.close();
+echoInput.close();
 client.disconnect();
 }
 




svn commit: r1788523 - in /commons/proper/net/trunk/src/main/java/examples/unix: finger.java fwhois.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:40:33 2017
New Revision: 1788523

URL: http://svn.apache.org/viewvc?rev=1788523&view=rev
Log:
(FindBugs) cheaper to scan for chars than Strings of length 1

Modified:
commons/proper/net/trunk/src/main/java/examples/unix/finger.java
commons/proper/net/trunk/src/main/java/examples/unix/fwhois.java

Modified: commons/proper/net/trunk/src/main/java/examples/unix/finger.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/finger.java?rev=1788523&r1=1788522&r2=1788523&view=diff
==
--- commons/proper/net/trunk/src/main/java/examples/unix/finger.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/finger.java Fri Mar 24 
18:40:33 2017
@@ -93,7 +93,7 @@ public final class finger
 while (arg < args.length)
 {
 
-index = args[arg].lastIndexOf("@");
+index = args[arg].lastIndexOf('@');
 
 if (index == -1)
 {

Modified: commons/proper/net/trunk/src/main/java/examples/unix/fwhois.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/fwhois.java?rev=1788523&r1=1788522&r2=1788523&view=diff
==
--- commons/proper/net/trunk/src/main/java/examples/unix/fwhois.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/fwhois.java Fri Mar 24 
18:40:33 2017
@@ -43,7 +43,7 @@ public final class fwhois
 System.exit(1);
 }
 
-index = args[0].lastIndexOf("@");
+index = args[0].lastIndexOf('@');
 
 whois = new WhoisClient();
 // We want to timeout if a response takes longer than 60 seconds




svn commit: r1788524 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:40:53 2017
New Revision: 1788524

URL: http://svn.apache.org/viewvc?rev=1788524&view=rev
Log:
(FindBugs) cheaper to scan for chars than Strings of length 1

Modified:

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java?rev=1788524&r1=1788523&r2=1788524&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
 Fri Mar 24 18:40:53 2017
@@ -164,7 +164,7 @@ public class VMSFTPEntryParser extends C
 }
 else
 {
-name = name.substring(0, name.lastIndexOf(";"));
+name = name.substring(0, name.lastIndexOf(';'));
 f.setName(name);
 }
 //size is retreived in blocks and needs to be put in bytes




svn commit: r1788525 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:41:11 2017
New Revision: 1788525

URL: http://svn.apache.org/viewvc?rev=1788525&view=rev
Log:
Unused

Modified:

commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java

Modified: 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java?rev=1788525&r1=1788524&r2=1788525&view=diff
==
--- 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
 (original)
+++ 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientConfigTest.java
 Fri Mar 24 18:41:11 2017
@@ -176,13 +176,13 @@ public class FTPClientConfigTest extends
 assertEquals("different.parser.same.date",d1, d2);
 
 try {
-d2 = sdf1.parse("hij 31, 2004");
+sdf1.parse("hij 31, 2004");
 fail("should.have.failed.to.parse.weird");
 } catch (ParseException px) {
 // expected
 }
 try {
-d2 = sdf2.parse("dec 31, 2004");
+sdf2.parse("dec 31, 2004");
 fail("should.have.failed.to.parse.standard");
 } catch (ParseException px) {
 // expected




svn commit: r1788526 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:41:30 2017
New Revision: 1788526

URL: http://svn.apache.org/viewvc?rev=1788526&view=rev
Log:
Unused

Modified:

commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java

Modified: 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java?rev=1788526&r1=1788525&r2=1788526&view=diff
==
--- 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
 (original)
+++ 
commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java
 Fri Mar 24 18:41:30 2017
@@ -90,7 +90,7 @@ public class DefaultFTPFileEntryParserFa
 assertTrue(parser instanceof OS2FTPEntryParser);
 
 try {
-parser = factory.createFileEntryParser(
+factory.createFileEntryParser(
 
"org.apache.commons.net.ftp.parser.DefaultFTPFileEntryParserFactory");
 fail("Exception should have been thrown. 
\"DefaultFTPFileEntryParserFactory\" does not implement FTPFileEntryParser");
 } catch (ParserInitializationException pie) {




svn commit: r1788527 - /commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 18:42:07 2017
New Revision: 1788527

URL: http://svn.apache.org/viewvc?rev=1788527&view=rev
Log:
(Findbugs) useless Integer creation

Modified:

commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java

Modified: 
commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java?rev=1788527&r1=1788526&r2=1788527&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java 
(original)
+++ 
commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java 
Fri Mar 24 18:42:07 2017
@@ -70,7 +70,7 @@ public class TelnetClientExample impleme
 
 if (args.length > 1)
 {
-remoteport = (new Integer(args[1])).intValue();
+remoteport = Integer.parseInt(args[1]);
 }
 else
 {




svn commit: r1788535 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/examples/mail/POP3ExportMbox.java main/resources/examples/examples.properties

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:00:09 2017
New Revision: 1788535

URL: http://svn.apache.org/viewvc?rev=1788535&view=rev
Log:
Add POP3ExportMbox example code

Added:
commons/proper/net/trunk/src/main/java/examples/mail/POP3ExportMbox.java   
(with props)
Modified:
commons/proper/net/trunk/src/changes/changes.xml
commons/proper/net/trunk/src/main/resources/examples/examples.properties

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1788535&r1=1788534&r2=1788535&view=diff
==
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Fri Mar 24 
20:00:09 2017
@@ -71,6 +71,9 @@ This is mainly a bug-fix release. See fu
  However it is not source compatible with releases before 3.4, as some methods 
were added to the interface NtpV3Packet in 3.4
 
 ">
+
+Add POP3ExportMbox example code
+
 
 Add XOAUTH2 to IMAP and SMTP
 

Added: commons/proper/net/trunk/src/main/java/examples/mail/POP3ExportMbox.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/mail/POP3ExportMbox.java?rev=1788535&view=auto
==
--- commons/proper/net/trunk/src/main/java/examples/mail/POP3ExportMbox.java 
(added)
+++ commons/proper/net/trunk/src/main/java/examples/mail/POP3ExportMbox.java 
Fri Mar 24 20:00:09 2017
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package examples.mail;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.nio.charset.Charset;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.net.pop3.POP3Client;
+import org.apache.commons.net.pop3.POP3MessageInfo;
+import org.apache.commons.net.pop3.POP3SClient;
+
+/**
+ * This is an example program demonstrating how to use the POP3[S]Client class.
+ * This program connects to a POP3[S] server and writes the messages
+ * to an mbox file.
+ * 
+ * The code currently assumes that POP3Client decodes the POP3 data as 
iso-8859-1.
+ * The POP3 standard only allows for ASCII so in theory iso-8859-1 should be 
OK.
+ * However it appears that actual POP3 implementations may return 8bit data 
that is
+ * outside the ASCII range; this may result in loss of data when the mailbox 
is created.
+ * 
+ * See main() method for usage details
+ */
+public final class POP3ExportMbox
+{
+
+private static final Pattern PATFROM = Pattern.compile(">*From "); // 
unescaped From_
+
+public static void main(String[] args)
+{
+int argIdx;
+String file = null;
+for(argIdx = 0; argIdx < args.length; argIdx++) {
+if (args[argIdx].equals("-F")) {
+file = args[++argIdx];
+} else {
+break;
+}
+}
+
+final int argCount = args.length - argIdx;
+if (argCount < 3)
+{
+System.err.println(
+"Usage: POP3Mail [-F file]   
 [TLS [true=implicit]]");
+System.exit(1);
+}
+
+String arg0[] = args[argIdx++].split(":");
+String server=arg0[0];
+String username = args[argIdx++];
+String password = args[argIdx++];
+// prompt for the password if necessary
+try {
+password = Utils.getPassword(username, password);
+} catch (IOException e1) {
+System.err.println("Could not retrieve password: " + 
e1.getMessage());
+return;
+}
+
+String proto = argCount > 3 ? args[argIdx++] : null;
+boolean implicit = argCount > 4 ? Boolean.parseBoolean(args[argIdx++]) 
: false;
+
+POP3Client pop3;
+
+if (proto != null) {
+System.out.println("Using secure protocol: "+proto);
+pop3 =

svn commit: r1788536 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:07:27 2017
New Revision: 1788536

URL: http://svn.apache.org/viewvc?rev=1788536&view=rev
Log:
Duh! need to actually use the encoding ...

Modified:

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java?rev=1788536&r1=1788535&r2=1788536&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java
 Fri Mar 24 20:07:27 2017
@@ -65,7 +65,7 @@ public class FTPHTTPClient extends FTPCl
 this.proxyUsername = proxyUser;
 this.proxyPassword = proxyPass;
 this.tunnelHost = null;
-this.charset = null;
+this.charset = encoding;
 }
 
 /**




svn commit: r1788537 - /commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:19:42 2017
New Revision: 1788537

URL: http://svn.apache.org/viewvc?rev=1788537&view=rev
Log:
Avoid System.exit

Modified:
commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java

Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1788537&r1=1788536&r2=1788537&view=diff
==
--- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java 
(original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Fri 
Mar 24 20:19:42 2017
@@ -163,9 +163,7 @@ public final class TFTPExample
 catch (IOException e)
 {
 tftp.close();
-System.err.println("Error: could not open local file for 
reading.");
-System.err.println(e.getMessage());
-System.exit(1);
+throw new RuntimeException("Error: could not open local file for 
reading.", e);
 }
 
 open(tftp);
@@ -213,7 +211,7 @@ public final class TFTPExample
 if (file.exists())
 {
 System.err.println("Error: " + localFilename + " already exists.");
-System.exit(1);
+return false;
 }
 
 // Try to open local file for writing
@@ -224,9 +222,7 @@ public final class TFTPExample
 catch (IOException e)
 {
 tftp.close();
-System.err.println("Error: could not open local file for 
writing.");
-System.err.println(e.getMessage());
-System.exit(1);
+throw new RuntimeException("Error: could not open local file for 
writing.", e);
 }
 
 open(tftp);
@@ -289,9 +285,7 @@ public final class TFTPExample
 }
 catch (SocketException e)
 {
-System.err.println("Error: could not open local UDP socket.");
-System.err.println(e.getMessage());
-System.exit(1);
+throw new RuntimeException("Error: could not open local UDP 
socket.", e);
 }
 }
 




svn commit: r1788538 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:20:22 2017
New Revision: 1788538

URL: http://svn.apache.org/viewvc?rev=1788538&view=rev
Log:
Specify Locale for upcasing

Modified:

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java?rev=1788538&r1=1788537&r2=1788538&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
 Fri Mar 24 20:20:22 2017
@@ -19,6 +19,7 @@ package org.apache.commons.net.ftp.parse
 
 import java.io.File;
 import java.text.ParseException;
+import java.util.Locale;
 
 import org.apache.commons.net.ftp.FTPClientConfig;
 import org.apache.commons.net.ftp.FTPFile;
@@ -335,7 +336,7 @@ public class OS400FTPEntryParser extends
 // file.
 // Save files are a special type of files which are used
 // to save objects, e.g. for backups.
-if (name != null && name.toUpperCase().endsWith(".SAVF"))
+if (name != null && 
name.toUpperCase(Locale.ROOT).endsWith(".SAVF"))
 {
 mustScanForPathSeparator = false;
 type = FTPFile.FILE_TYPE;




svn commit: r1788539 - in /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp: FTP.java parser/NetwareFTPEntryParser.java

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:20:41 2017
New Revision: 1788539

URL: http://svn.apache.org/viewvc?rev=1788539&view=rev
Log:
(FindBugs) cheaper to scan for chars than Strings of length 1

Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java

commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java?rev=1788539&r1=1788538&r2=1788539&view=diff
==
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java 
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java 
Fri Mar 24 20:20:41 2017
@@ -1004,7 +1004,7 @@ public class FTP extends SocketClient
 
 // If IPv6, trim the zone index
 h = host.getHostAddress();
-num = h.indexOf("%");
+num = h.indexOf('%');
 if (num > 0) {
 h = h.substring(0, num);
 }

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java?rev=1788539&r1=1788538&r2=1788539&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
 (original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
 Fri Mar 24 20:20:41 2017
@@ -147,11 +147,11 @@ public class NetwareFTPEntryParser exten
 
 // Now set the permissions (or at least a subset thereof - full 
permissions would probably require
 // subclassing FTPFile and adding extra metainformation there)
-if (attrib.indexOf("R") != -1) {
+if (attrib.indexOf('R') != -1) {
 f.setPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION,
 true);
 }
-if (attrib.indexOf("W") != -1) {
+if (attrib.indexOf('W') != -1) {
 f.setPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION,
 true);
 }




svn commit: r1788542 - /commons/proper/net/trunk/src/changes/changes.xml

2017-03-24 Thread sebb
Author: sebb
Date: Fri Mar 24 20:44:31 2017
New Revision: 1788542

URL: http://svn.apache.org/viewvc?rev=1788542&view=rev
Log:
Dummy whitespace change to try and close some PRs (propchanges don't seem to 
work)

This fixes #11
This fixes #5

Modified:
commons/proper/net/trunk/src/changes/changes.xml

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1788542&r1=1788541&r2=1788542&view=diff
==
--- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original)
+++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Fri Mar 24 
20:44:31 2017
@@ -69,7 +69,7 @@ This is mainly a bug-fix release. See fu
 
  This release is binary compatible with previous releases.
  However it is not source compatible with releases before 3.4, as some methods 
were added to the interface NtpV3Packet in 3.4
-
+
 ">
 
 Add POP3ExportMbox example code




svn commit: r1788574 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:06:52 2017
New Revision: 1788574

URL: http://svn.apache.org/viewvc?rev=1788574&view=rev
Log:
Removed an unused local variable

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java?rev=1788574&r1=1788573&r2=1788574&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Interpreter.java
 Sat Mar 25 00:06:52 2017
@@ -1636,7 +1636,6 @@ public class Interpreter extends Interpr
 argv[i] = node.jjtGetChild(i + 1).jjtAccept(this, data);
 }
 
-JexlException xjexl = null;
 try {
 // attempt to reuse last constructor cached in volatile 
JexlNode.value
 if (cache) {




svn commit: r1788575 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:07:25 2017
New Revision: 1788575

URL: http://svn.apache.org/viewvc?rev=1788575&view=rev
Log:
Removed an unnecessary type cast

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java?rev=1788575&r1=1788574&r2=1788575&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/Script.java
 Sat Mar 25 00:07:25 2017
@@ -188,7 +188,7 @@ public class Script implements JexlScrip
 @Override
 public Object execute(JexlContext context) {
 checkCacheVersion();
-Scope.Frame frame = createFrame((Object[]) null);
+Scope.Frame frame = createFrame(null);
 Interpreter interpreter = createInterpreter(context, frame);
 return interpreter.interpret(script);
 }




svn commit: r1788576 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:08:49 2017
New Revision: 1788576

URL: http://svn.apache.org/viewvc?rev=1788576&view=rev
Log:
Inner enums are implicitly static

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java?rev=1788576&r1=1788575&r2=1788576&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 Sat Mar 25 00:08:49 2017
@@ -710,7 +710,7 @@ public final class TemplateEngine extend
 }
 
 /** The different parsing states. */
-private static enum ParseState {
+private enum ParseState {
 /** Parsing a constant. */
 CONST,
 /** Parsing after $ . */
@@ -900,11 +900,11 @@ public final class TemplateEngine extend
 /**
  * The enum capturing the difference between verbatim and code source 
fragments.
  */
-static enum BlockType {
+enum BlockType {
 /** Block is to be output "as is" but may be a unified expression. */
 VERBATIM,
 /** Block is a directive, ie a fragment of JEXL code. */
-DIRECTIVE;
+DIRECTIVE
 }
 
 /**




svn commit: r1788577 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:09:14 2017
New Revision: 1788577

URL: http://svn.apache.org/viewvc?rev=1788577&view=rev
Log:
foreach loop

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java?rev=1788577&r1=1788576&r2=1788577&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateScript.java
 Sat Mar 25 00:09:14 2017
@@ -161,8 +161,7 @@ public final class TemplateScript implem
 public String asString() {
 StringBuilder strb = new StringBuilder();
 int e = 0;
-for (int b = 0; b < source.length; ++b) {
-Block block = source[b];
+for (Block block : source) {
 if (block.getType() == BlockType.DIRECTIVE) {
 strb.append(prefix);
 } else {




svn commit: r1788578 - in /commons/proper/jexl/trunk/src: main/java/org/apache/commons/jexl3/internal/TemplateEngine.java test/java/org/apache/commons/jexl3/PublicFieldsTest.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:12:47 2017
New Revision: 1788578

URL: http://svn.apache.org/viewvc?rev=1788578&view=rev
Log:
Inner enums are implicitly static (more)

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java?rev=1788578&r1=1788577&r2=1788578&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 Sat Mar 25 00:12:47 2017
@@ -86,7 +86,7 @@ public final class TemplateEngine extend
  * Each instance carries a counter index per (composite sub-) template 
expression type.
  * @see ExpressionBuilder
  */
-static enum ExpressionType {
+enum ExpressionType {
 /** Constant TemplateExpression, count index 0. */
 CONSTANT(0),
 /** Immediate TemplateExpression, count index 1. */

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java?rev=1788578&r1=1788577&r2=1788578&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java
 Sat Mar 25 00:12:47 2017
@@ -123,7 +123,7 @@ public class PublicFieldsTest extends Je
 } catch(JexlException xjexl) {}
 }
 
-public static enum Gender { MALE, FEMALE };
+public enum Gender { MALE, FEMALE };
 
 @Test public void testGetEnum() throws Exception {
 ctxt.set("com.jexl.gender", Gender.class);




svn commit: r1788579 - /commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:14:47 2017
New Revision: 1788579

URL: http://svn.apache.org/viewvc?rev=1788579&view=rev
Log:
Minor simplification, the cache is guaranteed to be never null

Modified:

commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java

Modified: 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java?rev=1788579&r1=1788578&r2=1788579&view=diff
==
--- 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 (original)
+++ 
commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/internal/TemplateEngine.java
 Sat Mar 25 00:14:47 2017
@@ -659,14 +659,10 @@ public final class TemplateEngine extend
 Exception xuel = null;
 TemplateExpression stmt = null;
 try {
-if (cache == null) {
+stmt = cache.get(expression);
+if (stmt == null) {
 stmt = parseExpression(info, expression, null);
-} else {
-stmt = cache.get(expression);
-if (stmt == null) {
-stmt = parseExpression(info, expression, null);
-cache.put(expression, stmt);
-}
+cache.put(expression, stmt);
 }
 } catch (JexlException xjexl) {
 xuel = new Exception(xjexl.getInfo(), "failed to parse '" + 
expression + "'", xjexl);




svn commit: r1788581 - /commons/proper/jexl/trunk/NOTICE.txt

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:16:26 2017
New Revision: 1788581

URL: http://svn.apache.org/viewvc?rev=1788581&view=rev
Log:
Update copyright to 2017

Modified:
commons/proper/jexl/trunk/NOTICE.txt

Modified: commons/proper/jexl/trunk/NOTICE.txt
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/NOTICE.txt?rev=1788581&r1=1788580&r2=1788581&view=diff
==
--- commons/proper/jexl/trunk/NOTICE.txt (original)
+++ commons/proper/jexl/trunk/NOTICE.txt Sat Mar 25 00:16:26 2017
@@ -1,5 +1,5 @@
 Apache Commons JEXL
-Copyright 2001-2016 The Apache Software Foundation
+Copyright 2001-2017 The Apache Software Foundation
 
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).




svn commit: r1788590 - in /commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3: ArithmeticTest.java ArrayAccessTest.java AssignTest.java LambdaTest.java

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:34:19 2017
New Revision: 1788590

URL: http://svn.apache.org/viewvc?rev=1788590&view=rev
Log:
Added the missing @Test annotations in the JUnit 4 tests

Modified:

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArrayAccessTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AssignTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/LambdaTest.java

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java?rev=1788590&r1=1788589&r2=1788590&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArithmeticTest.java
 Sat Mar 25 00:34:19 2017
@@ -305,6 +305,7 @@ public class ArithmeticTest extends Jexl
 }
 
 // JEXL-24: doubles with exponent
+@Test
 public void test2DoubleLiterals() throws Exception {
 JexlEvalContext ctxt = new JexlEvalContext();
 ctxt.setStrictArithmetic(true);
@@ -429,6 +430,7 @@ public class ArithmeticTest extends Jexl
 Assert.assertEquals(java.math.BigDecimal.class, r1.getClass());
 }
 
+@Test
 public void testDivClass() throws Exception {
 JexlEngine jexl = new JexlBuilder().create();
 JexlContext jc = new MapContext();
@@ -440,6 +442,7 @@ public class ArithmeticTest extends Jexl
 Assert.assertEquals(java.math.BigDecimal.class, r1.getClass());
 }
 
+@Test
 public void testPlusClass() throws Exception {
 JexlEngine jexl = new JexlBuilder().create();
 JexlContext jc = new MapContext();
@@ -451,6 +454,7 @@ public class ArithmeticTest extends Jexl
 Assert.assertEquals(java.math.BigDecimal.class, r1.getClass());
 }
 
+@Test
 public void testMinusClass() throws Exception {
 JexlEngine jexl = new JexlBuilder().create();
 JexlContext jc = new MapContext();

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArrayAccessTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArrayAccessTest.java?rev=1788590&r1=1788589&r2=1788590&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArrayAccessTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ArrayAccessTest.java
 Sat Mar 25 00:34:19 2017
@@ -59,6 +59,7 @@ public class ArrayAccessTest extends Jex
 /**
  * test simple array access
  */
+@Test
 public void testArrayAccess() throws Exception {
 
 /*
@@ -190,6 +191,7 @@ public class ArrayAccessTest extends Jex
 asserter.assertExpression("foo.0.1", "three");
 }
 
+@Test
 public void testArrayProperty() throws Exception {
 Foo foo = new Foo();
 
@@ -202,6 +204,7 @@ public class ArrayAccessTest extends Jex
 }
 
 // This is JEXL-26
+@Test
 public void testArrayAndDottedConflict() throws Exception {
 Object[] objects = new Object[] {"an", "array", new Long(0)};
 asserter.setStrict(false);
@@ -216,6 +219,7 @@ public class ArrayAccessTest extends Jex
 asserter.assertExpression("base.objects.1.status", null);
 }
 
+@Test
 public void testArrayIdentifierParsing() throws Exception {
 Map map = new HashMap();
 map.put("00200", -42.42d);
@@ -228,6 +232,7 @@ public class ArrayAccessTest extends Jex
 asserter.assertExpression("objects.200", 42.42d);
 }
 
+@Test
 public void testArrayMethods() throws Exception {
 Object[] objects = new Object[] {"an", "array", new Long(0)};
 
@@ -239,6 +244,7 @@ public class ArrayAccessTest extends Jex
 asserter.assertExpression("objects[1]", "dion");
 }
 
+@Test
 public void testArrayArray() throws Exception {
 Integer i42 = Integer.valueOf(42);
 Integer i43 = Integer.valueOf(43);

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AssignTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AssignTest.java?rev=1788590&r1=1788589&r2=1788590&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AssignTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/AssignTest.java
 Sat Mar 25 00:34:19 2017
@@ -109,6 +109,7 @@ public class AssignTest extends JexlTest
 Assert

svn commit: r1788591 - in /commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3: IssuesTest.java JXLTTest.java PropertyAccessTest.java PublicFieldsTest.java ScriptTest.java examples/ArrayT

2017-03-24 Thread ebourg
Author: ebourg
Date: Sat Mar 25 00:35:04 2017
New Revision: 1788591

URL: http://svn.apache.org/viewvc?rev=1788591&view=rev
Log:
Moved the @Test annotations to a separate line

Modified:

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/IssuesTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JXLTTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/ScriptTest.java

commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/examples/ArrayTest.java

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/IssuesTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/IssuesTest.java?rev=1788591&r1=1788590&r2=1788591&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/IssuesTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/IssuesTest.java
 Sat Mar 25 00:35:04 2017
@@ -813,7 +813,8 @@ public class IssuesTest extends JexlTest
 Assert.assertEquals("EXPR01 result", 22, result);
 }
 
-//@Test public void test138() throws Exception {
+//@Test
+//public void test138() throws Exception {
 //MapContext ctxt = new MapContext();
 //ctxt.set("tz", java.util.TimeZone.class);
 //String source = ""

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JXLTTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JXLTTest.java?rev=1788591&r1=1788590&r2=1788591&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JXLTTest.java 
(original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/JXLTTest.java 
Sat Mar 25 00:35:04 2017
@@ -727,7 +727,8 @@ public class JXLTTest extends JexlTestCa
 }
 //
 //
-//@Test public void testDeferredTemplate() throws Exception {
+//@Test
+//public void testDeferredTemplate() throws Exception {
 //JxltEngine.Template t = JXLT.createTemplate("$$", new StringReader(
 // "select * from \n"+
 // "##for(var c : tables) {\n"+

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java?rev=1788591&r1=1788590&r2=1788591&view=diff
==
--- 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
 (original)
+++ 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PropertyAccessTest.java
 Sat Mar 25 00:35:04 2017
@@ -46,7 +46,8 @@ public class PropertyAccessTest extends
 asserter = new Asserter(JEXL);
 }
 
-@Test public void testPropertyProperty() throws Exception {
+@Test
+public void testPropertyProperty() throws Exception {
 Integer i42 = Integer.valueOf(42);
 Integer i43 = Integer.valueOf(43);
 String s42 = "fourty-two";
@@ -133,7 +134,8 @@ public class PropertyAccessTest extends
 }
 }
 
-@Test public void testInnerViaArithmetic() throws Exception {
+@Test
+public void testInnerViaArithmetic() throws Exception {
 PropertyArithmetic pa = new PropertyArithmetic(true);
 JexlEngine jexl = new 
JexlBuilder().arithmetic(pa).debug(true).strict(true).cache(32).create();
 PropertyContainer quux = new PropertyContainer("bar", 169);
@@ -213,7 +215,8 @@ public class PropertyAccessTest extends
 }
 }
 
-@Test public void testInnerProperty() throws Exception {
+@Test
+public void testInnerProperty() throws Exception {
 PropertyArithmetic pa = new PropertyArithmetic(true);
 JexlEngine jexl = new 
JexlBuilder().arithmetic(pa).debug(true).strict(true).cache(32).create();
 Container quux = new Container("quux", 42);
@@ -269,7 +272,8 @@ public class PropertyAccessTest extends
 }
 
 
-@Test public void testStringIdentifier() throws Exception {
+@Test
+public void testStringIdentifier() throws Exception {
 Map foo = new HashMap();
 
 JexlContext jc = new MapContext();

Modified: 
commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/test/java/org/apache/commons/jexl3/PublicFieldsTest.java?rev=1788591&r1=1788590&r2=1788591&view=diff
==

svn commit: r1788639 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java

2017-03-24 Thread sebb
Author: sebb
Date: Sat Mar 25 02:02:02 2017
New Revision: 1788639

URL: http://svn.apache.org/viewvc?rev=1788639&view=rev
Log:
Typo

Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java

Modified: 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java?rev=1788639&r1=1788638&r2=1788639&view=diff
==
--- 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java 
(original)
+++ 
commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java 
Sat Mar 25 02:02:02 2017
@@ -88,7 +88,7 @@ public class POP3 extends SocketClient
 
 /**
  * A ProtocolCommandSupport object used to manage the registering of
- * ProtocolCommandListeners and te firing of ProtocolCommandEvents.
+ * ProtocolCommandListeners and the firing of ProtocolCommandEvents.
  */
 protected ProtocolCommandSupport _commandSupport_;