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:com.job.portal.servlets.JobApplicationsServlet.java

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    JSONObject obj = null;/*ww  w.  j a  v a2s .  c om*/
    JSONArray arr = null;
    JobApplicationsManager jam = new JobApplicationsManager();
    try {
        String param = request.getParameter("param");
        if (param != null) {
            if (param.equalsIgnoreCase("apply")) {
                obj = jam.apply(request);
                out.print(obj);
            } else if (param.equalsIgnoreCase("showApplied")) {
                arr = jam.getAppliedJobs(request);
                out.print(arr);
            }
        }
    } catch (Exception e) {
        LogOut.log.error("In " + new Object() {
        }.getClass().getEnclosingClass().getName() + "." + new Object() {
        }.getClass().getEnclosingMethod().getName() + " " + e);
    } finally {
        out.close();
    }
}

From source file:ar.com.zauber.commons.spring.exceptions.StatusSimpleMappingExceptionHandlerTest.java

/** test */
public final void testViewNameNotString() {
    final StatusSimpleMappingExceptionHandler h = new StatusSimpleMappingExceptionHandler();
    final Properties status = new Properties();
    status.put(new Object(), "400");
    try {/*from w w w. j  a va  2 s.co m*/
        h.setStatusMappings(status);
        fail();
    } catch (IllegalArgumentException e) {
        // ok
    }
}

From source file:io.wcm.caravan.pipeline.impl.JacksonFunctionsTest.java

@Test(expected = JsonPipelineOutputException.class)
public void testObjectToString() {

    // fail with JsonPipelineInputException by providing incorrect POJO class
    JacksonFunctions.pojoToString(new Object());
}

From source file:com.hp.autonomy.frontend.find.core.web.ControllerUtilsTest.java

@Test
public void convertToJson() throws JsonProcessingException {
    final String json = controllerUtils.convertToJson(new Object() {
        private final String field = "</close_tag>";

        @SuppressWarnings("unused")
        public String getField() {
            return field;
        }// www. j av  a 2 s .  c o m
    });
    assertFalse(json.contains("</"));
}

From source file:com.job.portal.dao.JobsDAO.java

public boolean addJob(JobMaster jm) {
    boolean flag = false;
    try {//  ww w  .  j  av  a 2s.c  o m
        String query = "insert into job_master (datePosted,description,experience,"
                + "functionalArea,keywords,location,qualificationRequired,salary,title,vacancies,companyId) "
                + "values (?,?,?,?,?,?,?,?,?,?,?)";
        Object[] arr = new Object[11];
        arr[0] = new Date();
        arr[1] = jm.getDescription();
        arr[2] = jm.getExperience();
        arr[3] = jm.getFunctionalArea();
        arr[4] = jm.getKeywords();
        arr[5] = jm.getLocation();
        arr[6] = jm.getQualificationRequired();
        arr[7] = jm.getSalary();
        arr[8] = jm.getTitle();
        arr[9] = jm.getVacancies();
        arr[10] = jm.getCompanymaster();
        int id = insert(query, arr);
        if (id > -1) {
            flag = true;
        }
    } catch (Exception e) {
        LogOut.log.error("In " + new Object() {
        }.getClass().getEnclosingClass().getName() + "." + new Object() {
        }.getClass().getEnclosingMethod().getName() + " " + e);
    } finally {
        return flag;
    }
}

From source file:shiver.me.timbers.security.spring.AbstractNullSafeAuthenticationConverterTest.java

@Test
public void Can_safely_convert_non_null_principal() {

    // Given//from  www .  j av  a2  s .c  om
    final Authentication expected = mock(Authentication.class);

    // When
    final Authentication actual = new AbstractNullSafeAuthenticationConverter<Object>() {
        @Override
        public Object convert(Authentication authentication) {
            throw new UnsupportedOperationException();
        }

        @Override
        protected Authentication nullSafeConvert(Object principal) {
            return expected;
        }
    }.convert(new Object());

    // Then
    assertThat(actual, is(expected));
}

From source file:com.qrmedia.commons.collections.PairUtilsTest.java

@Test
public void toPairSetsFirstObject() {
    Object obj = new Object();
    assertEquals(obj, PairUtils.toPair(obj, null).getFirstObject());
}

From source file:io.wcm.tooling.commons.contentpackagebuilder.ValueConverterTest.java

@Test(expected = IllegalArgumentException.class)
public void testInvalid() {
    underTest.toString("prop", new Object());
}

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

@Test
public void testInsertAndSearch() {
    Object obj = new Object();
    tree.insert(new Vector2D(10, 10), obj);
    Object objT = tree.search(new Vector2D(10, 10));
    Assert.assertEquals(obj, objT);//from  w w  w . j  a  v a  2 s .  co  m
}

From source file:code.google.nfs.rpc.grizzly.serialize.GrizzlyProtocolFilter.java

public NextAction handleRead(FilterChainContext ctx) throws IOException {
    final Object message = ctx.getMessage();
    if (message instanceof IncompleteBufferHolder) {
        return ctx.getStopAction(((IncompleteBufferHolder) message).buffer);
    }//from   ww  w.j  av  a2 s .c  o m

    final Buffer buffer = (Buffer) message;

    //        final int bufferLen = buffer.remaining();
    Object errorReturnObject = new Object();
    GrizzlyByteBufferWrapper wrapper = new GrizzlyByteBufferWrapper(buffer);

    try {
        final List<Object> list = new ArrayList<Object>();
        Object object;
        while ((object = ProtocolUtils.decode(wrapper, errorReturnObject)) != errorReturnObject) {
            list.add(object);
        }

        if (list.isEmpty()) {
            return ctx.getStopAction(buffer);
        } else {
            final Buffer remainder = buffer.hasRemaining() ? buffer.split(buffer.position()) : null;
            buffer.dispose();

            ctx.setMessage(list);
            return ctx.getInvokeAction(new IncompleteBufferHolder(remainder));
        }
    } catch (Exception e) {
        LOGGER.error("decode message error", e);
        throw new IOException(e);
    }
}