Projects >> SWADroid >>0bc4423206a5c398922ec599f3e20abb89bceb09

Chunk
Conflicting content
	 */
	private static long selectedCourseCode = -1;
	/**
<<<<<<< HEAD
	 * Short name of the chosen course.
	 * */
	private static String selectedCourseShortName;
	/**
	 * Short name of the full course.
	 * */
	private static String selectedCourseFullName;
		

=======
	 * Code of the chosen course for rollcall. All next actions are referred to this course.
	 */
	private static long selectedRollcallCourseCode = -1;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	/**
	 * Indicates if there are changes on db
	 * */
Solution content
	 */
	private static long selectedCourseCode = -1;
	/**
	 * Short name of the chosen course.
	 * */
	private static String selectedCourseShortName;
	/**
	 * Short name of the full course.
	 * */
	private static String selectedCourseFullName;
		

	/**
	 * Code of the chosen course for rollcall. All next actions are referred to this course.
	 */
	private static long selectedRollcallCourseCode = -1;
	/**
	 * Indicates if there are changes on db
	 * */
File
Global.java
Developer's decision
Concatenation
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
	/**
	 * Request code for Rollcall Config Download module.
	 */
<<<<<<< HEAD
	public static final int SCAN_QR_REQUEST_CODE = 12;
    /**
     * Request code for Directory Tree Download module
     * */
    public static final int DIRECTORY_TREE_REQUEST_CODE = 13;
    /**
     * Request code for Directory Tree Download module
     * */
    public static final int GROUPS_REQUEST_CODE = 14;
    /**
     * Request code for Downloads Manager
     * */
    public static final int DOWNLOADSMANAGER_REQUEST_CODE = 15;
    /**
     * Request code for Notify Download
     * */
    public static final int NOTIFYDOWNLOAD_REQUEST_CODE = 16;
    /**
     * Request code for MyGroups Manager
     * */
    public static final int MYGROUPSMANAGER_REQUEST_CODE= 17;
=======
	public static final int ROLLCALL_CONFIG_DOWNLOAD_REQUEST_CODE = 15;
	/**
	 * Request code for Rollcall History module.
	 */
	public static final int ROLLCALL_HISTORY_REQUEST_CODE = 16;
	/**
	 * Request code for Students List module.
	 */
	public static final int STUDENTS_LIST_REQUEST_CODE = 17;
	/**
	 * Request code for Students History module.
	 */
	public static final int STUDENTS_HISTORY_REQUEST_CODE = 18;
	/**
	 * Request code for Sessions List module.
	 */
	public static final int SESSIONS_LIST_REQUEST_CODE = 19;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	/**
	 * Prefix tag name for Logcat
	 */
Solution content
	/**
	 * Request code for Rollcall Config Download module.
	 */
	public static final int ROLLCALL_CONFIG_DOWNLOAD_REQUEST_CODE = 15;
	/**
	 * Request code for Rollcall History module.
	 */
	public static final int ROLLCALL_HISTORY_REQUEST_CODE = 16;
	/**
	 * Request code for Students List module.
	 */
	public static final int STUDENTS_LIST_REQUEST_CODE = 17;
	/**
	 * Request code for Students History module.
	 */
	public static final int STUDENTS_HISTORY_REQUEST_CODE = 18;
	/**
	 * Request code for Sessions List module.
	 */
	public static final int SESSIONS_LIST_REQUEST_CODE = 19;
    /**
     * Request code for Downloads Manager
     * */
    public static final int DOWNLOADSMANAGER_REQUEST_CODE = 20;
    /**
     * Request code for Notify Download
     * */
    public static final int NOTIFYDOWNLOAD_REQUEST_CODE = 21;
    /**
     * Request code for MyGroups Manager
     * */
    public static final int MYGROUPSMANAGER_REQUEST_CODE= 22;
	/**
	 * Prefix tag name for Logcat
	 */
File
Global.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
	public static void setPreferencesChanged(boolean newState){
		preferencesChanged = newState;
	}
