com.tc.util.Assert.assertNull()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(224)

本文整理了Java中com.tc.util.Assert.assertNull()方法的一些代码示例,展示了Assert.assertNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertNull()方法的具体详情如下:
包路径:com.tc.util.Assert
类名称:Assert
方法名:assertNull

Assert.assertNull介绍

[英]If o is non-null, throw assertion error
[中]如果o为非null,则抛出断言错误

代码示例

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
 public ServerLockContext setNext(ServerLockContext next) {
  Assert.assertNull(next);
  return null;
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

/**
 * If o is non-null, throw assertion error
 *
 * @param o Object
 */
public static void assertNull(Object o) {
 assertNull("object", o);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

/**
 * If o is non-null, throw assertion error
 *
 * @param o Object
 */
public static void assertNull(Object o) {
 assertNull("object", o);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

private static void addMapping(Map<String, LiteralValues> map, String className, LiteralValues type) {
 LiteralValues prev = map.put(className, type);
 Assert.assertNull(className, prev);
}

代码示例来源:origin: org.terracotta.toolkit/terracotta-toolkit-1.3-impl

synchronized void initialize(Comparator<? super Element> comparator) {
 Assert.assertNull(present);
 Assert.assertNull(localSet);
 present = new HashMap<Object, Element>();
 localSet = new TreeSet<Element>(comparator);
 applyPending();
 initialized = true;
}

代码示例来源:origin: org.terracotta.toolkit/terracotta-toolkit-1.4-impl

synchronized void initialize(Comparator<? super Element> comparator) {
 Assert.assertNull(present);
 Assert.assertNull(localSet);
 present = new HashMap<Object, Element>();
 localSet = new TreeSet<Element>(comparator);
 applyPending();
 initialized = true;
}

代码示例来源:origin: org.terracotta/terracotta-ee

private void validateOldLock(ServerLock lock) {
 if (oldLock != null) {
  Assert.assertSame(oldLock, lock);
 } else {
  Assert.assertNull(lock);
 }
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public void attachNewConnection(TCConnectionEvent closeEvent, TCConnection oldConnection, TCConnection newConnection) {
 Assert.assertNull(oldConnection);
 wireNewConnection(newConnection);
}

代码示例来源:origin: org.terracotta/terracotta-l1

@Override
public void attachNewConnection(TCConnectionEvent closeEvent, TCConnection oldConnection, TCConnection newConnection) {
 Assert.assertNull(oldConnection);
 wireNewConnection(newConnection);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
public void attachNewConnection(TCConnectionEvent closeEvent, TCConnection oldConnection, TCConnection newConnection) {
 Assert.assertNull(oldConnection);
 wireNewConnection(newConnection);
}

代码示例来源:origin: org.terracotta/terracotta-l1

private synchronized void addStage(String name, Stage s) {
 Object prev = stages.put(name, s);
 Assert.assertNull(prev);
 s.getSink().enableStatsCollection(MONITOR);
 stageNames = stages.keySet().toArray(new String[stages.size()]);
 Arrays.sort(stageNames);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

private synchronized void addStage(String name, Stage s) {
 Object prev = stages.put(name, s);
 Assert.assertNull(prev);
 s.getSink().enableStatsCollection(MONITOR);
 stageNames = stages.keySet().toArray(new String[stages.size()]);
 Arrays.sort(stageNames);
}

代码示例来源:origin: org.terracotta/terracotta-ee

private synchronized void addStage(String name, Stage s) {
 Object prev = stages.put(name, s);
 Assert.assertNull(prev);
 s.getSink().enableStatsCollection(MONITOR);
 stageNames = stages.keySet().toArray(new String[stages.size()]);
 Arrays.sort(stageNames);
}

代码示例来源:origin: org.terracotta/terracotta-ee

void open() throws IOException {
 Assert.assertNull(in);
 if (logger.isDebugEnabled()) {
  char sep = File.separatorChar;
  logger.debug("Opening file for read: [" + cachename + sep + indexId + sep + luceneFileName + "]");
 }
 this.in = coordinator.getIndexFile(cachename, indexId, luceneFileName);
 this.isZeroLength = in.available() == 0;
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public void setupNodes(Node local, Node[] nodes) {
 this.local = local;
 for (Node node : nodes) {
  DiscoveryStateMachine stateMachine = new DiscoveryStateMachine(node);
  DiscoveryStateMachine old = nodeStateMap.put(getNodeName(node), stateMachine);
  Assert.assertNull("Duplicate nodes specified in config, please check " + getNodeName(node), old);
  stateMachine.start();
 }
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
public Set<NodeID> getNodesWithObject(final ObjectID id) {
 final GroupID gid = getGroupID(id);
 final ThreadID thisThread = this.threadIDManager.getThreadID();
 final ClusterMetaDataManagerImpl manager = getClusterMetaDataManager(gid);
 Assert.assertNull(this.threadManagerMap.put(thisThread, manager));
 return manager.getNodesWithObject(id);
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public Set<NodeID> getNodesWithObject(final ObjectID id) {
 final GroupID gid = getGroupID(id);
 final ThreadID thisThread = this.threadIDManager.getThreadID();
 final ClusterMetaDataManagerImpl manager = getClusterMetaDataManager(gid);
 Assert.assertNull(this.threadManagerMap.put(thisThread, manager));
 return manager.getNodesWithObject(id);
}

代码示例来源:origin: org.terracotta/terracotta-ee

synchronized void initiateIndexSync() throws IOException {
 Assert.assertTrue(this.state == SYNC_STARTED);
 Assert.assertNull(currentSyncFile);
 nextSyncFile();
 sendData();
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public GroupResponse sendAllAndWaitForResponse(GroupMessage msg, Set nodeIDs) throws GroupException {
 debugInfo("Sending to ALL and Waiting for Response : " + msg.getMessageID());
 GroupResponseImpl groupResponse = new GroupResponseImpl(this);
 MessageID msgID = msg.getMessageID();
 GroupResponse old = pendingRequests.put(msgID, groupResponse);
 Assert.assertNull(old);
 groupResponse.sendAll(msg, nodeIDs);
 groupResponse.waitForResponses(getNodeID());
 pendingRequests.remove(msgID);
 return groupResponse;
}

代码示例来源:origin: org.terracotta/terracotta-ee

private ManagedObjectSyncContext getSomeObjectsToSyncContext(final int count) {
 Assert.assertTrue(this.state == SYNC_STARTED);
 Assert.assertNull(this.syncingContext);
 if (isRootsMissing()) { return getMissingRootsSynccontext(); }
 final ObjectIDSet oids = new ObjectIDSet();
 addSomeMissingObjectIDsTo(oids, count);
 this.syncingContext = new ManagedObjectSyncContext(this.nodeID, oids, !this.missingOids.isEmpty(),
                           this.totalObjectsToSync, this.totalObjectsSynced,
                           this.sessionId);
 return this.syncingContext;
}

相关文章