[jira] [Updated] (MATH-649) SimpleRegression needs the ability to surpress the intercept
[ https://issues.apache.org/jira/browse/MATH-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Steitz updated MATH-649: - Affects Version/s: (was: 3.1) 1.2 2.1 2.2 Fix Version/s: 3.0 SimpleRegression needs the ability to surpress the intercept Key: MATH-649 URL: https://issues.apache.org/jira/browse/MATH-649 Project: Commons Math Issue Type: New Feature Affects Versions: 1.2, 2.1, 2.2 Environment: JAVA Reporter: greg sterijevski Priority: Minor Labels: NOINTERCEPT, SIMPLEREGRESSION Fix For: 3.0 Attachments: simplereg, simpleregtest Original Estimate: 2h Remaining Estimate: 2h The SimpleRegression class is a useful class for running regressions involving one independent variable. It lacks the ability to constrain the constant to be zero. I am attaching a patch which gives a constructor for setting NOINT. I am also checking in two NIST data sets for noint estimation. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-744) StringUtils throws java.security.AccessControlException on Google App Engine
[ https://issues.apache.org/jira/browse/LANG-744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088637#comment-13088637 ] Sebb commented on LANG-744: --- The static code should probably just catch Exception. Do we really want any RuntimeExceptions to escape into the calling code? StringUtils throws java.security.AccessControlException on Google App Engine Key: LANG-744 URL: https://issues.apache.org/jira/browse/LANG-744 Project: Commons Lang Issue Type: Bug Components: lang.* Affects Versions: 3.0.1 Environment: Google App Engine Reporter: Clément Denis In the static initializer of org.apache.commons.lang3.StringUtils, there is an attempt to load the class sun.text.Normalizer. Such a class is prohibited on Google App Engine, and the static intializer throws a java.security.AccessControlException. {code} Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.text) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374) at java.security.AccessController.checkPermission(AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:166) at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1512) at java.lang.Class.checkMemberAccess(Class.java:2164) at java.lang.Class.getMethod(Class.java:1602) at org.apache.commons.lang3.StringUtils.clinit(StringUtils.java:739) {code} The exception should be caught in the catch clauses around loadClass(sun.text.Normalizer). Commons lang 2 worked fine on GAE. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MATH-649) SimpleRegression needs the ability to suppress the intercept
[ https://issues.apache.org/jira/browse/MATH-649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb updated MATH-649: -- Summary: SimpleRegression needs the ability to suppress the intercept (was: SimpleRegression needs the ability to surpress the intercept) Typo SimpleRegression needs the ability to suppress the intercept Key: MATH-649 URL: https://issues.apache.org/jira/browse/MATH-649 Project: Commons Math Issue Type: New Feature Affects Versions: 1.2, 2.1, 2.2 Environment: JAVA Reporter: greg sterijevski Priority: Minor Labels: NOINTERCEPT, SIMPLEREGRESSION Fix For: 3.0 Attachments: simplereg, simpleregtest Original Estimate: 2h Remaining Estimate: 2h The SimpleRegression class is a useful class for running regressions involving one independent variable. It lacks the ability to constrain the constant to be zero. I am attaching a patch which gives a constructor for setting NOINT. I am also checking in two NIST data sets for noint estimation. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MATH-449) Storeless covariance
[ https://issues.apache.org/jira/browse/MATH-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088719#comment-13088719 ] Patrick Meyer commented on MATH-449: I like all of these ideas. When I wrote the patch, I didn't know if forcing a square matrix was preferred, so I wrote it more generally. A square matrix is fine with me. Incrementing the full vector of new values is definitely the safest way to do it. However, it forces the user into listwise deletion if a case has any missing data. The more granular version allows a user to implement pairwise deletion. Nether option is a great way to handle missing data, but do we want to force one approach on the user? Is there way to increment the full vector of values and account for missing data on one or more variables? Thanks, Patrick Storeless covariance Key: MATH-449 URL: https://issues.apache.org/jira/browse/MATH-449 Project: Commons Math Issue Type: Improvement Reporter: Patrick Meyer Assignee: Phil Steitz Fix For: 3.1 Attachments: MATH-449.patch Original Estimate: 168h Remaining Estimate: 168h Currently there is no storeless version for computing the covariance. However, Pebay (2008) describes algorithms for on-line covariance computations, [http://infoserve.sandia.gov/sand_doc/2008/086212.pdf]. I have provided a simple class for implementing this algorithm. It would be nice to have this integrated into org.apache.commons.math.stat.correlation.Covariance. {code} //This code is granted for inclusion in the Apache Commons under the terms of the ASL. public class StorelessCovariance{ private double deltaX = 0.0; private double deltaY = 0.0; private double meanX = 0.0; private double meanY = 0.0; private double N=0; private Double covarianceNumerator=0.0; private boolean unbiased=true; public Covariance(boolean unbiased){ this.unbiased = unbiased; } public void increment(Double x, Double y){ if(x!=null y!=null){ N++; deltaX = x - meanX; deltaY = y - meanY; meanX += deltaX/N; meanY += deltaY/N; covarianceNumerator += ((N-1.0)/N)*deltaX*deltaY; } } public Double getResult(){ if(unbiased){ return covarianceNumerator/(N-1.0); }else{ return covarianceNumerator/N; } } } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MATH-649) SimpleRegression needs the ability to suppress the intercept
[ https://issues.apache.org/jira/browse/MATH-649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088737#comment-13088737 ] greg sterijevski commented on MATH-649: --- Mea Culpa! SimpleRegression needs the ability to suppress the intercept Key: MATH-649 URL: https://issues.apache.org/jira/browse/MATH-649 Project: Commons Math Issue Type: New Feature Affects Versions: 1.2, 2.1, 2.2 Environment: JAVA Reporter: greg sterijevski Priority: Minor Labels: NOINTERCEPT, SIMPLEREGRESSION Fix For: 3.0 Attachments: simplereg, simpleregtest Original Estimate: 2h Remaining Estimate: 2h The SimpleRegression class is a useful class for running regressions involving one independent variable. It lacks the ability to constrain the constant to be zero. I am attaching a patch which gives a constructor for setting NOINT. I am also checking in two NIST data sets for noint estimation. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MATH-449) Storeless covariance
[ https://issues.apache.org/jira/browse/MATH-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088843#comment-13088843 ] Phil Steitz commented on MATH-449: -- We could allow NaNs in the input vectors and skip updating the bivariate covariances for pairs including a NaN. Storeless covariance Key: MATH-449 URL: https://issues.apache.org/jira/browse/MATH-449 Project: Commons Math Issue Type: Improvement Reporter: Patrick Meyer Assignee: Phil Steitz Fix For: 3.1 Attachments: MATH-449.patch Original Estimate: 168h Remaining Estimate: 168h Currently there is no storeless version for computing the covariance. However, Pebay (2008) describes algorithms for on-line covariance computations, [http://infoserve.sandia.gov/sand_doc/2008/086212.pdf]. I have provided a simple class for implementing this algorithm. It would be nice to have this integrated into org.apache.commons.math.stat.correlation.Covariance. {code} //This code is granted for inclusion in the Apache Commons under the terms of the ASL. public class StorelessCovariance{ private double deltaX = 0.0; private double deltaY = 0.0; private double meanX = 0.0; private double meanY = 0.0; private double N=0; private Double covarianceNumerator=0.0; private boolean unbiased=true; public Covariance(boolean unbiased){ this.unbiased = unbiased; } public void increment(Double x, Double y){ if(x!=null y!=null){ N++; deltaX = x - meanX; deltaY = y - meanY; meanX += deltaX/N; meanY += deltaY/N; covarianceNumerator += ((N-1.0)/N)*deltaX*deltaY; } } public Double getResult(){ if(unbiased){ return covarianceNumerator/(N-1.0); }else{ return covarianceNumerator/N; } } } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MATH-449) Storeless covariance
[ https://issues.apache.org/jira/browse/MATH-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088913#comment-13088913 ] Patrick Meyer commented on MATH-449: I like that idea. It's probably the best way to handle it. However, in looking back at the regular Covariance class, it only provides for listwise deletion. Should we reconsider treatment of missing data in Covariance and StorelessCovariance so that the implementations are similar? We should probably give the user an option for treatment of missing data. The cov() function in R has an option for casewise or pairwise deletion but it looks like only casewise is available for the Pearson correlation. Missing data for Spearman's correlation is handled through the ranking procedure. Storeless covariance Key: MATH-449 URL: https://issues.apache.org/jira/browse/MATH-449 Project: Commons Math Issue Type: Improvement Reporter: Patrick Meyer Assignee: Phil Steitz Fix For: 3.1 Attachments: MATH-449.patch Original Estimate: 168h Remaining Estimate: 168h Currently there is no storeless version for computing the covariance. However, Pebay (2008) describes algorithms for on-line covariance computations, [http://infoserve.sandia.gov/sand_doc/2008/086212.pdf]. I have provided a simple class for implementing this algorithm. It would be nice to have this integrated into org.apache.commons.math.stat.correlation.Covariance. {code} //This code is granted for inclusion in the Apache Commons under the terms of the ASL. public class StorelessCovariance{ private double deltaX = 0.0; private double deltaY = 0.0; private double meanX = 0.0; private double meanY = 0.0; private double N=0; private Double covarianceNumerator=0.0; private boolean unbiased=true; public Covariance(boolean unbiased){ this.unbiased = unbiased; } public void increment(Double x, Double y){ if(x!=null y!=null){ N++; deltaX = x - meanX; deltaY = y - meanY; meanX += deltaX/N; meanY += deltaY/N; covarianceNumerator += ((N-1.0)/N)*deltaX*deltaY; } } public Double getResult(){ if(unbiased){ return covarianceNumerator/(N-1.0); }else{ return covarianceNumerator/N; } } } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (MATH-646) Unmodifiable views of RealVector
[ https://issues.apache.org/jira/browse/MATH-646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sébastien Brisard updated MATH-646: --- Attachment: MATH-646.patch Here is a new patch taking into account your comments. I didn't know about putting several classes into the same {{*.java}} file. The problem is you cannot make {{UnmodifiableRealVector}} private. I therefore resorted to a nested class. Hope the file does not get to cluttered. Unmodifiable views of RealVector Key: MATH-646 URL: https://issues.apache.org/jira/browse/MATH-646 Project: Commons Math Issue Type: New Feature Affects Versions: 3.0 Reporter: Sébastien Brisard Labels: linear, vector Attachments: MATH-646.patch, MATH-646.patch The issue has been discussed on the [mailing list|http://mail-archives.apache.org/mod_mbox/commons-dev/201108.mbox/CAGRH7HqxUb2y1HmFt9VJ-kxsXwipk_MdO0D=rnuazmgpnot...@mail.gmail.com]. Please find attached a proposal for a new class {{UnmodifiableRealVector}}. I chose not to nest it in {{AbstractRealVector}} because it would make the corresponding file huge. Therefore, {{UnmodifiableRealVector}} is {{final}}. Maybe you'd like it to be {{private}} as well? A static method is provided in {{AbstractRealVector}} to build an {{UnmodifiableRealVector}} from any {{RealVector}}. Tests are also provided. Since iterating through different implementations of {{RealVector}} is actually different, a test is provided for {{UnmodifiableRealVector}} built on {{ArrayRealVector}} and {{OpenMapRealVector}}. These tests both derive from the same abstract test class. Hope everything works fine. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Created] (IO-281) WildcardFileFilter fails for wild card pattern with a '*' in it
WildcardFileFilter fails for wild card pattern with a '*' in it --- Key: IO-281 URL: https://issues.apache.org/jira/browse/IO-281 Project: Commons IO Issue Type: Bug Components: Filters Affects Versions: 1.3.2 Environment: Windows XP Reporter: Dean Schulze Priority: Blocker The code below reports no files found when there is a file matching the wild card pattern. If I enter this command in a DOS windows in the same directory it finds the file so the wild card pattern is correct as far as DOS is concerned: C:\dean\clipper\src\metadata.maildir 320620110821433-*.RWD Directory of C:\dean\clipper\src\metadata.mail 08/22/2011 12:36 PM 9,728 320620110821433-1.RWD 1 File(s) 9,728 bytes 0 Dir(s) 50,033,049,600 bytes free This code should work according to the docs but it reports no file found: void testFileNameFilter() throws IOException { String fileNamePrefix = 320620110821433; File f = new File(fileNamePrefix + .rwd); String filterString = fileNamePrefix + -*.RWD; FileFilter filter = new WildcardFileFilter(filterString, IOCase.SYSTEM); File dir = f.getCanonicalFile(); File[] existingFiles = dir.listFiles(filter); if (existingFiles != null) for (File f2 : existingFiles) System.out.println(f2.getName()); else System.out.println(No files found for + filterString); } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IO-281) WildcardFileFilter fails for wild card pattern with a '*' in it
[ https://issues.apache.org/jira/browse/IO-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088946#comment-13088946 ] Sebb commented on IO-281: - Are you sure that the dir variable points to the correct directory? Try printing it out, and/or removing the filter. WildcardFileFilter fails for wild card pattern with a '*' in it --- Key: IO-281 URL: https://issues.apache.org/jira/browse/IO-281 Project: Commons IO Issue Type: Bug Components: Filters Affects Versions: 1.3.2 Environment: Windows XP Reporter: Dean Schulze Priority: Blocker The code below reports no files found when there is a file matching the wild card pattern. If I enter this command in a DOS windows in the same directory it finds the file so the wild card pattern is correct as far as DOS is concerned: {code} C:\dean\clipper\src\metadata.maildir 320620110821433-*.RWD Directory of C:\dean\clipper\src\metadata.mail 08/22/2011 12:36 PM 9,728 320620110821433-1.RWD 1 File(s) 9,728 bytes 0 Dir(s) 50,033,049,600 bytes free {code} This code should work according to the docs but it reports no file found: {code} void testFileNameFilter() throws IOException { String fileNamePrefix = 320620110821433; File f = new File(fileNamePrefix + .rwd); String filterString = fileNamePrefix + -*.RWD; FileFilter filter = new WildcardFileFilter(filterString, IOCase.SYSTEM); File dir = f.getCanonicalFile(); File[] existingFiles = dir.listFiles(filter); if (existingFiles != null) for (File f2 : existingFiles) System.out.println(f2.getName()); else System.out.println(No files found for + filterString); } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MATH-449) Storeless covariance
[ https://issues.apache.org/jira/browse/MATH-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13088996#comment-13088996 ] Phil Steitz commented on MATH-449: -- Good point on the stored data version. This is really our first foray into meaningful management of missing data and now is a great time to start dealing with it. In the correlation package, at this point, we can fairly easily support either or both casewise or pairwise deletion so it is probably best to make it configurable. Also, we need to agree on and advertise the fact that NaNs should be used to signal missing data. Lets start by implementing things this way in the new storeless covariance classes and then open new tickets to add support for missing data in first the rest of the correlation package and then regression. One thing that is bugging me a little is convincing myself that if we allow pairwise deletion, the covariance matrix will be legitimate (i.e. have all of the analytical properties associated with a cov matrix). Also, are there negative implications that I have not thought about to using NaNs to signal missing data. Storeless covariance Key: MATH-449 URL: https://issues.apache.org/jira/browse/MATH-449 Project: Commons Math Issue Type: Improvement Reporter: Patrick Meyer Assignee: Phil Steitz Fix For: 3.1 Attachments: MATH-449.patch Original Estimate: 168h Remaining Estimate: 168h Currently there is no storeless version for computing the covariance. However, Pebay (2008) describes algorithms for on-line covariance computations, [http://infoserve.sandia.gov/sand_doc/2008/086212.pdf]. I have provided a simple class for implementing this algorithm. It would be nice to have this integrated into org.apache.commons.math.stat.correlation.Covariance. {code} //This code is granted for inclusion in the Apache Commons under the terms of the ASL. public class StorelessCovariance{ private double deltaX = 0.0; private double deltaY = 0.0; private double meanX = 0.0; private double meanY = 0.0; private double N=0; private Double covarianceNumerator=0.0; private boolean unbiased=true; public Covariance(boolean unbiased){ this.unbiased = unbiased; } public void increment(Double x, Double y){ if(x!=null y!=null){ N++; deltaX = x - meanX; deltaY = y - meanY; meanX += deltaX/N; meanY += deltaY/N; covarianceNumerator += ((N-1.0)/N)*deltaX*deltaY; } } public Double getResult(){ if(unbiased){ return covarianceNumerator/(N-1.0); }else{ return covarianceNumerator/N; } } } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (LANG-564) Improve StrLookup API documentation
[ https://issues.apache.org/jira/browse/LANG-564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13089035#comment-13089035 ] Etienne Neveu commented on LANG-564: I was also confused by the StrLookup type parameter while browsing the commons-lang 3.0.1 source. Instead of creating a duplicate issue, I thought it would be better to comment here, even though this issue seems to be closed... I don't see the point of having a generic type parameter on the StrLookup class, if it's not used anywhere. No method / field in StrLookup references this type parameter. IntelliJ IDEA itself reports a warning: Type parameter 'V' is never used. Moreover, Java generics are not reified, so there is no reliable way to access the type parameter at runtime (and I don't see the point of doing that anyway...). While the Javadoc tries to clarify the purpose of a StrLookup, the unused type parameter is still confusing, and the client code has to un-necessarily specify type parameters. For example, I have to write: {code} StrLookup? lookup = StrLookup.noneLookup(); StrLookupString lookup2 = StrLookup.systemPropertiesLookup(); StrLookupInteger lookup3 = StrLookup.mapLookup(integerMap); {code} instead of {code} StrLookup lookup = StrLookup.noneLookup(); StrLookup lookup2 = StrLookup.systemPropertiesLookup(); StrLookup lookup3 = StrLookup.mapLookup(integerMap); {code} My best guess is that this type parameter was added when commons-lang was generified, because StringLookup.mapLookup() takes a generified Map. Doing this is not really needed, though: we could remove the V type parameter everywhere, and replace the StrLookup.mapLookup()'s MapString, V with a MapString, ? (which is the same as MapString, ? extends Object, but shorter). I guess it's too late to change this now, due to backward compatibility... But I thought I'd comment just in case it's still possible. Improve StrLookup API documentation --- Key: LANG-564 URL: https://issues.apache.org/jira/browse/LANG-564 Project: Commons Lang Issue Type: Bug Components: lang.text.* Reporter: Sebb Fix For: 3.0 The API for StrLookup is confused. The class has been partly genericised, but why? The Javadoc says the class is for looking up Strings which are indexed by Strings, and this agrees with the method lookup() Surely if the class is generic on V, the lookup() method should return V, not String? Does it make any sense for the class to return anything but a String? If not, then why is the class generic? If it does make sense, then lookup() should return V. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (IO-281) WildcardFileFilter fails for wild card pattern with a '*' in it
[ https://issues.apache.org/jira/browse/IO-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13089091#comment-13089091 ] Dean Schulze commented on IO-281: - This looks like unexpected behavior from the Java File class. If I create a File object for a file that exists in the current directory the various File methods all return either null or a path that ends with the file name instead of the directory name. I've resorted to manually parsing off the file name from the end of the absolute path. http://stackoverflow.com/questions/7153729/java-cant-get-the-path-of-a-file-that-exists-in-the-current-directory/7154296#7154296 This can probably be closed out. WildcardFileFilter fails for wild card pattern with a '*' in it --- Key: IO-281 URL: https://issues.apache.org/jira/browse/IO-281 Project: Commons IO Issue Type: Bug Components: Filters Affects Versions: 1.3.2 Environment: Windows XP Reporter: Dean Schulze Priority: Blocker The code below reports no files found when there is a file matching the wild card pattern. If I enter this command in a DOS windows in the same directory it finds the file so the wild card pattern is correct as far as DOS is concerned: {code} C:\dean\clipper\src\metadata.maildir 320620110821433-*.RWD Directory of C:\dean\clipper\src\metadata.mail 08/22/2011 12:36 PM 9,728 320620110821433-1.RWD 1 File(s) 9,728 bytes 0 Dir(s) 50,033,049,600 bytes free {code} This code should work according to the docs but it reports no file found: {code} void testFileNameFilter() throws IOException { String fileNamePrefix = 320620110821433; File f = new File(fileNamePrefix + .rwd); String filterString = fileNamePrefix + -*.RWD; FileFilter filter = new WildcardFileFilter(filterString, IOCase.SYSTEM); File dir = f.getCanonicalFile(); File[] existingFiles = dir.listFiles(filter); if (existingFiles != null) for (File f2 : existingFiles) System.out.println(f2.getName()); else System.out.println(No files found for + filterString); } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (IO-281) WildcardFileFilter fails for wild card pattern with a '*' in it
[ https://issues.apache.org/jira/browse/IO-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb closed IO-281. --- WildcardFileFilter fails for wild card pattern with a '*' in it --- Key: IO-281 URL: https://issues.apache.org/jira/browse/IO-281 Project: Commons IO Issue Type: Bug Components: Filters Affects Versions: 1.3.2 Environment: Windows XP Reporter: Dean Schulze Priority: Blocker The code below reports no files found when there is a file matching the wild card pattern. If I enter this command in a DOS windows in the same directory it finds the file so the wild card pattern is correct as far as DOS is concerned: {code} C:\dean\clipper\src\metadata.maildir 320620110821433-*.RWD Directory of C:\dean\clipper\src\metadata.mail 08/22/2011 12:36 PM 9,728 320620110821433-1.RWD 1 File(s) 9,728 bytes 0 Dir(s) 50,033,049,600 bytes free {code} This code should work according to the docs but it reports no file found: {code} void testFileNameFilter() throws IOException { String fileNamePrefix = 320620110821433; File f = new File(fileNamePrefix + .rwd); String filterString = fileNamePrefix + -*.RWD; FileFilter filter = new WildcardFileFilter(filterString, IOCase.SYSTEM); File dir = f.getCanonicalFile(); File[] existingFiles = dir.listFiles(filter); if (existingFiles != null) for (File f2 : existingFiles) System.out.println(f2.getName()); else System.out.println(No files found for + filterString); } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (IO-281) WildcardFileFilter fails for wild card pattern with a '*' in it
[ https://issues.apache.org/jira/browse/IO-281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb resolved IO-281. - Resolution: Invalid WildcardFileFilter fails for wild card pattern with a '*' in it --- Key: IO-281 URL: https://issues.apache.org/jira/browse/IO-281 Project: Commons IO Issue Type: Bug Components: Filters Affects Versions: 1.3.2 Environment: Windows XP Reporter: Dean Schulze Priority: Blocker The code below reports no files found when there is a file matching the wild card pattern. If I enter this command in a DOS windows in the same directory it finds the file so the wild card pattern is correct as far as DOS is concerned: {code} C:\dean\clipper\src\metadata.maildir 320620110821433-*.RWD Directory of C:\dean\clipper\src\metadata.mail 08/22/2011 12:36 PM 9,728 320620110821433-1.RWD 1 File(s) 9,728 bytes 0 Dir(s) 50,033,049,600 bytes free {code} This code should work according to the docs but it reports no file found: {code} void testFileNameFilter() throws IOException { String fileNamePrefix = 320620110821433; File f = new File(fileNamePrefix + .rwd); String filterString = fileNamePrefix + -*.RWD; FileFilter filter = new WildcardFileFilter(filterString, IOCase.SYSTEM); File dir = f.getCanonicalFile(); File[] existingFiles = dir.listFiles(filter); if (existingFiles != null) for (File f2 : existingFiles) System.out.println(f2.getName()); else System.out.println(No files found for + filterString); } {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira