List of usage examples for java.lang Object Object
@HotSpotIntrinsicCandidate
public Object()
From source file:ivorius.ivtoolkit.rendering.grid.BlockQuadCache.java
public static GridQuadCache<?> createQuadCache(final IvBlockCollection blockCollection, float[] scale) { final Object handle = new Object(); final int[] size = { blockCollection.width, blockCollection.height, blockCollection.length }; return GridQuadCache.createQuadCache(size, scale, new Function<Pair<BlockCoord, ForgeDirection>, Object>() { @Nullable/*from w w w. jav a2s.c om*/ @Override public Object apply(Pair<BlockCoord, ForgeDirection> input) { Block block = blockCollection.getBlock(input.getLeft()); return block.isOpaqueCube() && blockCollection.shouldRenderSide(input.getLeft(), input.getRight()) ? handle : null; } }); }
From source file:InterruptibleSyncBlock.java
public InterruptibleSyncBlock() { longLock = new Object(); busyLock = new BooleanLock(false); }
From source file:Main.java
public void run() { while (true) { data.addElement(new Object()); if (data.size() > 1000) data.removeAllElements();/* ww w. j a v a2 s. c o m*/ } }
From source file:Main.java
private static void dispatchEventsUntilNow() { if (java.awt.EventQueue.isDispatchThread() && !isDispatching) { isDispatching = true;// w ww . j a v a 2 s . c om try { int handled = 0; java.awt.EventQueue eventQ = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue(); class StopEvent extends AWTEvent { StopEvent() { super(new Object(), 0); } } eventQ.postEvent(new StopEvent()); while (true) { try { AWTEvent event = eventQ.getNextEvent(); if (event instanceof StopEvent) { break; } if (event instanceof ActiveEvent) { ((ActiveEvent) event).dispatch(); } else { Object source = event.getSource(); if (source instanceof Component) { Component comp = (Component) source; comp.dispatchEvent(event); } } handled++; } catch (InterruptedException e) { //hmm } } // Debug.trace("####dispatchEventsUntilNow handeld "+(handled)+" events"); } finally { isDispatching = false; } } }
From source file:com.job.portal.utils.BeanUtils.java
public static JSONObject convertToJSON(Object bean) { JSONObject obj = new JSONObject(); try {// ww w . j av a 2s. c o m for (Field field : bean.getClass().getDeclaredFields()) { field.setAccessible(true); // You might want to set modifier to public first. Object value = field.get(bean); if (value != null) { obj.put(field.getName(), value); } } } catch (Exception e) { LogOut.log.error("In " + new Object() { }.getClass().getEnclosingClass().getName() + "." + new Object() { }.getClass().getEnclosingMethod().getName() + " " + e); } return obj; }
From source file:org.a3badran.platform.logging.LogMethods.java
@LogRequest("hasReturnType") public Object hasReturnType() { return new Object(); }
From source file:mockit.integration.logging.MoreLoggingIntegrationsTest.java
@Test public void jdkLoggingShouldLogNothing() { Logger log1 = Logger.getAnonymousLogger(); log1.entering("testing that logger does nothing", "method"); log1.exiting("testing that logger does nothing", "method", new Object()); }
From source file:Volatile.java
public void run() { print("entering run()"); // each time, check to see if 'value' is different while (value < 20) { // Used to break out of the loop if change to // value is missed. if (missedIt) { int currValue = value; // Simply execute a synchronized statement on an // arbitrary object to see the effect. Object lock = new Object(); synchronized (lock) { // do nothing! }//w ww. j a v a2 s.c om int valueAfterSync = value; print("in run() - see value=" + currValue + ", but rumor has it that it changed!"); print("in run() - valueAfterSync=" + valueAfterSync); break; } } print("leaving run()"); }
From source file:nl.mok.mastersofcode.spectatorclient.controllers.IndexController.java
@RequestMapping(method = RequestMethod.GET) public ModelAndView showIndex(final HttpServletRequest request) { ModelAndView mav = new ModelAndView(); mav.addObject("page", new Object() { public String uri = "/spec/"; public String redirect = request.getRequestURL().toString(); });//from w w w .j av a 2 s . c om mav.addObject("competitions", DataController.getCompetitions()); mav.addObject("currentCompetition", DataController.getCurrentCompetition()); mav.addObject("currentRound", DataController.getCurrentRound()); mav.setViewName("index.twig"); return mav; }
From source file:com.bsb.cms.commons.utils.URLUtils.java
/** * ?class path// w w w . j a v a 2 s. c om * @return */ public static String getCLassPath() { String classpath = null; try { URL url = new Object() { }.getClass().getResource("/properties/log4j.properties"); classpath = (new File(url.getFile())).getParentFile().getAbsolutePath(); } catch (Exception e) { e.printStackTrace(); } return classpath; }