<<<<<<< HEAD
	
	public static void setSelectedCourseShortName(String currentCourseShortName){
		selectedCourseShortName = currentCourseShortName;
		
	}
	public static void setSelectedCourseFullName(String currentCourseFullName){
		selectedCourseFullName = currentCourseFullName;
		
	}
	public static String getSelectedCourseShortName(){
		return selectedCourseShortName;
		
	}
	public static String getSelectedCourseFullName(){
		return selectedCourseFullName;
		
=======

	/**
	 * Gets code of actual rollcall course
	 * return -1 if no rollcall course chosen; code of actual rollcall course in other case
	 * */
	public static long getSelectedRollcallCourseCode() {
		return selectedRollcallCourseCode;
	}

	/**
	 * Sets code of actual rollcall course
	 * @param actualCourseCode. Code of the chosen rollcall course. It should be actualCourseCode>0. Otherwise nothing will change
	 * */
	public static void setSelectedRollcallCourseCode(long actualCourseCode) {
		selectedRollcallCourseCode = actualCourseCode;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	}
}
Solution content
	public static void setPreferencesChanged(boolean newState){
		preferencesChanged = newState;
	}
	
	public static void setSelectedCourseShortName(String currentCourseShortName){
		selectedCourseShortName = currentCourseShortName;
		
	}
	public static void setSelectedCourseFullName(String currentCourseFullName){
		selectedCourseFullName = currentCourseFullName;
		
	}
	public static String getSelectedCourseShortName(){
		return selectedCourseShortName;
		
	}
	public static String getSelectedCourseFullName(){
		return selectedCourseFullName;
		
	}
		/**
	 * Gets code of actual rollcall course
	 * return -1 if no rollcall course chosen; code of actual rollcall course in other case
	 * */
	public static long getSelectedRollcallCourseCode() {
		return selectedRollcallCourseCode;
	}

	/**
	 * Sets code of actual rollcall course
	 * @param actualCourseCode. Code of the chosen rollcall course. It should be actualCourseCode>0. Otherwise nothing will change
	 * */
	public static void setSelectedRollcallCourseCode(long actualCourseCode) {
		selectedRollcallCourseCode = actualCourseCode;
	}
	
}
File
Global.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
Method declaration
Method signature
Return statement
Variable
Chunk
Conflicting content
import es.ugr.swad.swadroid.modules.Messages;
import es.ugr.swad.swadroid.modules.Module;
import es.ugr.swad.swadroid.modules.Notices;
<<<<<<< HEAD
import es.ugr.swad.swadroid.modules.attendance.Attendance;
import es.ugr.swad.swadroid.modules.downloads.DownloadsManager;
=======
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
import es.ugr.swad.swadroid.modules.downloads.DirectoryTreeDownload;
import es.ugr.swad.swadroid.modules.groups.MyGroupsManager;
import es.ugr.swad.swadroid.modules.notifications.Notifications;
Solution content
import es.ugr.swad.swadroid.modules.Messages;
import es.ugr.swad.swadroid.modules.Module;
import es.ugr.swad.swadroid.modules.Notices;
import es.ugr.swad.swadroid.modules.downloads.DownloadsManager;
import es.ugr.swad.swadroid.modules.downloads.DirectoryTreeDownload;
import es.ugr.swad.swadroid.modules.notifications.Notifications;
File
SWADMain.java
Developer's decision
Combination
Kind of conflict
Import
Chunk
Conflicting content
	/**
	 * Group position inside the main menu for User group
	 * */
<<<<<<< HEAD
	private int USERS_GROUP = 4;
=======
	private int USERS_GROUP = 2;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	/**
	 * Child position inside the messages menu for Notification
	 * */
Solution content
	/**
	 * Group position inside the main menu for User group
	 * */
	private int USERS_GROUP = 4;
	/**
	 * Child position inside the messages menu for Notification
	 * */
File
SWADMain.java
Developer's decision
Version 1
Kind of conflict
Attribute
Chunk
Conflicting content
				
			}else{
				Global.setSelectedCourseCode(-1);
<<<<<<< HEAD
				Global.setSelectedCourseShortName("");
				Global.setSelectedCourseFullName("");
				if(!firstRun && Module.connectionAvailable(this)) getCurrentCourses(); //at the first run, this will be launched after the preferences menu 
=======
				if(!firstRun && Module.connectionAvailable(this))
					getActualCourses(); //at the first run, this will be launched after the preferences menu 
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
			}
			currentRole = -1;
		} catch (Exception ex) {
Solution content
				
			}else{
				Global.setSelectedCourseCode(-1);
				Global.setSelectedCourseShortName("");
				Global.setSelectedCourseFullName("");
				if(!firstRun && Module.connectionAvailable(this)) getCurrentCourses(); //at the first run, this will be launched after the preferences menu 
			}
			currentRole = -1;
		} catch (Exception ex) {
File
SWADMain.java
Developer's decision
Version 1
Kind of conflict
Comment
If statement
Method invocation
Chunk
Conflicting content
				createMenu();
				break;
			case Global.GROUPS_REQUEST_CODE:
<<<<<<< HEAD
=======
				// Check if course has practice groups
				Cursor c = dbHelper.getPracticeGroups(Global.getSelectedCourseCode());
				startManagingCursor(c);

				if (c.getCount() > 0) {
					Intent activity  = new Intent(getBaseContext(), Rollcall.class);
					startActivityForResult(activity, Global.ROLLCALL_REQUEST_CODE);
				} else {
					error(getString(R.string.noGroupsAvailableMsg));
				}
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
				break;
			}
		}
Solution content
				createMenu();
				break;
			case Global.GROUPS_REQUEST_CODE:
				// Check if course has practice groups
				Cursor c = dbHelper.getPracticeGroups(Global.getSelectedCourseCode());
				startManagingCursor(c);

				if (c.getCount() > 0) {
					Intent activity  = new Intent(getBaseContext(), Rollcall.class);
					startActivityForResult(activity, Global.ROLLCALL_REQUEST_CODE);
				} else {
					error(getString(R.string.noGroupsAvailableMsg));
				}
				break;
			}
		}
