Author: sebb
Date: Tue Jun 4 21:01:38 2013
New Revision: 1489607
URL: http://svn.apache.org/r1489607
Log:
FindBugs points out that pattern can never be null if the compile succeeds
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
URL:
http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java?rev=1489607&r1=1489606&r2=1489607&view=diff
==============================================================================
---
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
(original)
+++
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
Tue Jun 4 21:01:38 2013
@@ -139,17 +139,18 @@ public abstract class RegexFTPFileEntryP
* Alter the current regular expression being utilised for entry parsing
* and create a new {@link Pattern} instance.
* @param regex The new regular expression
- * @return true if the compiled pattern is not null
+ * @return true
* @since 2.0
+ * @throws PatternSyntaxException if the regex cannot be compiled
*/
public boolean setRegex(String regex) {
try {
pattern = Pattern.compile(regex);
+ return true;
} catch (PatternSyntaxException pse) {
throw new IllegalArgumentException("Unparseable regex supplied: "
+ regex);
}
- return (pattern != null);
}
}