01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

esolving conflicts<br />

Make these changes to your own copy <strong>of</strong><br />

BeatBox.java, and commit them to<br />

your code repository:<br />

You can skip this<br />

step if you didn’t<br />

really get a conflict<br />

from Subversion.<br />

Now, commit the file<br />

to your server, adding<br />

a comment indicating<br />

what you did.<br />

196 Chapter 6<br />

Conflict Resolution: Here’s the file version control kicked back to Bob with both changes in it.<br />

What should the final section look like that Bob commits back in?<br />

public class RemoteReader implements Runnable {<br />

// variable declarations<br />

public void run() {<br />

try {<br />

while ((obj = in.readObject()) != null) {<br />

System.out.println("got an object from server");<br />

System.out.println(obj.getClass());<br />

String nameToShow = (String) obj;<br />

checkboxState = (boolean[]) in.readObject();<br />

if (nameToShow.equals(PICTURE_START_SEQUENCE)) {<br />

receiveJPEG();<br />

}<br />

else {<br />

if (nameToShow.equals(POKE_START_SEQUENCE)) {<br />

playPoke();<br />

nameToShow = "Hey! Pay attention.";<br />

}<br />

otherSeqsMap.put(nameToShow, checkboxState);<br />

listVector.add(nameToShow);<br />

incomingList.setListData(listVector);<br />

// now reset the sequence to be this<br />

}<br />

} // close while<br />

} catch (Exception ex) {<br />

ex.printStackTrace();<br />

}<br />

} // close run<br />

} // close inner class<br />

File Edit Window Help Tranquility<br />

hfsd> svn resolved src/headfirst/sd/chapter6/BeatBox.java<br />

Resolved conflicted state <strong>of</strong> ‘BeatBox.java’<br />

hfsd> svn commit -m “Merged picture support with Poke stuff.”<br />

Sending src\headfirst\sd\chapter6\BeatBox.java<br />

Transmitting file data .<br />

Committed revision 3.<br />

hfsd><br />

First, tell Subversion you resolved the conflict in the file<br />

using the “resolved” command and the path to the file.<br />

Download at WoweBook.Com<br />

We need to<br />

support both<br />

the picture<br />

sequence and<br />

the poke<br />

sequence so we<br />

need to merge<br />

the conditionals.<br />

Make sure you<br />

delete the conflict<br />

characters ().

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!