File
SWADMain.java
Developer's decision
Version 2
Kind of conflict
Comment
If statement
Method invocation
Variable
Chunk
Conflicting content
			//Removes Publish Note from messages menu
			((ImageExpandableListAdapter) getExpandableListAdapter()).removeChild(MESSAGES_GROUP, PUBLISH_NOTE_CHILD);
			//Removes completely users menu 
<<<<<<< HEAD
			//DISABLE until it will be functional
			((ImageExpandableListAdapter) getExpandableListAdapter()).removeGroup(USERS_GROUP);

=======
			((ImageExpandableListAdapter) getExpandableListAdapter()).removeGroup(USERS_GROUP);
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		}
		currentRole = Global.STUDENT_ROLE;
	}
Solution content
			//Removes Publish Note from messages menu
			((ImageExpandableListAdapter) getExpandableListAdapter()).removeChild(MESSAGES_GROUP, PUBLISH_NOTE_CHILD);
			//Removes completely users menu 
			((ImageExpandableListAdapter) getExpandableListAdapter()).removeGroup(USERS_GROUP);
		}
		currentRole = Global.STUDENT_TYPE_CODE;
	}
File
SWADMain.java
Developer's decision
Version 2
Kind of conflict
Comment
Method invocation
Chunk
Conflicting content
			map.put(IMAGE, getResources().getDrawable(R.drawable.note));
			((ImageExpandableListAdapter) getExpandableListAdapter()).addChild(MESSAGES_GROUP,PUBLISH_NOTE_CHILD, map);

<<<<<<< HEAD
			//DISABLE until it will be functional
=======
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
			final HashMap users = new HashMap();
			users.put(NAME, getString(R.string.users));
			users.put(IMAGE, getResources().getDrawable(R.drawable.users));
Solution content
			map.put(IMAGE, getResources().getDrawable(R.drawable.note));
			((ImageExpandableListAdapter) getExpandableListAdapter()).addChild(MESSAGES_GROUP,PUBLISH_NOTE_CHILD, map);

			final HashMap users = new HashMap();
			users.put(NAME, getString(R.string.users));
			users.put(IMAGE, getResources().getDrawable(R.drawable.users));
File
SWADMain.java
Developer's decision
Version 2
Kind of conflict
Comment
Chunk
Conflicting content
			map.put(NAME, getString(R.string.rollcallModuleLabel));
			map.put(IMAGE, getResources().getDrawable(R.drawable.rollcall));
			child.add(map);
<<<<<<< HEAD
			((ImageExpandableListAdapter) getExpandableListAdapter()).addGroup(USERS_GROUP, users, child);

=======
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1

			((ImageExpandableListAdapter) getExpandableListAdapter()).addGroup(USERS_GROUP, users, child);
		}
Solution content
			map.put(NAME, getString(R.string.rollcallModuleLabel));
			map.put(IMAGE, getResources().getDrawable(R.drawable.rollcall));
			child.add(map);
			((ImageExpandableListAdapter) getExpandableListAdapter()).addGroup(USERS_GROUP, users, child);


		}
File
SWADMain.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Chunk
Conflicting content
	private static PropertyInfo PI_id = new PropertyInfo();
	private static PropertyInfo PI_name = new PropertyInfo();
	private static PropertyInfo PI_userRole = new PropertyInfo();
<<<<<<< HEAD
	private static PropertyInfo PI_shortName = new PropertyInfo();
	private static PropertyInfo PI_fullName = new PropertyInfo();
    @SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY =
    {
    	PI_id,
    	PI_name,
    	PI_userRole,
    	PI_shortName,
    	PI_fullName
    };
	
=======
	@SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY =
{
		PI_id,
		PI_name,
		PI_userRole
};

