I was going through API code i found this in JAVA Api
java.io.FilePermission.getMask(String actions) {
int mask = NONE;
// Null action valid?
if (actions == null) {
return mask;
}
// Check against use of constants (used heavily within the JDK)
if (actions == SecurityConstants.FILE_READ_ACTION) {
return READ;
} else if (actions == SecurityConstants.FILE_WRITE_ACTION) {
return WRITE;
} else if (actions == SecurityConstants.FILE_EXECUTE_ACTION) {
return EXECUTE;
} else if (actions == SecurityConstants.FILE_DELETE_ACTION) {
return DELETE;
} else if (actions == SecurityConstants.FILE_READLINK_ACTION) {
return READLINK;
}
....
....
.....
}
can any one tell me why they have used '==' operator instead of .equlas() method. :?