几乎修改了全部阻断问题

This commit is contained in:
zhoudaxia 2016-08-26 20:59:34 +08:00
parent 92e6225590
commit ea887f280b
8 changed files with 14 additions and 11 deletions

View File

@ -609,6 +609,7 @@ public class AutoExtract implements ActionListener {
} catch (IOException e) {
e.printStackTrace();
} finally {
if(out!=null)
out.close();
if (file != null) {
if (!file.delete()) {

View File

@ -61,7 +61,7 @@ public abstract class BaseRoot implements Serializable, IRepositoryRoot {
public void extractJAR() {
throw new UnsupportedOperationException();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof IRepositoryRoot) {
return ((IRepositoryRoot) obj).getURL().equals(rootURL);

View File

@ -109,7 +109,7 @@ public class BattlesRunner {
lastResults = null;
engine.runBattle(specification, true);
if (lastResults != null && lastResults.length > 1) {
if (lastResults.length > 1) {
dumpResults(outtxt, lastResults, param[param.length - 1], melee);
}
}
@ -157,11 +157,10 @@ public class BattlesRunner {
try {
FileReader fr = new FileReader(inputfile);
br = new BufferedReader(fr);
fr.close();
String record;
while ((record = br.readLine()) != null) {
robots.add(record);
fr.close();
}
} catch (IOException e) {
System.out.println("Battles input file not found ... Aborting");

View File

@ -425,6 +425,7 @@ public class PrepareBattles {
}
}
}
fr.close();
} catch (IOException e) {
System.out.println("Participants file not found ... Aborting");
System.out.println(e);

View File

@ -392,7 +392,7 @@ public class BotsDownload {
InputStream properties = jarf.getInputStream(zipe);
Properties parameters = getProperties(properties);
jarf.close();
if (!isteams.equals("YES")) {
String classname = parameters.getProperty("robot.classname", "");
String version = parameters.getProperty("robot.version", "");
@ -402,7 +402,7 @@ public class BotsDownload {
String version = parameters.getProperty("team.version", "");
return (botname.equals(botname.substring(0, botname.indexOf(" ")) + " " + version));
jarf.close();
} catch (Exception e) {
System.out.println(e);
return false;

View File

@ -50,7 +50,7 @@ public class AlphanumericComparatorTest {
String str1 = unsortedStrings[i];
String str2 = correctlySortedStrings[i];
if (!(str1 == null && str2 == null) && !str1.equals(str2)) {
if (str1!=null&&!(str1 == null && str2 == null) && !str1.equals(str2)) {
sortedCorrectly = false;
break;
}

View File

@ -484,6 +484,7 @@ public class JavaDocument extends StyledDocument {
spaceBuffer = new String(chars);
}
// Return a string containing the given number of spaces
if(spaceBuffer!=null)
return spaceBuffer.substring(0, count);
}

View File

@ -227,10 +227,11 @@ public class PreferencesSoundOptionsTab extends WizardPanel {
for (Mixer.Info mi : mixerInfo) {
if (AudioSystem.getMixer(mi).getSourceLineInfo(clipLineInfo).length > 0) {
mixers.add(mi);
}
AudioSystem.getMixer(mi).close();
}
}
mixerComboBox = new JComboBox(mixers);
mixerComboBox.setRenderer(new MixerInfoCellRenderer());
mixerComboBox.addActionListener(eventHandler);
@ -297,9 +298,8 @@ public class PreferencesSoundOptionsTab extends WizardPanel {
if (mixerInfo != null) {
Mixer mixer = AudioSystem.getMixer((Mixer.Info) getMixerComboBox().getSelectedItem());
if (mixer != null) {
mixerClassName = mixer.getClass().getSimpleName();
}
}
if (mixerClassName != null) {
props.setOptionsSoundMixer(mixerClassName);
@ -317,9 +317,10 @@ public class PreferencesSoundOptionsTab extends WizardPanel {
for (Mixer.Info mi : AudioSystem.getMixerInfo()) {
if (AudioSystem.getMixer(mi).getClass().getSimpleName().equals(mixerName)) {
getMixerComboBox().setSelectedItem(mi);
AudioSystem.getMixer(mi).close();
break;
}
AudioSystem.getMixer(mi).close();
}
}