Example usage for java.lang Object Object

List of usage examples for java.lang Object Object

Introduction

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

Prototype

@HotSpotIntrinsicCandidate
public Object() 

Source Link

Document

Constructs a new object.

Usage

From source file:kitt.admin.service.UserService.java

/**
 * ?? ?/*from   ww w. j  a va  2 s  . co  m*/
 * @param user   
 * @return       success: true or false
 * @return       isactive: ?
 */
@Transactional
public Object doDisableEnableAccountMethod(User user) {
    int rows;
    if (user.isIsactive()) {
        rows = userMapper.editUserAccount(false, user.getSecurephone());
    } else {
        rows = userMapper.editUserAccount(true, user.getSecurephone());
    }
    if (rows == 1) {
        boolean activeStatus = userMapper.getUserById(user.getId()).isIsactive();
        return new Object() {
            public boolean isactive = activeStatus;
            public boolean success = true;
        };
    }
    throw new BusinessException("????");
}

From source file:org.openspaces.eviction.test.ClassSpecificOrderTest.java

public void assertMultiThreadedOperationsTest() {
    logger.info("assert only objects with none are left");
    Assert.assertTrue("not all objects in space are of the highest priority",
            gigaSpace.count(new Object()) == gigaSpace.count(new GoldMedal()) + 1
                    || gigaSpace.count(new Object()) == gigaSpace.count(new GoldMedal()));
}

From source file:net.sf.ehcache.StatusTest.java

/**
 * An alternate implementation that is and override of the equals in Object. This would not normally
 * be used/*from   ww w .  j  ava 2  s  .  com*/
 */
public void testObjectEqualsPerformance() {
    StopWatch stopWatch = new StopWatch();
    stopWatch.getElapsedTime();

    Object object = new Object();
    for (int i = 0; i < 10000; i++) {
        status1.equals(object);
    }
    stopWatch.getElapsedTime();
    for (int i = 0; i < 10000; i++) {
        status1.equals(object);
    }
    long objectCompareTime = stopWatch.getElapsedTime();
    LOG.info("Time to do equals(Object): " + objectCompareTime);
    assertTrue("Status compare is greater than permitted time", objectCompareTime < 25);

}

From source file:org.chaplib.TestHttpResource.java

@Before
public void setUp() throws Exception {
    uri = new URI("http://www.example.com/");
    entity = new ByteArrayEntity(new byte[] {});
    response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK, "OK");
    response.setEntity(entity);/*from   www. j a v a 2 s  .co m*/
    parsed = new Object();
    impl = new HttpResource(uri, mockHttpClient);
}

From source file:com.espertech.esper.event.bean.TestCGLibPropertyGetter.java

public void testGetter() throws Exception {
    CGLibPropertyGetter getter = makeGetter(SupportBean.class, "getIntPrimitive");
    assertEquals(10, getter.get(unitTestBean));

    getter = makeGetter(SupportBean.class, "getTheString");
    assertEquals("a", getter.get(unitTestBean));

    getter = makeGetter(SupportBean.class, "getDoubleBoxed");
    assertEquals(null, getter.get(unitTestBean));

    try {/*from w  ww  .  ja  v  a2s .c o m*/
        EventBean eventBean = SupportEventBeanFactory.createObject(new Object());
        getter.get(eventBean);
        assertTrue(false);
    } catch (PropertyAccessException ex) {
        // Expected
        log.debug(".testGetter Expected exception, msg=" + ex.getMessage());
    }
}

From source file:com.teradata.benchto.service.IntegrationTestBase.java

protected void withinTransaction(Runnable runnable) {
    new TransactionTemplate(transactionManager).execute(transactionStatus -> {
        runnable.run();//from   ww  w  .  j a v  a  2  s .  com
        return new Object();
    });
}

From source file:de.r2soft.empires.framework.test.ObjectTreeTest.java

@Test
public void testNearestN() {
    Object obj1 = new Object();
    Object obj2 = new Object();
    tree.insert(new Vector2D(40, 40), obj1);
    tree.insert(new Vector2D(41, 41), obj2);
    Object[] objT = tree.nearest(new Vector2D(41, 41), 2);
    Assert.assertEquals(2, objT.length);
    Assert.assertEquals(obj1, objT[1]);/*from  ww w  . ja  va 2s .com*/
    Assert.assertEquals(obj2, objT[0]);
}

From source file:org.springmodules.cache.provider.CacheManagerFactoryBeanTests.java

public void testDestroyWithCacheManagerNotEqualToNull() throws Exception {
    factoryBean.cacheManager = new Object();
    factoryBean.destroy();/*from  w  w  w. j  a v a  2  s  .co m*/
    assertTrue(factoryBean.cacheManagerDestroyed);
}

From source file:fi.solita.phantomrunner.jetty.PhantomWebSocketHandler.java

public JsonNode sendMessageToConnections(String msg) {
    try {/*from   w w  w .  j a  v  a2  s .co  m*/
        final Object requestLock = new Object();
        final AtomicReference<JsonNode> result = new AtomicReference<JsonNode>();

        synchronized (socketLock) {
            if (socket.get() == null) {
                // wait for 10 secs for the socket to open
                socketLock.wait(TimeUnit.SECONDS.toMillis(10));
            }
        }

        if (socket.get() == null) {
            throw new PhantomWebSocketException("No open websocket connection available, cannot send message");
        }

        try {
            socket.get().send(msg, new PhantomMessageListener() {
                @Override
                public void message(JsonNode readTree) {
                    synchronized (requestLock) {
                        result.set(readTree);
                        requestLock.notifyAll();
                    }
                }
            });
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }

        synchronized (requestLock) {
            requestLock.wait(10000);
        }

        return result.get();
    } catch (InterruptedException ie) {
        throw new RuntimeException(ie);
    }
}

From source file:A.java

public void print() {
    class C { // local class
    }/*from ww  w. j a  v  a  2  s  . c o  m*/
    Object d = new Object() {
        // anonymous inner class
    };
    System.out.println("Here are an A, a B, a C, and d.");
    System.out.println(this + " " + new B() + " " + new C() + " " + d);
    new B().print();
}