Example usage for java.lang Thread dumpStack

List of usage examples for java.lang Thread dumpStack

Introduction

In this page you can find the example usage for java.lang Thread dumpStack.

Prototype

public static void dumpStack() 

Source Link

Document

Prints a stack trace of the current thread to the standard error stream.

Usage

From source file:org.openflexo.foundation.resource.ResourceManager.java

public void registerResource(FlexoResource<?> resource) {
    if (!resources.contains(resource)) {
        resources.add(resource);/*from w  w  w .jav a 2s  . co m*/
        getServiceManager().notify(this, new ResourceRegistered(resource, null));
    } else {
        logger.info("Resource already registered: " + resource);
    }
    if (resource.getURI() == null) {
        logger.info("Une resource avec une URI null: " + resource);
        Thread.dumpStack();
    }
}

From source file:org.spout.engine.filesystem.WorldFiles.java

@SuppressWarnings("unchecked")
private static SpoutEntity loadEntityImpl(World w, CompoundTag tag, String name) {
    CompoundMap map = tag.getValue();/*from ww  w  .ja  va  2s.  co m*/

    @SuppressWarnings("unused")
    byte version = SafeCast.toByte(NBTMapper.toTagValue(map.get("version")), (byte) 0);
    boolean player = SafeCast.toByte(NBTMapper.toTagValue(map.get("player")), (byte) 0) == 1;

    //Read entity
    Float pX = SafeCast.toFloat(NBTMapper.toTagValue(map.get("posX")), Float.MAX_VALUE);
    Float pY = SafeCast.toFloat(NBTMapper.toTagValue(map.get("posY")), Float.MAX_VALUE);
    Float pZ = SafeCast.toFloat(NBTMapper.toTagValue(map.get("posZ")), Float.MAX_VALUE);

    if (pX == Float.MAX_VALUE || pY == Float.MAX_VALUE || pZ == Float.MAX_VALUE) {
        return null;
    }

    float sX = SafeCast.toFloat(NBTMapper.toTagValue(map.get("scaleX")), 1.0F);
    float sY = SafeCast.toFloat(NBTMapper.toTagValue(map.get("scaleY")), 1.0F);
    float sZ = SafeCast.toFloat(NBTMapper.toTagValue(map.get("scaleZ")), 1.0F);

    float qX = SafeCast.toFloat(NBTMapper.toTagValue(map.get("quatX")), 0.0F);
    float qY = SafeCast.toFloat(NBTMapper.toTagValue(map.get("quatY")), 0.0F);
    float qZ = SafeCast.toFloat(NBTMapper.toTagValue(map.get("quatZ")), 0.0F);
    float qW = SafeCast.toFloat(NBTMapper.toTagValue(map.get("quatW")), 1.0F);

    long msb = SafeCast.toLong(NBTMapper.toTagValue(map.get("UUID_msb")), new Random().nextLong());
    long lsb = SafeCast.toLong(NBTMapper.toTagValue(map.get("UUID_lsb")), new Random().nextLong());
    UUID uid = new UUID(msb, lsb);

    int view = SafeCast.toInt(NBTMapper.toTagValue(map.get("view")), 0);
    boolean observer = SafeCast
            .toGeneric(NBTMapper.toTagValue(map.get("observer")), new ByteTag("", (byte) 0), ByteTag.class)
            .getBooleanValue();

    //Setup data
    boolean controllerDataExists = SafeCast.toGeneric(NBTMapper.toTagValue(map.get("controller_data_exists")),
            new ByteTag("", (byte) 0), ByteTag.class).getBooleanValue();
    byte[] dataMap = null;
    if (controllerDataExists) {
        dataMap = SafeCast.toByteArray(NBTMapper.toTagValue(map.get("controller_data")), new byte[0]);
    }

    //Setup entity
    Region r = w.getRegionFromBlock(Math.round(pX), Math.round(pY), Math.round(pZ),
            player ? LoadOption.LOAD_GEN : LoadOption.NO_LOAD);
    if (r == null) {
        // TODO - this should never happen - entities should be located in the chunk that was just loaded
        Spout.getLogger().info("Attempted to load entity to unloaded region");
        Thread.dumpStack();
        return null;
    }
    final Transform t = new Transform(new Point(r.getWorld(), pX, pY, pZ),
            new Quaternion(qX, qY, qZ, qW, false), new Vector3(sX, sY, sZ));

    ListTag<StringTag> components = (ListTag<StringTag>) map.get("components");
    List<Class<? extends Component>> types = new ArrayList<Class<? extends Component>>(
            components.getValue().size());
    for (StringTag component : components.getValue()) {
        try {
            try {
                Class<? extends Component> clazz = (Class<? extends Component>) CommonClassLoader
                        .findPluginClass(component.getValue());
                types.add(clazz);
            } catch (ClassNotFoundException e) {
                Class<? extends Component> clazz = (Class<? extends Component>) Class
                        .forName(component.getValue());
                types.add(clazz);
            }
        } catch (ClassNotFoundException e) {
            Spout.getLogger().log(Level.SEVERE, "Unable to find component class " + component.getValue(), e);
        }
    }

    SpoutEntity e;
    if (!player) {
        e = new SpoutEntity(t, view, uid, false, dataMap, types.toArray(new Class[types.size()]));
        e.setObserver(observer);
    } else {
        e = new SpoutPlayer(name, t, view, uid, false, dataMap, types.toArray(new Class[types.size()]));
    }

    return e;
}

From source file:org.structr.rest.resource.Resource.java

public RestMethodResult doHead() throws FrameworkException {
    Thread.dumpStack();
    throw new IllegalStateException("Resource.doHead() called, this should not happen.");
}

From source file:rlVizLib.messaging.BinaryPayload.java

public String getAsEncodedString() {
    alreadyEncoded = true;//from  w w  w  . j  av  a2s  .  c om
    try {
        theOutputStream.close();
        byte[] theStringBytes = BOS.toByteArray();
        byte[] b64encoded = Base64.encodeBase64(theStringBytes);
        String theBytesAsString = new String(b64encoded);
        return theBytesAsString;
    } catch (IOException ex) {
        System.err.println("Problem closing the output stream." + ex);
        Thread.dumpStack();
        System.exit(1);
    }
    return null;
}