mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 15:45:25 +02:00
[209593] changed duplcate to use Cloneable and override Object.clone()
This commit is contained in:
parent
a1b0c1d252
commit
c8a217ab4f
3 changed files with 8 additions and 11 deletions
|
@ -24,6 +24,7 @@ import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
|||
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.internal.files.ui.FileResources;
|
||||
import org.eclipse.rse.services.files.HostFilePermissions;
|
||||
import org.eclipse.rse.services.files.IFilePermissionsService;
|
||||
import org.eclipse.rse.services.files.IHostFilePermissions;
|
||||
import org.eclipse.rse.services.files.PendingHostFilePermissions;
|
||||
|
@ -351,7 +352,7 @@ public class SystemFilePermissionsPropertyPage extends SystemBasePropertyPage {
|
|||
if ((capabilities & IFilePermissionsService.FS_CAN_SET_PERMISSIONS) != 0){
|
||||
try
|
||||
{
|
||||
IHostFilePermissions newPermissions = _permissions.duplicate();
|
||||
IHostFilePermissions newPermissions = (IHostFilePermissions)((HostFilePermissions)_permissions).clone();
|
||||
|
||||
if (_permissions.getPermission(IHostFilePermissions.PERM_USER_READ) != _userRead.getSelection()){
|
||||
changed = true;
|
||||
|
|
|
@ -106,7 +106,7 @@ public class HostFilePermissions implements
|
|||
}
|
||||
|
||||
public String toString(){
|
||||
return "" + _permissions;
|
||||
return "" + _permissions; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private boolean isSet(long mask) {
|
||||
|
@ -155,8 +155,9 @@ public class HostFilePermissions implements
|
|||
_user = user;
|
||||
}
|
||||
|
||||
public IHostFilePermissions duplicate(){
|
||||
IHostFilePermissions clone = new HostFilePermissions(getPermissionBits(), getUserOwner(), getGroupOwner());
|
||||
return clone;
|
||||
public Object clone() throws CloneNotSupportedException {
|
||||
return super.clone();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
package org.eclipse.rse.services.files;
|
||||
|
||||
|
||||
public interface IHostFilePermissions {
|
||||
public interface IHostFilePermissions extends Cloneable {
|
||||
|
||||
/**
|
||||
* Permission constant indicating that
|
||||
|
@ -144,9 +144,4 @@ public interface IHostFilePermissions {
|
|||
*/
|
||||
public void setGroupOwner(String group);
|
||||
|
||||
/**
|
||||
* Create a duplicate of a set of permissions
|
||||
* @return the duplicate
|
||||
*/
|
||||
public IHostFilePermissions duplicate();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue