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);
}