diff options
author | renanse <[email protected]> | 2012-12-19 17:30:05 -0600 |
---|---|---|
committer | renanse <[email protected]> | 2012-12-19 17:30:05 -0600 |
commit | 580b097cb031ee97180849736f66b1c60fe515e1 (patch) | |
tree | a328d685d4141e6a05f84962dead09f5af93f836 | |
parent | d38661526216e2efe7e1d8abf01cf8d4f21fe53a (diff) |
Various audit cleanup suggestions.
26 files changed, 135 insertions, 137 deletions
diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java index 811c65b..c8d8439 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java @@ -979,7 +979,7 @@ public class ColladaAnimUtils { String accessorString = targetString.substring(accessorIndex, targetString.length()); accessorString = accessorString.replace(".", ""); - if (accessorString.startsWith("(")) { + if (accessorString.length() > 0 && accessorString.charAt(0) == '(') { int endPara = accessorString.indexOf(")"); final String indexXString = accessorString.substring(1, endPara); target.accessorIndexX = Integer.parseInt(indexXString); @@ -1104,46 +1104,46 @@ public class ColladaAnimUtils { private static void getElementString(final Element e, final StringBuilder str, final int depth, final int maxDepth, final boolean showDots) { addSpacing(str, depth); - str.append("<"); + str.append('<'); str.append(e.getName()); - str.append(" "); + str.append(' '); final List<Attribute> attrs = e.getAttributes(); for (int i = 0; i < attrs.size(); i++) { final Attribute attr = attrs.get(i); str.append(attr.getName()); str.append("=\""); str.append(attr.getValue()); - str.append("\""); + str.append('"'); if (i < attrs.size() - 1) { - str.append(" "); + str.append(' '); } } if (!e.getChildren().isEmpty() || !"".equals(e.getText())) { - str.append(">"); + str.append('>'); if (depth < maxDepth) { - str.append("\n"); + str.append('\n'); for (final Element child : (List<Element>) e.getChildren()) { getElementString(child, str, depth + 1, maxDepth, showDots); } if (!"".equals(e.getText())) { addSpacing(str, depth + 1); str.append(e.getText()); - str.append("\n"); + str.append('\n'); } } else if (showDots) { - str.append("\n"); + str.append('\n'); addSpacing(str, depth + 1); str.append("..."); - str.append("\n"); + str.append('\n'); } addSpacing(str, depth); str.append("</"); str.append(e.getName()); - str.append(">"); + str.append('>'); } else { str.append("/>"); } - str.append("\n"); + str.append('\n'); } private static void addSpacing(final StringBuilder str, final int depth) { diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java index 28728fd..73287c6 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java @@ -110,7 +110,7 @@ public class ColladaDOMUtil { } private String parseUrl(String baseUrl) { - if (baseUrl.startsWith("#")) { + if (baseUrl.length() > 1 && baseUrl.charAt(0) == '#') { baseUrl = baseUrl.substring(1); } return baseUrl; diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java index 9621973..75704ec 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java @@ -142,7 +142,7 @@ public class ColladaInputPipe { } // String paramType = param.getAttributeValue("type"); } - if (_paramCount > 1 && skippedParam == true) { + if (_paramCount > 1 && skippedParam) { ColladaInputPipe.logger.warning("Parameter skipping not yet supported when parsing sources. " + _source.getAttributeValue("id")); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java index dca8689..70e8c1c 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/input/ControllerState.java @@ -75,11 +75,11 @@ public class ControllerState { for (final String controllerStateKey : _controllerStates.keySet()) {
final Map<String, Float> state = _controllerStates.get(controllerStateKey);
- stateString.append("[").append(controllerStateKey);
+ stateString.append('[').append(controllerStateKey);
for (final String stateKey : state.keySet()) {
- stateString.append("[").append(stateKey).append(":").append(state.get(stateKey)).append("]");
+ stateString.append('[').append(stateKey).append(':').append(state.get(stateKey)).append(']');
}
- stateString.append("]");
+ stateString.append(']');
}
return stateString.toString();
diff --git a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java index 5b93988..4f8773f 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java +++ b/ardor3d-core/src/main/java/com/ardor3d/scenegraph/shape/Tube.java @@ -20,12 +20,6 @@ import com.ardor3d.util.geom.BufferUtils; public class Tube extends Mesh { - private static final long serialVersionUID = 1L; - - public static long getSerialVersionUID() { - return serialVersionUID; - } - private int _axisSamples; private int _radialSamples; @@ -137,43 +131,43 @@ public class Tube extends Mesh { // outer cylinder for (int radialCount = 0; radialCount < _radialSamples + 1; radialCount++) { for (int axisCount = 0; axisCount < _axisSamples + 1; axisCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _outerRadius)).put( - (float) (axisStep * axisCount - halfHeight)).put( - (float) (sin[radialCount % _radialSamples] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _outerRadius)) + .put((float) (axisStep * axisCount - halfHeight)) + .put((float) (sin[radialCount % _radialSamples] * _outerRadius)); if (_viewInside) { - _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0).put( - (float) sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0) + .put((float) sin[radialCount % _radialSamples]); } else { - _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0).put( - (float) -sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0) + .put((float) -sin[radialCount % _radialSamples]); } - _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)).put( - (float) (axisTextureStep * axisCount)); + _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)) + .put((float) (axisTextureStep * axisCount)); } } // inner cylinder for (int radialCount = 0; radialCount < _radialSamples + 1; radialCount++) { for (int axisCount = 0; axisCount < _axisSamples + 1; axisCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _innerRadius)).put( - (float) (axisStep * axisCount - halfHeight)).put( - (float) (sin[radialCount % _radialSamples] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount % _radialSamples] * _innerRadius)) + .put((float) (axisStep * axisCount - halfHeight)) + .put((float) (sin[radialCount % _radialSamples] * _innerRadius)); if (_viewInside) { - _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0).put( - (float) -sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) -cos[radialCount % _radialSamples]).put(0) + .put((float) -sin[radialCount % _radialSamples]); } else { - _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0).put( - (float) sin[radialCount % _radialSamples]); + _meshData.getNormalBuffer().put((float) cos[radialCount % _radialSamples]).put(0) + .put((float) sin[radialCount % _radialSamples]); } - _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)).put( - (float) (axisTextureStep * axisCount)); + _meshData.getTextureCoords(0).getBuffer().put((float) (radialCount * inverseRadial)) + .put((float) (axisTextureStep * axisCount)); } } // bottom edge for (int radialCount = 0; radialCount < _radialSamples; radialCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) -halfHeight).put( - (float) (sin[radialCount] * _outerRadius)); - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) -halfHeight).put( - (float) (sin[radialCount] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) -halfHeight) + .put((float) (sin[radialCount] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) -halfHeight) + .put((float) (sin[radialCount] * _innerRadius)); if (_viewInside) { _meshData.getNormalBuffer().put(0).put(1).put(0); _meshData.getNormalBuffer().put(0).put(1).put(0); @@ -181,17 +175,17 @@ public class Tube extends Mesh { _meshData.getNormalBuffer().put(0).put(-1).put(0); _meshData.getNormalBuffer().put(0).put(-1).put(0); } - _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])).put( - (float) (0.5 + 0.5 * sin[radialCount])); + _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])) + .put((float) (0.5 + 0.5 * sin[radialCount])); _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + innerOuterRatio * 0.5 * cos[radialCount])) .put((float) (0.5 + innerOuterRatio * 0.5 * sin[radialCount])); } // top edge for (int radialCount = 0; radialCount < _radialSamples; radialCount++) { - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) halfHeight).put( - (float) (sin[radialCount] * _outerRadius)); - _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) halfHeight).put( - (float) (sin[radialCount] * _innerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _outerRadius)).put((float) halfHeight) + .put((float) (sin[radialCount] * _outerRadius)); + _meshData.getVertexBuffer().put((float) (cos[radialCount] * _innerRadius)).put((float) halfHeight) + .put((float) (sin[radialCount] * _innerRadius)); if (_viewInside) { _meshData.getNormalBuffer().put(0).put(-1).put(0); _meshData.getNormalBuffer().put(0).put(-1).put(0); @@ -199,8 +193,8 @@ public class Tube extends Mesh { _meshData.getNormalBuffer().put(0).put(1).put(0); _meshData.getNormalBuffer().put(0).put(1).put(0); } - _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])).put( - (float) (0.5 + 0.5 * sin[radialCount])); + _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + 0.5 * cos[radialCount])) + .put((float) (0.5 + 0.5 * sin[radialCount])); _meshData.getTextureCoords(0).getBuffer().put((float) (0.5 + innerOuterRatio * 0.5 * cos[radialCount])) .put((float) (0.5 + innerOuterRatio * 0.5 * sin[radialCount])); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java b/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java index 9e9e343..9d5991e 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java +++ b/ardor3d-core/src/main/java/com/ardor3d/ui/text/BMFont.java @@ -234,7 +234,7 @@ public class BMFont implements Savable { xml.append(_info.padding[i]);
if (i < (_info.padding.length - 1)) {
- xml.append(",");
+ xml.append(',');
}
}
@@ -244,7 +244,7 @@ public class BMFont implements Savable { xml.append(_info.spacing[i]);
if (i < (_info.spacing.length - 1)) {
- xml.append(",");
+ xml.append(',');
}
}
@@ -859,7 +859,7 @@ public class BMFont implements Savable { void setUseBlend(final boolean blend) {
_useBlend = blend;
- if (blend == false) {
+ if (!_useBlend) {
blendState.setBlendEnabled(false);
blendState.setReference(_blendDisabledTestRef);
zBuffState.setWritable(true);
diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java b/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java index 3ae77d5..0aab109 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/GameTaskQueue.java @@ -54,7 +54,7 @@ public class GameTaskQueue { */ public void setExecuteMultiple(final boolean executeMultiple) { _executeMultiple.set(executeMultiple); - if (executeMultiple == true) { + if (executeMultiple) { _executionTime = Integer.MAX_VALUE; } } @@ -79,7 +79,7 @@ public class GameTaskQueue { * @return -1 if executeAll is false, else min time allocated for task execution per frame */ public long getExecutionTime() { - if (_executeMultiple.get() == false) { + if (!_executeMultiple.get()) { return -1; } return _executionTime; diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java index b07df78..ce2e9c7 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMOutputCapsule.java @@ -86,7 +86,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final byte b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -105,9 +105,9 @@ public class DOMOutputCapsule implements OutputCapsule { for (final byte[] bs : value) { for (final byte b : bs) { buf.append(b); - buf.append(" "); + buf.append(' '); } - buf.append(" "); + buf.append(' '); } // remove last spaces buf.setLength(buf.length() - 2); @@ -137,7 +137,7 @@ public class DOMOutputCapsule implements OutputCapsule { for (final int b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(Math.max(0, buf.length() - 1)); @@ -180,7 +180,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final float b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -203,7 +203,7 @@ public class DOMOutputCapsule implements OutputCapsule { for (final float[] bs : value) { for (final float b : bs) { buf.append(b); - buf.append(" "); + buf.append(' '); } } // remove last space @@ -230,7 +230,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final double b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -273,7 +273,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final long b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -316,7 +316,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final short b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(buf.length() - 1); @@ -359,7 +359,7 @@ public class DOMOutputCapsule implements OutputCapsule { } for (final boolean b : value) { buf.append(b); - buf.append(" "); + buf.append(' '); } // remove last space buf.setLength(Math.max(0, buf.length() - 1)); @@ -439,7 +439,7 @@ public class DOMOutputCapsule implements OutputCapsule { final StringBuilder buf = new StringBuilder(); for (int i = value.nextSetBit(0); i >= 0; i = value.nextSetBit(i + 1)) { buf.append(i); - buf.append(" "); + buf.append(' '); } buf.setLength(Math.max(0, buf.length() - 1)); _currentElement.setAttribute(name, buf.toString()); @@ -680,7 +680,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(Math.max(0, buf.length() - 1)); value.position(pos); @@ -703,7 +703,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); @@ -726,7 +726,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); @@ -749,7 +749,7 @@ public class DOMOutputCapsule implements OutputCapsule { value.rewind(); while (value.hasRemaining()) { buf.append(value.get()); - buf.append(" "); + buf.append(' '); } buf.setLength(buf.length() - 1); value.position(pos); diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java index eef7b79..34000f0 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/export/xml/DOMSerializer.java @@ -53,7 +53,7 @@ public class DOMSerializer { public void setIndent(final int numSpaces) { final StringBuffer buffer = new StringBuffer(); for (int i = 0; i < numSpaces; i++) { - buffer.append("\t"); + buffer.append('\t'); } _indent = buffer.toString(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java index ebe13ca..6017a8b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/BufferUtils.java @@ -1683,13 +1683,13 @@ public final class BufferUtils { if (store == null) { store = new StringBuilder(); } - store.append("Existing buffers: ").append(bufs.size()).append("\n"); + store.append("Existing buffers: ").append(bufs.size()).append('\n'); store.append("(b: ").append(bBufs).append(" f: ").append(fBufs).append(" i: ").append(iBufs).append(" s: ") - .append(sBufs).append(" d: ").append(dBufs).append(")").append("\n"); + .append(sBufs).append(" d: ").append(dBufs).append(')').append('\n'); store.append("Total direct memory held: ").append(totalHeld / 1024).append("kb\n"); store.append("(b: ").append(bBufsM / 1024).append("kb f: ").append(fBufsM / 1024).append("kb i: ") .append(iBufsM / 1024).append("kb s: ").append(sBufsM / 1024).append("kb d: ").append(dBufsM / 1024) - .append("kb)").append("\n"); + .append("kb)").append('\n'); if (printStout) { System.out.println(store.toString()); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java b/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java index aa9d32a..35c4a41 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/geom/NormalGenerator.java @@ -723,7 +723,7 @@ public class NormalGenerator { for (int i = 0; i < 3; i++) { final Edge edge = edges[i]; if (edge == null) { - result.append("?"); + result.append('?'); } else { if (edge.newI0 > -1) { result.append(edge.newI0); @@ -735,7 +735,7 @@ public class NormalGenerator { result.append(", "); } } - result.append(")"); + result.append(')'); return result.toString(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java b/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java index 359c158..bd32181 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java +++ b/ardor3d-core/src/main/java/com/ardor3d/util/stat/graph/TabledLabelGrapher.java @@ -239,7 +239,7 @@ public class TabledLabelGrapher extends AbstractStatGrapher { final StringBuilder format = new StringBuilder(decimals > 0 ? "0.0" : "0"); for (int x = 1; x < decimals; x++) { - format.append("0"); + format.append('0'); } return new DecimalFormat(format.toString()).format(val) + post; diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/AnimationEntry.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/AnimationEntry.java index 56e5121..13d2554 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/AnimationEntry.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/AnimationEntry.java @@ -75,7 +75,7 @@ public class AnimationEntry implements Savable { final StringBuilder sb = new StringBuilder(); for (final int frame : frames) { sb.append(frame); - sb.append(","); + sb.append(','); } return sb.substring(0, sb.length() - 1); } diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java index 351470e..aa41a49 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/ParticleSystem.java @@ -46,8 +46,6 @@ import com.ardor3d.util.geom.BufferUtils; public abstract class ParticleSystem extends Node {
private static final Logger logger = Logger.getLogger(ParticleSystem.class.getName());
- protected static final long serialVersionUID = 2L;
-
public enum ParticleType {
Quad, Triangle, Point, Line, GeomMesh;
}
diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/RampEntry.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/RampEntry.java index 2e014d7..690532a 100644 --- a/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/RampEntry.java +++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/effect/particle/RampEntry.java @@ -166,7 +166,7 @@ public class RampEntry implements Savable { builder.append(convColorToHex(_color).toUpperCase()); builder.append(" a: "); builder.append((int) (_color.getAlpha() * 100)); - builder.append("%"); + builder.append('%'); } if (_size != DEFAULT_SIZE) { diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/ExampleRunner.java b/ardor3d-examples/src/main/java/com/ardor3d/example/ExampleRunner.java index d60f204..32f638a 100644 --- a/ardor3d-examples/src/main/java/com/ardor3d/example/ExampleRunner.java +++ b/ardor3d-examples/src/main/java/com/ardor3d/example/ExampleRunner.java @@ -642,7 +642,8 @@ public class ExampleRunner extends JFrame { * @see FileFilter
*/
public boolean accept(final File pathname) {
- return (pathname.isDirectory() && !pathname.getName().startsWith("."))
+ return (pathname.isDirectory() && (pathname.getName().length() == 0 || pathname.getName()
+ .charAt(0) != '.'))
|| (pathname.getName().endsWith(".class") && pathname.getName().indexOf('$') < 0);
}
};
@@ -661,7 +662,7 @@ public class ExampleRunner extends JFrame { if (name.endsWith(".class") && name.indexOf('$') < 0) {
String classname = name.substring(0, name.length() - ".class".length());
- if (classname.startsWith("/")) {
+ if (classname.length() > 0 && classname.charAt(0) == '/') {
classname = classname.substring(1);
}
classname = classname.replace('/', '.');
diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/ScenegraphTree.java b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/ScenegraphTree.java index b1d78aa..38612f2 100644 --- a/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/ScenegraphTree.java +++ b/ardor3d-examples/src/main/java/com/ardor3d/example/pipeline/ScenegraphTree.java @@ -70,27 +70,27 @@ public class ScenegraphTree { str.append(spatial.getName()); str.append(" - "); - str.append(spatial.getClass().getName()).append("\n"); + str.append(spatial.getClass().getName()).append('\n'); if (spatial instanceof Mesh) { final Mesh mesh = (Mesh) spatial; str.append("Primitives: "); - str.append(mesh.getMeshData().getTotalPrimitiveCount()).append("\n"); + str.append(mesh.getMeshData().getTotalPrimitiveCount()).append('\n'); str.append("Index mode: "); - str.append(mesh.getMeshData().getIndexMode(0)).append("\n"); + str.append(mesh.getMeshData().getIndexMode(0)).append('\n'); } - str.append(spatial.getTransform()).append("\n"); + str.append(spatial.getTransform()).append('\n'); if (spatial.getWorldBound() != null) { - str.append(spatial.getWorldBound()).append("\n"); + str.append(spatial.getWorldBound()).append('\n'); } - str.append("\n"); + str.append('\n'); final SceneHints sceneHints = spatial.getSceneHints(); str.append("Cull hint: "); - str.append(sceneHints.getCullHint()).append("\n"); + str.append(sceneHints.getCullHint()).append('\n'); str.append("Bucket: "); - str.append(sceneHints.getRenderBucketType()).append("\n"); + str.append(sceneHints.getRenderBucketType()).append('\n'); textArea.setText(str.toString()); } diff --git a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java index 0cfc59a..e41cae6 100644 --- a/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java +++ b/ardor3d-extras/src/main/java/com/ardor3d/extension/model/obj/ObjImporter.java @@ -151,7 +151,7 @@ public class ObjImporter { } // ignore comments. goto next line - if (line.startsWith("#")) { + if (line.length() > 0 && line.charAt(0) == '#') { continue; } @@ -421,7 +421,7 @@ public class ObjImporter { } // ignore comments. goto next line - if (line.startsWith("#") || line.length() == 0) { + if (line.length() == 0 || line.charAt(0) == '#') { continue; } diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/ColorRGBA.java b/ardor3d-math/src/main/java/com/ardor3d/math/ColorRGBA.java index ea11e50..a6879cd 100644 --- a/ardor3d-math/src/main/java/com/ardor3d/math/ColorRGBA.java +++ b/ardor3d-math/src/main/java/com/ardor3d/math/ColorRGBA.java @@ -443,19 +443,19 @@ public class ColorRGBA implements Cloneable, Savable, Externalizable, ReadOnlyCo final String blue = Integer.toHexString(Math.round(MathUtils.clamp(getBlue(), 0f, 1f) * 255)); final String alpha = Integer.toHexString(Math.round(MathUtils.clamp(getAlpha(), 0f, 1f) * 255)); if (red.length() < 2) { - sb.append("0"); + sb.append('0'); } sb.append(red); if (green.length() < 2) { - sb.append("0"); + sb.append('0'); } sb.append(green); if (blue.length() < 2) { - sb.append("0"); + sb.append('0'); } sb.append(blue); if (alpha.length() < 2) { - sb.append("0"); + sb.append('0'); } sb.append(alpha); return sb.toString(); @@ -995,7 +995,7 @@ public class ColorRGBA implements Cloneable, Savable, Externalizable, ReadOnlyCo } // XXX: should we parse words too? eg 'red'... - if (!colorString.startsWith("#")) { + if (colorString.length() == 0 || colorString.charAt(0) != '#') { throw new IllegalArgumentException("must start with #."); } diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/FastMath.java b/ardor3d-math/src/main/java/com/ardor3d/math/FastMath.java index 6ef29eb..0b45885 100644 --- a/ardor3d-math/src/main/java/com/ardor3d/math/FastMath.java +++ b/ardor3d-math/src/main/java/com/ardor3d/math/FastMath.java @@ -83,7 +83,7 @@ public enum FastMath { /** inverseSqrt: (0,‚àû) -> (0,‚àû) **/ public final static double inverseSqrt(double x) { final double xhalves = 0.5d * x; - x = Double.longBitsToDouble(0x5FE6EB50C7B537AAl - (Double.doubleToRawLongBits(x) >> 1)); + x = Double.longBitsToDouble(0x5FE6EB50C7B537AAL - (Double.doubleToRawLongBits(x) >> 1)); return x * (1.5d - xhalves * x * x); // more iterations possible } diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/Matrix3.java b/ardor3d-math/src/main/java/com/ardor3d/math/Matrix3.java index a13ddc4..78a9b16 100644 --- a/ardor3d-math/src/main/java/com/ardor3d/math/Matrix3.java +++ b/ardor3d-math/src/main/java/com/ardor3d/math/Matrix3.java @@ -1705,31 +1705,31 @@ public class Matrix3 implements Cloneable, Savable, Externalizable, ReadOnlyMatr @Override public String toString() { final StringBuffer result = new StringBuffer("com.ardor3d.math.Matrix3\n[\n"); - result.append(" "); + result.append(' '); result.append(_m00); - result.append(" "); + result.append(' '); result.append(_m01); - result.append(" "); + result.append(' '); result.append(_m02); result.append(" \n"); - result.append(" "); + result.append(' '); result.append(_m10); - result.append(" "); + result.append(' '); result.append(_m11); - result.append(" "); + result.append(' '); result.append(_m12); result.append(" \n"); - result.append(" "); + result.append(' '); result.append(_m20); - result.append(" "); + result.append(' '); result.append(_m21); - result.append(" "); + result.append(' '); result.append(_m22); result.append(" \n"); - result.append("]"); + result.append(']'); return result.toString(); } diff --git a/ardor3d-math/src/main/java/com/ardor3d/math/Matrix4.java b/ardor3d-math/src/main/java/com/ardor3d/math/Matrix4.java index 9b2131f..8d21433 100644 --- a/ardor3d-math/src/main/java/com/ardor3d/math/Matrix4.java +++ b/ardor3d-math/src/main/java/com/ardor3d/math/Matrix4.java @@ -2099,47 +2099,47 @@ public class Matrix4 implements Cloneable, Savable, Externalizable, ReadOnlyMatr @Override public String toString() { final StringBuffer result = new StringBuffer("com.ardor3d.math.Matrix4\n[\n"); - result.append(" "); + result.append(' '); result.append(_m00); - result.append(" "); + result.append(' '); result.append(_m01); - result.append(" "); + result.append(' '); result.append(_m02); - result.append(" "); + result.append(' '); result.append(_m03); result.append(" \n"); - result.append(" "); + result.append(' '); result.append(_m10); - result.append(" "); + result.append(' '); result.append(_m11); - result.append(" "); + result.append(' '); result.append(_m12); - result.append(" "); + result.append(' '); result.append(_m13); result.append(" \n"); - result.append(" "); + result.append(' '); result.append(_m20); - result.append(" "); + result.append(' '); result.append(_m21); - result.append(" "); + result.append(' '); result.append(_m22); - result.append(" "); + result.append(' '); result.append(_m23); result.append(" \n"); - result.append(" "); + result.append(' '); result.append(_m30); - result.append(" "); + result.append(' '); result.append(_m31); - result.append(" "); + result.append(' '); result.append(_m32); - result.append(" "); + result.append(' '); result.append(_m33); result.append(" \n"); - result.append("]"); + result.append(']'); return result.toString(); } diff --git a/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRGB.java b/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRGB.java index 13f530c..887a85c 100644 --- a/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRGB.java +++ b/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRGB.java @@ -12,8 +12,6 @@ package com.ardor3d.extension.terrain.util; import org.junit.Test; -import com.ardor3d.extension.terrain.util.IntColorUtils; - public class TestRGB { @Test public void testLerp() throws Exception { diff --git a/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRegion.java b/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRegion.java index 4e1c700..66f3345 100644 --- a/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRegion.java +++ b/ardor3d-terrain/src/test/java/com/ardor3d/extension/terrain/util/TestRegion.java @@ -14,8 +14,6 @@ import junit.framework.Assert; import org.junit.Test; -import com.ardor3d.extension.terrain.util.Region; - public class TestRegion { @Test public void testIntersects() throws Exception { diff --git a/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/text/parser/ForumLikeMarkupParser.java b/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/text/parser/ForumLikeMarkupParser.java index 405ff5b..6afa78f 100644 --- a/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/text/parser/ForumLikeMarkupParser.java +++ b/ardor3d-ui/src/main/java/com/ardor3d/extension/ui/text/parser/ForumLikeMarkupParser.java @@ -51,13 +51,13 @@ public class ForumLikeMarkupParser implements StyleParser { index++; continue; } else { - rVal.append("\\"); + rVal.append('\\'); rVal.append(token); index += token.length() + 1; continue; } } else { - rVal.append("\\"); + rVal.append('\\'); index++; continue; } @@ -138,9 +138,9 @@ public class ForumLikeMarkupParser implements StyleParser { endSpan(StyleConstants.KEY_FAMILY, store, index, buildingSpans); } else { // not really a tag, so put it back. - rVal.append("["); + rVal.append('['); rVal.append(currTagText); - rVal.append("]"); + rVal.append(']'); tagStatus = TagStatus.NONE; } diff --git a/trunk/ardor3d-examples/ardorSettings.properties b/trunk/ardor3d-examples/ardorSettings.properties new file mode 100644 index 0000000..e3686ea --- /dev/null +++ b/trunk/ardor3d-examples/ardorSettings.properties @@ -0,0 +1,9 @@ +#Game Settings written by com.ardor3d.example.PropertiesGameSettings at Sun Nov 18 22:22:52 CST 2012
+#Sun Nov 18 22:22:52 CST 2012
+SAMPLES=0
+FREQ=-1
+WIDTH=1024
+RENDERER=JOGL
+HEIGHT=768
+DEPTH=24
+FULLSCREEN=false
|