本文整理汇总了Java中java.lang.Error类的典型用法代码示例。如果您正苦于以下问题:Java Error类的具体用法?Java Error怎么用?Java Error使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Error类属于java.lang包,在下文中一共展示了Error类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitMemberReferenceExpression
import java.lang.Error; //导入依赖的package包/类
@Override
public Void visitMemberReferenceExpression(MemberReferenceExpression node, SourceIndex index) {
MemberReference ref = node.getUserData(Keys.MEMBER_REFERENCE);
if (ref != null) {
// make sure this is actually a field
if (ref.getErasedSignature().indexOf('(') >= 0) {
throw new Error("Expected a field here! got " + ref);
}
ClassEntry classEntry = new ClassEntry(ref.getDeclaringType().getInternalName());
FieldEntry fieldEntry = new FieldEntry(classEntry, ref.getName(), new Type(ref.getErasedSignature()));
index.addReference(node.getMemberNameToken(), fieldEntry, this.behaviorEntry);
}
return recurse(node, index);
}
示例2: send
import java.lang.Error; //导入依赖的package包/类
/**
* A convenience method for assigning the internal trace level and route string to a message before sending it
* through the internal mbus session object.
*
* @param msg The message to send.
* @return The document api result object.
*/
public Result send(Message msg) {
try {
long reqId = requestId.incrementAndGet();
msg.setContext(reqId);
msg.getTrace().setLevel(traceLevel);
if (route != null) {
return toResult(reqId, session.send(msg, route, true));
} else {
return toResult(reqId, session.send(msg));
}
} catch (Exception e) {
return new Result(Result.ResultType.FATAL_ERROR, new Error(e.getMessage(), e));
}
}
示例3: toResult
import java.lang.Error; //导入依赖的package包/类
private static Result toResult(long reqId, com.yahoo.messagebus.Result mbusResult) {
if (mbusResult.isAccepted()) {
return new Result(reqId);
}
return new Result(
messageBusErrorToResultType(mbusResult.getError().getCode()),
new Error(mbusResult.getError().getMessage() + " (" + mbusResult.getError().getCode() + ")"));
}
示例4: setValueData
import java.lang.Error; //导入依赖的package包/类
protected void setValueData(ByteBuffer buffer) throws TLVException {
checkLength(buffer);
if (buffer != null) {
try {
value = buffer.removeBuffer(buffer.length());
} catch (NotEnoughDataInByteBufferException e) {
throw new Error(
"Removing buf.length() data from ByteBuffer buf "
+ "reported too little data in buf, which shouldn't happen.");
}
} else {
value = null;
}
markValueSet();
}
示例5: setValue
import java.lang.Error; //导入依赖的package包/类
public void setValue(ByteBuffer p_value) {
if (p_value != null) {
try {
value = p_value.removeBuffer(p_value.length());
} catch (NotEnoughDataInByteBufferException e) {
throw new Error(
"Removing buf.length() data from ByteBuffer buf "
+ "reported too little data in buf, which shouldn't happen.");
}
} else {
value = null;
}
markValueSet();
}