Prune trailing whitespace & foreachize loops.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@824 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2009-05-23 01:57:36 +00:00
parent 09d081e261
commit ecdf0f2f4a
43 changed files with 182 additions and 184 deletions
@@ -47,8 +47,8 @@ public class DumpBundle
System.exit(-1);
}
for (int i = 0; i < args.length; i++) {
File file = new File(args[i]);
for (String arg : args) {
File file = new File(arg);
try {
ResourceBundle bundle = new FileResourceBundle(file);
@@ -69,7 +69,7 @@ public class DumpBundle
dumpTable("components: ", comps);
} catch (Exception e) {
System.err.println("Error dumping bundle [path=" + args[i] +
System.err.println("Error dumping bundle [path=" + arg +
", error=" + e + "].");
e.printStackTrace();
}
@@ -95,8 +95,8 @@ public class ClassRuleSet extends RuleSetBase
public Object parse (String text) {
String[] orients = StringUtil.parseStringArray(text);
ArrayIntSet oset = new ArrayIntSet();
for (int ii = 0; ii < orients.length; ii++) {
oset.add(DirectionUtil.fromShortString(orients[ii]));
for (String orient : orients) {
oset.add(DirectionUtil.fromShortString(orient));
}
return oset;
}
@@ -101,8 +101,8 @@ public class SwissArmyTileSet extends TileSet
{
// compute our number of tiles
_numTiles = 0;
for (int i = 0; i < _tileCounts.length; i++) {
_numTiles += _tileCounts[i];
for (int count : _tileCounts) {
_numTiles += count;
}
}
@@ -49,17 +49,17 @@ public class DumpBundle
System.exit(-1);
}
for (int i = 0; i < args.length; i++) {
for (String arg : args) {
// oh the hackery
if (args[i].equals("-tiles")) {
if (arg.equals("-tiles")) {
dumpTiles = true;
continue;
}
File file = new File(args[i]);
File file = new File(arg);
try {
TileSetBundle tsb = null;
if (args[i].endsWith(".jar")) {
if (arg.endsWith(".jar")) {
ResourceBundle bundle = new FileResourceBundle(file);
tsb = BundleUtil.extractBundle(bundle);
tsb.init(bundle);
@@ -81,7 +81,7 @@ public class DumpBundle
}
} catch (Exception e) {
System.err.println("Error dumping bundle [path=" + args[i] +
System.err.println("Error dumping bundle [path=" + arg +
", error=" + e + "].");
e.printStackTrace();
}
@@ -71,12 +71,12 @@ public class ModeUtil
// but we only add modes that meet our minimum requirements
TreeSet<DisplayMode> mset = new TreeSet<DisplayMode>(mcomp);
for (int i = 0; i < modes.length; i++) {
if (modes[i].getWidth() == width &&
modes[i].getHeight() == height &&
modes[i].getBitDepth() >= minimumDepth &&
modes[i].getRefreshRate() <= 75) {
mset.add(modes[i]);
for (DisplayMode mode : modes) {
if (mode.getWidth() == width &&
mode.getHeight() == height &&
mode.getBitDepth() >= minimumDepth &&
mode.getRefreshRate() <= 75) {
mset.add(mode);
}
}
@@ -130,8 +130,7 @@ public class SimpleMisoSceneModel extends MisoSceneModel
public void getObjects (Rectangle region, ObjectSet set)
{
// first look for intersecting interesting objects
for (int ii = 0; ii < objectInfo.length; ii++) {
ObjectInfo info = objectInfo[ii];
for (ObjectInfo info : objectInfo) {
if (region.contains(info.x, info.y)) {
set.insert(info);
}
@@ -81,8 +81,7 @@ public class SimpleMisoSceneWriter implements NestableWriter
}
// write our uninteresting object tile information
for (int ii = 0; ii < model.objectInfo.length; ii++) {
ObjectInfo info = model.objectInfo[ii];
for (ObjectInfo info : model.objectInfo) {
AttributesImpl attrs = new AttributesImpl();
attrs.addAttribute("", "tileId", "", "",
String.valueOf(info.tileId));
@@ -96,8 +96,8 @@ public class SparseMisoSceneWriter implements NestableWriter
}
// write our interesting object tile information
for (int ii = 0; ii < sect.objectInfo.length; ii++) {
writeInterestingObject(sect.objectInfo[ii], writer);
for (ObjectInfo element : sect.objectInfo) {
writeInterestingObject(element, writer);
}
writer.endElement("objects");
writer.endElement("section");
@@ -154,13 +154,13 @@ public class Handler extends URLStreamHandler
String[] bits = StringUtil.split(query, "&");
int width = -1, height = -1, tidx = -1;
try {
for (int ii = 0; ii < bits.length; ii++) {
if (bits[ii].startsWith("width=")) {
width = Integer.parseInt(bits[ii].substring(6));
} else if (bits[ii].startsWith("height=")) {
height = Integer.parseInt(bits[ii].substring(7));
} else if (bits[ii].startsWith("tile=")) {
tidx = Integer.parseInt(bits[ii].substring(5));
for (String bit : bits) {
if (bit.startsWith("width=")) {
width = Integer.parseInt(bit.substring(6));
} else if (bit.startsWith("height=")) {
height = Integer.parseInt(bit.substring(7));
} else if (bit.startsWith("tile=")) {
tidx = Integer.parseInt(bit.substring(5));
}
}
} catch (NumberFormatException nfe) {