>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	/**
	 * Constructor
	 * @param id Course identifier
Solution content
	private static PropertyInfo PI_id = new PropertyInfo();
	private static PropertyInfo PI_name = new PropertyInfo();
	private static PropertyInfo PI_userRole = new PropertyInfo();
	private static PropertyInfo PI_shortName = new PropertyInfo();
	private static PropertyInfo PI_fullName = new PropertyInfo();
    @SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY =
    {
    	PI_id,
    	PI_name,
    	PI_userRole,
    	PI_shortName,
    	PI_fullName
    };
	
	/**
	 * Constructor
	 * @param id Course identifier
File
Course.java
Developer's decision
Version 1
Kind of conflict
Annotation
Array initializer
Attribute
Method invocation
Chunk
Conflicting content
	
=======
	}
	
	
	public int getUserRole(){
		return userRole;
	}
<<<<<<< HEAD
	/**
	 * Gets short course name
	 * @return Short course name
	 */
	public String getShortName() {
		return shortName;
	}
	
	/**
	 * Sets short course name
	 * @param shortName short course name
	 */
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	/**
	 * Gets short course name
	 * @return Full course name
	 */
	public String getFullName() {
		return fullName;
	}
	
	/**
	 * Sets short course name
	 * @param shortName short course name
	 */
	public void setFullName(String fullName) {
		this.fullName = fullName;

>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
Solution content
	public int getUserRole(){
		return userRole;
	}
	/**
	 * Gets short course name
	 * @return Short course name
	 */
	public String getShortName() {
		return shortName;
	}
	
	/**
	 * Sets short course name
	 * @param shortName short course name
	 */
	public void setShortName(String shortName) {
		this.shortName = shortName;
	}
	/**
	 * Gets short course name
	 * @return Full course name
	 */
	public String getFullName() {
		return fullName;
	}
	
	/**
	 * Sets short course name
	 * @param shortName short course name
	 */
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}
	
	
	

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
File
Course.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
	 */
	public Object getProperty(int param) {
		Object object = null;
<<<<<<< HEAD
        switch(param)
        {
            case 0 : object = this.getId();break;
            case 1 : object = name;break;
            case 2 : object = userRole;break;
            case 3 : object = shortName;break;
            case 4 : object = fullName;break;
        }
        
        return object;
=======
		switch(param)
		{
		case 0 : object = this.getId();break;
		case 1 : object = name;break;
		case 2 : object = userRole;break;
		}

		return object;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	}

	/* (non-Javadoc)
Solution content
	 */
	public Object getProperty(int param) {
		Object object = null;
        switch(param)
        {
            case 0 : object = this.getId();break;
            case 1 : object = name;break;
            case 2 : object = userRole;break;
            case 3 : object = shortName;break;
            case 4 : object = fullName;break;
        }
        
        return object;
	}

	/* (non-Javadoc)
File
Course.java
Developer's decision
Version 1
Kind of conflict
Return statement
Switch statement
Variable
Chunk
Conflicting content
	 */
	public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
		switch(param){
<<<<<<< HEAD
	        case 0:
	            propertyInfo.type = PropertyInfo.LONG_CLASS;
	            propertyInfo.name = "id";
	            break;   
	        case 1:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "name";
	            break; 
	        case 2:
	        	propertyInfo.type = PropertyInfo.INTEGER_CLASS;
	        	propertyInfo.name = "userRole";
	        	break;
	        case 3:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "shortName";
	            break;
	        case 4:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "fullName";
	            break;    
	      
=======
		case 0:
			propertyInfo.type = PropertyInfo.LONG_CLASS;
			propertyInfo.name = "id";
			break;   
		case 1:
			propertyInfo.type = PropertyInfo.STRING_CLASS;
			propertyInfo.name = "name";
			break; 
		case 2:
			propertyInfo.type = PropertyInfo.INTEGER_CLASS;
			propertyInfo.name = "userRole";
			break;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		}
	}
Solution content
	 */
	public void getPropertyInfo(int param, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo propertyInfo) {
		switch(param){
	        case 0:
	            propertyInfo.type = PropertyInfo.LONG_CLASS;
	            propertyInfo.name = "id";
	            break;   
	        case 1:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "name";
	            break; 
	        case 2:
	        	propertyInfo.type = PropertyInfo.INTEGER_CLASS;
	        	propertyInfo.name = "userRole";
	        	break;
	        case 3:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "shortName";
	            break;
	        case 4:
	            propertyInfo.type = PropertyInfo.STRING_CLASS;
	            propertyInfo.name = "fullName";
	            break;    
	      
		}
	}
File
Course.java
Developer's decision
Version 1
Kind of conflict
Attribute
Break statement
Case statement
Variable
Chunk
Conflicting content
	public void setProperty(int param, Object obj) {
		switch(param)
		{
<<<<<<< HEAD
			case 0  : this.setId((Long)obj); break;
			case 1  : name = (String)obj; break;
			case 2  : userRole = (Integer)obj; break;
			case 3  : shortName = (String)obj; break;
			case 4  : fullName = (String)obj; break;
		
=======
		case 0  : this.setId((Long)obj); break;
		case 1  : name = (String)obj; break;
		case 2  : userRole = (Integer)obj; break;
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		}    
	}
Solution content
	public void setProperty(int param, Object obj) {
		switch(param)
		{
			case 0  : this.setId((Long)obj); break;
			case 1  : name = (String)obj; break;
			case 2  : userRole = (Integer)obj; break;
			case 3  : shortName = (String)obj; break;
			case 4  : fullName = (String)obj; break;
		
		}    
	}
File
Course.java
Developer's decision
Version 1
Kind of conflict
Attribute
Break statement
Case statement
Cast expression
Method invocation
Chunk
Conflicting content
					ent.getString("groupTypeName"));
					ent.getString("userFirstname"),
					ent.getString("photoPath"),
					ent.getInt("userRole"));			
