Source:
<code>private void refreshUiFromState(View editShareView) { if (editShareView != null) { setPermissionsListening(editShareView, false); int sharePermissions = mShare.getPermissions(); boolean isFederated = mShare.getShareType().equals(ShareType.FEDERATED); CompoundButton compound; compound = (CompoundButton) editShareView.findViewById(R.id.canShareSwitch); <START> if(isFederated) <END> compound.setVisibility(View.INVISIBLE); compound.setChecked((sharePermissions & OCShare.SHARE_PERMISSION_FLAG) > 0); compound = (CompoundButton) editShareView.findViewById(R.id.canEditSwitch); int anyUpdatePermission = OCShare.CREATE_PERMISSION_FLAG | OCShare.UPDATE_PERMISSION_FLAG | OCShare.DELETE_PERMISSION_FLAG; boolean canEdit = (sharePermissions & anyUpdatePermission) > 0; compound.setChecked(canEdit); if (mFile.isFolder() && !isFederated) { compound = (CompoundButton) editShareView.findViewById(R.id.canEditCreateCheckBox); compound.setChecked((sharePermissions & OCShare.CREATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditChangeCheckBox); compound.setChecked((sharePermissions & OCShare.UPDATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditDeleteCheckBox); compound.setChecked((sharePermissions & OCShare.DELETE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); } setPermissionsListening(editShareView, true); } }</code><technical_language>Please, curly brackets for single-line ifs too</technical_language>

Target:
private void refreshUiFromState(View editShareView) { if (editShareView != null) { setPermissionsListening(editShareView, false); int sharePermissions = mShare.getPermissions(); boolean isFederated = ShareType.FEDERATED.equals(mShare.getShareType()); CompoundButton compound; compound = (CompoundButton) editShareView.findViewById(R.id.canShareSwitch); if(isFederated) { compound.setVisibility(View.INVISIBLE); } compound.setChecked((sharePermissions & OCShare.SHARE_PERMISSION_FLAG) > 0); compound = (CompoundButton) editShareView.findViewById(R.id.canEditSwitch); int anyUpdatePermission = OCShare.CREATE_PERMISSION_FLAG | OCShare.UPDATE_PERMISSION_FLAG | OCShare.DELETE_PERMISSION_FLAG; boolean canEdit = (sharePermissions & anyUpdatePermission) > 0; compound.setChecked(canEdit); if (mFile.isFolder() && !isFederated) { compound = (CompoundButton) editShareView.findViewById(R.id.canEditCreateCheckBox); compound.setChecked((sharePermissions & OCShare.CREATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditChangeCheckBox); compound.setChecked((sharePermissions & OCShare.UPDATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditDeleteCheckBox); compound.setChecked((sharePermissions & OCShare.DELETE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); } setPermissionsListening(editShareView, true); } }