Thread.dumpStack() circumvents whatever logging is configured and writes
directly to stderr. Logging an exception with the associated warning does the right thing and logs the stack trace via the logging system. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5318 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -132,8 +132,7 @@ public class PulldownFieldEditor extends FieldEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// cause shit to blow up minorly
|
// cause shit to blow up minorly
|
||||||
log.warning("Value in dobj is not settable, disabling choice.");
|
log.warning("Value in dobj is not settable, disabling choice.", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
_value.setEnabled(false);
|
_value.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,8 +175,7 @@ public class SpeakUtil
|
|||||||
public static void sendMessage (DObject speakObj, ChatMessage msg)
|
public static void sendMessage (DObject speakObj, ChatMessage msg)
|
||||||
{
|
{
|
||||||
if (speakObj == null) {
|
if (speakObj == null) {
|
||||||
log.warning("Dropping speak message, no speak obj '" + msg + "'.");
|
log.warning("Dropping speak message, no speak obj '" + msg + "'.", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,11 +122,9 @@ public class ObjectInputStream extends DataInputStream
|
|||||||
// sanity check
|
// sanity check
|
||||||
if (cmap == null) {
|
if (cmap == null) {
|
||||||
// this will help with debugging
|
// this will help with debugging
|
||||||
log.warning("Internal stream error, no class metadata [code=" + code +
|
log.warning("Internal stream error, no class metadata", "code", code,
|
||||||
", ois=" + this + "].");
|
"ois", this, new Exception());
|
||||||
Thread.dumpStack();
|
log.warning("ObjectInputStream mappings", "map", _classmap);
|
||||||
log.warning(
|
|
||||||
"ObjectInputStream mappings " + StringUtil.toString(_classmap) + ".");
|
|
||||||
String errmsg = "Read object code for which we have no registered class " +
|
String errmsg = "Read object code for which we have no registered class " +
|
||||||
"metadata [code=" + code + "]";
|
"metadata [code=" + code + "]";
|
||||||
throw new RuntimeException(errmsg);
|
throw new RuntimeException(errmsg);
|
||||||
|
|||||||
@@ -113,9 +113,8 @@ public class Streamer
|
|||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
// make sure this is a streamable class
|
// make sure this is a streamable class
|
||||||
if (!isStreamable(target)) {
|
if (!isStreamable(target)) {
|
||||||
Thread.dumpStack();
|
throw new IOException(
|
||||||
throw new IOException("Requested to stream invalid class '" +
|
"Requested to stream invalid class '" + target.getName() + "'");
|
||||||
target.getName() + "'");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a streamer for this class and cache it
|
// create a streamer for this class and cache it
|
||||||
|
|||||||
@@ -164,8 +164,7 @@ public class DObject
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.warning("Refusing subscriber that's already in the list", "dobj", which(),
|
log.warning("Refusing subscriber that's already in the list", "dobj", which(),
|
||||||
"subscriber", sub);
|
"subscriber", sub, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,8 +224,7 @@ public class DObject
|
|||||||
_listeners = els;
|
_listeners = els;
|
||||||
} else {
|
} else {
|
||||||
log.warning("Refusing repeat listener registration [dobj=" + which() +
|
log.warning("Refusing repeat listener registration [dobj=" + which() +
|
||||||
", list=" + listener + "]");
|
", list=" + listener + "]", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -802,10 +800,7 @@ public class DObject
|
|||||||
// if we're on the authoritative server, we update the set immediately
|
// if we're on the authoritative server, we update the set immediately
|
||||||
boolean alreadyApplied = false;
|
boolean alreadyApplied = false;
|
||||||
if (_omgr != null && _omgr.isManager(this)) {
|
if (_omgr != null && _omgr.isManager(this)) {
|
||||||
if (!set.add(entry)) {
|
set.add(entry);
|
||||||
// DSet will have logged a warning
|
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
|
||||||
alreadyApplied = true;
|
alreadyApplied = true;
|
||||||
}
|
}
|
||||||
// dispatch an entry added event
|
// dispatch an entry added event
|
||||||
@@ -823,8 +818,8 @@ public class DObject
|
|||||||
if (_omgr != null && _omgr.isManager(this)) {
|
if (_omgr != null && _omgr.isManager(this)) {
|
||||||
oldEntry = set.removeKey(key);
|
oldEntry = set.removeKey(key);
|
||||||
if (oldEntry == null) {
|
if (oldEntry == null) {
|
||||||
log.warning("Requested to remove non-element", "set", name, "key", key);
|
log.warning("Requested to remove non-element", "set", name, "key", key,
|
||||||
Thread.dumpStack();
|
new Exception());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// dispatch an entry removed event
|
// dispatch an entry removed event
|
||||||
@@ -850,7 +845,8 @@ public class DObject
|
|||||||
if (_omgr != null && _omgr.isManager(this)) {
|
if (_omgr != null && _omgr.isManager(this)) {
|
||||||
oldEntry = set.update(entry);
|
oldEntry = set.update(entry);
|
||||||
if (oldEntry == null) {
|
if (oldEntry == null) {
|
||||||
Thread.dumpStack();
|
log.warning("Set update had no old entry", "name", name, "entry", entry,
|
||||||
|
new Exception());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// dispatch an entry updated event
|
// dispatch an entry updated event
|
||||||
|
|||||||
@@ -210,8 +210,7 @@ public class DSet<E extends DSet.Entry>
|
|||||||
{
|
{
|
||||||
// the crazy sanity checks
|
// the crazy sanity checks
|
||||||
if (_size < 0 || _size > _entries.length || (_size > 0 && _entries[_size-1] == null)) {
|
if (_size < 0 || _size > _entries.length || (_size > 0 && _entries[_size-1] == null)) {
|
||||||
log.warning("DSet in a bad way", "size", _size, "entries", _entries);
|
log.warning("DSet in a bad way", "size", _size, "entries", _entries, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Iterator<E>() {
|
return new Iterator<E>() {
|
||||||
@@ -232,8 +231,7 @@ public class DSet<E extends DSet.Entry>
|
|||||||
}
|
}
|
||||||
if (_ssize != _size) {
|
if (_ssize != _size) {
|
||||||
log.warning("Size changed during iteration", "ssize", _ssize, "nsize", _size,
|
log.warning("Size changed during iteration", "ssize", _ssize, "nsize", _size,
|
||||||
"entries", _entries);
|
"entries", _entries, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected int _index = 0;
|
protected int _index = 0;
|
||||||
@@ -282,7 +280,8 @@ public class DSet<E extends DSet.Entry>
|
|||||||
|
|
||||||
// if the element is already in the set, bail now
|
// if the element is already in the set, bail now
|
||||||
if (eidx >= 0) {
|
if (eidx >= 0) {
|
||||||
log.warning("Refusing to add duplicate entry [entry=" + elem + ", set=" + this + "].");
|
log.warning("Refusing to add duplicate entry", "entry", elem, "set", this,
|
||||||
|
new Exception());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,8 +293,8 @@ public class DSet<E extends DSet.Entry>
|
|||||||
if (_size >= elength) {
|
if (_size >= elength) {
|
||||||
// sanity check
|
// sanity check
|
||||||
if (elength > 2048) {
|
if (elength > 2048) {
|
||||||
log.warning("Requested to expand to questionably large size [l=" + elength + "].");
|
log.warning("Requested to expand to questionably large size", "l", elength,
|
||||||
Thread.dumpStack();
|
new Exception());
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new array and copy our data into it
|
// create a new array and copy our data into it
|
||||||
@@ -340,8 +339,7 @@ public class DSet<E extends DSet.Entry>
|
|||||||
{
|
{
|
||||||
// don't fail, but generate a warning if we're passed a null key
|
// don't fail, but generate a warning if we're passed a null key
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
log.warning("Requested to remove null key.");
|
log.warning("Requested to remove null key.", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -306,8 +306,8 @@ public class ClientManager
|
|||||||
{
|
{
|
||||||
ClientObject clobj = _objmap.get(username);
|
ClientObject clobj = _objmap.get(username);
|
||||||
if (clobj == null) {
|
if (clobj == null) {
|
||||||
log.warning("Requested to release unmapped client object [username=" + username + "].");
|
log.warning("Requested to release unmapped client object", "username", username,
|
||||||
Thread.dumpStack();
|
new Exception());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,8 +334,8 @@ public class ClientManager
|
|||||||
{
|
{
|
||||||
ClientObject clobj = _objmap.remove(oldname);
|
ClientObject clobj = _objmap.remove(oldname);
|
||||||
if (clobj == null) {
|
if (clobj == null) {
|
||||||
log.warning("Requested to rename unmapped client object [username=" + oldname + "].");
|
log.warning("Requested to rename unmapped client object", "username", oldname,
|
||||||
Thread.dumpStack();
|
new Exception());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_objmap.put(newname, clobj);
|
_objmap.put(newname, clobj);
|
||||||
@@ -409,8 +409,7 @@ public class ClientManager
|
|||||||
client.connectionFailed(fault);
|
client.connectionFailed(fault);
|
||||||
|
|
||||||
} else if (!(conn instanceof AuthingConnection)) {
|
} else if (!(conn instanceof AuthingConnection)) {
|
||||||
log.info("Unmapped connection failed? [conn=" + conn + ", fault=" + fault + "].");
|
log.info("Unmapped connection failed?", "conn", conn, "fault", fault, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,15 +165,13 @@ public class InvocationManager
|
|||||||
_omgr.requireEventThread(); // sanity check
|
_omgr.requireEventThread(); // sanity check
|
||||||
|
|
||||||
if (marsh == null) {
|
if (marsh == null) {
|
||||||
log.warning("Refusing to unregister null marshaller.");
|
log.warning("Refusing to unregister null marshaller.", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_dispatchers.remove(marsh.getInvocationCode()) == null) {
|
if (_dispatchers.remove(marsh.getInvocationCode()) == null) {
|
||||||
log.warning("Requested to remove unregistered marshaller? " +
|
log.warning("Requested to remove unregistered marshaller? " +
|
||||||
"[marsh=" + marsh + "].");
|
"[marsh=" + marsh + "].", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.presents.server;
|
package com.threerings.presents.server;
|
||||||
|
|
||||||
import com.samskivert.util.StringUtil;
|
|
||||||
|
|
||||||
import com.threerings.presents.client.InvocationReceiver.Registration;
|
import com.threerings.presents.client.InvocationReceiver.Registration;
|
||||||
import com.threerings.presents.data.ClientObject;
|
import com.threerings.presents.data.ClientObject;
|
||||||
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
import com.threerings.presents.dobj.InvocationNotificationEvent;
|
||||||
@@ -57,14 +55,13 @@ public abstract class InvocationSender
|
|||||||
// specific client
|
// specific client
|
||||||
Registration rreg = target.receivers.get(receiverCode);
|
Registration rreg = target.receivers.get(receiverCode);
|
||||||
if (rreg == null) {
|
if (rreg == null) {
|
||||||
log.warning("Unable to locate receiver for invocation service notification " +
|
log.warning("Unable to locate receiver for invocation service notification",
|
||||||
"[clobj=" + target.who() + ", code=" + receiverCode +
|
"clobj", target.who(), "code", receiverCode, "methId", methodId,
|
||||||
", methId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
"args", args, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Log.info("Sending notification [target=" + target + ", code=" + receiverCode +
|
// log.info("Sending notification", "target", target, "code", receiverCode,
|
||||||
// ", methodId=" + methodId + ", args=" + StringUtil.toString(args) + "].");
|
// "methodId", methodId, "args", args);
|
||||||
|
|
||||||
// create and dispatch an invocation notification event
|
// create and dispatch an invocation notification event
|
||||||
target.postEvent(
|
target.postEvent(
|
||||||
|
|||||||
@@ -874,8 +874,8 @@ public class PresentsClient
|
|||||||
public void eventReceived (DEvent event)
|
public void eventReceived (DEvent event)
|
||||||
{
|
{
|
||||||
if (event instanceof PresentsDObjectMgr.AccessObjectEvent) {
|
if (event instanceof PresentsDObjectMgr.AccessObjectEvent) {
|
||||||
log.warning("Ignoring event that shouldn't be forwarded " + event + ".");
|
log.warning("Ignoring event that shouldn't be forwarded " + event + ".",
|
||||||
Thread.dumpStack();
|
new Exception());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,9 +218,8 @@ public class PresentsDObjectMgr
|
|||||||
public <T extends DObject> T registerObject (T object)
|
public <T extends DObject> T registerObject (T object)
|
||||||
{
|
{
|
||||||
if (_dobjThread != null && !isDispatchThread()) {
|
if (_dobjThread != null && !isDispatchThread()) {
|
||||||
log.warning("Registering DObject on non-dobject thread: " +
|
log.warning("Registering DObject on non-dobject thread",
|
||||||
"[class=" + object.getClass().getName() + "]");
|
"class", object.getClass().getName(), new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int oid = getNextOid();
|
int oid = getNextOid();
|
||||||
|
|||||||
@@ -166,8 +166,7 @@ public abstract class Connection implements NetEventHandler
|
|||||||
{
|
{
|
||||||
// we shouldn't be closed twice
|
// we shouldn't be closed twice
|
||||||
if (isClosed()) {
|
if (isClosed()) {
|
||||||
log.warning("Attempted to re-close connection " + this + ".");
|
log.warning("Attempted to re-close connection " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,8 +185,7 @@ public abstract class Connection implements NetEventHandler
|
|||||||
{
|
{
|
||||||
// if we're already closed, then something is seriously funny
|
// if we're already closed, then something is seriously funny
|
||||||
if (isClosed()) {
|
if (isClosed()) {
|
||||||
log.warning("Failure reported on closed connection " + this + ".");
|
log.warning("Failure reported on closed connection " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -847,16 +847,14 @@ public class ConnectionManager extends LoopingThread
|
|||||||
{
|
{
|
||||||
// sanity check
|
// sanity check
|
||||||
if (conn == null || msg == null) {
|
if (conn == null || msg == null) {
|
||||||
log.warning("postMessage() bogosity [conn=" + conn + ", msg=" + msg + "].");
|
log.warning("postMessage() bogosity", "conn", conn, "msg", msg, new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// more sanity check; messages must only be posted from the dobjmgr thread
|
// more sanity check; messages must only be posted from the dobjmgr thread
|
||||||
if (!_omgr.isDispatchThread()) {
|
if (!_omgr.isDispatchThread()) {
|
||||||
log.warning("Message posted on non-distributed object thread [conn=" + conn +
|
log.warning("Message posted on non-distributed object thread", "conn", conn,
|
||||||
", msg=" + msg + ", thread=" + Thread.currentThread() + "].");
|
"msg", msg, "thread", Thread.currentThread(), new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
// let it through though as we don't want to break things unnecessarily
|
// let it through though as we don't want to break things unnecessarily
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,8 +76,7 @@ public class SafeSubscriber<T extends DObject>
|
|||||||
public void subscribe (DObjectManager omgr)
|
public void subscribe (DObjectManager omgr)
|
||||||
{
|
{
|
||||||
if (_active) {
|
if (_active) {
|
||||||
log.warning("Active safesub asked to resubscribe " + this + ".");
|
log.warning("Active safesub asked to resubscribe " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,8 +87,7 @@ public class SafeSubscriber<T extends DObject>
|
|||||||
// logically impossible)
|
// logically impossible)
|
||||||
if (_object != null) {
|
if (_object != null) {
|
||||||
log.warning("Incroyable! A safesub has an object and was " +
|
log.warning("Incroyable! A safesub has an object and was " +
|
||||||
"non-active!? " + this + ".");
|
"non-active!? " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
// make do in the face of insanity
|
// make do in the face of insanity
|
||||||
_subscriber.objectAvailable(_object);
|
_subscriber.objectAvailable(_object);
|
||||||
return;
|
return;
|
||||||
@@ -125,8 +123,7 @@ public class SafeSubscriber<T extends DObject>
|
|||||||
if (_object == null && !_pending) {
|
if (_object == null && !_pending) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.warning("Inactive safesub asked to unsubscribe " + this + ".");
|
log.warning("Inactive safesub asked to unsubscribe " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// note that we no longer desire to be subscribed
|
// note that we no longer desire to be subscribed
|
||||||
@@ -136,8 +133,7 @@ public class SafeSubscriber<T extends DObject>
|
|||||||
// make sure we don't have an object reference
|
// make sure we don't have an object reference
|
||||||
if (_object != null) {
|
if (_object != null) {
|
||||||
log.warning("Incroyable! A safesub has an object and is " +
|
log.warning("Incroyable! A safesub has an object and is " +
|
||||||
"pending!? " + this + ".");
|
"pending!? " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
} else {
|
} else {
|
||||||
// nothing to do but wait for the subscription to complete
|
// nothing to do but wait for the subscription to complete
|
||||||
// at which point we'll pitch the object post-haste
|
// at which point we'll pitch the object post-haste
|
||||||
@@ -148,8 +144,7 @@ public class SafeSubscriber<T extends DObject>
|
|||||||
// make sure we have our object
|
// make sure we have our object
|
||||||
if (_object == null) {
|
if (_object == null) {
|
||||||
log.warning("Zut alors! A safesub _was_ active and not " +
|
log.warning("Zut alors! A safesub _was_ active and not " +
|
||||||
"pending yet has no object!? " + this + ".");
|
"pending yet has no object!? " + this + ".", new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
// nothing to do since we're apparently already unsubscribed
|
// nothing to do since we're apparently already unsubscribed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,9 +247,7 @@ public class MessageBundle
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (reportMissing) {
|
if (reportMissing) {
|
||||||
log.warning("Missing translation message " +
|
log.warning("Missing translation message", "bundle", _path, "key", key, new Exception());
|
||||||
"[bundle=" + _path + ", key=" + key + "].");
|
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -319,9 +317,8 @@ public class MessageBundle
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.warning("Missing translation message " +
|
log.warning("Missing translation message", "bundle", _path, "key", key,
|
||||||
"[bundle=" + _path + ", key=" + key + "].");
|
new Exception());
|
||||||
Thread.dumpStack();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,10 +47,9 @@ public class TimeUtil
|
|||||||
protected static final byte MAX_UNIT = DAY;
|
protected static final byte MAX_UNIT = DAY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a translatable string specifying the magnitude of the specified
|
* Get a translatable string specifying the magnitude of the specified duration. Results will
|
||||||
* duration. Results will be between "1 second" and "X hours", with
|
* be between "1 second" and "X hours", with all times rounded to the nearest unit. "0 units"
|
||||||
* all times rounded to the nearest unit. "0 units" will never be
|
* will never be displayed, the minimum is 1.
|
||||||
* displayed, the minimum is 1.
|
|
||||||
*/
|
*/
|
||||||
public static String getTimeOrderString (long duration, byte minUnit)
|
public static String getTimeOrderString (long duration, byte minUnit)
|
||||||
{
|
{
|
||||||
@@ -58,12 +57,11 @@ public class TimeUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a translatable string specifying the magnitude of the specified
|
* Get a translatable string specifying the magnitude of the specified duration, with the units
|
||||||
* duration, with the units of time bounded between the minimum and
|
* of time bounded between the minimum and maximum specified. "0 units" will never be returned,
|
||||||
* maximum specified. "0 units" will never be returned, the minimum is 1.
|
* the minimum is 1.
|
||||||
*/
|
*/
|
||||||
public static String getTimeOrderString (
|
public static String getTimeOrderString (long duration, byte minUnit, byte maxUnit)
|
||||||
long duration, byte minUnit, byte maxUnit)
|
|
||||||
{
|
{
|
||||||
// enforce sanity
|
// enforce sanity
|
||||||
minUnit = (byte) Math.min(minUnit, maxUnit);
|
minUnit = (byte) Math.min(minUnit, maxUnit);
|
||||||
@@ -85,8 +83,7 @@ public class TimeUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a translatable string specifying the duration, down to the
|
* Get a translatable string specifying the duration, down to the minimum granularity.
|
||||||
* minimum granularity.
|
|
||||||
*/
|
*/
|
||||||
public static String getTimeString (long duration, byte minUnit)
|
public static String getTimeString (long duration, byte minUnit)
|
||||||
{
|
{
|
||||||
@@ -117,8 +114,7 @@ public class TimeUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal method to get the quantity for the specified unit.
|
* Internal method to get the quantity for the specified unit. (Not very OO)
|
||||||
* (Not very OO)
|
|
||||||
*/
|
*/
|
||||||
protected static int getQuantityPerUnit (byte unit)
|
protected static int getQuantityPerUnit (byte unit)
|
||||||
{
|
{
|
||||||
@@ -132,8 +128,7 @@ public class TimeUtil
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal method to get the translation key for the specified unit.
|
* Internal method to get the translation key for the specified unit. (Not very OO)
|
||||||
* (Not very OO)
|
|
||||||
*/
|
*/
|
||||||
protected static String getTransKey (byte unit)
|
protected static String getTransKey (byte unit)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user