<<<<<<< HEAD
		} else if (table.equals(Global.DB_TABLE_GROUPS)){
			o = new Group(ent.getLong("groupCode"),
					ent.getString("groupName"),
					ent.getInt("groupTypeCode"),
					ent.getString("groupTypeName"));
=======
		} else if(table.equals(Global.DB_TABLE_GROUPS)) {
			o = new Group(ent.getInt("groupCode"),
					ent.getString("groupName"),
					ent.getInt("groupTypeCode"),
		} else if(table.equals(Global.DB_TABLE_PRACTICE_SESSIONS)) {
			SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm");

			try {
				o = new PracticeSession(ent.getId(),
						ent.getInt("crsCod"),
						ent.getInt("grpCod"),
						format.parse(ent.getString("startDate")),
						format.parse(ent.getString("endDate")),
						ent.getString("site"),
						ent.getString("description"));
			} catch (ParseException e) {
				e.printStackTrace();
			}
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		}

		return o;
Solution content
					ent.getString("userFirstname"),
					ent.getString("photoPath"),
					ent.getInt("userRole"));			
		} else if (table.equals(Global.DB_TABLE_GROUPS)){
			o = new Group(ent.getLong("groupCode"),
					ent.getString("groupName"),
					ent.getInt("groupTypeCode"),
					ent.getString("groupTypeName"));
		} else if(table.equals(Global.DB_TABLE_GROUPS)) {
			o = new Group(ent.getInt("groupCode"),
					ent.getString("groupName"),
					ent.getInt("groupTypeCode"),
					ent.getString("groupTypeName"));
		} else if(table.equals(Global.DB_TABLE_PRACTICE_SESSIONS)) {
			SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm");

			try {
				o = new PracticeSession(ent.getId(),
						ent.getInt("crsCod"),
						ent.getInt("grpCod"),
						format.parse(ent.getString("startDate")),
						format.parse(ent.getString("endDate")),
						ent.getString("site"),
						ent.getString("description"));
			} catch (ParseException e) {
				e.printStackTrace();
			}
		}

		return o;
File
DataBaseHelper.java
Developer's decision
Concatenation
Kind of conflict
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
	 * @param description Optional description of practice session
	 * @return True if practice session does not exist in database and is inserted. False otherwise.
	 */
