[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder
[ https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484759#comment-13484759 ] Mirko Raner commented on CODEC-158: --- Hi Sebb, I haven't seen any activity on this issue in a while. Are there further improvements or changes you would like me to make, or is the patch ready to be committed? Thanks, Mirko Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder --- Key: CODEC-158 URL: https://issues.apache.org/jira/browse/CODEC-158 Project: Commons Codec Issue Type: Improvement Affects Versions: 1.7 Reporter: Mirko Raner Priority: Minor Attachments: CODEC-158.patch, CODEC-158.patch Original Estimate: 1h Remaining Estimate: 1h Currently, there are no common interfaces that extend both the encoder and the decoder interfaces. This makes it hard to deal with a codec as a single entity and requires separate treatment of encoder and decoder parts. For example, let's say you want to develop a storage abstraction that uses an encoding. Right now, you would need to write class Storage { @Inject Encoder encoder; @Inject Decoder decoder; //... } In practice, encoder and decoder need to match, and most likely both encoder and decoder would be bound to the same implementation, like Base64 or URLCodec. Because of the lack of a common superinterface they need to be specified separately. There are some classes like BaseNCodec that can be used to unify some of the encoders and decoders, but they are too specific and restrictive. Ideally, I would like to write: class Storage { @Inject Codec codec; //... } Assuming that combined encoder/decoder classes like Base64 would implement that Codec interface, this could be directly bound to a combined encoder/decoder implementation. It would be nice if these interfaces were added and the existing codec classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be modified to implement these new interfaces. I'm happy to contribute a patch if there is interest in this feature. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-836) StrSubstitutor does not support StringBuilder or CharSequence
[ https://issues.apache.org/jira/browse/LANG-836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arnaud Brunet updated LANG-836: --- Attachment: mylyn-context.zip StrSubstitutor does not support StringBuilder or CharSequence - Key: LANG-836 URL: https://issues.apache.org/jira/browse/LANG-836 Project: Commons Lang Issue Type: Bug Reporter: Sebb Attachments: LANG-836.patch, LANG-836-v2.patch, mylyn-context.zip -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-836) StrSubstitutor does not support StringBuilder or CharSequence
[ https://issues.apache.org/jira/browse/LANG-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484815#comment-13484815 ] Arnaud Brunet commented on LANG-836: Attached a new patch that doesn't break binary comptability (i hope). StrSubstitutor does not support StringBuilder or CharSequence - Key: LANG-836 URL: https://issues.apache.org/jira/browse/LANG-836 Project: Commons Lang Issue Type: Bug Reporter: Sebb Attachments: LANG-836.patch, LANG-836-v2.patch, mylyn-context.zip -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-836) StrSubstitutor does not support StringBuilder or CharSequence
[ https://issues.apache.org/jira/browse/LANG-836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arnaud Brunet updated LANG-836: --- Attachment: LANG-836-v2.patch StrSubstitutor does not support StringBuilder or CharSequence - Key: LANG-836 URL: https://issues.apache.org/jira/browse/LANG-836 Project: Commons Lang Issue Type: Bug Reporter: Sebb Attachments: LANG-836.patch, LANG-836-v2.patch, mylyn-context.zip -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-836) StrSubstitutor does not support StringBuilder or CharSequence
[ https://issues.apache.org/jira/browse/LANG-836?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Arnaud Brunet updated LANG-836: --- Attachment: (was: mylyn-context.zip) StrSubstitutor does not support StringBuilder or CharSequence - Key: LANG-836 URL: https://issues.apache.org/jira/browse/LANG-836 Project: Commons Lang Issue Type: Bug Reporter: Sebb Attachments: LANG-836.patch, LANG-836-v2.patch -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CODEC-161) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec
[ https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm Rice updated CODEC-161: Attachment: CODEC-161-MatchRatingApproach.patch MRA patch. My 1st contribution :-) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec --- Key: CODEC-161 URL: https://issues.apache.org/jira/browse/CODEC-161 Project: Commons Codec Issue Type: New Feature Affects Versions: 1.6 Reporter: Colm Rice Priority: Minor Labels: newbie Attachments: CODEC-161-MatchRatingApproach.patch Original Estimate: 168h Remaining Estimate: 168h I want to add MatchRatingApproach algorithm to the Lucene project via commons codec. What I have at the moment is a class called org.apache.lucene.analysis.phoenetic.MatchRatingApproach implementing StringEncoder I have a pretty comprehensive test file located at: org.apache.lucene.analysis.phonetic.MatchRatingApproachTests It's not exactly existing pattern so I'm going to need a bit of advice here. Thanks! Feel free to email. FYI: It my first contribution so be gentle :-) C# is my native. I had incorrectly added this to Lucene solution as LUCENE-4494 but received some good advice to move it to here. I'm doing that now. Reference: http://en.wikipedia.org/wiki/Match_rating_approach -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (CODEC-161) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec
[ https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484828#comment-13484828 ] Colm Rice edited comment on CODEC-161 at 10/26/12 10:20 AM: MRA phonetic codec patch. My 1st contribution :-) Ack. Ryan McKinley cf. LUCENE-4494 was (Author: crice): MRA patch. My 1st contribution :-) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec --- Key: CODEC-161 URL: https://issues.apache.org/jira/browse/CODEC-161 Project: Commons Codec Issue Type: New Feature Affects Versions: 1.6 Reporter: Colm Rice Priority: Minor Labels: newbie Attachments: CODEC-161-MatchRatingApproach.patch Original Estimate: 168h Remaining Estimate: 168h I want to add MatchRatingApproach algorithm to the Lucene project via commons codec. What I have at the moment is a class called org.apache.lucene.analysis.phoenetic.MatchRatingApproach implementing StringEncoder I have a pretty comprehensive test file located at: org.apache.lucene.analysis.phonetic.MatchRatingApproachTests It's not exactly existing pattern so I'm going to need a bit of advice here. Thanks! Feel free to email. FYI: It my first contribution so be gentle :-) C# is my native. I had incorrectly added this to Lucene solution as LUCENE-4494 but received some good advice to move it to here. I'm doing that now. Reference: http://en.wikipedia.org/wiki/Match_rating_approach -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MATH-878) G-Test (Log-Likelihood ratio - LLR test) in math.stat.inference
[ https://issues.apache.org/jira/browse/MATH-878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Radoslav Tsvetkov updated MATH-878: --- Attachment: MATH-878_gTest_26102012.patch I added most corrections. * All corrections in the code part (no underscore in the names etc.) * comments should look better now. The condensed form of the linked content is added in the comments. For sure there are some more issues left to beautify. G-Test (Log-Likelihood ratio - LLR test) in math.stat.inference --- Key: MATH-878 URL: https://issues.apache.org/jira/browse/MATH-878 Project: Commons Math Issue Type: New Feature Affects Versions: 3.1, 3.2, 4.0 Environment: Netbeans Reporter: Radoslav Tsvetkov Labels: features, test Fix For: 3.1 Attachments: MATH-878_gTest_12102012.patch, MATH-878_gTest_15102012.patch, MATH-878_gTest_26102012.patch, vcs-diff16294.patch Original Estimate: 24h Remaining Estimate: 24h 1. Implementation of G-Test (Log-Likelihood ratio LLR test for independence and goodnes-of-fit) 2. Reference: http://en.wikipedia.org/wiki/G-test 3. Reasons-Usefulness: G-tests are tests are increasingly being used in situations where chi-squared tests were previously recommended. The approximation to the theoretical chi-squared distribution for the G-test is better than for the Pearson chi-squared tests. In cases where Observed 2*Expected for some cell case, the G-test is always better than the chi-squared test. For testing goodness-of-fit the G-test is infinitely more efficient than the chi squared test in the sense of Bahadur, but the two tests are equally efficient in the sense of Pitman or in the sense of Hodge and Lehman. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (MATH-878) G-Test (Log-Likelihood ratio - LLR test) in math.stat.inference
[ https://issues.apache.org/jira/browse/MATH-878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484887#comment-13484887 ] Radoslav Tsvetkov edited comment on MATH-878 at 10/26/12 12:54 PM: --- I added most of the corrections. * All corrections in the code part (no underscore in the names etc.) * Comments should look better now. The condensed form of the linked content is added in the comments. (but the links are left) For sure there are some more points left to beautify but with the time I guess they'll be perfected. was (Author: rtsvet): I added most corrections. * All corrections in the code part (no underscore in the names etc.) * comments should look better now. The condensed form of the linked content is added in the comments. For sure there are some more issues left to beautify. G-Test (Log-Likelihood ratio - LLR test) in math.stat.inference --- Key: MATH-878 URL: https://issues.apache.org/jira/browse/MATH-878 Project: Commons Math Issue Type: New Feature Affects Versions: 3.1, 3.2, 4.0 Environment: Netbeans Reporter: Radoslav Tsvetkov Labels: features, test Fix For: 3.1 Attachments: MATH-878_gTest_12102012.patch, MATH-878_gTest_15102012.patch, MATH-878_gTest_26102012.patch, vcs-diff16294.patch Original Estimate: 24h Remaining Estimate: 24h 1. Implementation of G-Test (Log-Likelihood ratio LLR test for independence and goodnes-of-fit) 2. Reference: http://en.wikipedia.org/wiki/G-test 3. Reasons-Usefulness: G-tests are tests are increasingly being used in situations where chi-squared tests were previously recommended. The approximation to the theoretical chi-squared distribution for the G-test is better than for the Pearson chi-squared tests. In cases where Observed 2*Expected for some cell case, the G-test is always better than the chi-squared test. For testing goodness-of-fit the G-test is infinitely more efficient than the chi squared test in the sense of Bahadur, but the two tests are equally efficient in the sense of Pitman or in the sense of Hodge and Lehman. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Gregory updated VFS-440: - Attachment: sftp-stream-proxy-v4.diff Benjamin, I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below. Questions: 1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something? 2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it? Gary [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484930#comment-13484930 ] Gary Gregory edited comment on VFS-440 at 10/26/12 2:00 PM: Benjamin, I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below. Questions: 1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something? 2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it? 3. SftpStreamProxy getSocket() returns null, I think this warrants a comment. Gary was (Author: garydgregory): Benjamin, I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below. Questions: 1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something? 2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it? Gary [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484941#comment-13484941 ] Benjamin Piwowarski commented on VFS-440: - Gary, here are the answers to your questions: 1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections; 3. SftpStreamProxy does not rely on sockets - hence it does not have one. Benjamin [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484941#comment-13484941 ] Benjamin Piwowarski edited comment on VFS-440 at 10/26/12 2:15 PM: --- Gary, here are the answers to your questions: 1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections; 3. SftpStreamProxy does not rely on sockets - hence it does not have one. I reviewed the changes in patch v4 and I have no special comments. Benjamin was (Author: bpiwowar): Gary, here are the answers to your questions: 1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections; 3. SftpStreamProxy does not rely on sockets - hence it does not have one. Benjamin [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484958#comment-13484958 ] Gary Gregory commented on VFS-440: -- So the session ivar be removed, check? [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484962#comment-13484962 ] Benjamin Piwowarski commented on VFS-440: - Just to be sure: - JSch jsch should be removed - in connect, the final Session should be removed so that we use the member variable session and not a local one (and that the session can be properly closed) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485027#comment-13485027 ] Gary Gregory commented on VFS-440: -- Ok, It's clear now. Thanks. [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (LANG-847) Add an isTrue and isFalse method to StringUtils
Dexter Fryar created LANG-847: - Summary: Add an isTrue and isFalse method to StringUtils Key: LANG-847 URL: https://issues.apache.org/jira/browse/LANG-847 Project: Commons Lang Issue Type: Improvement Affects Versions: 3.x Reporter: Dexter Fryar Priority: Trivial Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile Implement a common list of true / false statements with a helper method which cleans and validates an input string. StringUtils.isFalse(OFF) StringUtils.isFalse(false) StringUtils.isFalse( false) StringUtils.isFalse(false\n) StringUtils.isFalse( false\r\n ) StringUtils.isFalse( 0\r\n ) StringUtils.isFalse(disable) StringUtils.isFalse( disable\r\n ) StringUtils.isFalse(disabled) StringUtils.isFalse( disabled\r\n ) StringUtils.isFalse(N) StringUtils.isFalse( N\n ) StringUtils.isFalse(NO) StringUtils.isFalse(NO\r\n ) StringUtils.isTrue(ON) StringUtils.isTrue(true) StringUtils.isTrue( true) StringUtils.isTrue(true\n) StringUtils.isTrue( true\r\n ) StringUtils.isTrue( 1\r\n ) StringUtils.isTrue(enable) StringUtils.isTrue( enable\r\n ) StringUtils.isTrue(enabled) StringUtils.isTrue( enabled\r\n ) StringUtils.isTrue(Y) StringUtils.isTrue( Y\n ) StringUtils.isTrue(YES) StringUtils.isTrue(YES\r\n ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-847) Add an isTrue and isFalse method to StringUtils
[ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dexter Fryar updated LANG-847: -- Attachment: StringUtilsTest.java.patchfile StringUtils.java.patchfile Added two patch files that contain junit and source. Add an isTrue and isFalse method to StringUtils --- Key: LANG-847 URL: https://issues.apache.org/jira/browse/LANG-847 Project: Commons Lang Issue Type: Improvement Affects Versions: 3.x Reporter: Dexter Fryar Priority: Trivial Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile Original Estimate: 2h Remaining Estimate: 2h Implement a common list of true / false statements with a helper method which cleans and validates an input string. StringUtils.isFalse(OFF) StringUtils.isFalse(false) StringUtils.isFalse( false) StringUtils.isFalse(false\n) StringUtils.isFalse( false\r\n ) StringUtils.isFalse( 0\r\n ) StringUtils.isFalse(disable) StringUtils.isFalse( disable\r\n ) StringUtils.isFalse(disabled) StringUtils.isFalse( disabled\r\n ) StringUtils.isFalse(N) StringUtils.isFalse( N\n ) StringUtils.isFalse(NO) StringUtils.isFalse(NO\r\n ) StringUtils.isTrue(ON) StringUtils.isTrue(true) StringUtils.isTrue( true) StringUtils.isTrue(true\n) StringUtils.isTrue( true\r\n ) StringUtils.isTrue( 1\r\n ) StringUtils.isTrue(enable) StringUtils.isTrue( enable\r\n ) StringUtils.isTrue(enabled) StringUtils.isTrue( enabled\r\n ) StringUtils.isTrue(Y) StringUtils.isTrue( Y\n ) StringUtils.isTrue(YES) StringUtils.isTrue(YES\r\n ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Gregory updated VFS-440: - Attachment: sftp-stream-proxy-v5.diff We are getting close! The remaining issue is the test is not cleaning up after itself. This affects all the patches I tested: v3, v4 and v5: {noformat} --- With V3 patch: --- T E S T S --- Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase Sftp server started on port 64349 true created threads still running: #1: mainNioProcessor-2 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #2: mainpool-1-thread-1 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #3: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #4: mainThread-2not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #5: mainNioProcessor-3 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #6: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #7: mainThread-4not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #8: mainNioProcessor-4 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #9: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #10: main Thread-6not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #11: main pool-2-thread-4 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #12: main Thread-11 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #13: main Thread-27 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #14: main Thread-28 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #15: main Thread-29 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem created threads still running: #1: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session Tests run: 87, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.693 sec --- With V4 patch: --- T E S T S --- Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase Sftp server started on port 64466 true created threads still running: #1: mainNioProcessor-2 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #2: mainpool-1-thread-1 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #3: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #4: mainThread-2not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #5: mainNioProcessor-3 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #6: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #7: mainThread-4not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #8: mainNioProcessor-4 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #9: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session #10: main Thread-6not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #11: main pool-2-thread-4 not_a_daemonclass java.util.concurrent.ThreadPoolExecutor$Worker #12: main Thread-11 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #13: main Thread-27 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #14: main Thread-28 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem #15: main Thread-29 not_a_daemonclass org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem created threads still running: #1: mainConnect thread localhost sessiondaemon class com.jcraft.jsch.Session Tests run: 87, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.981 sec
[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
[ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485118#comment-13485118 ] Gary Gregory commented on VFS-440: -- I attached v5 of the patch. [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand) - Key: VFS-440 URL: https://issues.apache.org/jira/browse/VFS-440 Project: Commons VFS Issue Type: Improvement Reporter: Benjamin Piwowarski Priority: Minor Labels: proxy, sftp Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance http://backdrift.org/transparent-proxy-with-ssh for a use case. This simulates a ProxyCommand where the command is run on a SSH host. The patch also contains a test for the new functionality. Example of use (with the netcat command nc -q 0 HOSTNAME PORT) {code:java} builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM); builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND); builder.setProxyHost(opts, gate.way.host); builder.setProxyPort(opts, 22); builder.setProxyOptions(opts, proxyOptions); {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CODEC-161) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec
[ https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485138#comment-13485138 ] Thomas Neidhart commented on CODEC-161: --- Hi Colm, thanks for your contribution, I looked at the patch and it's not so bad, though it will require some adaptations before it can be accepted: * indentation is normally 4 chars, only spaces * author name is usually omitted in the source files, but added to the pom.xml * try to avoid trailing spaces in a line * naming convention for methods: camel case, e.g. removeVowels, instead of RemoveVowels * try to use parenthesis also for single line if clauses * documentation for private methods should be using javadoc style or omitted * the removeAccents method uses indexOf in a string to remove accents, but this can be rather slow for large strings better use a set of all accent chars btw. there is a checkstyle configuration in the trunk, which you can use to check your contribution (e.g. with the eclipse plugin or on the command line with maven: mvn checkstyle:checkstyle). The less warnings remain the more likely it is that a patch will be committed ;-). Thomas Add phonetic algorithm Match Rating Approach (MRA) to the commons codec --- Key: CODEC-161 URL: https://issues.apache.org/jira/browse/CODEC-161 Project: Commons Codec Issue Type: New Feature Affects Versions: 1.6 Reporter: Colm Rice Priority: Minor Labels: newbie Attachments: CODEC-161-MatchRatingApproach.patch Original Estimate: 168h Remaining Estimate: 168h I want to add MatchRatingApproach algorithm to the Lucene project via commons codec. What I have at the moment is a class called org.apache.lucene.analysis.phoenetic.MatchRatingApproach implementing StringEncoder I have a pretty comprehensive test file located at: org.apache.lucene.analysis.phonetic.MatchRatingApproachTests It's not exactly existing pattern so I'm going to need a bit of advice here. Thanks! Feel free to email. FYI: It my first contribution so be gentle :-) C# is my native. I had incorrectly added this to Lucene solution as LUCENE-4494 but received some good advice to move it to here. I'm doing that now. Reference: http://en.wikipedia.org/wiki/Match_rating_approach -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CODEC-161) Add phonetic algorithm Match Rating Approach (MRA) to the commons codec
[ https://issues.apache.org/jira/browse/CODEC-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485148#comment-13485148 ] Gary Gregory commented on CODEC-161: Hello Colm, Thank you for the patch. Welcome to our little [codec] world! Please find my code review below. # General note: Look at the code around you in [codec] and follow the conventions you see. # Rename the main class from {{MatchRatingApproach}} to {{MatchRatingApproachEncoder}} # All methods start with a lower case, so rename {{public static String GetMRA(String name)}} to {{GetMRA}}, and so on. # About @see hyperlink(s) in the Javadoc for {{MatchRatingApproachEncoder}}. If Wikipedia is all there is, then so be it, but any other documentation would be helpful. # You can add yourself as a contributor in the pom.xml but I'd rather leave names, emails (and egos) out of .java files. # In the Javadocs, soundex should be Soundex. # Always use blocks. IOW: if (expr){\n stmt;\n} # Rename all unit test methods to be prefixed with {{test}} instead of {{MRA_}}. # The method {{RemoveDoubleConsonants}} (sic) looks like it could be implemented in one loop. I'd worry about this one last. # {{PLAIN_ASCII}} and {{UNICODE}} need Javadoc to explain how they are used. # Rename {{MatchRatingApproachTests}} to {{MatchRatingApproachTest}} (singular) or Maven will not pick it up in the test suite. # Improve code coverage from 84% to... can you get it to 100%? # In-line your test methods from: {code:java} @Test public void MRA_Compare_ZACH_ZAKARIA_SuccessfullyMatched() { //Arrange String testInput2 = Zach; String testInput1 = Zakaria; //Assert boolean actualRes = MatchRatingApproach.CompareMRA(testInput1, testInput2); //Act assertTrue(actualRes); } {code} to: {code:java} @Test public void MRA_Compare_ZACH_ZAKARIA_SuccessfullyMatched() { assertTrue(MatchRatingApproach.CompareMRA(Zakaria, Zach)); } {code} Add phonetic algorithm Match Rating Approach (MRA) to the commons codec --- Key: CODEC-161 URL: https://issues.apache.org/jira/browse/CODEC-161 Project: Commons Codec Issue Type: New Feature Affects Versions: 1.6 Reporter: Colm Rice Priority: Minor Labels: newbie Attachments: CODEC-161-MatchRatingApproach.patch Original Estimate: 168h Remaining Estimate: 168h I want to add MatchRatingApproach algorithm to the Lucene project via commons codec. What I have at the moment is a class called org.apache.lucene.analysis.phoenetic.MatchRatingApproach implementing StringEncoder I have a pretty comprehensive test file located at: org.apache.lucene.analysis.phonetic.MatchRatingApproachTests It's not exactly existing pattern so I'm going to need a bit of advice here. Thanks! Feel free to email. FYI: It my first contribution so be gentle :-) C# is my native. I had incorrectly added this to Lucene solution as LUCENE-4494 but received some good advice to move it to here. I'm doing that now. Reference: http://en.wikipedia.org/wiki/Match_rating_approach -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (SANDBOX-436) [BeanUtils2] Implement BeanAccessor.getMapped
Benedikt Ritter created SANDBOX-436: --- Summary: [BeanUtils2] Implement BeanAccessor.getMapped Key: SANDBOX-436 URL: https://issues.apache.org/jira/browse/SANDBOX-436 Project: Commons Sandbox Issue Type: Improvement Components: BeanUtils2 Affects Versions: Nightly Builds Reporter: Benedikt Ritter The method getMapped() has to be implemented on DefaultBeanAccessor. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (SANDBOX-436) [BeanUtils2] Implement BeanAccessor.getMapped
[ https://issues.apache.org/jira/browse/SANDBOX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benedikt Ritter updated SANDBOX-436: Attachment: SANDBOX-436.patch I've created a patch for this issue. It also contains the changes from my patch for SANDBOX-433 because the tests are failing on my machine without those changes. To resolve this issue, I have reused the MappedPropertyDescriptor from BeanUtils1. TIA for review. [BeanUtils2] Implement BeanAccessor.getMapped - Key: SANDBOX-436 URL: https://issues.apache.org/jira/browse/SANDBOX-436 Project: Commons Sandbox Issue Type: Improvement Components: BeanUtils2 Affects Versions: Nightly Builds Reporter: Benedikt Ritter Attachments: SANDBOX-436.patch The method getMapped() has to be implemented on DefaultBeanAccessor. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (LANG-847) Add an isTrue and isFalse method to StringUtils
[ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dexter Fryar updated LANG-847: -- Component/s: lang.* Add an isTrue and isFalse method to StringUtils --- Key: LANG-847 URL: https://issues.apache.org/jira/browse/LANG-847 Project: Commons Lang Issue Type: Improvement Components: lang.* Affects Versions: 3.x Reporter: Dexter Fryar Priority: Trivial Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile Original Estimate: 2h Remaining Estimate: 2h Implement a common list of true / false statements with a helper method which cleans and validates an input string. StringUtils.isFalse(OFF) StringUtils.isFalse(false) StringUtils.isFalse( false) StringUtils.isFalse(false\n) StringUtils.isFalse( false\r\n ) StringUtils.isFalse( 0\r\n ) StringUtils.isFalse(disable) StringUtils.isFalse( disable\r\n ) StringUtils.isFalse(disabled) StringUtils.isFalse( disabled\r\n ) StringUtils.isFalse(N) StringUtils.isFalse( N\n ) StringUtils.isFalse(NO) StringUtils.isFalse(NO\r\n ) StringUtils.isTrue(ON) StringUtils.isTrue(true) StringUtils.isTrue( true) StringUtils.isTrue(true\n) StringUtils.isTrue( true\r\n ) StringUtils.isTrue( 1\r\n ) StringUtils.isTrue(enable) StringUtils.isTrue( enable\r\n ) StringUtils.isTrue(enabled) StringUtils.isTrue( enabled\r\n ) StringUtils.isTrue(Y) StringUtils.isTrue( Y\n ) StringUtils.isTrue(YES) StringUtils.isTrue(YES\r\n ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-847) Add an isTrue and isFalse method to StringUtils
[ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485232#comment-13485232 ] James Ring commented on LANG-847: - I don't think this is appropriate for a general-purpose lib like Commons Lang. It's hard to see a burning need for something like this. Add an isTrue and isFalse method to StringUtils --- Key: LANG-847 URL: https://issues.apache.org/jira/browse/LANG-847 Project: Commons Lang Issue Type: Improvement Components: lang.* Affects Versions: 3.x Reporter: Dexter Fryar Priority: Trivial Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile Original Estimate: 2h Remaining Estimate: 2h Implement a common list of true / false statements with a helper method which cleans and validates an input string. StringUtils.isFalse(OFF) StringUtils.isFalse(false) StringUtils.isFalse( false) StringUtils.isFalse(false\n) StringUtils.isFalse( false\r\n ) StringUtils.isFalse( 0\r\n ) StringUtils.isFalse(disable) StringUtils.isFalse( disable\r\n ) StringUtils.isFalse(disabled) StringUtils.isFalse( disabled\r\n ) StringUtils.isFalse(N) StringUtils.isFalse( N\n ) StringUtils.isFalse(NO) StringUtils.isFalse(NO\r\n ) StringUtils.isTrue(ON) StringUtils.isTrue(true) StringUtils.isTrue( true) StringUtils.isTrue(true\n) StringUtils.isTrue( true\r\n ) StringUtils.isTrue( 1\r\n ) StringUtils.isTrue(enable) StringUtils.isTrue( enable\r\n ) StringUtils.isTrue(enabled) StringUtils.isTrue( enabled\r\n ) StringUtils.isTrue(Y) StringUtils.isTrue( Y\n ) StringUtils.isTrue(YES) StringUtils.isTrue(YES\r\n ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (IO-354) Commons IO Tailer does not respect UTF-8 Charset
Liyu Yi created IO-354: -- Summary: Commons IO Tailer does not respect UTF-8 Charset Key: IO-354 URL: https://issues.apache.org/jira/browse/IO-354 Project: Commons IO Issue Type: Bug Components: Utilities Affects Versions: 2.3 Environment: JDK 7 RHEL Linux Apache Commons IO version 2.4 Reporter: Liyu Yi I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460case '\n': 461seenCR = false; // swallow CR before LF 462listener.handle(sb.toString()); 463sb.setLength(0); 464rePos = pos + i + 1; 465break; 466case '\r': 467if (seenCR) { 468sb.append('\r'); 469} 470seenCR = true; 471break; 472default: 473if (seenCR) { 474seenCR = false; // swallow final CR 475listener.handle(sb.toString()); 476sb.setLength(0); 477rePos = pos + i + 1; 478} 479sb.append((char) ch); // add character, not its ascii value 480} 481} 482 483pos = reader.getFilePointer(); 484} 485 486reader.seek(rePos); // Ensure we can re-read if necessary 487return rePos; 488} At line 479, the conversion of byte to char types breaks the encoding. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IO-354) Commons IO Tailer does not respect UTF-8 Charset
[ https://issues.apache.org/jira/browse/IO-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485300#comment-13485300 ] Liyu Yi commented on IO-354: I used a hacky fix to reconstruct the String with right encoding in the handler class. private String rebuildUTF8String(String line) { int len = line.length(); byte[] bytes = new byte[len]; for (int i=0; ilen; i++) { bytes[i] = (byte)line.charAt(i); } return new String(bytes, UTF8); } However, the right approach is to pass in the encoding in the create method and handling it in the Tailer. Commons IO Tailer does not respect UTF-8 Charset Key: IO-354 URL: https://issues.apache.org/jira/browse/IO-354 Project: Commons IO Issue Type: Bug Components: Utilities Affects Versions: 2.3 Environment: JDK 7 RHEL Linux Apache Commons IO version 2.4 Reporter: Liyu Yi Labels: Charset, Encoding, Tailer I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460case '\n': 461seenCR = false; // swallow CR before LF 462listener.handle(sb.toString()); 463sb.setLength(0); 464rePos = pos + i + 1; 465break; 466case '\r': 467if (seenCR) { 468sb.append('\r'); 469} 470seenCR = true; 471break; 472default: 473if (seenCR) { 474seenCR = false; // swallow final CR 475listener.handle(sb.toString()); 476sb.setLength(0); 477rePos = pos + i + 1; 478} 479sb.append((char) ch); // add character, not its ascii value 480} 481} 482 483pos = reader.getFilePointer(); 484} 485 486reader.seek(rePos); // Ensure we can re-read if necessary 487return rePos; 488} At line 479, the conversion of byte to char types breaks the encoding. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (IO-354) Commons IO Tailer does not respect UTF-8 Charset
[ https://issues.apache.org/jira/browse/IO-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485300#comment-13485300 ] Liyu Yi edited comment on IO-354 at 10/27/12 12:10 AM: --- I used a hacky fix to reconstruct the String with right encoding in the handler class. private String rebuildUTF8String(String line) { int len = line.length(); byte[] bytes = new byte[len]; for (int i=0; ilen; i++) { bytes[i] = (byte)line.charAt(i); } return new String(bytes, UTF8); } However, the right approach is to pass in the encoding in the create method and handle it in the Tailer. was (Author: liyuyi): I used a hacky fix to reconstruct the String with right encoding in the handler class. private String rebuildUTF8String(String line) { int len = line.length(); byte[] bytes = new byte[len]; for (int i=0; ilen; i++) { bytes[i] = (byte)line.charAt(i); } return new String(bytes, UTF8); } However, the right approach is to pass in the encoding in the create method and handling it in the Tailer. Commons IO Tailer does not respect UTF-8 Charset Key: IO-354 URL: https://issues.apache.org/jira/browse/IO-354 Project: Commons IO Issue Type: Bug Components: Utilities Affects Versions: 2.3 Environment: JDK 7 RHEL Linux Apache Commons IO version 2.4 Reporter: Liyu Yi Labels: Charset, Encoding, Tailer I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460case '\n': 461seenCR = false; // swallow CR before LF 462listener.handle(sb.toString()); 463sb.setLength(0); 464rePos = pos + i + 1; 465break; 466case '\r': 467if (seenCR) { 468sb.append('\r'); 469} 470seenCR = true; 471break; 472default: 473if (seenCR) { 474seenCR = false; // swallow final CR 475listener.handle(sb.toString()); 476sb.setLength(0); 477rePos = pos + i + 1; 478} 479sb.append((char) ch); // add character, not its ascii value 480} 481} 482 483pos = reader.getFilePointer(); 484} 485 486reader.seek(rePos); // Ensure we can re-read if necessary 487return rePos; 488} At line 479, the conversion of byte to char types breaks the encoding. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (IO-354) Commons IO Tailer does not respect UTF-8 Charset
[ https://issues.apache.org/jira/browse/IO-354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Liyu Yi updated IO-354: --- Description: I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460case '\n': 461seenCR = false; // swallow CR before LF 462listener.handle(sb.toString()); 463sb.setLength(0); 464rePos = pos + i + 1; 465break; 466case '\r': 467if (seenCR) { 468sb.append('\r'); 469} 470seenCR = true; 471break; 472default: 473if (seenCR) { 474seenCR = false; // swallow final CR 475listener.handle(sb.toString()); 476sb.setLength(0); 477rePos = pos + i + 1; 478} 479sb.append((char) ch); // add character, not its ascii value 480} 481} 482 483pos = reader.getFilePointer(); 484} 485 486reader.seek(rePos); // Ensure we can re-read if necessary 487return rePos; 488} At line 479, the conversion of byte to char type breaks the encoding. was: I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460case '\n': 461seenCR = false; // swallow CR before LF 462listener.handle(sb.toString()); 463sb.setLength(0); 464rePos = pos + i + 1; 465break; 466case '\r': 467if (seenCR) { 468sb.append('\r'); 469} 470seenCR = true; 471break; 472default: 473if (seenCR) { 474seenCR = false; // swallow final CR 475listener.handle(sb.toString()); 476sb.setLength(0); 477rePos = pos + i + 1; 478} 479sb.append((char) ch); // add character, not its ascii value 480} 481} 482 483pos = reader.getFilePointer(); 484} 485 486reader.seek(rePos); // Ensure we can re-read if necessary 487return rePos; 488} At line 479, the conversion of byte to char types breaks the encoding. Commons IO Tailer does not respect UTF-8 Charset Key: IO-354 URL: https://issues.apache.org/jira/browse/IO-354 Project: Commons IO Issue Type: Bug Components: Utilities Affects Versions: 2.3 Environment: JDK 7 RHEL Linux Apache Commons IO version 2.4 Reporter: Liyu Yi Labels: Charset, Encoding, Tailer I just realized there is a defect in the source code of org.apache.commons.io.input.Tailer.java. Basically, the current implementation does not work for multi-byte encoded files. See the following snippet, 448private long readLines(RandomAccessFile reader) throws IOException { 449StringBuilder sb = new StringBuilder(); 450 451long pos = reader.getFilePointer(); 452long rePos = pos; // position to re-read 453 454int num; 455boolean seenCR = false; 456while (run ((num = reader.read(inbuf)) != -1)) { 457for (int i = 0; i num; i++) { 458byte ch = inbuf[i]; 459switch (ch) { 460
[jira] [Created] (MATH-883) getSquareRoot in EigenDecomposition
Gilles created MATH-883: --- Summary: getSquareRoot in EigenDecomposition Key: MATH-883 URL: https://issues.apache.org/jira/browse/MATH-883 Project: Commons Math Issue Type: New Feature Reporter: Gilles Assignee: Gilles Priority: Minor Fix For: 3.1 I propose to add a method getSquareRoot in class EigenDecomposition (package o.a.c.m.linear). When assuming that the matrix is symmetric and positive definite, the implementation is trivial (see [By diagonalisation|http://en.wikipedia.org/wiki/Square_root_of_a_matrix]). I would also suggest that the isSymmetric method be moved from EigenDecomposition to MatrixUtils. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-847) Add an isTrue and isFalse method to StringUtils
[ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13485304#comment-13485304 ] Gary Gregory commented on LANG-847: --- This feels out of scope. What about other languages? Add an isTrue and isFalse method to StringUtils --- Key: LANG-847 URL: https://issues.apache.org/jira/browse/LANG-847 Project: Commons Lang Issue Type: Improvement Components: lang.* Affects Versions: 3.x Reporter: Dexter Fryar Priority: Trivial Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile Original Estimate: 2h Remaining Estimate: 2h Implement a common list of true / false statements with a helper method which cleans and validates an input string. StringUtils.isFalse(OFF) StringUtils.isFalse(false) StringUtils.isFalse( false) StringUtils.isFalse(false\n) StringUtils.isFalse( false\r\n ) StringUtils.isFalse( 0\r\n ) StringUtils.isFalse(disable) StringUtils.isFalse( disable\r\n ) StringUtils.isFalse(disabled) StringUtils.isFalse( disabled\r\n ) StringUtils.isFalse(N) StringUtils.isFalse( N\n ) StringUtils.isFalse(NO) StringUtils.isFalse(NO\r\n ) StringUtils.isTrue(ON) StringUtils.isTrue(true) StringUtils.isTrue( true) StringUtils.isTrue(true\n) StringUtils.isTrue( true\r\n ) StringUtils.isTrue( 1\r\n ) StringUtils.isTrue(enable) StringUtils.isTrue( enable\r\n ) StringUtils.isTrue(enabled) StringUtils.isTrue( enabled\r\n ) StringUtils.isTrue(Y) StringUtils.isTrue( Y\n ) StringUtils.isTrue(YES) StringUtils.isTrue(YES\r\n ) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira