当前位置: 首页>>代码示例>>Java>>正文


Java Error类代码示例

本文整理汇总了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);
}
 
开发者ID:OpenModLoader,项目名称:Enigma,代码行数:17,代码来源:SourceIndexBehaviorVisitor.java

示例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));
    }
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:22,代码来源:MessageBusAsyncSession.java

示例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() + ")"));
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:9,代码来源:MessageBusAsyncSession.java

示例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();
}
 
开发者ID:OpenSmpp,项目名称:opensmpp,代码行数:16,代码来源:TLVOctets.java

示例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();
}
 
开发者ID:OpenSmpp,项目名称:opensmpp,代码行数:15,代码来源:TLVOctets.java


注:本文中的java.lang.Error类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。