Changed a bunch of Thread.dumpStack() calls into stack traces properly logged

via the logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@788 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2009-03-24 18:46:59 +00:00
parent fdfa3aa2e5
commit 8f6e10af8f
12 changed files with 37 additions and 50 deletions
+8 -4
View File
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry excluding="**/.svn/|com/threerings/jme/" kind="src" output="dist/classes" path="src/java"/> <classpathentry excluding="**/.svn/**" kind="src" output="dist/classes" path="src/java"/>
<classpathentry excluding="**/.svn/|com/threerings/jme/" kind="src" output="tests/dist/classes" path="tests/src/java"/> <classpathentry excluding="**/.svn/**" kind="src" output="tests/dist/classes" path="tests/src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/narya"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/xml-writer.jar"/> <classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/xml-writer.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jogg-0.0.7.jar"/> <classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jogg-0.0.7.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jorbis-0.0.15.jar"/> <classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jorbis-0.0.15.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/lwjgl/lwjgl.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jl1.0.jar"/> <classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jl1.0.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jme/jme.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jme/jme-effects.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/jme/jme-model.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/lwjgl/lwjgl.jar"/>
<classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/lwjgl/lwjgl_util.jar"/> <classpathentry exported="true" kind="var" path="EXT_LIBS_DIR/lwjgl/lwjgl_util.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/narya"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/jme-bui"/>
</classpath> </classpath>
@@ -129,8 +129,7 @@ public class CharacterSprite extends ImageSprite
{ {
// sanity check // sanity check
if (action == null) { if (action == null) {
log.warning("Refusing to set null action sequence " + this + "."); log.warning("Refusing to set null action sequence " + this + ".", new Exception());
Thread.dumpStack();
return; return;
} }
@@ -147,8 +146,7 @@ public class CharacterSprite extends ImageSprite
{ {
if (orient < 0 || orient >= FINE_DIRECTION_COUNT) { if (orient < 0 || orient >= FINE_DIRECTION_COUNT) {
log.info("Refusing to set invalid orientation [sprite=" + this + log.info("Refusing to set invalid orientation [sprite=" + this +
", orient=" + orient + "]."); ", orient=" + orient + "].", new Exception());
Thread.dumpStack();
return; return;
} }
@@ -285,8 +283,7 @@ public class CharacterSprite extends ImageSprite
if (_descrip.getComponentIds() == null || if (_descrip.getComponentIds() == null ||
_descrip.getComponentIds().length == 0) { _descrip.getComponentIds().length == 0) {
log.warning("Invalid character descriptor [sprite=" + this + log.warning("Invalid character descriptor [sprite=" + this +
", descrip=" + _descrip + "]."); ", descrip=" + _descrip + "].", new Exception());
Thread.dumpStack();
} }
} }
+2 -2
View File
@@ -202,8 +202,8 @@ public class GeomUtil
public static Rectangle grow (Rectangle source, Rectangle target) public static Rectangle grow (Rectangle source, Rectangle target)
{ {
if (target == null) { if (target == null) {
log.warning("Can't grow with null rectangle [src=" + source + ", tgt=" + target + "]."); log.warning("Can't grow with null rectangle [src=" + source + ", tgt=" + target + "].",
Thread.dumpStack(); new Exception());
} else if (source == null) { } else if (source == null) {
source = new Rectangle(target); source = new Rectangle(target);
} else { } else {
@@ -162,8 +162,7 @@ public class Sprite extends Node
{ {
if (_path == null) { if (_path == null) {
log.warning("pathCompleted() called on pathless sprite " + log.warning("pathCompleted() called on pathless sprite " +
"(re-completed?) [sprite=" + this + "]."); "(re-completed?) [sprite=" + this + "].", new Exception());
Thread.dumpStack();
return; return;
} }
@@ -128,8 +128,7 @@ public abstract class AbstractMediaManager
public void fastForward (long timeDelta) public void fastForward (long timeDelta)
{ {
if (_tickStamp > 0) { if (_tickStamp > 0) {
log.warning("Egads! Asked to fastForward() during a tick."); log.warning("Egads! Asked to fastForward() during a tick.", new Exception());
Thread.dumpStack();
} }
for (int ii = 0, nn = _media.size(); ii < nn; ii++) { for (int ii = 0, nn = _media.size(); ii < nn; ii++) {
@@ -165,8 +164,7 @@ public abstract class AbstractMediaManager
public void renderOrderDidChange (AbstractMedia media) public void renderOrderDidChange (AbstractMedia media)
{ {
if (_tickStamp > 0) { if (_tickStamp > 0) {
log.warning("Egads! Render order changed during a tick."); log.warning("Egads! Render order changed during a tick.", new Exception());
Thread.dumpStack();
} }
_media.remove(media); _media.remove(media);
@@ -193,8 +191,8 @@ public abstract class AbstractMediaManager
protected boolean insertMedia (AbstractMedia media) protected boolean insertMedia (AbstractMedia media)
{ {
if (_media.contains(media)) { if (_media.contains(media)) {
log.warning("Attempt to insert media more than once [media=" + media + "]."); log.warning("Attempt to insert media more than once [media=" + media + "].",
Thread.dumpStack(); new Exception());
return false; return false;
} }
@@ -256,8 +254,7 @@ public abstract class AbstractMediaManager
protected void clearMedia () protected void clearMedia ()
{ {
if (_tickStamp > 0) { if (_tickStamp > 0) {
log.warning("Egads! Requested to clearMedia() during a tick."); log.warning("Egads! Requested to clearMedia() during a tick.", new Exception());
Thread.dumpStack();
} }
for (int ii = _media.size() - 1; ii >= 0; ii--) { for (int ii = _media.size() - 1; ii >= 0; ii--) {
@@ -289,7 +286,8 @@ public abstract class AbstractMediaManager
} }
/** Used to sort media by render order. */ /** Used to sort media by render order. */
protected static final Comparator<AbstractMedia> RENDER_ORDER = new Comparator<AbstractMedia>() { protected static final Comparator<AbstractMedia> RENDER_ORDER =
new Comparator<AbstractMedia>() {
public int compare (AbstractMedia am1, AbstractMedia am2) { public int compare (AbstractMedia am1, AbstractMedia am2) {
return am1.renderCompareTo(am2); return am1.renderCompareTo(am2);
} }
@@ -298,8 +298,7 @@ public class MediaPanel extends JComponent
public void setOpaque (boolean opaque) public void setOpaque (boolean opaque)
{ {
if (!opaque) { if (!opaque) {
log.warning("Media panels shouldn't be setOpaque(false)."); log.warning("Media panels shouldn't be setOpaque(false).", new Exception());
Thread.dumpStack();
} }
super.setOpaque(true); super.setOpaque(true);
} }
@@ -435,8 +434,7 @@ public class MediaPanel extends JComponent
Rectangle clip = dirty[ii]; Rectangle clip = dirty[ii];
// sanity-check the dirty rectangle // sanity-check the dirty rectangle
if (clip == null) { if (clip == null) {
log.warning("Found null dirty rect painting media panel?!"); log.warning("Found null dirty rect painting media panel?!", new Exception());
Thread.dumpStack();
continue; continue;
} }
@@ -68,14 +68,13 @@ public class RegionManager
{ {
// make sure we're on an AWT thread // make sure we're on an AWT thread
if (!EventQueue.isDispatchThread()) { if (!EventQueue.isDispatchThread()) {
log.warning("Oi! Region dirtied on non-AWT thread [rect=" + rect + "]."); log.warning("Oi! Region dirtied on non-AWT thread [rect=" + rect + "].",
Thread.dumpStack(); new Exception());
} }
// sanity check // sanity check
if (rect == null) { if (rect == null) {
log.warning("Attempt to dirty a null rect!?"); log.warning("Attempt to dirty a null rect!?", new Exception());
Thread.dumpStack();
return; return;
} }
@@ -98,8 +97,7 @@ public class RegionManager
{ {
if (width < 0 || height < 0) { if (width < 0 || height < 0) {
log.warning("Attempt to add invalid dirty region?! " + log.warning("Attempt to add invalid dirty region?! " +
"[size=" + width + "x" + height + "]."); "[size=" + width + "x" + height + "].", new Exception());
Thread.dumpStack();
return false; return false;
} else if (width == 0 || height == 0) { } else if (width == 0 || height == 0) {
@@ -382,8 +382,7 @@ public class ColorPository implements Serializable
return crec; return crec;
} }
} }
log.warning("No such color class [class=" + className + "]."); log.warning("No such color class [class=" + className + "].", new Exception());
Thread.dumpStack();
return null; return null;
} }
@@ -397,10 +396,8 @@ public class ColorPository implements Serializable
// if they request color class zero, we assume they're just // if they request color class zero, we assume they're just
// decoding a blank colorprint, otherwise we complain // decoding a blank colorprint, otherwise we complain
if (classId != 0) { if (classId != 0) {
log.warning("Requested unknown color class " + log.warning("Requested unknown color class [classId=" + classId +
"[classId=" + classId + ", colorId=" + colorId + "].", new Exception());
", colorId=" + colorId + "].");
Thread.dumpStack();
} }
return null; return null;
} }
@@ -414,9 +411,8 @@ public class ColorPository implements Serializable
{ {
ClassRecord record = getClassRecord(className); ClassRecord record = getClassRecord(className);
if (record == null) { if (record == null) {
log.warning("Requested unknown color class " + log.warning("Requested unknown color class [className=" + className +
"[className=" + className + ", colorName=" + colorName + "]."); ", colorName=" + colorName + "].", new Exception());
Thread.dumpStack();
return null; return null;
} }
@@ -323,8 +323,8 @@ public abstract class TileSet
if (tileIndex >= 0 && tileIndex < tcount) { if (tileIndex >= 0 && tileIndex < tcount) {
return true; return true;
} else { } else {
log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "]."); log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].",
Thread.dumpStack(); new Exception());
return false; return false;
} }
} }
@@ -38,8 +38,7 @@ public abstract class TimedPath implements Path
// sanity check some things // sanity check some things
if (duration <= 0) { if (duration <= 0) {
log.warning("Requested path with illegal duration (<=0) " + log.warning("Requested path with illegal duration (<=0) " +
"[duration=" + duration + "]"); "[duration=" + duration + "]", new Exception());
Thread.dumpStack();
duration = 1; // assume something short but non-zero duration = 1; // assume something short but non-zero
} }
@@ -51,8 +51,7 @@ public class ObjectSet
// log a warning because the caller shouldn't be doing this // log a warning because the caller shouldn't be doing this
log.warning("Requested to add an object to a set that already " + log.warning("Requested to add an object to a set that already " +
"contains such an object [ninfo=" + info + "contains such an object [ninfo=" + info +
", oinfo=" + _objs[ipos] + "]."); ", oinfo=" + _objs[ipos] + "].", new Exception());
Thread.dumpStack();
return false; return false;
} }
@@ -138,8 +138,7 @@ public class KeyboardManager
{ {
// report incorrect usage // report incorrect usage
if (enabled && _target == null) { if (enabled && _target == null) {
log.warning("Attempt to enable uninitialized keyboard manager!"); log.warning("Attempt to enable uninitialized keyboard manager!", new Exception());
Thread.dumpStack();
return; return;
} }