Example usage for java.lang IllegalStateException getClass

List of usage examples for java.lang IllegalStateException getClass

Introduction

In this page you can find the example usage for java.lang IllegalStateException getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testResolveTypeObjectStringClassint15() <br>
 * <br>/*from   w  w  w .j  a  v  a2  s . c o m*/
 *  <br>
 * G <br>
 * <br>
 * () bean:?Object object????getter??<br>
 * () name:"object"<br>
 * () genericClass:Object.class<br>
 * () index:1<br>
 * <br>
 * () :IllegalStateException<br>
 * "No parameterizedType was detected."<br>
 * <br>
 * ?????? IllegalStateException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testResolveTypeObjectStringClassint15() throws Exception {
    try {
        // 
        GenericPropertyUtil.resolveType(new GenericPropertyUtil_Stub01(), "object", Object.class, 1);
        // 
        fail("???????");
    } catch (IllegalStateException e) {
        assertEquals("No parameterizedType was detected.", e.getMessage());
        assertEquals(IllegalStateException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testResolveTypeClassClassTypeint02() <br>
 * <br>//from   www  .  j  a va  2  s .  co  m
 *  <br>
 * G <br>
 * <br>
 * () genericClass:List.class<br>
 * () clazz:null<br>
 * () index:0<br>
 * <br>
 * () :IllegalStateException<br>
 * genericClass+ " is not assignable from " + clazz<br>
 * <br>
 * clazz?null???IllegalStateException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testResolveTypeClassClassTypeint02() throws Exception {
    try {
        // 
        GenericPropertyUtil.resolveType(List.class, (Class<?>) null, null, 0);
        // 
        fail("???????");
    } catch (IllegalStateException e) {
        String message = List.class + " is not assignable from " + "null";
        assertEquals(message, e.getMessage());
        assertEquals(IllegalStateException.class.getName(), e.getClass().getName());
    }
}

From source file:jp.terasoluna.fw.util.GenericPropertyUtilTest.java

/**
 * testResolveTypeClassClassTypeint03() <br>
 * <br>/*from   w  w  w . j  a va2 s .c  o  m*/
 *  <br>
 * G <br>
 * <br>
 * () genericClass:List.class<br>
 * () clazz:Object.class<br>
 * () index:0<br>
 * <br>
 * () :IllegalStateException<br>
 * genericClass+ " is not assignable from " + clazz<br>
 * <br>
 * clazz?genericClass???????IllegalStateException?????? <br>
 * @throws Exception ?????
 */
@Test
public void testResolveTypeClassClassTypeint03() throws Exception {
    try {
        // 
        GenericPropertyUtil.resolveType(List.class, Object.class, null, 0);
        // 
        fail("???????");
    } catch (IllegalStateException e) {
        String message = List.class + " is not assignable from " + Object.class;
        assertEquals(message, e.getMessage());
        assertEquals(IllegalStateException.class.getName(), e.getClass().getName());
    }
}

From source file:org.tomahawk.tomahawk_android.services.PlaybackService.java

/**
 * Returns the position of playback in the current Track.
 *///from w  ww.jav  a 2s  . c  om
public int getPosition() {
    int position = 0;
    if (getCurrentQuery() != null && getCurrentQuery().getMediaPlayerInterface() != null) {
        try {
            position = getCurrentQuery().getMediaPlayerInterface().getPosition();
        } catch (IllegalStateException e) {
            Log.e(TAG, "getPosition: " + e.getClass() + ": " + e.getLocalizedMessage());
        }
    }
    return position;
}