<<<<<<< HEAD
	public boolean insertGroup(Group g, long courseCode)
	{
		List rows = db.getEntityList(Global.DB_TABLE_GROUPS, "groupCode = " + g.getId());

		if(rows.isEmpty()) {
			Entity ent = new Entity(Global.DB_TABLE_GROUPS);
	
			ent.setValue("groupCode", g.getId());
			ent.setValue("groupName", g.getGroupName());
			ent.setValue("groupTypeCode", g.getGroupTypeCode());
			ent.setValue("groupTypeName", g.getGroupTypeName());
			ent.save();
			
			rows = db.getEntityList(Global.DB_TABLE_GROUPS_COURSES,"grpCod =" + g.getId());
			if(rows.isEmpty()){
				ent = new Entity(Global.DB_TABLE_GROUPS_COURSES);
				ent.setValue("grpCod", g.getId());
				ent.setValue("crsCod", courseCode);
				ent.save();	
			}else{ 
				rows.get(0).setValue("crsCod", courseCode);
				rows.get(0).save();
			}
			
			return true;
		} else 	
			return false;	
=======
	public boolean insertPracticeSession(long courseCode, long groupCode, String startDate, String endDate, String site, String description) {
		String where = "crsCod = '" + courseCode + "' AND " +
				"grpCod = '" + groupCode + "' AND " +
				"startDate = '" + startDate + "' AND " +
				"endDate = '" + endDate + "'";
		List rows = db.getEntityList(Global.DB_TABLE_PRACTICE_SESSIONS, where);

		if (rows.isEmpty()) {
			Entity ent = new Entity(Global.DB_TABLE_PRACTICE_SESSIONS);

			ent.setValue("crsCod", courseCode);
			ent.setValue("grpCod", groupCode);
			ent.setValue("startDate", startDate);
			ent.setValue("endDate", endDate);
			if (site != null && site != "")
				ent.setValue("site", site);
			if (description != null && description != "")
				ent.setValue("description", description);
			ent.save();
			return true;
		} else {
			return false;
		}
	}

	/**
	 * Inserts the rollcall data of a student to a practice session in database
	 * @param l User code of student
	 * @param sessCode Practice session code
	 */
	public void insertRollcallData(long l, long sessCode) {
		List rows = db.getEntityList(Global.DB_TABLE_ROLLCALL, "sessCod = " + sessCode + " AND usrCod = " + l);

		if (rows.isEmpty()) {
			Entity ent = new Entity(Global.DB_TABLE_ROLLCALL);

			ent.setValue("sessCod", sessCode);
			ent.setValue("usrCod", l);
			ent.save();
		}
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	}

	/**
Solution content
	 * @param description Optional description of practice session
	 * @return True if practice session does not exist in database and is inserted. False otherwise.
	 */
	public boolean insertPracticeSession(long courseCode, long groupCode, String startDate, String endDate, String site, String description) {
		String where = "crsCod = '" + courseCode + "' AND " +
				"grpCod = '" + groupCode + "' AND " +
				"startDate = '" + startDate + "' AND " +
				"endDate = '" + endDate + "'";
		List rows = db.getEntityList(Global.DB_TABLE_PRACTICE_SESSIONS, where);

		if (rows.isEmpty()) {
			Entity ent = new Entity(Global.DB_TABLE_PRACTICE_SESSIONS);

			ent.setValue("crsCod", courseCode);
			ent.setValue("grpCod", groupCode);
			ent.setValue("startDate", startDate);
			ent.setValue("endDate", endDate);
			if (site != null && site != "")
				ent.setValue("site", site);
			if (description != null && description != "")
				ent.setValue("description", description);
			ent.save();
			return true;
		} else {
			return false;
		}
	}


	/**
File
DataBaseHelper.java
Developer's decision
Combination
Kind of conflict
Comment
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
=======
		emptyTable(Global.DB_TABLE_TEST_TAGS);
		emptyTable(Global.DB_TABLE_USERS_COURSES);
		emptyTable(Global.DB_TABLE_USERS);
<<<<<<< HEAD
		emptyTable(Global.DB_TABLE_GROUPS);
		emptyTable(Global.DB_TABLE_GROUPS_COURSES);
		
		emptyTable(Global.DB_TABLE_GROUPS_COURSES);
		emptyTable(Global.DB_TABLE_GROUPS);
		emptyTable(Global.DB_TABLE_PRACTICE_SESSIONS);
		emptyTable(Global.DB_TABLE_ROLLCALL);
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		compactDB();

		// Removes users photos from external storage (Android 2.2 or higher only)
Solution content
		emptyTable(Global.DB_TABLE_TEST_TAGS);
		emptyTable(Global.DB_TABLE_USERS_COURSES);
		emptyTable(Global.DB_TABLE_USERS);
		emptyTable(Global.DB_TABLE_GROUPS_COURSES);
		emptyTable(Global.DB_TABLE_GROUPS);
		emptyTable(Global.DB_TABLE_PRACTICE_SESSIONS);
		emptyTable(Global.DB_TABLE_ROLLCALL);
		compactDB();

		// Removes users photos from external storage (Android 2.2 or higher only)
File
DataBaseHelper.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
	 * Group type name.
	 */
	private String groupTypeName;
<<<<<<< HEAD
	
=======

>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
	private static PropertyInfo PI_id = new PropertyInfo();
	private static PropertyInfo PI_groupName = new PropertyInfo();
	private static PropertyInfo PI_groupTypeCode = new PropertyInfo();
Solution content
	 * Group type name.
	 */
	private String groupTypeName;
	
	private static PropertyInfo PI_id = new PropertyInfo();
	private static PropertyInfo PI_groupName = new PropertyInfo();
	private static PropertyInfo PI_groupTypeCode = new PropertyInfo();
File
Group.java
Developer's decision
Version 1
Kind of conflict
Blank
Chunk
Conflicting content
	private static PropertyInfo PI_groupName = new PropertyInfo();
	private static PropertyInfo PI_groupTypeCode = new PropertyInfo();
	private static PropertyInfo PI_groupTypeName = new PropertyInfo();
<<<<<<< HEAD
	
    @SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY =
    {
    	PI_id,
    	PI_groupName,
    	PI_groupTypeCode,
    	PI_groupTypeName,
    };
	
	
	public Group(long id,String groupName, int groupTypeCode, String groupTypeName) {
=======

	@SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY = {
		PI_id,
		PI_groupName,
		PI_groupTypeCode,
		PI_groupTypeName
	};

	/**
	 * Constructor.
	 * @param id Group code.
	 * @param groupName Group name.
	 * @param groupTypeCode Identifier of the group type that owns this group.
	 * @param groupTypeName Group type name.
	 */
	public Group(long id, String groupName, int groupTypeCode, String groupTypeName) {
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
		super(id);
		this.groupName		= groupName;
		this.groupTypeCode	= groupTypeCode;
Solution content
	private static PropertyInfo PI_groupName = new PropertyInfo();
	private static PropertyInfo PI_groupTypeCode = new PropertyInfo();
	private static PropertyInfo PI_groupTypeName = new PropertyInfo();

	@SuppressWarnings("unused")
	private static PropertyInfo[] PI_PROP_ARRAY = {
		PI_id,
		PI_groupName,
		PI_groupTypeCode,
		PI_groupTypeName
	};

	/**
	 * Constructor.
	 * @param id Group code.
	 * @param groupName Group name.
	 * @param groupTypeCode Identifier of the group type that owns this group.
	 * @param groupTypeName Group type name.
	 */
	public Group(long id, String groupName, int groupTypeCode, String groupTypeName) {
		super(id);
		this.groupName		= groupName;
		this.groupTypeCode	= groupTypeCode;
File
Group.java
Developer's decision
Version 2
Kind of conflict
Annotation
Array initializer
Attribute
Comment
Method signature
Chunk
Conflicting content
	public String getGroupCompleteName() {
		return groupTypeName + ":" + groupName;
	}
<<<<<<< HEAD
	
	public int getGroupTypeCode(){
		return groupTypeCode;
	}
	
=======
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1

	@Override
	public int hashCode() {
Solution content
		return groupTypeName + ":" + groupName;
	}
	
	public int getGroupTypeCode(){
		return groupTypeCode;
	}
	

	@Override
	public int hashCode() {
File
Group.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
<<<<<<< HEAD
package es.ugr.swad.swadroid.modules;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.xmlpull.v1.XmlPullParserException;

import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.model.Course;
import es.ugr.swad.swadroid.model.Group;
import es.ugr.swad.swadroid.model.Model;

/**
 * Groups module gets user's groups inside the current course
 * and stores them in the database
 * @author Helena Rodríguez Gijón 
 */
public class Groups extends Module {


	@Override
	protected void requestService() throws NoSuchAlgorithmException,
			IOException, XmlPullParserException, SoapFault,
			IllegalAccessException, InstantiationException {
		createRequest();
		addParam("wsKey", Global.getLoggedUser().getWsKey());
		addParam("courseCode", (int)Global.getSelectedCourseCode());
		sendRequest(Group.class,false);
		
		if(result != null){
			
			//Stores groups data returned by webservice response
			List groupsSWAD = new ArrayList();
			
			
			Vector res = (Vector ) result;
			SoapObject soap = (SoapObject) res.get(1);	
			int csSize = soap.getPropertyCount();
			
			
			for (int i = 0; i < csSize; i++) {
				SoapObject pii = (SoapObject)soap.getProperty(i);
				long id = Long.parseLong(pii.getProperty("groupCode").toString());
				String groupName = pii.getProperty("groupName").toString();
				int groupTypeCode = Integer.parseInt(pii.getProperty("groupTypeCode").toString());
				String groupTypeName = pii.getProperty("groupTypeName").toString();
				Group g = new Group(id,groupName,groupTypeCode,groupTypeName);
				
				groupsSWAD.add(g);
				
				if(isDebuggable){
					Log.i(TAG, g.toString());
        		}
			}

			//TODO remove obsolete groups
			for(int i = 0; i < groupsSWAD.size(); ++i){
				Group g = (Group) groupsSWAD.get(i);
				//boolean isAdded = dbHelper.insertGroup(g,Global.getSelectedCourseCode());
				//if(!isAdded){
				if(!dbHelper.insertGroup(g,Global.getSelectedCourseCode())){
					Log.i(TAG, "group to update");
					dbHelper.updateGroup(g.getId(), Global.getSelectedCourseCode(), g);
					Log.i(TAG, "group updated");
				}
			}
			//Request finalized without errors
			setResult(RESULT_OK);
		}
		
		
		
		
	}

	@Override
	protected void connect() {
		 Toast.makeText(this,"Getting Groups", Toast.LENGTH_LONG).show();
		Connect con = new Connect(false,null,0);
		con.execute();
	}

	@Override
	protected void postConnect() {
		Toast.makeText(this, "got groups", Toast.LENGTH_LONG).show();
		Log.i(TAG, "got groups");
		finish();
	}

	@Override
	protected void onError() {
		// TODO Auto-generated method stub

	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setMETHOD_NAME("getGroups");
	}

	@Override
	protected void onStart() {
		super.onStart();
		runConnection();
		if(!isConnected){
			setResult(RESULT_CANCELED);
			finish();
		}
		
	}

}
=======
package es.ugr.swad.swadroid.modules;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.Vector;

import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.R;
import es.ugr.swad.swadroid.model.Group;

/**
 * Groups module gets user's groups inside the current course
 * and stores them in the database
 * @author Helena Rodriguez Gijon 
 * @author Antonio Aguilera Malagon 
 */
public class Groups extends Module {
	/**
	 * Groups counter
	 */
	private int numGroups;
	/**
	 * Groups tag name for Logcat
	 */
	public static final String TAG = Global.APP_TAG + " Groups";

	@Override
	protected void runConnection() {
		super.runConnection();
		if (!isConnected) {
			setResult(RESULT_CANCELED);
			finish();
		}
	}

	/* (non-Javadoc)
	 * @see es.ugr.swad.swadroid.modules.Module#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {		
		super.onCreate(savedInstanceState);
		setMETHOD_NAME("getGroups");
	}

	@Override
	protected void onStart() {
		super.onStart();      
		try {
			runConnection();
		} catch (Exception ex) {
			String errorMsg = getString(R.string.errorServerResponseMsg);
			error(errorMsg);

			if(isDebuggable) {
				Log.e(ex.getClass().getSimpleName(), errorMsg);        		
				ex.printStackTrace();
			}
		}
	}

	/* (non-Javadoc)
	 * @see es.ugr.swad.swadroid.modules.Module#onActivityResult(int, int, android.content.Intent)
	 */
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == Activity.RESULT_CANCELED) {
			setResult(RESULT_CANCELED);
			finish();
		}
	}

	@Override
	protected void connect() {
		String progressDescription = getString(R.string.groupsProgressDescription);
		finish();
	protected void postConnect() {
		int progressTitle = R.string.groupsProgressTitle;

		new Connect(true, progressDescription, progressTitle).execute();
	}

	@Override
	protected void requestService() throws NoSuchAlgorithmException, IOException, XmlPullParserException, SoapFault, IllegalAccessException, InstantiationException {
		// Creates webservice request, adds required params and sends request to webservice
		createRequest();
		addParam("wsKey", Global.getLoggedUser().getWsKey());
		Log.i(TAG, "selectedCourseCode=" + Global.getSelectedCourseCode());
		addParam("courseCode", Integer.valueOf(String.valueOf(Global.getSelectedCourseCode())));
		sendRequest(Group.class, false);

		if (result != null) {
			// Stores users data returned by webservice response
			Vector res = (Vector) result;
			SoapObject soap = (SoapObject) res.get(1);
			numGroups = soap.getPropertyCount();
			for (int i = 0; i < numGroups; i++) {
				SoapObject pii = (SoapObject) soap.getProperty(i);
				long groupCode = new Long(pii.getProperty("groupCode").toString());
				String groupName = pii.getProperty("groupName").toString();
				int groupTypeCode = Integer.parseInt(pii.getProperty("groupTypeCode").toString());
				String groupTypeName = pii.getProperty("groupTypeName").toString();

				Group g = new Group(
						groupCode,
						groupName,
						groupTypeCode,
						groupTypeName);

				dbHelper.insertGroup(g, Global.getSelectedCourseCode());
				Log.d(TAG, g.toString());
			}	// end for (int i=0; i < usersCount; i++)

			if(isDebuggable) {
				Log.d(TAG, "Retrieved " + numGroups + " groups");
			}
		} // end if (result != null)

		// Request finalized without errors
		setResult(RESULT_OK);
	}

	@Override
	}

	@Override
	protected void onError() {
	}
}
>>>>>>> 24dc45a690175534d8f261a9ad5078b213ccded1
Solution content
package es.ugr.swad.swadroid.modules;

import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import es.ugr.swad.swadroid.Global;
import es.ugr.swad.swadroid.model.Course;
import es.ugr.swad.swadroid.model.Group;
import es.ugr.swad.swadroid.model.Model;
import es.ugr.swad.swadroid.R;

/**
 * Groups module gets user's groups inside the current course
 * and stores them in the database
 * @author Helena Rodriguez Gijon 
 * @author Antonio Aguilera Malagon 
 */
public class Groups extends Module {
	/**
	 * Groups counter
	 */
	private int numGroups;
	/**
	 * Groups tag name for Logcat
	 */
	public static final String TAG = Global.APP_TAG + " Groups";
	@Override
	protected void runConnection() {
		super.runConnection();
		if (!isConnected) {
			setResult(RESULT_CANCELED);
			finish();
			}
		}

        		}
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setMETHOD_NAME("getGroups");
	}

	@Override
	protected void onStart() {
		super.onStart();      
		try {
			runConnection();
		} catch (Exception ex) {
			String errorMsg = getString(R.string.errorServerResponseMsg);
			error(errorMsg);

			if(isDebuggable) {
				Log.e(ex.getClass().getSimpleName(), errorMsg);        		
				ex.printStackTrace();
			}
		}
	}
	
		/* (non-Javadoc)
	 * @see es.ugr.swad.swadroid.modules.Module#onActivityResult(int, int, android.content.Intent)
	 */
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode == Activity.RESULT_CANCELED) {
			setResult(RESULT_CANCELED);
			finish();
		}
	}
		@Override
	protected void connect() {
		String progressDescription = getString(R.string.groupsProgressDescription);
		int progressTitle = R.string.groupsProgressTitle;

		new Connect(true, progressDescription, progressTitle).execute();
	}
	
	
	@Override
	protected void requestService() throws NoSuchAlgorithmException,
			IOException, XmlPullParserException, SoapFault,
			IllegalAccessException, InstantiationException {
		createRequest();
		addParam("wsKey", Global.getLoggedUser().getWsKey());
		addParam("courseCode", (int)Global.getSelectedCourseCode());
		sendRequest(Group.class,false);
		
		if(result != null){
			
			//Stores groups data returned by webservice response
			List groupsSWAD = new ArrayList();
			
			
			Vector res = (Vector ) result;
			SoapObject soap = (SoapObject) res.get(1);	
			int csSize = soap.getPropertyCount();
			
			
			for (int i = 0; i < csSize; i++) {
				SoapObject pii = (SoapObject)soap.getProperty(i);
				long id = Long.parseLong(pii.getProperty("groupCode").toString());
				String groupName = pii.getProperty("groupName").toString();
				int groupTypeCode = Integer.parseInt(pii.getProperty("groupTypeCode").toString());
				String groupTypeName = pii.getProperty("groupTypeName").toString();
				Group g = new Group(id,groupName,groupTypeCode,groupTypeName);
				
				groupsSWAD.add(g);
				
				if(isDebuggable){
					Log.i(TAG, g.toString());

			//TODO remove obsolete groups
			for(int i = 0; i < groupsSWAD.size(); ++i){
				Group g = (Group) groupsSWAD.get(i);
				//boolean isAdded = dbHelper.insertGroup(g,Global.getSelectedCourseCode());
				//if(!isAdded){
				if(!dbHelper.insertGroup(g,Global.getSelectedCourseCode())){
					Log.i(TAG, "group to update");
					dbHelper.updateGroup(g.getId(), Global.getSelectedCourseCode(), g);
					Log.i(TAG, "group updated");
				}
			}
			//Request finalized without errors
			setResult(RESULT_OK);
		}

	}


	@Override
	protected void postConnect() {
		Toast.makeText(this, "got groups", Toast.LENGTH_LONG).show();
		Log.i(TAG, "got groups");
		finish();
	}

	@Override
	protected void onError() {
		// TODO Auto-generated method stub
	}



}
File
Groups.java
Developer's decision
Combination
Kind of conflict
Class declaration
Comment
Import
Package declaration